diff --git a/.clang-format b/.clang-format index 2a9205219a..04e0284f97 100644 --- a/.clang-format +++ b/.clang-format @@ -7,28 +7,33 @@ AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right AlignOperands: false AlignTrailingComments: false +AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true AllowShortFunctionsOnASingleLine: None +AllowShortLambdasOnASingleLine: None AlwaysBreakAfterReturnType: None AlwaysBreakTemplateDeclarations: true BreakBeforeBraces: Custom BraceWrapping: AfterClass: true + AfterControlStatement: true AfterEnum: true AfterFunction: true AfterNamespace: true + BeforeLambdaBody: true AfterStruct: true - SplitEmptyFunction: true - AfterControlStatement: true BeforeElse: true + SplitEmptyFunction: true BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma ColumnLimit: 140 ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true +Cpp11BracedListStyle: false FixNamespaceComments: true IncludeBlocks: Preserve +IndentCaseBlocks: true IndentCaseLabels: false IndentPPDirectives: None IndentWidth: 4 @@ -38,27 +43,17 @@ NamespaceIndentation: All PenaltyReturnTypeOnItsOwnLine: 1000 PointerAlignment: Left SortIncludes: true +SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesInAngles: false SpacesInCStyleCastParentheses: false SpacesInParentheses: false +Standard: c++17 UseTab: Never - -# Not available in clang-format version 6.0.0 -# BasedOnStyle: Microsoft -# Standard: c++17 -# AllowAllArgumentsOnNextLine: true -# AllowShortLambdasOnASingleLine: None -# BreakInheritanceList: BeforeComma -# SpaceAfterLogicalNot: false -# SpaceBeforeCpp11BracedList: false -# SpaceBeforeCtorInitializerColon: true -# SpaceBeforeInheritanceColon: true -# SpaceBeforeRangeBasedForLoopColon: true - -# Not available in clang-format version 10.0.0 -# BeforeLambdaBody: true (BraceWrapping) -# IndentCaseBlocks: true diff --git a/.gitattributes b/.gitattributes index d7f9d36c50..2037909dbd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -115,7 +115,6 @@ *.wav filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text *.wem filter=lfs diff=lfs merge=lfs -text -*.wxs filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.tbscene filter=lfs diff=lfs merge=lfs -text *.spp filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore index c3af907e97..664680c5bf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ __pycache__ AssetProcessorTemp/** [Bb]uild/** [Cc]ache/ +/install/ Editor/EditorEventLog.xml Editor/EditorLayout.xml **/*egg-info/** @@ -19,3 +20,4 @@ _savebackup/ TestResults/** *.swatches /imgui.ini +/scripts/project_manager/logs/ diff --git a/Assets/Editor/Prefabs/Default_Level.prefab b/Assets/Editor/Prefabs/Default_Level.prefab new file mode 100644 index 0000000000..fb82c5ab03 --- /dev/null +++ b/Assets/Editor/Prefabs/Default_Level.prefab @@ -0,0 +1,666 @@ +{ + "Source": "Default_Level.prefab", + "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 + }, + "Component_[15230859088967841193]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 15230859088967841193, + "Parent Entity": "", + "Cached World Transform Parent": "" + }, + "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 + } + }, + "IsDependencyReady": true + }, + "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, + "ShadowmapSize": "Size1024", + "Pcf Method": 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 + ] + }, + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 9.442070960998536 + ], + "Rotation": [ + -0.6098860502243042, + -0.09055805951356888, + -0.10376212745904924, + 0.7804304361343384 + ] + }, + "Cached World Transform Parent": "Entity_[1176639161715]" + }, + "Component_[8599729549570828259]": { + "$type": "EditorEntitySortComponent", + "Id": 8599729549570828259 + }, + "Component_[952797371922080273]": { + "$type": "EditorPendingCompositionComponent", + "Id": 952797371922080273 + } + }, + "IsDependencyReady": true + }, + "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]", + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ] + }, + "Cached World Transform Parent": "Entity_[1176639161715]" + }, + "Component_[16919232076966545697]": { + "$type": "EditorInspectorComponent", + "Id": 16919232076966545697 + }, + "Component_[5182430712893438093]": { + "$type": "EditorMaterialComponent", + "Id": 5182430712893438093, + "materialSlots": [ + { + "id": { + "materialAssetId": { + "guid": "{935F694A-8639-515B-8133-81CDC7948E5B}", + "subId": 803645540 + } + } + } + ], + "materialSlotsByLod": [ + [ + { + "id": { + "lodIndex": 0, + "materialAssetId": { + "guid": "{935F694A-8639-515B-8133-81CDC7948E5B}", + "subId": 803645540 + } + } + } + ] + ] + }, + "Component_[5675108321710651991]": { + "$type": "AZ::Render::EditorMeshComponent", + "Id": 5675108321710651991, + "Controller": { + "Configuration": { + "ModelAsset": { + "assetId": { + "guid": "{935F694A-8639-515B-8133-81CDC7948E5B}", + "subId": 277333723 + }, + "assetHint": "objects/groudplane/groundplane_521x521m.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 + } + }, + "IsDependencyReady": true + }, + "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": 8929576024571800510 + } + } + }, + "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.300000190734864, + -3.9368600845336916, + 1.0 + ], + "Rotate": [ + -2.050307512283325, + 1.9552897214889529, + -43.62335586547852 + ] + }, + "Cached World Transform": { + "Translation": [ + -11.904647827148438, + 13.392678260803223, + -3.0449724197387697 + ], + "Rotation": [ + -0.02294669672846794, + 0.00919158011674881, + -0.37172695994377139, + 0.9280129671096802 + ] + }, + "Cached World Transform Parent": "Entity_[1176639161715]" + }, + "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_[8866210352157164042]": { + "$type": "EditorInspectorComponent", + "Id": 8866210352157164042 + }, + "Component_[9129253381063760879]": { + "$type": "EditorOnlyEntityComponent", + "Id": 9129253381063760879 + } + }, + "IsDependencyReady": true + }, + "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]", + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ] + }, + "Cached World Transform Parent": "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 + } + }, + "IsDependencyReady": true + }, + "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 + ] + }, + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ], + "Rotation": [ + 0.0008726645028218627, + 0.0, + 0.9999996423721314, + 0.0 + ] + }, + "Cached World Transform Parent": "Entity_[1176639161715]" + }, + "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 + } + }, + "IsDependencyReady": true + }, + "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]", + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ] + }, + "Cached World Transform Parent": "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, + "ChildEntityOrderEntryArray": [ + { + "EntityId": "Entity_[1155164325235]" + }, + { + "EntityId": "Entity_[1180934129011]", + "SortIndex": 1 + }, + { + "EntityId": "Entity_[1172344194419]", + "SortIndex": 2 + }, + { + "EntityId": "Entity_[1168049227123]", + "SortIndex": 3 + }, + { + "EntityId": "Entity_[1163754259827]", + "SortIndex": 4 + }, + { + "EntityId": "Entity_[1159459292531]", + "SortIndex": 5 + } + ] + }, + "Component_[9277695270015777859]": { + "$type": "EditorEntityIconComponent", + "Id": 9277695270015777859 + } + }, + "IsDependencyReady": true + }, + "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]", + "Cached World Transform": { + "Translation": [ + 0.0, + 0.0, + 0.0 + ] + }, + "Cached World Transform Parent": "Entity_[1176639161715]" + }, + "Component_[931091830724002070]": { + "$type": "EditorInspectorComponent", + "Id": 931091830724002070 + } + }, + "IsDependencyReady": true + } + } +} \ No newline at end of file diff --git a/Assets/Engine/SeedAssetList.seed b/Assets/Engine/SeedAssetList.seed index 45a02f7682..77ec509721 100644 --- a/Assets/Engine/SeedAssetList.seed +++ b/Assets/Engine/SeedAssetList.seed @@ -67,106 +67,98 @@ - + - + - + - + - + - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -264,109 +256,101 @@ - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -387,498 +371,474 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -896,14 +856,6 @@ - - - - - - - - @@ -928,29 +880,13 @@ - - - - - - - - - - - - - - - - - + - + @@ -1451,146 +1387,146 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1699,42 +1635,42 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/Assets/Engine/Shaders/DistanceClouds.ext b/Assets/Engine/Shaders/DistanceClouds.ext deleted file mode 100644 index 322acef5f3..0000000000 --- a/Assets/Engine/Shaders/DistanceClouds.ext +++ /dev/null @@ -1,51 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Particles shader extension used by the editor -// for automatic shader generation (based on "Particles" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %DIFFUSE - Mask = 0x1 - Hidden -} - -Property -{ - Name = %SIMPLE - Mask = 0x2 - Property (Simple distance clouds) - Description (Use distance clouds with no volumetric shading computations) -} - -Property -{ - Name = %ADVANCED - Mask = 0x4 - Property (Advanced distance clouds) - Description (Use distance clouds with more accurate shading computations) -} - -Property -{ - Name = %DEPTH_FADE - Mask = 0x8 - Property (Depth Fade) - Description (Fades the output based on closeness of objects behind it) -} diff --git a/Assets/Engine/Shaders/Eye.ext b/Assets/Engine/Shaders/Eye.ext deleted file mode 100644 index 28df961f79..0000000000 --- a/Assets/Engine/Shaders/Eye.ext +++ /dev/null @@ -1,74 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Eye shader extension used by the editor -// for automatic shader generation (based on "Eye" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %ENVIRONMENT_MAP - Mask = 0x2 - Property (Environment map) - Description (Use environment map as separate texture) - DependencyReset = $TEX_EnvCM -} - -Property -{ - Name = %EYE_AO_OVERLAY - Mask = 0x4 - Property (Ambient occlusion overlay) - Description (Use for ambient occlusion overlay rendering) -} - -Property -{ - Name = %EYE_SPECULAR_OVERLAY - Mask = 0x8 - Property (Specular overlay) - Description (Use for specular overlay rendering) -} - -Property -{ - Name = %VERTCOLORS - Mask = 0x400000 - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %TEMP_EYES - Mask = 0x80000000 - DependencySet = $UserEnabled - Hidden -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/Fur.ext b/Assets/Engine/Shaders/Fur.ext deleted file mode 100644 index 067c85d274..0000000000 --- a/Assets/Engine/Shaders/Fur.ext +++ /dev/null @@ -1,126 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// - -// Description: Fur shader extension used by the editor -// for automatic shader generation (based on "Fur" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x2 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %CUSTOM_MODIFICATOR - Mask = 0x4 - Property (Call CustomModificator function in vertex shader) - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %FUR_VERT_COLORS - Mask = 0x8 - Property (Fur Color Data) - Description (Vertex color channel contains fur combing and scaling info) -} - -Property -{ - Name = %FUR_WIND_BENDING - Mask = 0x10 - Property (Wind bending) - Description (Enable wind bending for fur) -} - -Property -{ - Name = %FUR_BLENDLAYER - Mask = 0x20 - Property (Fur Blendlayer) - Description (Diffuse layer blended into fur as it grows from base to tip) -} - -Property -{ - Name = %FUR_BLENDCOLOR - Mask = 0x40 - Property (Fur Blend color) - Description (Specified color blended into fur diffuse as it grows from base to tip) -} - -Property -{ - Name = %FUR_LENGTH_SCALED - Mask = 0x80 - Property (Scale fur length) - Description (Fur length scales with object scale) -} - -Property -{ - Name = %MODEL_SPACE_Z_UP - Mask = 0x100 - Property (Model Space Z Up) - Description (Check if model was generated with Z up, if unchecked, assumes Y up) -} - -Property -{ - Name = %DEPTH_FIXUP - Mask = 0x200 - Property (Depth Fixup) - Description (Write depth for depth of field and postprocessing) - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %ZPASS_CUSTOM_DIFFUSE - Mask = 0x400 - Property (Calls GetZPassDiffuse function in z pass pixel shader for custom diffuse handling) - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %FUR_MULTI_LAYER_ALPHA_BLEND - Mask = 0x800 - Property(Enable OIT) - Description(Use OIT for accurate alpha blending - performance penalty expected) -} diff --git a/Assets/Engine/Shaders/GeometryBeam.ext b/Assets/Engine/Shaders/GeometryBeam.ext deleted file mode 100644 index 25e395f42d..0000000000 --- a/Assets/Engine/Shaders/GeometryBeam.ext +++ /dev/null @@ -1,43 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// - - -Property -{ - Name = %NOISE - Mask = 0x1 - Property (Dust & Turbulence) - Description (Add a dust overlay [spec map for dust, bump map for turbulence] ) -} - - -Property -{ - Name = %RECEIVE_SHADOWS - Mask = 0x2 - Property (Receive Shadows) - Description (Enable shadow receiving) -} - - -Property -{ - Name = %UV_VIGNETTING - Mask = 0x4 - Property (UV Vignetting) - Description (Enabling this will cause contents to fade out at UV boundaries) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/Glass.ext b/Assets/Engine/Shaders/Glass.ext deleted file mode 100644 index 1070d4e5c9..0000000000 --- a/Assets/Engine/Shaders/Glass.ext +++ /dev/null @@ -1,111 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Glass shader extension used by the editor -// for automatic shader generation (based on "Glass" shader template) -// -//////////////////////////////////////////////////////////////////////////// - - -Version (2.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %DIRT_MAP - Mask = 0x100000 - Property (Use Diffuse map) - Description (Use Diffuse map for dirt, etc. Requires Alpha channel) -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x200000 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %ENVIRONMENT_MAP - Mask = 0x10 - Property (Environment map) - Description (Use environment map as separate texture) - DependencyReset = $TEX_EnvCM -} - - -Property -{ - Name = %TINT_MAP - Mask = 0x200 - Property (Tint map - Tint/Gloss/Spec) - Description (Use RGB Spec Map to control Tinting in Red channel / Cloudiness in Green channel / Specular in Blue channel) - -} - -Property -{ - Name = %TINT_COLOR_MAP - Mask = 0x400 - Property (Use Tint Color Map) - Description (Use Tint Color Map for multi-colored glass, goes in the custom Tint Color Map slot) - DependencyReset = $TEX_Custom - DependencySet = $TEX_Custom -} - -Property -{ - Name = %BLUR_REFRACTION - Mask = 0x2000 - Property (Blur refraction - PC Only) - Description (Blur objects seen through the glass) -} - -Property -{ - Name = %DEPTH_FOG - Mask = 0x4000 - Property (Depth Fog) - Description (Enables depth fog behind glass surface) -} - -Property -{ - Name = %UNLIT - Mask = 0x8000 - Property (Disable Lights) - Description (Disables the reflection of lights) -} - -Property -{ - Name = %DEPTH_FIXUP - Mask = 0x4000000 - Property (Depth Fixup) - Description (Write depth for depth of field and postprocessing) -} - -Property -{ - Name = %SAA_FILTERING - Mask = 0x80000000 - Property (Specular Antialiasing) - Description (Perform specular Antialiasing) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/AuxGeom.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/AuxGeom.cfx deleted file mode 100644 index ac64ed293a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/AuxGeom.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d924c59739f63724999b1bf6cd326d10024b031bdfbf02fe8e09cb0b783dfe67 -size 2891 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Clouds.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Clouds.cfx deleted file mode 100644 index cf8ee86492..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Clouds.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:045f6506425364221f9dbf0b359e38877f276300770ef7a5ab694f1055eb0d02 -size 1569 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfi deleted file mode 100644 index 644826685e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f25999b453c3e91c8237d28ccc1ef3baefaa2a7ec8f9aad65adb95042e25e435 -size 56582 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfx deleted file mode 100644 index d347b5c967..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Common.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:396a70d86a4678b16fa110b3eceacbd5b515aa85090d16bdb6a8562d7c94e4a8 -size 17205 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonDebugPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonDebugPass.cfi deleted file mode 100644 index 95abf99bbf..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonDebugPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b05841cd01ec853455ad792e80302cf5ffbbd104c5ecf46699f5ecd4b0624c09 -size 983 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPass.cfi deleted file mode 100644 index 54f160e01b..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:725006c2f2844e49b691506cbc3d015466cdfbad19209a63964acc264b78c782 -size 4096 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPassTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPassTess.cfi deleted file mode 100644 index 4d74269d97..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonMotionBlurPassTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5886e0be4d4047a9b41431c141738cb0a13a3b3a4033cc262f173b5e9e195707 -size 4734 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonSVO.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonSVO.cfi deleted file mode 100644 index 023437ec3c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonSVO.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:57682432ba4de87ddc5ba542b6630ad512f75dbaca2a0c1402fb2a59ed35804c -size 111615 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPass.cfi deleted file mode 100644 index 7907e3913d..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01bbe928766a8c75bc3d990747f91e5becfbed6a59d58b71d2a2922f6d14bc1f -size 6970 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPassTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPassTess.cfi deleted file mode 100644 index ccb63377d1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonShadowGenPassTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c4c004afe3782ae58fa4ac90dd7f16e026d0c38e4bf66ed475beaa1ce3fcf98 -size 3363 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonTessellation.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonTessellation.cfi deleted file mode 100644 index 33aa6974cf..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonTessellation.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:86f594a6f8fb6e1328b95e6b03a04109ea3e9e8b8642d30c674281ea916dbf41 -size 19522 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPass.cfi deleted file mode 100644 index 71876eddd2..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04850ac23185147fd8e97303efad70cbb876c6589c71cb413b0429d267705cd3 -size 8020 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPassTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPassTess.cfi deleted file mode 100644 index 96cbad4a40..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonViewsPassTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c660b79e7532b5a9513341d3f37215a742d3ee99532ba0003e2c13381d55bc6 -size 4238 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPass.cfi deleted file mode 100644 index 8a9f7ef4f1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8fe036b79e16737499920500c87997567d8ee32534748df4ea617c4118237cb5 -size 32052 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPassTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPassTess.cfi deleted file mode 100644 index adc03e7945..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPassTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a30f1c7b94eb1bcb0261e518062da6eb69987698d65e6dd786bfe29be32d749e -size 4995 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPrePass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPrePass.cfi deleted file mode 100644 index 43481f75fe..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/CommonZPrePass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c4ac5b9fa8a288f8fdfc4110599b25742b19ddd3a251d638e5e1da9284310d6 -size 2814 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DXTCompress.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DXTCompress.cfx deleted file mode 100644 index 26545c6531..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DXTCompress.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a2b214f2873a3a99bcaccc120d6a397c708a4b3309c9b953860f8f9cf93461c8 -size 8591 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Debug.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Debug.cfx deleted file mode 100644 index 71ab497cc5..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Debug.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f26436234a598c2aa906653e711eb0e8ae14f99b65fc25eea0d238d9f56d914a -size 4345 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DebugLight.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DebugLight.cfx deleted file mode 100644 index cc9a79a324..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DebugLight.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bb0a8212530051bd6e4ac5646f6ab2f0a59f43a349ce8e03e544f6cf6d87ba4b -size 1929 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredCaustics.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DeferredCaustics.cfx deleted file mode 100644 index f477baa00c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredCaustics.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24e1f7c4242c708a638a1069908f258fa26aa77152330a2c8da72260dd192209 -size 14703 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredRain.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DeferredRain.cfx deleted file mode 100644 index 2e771c73bf..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredRain.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:77910f05ea15757e24201187a68a9a0db924f7951dadd4b7c7330f0845bd5944 -size 14043 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShading.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShading.cfx deleted file mode 100644 index 9252e1b06e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShading.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4ab94af4462722c1a111f4199714fabd0addf095aba82840f92e6ef8b056d78c -size 94446 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShadows.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShadows.cfi deleted file mode 100644 index 63c8b33c21..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredShadows.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0641726ad6140704434896912f0e57e29e6f5e28ac2653bc97bbe7e2d444fbc2 -size 2828 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredSnow.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DeferredSnow.cfx deleted file mode 100644 index 0789202955..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DeferredSnow.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6ea4c40161f4f628fbf9cd1a3b7df445615dfa8ca15761a4fec15d0c2276b369 -size 22312 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DepthOfField.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DepthOfField.cfx deleted file mode 100644 index 9a431fb20a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DepthOfField.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b67ece889d68d8ed6f891ca5cfb1f951a777616ea928b0e6f91bd541b35c62ff -size 13136 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/DistanceClouds.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/DistanceClouds.cfx deleted file mode 100644 index 7448f0304a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/DistanceClouds.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a06a4a972542f51bea726578b26ef0fc711c4b6f4a77a31a383690717c5ccba2 -size 10622 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Eye.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Eye.cfx deleted file mode 100644 index a3cb1227ea..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Eye.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fed5c2b72b2b4769954f2fad9573c6e35581c556e3a96685d449eea5576cf433 -size 19244 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FXConstantDefs.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FXConstantDefs.cfi deleted file mode 100644 index 7b0d7202e7..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FXConstantDefs.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b6aa7281d2174f24b510a7ac820b4ab308a215d6b3eae4a039bc01e34b131ec -size 9922 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FXSamplerDefs.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FXSamplerDefs.cfi deleted file mode 100644 index 7f5b097148..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FXSamplerDefs.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:750ac5a4ef25f1379121c7346dad0230d389c7c889ffdccbe6281a511b021cea -size 4044 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FXStreamDefs.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FXStreamDefs.cfi deleted file mode 100644 index 4d05f905c1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FXStreamDefs.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:073303aa45adc5ca237f33f29fb4de52f8b3c935912298cdec611128c510399c -size 9279 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FallBack.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/FallBack.cfx deleted file mode 100644 index 321440401b..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FallBack.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:052a458b7bdef6d7e1fa1a26d4cb66f6e24f91b9e42451a8e48045d3779aef1c -size 2383 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FixedPipelineEmu.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/FixedPipelineEmu.cfx deleted file mode 100644 index 8b92aa7399..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FixedPipelineEmu.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab757a0df8246a0e9d20839a89219a6c616d6df054d72b21b79e459b8503ade8 -size 10188 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FogVolume.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/FogVolume.cfx deleted file mode 100644 index 929d89ab5b..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FogVolume.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a37c2ab18b0ad1da90005c0ff9fea89d7c78ade9fd51b28b665cf42b814ecd8d -size 23690 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Fur.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Fur.cfx deleted file mode 100644 index 7d7405cc5e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Fur.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2f429a8537df95455e32da7fd480e79ef46751d6bc880c34b746c21515aa012a -size 31609 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FurFinPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FurFinPass.cfi deleted file mode 100644 index 84149cb0f6..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FurFinPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3f25ea475310f699442a160ffcc9f58c40e54b6570210dafbe41746a010b821 -size 15002 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FurObliteratePass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FurObliteratePass.cfi deleted file mode 100644 index 3ffe779a54..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FurObliteratePass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f6246f93aa73fdab460c1c82a33f2588a0ae83a162acdcdb12cec86ddac332b6 -size 5142 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/FurZPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/FurZPass.cfi deleted file mode 100644 index 5735035e49..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/FurZPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fb0d83cc48ebee33b3d3db2b1a5c27636d35dfb7ce720e5391a28ff70ca0d729 -size 9023 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticle.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticle.cfi deleted file mode 100644 index 6cd187c993..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticle.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b690c770f90e33dc78604b5beca3453aba4fbb4db8014b730680c33b5cef5120 -size 2299 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBegin.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBegin.cfx deleted file mode 100644 index 3bc0dd3e01..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBegin.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64c184691014423f2f6c518d34ff9657acc1dc8867e0e43d20b5526491d35d5b -size 462 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSort.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSort.cfx deleted file mode 100644 index 14c0b06c58..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSort.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a71929dda4a7b4516754286da5494546a0ea2075b9fde5cefef68f0a99d37381 -size 1520 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortGlobal2048.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortGlobal2048.cfx deleted file mode 100644 index b8ff2e6afc..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortGlobal2048.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a50144544a4c292d172d4bb9586a6016de4cc5b0a39958abfb00bc720e8c23e9 -size 1989 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortLocal.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortLocal.cfx deleted file mode 100644 index 6ee0b7b645..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleBitonicSortLocal.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:25d51818120964a1576f35727c0f13bc10a01727ab793f5fdf79cb9c1f7bf563 -size 2055 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleCurves.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleCurves.cfi deleted file mode 100644 index a565d62cc4..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleCurves.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4308e81d4ee4c65480a1cf110f3f602d347f2899b4cf299f334c2659904329dd -size 553 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleEmit.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleEmit.cfx deleted file mode 100644 index 8d417c29ac..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleEmit.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bfe3a765c1057d5dfae514ba17d0ce99d6598693035df2037314da5f38e4c305 -size 19142 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleGatherSortDistance.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleGatherSortDistance.cfx deleted file mode 100644 index 0a223398ff..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleGatherSortDistance.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f94a71dd8cbe95080f2de1bfa8cbd9443bea18106cc7bcae2c5c7225d113f2b4 -size 644 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleHelpers.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleHelpers.cfi deleted file mode 100644 index a3b10d582b..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleHelpers.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cf39d59eefe2c6641437e9d535528edb29e1e0dad6d1b84b20662c7075928fe8 -size 6969 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleOddEvenSort.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleOddEvenSort.cfx deleted file mode 100644 index be1e36e5db..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleOddEvenSort.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5cbcdd1c83247233dce9fb5c32e9d4530b23b825b284591a921a0b7e81d230ea -size 1817 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleRenderNoGS.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleRenderNoGS.cfx deleted file mode 100644 index 2d8fc2a1d0..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleRenderNoGS.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cae99346703f5ebc9bb59edb61c17b86184ae7659af78395ec4cba11cb6da471 -size 37741 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleUpdate.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleUpdate.cfx deleted file mode 100644 index 7524f13c6f..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GPUParticleUpdate.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a3a7bb8ad18d99c7490d15ce24b3c4867d9668b1539014a31b3ba5e80ebb00e -size 25753 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/GeometryBeam.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/GeometryBeam.cfx deleted file mode 100644 index 364f613063..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/GeometryBeam.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:45e7f387bb7cc9d7a489916b27ea6bff816510664099008ebbeaa0d10a26faa7 -size 12612 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Glass.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Glass.cfx deleted file mode 100644 index 38226fedec..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Glass.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:49aa341aa2563ced85aa4f62f74865c558238c91ba9d8d62ad21392088755820 -size 26913 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass0.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass0.cfx deleted file mode 100644 index b2df095b8a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass0.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7f9297a483fd7d7b91a3f06f1a3eb83e77192b967691f4e2119d41b7a7afdd2 -size 2707 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass1.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass1.cfx deleted file mode 100644 index 25c959c8f6..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HDRDolbyMetadataPass1.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52d68438b25fbd2d88a7247295a021680a9b95a6f3ed07c3ae066cb3d44b25ed -size 2530 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcess.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcess.cfx deleted file mode 100644 index 76e692fa63..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcess.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5cf8d27075f4aa76e5814d1c4a9718d7106df50229f33e1d8d7d7a4532d1e5f3 -size 40838 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcessDolby.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcessDolby.cfi deleted file mode 100644 index b8c0c3043c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HDRPostProcessDolby.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2e62a2aa829af58b2ba19a9920bd87d64a27854d24de5a51842740c7ec1e9ae8 -size 33567 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Hair.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Hair.cfx deleted file mode 100644 index 4788d26a0e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Hair.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:eb56b0070f3811f1b8780e70d4b9410a08f3aac9f8fa3e947194a4d902c9d8ef -size 33265 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Helper.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Helper.cfx deleted file mode 100644 index 5c19cc54e0..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Helper.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9764bb3ab6d2895a355466f3c53f735c3500006420bac211bc9a0b7c29a605c6 -size 2168 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Hud3D.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Hud3D.cfx deleted file mode 100644 index c460d0468c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Hud3D.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c63de566d2a5a69781a4c1e16958d64d187e057f3447afb4ec9aa47455ef7a5c -size 9617 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkin.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkin.cfx deleted file mode 100644 index ff2a2b894a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkin.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b81300b59d42b38b7669016cc8920db9adbf07b612f12d520d9480a6de59aa73 -size 18648 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinTess.cfi deleted file mode 100644 index 8f7ce5f8c9..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a79996ad61013920dcccd254f23e05fb4089879d477d8f3ce00ff98ee04d6ec1 -size 7783 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinValidations.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinValidations.cfi deleted file mode 100644 index 9743568b4d..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/HumanSkinValidations.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:548f2cc401046358ef4f4edeb37532f06437b99b2fe5bff70100e66a6ecb281a -size 986 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Illum.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Illum.cfx deleted file mode 100644 index 6de2f49547..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Illum.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c110e0891fbe46a10f2fbcf4ffb8f82c0711ffaa943fac5ca92c96f7e63d051 -size 28796 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/IllumTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/IllumTess.cfi deleted file mode 100644 index ef66d513a9..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/IllumTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a52e2256a43707dfab74c680e96249d27e7eb38a2984c9d4dcff83ffe7dd15b -size 5194 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/IllumValidations.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/IllumValidations.cfi deleted file mode 100644 index 7af7a4748c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/IllumValidations.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4155e44e6687796095b5e2401c93a09e527c61a48830e8a35d4ab16d849d8159 -size 2031 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/LensOptics.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/LensOptics.cfx deleted file mode 100644 index ab20cc3bc7..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/LensOptics.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7acdc1aaa28aea83d9af53547f65c5686b2fc43be988068d8f4f88c87c4359a7 -size 16847 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Light.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Light.cfx deleted file mode 100644 index ebbe8183bf..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Light.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4436686d0f3e735973df2dd56523269683c66b3ae01da67fa7f41e5f9e1b1234 -size 12760 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/LightBeam.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/LightBeam.cfx deleted file mode 100644 index e19414deef..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/LightBeam.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:13c69186729534dcd2676d1740a530fb5d5a3307d7b713f5c08704220186ba6d -size 14169 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/LightVolumes.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/LightVolumes.cfi deleted file mode 100644 index 4ab290bb32..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/LightVolumes.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f79e6c1e182e86afd295758f0afefc901407e69eb3f93422d8a3089451e49c7d -size 5526 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/MeshBaker.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/MeshBaker.cfi deleted file mode 100644 index 5f019eca9a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/MeshBaker.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ca1d710fd2b0937a04ded739ab4dc35ff48e3ff0c07d6a5d4df95f32a1947a4 -size 5032 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/MeshBakerDilate.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/MeshBakerDilate.cfx deleted file mode 100644 index 59ff9363a5..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/MeshBakerDilate.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a7db4ca9b7d87e4c3410df26f3045a18fb96a2535b88ab8afe00dcf1d621943 -size 4173 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorTC.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorTC.cfi deleted file mode 100644 index 6d0fd6bb42..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorTC.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0eb9c63a60a3d2afb78d6e4077ac81322dbd1a0537f5551c638d57c353381e15 -size 5256 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorVT.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorVT.cfi deleted file mode 100644 index fff9af0b52..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ModificatorVT.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dd0aecf5b1620c49a9b08c35865ea8de5487098f1eed8374fa4fc85e4a87e886 -size 52858 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Monitor.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Monitor.cfx deleted file mode 100644 index 840da6f035..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Monitor.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:758aa594628cd94f10d379f08a9a0a63478cc69eb9a093404d57c46e6830150a -size 19450 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/MotionBlur.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/MotionBlur.cfx deleted file mode 100644 index b6ba57f9f3..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/MotionBlur.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b4f6c44e52297c1dfe02040a7e63739aeed73f2c2c4930053f5a83c3c73f816 -size 8716 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/MultiLayerAlphaBlend.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/MultiLayerAlphaBlend.cfi deleted file mode 100644 index 751d38bde8..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/MultiLayerAlphaBlend.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:01f08e32bfb1f8690759da687114e66bf6652b6d17b208ed1b316315f0a66a1b -size 6435 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/NoDraw.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/NoDraw.cfx deleted file mode 100644 index a4a038ac28..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/NoDraw.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1d183abe91463d2ab90f56c055a44aa8c3cad1d731f51c9f56bd6f9df3d7eba1 -size 180 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/OcclusionTest.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/OcclusionTest.cfx deleted file mode 100644 index 7f1b7bf522..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/OcclusionTest.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ceef3fd50e977ba168e2f80803bc0a09542aa3c55721e0e6e27bbab45454607 -size 1545 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticleImposter.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ParticleImposter.cfx deleted file mode 100644 index 0506b14d5e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticleImposter.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b67b9997024270cfdede2d057220078029db61ab5dff6d522a39c99d08420245 -size 8657 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticleVT.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ParticleVT.cfi deleted file mode 100644 index bbe4d0c261..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticleVT.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:670e9dd98f131fa0375ddcc4df8fe850eeabb43f9771d302b5c8e2fd7022d78d -size 8534 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfi deleted file mode 100644 index 6f38a8eae7..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98f62a7869360e63083eea9a784652ad0fca13a9cd741930940be75c10ca83e7 -size 40918 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfx deleted file mode 100644 index 728135d83c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Particles.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:55bcc8a634262b6001193fabf318cdf2960904dd47e915fa17de3a60c620639d -size 4613 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesCustomPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesCustomPass.cfi deleted file mode 100644 index 7f90f9f1a5..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesCustomPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:af77abd5a2d462e4b533e6e5b489bc8e39909527c64a9cd599bbf5312b3aa17a -size 6052 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMat.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMat.cfx deleted file mode 100644 index 3728b1f379..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMat.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db6f21607b4ce4e0d0a48ffa0a7db81f29ac0546c76846dd39f1fc584f7d23e5 -size 1517 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMatMirror.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMatMirror.cfx deleted file mode 100644 index 955c99c3e9..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesNoMatMirror.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f8178b44fc27aacde3600b86bc06038aefbac6ca4fbf4fbe29f32ca6e8e0584 -size 1603 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesShadowPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesShadowPass.cfi deleted file mode 100644 index 461f4d40ac..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ParticlesShadowPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c7c5e176c6f0a5f689bc433dd23d5bb998f8f10d4185c30cb9788022ebb38a0 -size 6464 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/PostAA.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/PostAA.cfx deleted file mode 100644 index d8ae4939e4..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/PostAA.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a10320d3b31738cc0154de2c973fcaf912885209a7e729e3f6bd372f7633354 -size 67647 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffects.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/PostEffects.cfx deleted file mode 100644 index 95269fe06c..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffects.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ec164683d3fe45a512c0e9a2314c5b450602ee8c8a8281d99d43c1d76a761df3 -size 60596 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsGame.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsGame.cfx deleted file mode 100644 index efaa765189..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsGame.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a6d66a0aed7f39e3848ee4763c408c390ec7021205cf2f0f07459b99d84f1d27 -size 80783 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsLib.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsLib.cfi deleted file mode 100644 index 90ce479d4a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/PostEffectsLib.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b73c3ae905c1833cade569500b647dc504e83b34f15a4584f72a372d254d884f -size 8502 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImage.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImage.cfx deleted file mode 100644 index 08b3c94d06..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImage.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12d61af66003a6ab90e24574925fd94bc03622386da142fcaa655df21b0fd5bd -size 2033 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImageHDR.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImageHDR.cfx deleted file mode 100644 index aaa0a26a21..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ReferenceImageHDR.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1c4913b73fec9ebdcd5b8e7c86d495b7dc9a135e7f8a77ee90b9e62a78d3cc47 -size 1819 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Scopes.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Scopes.cfx deleted file mode 100644 index 7be1e74629..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Scopes.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4565c5415b0a68ced049335d803fcfdbf899db4ea914b8fbc5ba34620e4c4045 -size 10709 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowBlur.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ShadowBlur.cfx deleted file mode 100644 index ad707f2932..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowBlur.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3a6eafe0f42be55811eda4ac6b164bd01e22b6cc2b77723a8693549b26939871 -size 10768 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowCommon.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/ShadowCommon.cfi deleted file mode 100644 index fbaa4d7f65..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowCommon.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ddac405a61300a0857cba4ea7dabcb6d5aef5253ada53d09ec4ab591ed3cfbce -size 25680 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowMaskGen.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/ShadowMaskGen.cfx deleted file mode 100644 index 36b7604c43..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/ShadowMaskGen.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2aec8020aa2454b8a0cd406198bd2c067f878cb697dad2e2059e88c7cb2e5e87 -size 32118 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Sketch.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Sketch.cfx deleted file mode 100644 index 60d4aa0f4a..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Sketch.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ba3cc8b5127ccb8a446e0ac85daf0b13c700092bcdcbdd92d5fbf45dfd430dc -size 11176 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/SketchTerrain.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/SketchTerrain.cfx deleted file mode 100644 index f8ff66d760..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/SketchTerrain.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b247b792e8e26abb50c2c01e9bc6c341216f6a84fc3fac67088294cf868428ab -size 2992 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Sky.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Sky.cfx deleted file mode 100644 index 06ec9fc6f1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Sky.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7fec7735636fa7a4c2387e216918ec92414bc29ec6ecbd89605677214f829403 -size 4830 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/SkyHDR.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/SkyHDR.cfx deleted file mode 100644 index 48b47a9ae1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/SkyHDR.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3195bdf90fa2a0b1539f0cac7471dc31ec7aa783d138f9c0455a32354ead3874 -size 8548 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/SoftOcclusionQuery.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/SoftOcclusionQuery.cfx deleted file mode 100644 index 425102e21d..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/SoftOcclusionQuery.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c82e35c6af179bb2405bbfe1d452ae2a8c5479934c0c9d8e8119d04db35d8cf5 -size 3546 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Stars.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Stars.cfx deleted file mode 100644 index 4fdbddb2c6..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Stars.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5f191743c706e8531bada03abab8700c01cc9afbff0c9ea22c41d509b11ee76 -size 4075 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/StarterGame_GeometryBeamScaling.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/StarterGame_GeometryBeamScaling.cfx deleted file mode 100644 index a5a51340fc..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/StarterGame_GeometryBeamScaling.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:888486a516d3052e6b8b01cc0d36f01a68985ed482db683a25527c220290cc6c -size 13217 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Stereo.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Stereo.cfx deleted file mode 100644 index 8ef249a60f..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Stereo.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:761402eba9c7256a79fe78869b0287b95a8be8f810b48e41222049425b2eb535 -size 5422 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Sunshafts.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Sunshafts.cfx deleted file mode 100644 index 2274352ec3..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Sunshafts.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9a162b22e9ee5dc42559c8bcd4a6160c8b227bfeb6a5b367b62b8256109b99b5 -size 8884 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/TemplBeamProc.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/TemplBeamProc.cfx deleted file mode 100644 index 1a2de2a0dd..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/TemplBeamProc.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aed5eeb5e7467884319e268f985134f0d50482408cdbda6359873d211387737c -size 7182 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Terrain.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Terrain.cfx deleted file mode 100644 index 22abec6b24..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Terrain.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e4d2246d81afaad43e267addffdc01ce201dc4032bf5e05131cfb9f56ebc5ed0 -size 19043 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/TerrainValidations.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/TerrainValidations.cfi deleted file mode 100644 index 1c8349f673..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/TerrainValidations.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3956d70a7eff854ab02d44f6c712cdb694045e87e9a0201ad8427436c693897a -size 707 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/TiledShading.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/TiledShading.cfi deleted file mode 100644 index ebc1521531..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/TiledShading.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:72448b07701ad745e35d98de2229f0675cbb74bd6d40095ec4625929da906c5f -size 50201 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Total_Illumination.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Total_Illumination.cfx deleted file mode 100644 index 9b2c8e38dc..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Total_Illumination.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c73e03d1e09efd2e8cdb9292debb5260a0690772c81a9dbb085502f822b7f91b -size 38227 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/UI.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/UI.cfx deleted file mode 100644 index e98a5a2fae..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/UI.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c2b7a3ff846dde2ba481e46180e67e81528fa2a984ba6bb1a5c83304c301551d -size 7717 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Vegetation.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Vegetation.cfx deleted file mode 100644 index 0bca5a3e53..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Vegetation.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6c330b2ecb3d850e5eeb3673500cdebb95bee46b92eb93c3274291dbf96b2c98 -size 25807 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/VegetationTess.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/VegetationTess.cfi deleted file mode 100644 index 5abc5af104..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/VegetationTess.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28aadc74c027782d5971e8145d3286f733fcbb571872447f638397df4f957765 -size 5746 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/VegetationValidations.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/VegetationValidations.cfi deleted file mode 100644 index 00d2e11b8f..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/VegetationValidations.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c05fb764a9fbc9cf7ea7b225680880c32847f4d355cab27f958564d5adcfc21b -size 1167 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Video.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Video.cfx deleted file mode 100644 index 966c5d92f6..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Video.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c1c4e2eed305e2319127d12349754819350301b42d33cb109def7237c3591f1 -size 2123 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/VolumeLighting.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/VolumeLighting.cfi deleted file mode 100644 index 77cb40a98f..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/VolumeLighting.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:515e3218c9b23e8ff4d67a200ca11b3c833ad3999500f7f8be4ecdc5c01d5565 -size 82057 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/VolumeObject.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/VolumeObject.cfx deleted file mode 100644 index 2ca573741e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/VolumeObject.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a1fa34bd8cd7d8df9089739c7adf62b95c64f3d0993dcb2ee3892e05e118e83c -size 6700 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/VolumetricFog.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/VolumetricFog.cfi deleted file mode 100644 index 2556067f04..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/VolumetricFog.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3dd1721686abf6fe824df07a5e8ee1505b0fbcbaec6dc1a8ded98274d6ea4058 -size 25814 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Water.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Water.cfx deleted file mode 100644 index 175960ffc2..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Water.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d3ebab64f075124eb4cf426fee1c9ac446225ed647db3f10a28a28b1efaa5e63 -size 41727 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/WaterCausticsPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/WaterCausticsPass.cfi deleted file mode 100644 index 5aa4d40dff..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/WaterCausticsPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9f73053b56ef452bf8ae72a4cc6fed59876562d9f4541172265ce6c8d5740711 -size 3340 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/WaterFogVolume.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/WaterFogVolume.cfx deleted file mode 100644 index eda54be33e..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/WaterFogVolume.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9f9d26a36eb0fa05b58991aaaa6a073621309aa8a4a06a5bb4a6048b507a3fe1 -size 18306 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/WaterOceanBottom.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/WaterOceanBottom.cfx deleted file mode 100644 index 90cf67ba52..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/WaterOceanBottom.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5266c69503cb72e831e5c488332237fbfd343f96708ea3c75037780bd62fed60 -size 5280 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/WaterReflectionsPass.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/WaterReflectionsPass.cfi deleted file mode 100644 index a2ffd3d2a8..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/WaterReflectionsPass.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bb1ba5273a487655f813688f0a8500c662348639414ac53a0b0ee3d911010eab -size 10008 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/WaterVolume.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/WaterVolume.cfx deleted file mode 100644 index 7985e3dab0..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/WaterVolume.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41c19dceb8daa6e9a9102b83c78208d6f0681066f5d6c2cf2e657a82e1ce695c -size 39737 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/Waterfall.cfx b/Assets/Engine/Shaders/HWScripts/CryFX/Waterfall.cfx deleted file mode 100644 index d09922f322..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/Waterfall.cfx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ebece6e3b0115174da434ed1b166b7209c012a6013e219e2421ffee5ebd6dda1 -size 11237 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/fragLib.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/fragLib.cfi deleted file mode 100644 index ffba873be1..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/fragLib.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3a340c8cbb76900b02bc171e680cfdc628900a5c38ecd3ce6a7b9eecbafa72ef -size 23148 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/shadeLib.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/shadeLib.cfi deleted file mode 100644 index b2633fd0da..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/shadeLib.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b33f5a65661f977c15047dea6b01809a1ebab5dbd6c7299a0e2888c2de8a911b -size 59794 diff --git a/Assets/Engine/Shaders/HWScripts/CryFX/vertexLib.cfi b/Assets/Engine/Shaders/HWScripts/CryFX/vertexLib.cfi deleted file mode 100644 index 66def251da..0000000000 --- a/Assets/Engine/Shaders/HWScripts/CryFX/vertexLib.cfi +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b577a8c20b7cc94e1c97909487b3a0986b47882502e120fc518880883e04435 -size 15666 diff --git a/Assets/Engine/Shaders/Hair.ext b/Assets/Engine/Shaders/Hair.ext deleted file mode 100644 index 975e29323e..0000000000 --- a/Assets/Engine/Shaders/Hair.ext +++ /dev/null @@ -1,111 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Hair shader extension used by the editor -// for automatic shader generation (based on "Hair" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %VERTCOLORS - Mask = 0x10 - Property (Vertex Colors) - Description (Use vertex colors) -} - -Property -{ - Name = %HAIR_PASS - Mask = 0x20 - Property (Hair Pass) - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %ANISO_SPECULAR - Mask = 0x40 - Property (Anisotropic specular) - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %DIRECTION_MAP - Mask = 0x200 - Property (Direction map) - Description (Use direction map as separate texture) - DependencySet = $TEX_Detail - DependencyReset = $TEX_Detail - Hidden -} - -Property -{ - Name = %VIEW_ALIGNED_STRANDS - Mask = 0x800 - Property (View aligned strands) - Description (View aligned cards that get extruded from thin quads with texture u-coords 0 and 1) -} - -Property -{ - Name = %THIN_HAIR - Mask = 0x1000 - Property (Thin hair) - Description (Thin alpha-blended hair) -} - -Property -{ - Name = %HAIR_AMBIENT - Mask = 0x2000 - Property (Ambient cubemap) - Description (Use (nearest) cubemap specified in environment map slot for ambient lighting) - DependencyReset = $TEX_EnvCM -} - -Property -{ - Name = %ENFORCE_TILED_SHADING - Mask = 0x4000 - Property (Enforce tiled shading) - Description (Force hair to be fully affected by tiled shading. This can be expensive for dense hair meshes.) -} - -Property -{ - Name = %WIND_BENDING - Mask = 0x40000000 - Property (Wind bending) - Description (Gets affected by wind entities. Use extra shader parameters to tweak look.) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/HumanSkin.ext b/Assets/Engine/Shaders/HumanSkin.ext deleted file mode 100644 index 92429316ea..0000000000 --- a/Assets/Engine/Shaders/HumanSkin.ext +++ /dev/null @@ -1,116 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Skin shader extension used by the editor -// for automatic shader generation (based on "Skin" shader template) -// -//////////////////////////////////////////////////////////////////////////// - - - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x2 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %WRINKLE_BLENDING - Mask = 0x200 - Property (Wrinkle blending) - Description (Use subsurface map alpha for wrinkle blending) - DependencyReset = $TEX_Custom - DependencyReset = $TEX_CustomSecondary -} - -Property -{ - Name = %TEMP_SKIN - Mask = 0x1000 - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %DECAL_MAP - Mask = 0x2000 - Property (Decal map) - Description (Use a decal map which is blended on top of the diffuse map) -} - -Property -{ - Name = %DETAIL_MAPPING - Mask = 0x20000 - Property (Detail normal-map) - Description (Tiled detail normal-map for pores and tiny details (_ddn)) -} - -Property -{ - Name = %SUBSURFACE_SCATTERING_MASK - Mask = 0x40000 - Property (Subsurface Scattering Mask) - Description (Use diffuse map alpha as subsurface scattering amount multiplier) -} - -#ifdef FEATURE_MESH_TESSELLATION -Property -{ - Name = %DISPLACEMENT_MAPPING - Mask = 0x10000000 - Property (Displacement mapping) - Description (Use displacement mapping (requires height map (_displ))) - //DependencySet = $TEX_Height - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %PHONG_TESSELLATION - Mask = 0x20000000 - Property (Phong tessellation) - Description (Use rough approximation of smooth surface subdivision) -} - -Property -{ - Name = %PN_TESSELLATION - Mask = 0x40000000 - Property (PN triangles tessellation) - Description (Use rough approximation of smooth surface subdivision) -} -#endif \ No newline at end of file diff --git a/Assets/Engine/Shaders/Illum.ext b/Assets/Engine/Shaders/Illum.ext deleted file mode 100644 index edce2900d2..0000000000 --- a/Assets/Engine/Shaders/Illum.ext +++ /dev/null @@ -1,243 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Illumination shader extension used by the editor -// for automatic shader generation (based on "Illumination" shader template) -// -//////////////////////////////////////////////////////////////////////////// - - - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x10 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %DETAIL_MAPPING - Mask = 0x4000 - Property (Detail mapping) - Description (Enables Detail Map texture to increase surface detail. Requires Detail map before enabling.) - DependencyReset = $TEX_Detail -} - -Property -{ - Name = %DETAIL_MAPPING_UV_SET_2 - Mask = 0x8000 - Property (Use uv set 2 for detail map) - Description (Detail map will be applied to second UV set on mesh) -} - -Property -{ - Name = %OFFSET_BUMP_MAPPING - Mask = 0x20000 - Property (Offset bump mapping) - Description (Simulates surface bump detail. Used in place of POM for lower spec configs. Requires height and normal maps before enabling.) - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %FX_DISSOLVE - Mask = 0x20 - Property (Dissolve FX) - Description (Enables the use of an animated dissolve effect on the material) -} - -Property -{ - Name = %VERTCOLORS - Mask = 0x400000 - Property (Vertex Colors) - Description (Enables the use of vertex colors added to the mesh in the DCC tool) -} - -Property -{ - Name = %DECAL - Mask = 0x2000000 - Property (Decal) - Description (Enables the decal opacity map and used to prevent flickering and z-fighting) -} - -Property -{ - Name = %PARALLAX_OCCLUSION_MAPPING - Mask = 0x8000000 - Property (Parallax occlusion mapping) - Description (Simulates surface depth by parallaxing bump detail from camera view. Requires height and normal maps before enabling.) - DependencyReset = $TEX_Normals -} - -#ifdef FEATURE_MESH_TESSELLATION -Property -{ - Name = %DISPLACEMENT_MAPPING - Mask = 0x10000000 - Property (Displacement mapping) - Description (Displaces the vertices on the mesh to add depth. Requires height and normal maps before enabling.) - //DependencySet = $TEX_Height - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %PHONG_TESSELLATION - Mask = 0x20000000 - Property (Phong tessellation) - Description (Tesselates geometry for smoother faces and displacement. Can suffer from inflation.) -} - -Property -{ - Name = %PN_TESSELLATION - Mask = 0x40000000 - Property (PN triangles tessellation) - Description (Best geometry tesselation for smoother faces and displacement at the cost of perfornmance) -} -#endif - -Property -{ - Name = %BLENDLAYER - Mask = 0x100 - Property (Blendlayer) - Description (Enables a second set of texture inputs and mask to be used for a layered material) -} - -Property -{ - Name = %BLENDLAYER_UV_SET_2 - Mask = 0x200 - Property (Use uv set 2 for blendlayer maps) - Description (Second blend layer maps will be applied to second UV set on mesh) -} - -Property -{ - Name = %EMITTANCE_MAP - Mask = 0x400 - Property (Emittance Map) - Description (Use emittance map texture) - DependencySet = $TEX_Emittance - DependencyReset = $TEX_Emittance - Hidden -} - -Property -{ - Name = %EMITTANCE_MAP_UV_SET_2 - Mask = 0x800 - Property (Use uv set 2 for emittance map) - Description (Emittance map will be applied to second UV set on mesh) -} - -Property -{ - Name = %ALPHAMASK_DETAILMAP - Mask = 0x800000 - Property (DetailMap mask in Diffuse alpha) - Description (Enables the diffuse map alpha to mask the detail map) -} - -Property -{ - Name = %SILHOUETTE_PARALLAX_OCCLUSION_MAPPING - Mask = 0x10000 - Property (Silhouette POM) - Description (Simulates surface depth by parallaxing bump detail and adds silhouette displacement to the mesh edge. Requires height and normal maps before enabling.) - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %ALLOW_SILHOUETTE_POM - Mask = 0x40000 - DependencySet = $HW_SilhouettePom - DependencyReset = $HW_SilhouettePom - Hidden -} - -Property -{ - Name = %SUBSURFACE_SCATTERING - Mask = 0x80000 - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %DEPTH_FIXUP - Mask = 0x4000000 - Property (Depth Fixup) - Description (Enables to write and control depth for post-processing like depth of field) -} - -Property -{ - Name = %SAA_FILTERING - Mask = 0x80000000 - Property (Specular Antialiasing) - Description (Reduces antialiasing on bright specular meshes) -} - -Property -{ - Name = %ALLOW_SPECULAR_ANTIALIASING - Mask = 0x200000000 - DependencySet = $HW_SpecularAntialiasing - DependencyReset = $HW_SpecularAntialiasing - Hidden -} - -Property -{ - Name = %OCCLUSION_MAP - Mask = 0x40 - Property (Occlusion Map) - Description (Adds an additional texture slot for ambient occlusion) -} - -Property -{ - Name = %APPLY_FORWARD_DYNAMIC_LIGHTING - Mask = 0x400000000 - Property(Dynamic Lighting for Transparency) - Description(Adds a full forward lighting pass for transparent objects - less performant) -} diff --git a/Assets/Engine/Shaders/LensOptics.ext b/Assets/Engine/Shaders/LensOptics.ext deleted file mode 100644 index 5bd18e3895..0000000000 --- a/Assets/Engine/Shaders/LensOptics.ext +++ /dev/null @@ -1,16 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// diff --git a/Assets/Engine/Shaders/LightBeam.ext b/Assets/Engine/Shaders/LightBeam.ext deleted file mode 100644 index 835a0dbc99..0000000000 --- a/Assets/Engine/Shaders/LightBeam.ext +++ /dev/null @@ -1,44 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: LightBeam shader extension used by the editor -// for automatic shader generation (based on "LightBeam" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %NOISE - Mask = 0x1 - Property (Noise map) - Description (Use 3D noise) -} - -Property -{ - Name = %FALLOFF - Mask = 0x2 - Property (Use Falloff) - Description (Use Falloff) -} - -Property -{ - Name = %DOUBLE_SAMPLING - Mask = 0x4 - Property (Extra Sampling) - Description (Add expense to reduce aliasing) -} diff --git a/Assets/Engine/Shaders/Monitor.ext b/Assets/Engine/Shaders/Monitor.ext deleted file mode 100644 index 2a20138c1f..0000000000 --- a/Assets/Engine/Shaders/Monitor.ext +++ /dev/null @@ -1,53 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Monitor shader extension used by the editor -// for automatic shader generation -// -//////////////////////////////////////////////////////////////////////////// - - - -Version (1.00) - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x2 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %PIXELIZE - Mask = 0x4 - Property (Pixelized) - Description (Pixelize the diffuse texture.) -} - diff --git a/Assets/Engine/Shaders/ParticleImposter.ext b/Assets/Engine/Shaders/ParticleImposter.ext deleted file mode 100644 index 650541cfa3..0000000000 --- a/Assets/Engine/Shaders/ParticleImposter.ext +++ /dev/null @@ -1,37 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SOFT_PARTICLE - Mask = 0x2 - Property (Soft Particle) - Description (Soften particle intersections with world) -} diff --git a/Assets/Engine/Shaders/Particles.ext b/Assets/Engine/Shaders/Particles.ext deleted file mode 100644 index 3f24ea84b7..0000000000 --- a/Assets/Engine/Shaders/Particles.ext +++ /dev/null @@ -1,102 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Particles shader extension used by the editor -// for automatic shader generation (based on "Particles" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %REFRACTION - Mask = 0x4 - Property (Refraction) - Description (Use normal-map texture as displacement for refraction) -} - -Property -{ - Name = %REFRACTION_TINTING - Mask = 0x800 - Property (Refraction Tinting) - Description (Use color texture to tint refraction) -} - -Property -{ - Name = %SCREEN_SPACE_DEFORMATION - Mask = 0x10 - Property (Screen space deformation) - Description (Use custom slot map for screen space particles deformation) - DependencyReset = $TEX_Custom -} - -Property -{ - Name = %DEFORMATION - Mask = 0x20 - Property (Deformation) - Description (Use custom slot map for per-particle deformation) - DependencyReset = $TEX_Custom -} - -Property -{ - Name = %COLOR_LOOKUP - Mask = 0x40 - Property (Color lookup) - Description (Use custom slot [1] map for applying color lookup) - DependencyReset = $TEX_CustomSecondary -} - -Property -{ - Name = %SPECULAR_LIGHTING - Mask = 0x100 - Property (Specular Lighting) - Description (Calculate specular lighting in addition to diffuse lighting) - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %DEPTH_FIXUP - Mask = 0x200 - Property (Depth Fixup) - Description (Write depth for depth of field and postprocessing) -} - -Property -{ - Name = %NORMAL_MAP - Mask = 0x400 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %GLOW_MAP - Mask = 0x1000 - Property (Emissive map) - Description (Use this map to mask the particle emissive intensity) - DependencySet = $TEX_Detail - DependencyReset = $TEX_Detail - Hidden -} diff --git a/Assets/Engine/Shaders/RunTime.ext b/Assets/Engine/Shaders/RunTime.ext deleted file mode 100644 index 9cc96769d5..0000000000 --- a/Assets/Engine/Shaders/RunTime.ext +++ /dev/null @@ -1,1259 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %_RT_FOG - Mask = 0x1 // 1 << 0 - Precache = GeneralPS - Precache = GeneralVS - Precache = GeneralGS - Precache = GeneralDS - Precache = GeneralHS - Precache = TerrainPS - Precache = TerrainVS - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS - Precache = SkinPS - Precache = SkinVS - Precache = HairPS - Precache = HairVS - Precache = EyePS - Precache = EyeVS - Precache = GlassPS - Precache = GlassVS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = CustomRenderHS - Precache = CustomRenderDS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_VS - Precache = WaterFogVolume_PS - Precache = MeshBakerPS - Precache = ParticleImposterVS - Precache = ParticleImposterPS -} - -Property -{ - Name = %_RT_AMBIENT - Mask = 0x2 // 1 << 1 - Precache = GeneralPS - Precache = SkinPS - Precache = HairPS - Precache = EyePS - Precache = GlassPS - Precache = TerrainPS - Precache = VegetationPS - Precache = ParticlePS - Precache = MeshBakerPS -} - -Property -{ - Name = %_RT_OCEAN_PARTICLE - Mask = 0x4 // 1 << 2 - Precache = PostProcessGamePS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_PS -} - -Property -{ - //Using the same mask as _RT_OCEAN_PARTICLE as we have run out of them. - //It should be safe to do this as this flag is not used in water rendering - Name = %_RT_DEPTHFIXUP - Mask = 0x4 // 1 << 2 - Precache = FurShellPS - Precache = GlassPS - Precache = IlluminationPS - Precache = GeneralPS -} - -Property -{ - Name = %_RT_DECAL_TEXGEN_2D - Mask = 0x8 // 1 << 3 - Precache = GeneralVS - Precache = GeneralDS - Precache = GeneralHS - Precache = ShadowGenVS - Precache = CausticsVS - Precache = GeneralPS - Precache = CustomRenderHS - Precache = CustomRenderDS - Precache = ZVS - Precache = ZPS - Precache = MeshBakerPS - Precache = TiledShadingCS -} - -Property -{ - Name = %_RT_DISSOLVE - Mask = 0x10 // 1 << 4 - Precache = ZPS - Precache = ZVS - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = GeneralPS - Precache = GeneralVS -} - -Property -{ - Name = %_RT_VOLUMETRIC_FOG - Mask = 0x20 // 1 << 5 - Precache = GeneralPS - Precache = GeneralVS - Precache = GeneralGS - Precache = GeneralDS - Precache = GeneralHS - Precache = TerrainPS - Precache = TerrainVS - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS - Precache = SkinPS - Precache = SkinVS - Precache = HairPS - Precache = HairVS - Precache = EyePS - Precache = EyeVS - Precache = GlassPS - Precache = GlassVS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = WaterSurfacePS - Precache = WaterFogVolume_VS - Precache = WaterFogVolume_PS - Precache = MeshBakerPS - Precache = CloudVS - Precache = CloudPS - Precache = FogPostProcessPS - Precache = ParticleImposterVS - Precache = ParticleImposterPS -} - -Property -{ - Name = %_RT_NEAREST - Mask = 0x40 // 1 << 6 - Precache = ShadowGenVS - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - Precache = ZVS - Precache = MotionBlurVS - Precache = SkinVS - Precache = GeneralVS - Precache = VegetationVS - Precache = CausticsVS - Precache = CustomRenderVS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_GLOBAL_ILLUMINATION - Mask = 0x80 // 1 << 7 - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_ALPHATEST - Mask = 0x100 // 1 << 8 - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = ZPS - Precache = ZVS - Precache = MotionBlurPS - Precache = CustomRenderPS - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS - Precache = GeneralPS - Precache = GlassPS - Precache = GlassVS - Precache = MotionBlurVS - Precache = MeshBakerPS -} - -Property -{ - Name = %_RT_SOFT_PARTICLE - Mask = 0x200 // 1 << 9 - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_HDR_MODE - Mask = 0x400 // 1 << 10 - Precache = GeneralPS - Precache = TerrainPS - Precache = VegetationPS - Precache = SkinPS - Precache = HairPS - Precache = EyePS - Precache = GlassPS - Precache = ParticlePS - Precache = WaterSurfacePS - Precache = ParticleImposterPS -} - -Property -{ - Name = %_RT_PARTICLE_SHADOW - Mask = 0x800 // 1 << 11 - Precache = ParticlePS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS -} - -Property -{ - Name = %_RT_SAMPLE1 - Mask = 0x1000 // 1 << 12 - Precache = CustomRenderHS - Precache = CustomRenderDS - Precache = CustomRenderVS - Precache = CustomRenderPS - Precache = SkinPS - Precache = HDRPostProcessPS - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostSunShaftsPS - Precache = PostProcessGamePS - Precache = PostDofPS - Precache = PostEffectsVS - Precache = PostEffectsPS - Precache = PostAA_PS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = PostHUD3D_VS - Precache = PostHUD3D_PS - Precache = ParticlePS - Precache = ParticleVS - Precache = DeferredRainPS - Precache = ShadowMaskGenPS - - Precache = WaterFogVolume_VS - Precache = WaterFogVolume_PS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - - Precache = BeamPS - Precache = ParticleHS - Precache = ParticleDS - - Precache = TiledShadingCS - Precache = VolumeLightInjectionCS - Precache = ResolvePS - Precache = VideoPS -} - -Property -{ - Name = %_RT_SAMPLE2 - Mask = 0x2000 // 1 << 13 - - Precache = HDRPostProcessPS - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostAA_PS - Precache = PostSunShaftsPS - Precache = PostProcessGamePS - Precache = DeferredDecalPassPS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = CustomRenderPS - Precache = DeferredRainPS - - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - Precache = ParticlePS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - - Precache = BeamPS - Precache = LensOpticsPS - Precache = WaterFogVolume_PS - Precache = TiledShadingCS - Precache = FogPostProcessPS - Precache = VideoPS -} - -Property -{ - Name = %_RT_SAMPLE3 - Mask = 0x4000 // 1 << 14 - Precache = ParticlePS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = PostAA_PS - Precache = HDRPostProcessPS - Precache = BeamPS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = DeferredRainPS - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - Precache = ResolvePS - - Precache = LensOpticsPS - Precache = WaterFogVolume_PS - Precache = TiledShadingCS - Precache = VideoPS -} - -Property -{ - Name = %_RT_POINT_LIGHT - Mask = 0x8000 // 1 << 15 - Precache = FogPassVolShadowsInterleavePassPS - Precache = WaterFogVolume_PS - Precache = ConeTraceDiffusePS -} - -Property -{ - Name = %_RT_ALPHABLEND - Mask = 0x10000 // 1 << 16 - Precache = GeneralHS - Precache = GeneralDS - Precache = FogPassVolShadowsInterleavePassPS - Precache = ParticlePS - Precache = ParticleVS - Precache = HairVS - Precache = EyeVS - Precache = VegetationVS - Precache = GeneralVS - Precache = GlassVS - Precache = CustomRenderHS - Precache = CustomRenderDS - Precache = ZVS - Precache = ZPS - Precache = MotionBlurPS -} - -Property -{ - Name = %_RT_ANIM_BLEND - Mask = 0x20000 // 1 << 17 - Precache = ParticlePS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticleGS -} - -Property -{ - Name = %_RT_QUALITY - Mask = 0x40000 // 1 << 18 - AutoPrecache - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = ZVS - Precache = ZPS - Precache = FogPassVolShadowsInterleavePassPS - Precache = GeneralPS - Precache = GeneralVS - Precache = SkinPS - Precache = SkinVS - Precache = HairPS - Precache = HairVS - Precache = EyePS - Precache = EyeVS - Precache = GlassPS - Precache = GlassVS - Precache = TerrainPS - Precache = TerrainVS - Precache = VegetationPS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationVS - Precache = MotionBlurVS - Precache = MotionBlurPS - Precache = CausticsVS - Precache = ParticlePS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostSunShaftsPS - Precache = SpriteDilatePS - Precache = ShadowMaskGenPS - - Precache = HDRPostProcessVS - Precache = HDRPostProcessPS - Precache = FogPostProcessPS - Precache = PostProcessGameVS - Precache = PostProcessGamePS - - Precache = DistanceCloudsPS - Precache = DeferredLightPassPS - Precache = VolumeLightInjectionCS -} - -Property -{ - Name = %_RT_QUALITY1 - Mask = 0x80000 // 1 << 19 - AutoPrecache - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = ZVS - Precache = ZPS - Precache = FogPassVolShadowsInterleavePassPS - Precache = GeneralPS - Precache = GeneralVS - Precache = SkinPS - Precache = SkinVS - Precache = HairPS - Precache = HairVS - Precache = EyePS - Precache = EyeVS - Precache = GlassPS - Precache = GlassVS - Precache = TerrainPS - Precache = TerrainVS - Precache = VegetationPS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationVS - Precache = MotionBlurVS - Precache = MotionBlurPS - Precache = CausticsVS - Precache = ParticlePS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostSunShaftsPS - Precache = SpriteDilatePS - Precache = ShadowMaskGenPS - - Precache = HDRPostProcessVS - Precache = HDRPostProcessPS - Precache = FogPostProcessPS - Precache = PostProcessGameVS - Precache = PostProcessGamePS - - Precache = DistanceCloudsPS - Precache = DeferredLightPassPS - Precache = VolumeLightInjectionCS -} - -Property -{ - Name = %_RT_INSTANCING_ATTR - Mask = 0x100000 // 1 << 20 - Precache = GeneralVS - Precache = SkinVS - Precache = HairVS - Precache = EyeVS - Precache = GlassVS - Precache = VegetationVS - Precache = ShadowGenVS - Precache = ZVS - Precache = MotionBlurVS - Precache = CausticsVS - Precache = CustomRenderVS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_ENVIRONMENT_CUBEMAP - Mask = 0x200000 // 1 << 21 - Precache = ParticlePS -} - -Property -{ - Name = %_RT_TILED_SHADING - Mask = 0x400000 // 1 << 22 - Precache = EyePS - Precache = HairPS - Precache = GlassPS - Precache = IlluminationPS -} - -Property -{ - Name = %_RT_NO_TESSELLATION - Mask = 0x800000 // 1 << 23 - Precache = GeneralVS - Precache = GeneralPS - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = ZVS - Precache = ZPS - Precache = MotionBlurVS - Precache = MotionBlurPS - Precache = CustomRenderVS - Precache = SkinVS - Precache = SkinPS - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_APPLY_TOON_SHADING - Mask = 0x1000000 // 1 << 24 - Precache = DeferredLightPassPS - Precache = TiledShadingCS -} - - -Property -{ - Name = %_RT_LIGHT_TEX_PROJ - Mask = 0x2000000 // 1 << 25 - Precache = DeferredLightPassPS - Precache = ParticleVS - Precache = ParticleDS - Precache = ConeTraceDiffusePS -} - -Property -{ - Name = %_RT_VERTEX_VELOCITY - Mask = 0x4000000 // 1 << 26 - Precache = ZVS - Precache = MotionBlurVS -} - -Property -{ - Name = %_RT_SKINNING_DUAL_QUAT - Mask = 0x8000000 // 1 << 27 - Precache = GeneralVS - Precache = SkinVS - Precache = HairVS - Precache = EyeVS - Precache = GlassVS - Precache = VegetationVS - Precache = ShadowGenVS - Precache = ZVS - Precache = MotionBlurVS - Precache = CausticsVS - Precache = CustomRenderVS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_SKINNING_DQ_LINEAR - Mask = 0x10000000 // 1 << 28 - Precache = GeneralVS - Precache = SkinVS - Precache = HairVS - Precache = EyeVS - Precache = GlassVS - Precache = VegetationVS - Precache = ShadowGenVS - Precache = ZVS - Precache = MotionBlurVS - Precache = CausticsVS - Precache = CustomRenderVS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_BLEND_WITH_TERRAIN_COLOR - Mask = 0x20000000 // 1 << 29 - Precache = ZVS - Precache = ZPS - Precache = GeneralHS - Precache = GeneralDS - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS - Precache = ConeTraceDiffusePS -} - -Property -{ - Name = %_RT_MOTION_BLUR - Mask = 0x40000000 // 1 << 30 - Precache = ParticleVS - Precache = ParticleHS - Precache = GPUParticleCS - Precache = ParticleDS - Precache = ParticlePS - Precache = ZVS - Precache = ZGS - Precache = ZPS - Precache = GeneralHS - Precache = GeneralDS -} - -Property -{ - Name = %_RT_LIGHTVOLUME0 - Mask = 0x80000000 // 1 << 31 - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = VolumeLightInjectionCS - Precache = RenderDownscaledShadowMapPS -} - -Property -{ - //Using the same mask as _RT_LIGHTVOLUME0 as we have run out of them. - //It should be safe to do this as this flag is not used in the deferred lighting pass or particles. - - Name = %_RT_SRGB0 - Mask = 0x80000000 // 1 << 31 - Precache = PostAA_PS - Precache = ResolvePS - Precache = HDRPostProcessPS -} - -Property -{ - Name = %_RT_LIGHTVOLUME1 - Mask = 0x100000000 // 1 << 32 - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = VolumeLightInjectionCS - Precache = RenderDownscaledShadowMapPS -} - -Property -{ - //Using the same mask as _RT_LIGHTVOLUME1 as we have run out of them. - //It should be safe to do this as this flag is not used in the deferred lighting pass or particles. - - Name = %_RT_SRGB1 - Mask = 0x100000000 // 1 << 32 - Precache = PostAA_PS - Precache = ResolvePS - Precache = HDRPostProcessPS -} - -Property -{ - Name = %_RT_NOZPASS - Mask = 0x200000000 // 1 << 33 - Precache = VegetationVS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationPS -} - -Property -{ - //Using the same mask as _RT_NOZPASS as we have run out of them. - //It should be safe to do this as this flag is not used in vegetation pass. - - Name = %_RT_SRGB2 - Mask = 0x200000000 // 1 << 33 - Precache = PostAA_PS - Precache = ResolvePS - Precache = HDRPostProcessPS -} - -Property -{ - Name = %_RT_SHADOW_MIXED_MAP_G16R16 - Mask = 0x400000000 // 1 << 34 - Precache = FogPassVolShadowsInterleavePassPS - Precache = WaterFogVolume_PS - - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS -} - -Property -{ - Name = %_RT_SHADOW_JITTERING - Mask = 0x800000000 // 1 << 35 - Precache = FogPassVolShadowsInterleavePassPS - Precache = TerrainPS - Precache = WaterFogVolume_PS - - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - - Precache = HairPS - Precache = EyePS -} - -Property -{ - Name = %_RT_ADDITIVE_BLENDING - Mask = 0x1000000000 // 1 << 36 - Precache = GlassPS - Precache = GeneralPS - Precache = HairPS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_SAMPLE0 - Mask = 0x2000000000 // 1 << 37 - Precache = CustomRenderVS - Precache = CustomRenderPS - Precache = SkinPS - Precache = GlassPS - - Precache = FogPostProcessPS - Precache = HDRPostProcessPS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS - Precache = PostHUD3D_VS - Precache = PostHUD3D_PS - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostAA_PS - Precache = PostSunShaftsPS - Precache = PostProcessGameVS - Precache = PostProcessGamePS - Precache = PostDofPS - Precache = PostEffectsVS - Precache = PostEffectsPS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = SceneRainVS - Precache = SceneRainPS - Precache = DeferredRainPS - Precache = ResolveVS - Precache = ResolvePS - - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_PS - - Precache = BeamPS - Precache = LensOpticsVS - Precache = TiledShadingCS - Precache = VolumeLightInjectionCS - Precache = VideoPS -} - -// Reserved for post processes/deferred - do not use for light/common shaders -Property -{ - Name = %_RT_SAMPLE5 - Mask = 0x4000000000 // 1 << 38 - - Precache = ZVS - Precache = GeneralVS - Precache = GeneralHS - Precache = GeneralDS - - Precache = HDRPostProcessPS - Precache = PostSunShaftsPS - Precache = PostProcessGamePS - Precache = DeferredPassPS - Precache = DeferredPassVS - Precache = DeferredLightPassPS - Precache = PostMotionBlurPS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - Precache = ResolvePS - Precache = FogPassVolShadowsInterleavePassPS - Precache = CustomRenderHS - Precache = CustomRenderDS - Precache = CustomRenderPS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_PS - Precache = PostAA_PS - - Precache = BeamPS - Precache = LensOpticsVS - Precache = TiledShadingCS - Precache = VolumeLightInjectionCS - Precache = ReprojectVolumetricFogCS -} - -Property -{ - Name = %_RT_HW_PCF_COMPARE - Mask = 0x8000000000 // 1 << 39 - Precache = FogPassVolShadowsInterleavePassPS - Precache = ShadowGenVS - Precache = ShadowGenPS - - Precache = DeferredLightPassPS - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - - Precache = WaterFogVolume_PS - Precache = ConeTraceDiffusePS -} - -Property -{ - Name = %_RT_REVERSE_DEPTH - Mask = 0x10000000000 // 1 << 40 - Precache = DistanceCloudsVS - Precache = PostProcessGamePS - Precache = TerrainVS - Precache = ZVS - Precache = ZPS - Precache = UnderwaterGodRays - Precache = WaterSurfaceVS - Precache = WaterFogVolume_VS - Precache = GeneralVS - Precache = LensOpticsVS -} - -Property -{ - Name = %_RT_DEBUG0 - Mask = 0x20000000000 // 1 << 41 - - Runtime -} - -Property -{ - Name = %_RT_DEBUG1 - Mask = 0x40000000000 // 1 << 42 - Runtime -} - -Property -{ - Name = %_RT_DEBUG2 - Mask = 0x80000000000 // 1 << 43 - Runtime -} - -Property -{ - Name = %_RT_DEBUG3 - Mask = 0x100000000000 // 1 << 44 - Runtime -} - -Property -{ - Name = %_RT_CUBEMAP0 - Mask = 0x200000000000 // 1 << 45 - Precache = ShadowGenPS - Precache = ShadowGenVS - - Precache = PostSunShaftsPS - Precache = PostProcessGamePS - - Precache = DeferredDecalPassVS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - Precache = DeferredLightPassVS - Precache = DeferredLightPassPS - Precache = DeferredPassVS - Precache = DeferredPassPS - - Precache = WaterFogVolume_PS - Precache = TiledShadingCS -} - -Property -{ - Name = %_RT_SAMPLE4 - Mask = 0x400000000000 // 1 << 46 - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = PostAA_PS - - Precache = HDRPostProcessPS - Precache = PostProcessGamePS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = PostSunShaftsPS - Precache = PostMotionBlurPS - - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_PS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - - Precache = BeamPS - Precache = LensOpticsPS - - Precache = TiledShadingCS - - Precache = ConeTraceDiffusePS - Precache = VolumeLightInjectionCS -} - -Property -{ - Name = %_RT_SPRITE - Mask = 0x800000000000 // 1 << 47 - Precache = VegetationVS - Precache = VegetationPS - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHADOW_PASS - Mask = 0x1000000000000 // 1 << 48 - Precache = ParticleVS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_DEPTH_COLLISION - Mask = 0x2000000000000 // 1 << 49 - Precache = GPUParticleCS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_TURBULENCE - Mask = 0x4000000000000 // 1 << 50 - Precache = GPUParticleCS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_UV_ANIMATION - Mask = 0x8000000000000 // 1 << 51 - Precache = ParticleVS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_NORMAL_MAP - Mask = 0x10000000000000 // 1 << 52 - Precache = ParticleVS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_GLOW_MAP - Mask = 0x20000000000000 // 1 << 53 - Precache = ParticleVS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_CUBEMAP_DEPTH_COLLISION - Mask = 0x40000000000000 // 1 << 54 - Precache = GPUParticleCS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_WRITEBACK_DEATH_LOCATIONS - Mask = 0x80000000000000 // 1 << 55 - Precache = GPUParticleCS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_TARGET_ATTRACTION - Mask = 0x100000000000000 // 1<< 56 - Precache = GPUParticleCS -} - -Property -{ - // Using the same mask as _RT_GPU_PARTICLE_TARGET_ATTRACTION as we have run out of them. - //It should be safe to do this as this flag is not used in the deferred lighting pass. - - Name = %_RT_DEFERRED_RENDER_TARGET_OPTIMIZATION - Mask = 0x100000000000000 // 1<< 56 - - Precache = DeferredPassPS - Precache = DeferredPassVS - Precache = DeferredLightPassPS - Precache = TiledShadingCS - Precache = LightPassPS - Precache = LightPassGmemPS - Precache = ConeTraceDiffusePS - Precache = VolumeLightInjectionCS - Precache = CubemapPassPS - Precache = CubemapPassGmemPS - Precache = DeferredShadowGmemPS - Precache = DeferredShadingPassPS - Precache = DeferredShadingPassGmemPS - Precache = AmbientPS - Precache = ShadowMaskGenVS - Precache = ShadowMaskGenPS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHAPE_ANGLE - Mask = 0x200000000000000 // 1 << 57 - Precache = GPUParticleCS -} - -Property -{ - - // Using the same mask as _RT_GPU_PARTICLE_SHAPE_ANGLE as we have run out of them. - //It should be safe to do this as this flag is not used in the deferred lighting pass. - - Name = %_RT_SLIM_GBUFFER - Mask = 0x200000000000000 // 1 << 57 - AutoPrecache - Precache = ShadowGenVS - Precache = ShadowGenPS - Precache = ZVS - Precache = ZPS - Precache = FogPassVolShadowsInterleavePassPS - Precache = GeneralPS - Precache = GeneralVS - Precache = SkinPS - Precache = SkinVS - Precache = HairPS - Precache = HairVS - Precache = EyePS - Precache = EyeVS - Precache = GlassPS - Precache = GlassVS - Precache = TerrainPS - Precache = TerrainVS - Precache = VegetationPS - Precache = VegetationHS - Precache = VegetationDS - Precache = VegetationVS - Precache = MotionBlurVS - Precache = MotionBlurPS - Precache = CausticsVS - Precache = ParticlePS - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - - Precache = PostMotionBlurVS - Precache = PostMotionBlurPS - Precache = PostSunShaftsPS - Precache = SpriteDilatePS - Precache = ShadowMaskGenPS - - Precache = HDRPostProcessVS - Precache = HDRPostProcessPS - Precache = FogPostProcessPS - Precache = PostProcessGameVS - Precache = PostProcessGamePS - - Precache = DistanceCloudsPS - Precache = DeferredLightPassPS - Precache = VolumeLightInjectionCS - Precache = HDRPostProcessPS - Precache = PostProcessGamePS - Precache = DeferredLightPassPS - Precache = DeferredPassPS - Precache = PostSunShaftsPS - Precache = PostMotionBlurPS - - Precache = WaterSurfaceVS - Precache = WaterSurfacePS - Precache = WaterSurfaceHS - Precache = WaterSurfaceDS - Precache = WaterFogVolume_PS - Precache = DeferredDecalPassPS - Precache = DeferredDecalEmissivePassPS - - Precache = BeamPS - Precache = LensOpticsPS - - Precache = DeferredShadingPassPS - Precache = DeferredPassVS - Precache = DeferredLightPassPS - Precache = TiledShadingCS - Precache = LightPassPS - Precache = ConeTraceDiffusePS - Precache = VolumeLightInjectionCS - Precache = CubemapPassPS - Precache = CubemapPassGmemPS - - Precache = DeferredSnowPS - Precache = DeferredRainPS - Precache = SSRCompositionPS - Precache = SSRRaytracePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHAPE_BOX - Mask = 0x400000000000000 // 1 << 58 - Precache = GPUParticleCS - Precache = ParticleVS -} - -Property -{ - // Using the same mask as _RT_GPU_PARTICLE_SHAPE_BOX as we have run out of them. - // It should be safe to do this as this (GPU Particles shouldn't have skinning) - - Name = %_RT_SKINNING_MATRIX - Mask = 0x400000000000000 // 1 << 58 - Precache = GeneralVS - Precache = SkinVS - Precache = HairVS - Precache = EyeVS - Precache = GlassVS - Precache = VegetationVS - Precache = ShadowGenVS - Precache = ZVS - Precache = MotionBlurVS - Precache = CausticsVS - Precache = CustomRenderVS - Precache = DebugPassVS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHAPE_POINT - Mask = 0x800000000000000 // 1 << 59 - Precache = GPUParticleCS -} - -Property -{ - //Using the same mask as _RT_GPU_PARTICLE_SHAPE_POINT as we have run out of them. - //It should be safe to do this as this flag is not used in the deferred lighting pass. - Name = %_RT_APPLY_SSDO - Mask = 0x800000000000000 // 1 << 59. - Precache = DeferredPassPS - Precache = DeferredPassVS - Precache = DeferredLightPassPS - Precache = TiledShadingCS -} - -//Using the same mask as _RT_APPLY_SSDO as we have run out of them. -//It should be safe to do this as this flag is not used in particle shaders. -Property -{ - Name = %_RT_FOG_VOLUME_HIGH_QUALITY_SHADER - Mask = 0x800000000000000 // 1 << 59 - Precache = ParticleVS - Precache = ParticleHS - Precache = ParticleDS - Precache = ParticlePS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHAPE_CIRCLE - Mask = 0x1000000000000000 // 1 << 60 - Precache = GPUParticleCS - Precache = ParticleVS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_SHAPE_SPHERE - Mask = 0x2000000000000000 // 1 << 61 - Precache = GPUParticleCS - Precache = ParticleVS -} - -Property -{ - Name = %_RT_GPU_PARTICLE_WIND - Mask = 0x4000000000000000 // 1 << 62 - Precache = GPUParticleCS - -} -Property -{ - Name = %_RT_MULTI_LAYER_ALPHA_BLEND - Mask = 0x8000000000000000 // 1 << 63 - Precache = FurShellPS - Precache = FurFinsPS - Precache = GlassPS - Precache = GeneralPS - Precache = HairPS - Precache = ParticlePS - Precache = MultiLayerAlphaBlendResolvePS -} - - diff --git a/Assets/Engine/Shaders/Scopes.ext b/Assets/Engine/Shaders/Scopes.ext deleted file mode 100644 index ae84db49ca..0000000000 --- a/Assets/Engine/Shaders/Scopes.ext +++ /dev/null @@ -1,42 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %REFLEX_SIGHT - Mask = 0x2 - Property (Reflex sight) - Description (New reflex sight version) -} - -Property -{ - Name = %SCOPE_ZOOMED_REFRACTION - Mask = 0x4 - Property (Scope zoomed refraction) - Description (Scope zoomed in refraction) -} - -Property -{ - Name = %HOLO_SIGHT - Mask = 0x8 - Property (Use holo sight depth) - Description (Holographic sight with depth modifier) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/ShaderProfiles.txt b/Assets/Engine/Shaders/ShaderProfiles.txt deleted file mode 100644 index ae5178118e..0000000000 --- a/Assets/Engine/Shaders/ShaderProfiles.txt +++ /dev/null @@ -1,11 +0,0 @@ - -Version (1.00) - -Profile 'Low' -{ -} - -Profile 'High' -{ - UseNormalAlpha -} diff --git a/Assets/Engine/Shaders/ShadowMaskGen.ext b/Assets/Engine/Shaders/ShadowMaskGen.ext deleted file mode 100644 index 6c65742d63..0000000000 --- a/Assets/Engine/Shaders/ShadowMaskGen.ext +++ /dev/null @@ -1,21 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: -// -//////////////////////////////////////////////////////////////////////////// - - - -Version (1.00) diff --git a/Assets/Engine/Shaders/SketchTerrain.ext b/Assets/Engine/Shaders/SketchTerrain.ext deleted file mode 100644 index 3dfad9d1cf..0000000000 --- a/Assets/Engine/Shaders/SketchTerrain.ext +++ /dev/null @@ -1,27 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %TEMP_TERRAIN - Mask = 0x40000000 - DependencySet = $UserEnabled - Hidden -} diff --git a/Assets/Engine/Shaders/SkyHDR.ext b/Assets/Engine/Shaders/SkyHDR.ext deleted file mode 100644 index 87d1a00ca5..0000000000 --- a/Assets/Engine/Shaders/SkyHDR.ext +++ /dev/null @@ -1,39 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// -Version (1.00) - -Property -{ - Name = %NO_MOON - Mask = 0x02 - Property (No moon) - Description (Sky dome doesn't render moon) -} -Property -{ - Name = %NO_NIGHT_SKY_GRADIENT - Mask = 0x04 - Property (No night sky gradient) - Description (Sky dome doesn't render night sky gradient) -} -Property -{ - Name = %NO_DAY_SKY_GRADIENT - Mask = 0x08 - Property (No day sky gradient) - Description (Sky dome doesn't render day sky gradient) -} diff --git a/Assets/Engine/Shaders/StarterGame_GeometryBeamScaling.ext b/Assets/Engine/Shaders/StarterGame_GeometryBeamScaling.ext deleted file mode 100644 index 25e395f42d..0000000000 --- a/Assets/Engine/Shaders/StarterGame_GeometryBeamScaling.ext +++ /dev/null @@ -1,43 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// - - -Property -{ - Name = %NOISE - Mask = 0x1 - Property (Dust & Turbulence) - Description (Add a dust overlay [spec map for dust, bump map for turbulence] ) -} - - -Property -{ - Name = %RECEIVE_SHADOWS - Mask = 0x2 - Property (Receive Shadows) - Description (Enable shadow receiving) -} - - -Property -{ - Name = %UV_VIGNETTING - Mask = 0x4 - Property (UV Vignetting) - Description (Enabling this will cause contents to fade out at UV boundaries) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/Statics.ext b/Assets/Engine/Shaders/Statics.ext deleted file mode 100644 index e7d93fbeaf..0000000000 --- a/Assets/Engine/Shaders/Statics.ext +++ /dev/null @@ -1,74 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %ST_GMEM_128BPP - Mask = 0x1 // 1 << 0 -} - -Property -{ - Name = %ST_GMEM_256BPP - Mask = 0x2 // 1 << 1 -} - -Property -{ - Name = %ST_GMEM_PLS - Mask = 0x4 // 1 << 2 -} - -Property -{ - Name = %ST_LLVM_DIRECTX_SHADER_COMPILER - Mask = 0x8 // 1 << 3 -} - -Property -{ - Name = %ST_FIXED_POINT - Mask = 0x10 // 1 << 4 -} - -Property -{ - Name = %ST_GMEM_RT_GREATER_FOUR - Mask = 0x20 // 1 << 5 -} - -Property -{ - Name = %ST_NO_DEPTH_CLIPPING - Mask = 0x40 // 1 << 6 -} - -Property -{ - Name = %ST_FEATURE_FETCH_DEPTHSTENCIL - Mask = 0x80 // 1 << 7 -} - -property -{ - Name = %ST_GMEM_VELOCITY_BUFFER - Mask = 0x100 // 1 << 8 -} - -property -{ - Name = %ST_GLES3_0 - Mask = 0x200 // 1 << 9 -} diff --git a/Assets/Engine/Shaders/TemplBeamProc.ext b/Assets/Engine/Shaders/TemplBeamProc.ext deleted file mode 100644 index 485702ace7..0000000000 --- a/Assets/Engine/Shaders/TemplBeamProc.ext +++ /dev/null @@ -1,34 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %NOISE - Mask = 0x1 - Property (Noise map) - Description (Use animated 3D noise) -} - -Property -{ - Name = %MUZZLEFLASH - Mask = 0x2 - Property (Muzzleflash) - Description (Use as muzzle flash) -} diff --git a/Assets/Engine/Shaders/Terrain.ext b/Assets/Engine/Shaders/Terrain.ext deleted file mode 100644 index 6e8b5dc6f3..0000000000 --- a/Assets/Engine/Shaders/Terrain.ext +++ /dev/null @@ -1,79 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: TerrainLayer shader extension used by the editor -// for automatic shader generation (based on "TerrainLayer" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x200 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %OFFSET_BUMP_MAPPING - Mask = 0x1000 - Property (Offset bump mapping) - Description (Use offset bump mapping (requires height map (_displ))) - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %DETAIL_MAPPING - Mask = 0x8000 - Property (Detail mapping) - Description (Use detail mapping) - DependencyReset = $TEX_Detail -} - -Property -{ - Name = %PARALLAX_OCCLUSION_MAPPING - Mask = 0x8000000 - Property (Parallax occlusion mapping) - Description (Use parallax occlusion mapping (requires height map (_displ))) - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %TEMP_TERRAIN - Mask = 0x40000000 - DependencySet = $UserEnabled - Hidden -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/Vegetation.ext b/Assets/Engine/Shaders/Vegetation.ext deleted file mode 100644 index 5f98ec49e6..0000000000 --- a/Assets/Engine/Shaders/Vegetation.ext +++ /dev/null @@ -1,137 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Vegetation extension used by the editor -// for automatic shader generation (based on "Vegetation" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -UsesCommonGlobalFlags - -Property -{ - Name = %NORMAL_MAP - Mask = 0x1 - Property (Normal map) - Description (Use normal-map texture) - DependencySet = $TEX_Normals - DependencyReset = $TEX_Normals - Hidden -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x10 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %LEAVES - Mask = 0x100 - Property (Leaves) - Description (Activate for leaves only ! Use leaf shading and leaves animation) -} - -Property -{ - Name = %GRASS - Mask = 0x2000 - Property (Grass) - Description (Activate for grass only ! Use simple grass rendering) -} - -Property -{ - Name = %SPEEDTREE_BILLBOARD - Mask = 0x40000 - Property (SpeedTree billboard) - Description (Activate for SpeedTree billboards only! Enables removal of non-camera-facing geometry from the billboard mesh) -} - -Property -{ - Name = %DETAIL_BENDING - Mask = 0x10000 - Property (Detail bending) - Description (Activate for leaves and grass only. Make sure to paint required vertex colors also) -} - -Property -{ - Name = %DETAIL_MAPPING - Mask = 0x20000 - Property (Detail mapping) - Description (Use detail mapping) - DependencyReset = $TEX_Detail -} - -Property -{ - Name = %BLENDLAYER - Mask = 0x80000 - Property (Blendlayer) - Description (Normal-mapped diffuse layer blended on top of base material) -} - -Property -{ - Name = %VERTCOLORS - Mask = 0x100000 - DependencySet = $UserEnabled - Hidden -} - -Property -{ - Name = %TEMP_VEGETATION - Mask = 0x8000000 - DependencySet = $UserEnabled - Hidden -} - -#ifdef FEATURE_MESH_TESSELLATION -Property -{ - Name = %DISPLACEMENT_MAPPING - Mask = 0x10000000 - Property (Displacement mapping) - Description (Use displacement mapping (requires height map (_displ))) - //DependencySet = $TEX_Height - DependencyReset = $TEX_Normals -} - -Property -{ - Name = %PHONG_TESSELLATION - Mask = 0x20000000 - Property (Phong tessellation) - Description (Use rough approximation of smooth surface subdivision) -} - -Property -{ - Name = %PN_TESSELLATION - Mask = 0x40000000 - Property (PN triangles tessellation) - Description (Use rough approximation of smooth surface subdivision) -} -#endif \ No newline at end of file diff --git a/Assets/Engine/Shaders/VolumeObject.ext b/Assets/Engine/Shaders/VolumeObject.ext deleted file mode 100644 index 8cab9b4270..0000000000 --- a/Assets/Engine/Shaders/VolumeObject.ext +++ /dev/null @@ -1,57 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: -// -//////////////////////////////////////////////////////////////////////////// - - - -Version (1.00) - -Property -{ - Name = %SOFT_OBJECT_INTERSECTION - Mask = 0x1 - Property (Soft Intersections) - Description (Enables soft intersections with opaque scene geometry) -} -Property -{ - Name = %BACK_LIGHTING - Mask = 0x2 - Property (Back Lighting) - Description (Adds back lighting to volume silhouette when viewing against sun) -} -Property -{ - Name = %JITTERING - Mask = 0x4 - Property (Jittering) - Description (Enables jittering on cloud steps) -} -Property -{ - Name = %SOFT_JITTERING - Mask = 0x8 - Property (Soft Jittering) - Description (Softens the effect of jittering on volume objects) -} -Property -{ - Name = %CUSTOM_SETTINGS - Mask = 0x10 - Property (Use TOD Settings) - Description (Use the custom cloud settings from the TOD for lighting) -} \ No newline at end of file diff --git a/Assets/Engine/Shaders/Water.ext b/Assets/Engine/Shaders/Water.ext deleted file mode 100644 index d44e3598e5..0000000000 --- a/Assets/Engine/Shaders/Water.ext +++ /dev/null @@ -1,62 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Water extension used by the editor -// for automatic shader generation (based on "Water" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %ENVIRONMENT_MAP - Mask = 0x4 - Property (Environment map) - Description (Use environment map instead of reflection) - DependencyReset = $TEX_EnvCM -} - -Property -{ - Name = %SUN_SHINE - Mask = 0x20 - Property (Sunshine) - Description (Activate for water sunshine) -} - -Property -{ - Name = %NO_REFRACTION_BUMP - Mask = 0x200 - Property (No refraction bump) - Description (Disables refraction bump) -} - -Property -{ - Name = %FOAM - Mask = 0x400 - Property (Foam) - Description (Enables foam) -} - -Property -{ - Name = %WATER_TESSELLATION_DX11 - Mask = 0x800 - DependencySet = $HW_WaterTessellation - DependencyReset = $HW_WaterTessellation - Hidden -} diff --git a/Assets/Engine/Shaders/WaterVolume.ext b/Assets/Engine/Shaders/WaterVolume.ext deleted file mode 100644 index dec9d1a531..0000000000 --- a/Assets/Engine/Shaders/WaterVolume.ext +++ /dev/null @@ -1,107 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Water extension used by the editor -// for automatic shader generation (based on "Water" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %SSREFL - Mask = 0x1 - Property (Realtime Reflection) - Description (Approximate realtime reflections) -} - -Property -{ - Name = %FLOW - Mask = 0x2 - Property (Water flow) - Description (Enable water to flow along geometry uvs) -} - -Property -{ - Name = %FLOW_MAP - Mask = 0x4 - Property (Water flow map) - Description (Enable water flow along a flow map) -} - -Property -{ - Name = %FLOW_MAP_STRENGTH - Mask = 0x100 - Property (Water flow map strength) - Description (Enable additional water flow strength controls - requires blue channel for strength) -} - -Property -{ - Name = %SUN_SPECULAR - Mask = 0x8 - Property (Sun specular) - Description (Activate for water sunshine) -} - -Property -{ - Name = %SPECULAR_MAP - Mask = 0x10 - Property (Specular map) - Description (Use specular map as separate texture) - DependencySet = $TEX_Specular - DependencyReset = $TEX_Specular - Hidden -} - -Property -{ - Name = %DEBUG_FLOW_MAP - Mask = 0x20 - Property (Debug flow map) - Description (Enable visualizing flow map) -} - -Property -{ - Name = %FOAM - Mask = 0x40 - Property (Foam) - Description (Enables foam) -} - -Property -{ - Name = %DECAL_MAP - Mask = 0x80 - Property (Decal map) - Description (Use tiling decal map as separate texture) - DependencySet = $TEX_Custom - DependencyReset = $TEX_Custom - Hidden -} - -Property -{ - Name = %WATER_TESSELLATION_DX11 - Mask = 0x80000000 - DependencySet = $HW_WaterTessellation - DependencyReset = $HW_WaterTessellation - Hidden -} diff --git a/Assets/Engine/Shaders/Waterfall.ext b/Assets/Engine/Shaders/Waterfall.ext deleted file mode 100644 index 8d0ff2cc73..0000000000 --- a/Assets/Engine/Shaders/Waterfall.ext +++ /dev/null @@ -1,45 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// -// All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -// its licensors. -// -// For complete copyright and license terms please see the LICENSE at the root of this -// distribution (the "License"). All use of this software is governed by the License, -// or, if provided, by the license below or the license accompanying this file. Do not -// remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// Original file Copyright Crytek GMBH or its affiliates, used under license. -// - -// Description: Water extension used by the editor -// for automatic shader generation (based on "Water" shader template) -// -//////////////////////////////////////////////////////////////////////////// - -Version (1.00) - -Property -{ - Name = %ENVIRONMENT_MAP - Mask = 0x1 - Property (Environment map) - Description (Use environment map as separate texture) - DependencyReset = $TEX_EnvCM -} - -Property -{ - Name = %SUN_SHADING - Mask = 0x2 - Property (Sun shading) - Description (Activate for water sunshading - for outdoors) -} - -Property -{ - Name = %FOAM - Mask = 0x4 - Property (Foam) - Description (Enables foam rendering) -} diff --git a/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_diff.tif.exportsettings b/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_diff.tif.exportsettings index 5c4c862583..b65133fbb0 100644 --- a/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_diff.tif.exportsettings +++ b/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /preset=AlbedoWithGenericAlpha /reduce="es3:2,ios:2,osx_gl:0,pc:0,provo:0" \ No newline at end of file +/autooptimizefile=0 /preset=AlbedoWithGenericAlpha /reduce="android:2,ios:2,mac:0,pc:0,provo:0" \ No newline at end of file diff --git a/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_sss.tif.exportsettings b/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_sss.tif.exportsettings index 441a11bc68..e8da408b36 100644 --- a/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_sss.tif.exportsettings +++ b/AutomatedTesting/Assets/Objects/Foliage/Textures/grass_atlas_sss.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /preset=Albedo /reduce="es3:3,ios:3,osx_gl:0,pc:0,provo:0" \ No newline at end of file +/autooptimizefile=0 /preset=Albedo /reduce="android:3,ios:3,mac:0,pc:0,provo:0" \ No newline at end of file diff --git a/AutomatedTesting/Config/aws_resource_mappings.json b/AutomatedTesting/Config/aws_resource_mappings.json new file mode 100644 index 0000000000..03a611b749 --- /dev/null +++ b/AutomatedTesting/Config/aws_resource_mappings.json @@ -0,0 +1,6 @@ +{ + "AWSResourceMappings": {}, + "AccountId": "", + "Region": "us-west-2", + "Version": "1.0.0" +} \ No newline at end of file diff --git a/AutomatedTesting/EngineFinder.cmake b/AutomatedTesting/EngineFinder.cmake index 1fdcef2b56..fbbe3d8cfe 100644 --- a/AutomatedTesting/EngineFinder.cmake +++ b/AutomatedTesting/EngineFinder.cmake @@ -20,31 +20,49 @@ if(json_error) message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}") endif() -# Read the list of paths from ~.o3de/o3de_manifest.json -file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows -if((NOT home_directory) OR (NOT EXISTS ${home_directory})) - file(TO_CMAKE_PATH "$ENV{HOME}" home_directory)# Unix +if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE}) + set(manifest_path $ENV{USERPROFILE}/.o3de/o3de_manifest.json) # Windows +else() + set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix endif() -if (NOT home_directory) - message(FATAL_ERROR "Cannot find user home directory, the o3de manifest cannot be found") -endif() -# Set manifest path to path in the user home directory -set(manifest_path ${home_directory}/.o3de/o3de_manifest.json) - +# Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object. +# Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path. if(EXISTS ${manifest_path}) file(READ ${manifest_path} manifest_json) - string(JSON engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines) + + string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path) if(json_error) - message(FATAL_ERROR "Unable to read key 'engines' from '${manifest_path}', error: ${json_error}") + message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}") endif() - math(EXPR engines_count "${engines_count}-1") - foreach(engine_path_index RANGE ${engines_count}) - string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines ${engine_path_index}) - if(${json_error}) - message(FATAL_ERROR "Unable to read engines[${engine_path_index}] '${manifest_path}', error: ${json_error}") + string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path) + if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT") + message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}") + endif() + + math(EXPR engines_path_count "${engines_path_count}-1") + foreach(engine_path_index RANGE ${engines_path_count}) + string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index}) + if(json_error) + message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}") + endif() + + if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name) + string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name}) + if(json_error) + message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}") + endif() + + if(engine_path) + list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake") + break() + endif() endif() - list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake") endforeach() +else() + # If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine + if(NOT CMAKE_MODULE_PATH) + message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'") + endif() endif() diff --git a/AutomatedTesting/Gem/Code/CMakeLists.txt b/AutomatedTesting/Gem/Code/CMakeLists.txt index 2bcc304bde..548aa51ad1 100644 --- a/AutomatedTesting/Gem/Code/CMakeLists.txt +++ b/AutomatedTesting/Gem/Code/CMakeLists.txt @@ -28,30 +28,41 @@ ly_add_target( Gem::Atom_AtomBridge.Static ) +# if enabled, AutomatedTesting is used by all kinds of applications +ly_create_alias(NAME AutomatedTesting.Builders NAMESPACE Gem TARGETS Gem::AutomatedTesting) +ly_create_alias(NAME AutomatedTesting.Tools NAMESPACE Gem TARGETS Gem::AutomatedTesting) +ly_create_alias(NAME AutomatedTesting.Clients NAMESPACE Gem TARGETS Gem::AutomatedTesting) +ly_create_alias(NAME AutomatedTesting.Servers NAMESPACE Gem TARGETS Gem::AutomatedTesting) + ################################################################################ # Gem dependencies ################################################################################ -ly_add_project_dependencies( - PROJECT_NAME - AutomatedTesting - TARGETS - AutomatedTesting.GameLauncher - DEPENDENCIES_FILES - runtime_dependencies.cmake - ${pal_dir}/runtime_dependencies.cmake -) -if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_project_dependencies( - PROJECT_NAME - AutomatedTesting - TARGETS - AssetBuilder - AssetProcessor - AssetProcessorBatch - Editor - DEPENDENCIES_FILES - tool_dependencies.cmake - ${pal_dir}/tool_dependencies.cmake - ) +# The GameLauncher uses "Clients" gem variants: +ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake + TARGETS AutomatedTesting.GameLauncher + VARIANTS Clients) + +# If we build a server, then apply the gems to the server +if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) + # if we're making a server, then add the "Server" gem variants to it: + ly_enable_gems(PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake + TARGETS AutomatedTesting.ServerLauncher + VARIANTS Servers) + + set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS AutomatedTesting) +endif() + +if (PAL_TRAIT_BUILD_HOST_TOOLS) + # The Editor uses "Tools" gem variants: + ly_enable_gems( + PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake + TARGETS Editor + VARIANTS Tools) + + # The pipeline tools use "Builders" gem variants: + ly_enable_gems( + PROJECT_NAME AutomatedTesting GEM_FILE enabled_gems.cmake + TARGETS AssetBuilder AssetProcessor AssetProcessorBatch + VARIANTS Builders) endif() diff --git a/AutomatedTesting/Gem/Code/enabled_gems.cmake b/AutomatedTesting/Gem/Code/enabled_gems.cmake new file mode 100644 index 0000000000..d99d17b55e --- /dev/null +++ b/AutomatedTesting/Gem/Code/enabled_gems.cmake @@ -0,0 +1,58 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(ENABLED_GEMS + ImGui + ScriptEvents + ExpressionEvaluation + Gestures + CertificateManager + DebugDraw + SceneProcessing + GraphCanvas + InAppPurchases + AutomatedTesting + EditorPythonBindings + QtForPython + PythonAssetBuilder + Metastream + AudioSystem + Camera + EMotionFX + PhysX + CameraFramework + StartingPointMovement + StartingPointCamera + ScriptCanvas + ScriptCanvasPhysics + ScriptCanvasTesting + LyShineExamples + StartingPointInput + PhysXDebug + WhiteBox + FastNoise + SurfaceData + GradientSignal + Vegetation + GraphModel + LandscapeCanvas + NvCloth + Blast + Maestro + TextureAtlas + LmbrCentral + LyShine + HttpRequestor + Atom_AtomBridge + AWSCore + AWSClientAuth + AWSMetrics +) diff --git a/AutomatedTesting/Gem/Code/runtime_dependencies.cmake b/AutomatedTesting/Gem/Code/runtime_dependencies.cmake deleted file mode 100644 index 280c25bcf7..0000000000 --- a/AutomatedTesting/Gem/Code/runtime_dependencies.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the License). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an AS IS BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -# Extracted from Game -set(GEM_DEPENDENCIES - Gem::Maestro - Gem::TextureAtlas - Gem::LmbrCentral - Gem::LyShine - Gem::HttpRequestor - Gem::ScriptEvents - Gem::ExpressionEvaluation - Gem::Gestures - Gem::CertificateManager - Gem::DebugDraw - Gem::AudioSystem - Gem::InAppPurchases - Gem::AutomatedTesting - Gem::Metastream - Gem::Camera - Gem::EMotionFX - Gem::PhysX - Gem::CameraFramework - Gem::StartingPointMovement - Gem::StartingPointCamera - Gem::ScriptCanvas - Gem::ImGui - Gem::LyShineExamples - Gem::StartingPointInput - Gem::ScriptCanvasPhysics - Gem::PhysXDebug - Gem::WhiteBox - Gem::FastNoise - Gem::SurfaceData - Gem::GradientSignal - Gem::Vegetation - Gem::Atom_AtomBridge - Gem::NvCloth - Gem::Blast -) diff --git a/AutomatedTesting/Gem/Code/tool_dependencies.cmake b/AutomatedTesting/Gem/Code/tool_dependencies.cmake deleted file mode 100644 index fc50707c12..0000000000 --- a/AutomatedTesting/Gem/Code/tool_dependencies.cmake +++ /dev/null @@ -1,58 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the License). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an AS IS BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -# Extracted from Editor.xml -set(GEM_DEPENDENCIES - Gem::Maestro.Editor - Gem::TextureAtlas - Gem::LmbrCentral.Editor - Gem::LyShine.Editor - Gem::HttpRequestor - Gem::ScriptEvents.Editor - Gem::ExpressionEvaluation - Gem::Gestures - Gem::CertificateManager - Gem::DebugDraw.Editor - Gem::SceneProcessing.Editor - Gem::GraphCanvas.Editor - Gem::InAppPurchases - Gem::AutomatedTesting - Gem::EditorPythonBindings.Editor - Gem::PythonAssetBuilder.Editor - Gem::Metastream - Gem::AudioSystem.Editor - Gem::Camera.Editor - Gem::EMotionFX.Editor - Gem::PhysX.Editor - Gem::CameraFramework - Gem::StartingPointMovement - Gem::StartingPointCamera - Gem::ScriptCanvas.Editor - Gem::ScriptEvents.Editor - Gem::ImGui.Editor - Gem::LyShineExamples - Gem::StartingPointInput.Editor - Gem::ScriptCanvasPhysics - Gem::ScriptCanvasTesting.Editor - Gem::PhysXDebug.Editor - Gem::WhiteBox.Editor - Gem::FastNoise.Editor - Gem::SurfaceData.Editor - Gem::GradientSignal.Editor - Gem::Vegetation.Editor - Gem::GraphModel.Editor - Gem::LandscapeCanvas.Editor - Gem::EMotionFX.Editor - Gem::ImGui.Editor - Gem::Atom_AtomBridge.Editor - Gem::NvCloth.Editor - Gem::Blast.Editor -) diff --git a/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt new file mode 100644 index 0000000000..f463210cb0 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/CMakeLists.txt @@ -0,0 +1,31 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +################################################################################ +# AWS Automated Tests +# Runs AWS Gems automation tests. +################################################################################ + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + # Enable after installing NodeJS and CDK on jenkins Windows AMI. + ly_add_pytest( + NAME AutomatedTesting::AWSTests + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/${PAL_PLATFORM_NAME}/ + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + AWS + ) +endif() diff --git a/Tests/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py old mode 100755 new mode 100644 similarity index 99% rename from Tests/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py index 6ed3dc4bda..8caef52682 --- a/Tests/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/__init__.py @@ -7,4 +7,5 @@ distribution (the "License"). All use of this software is governed by the Licens or, if provided, by the license below or the license accompanying this file. Do not remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" \ No newline at end of file +""" + diff --git a/Tests/BuildSystems/test_lib/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py old mode 100755 new mode 100644 similarity index 99% rename from Tests/BuildSystems/test_lib/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py index 6ed3dc4bda..8caef52682 --- a/Tests/BuildSystems/test_lib/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/__init__.py @@ -7,4 +7,5 @@ distribution (the "License"). All use of this software is governed by the Licens or, if provided, by the license below or the license accompanying this file. Do not remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" \ No newline at end of file +""" + diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk.py new file mode 100644 index 0000000000..455b3f94cb --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/cdk/cdk.py @@ -0,0 +1,155 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + +import os +import pytest +import boto3 + +import ly_test_tools.environment.process_utils as process_utils +from typing import List + + +class Cdk: + """ + Cdk class that provides methods to run cdk application commands. + Expects system to have NodeJS, AWS CLI and CDK installed globally and have their paths setup as env variables. + """ + def __init__(self, cdk_path: str, project: str, account_id: str, + workspace: pytest.fixture, session: boto3.session.Session): + """ + :param cdk_path: Path where cdk app.py is stored. + :param project: Project name used for cdk project name env variable. + :param account_id: AWS account id to use with cdk application. + :param workspace: ly_test_tools workspace fixture. + """ + self._cdk_env = os.environ.copy() + self._cdk_env['O3DE_AWS_PROJECT_NAME'] = project + self._cdk_env['O3DE_AWS_DEPLOY_REGION'] = session.region_name + self._cdk_env['O3DE_AWS_DEPLOY_ACCOUNT'] = account_id + self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH'] + + credentials = session.get_credentials().get_frozen_credentials() + self._cdk_env['AWS_ACCESS_KEY_ID'] = credentials.access_key + self._cdk_env['AWS_SECRET_ACCESS_KEY'] = credentials.secret_key + self._cdk_env['AWS_SESSION_TOKEN'] = credentials.token + self._stacks = [] + self._cdk_path = cdk_path + + output = process_utils.check_output( + 'python -m pip install -r requirements.txt', + cwd=self._cdk_path, + env=self._cdk_env, + shell=True) + + def list(self) -> List[str]: + """ + lists cdk stack names + :return List of cdk stack names + """ + + if not self._cdk_path: + return [] + + list_cdk_application_cmd = ['cdk', 'list'] + output = process_utils.check_output( + list_cdk_application_cmd, + cwd=self._cdk_path, + env=self._cdk_env, + shell=True) + + return output.splitlines() + + def synthesize(self) -> None: + """ + Synthesizes all cdk stacks + """ + if not self._cdk_path: + return + + list_cdk_application_cmd = ['cdk', 'synth'] + + process_utils.check_output( + list_cdk_application_cmd, + cwd=self._cdk_path, + env=self._cdk_env, + shell=True) + + def deploy(self, context_variable: str = '') -> List[str]: + """ + Deploys all the CDK stacks. + :param context_variable: Context variable for enabling optional features. + :return List of deployed stack arns. + """ + if not self._cdk_path: + return [] + + deploy_cdk_application_cmd = ['cdk', 'deploy', '--require-approval', 'never'] + if context_variable: + deploy_cdk_application_cmd.extend(['-c', f'{context_variable}']) + + output = process_utils.check_output( + deploy_cdk_application_cmd, + cwd=self._cdk_path, + env=self._cdk_env, + shell=True) + + stacks = [] + for line in output.splitlines(): + line_sections = line.split('/') + assert len(line_sections), 3 + stacks.append(line.split('/')[-2]) + + return stacks + + def destroy(self) -> None: + """ + Destroys the cdk application. + """ + destroy_cdk_application_cmd = ['cdk', 'destroy', '-f'] + process_utils.check_output( + destroy_cdk_application_cmd, + cwd=self._cdk_path, + env=self._cdk_env, + shell=True) + + self._stacks = [] + self._cdk_path = '' + + +@pytest.fixture(scope='function') +def cdk( + request: pytest.fixture, + project: str, + feature_name: str, + workspace: pytest.fixture, + aws_utils: pytest.fixture, + destroy_stacks_on_teardown: bool = True) -> Cdk: + """ + Fixture for setting up a Cdk + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param project: Project name used for cdk project name env variable. + :param feature_name: Feature gem name to expect cdk folder in. + :param workspace: ly_test_tools workspace fixture. + :param aws_utils: aws_utils fixture. + :param destroy_stacks_on_teardown: option to control calling destroy ot the end of test. + :return Cdk class object. + """ + + cdk_path = f'{workspace.paths.engine_root()}/Gems/{feature_name}/cdk' + cdk_obj = Cdk(cdk_path, project, aws_utils.assume_account_id(), workspace, aws_utils.assume_session()) + + def teardown(): + if destroy_stacks_on_teardown: + cdk_obj.destroy() + request.addfinalizer(teardown) + + return cdk_obj diff --git a/Tests/graphics/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py old mode 100755 new mode 100644 similarity index 99% rename from Tests/graphics/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py index 6ed3dc4bda..8caef52682 --- a/Tests/graphics/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/__init__.py @@ -7,4 +7,5 @@ distribution (the "License"). All use of this software is governed by the Licens or, if provided, by the license below or the license accompanying this file. Do not remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" \ No newline at end of file +""" + diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py new file mode 100644 index 0000000000..7b9c549f6c --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_anonymous_credentials.py @@ -0,0 +1,79 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" +import pytest +import os +import logging +import ly_test_tools.log.log_monitor + +from AWS.Windows.resource_mappings.resource_mappings import resource_mappings +from AWS.Windows.cdk.cdk import cdk +from AWS.common.aws_utils import aws_utils +from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor as asset_processor + +AWS_PROJECT_NAME = 'AWS-AutomationTest' +AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth' +AWS_CLIENT_AUTH_DEFAULT_PROFILE_NAME = 'default' + +GAME_LOG_NAME = 'Game.log' + +logger = logging.getLogger(__name__) + + +@pytest.mark.SUITE_periodic +@pytest.mark.usefixtures('automatic_process_killer') +@pytest.mark.usefixtures('asset_processor') +@pytest.mark.usefixtures('workspace') +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.parametrize('level', ['AWS/ClientAuth']) +@pytest.mark.usefixtures('cdk') +@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME]) +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('resource_mappings_filename', ['aws_resource_mappings.json']) +@pytest.mark.usefixtures('aws_utils') +@pytest.mark.parametrize('region_name', ['us-west-2']) +@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) +@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) +class TestAWSClientAuthAnonymousCredentials(object): + """ + Test class to verify AWS Cognito Identity pool anonymous authorization. + """ + + def test_anonymous_credentials(self, + level: str, + launcher: pytest.fixture, + cdk: pytest.fixture, + resource_mappings: pytest.fixture, + workspace: pytest.fixture, + asset_processor: pytest.fixture + ): + """ + Setup: Deploys cdk and updates resource mapping file. + Tests: Getting AWS credentials for no signed in user. + Verification: Log monitor looks for success credentials log. + """ + logger.info(f'Cdk stack names:\n{cdk.list()}') + stacks = cdk.deploy() + resource_mappings.populate_output_keys(stacks) + asset_processor.start() + asset_processor.wait_for_idle() + + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) + + launcher.args = ['+LoadLevel', level] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - Success anonymous credentials'], + unexpected_lines=['(Script) - Fail anonymous credentials'], + halt_on_unexpected=True, + ) + assert result, 'Anonymous credentials fetched successfully.' diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py new file mode 100644 index 0000000000..89b859dd0f --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/client_auth/test_password_signin.py @@ -0,0 +1,99 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" +import pytest +import os +import logging +import ly_test_tools.log.log_monitor + +from AWS.Windows.resource_mappings.resource_mappings import resource_mappings +from AWS.Windows.cdk.cdk import cdk +from AWS.common.aws_utils import aws_utils +from assetpipeline.ap_fixtures.asset_processor_fixture import asset_processor as asset_processor + +AWS_PROJECT_NAME = 'AWS-AutomationTest' +AWS_CLIENT_AUTH_FEATURE_NAME = 'AWSClientAuth' +AWS_CLIENT_AUTH_DEFAULT_PROFILE_NAME = 'default' + +GAME_LOG_NAME = 'Game.log' + +logger = logging.getLogger(__name__) + + +@pytest.mark.SUITE_periodic +@pytest.mark.usefixtures('automatic_process_killer') +@pytest.mark.usefixtures('asset_processor') +@pytest.mark.usefixtures('workspace') +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.usefixtures('cdk') +@pytest.mark.parametrize('feature_name', [AWS_CLIENT_AUTH_FEATURE_NAME]) +@pytest.mark.usefixtures('resource_mappings') +@pytest.mark.parametrize('resource_mappings_filename', ['aws_resource_mappings.json']) +@pytest.mark.usefixtures('aws_utils') +@pytest.mark.parametrize('region_name', ['us-west-2']) +@pytest.mark.parametrize('assume_role_arn', ['arn:aws:iam::645075835648:role/o3de-automation-tests']) +@pytest.mark.parametrize('session_name', ['o3de-Automation-session']) +class TestAWSClientAuthPasswordSignIn(object): + """ + Test class to verify AWS Cognito IDP Password sign in and Cognito Identity pool authenticated authorization. + """ + + def test_password_signin_credentials(self, + launcher: pytest.fixture, + cdk: pytest.fixture, + resource_mappings: pytest.fixture, + workspace: pytest.fixture, + asset_processor: pytest.fixture, + aws_utils: pytest.fixture + ): + """ + Setup: Deploys cdk and updates resource mapping file. + Tests: Sign up new test user, admin confirm the user, sign in and get aws credentials. + Verification: Log monitor looks for success credentials log. + """ + logger.info(f'Cdk stack names:\n{cdk.list()}') + stacks = cdk.deploy() + resource_mappings.populate_output_keys(stacks) + asset_processor.start() + asset_processor.wait_for_idle() + + file_to_monitor = os.path.join(launcher.workspace.paths.project_log(), GAME_LOG_NAME) + log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=launcher, log_file_path=file_to_monitor) + + launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignUp'] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - Signup Success'], + unexpected_lines=['(Script) - Signup Fail'], + halt_on_unexpected=True, + ) + assert result, 'Sign Up Success.' + + launcher.stop() + + cognito_idp = aws_utils.client('cognito-idp') + user_pool_id = resource_mappings.get_resource_name_id(f'{AWS_CLIENT_AUTH_FEATURE_NAME}.CognitoUserPoolId') + print(f'UserPoolId:{user_pool_id}') + cognito_idp.admin_confirm_sign_up( + UserPoolId=user_pool_id, + Username='test1' + ) + + launcher.args = ['+LoadLevel', 'AWS/ClientAuthPasswordSignIn'] + launcher.args.extend(['-rhi=null']) + + with launcher.start(launch_ap=False): + result = log_monitor.monitor_log_for_lines( + expected_lines=['(Script) - SignIn Success', '(Script) - Success credentials'], + unexpected_lines=['(Script) - SignIn Fail', '(Script) - Fail credentials'], + halt_on_unexpected=True, + ) + assert result, 'Sign in Success, fetched authenticated AWS temp credentials.' diff --git a/Tests/BuildSystems/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from Tests/BuildSystems/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/__init__.py diff --git a/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py new file mode 100644 index 0000000000..dc462e0556 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/Windows/resource_mappings/resource_mappings.py @@ -0,0 +1,148 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + +import os +from os.path import abspath +import pytest +import json +import logging + +logger = logging.getLogger(__name__) + +AWS_RESOURCE_MAPPINGS_KEY = 'AWSResourceMappings' +AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY = 'AccountId' +AWS_RESOURCE_MAPPINGS_REGION_KEY = 'Region' + + +class ResourceMappings: + """ + ResourceMappings class that handles writing Cloud formation outputs to resource mappings json file in a project. + """ + + def __init__(self, file_path: str, region: str, feature_name: str, account_id: str, workspace: pytest.fixture, + cloud_formation_client): + """ + :param file_path: Path for the resource mapping file. + :param region: Region value for the resource mapping file. + :param feature_name: Feature gem name to use to append name to mappings key. + :param account_id: AWS account id value for the resource mapping file. + :param workspace: ly_test_tools workspace fixture. + :param cloud_formation_client: AWS cloud formation client. + """ + self._cdk_env = os.environ.copy() + self._cdk_env['PATH'] = f'{workspace.paths.engine_root()}\\python;' + self._cdk_env['PATH'] + self._resource_mapping_file_path = file_path + self._region = region + self._feature_name = feature_name + self._account_id = account_id + self._resource_mappings = {} + + assert os.path.exists(self._resource_mapping_file_path), \ + f'Invalid resource mapping file path {self._resource_mapping_file_path}' + self._client = cloud_formation_client + + def populate_output_keys(self, stacks=[]) -> None: + """ + Calls describe stacks on cloud formation service and persists outputs to resource mappings file. + :param stacks List of stack arns to describe and populate resource mappings with. + """ + for stack_name in stacks: + response = self._client.describe_stacks( + StackName=stack_name + ) + stacks = response.get('Stacks', []) + assert len(stacks) == 1, f'{stack_name} is invalid.' + + self._write_resource_mappings(stacks[0].get('Outputs', [])) + + def _write_resource_mappings(self, outputs, append_feature_name = True) -> None: + with open(self._resource_mapping_file_path) as file_content: + resource_mappings = json.load(file_content) + + resource_mappings[AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY] = self._account_id + resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = self._region + + # Append new mappings. + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = resource_mappings.get(AWS_RESOURCE_MAPPINGS_KEY, {}) + + for output in outputs: + if append_feature_name: + resource_key = f'{self._feature_name}.{output.get("OutputKey", "InvalidKey")}' + else: + resource_key = output.get("OutputKey", "InvalidKey") + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key] = resource_mappings[ + AWS_RESOURCE_MAPPINGS_KEY].get(resource_key, {}) + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Type'] = 'AutomationTestType' + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID'] = output.get('OutputValue', + 'InvalidId') + + self._resource_mappings = resource_mappings + with open(self._resource_mapping_file_path, 'w') as file_content: + json.dump(resource_mappings, file_content, indent=4) + + def clear_output_keys(self) -> None: + """ + Clears values of all resource mapping keys. Sets region to default to us-west-2 + """ + with open(self._resource_mapping_file_path) as file_content: + resource_mappings = json.load(file_content) + + resource_mappings[AWS_RESOURCE_MAPPINGS_ACCOUNT_ID_KEY] = '' + resource_mappings[AWS_RESOURCE_MAPPINGS_REGION_KEY] = 'us-west-2' + + # Append new mappings. + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = resource_mappings.get(AWS_RESOURCE_MAPPINGS_KEY, {}) + resource_mappings[AWS_RESOURCE_MAPPINGS_KEY] = {} + + with open(self._resource_mapping_file_path, 'w') as file_content: + json.dump(resource_mappings, file_content, indent=4) + + self._resource_mapping_file_path = '' + self._region = '' + self._client = None + + def get_resource_name_id(self, resource_key: str): + return self._resource_mappings[AWS_RESOURCE_MAPPINGS_KEY][resource_key]['Name/ID'] + + +@pytest.fixture(scope='function') +def resource_mappings( + request: pytest.fixture, + project: str, + feature_name: str, + resource_mappings_filename: str, + workspace: pytest.fixture, + aws_utils: pytest.fixture) -> ResourceMappings: + """ + Fixture for setting up resource mappings file. + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param project: Project to find resource mapping file. + :param feature_name: AWS Gem name that is prepended to resource mapping keys. + :param resource_mappings_filename: Name of resource mapping file. + :param workspace: ly_test_tools workspace fixture. + :param aws_utils: AWS utils fixture. + :return: ResourceMappings class object. + """ + + path = f'{workspace.paths.engine_root()}/{project}/Config/{resource_mappings_filename}' + logger.info(f'Resource mapping path : {path}') + logger.info(f'Resource mapping resolved path : {abspath(path)}') + resource_mappings_obj = ResourceMappings(abspath(path), aws_utils.assume_session().region_name, feature_name, + aws_utils.assume_account_id(), workspace, + aws_utils.client('cloudformation')) + + def teardown(): + resource_mappings_obj.clear_output_keys() + + request.addfinalizer(teardown) + + return resource_mappings_obj diff --git a/Tests/ly_shared/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/__init__.py old mode 100755 new mode 100644 similarity index 99% rename from Tests/ly_shared/__init__.py rename to AutomatedTesting/Gem/PythonTests/AWS/__init__.py index 6ed3dc4bda..8caef52682 --- a/Tests/ly_shared/__init__.py +++ b/AutomatedTesting/Gem/PythonTests/AWS/__init__.py @@ -7,4 +7,5 @@ distribution (the "License"). All use of this software is governed by the Licens or, if provided, by the license below or the license accompanying this file. Do not remove or modify any license notices. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" \ No newline at end of file +""" + diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/__init__.py b/AutomatedTesting/Gem/PythonTests/AWS/common/__init__.py new file mode 100644 index 0000000000..8caef52682 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/__init__.py @@ -0,0 +1,11 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + diff --git a/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py new file mode 100644 index 0000000000..7a15ba0abe --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/AWS/common/aws_utils.py @@ -0,0 +1,82 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" +import boto3 +import pytest +import logging + +logger = logging.getLogger(__name__) + + +class AwsUtils: + + def __init__(self, arn: str, session_name: str, region_name: str): + local_session = boto3.Session(profile_name='default') + local_sts_client = local_session.client('sts') + self._local_account_id = local_sts_client.get_caller_identity()["Account"] + logger.info(f'Local Account Id: {self._local_account_id}') + + response = local_sts_client.assume_role(RoleArn=arn, RoleSessionName=session_name) + + self._assume_session = boto3.Session(aws_access_key_id=response['Credentials']['AccessKeyId'], + aws_secret_access_key=response['Credentials']['SecretAccessKey'], + aws_session_token=response['Credentials']['SessionToken'], + region_name=region_name) + + assume_sts_client = self._assume_session.client('sts') + assume_account_id = assume_sts_client.get_caller_identity()["Account"] + logger.info(f'Assume Account Id: {assume_account_id}') + self._assume_account_id = assume_account_id + + def client(self, service: str): + """ + Get the client for a specific AWS service from configured session + :return: Client for the AWS service. + """ + return self._assume_session.client(service) + + def assume_session(self): + return self._assume_session + + def local_account_id(self): + return self._local_account_id + + def assume_account_id(self): + return self._assume_account_id + + def destroy(self) -> None: + """ + clears stored session + """ + self._assume_session = None + + +@pytest.fixture(scope='function') +def aws_utils( + request: pytest.fixture, + assume_role_arn: str, + session_name: str, + region_name: str): + """ + Fixture for setting up a Cdk + :param request: _pytest.fixtures.SubRequest class that handles getting + a pytest fixture from a pytest function/fixture. + :param assume_role_arn: Role used to fetch temporary aws credentials, configure service clients with obtained credentials. + :param session_name: Session name to set. + :param region_name: AWS account region to set for session. + :return AWSUtils class object. + """ + aws_utils_obj = AwsUtils(assume_role_arn, session_name, region_name) + + def teardown(): + aws_utils_obj.destroy() + + request.addfinalizer(teardown) + + return aws_utils_obj diff --git a/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt new file mode 100644 index 0000000000..61bb2e8355 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/Blast/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::BlastTests + TEST_SUITE main + TEST_SERIAL TRUE + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT Blast + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt index 6f72d45893..8142691464 100644 --- a/AutomatedTesting/Gem/PythonTests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/CMakeLists.txt @@ -15,406 +15,50 @@ ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) +include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) + +## Asset pipeline ## add_subdirectory(assetpipeline) + +## Atom Renderer ## add_subdirectory(atom_renderer) ## Physics ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::PhysicsTests_Main - TEST_SUITE main - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Main.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Physics - ) - ly_add_pytest( - NAME AutomatedTesting::PhysicsTests_Periodic - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Periodic.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Physics - ) - ly_add_pytest( - NAME AutomatedTesting::PhysicsTests_Sandbox - TEST_SUITE sandbox - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/physics/TestSuite_Sandbox.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Physics - ) -endif() +add_subdirectory(physics) ## ScriptCanvas ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::ScriptCanvasTests - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Active.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - ScriptCanvas - ) - ly_add_pytest( - NAME AutomatedTesting::ScriptCanvasTests_Sandbox - TEST_SUITE sandbox - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/scripting/TestSuite_Sandbox.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - ) -endif() +add_subdirectory(scripting) ## White Box ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::WhiteBoxTests - TEST_SUITE main - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/WhiteBox/TestSuite_Active.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - WhiteBox - ) -endif() +add_subdirectory(WhiteBox) ## NvCloth ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::NvClothTests_Main - TEST_SUITE main - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/NvCloth/TestSuite_Active.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - NvCloth - ) -endif() +add_subdirectory(NvCloth) ## Prefab ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::PrefabTests - TEST_SUITE main - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/prefab/TestSuite_Main.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - ) -endif() +add_subdirectory(prefab) ## Editor Python Bindings ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::EditorPythonBindings - TEST_SUITE sandbox - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/EditorPythonBindings - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - Gem::EditorPythonBindings.Editor - COMPONENT TestTools - ) -endif() +add_subdirectory(EditorPythonBindings) ## Python Asset Builder ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::PythonAssetBuilder - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/PythonAssetBuilder - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - Gem::EditorPythonBindings.Editor - Gem::PythonAssetBuilder.Editor - COMPONENT TestTools - ) -endif() +add_subdirectory(PythonAssetBuilder) ## Blast ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::BlastTests - TEST_SUITE main - TEST_SERIAL TRUE - PATH ${CMAKE_CURRENT_LIST_DIR}/Blast/TestSuite_Active.py - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT Blast - ) -endif() - -############# +add_subdirectory(Blast) ## Large Worlds ## - -include(${pal_dir}/PAL_traits_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED) - -## DynVeg ## - # Temporarily moving all tests to periodic suite - SPEC-6553 - #ly_add_pytest( - # NAME AutomatedTesting::DynamicVegetationTests_Main - # TEST_SERIAL - # TEST_SUITE main - # PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - # PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" - # TIMEOUT 1500 - # RUNTIME_DEPENDENCIES - # AZ::AssetProcessor - # Legacy::Editor - # AutomatedTesting.GameLauncher - # AutomatedTesting.Assets - # COMPONENT - # LargeWorlds - #) - - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationTests_Sandbox - TEST_SERIAL - TEST_SUITE sandbox - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_sandbox" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_filter" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_modifier" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_regression" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_area" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_misc" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - - ly_add_pytest( - NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/dyn_veg - PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) -## LandscapeCanvas ## - # Temporarily moving all tests to periodic suite - SPEC-6553 - #ly_add_pytest( - # NAME AutomatedTesting::LandscapeCanvasTests_Main - # TEST_SERIAL - # TEST_SUITE main - # PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas - # PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" - # TIMEOUT 1500 - # RUNTIME_DEPENDENCIES - # AZ::AssetProcessor - # Legacy::Editor - # AutomatedTesting.Assets - # COMPONENT - # LargeWorlds - #) - - ly_add_pytest( - NAME AutomatedTesting::LandscapeCanvasTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/landscape_canvas - PYTEST_MARKS "SUITE_periodic" - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - -## GradientSignal ## - ly_add_pytest( - NAME AutomatedTesting::GradientSignalTests_Periodic - TEST_SERIAL - TEST_SUITE periodic - PATH ${CMAKE_CURRENT_LIST_DIR}/largeworlds/gradient_signal - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - Legacy::Editor - AutomatedTesting.Assets - COMPONENT - LargeWorlds - ) - -endif() +add_subdirectory(largeworlds) ## Editor ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_FOUNDATION_TEST_SUPPORTED) - ly_add_pytest( - NAME AutomatedTesting::EditorTests_Periodic - TEST_SUITE periodic - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/editor - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - Legacy::Editor - AZ::AssetProcessor - AutomatedTesting.Assets - COMPONENT - Editor - ) -endif() +add_subdirectory(editor) -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - # Unstable, SPEC-3838 will restore - #ly_add_pytest( - # NAME AutomatedTesting::asset_load_benchmark_test - # TEST_SERIAL - # TEST_SUITE benchmark - # PATH ${CMAKE_CURRENT_LIST_DIR}/streaming/benchmark/asset_load_benchmark_test.py - # RUNTIME_DEPENDENCIES - # AZ::AssetProcessor - # AZ::AssetProcessorBatch - # AutomatedTesting.GameLauncher - #) -endif() +## Streaming ## +add_subdirectory(streaming) ## Smoke ## -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_pytest( - NAME AutomatedTesting::SmokeTest - TEST_SUITE smoke - TEST_SERIAL - PATH ${CMAKE_CURRENT_LIST_DIR}/smoke - TIMEOUT 1500 - RUNTIME_DEPENDENCIES - AZ::AssetProcessor - AZ::PythonBindingsExample - Legacy::Editor - AutomatedTesting.GameLauncher - AutomatedTesting.Assets - COMPONENT - Smoke - ) -endif() +add_subdirectory(smoke) + +## AWS ## +# Enable when AWS Gems work on Linux and Android. +# add_subdirectory(AWS) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CMakeLists.txt new file mode 100644 index 0000000000..20a0ca8e65 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonBindings/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::EditorPythonBindings + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + Gem::EditorPythonBindings.Editor + COMPONENT TestTools + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_test_helper.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_test_helper.py index 74f34659c0..d375e69ac2 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_test_helper.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/editor_test_helper.py @@ -98,11 +98,6 @@ class EditorTestHelper: self.test_success = False success = False - # Turn off any display info like FPS, as that will mess up our image comparisons - # Turn off antialiasing as well - general.run_console("r_displayInfo=0") - general.run_console("r_antialiasingmode=0") - general.idle_wait(1.0) return success # Test Teardown 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 05614296b1..2feab75464 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 @@ -74,15 +74,23 @@ def add_component(componentName, entityId): typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', [componentName], entity.EntityType().Game) typeNamesList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeNames', typeIdsList) + + # If the type name comes back as empty, then it means componentName is invalid + if len(typeNamesList) != 1 or not typeNamesList[0]: + print('Unable to find component TypeId for {}'.format(componentName)) + return None + componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entityId, typeIdsList) + if not componentOutcome.IsSuccess(): + print('Failed to add {} component to entity'.format(typeNamesList[0])) + return None + isActive = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', componentOutcome.GetValue()[0]) hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', entityId, typeIdsList[0]) - if componentOutcome.IsSuccess() and isActive: + if isActive: print('{} component was added to entity'.format(typeNamesList[0])) - elif componentOutcome.IsSuccess() and not isActive: + else: print('{} component was added to entity, but the component is disabled'.format(typeNamesList[0])) - elif not componentOutcome.IsSuccess(): - print('Failed to add {} component to entity'.format(typeNamesList[0])) if hasComponent: print('Entity has a {} component'.format(typeNamesList[0])) return componentOutcome.GetValue()[0] @@ -218,7 +226,8 @@ class Entity: def add_component(self, component): new_component = add_component(component, self.id) - self.components.append(new_component) + if new_component: + self.components.append(new_component) def add_component_of_type(self, componentTypeId): new_component = add_component_of_type(componentTypeId, self.id) diff --git a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/pyside_utils.py b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/pyside_utils.py index 10f060bba6..eed6a18614 100644 --- a/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/pyside_utils.py +++ b/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools/editor_python_test_tools/pyside_utils.py @@ -18,7 +18,6 @@ from PySide2 import QtCore, QtWidgets, QtGui, QtTest from PySide2.QtWidgets import QAction, QWidget from PySide2.QtCore import Qt from PySide2.QtTest import QTest -import azlmbr.legacy.general as general import traceback import threading import types diff --git a/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt new file mode 100644 index 0000000000..058cc9ad94 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/NvCloth/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::NvClothTests_Main + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + NvCloth + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py index 818dc23079..ecf08cfcbd 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test.py @@ -31,13 +31,13 @@ class TestPythonAssetProcessing(object): unexpected_lines = [] expected_lines = [ 'Mock asset exists', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel) found', - 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel) found' + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative.azmodel) found', + 'Expected subId for asset (gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center.azmodel) found' ] timeout = 180 halt_on_unexpected = False diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py index cd9adfdbcf..a7907778b2 100644 --- a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/AssetBuilder_test_case.py @@ -38,16 +38,16 @@ def test_azmodel_product(generatedModelAssetPath, expectedSubId): assetId = azlmbr.asset.AssetCatalogRequestBus(azlmbr.bus.Broadcast, 'GetAssetIdByPath', generatedModelAssetPath, azModelAssetType, False) assetIdString = assetId.to_string() if (assetIdString.endswith(':' + expectedSubId) is False): - raise_and_stop(f'Asset has unexpected asset ID ({assetIdString}) for ({generatedModelAssetPath})!') + raise_and_stop(f'Asset at path {generatedModelAssetPath} has unexpected asset ID ({assetIdString}) for ({generatedModelAssetPath}), expected {expectedSubId}!') else: print(f'Expected subId for asset ({generatedModelAssetPath}) found') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive_1.azmodel', '10315ae0') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative_1.azmodel', '10661093') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive_1.azmodel', '10af8810') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative_1.azmodel', '10f8c263') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive_1.azmodel', '100ac47f') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative_1.azmodel', '105d8e0c') -test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center_1.azmodel', '1002d464') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_positive.azmodel', '1024be55') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_z_negative.azmodel', '1052c94e') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_positive.azmodel', '10130556') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_y_negative.azmodel', '1065724d') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_positive.azmodel', '10d16e68') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_x_negative.azmodel', '10a71973') +test_azmodel_product('gem/pythontests/pythonassetbuilder/geom_group_fbx_cube_100cm_center.azmodel', '10412075') azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'ExitNoPrompt') diff --git a/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt new file mode 100644 index 0000000000..0a550de539 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/PythonAssetBuilder/CMakeLists.txt @@ -0,0 +1,27 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::PythonAssetBuilder + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + Gem::EditorPythonBindings.Editor + Gem::PythonAssetBuilder.Editor + COMPONENT TestTools + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt new file mode 100644 index 0000000000..a6c0a9aa21 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/WhiteBox/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::WhiteBoxTests + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Active.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + WhiteBox + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/CMakeLists.txt index 74ef6c97a7..f453a38486 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/CMakeLists.txt @@ -13,8 +13,6 @@ add_subdirectory(asset_processor_tests) if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ## AP Python Tests ## - - ly_add_pytest( NAME AssetPipelineTests.AuxiliaryContent PATH ${CMAKE_CURRENT_LIST_DIR}/auxiliary_content_tests/auxiliary_content_tests.py @@ -22,7 +20,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) TEST_SUITE periodic ) - ly_add_pytest( NAME AssetPipelineTests.BankInfoParser PATH ${CMAKE_CURRENT_LIST_DIR}/wwise_bank_dependency_tests/bank_info_parser_tests.py @@ -33,4 +30,3 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) ) endif() - diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_all_platforms_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_all_platforms_setup_fixture.py index e729ee9882..9a5b93ca80 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_all_platforms_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/ap_all_platforms_setup_fixture.py @@ -34,10 +34,10 @@ def ap_all_platforms_setup_fixture(request, workspace, ap_setup_fixture) -> Dict # Specific platform cache locations resources["pc_cache_location"] = os.path.join(cache_dir, "pc") - resources["es3_cache_location"] = os.path.join(cache_dir, "es3") + resources["android_cache_location"] = os.path.join(cache_dir, "android") resources["ios_cache_location"] = os.path.join(cache_dir, "ios") - resources["osx_gl_cache_location"] = os.path.join(cache_dir, "osx_gl") + resources["mac_cache_location"] = os.path.join(cache_dir, "mac") resources["provo_cache_location"] = os.path.join(cache_dir, "provo") - resources["all_platforms"] = ["pc", "es3", "ios", "osx_gl", "provo"] + resources["all_platforms"] = ["pc", "android", "ios", "mac", "provo"] return resources diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py index 580816e7b5..34af4d9115 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/ap_fixtures/bundler_batch_setup_fixture.py @@ -54,7 +54,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> platforms = [platform.strip() for platform in platforms.split(",")] else: # No commandline argument provided, default to mac and pc - platforms = ["pc", "osx_gl"] + platforms = ["pc", "mac"] class BundlerBatchFixture: """ @@ -162,7 +162,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> else: cmd.append(f"--{key}") if append_defaults: - cmd.append(f"--project={workspace.project}") + cmd.append(f"--project-path={workspace.project}") return cmd # ****** @@ -241,11 +241,11 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> def get_platform_flag(self, platform_name: str) -> int: if (platform_name == "pc"): return 1 - elif (platform_name == "es3"): + elif (platform_name == "android"): return 2 elif (platform_name == "ios"): return 4 - elif (platform_name == "osx_gl"): + elif (platform_name == "mac"): return 8 elif (platform_name == "server"): return 128 @@ -300,9 +300,9 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> workspace.paths.engine_root(), "Code", "Framework", - "AzFramework", - "AzFramework", - "Platform", + "AzCore", + "AzCore", + "PlatformId", "PlatformDefaults.h", ) @@ -318,7 +318,7 @@ def bundler_batch_setup_fixture(request, workspace, asset_processor, timeout) -> if start_gathering: result = get_platform.match(line) # Try the regex if result: - platform_values[result.group(1).lower()] = counter + platform_values[result.group(1).replace("_ID", "").lower()] = counter counter = counter << 1 elif "(Invalid, -1)" in line: # The line right before the first platform start_gathering = True diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt index 6a865ee690..a2002f2d15 100644 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/CMakeLists.txt @@ -141,4 +141,3 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) # ) endif() - 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 d236e87aa2..1043bbaefa 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 @@ -302,7 +302,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): that generating debug information does not affect asset list creation """ helper = bundler_batch_helper - seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list + seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list asset = r"levels\testdependencieslevel\level.pak" # Create Asset list @@ -377,7 +377,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): subcommands. """ helper = bundler_batch_helper - seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list + seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list asset = r"levels\testdependencieslevel\level.pak" # Useful bundle locations / names (2 for comparing contents) @@ -460,12 +460,12 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): """ helper = bundler_batch_helper # fmt:off - assert "pc" in helper["platforms"] and "osx_gl" in helper["platforms"], \ + assert "pc" in helper["platforms"] and "mac" in helper["platforms"], \ "This test requires both PC and MAC platforms to be enabled. " \ - "Please rerun with commandline option: '--bundle_platforms=pc,osx_gl'" + "Please rerun with commandline option: '--bundle_platforms=pc,mac'" # fmt:on - seed_list = os.path.join(workspace.paths.engine_root(), "Engine", "SeedAssetList.seed") # Engine seed list + seed_list = os.path.join(workspace.paths.engine_root(), "Assets", "Engine", "SeedAssetList.seed") # Engine seed list # Useful bundle / asset list locations bundle_dir = os.path.dirname(helper["bundle_file"]) @@ -502,21 +502,21 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): for bundle_file in bundle_files.values(): assert os.path.isfile(bundle_file) - # This asset is created on osx_gl platform but not on windows - file_to_check = b"engineassets/shading/defaultprobe_cm.dds.5" # [use byte str because file is in binary] + # This asset is created both on mac and windows platform + file_to_check = b"engineassets/shading/defaultprobe_cm_ibldiffuse.tif.streamingimage" # [use byte str because file is in binary] # Extract the delta catalog file from pc archive. {file_to_check} SHOULD NOT be present for PC file_contents = helper.extract_file_content(bundle_files["pc"], "DeltaCatalog.xml") # fmt:off - assert file_to_check not in file_contents, \ + assert file_to_check in file_contents, \ f"{file_to_check} was found in DeltaCatalog.xml in pc bundle file {bundle_files['pc']}" # fmt:on - # Extract the delta catalog file from osx_gl archive. {file_to_check} SHOULD be present for MAC - file_contents = helper.extract_file_content(bundle_files["osx_gl"], "DeltaCatalog.xml") + # Extract the delta catalog file from mac archive. {file_to_check} SHOULD be present for MAC + file_contents = helper.extract_file_content(bundle_files["mac"], "DeltaCatalog.xml") # fmt:off assert file_to_check in file_contents, \ - f"{file_to_check} was not found in DeltaCatalog.xml in darwin bundle file {bundle_files['osx_gl']}" + f"{file_to_check} was not found in DeltaCatalog.xml in darwin bundle file {bundle_files['mac']}" # fmt:on # Gather checksums for first set of bundles @@ -613,20 +613,20 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): helper.call_seeds( seedListFile=helper["seed_list_file"], addSeed=test_asset, - platform="pc,osx_gl", + platform="pc,mac", ) # Validate both mac and pc are activated for seed # fmt:off check_seed_platform(helper["seed_list_file"], test_asset, - helper["platform_values"]["pc"] + helper["platform_values"]["osx"]) + helper["platform_values"]["pc"] + helper["platform_values"]["mac"]) # fmt:on # Remove MAC platform helper.call_seeds( seedListFile=helper["seed_list_file"], removePlatformFromSeeds="", - platform="osx_gl", + platform="mac", ) # Validate only pc platform for seed. Save file contents to variable all_lines = check_seed_platform(helper["seed_list_file"], test_asset, helper["platform_values"]["pc"]) @@ -646,12 +646,12 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): helper.call_seeds( seedListFile=helper["seed_list_file"], addPlatformToSeeds="", - platform="osx_gl", + platform="mac", ) # Validate Mac platform was added back on. Save file contents # fmt:off all_lines = check_seed_platform(helper["seed_list_file"], test_asset, - helper["platform_values"]["pc"] + helper["platform_values"]["osx"]) + helper["platform_values"]["pc"] + helper["platform_values"]["mac"]) # fmt:on # Try to remove platform without specifying a platform to remove (should fail) @@ -670,7 +670,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): helper.call_seeds( seedListFile=helper["seed_list_file"], removeSeed=test_asset, - platform="pc,osx_gl", + platform="pc,mac", ) # Validate seed was removed from file @@ -697,9 +697,9 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): env = ap_setup_fixture # fmt:off - assert "pc" in helper["platforms"] and "osx_gl" in helper["platforms"], \ + assert "pc" in helper["platforms"] and "mac" in helper["platforms"], \ "This test requires both PC and MAC platforms to be enabled. " \ - "Please rerun with commandline option: '--bundle_platforms=pc,osx_gl'" + "Please rerun with commandline option: '--bundle_platforms=pc,mac'" # fmt:on # Test assets arranged in common lists: six (0-5) .txt files and .dat files @@ -717,16 +717,16 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): file_platforms = { "txtfile_0.txt": "pc", "txtfile_1.txt": "pc", - "txtfile_2.txt": "pc,osx_gl", - "txtfile_3.txt": "pc,osx_gl", - "txtfile_4.txt": "osx_gl", - "txtfile_5.txt": "osx_gl", + "txtfile_2.txt": "pc,mac", + "txtfile_3.txt": "pc,mac", + "txtfile_4.txt": "mac", + "txtfile_5.txt": "mac", "datfile_0.dat": "pc", "datfile_1.dat": "pc", - "datfile_2.dat": "pc,osx_gl", - "datfile_3.dat": "pc,osx_gl", - "datfile_4.dat": "osx_gl", - "datfile_5.dat": "osx_gl", + "datfile_2.dat": "pc,mac", + "datfile_3.dat": "pc,mac", + "datfile_4.dat": "mac", + "datfile_5.dat": "mac", } # Comparison rules files and their associated 'comparisonType' flags @@ -741,7 +741,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Get our test assets ready and processed utils.prepare_test_assets(env["tests_dir"], "C16877178", env["project_test_assets_dir"]) - asset_processor.batch_process(timeout=timeout, fastscan=False, platforms="pc,osx_gl") + asset_processor.batch_process(timeout=timeout, fastscan=False, platforms="pc,mac") # *** Some helper functions *** # @@ -759,7 +759,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): helper.call_assetLists( assetListFile=os.path.join(helper["test_dir"], asset_list_file_name), seedListFile=os.path.join(helper["test_dir"], seed_file_name), - platform="pc,osx_gl", + platform="pc,mac", ) def get_platform_assets(asset_name_list: List[str]) -> Dict[str, List[str]]: @@ -769,7 +769,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): for asset_name in asset_name_list: if "pc" in file_platforms[asset_name]: win_assets.append(asset_name) - if "osx_gl" in file_platforms[asset_name]: + if "mac" in file_platforms[asset_name]: mac_assets.append(asset_name) return {"win": win_assets, "mac": mac_assets} @@ -798,7 +798,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # Get platform result file names win_asset_list_file = helper.platform_file_name(request_file, platforms["pc"]) - mac_asset_list_file = helper.platform_file_name(request_file, platforms["osx_gl"]) + mac_asset_list_file = helper.platform_file_name(request_file, platforms["mac"]) # Get expected platforms for each asset in asset_names platform_files = get_platform_assets(asset_names) @@ -879,14 +879,14 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # fmt:on # End verify_asset_list_contents() - def run_compare_command_and_verify(platform_arg: str, expect_pc_output: bool, expect_osx_gl_output: bool) -> None: + def run_compare_command_and_verify(platform_arg: str, expect_pc_output: bool, expect_mac_output: bool) -> None: # Expected asset list to equal result of comparison expected_pc_asset_list = None - expected_osx_gl_asset_list = None + expected_mac_asset_list = None # Last output file. Use this for comparison to 'expected' output_pc_asset_list = None - output_osx_gl_asset_list = None + output_mac_asset_list = None # Add the platform to the file name to match what the Bundler will create last_output_arg = output_arg.split(",")[-1] @@ -895,10 +895,10 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): expected_pc_asset_list = os.path.join(helper["test_dir"], helper.platform_file_name(expected_asset_list, platform)) output_pc_asset_list = helper.platform_file_name(last_output_arg, platform) - if expect_osx_gl_output: - platform = platforms["osx_gl"] - expected_osx_gl_asset_list = os.path.join(helper["test_dir"], helper.platform_file_name(expected_asset_list, platform)) - output_osx_gl_asset_list = helper.platform_file_name(last_output_arg, platform) + if expect_mac_output: + platform = platforms["mac"] + expected_mac_asset_list = os.path.join(helper["test_dir"], helper.platform_file_name(expected_asset_list, platform)) + output_mac_asset_list = helper.platform_file_name(last_output_arg, platform) # Build execution command cmd = generate_compare_command(platform_arg) @@ -911,15 +911,15 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): verify_asset_list_contents(expected_pc_asset_list, output_pc_asset_list) fs.delete([output_pc_asset_list], True, True) - if expect_osx_gl_output: - verify_asset_list_contents(expected_osx_gl_asset_list, output_osx_gl_asset_list) - fs.delete([output_osx_gl_asset_list], True, True) + if expect_mac_output: + verify_asset_list_contents(expected_mac_asset_list, output_mac_asset_list) + fs.delete([output_mac_asset_list], True, True) # End run_compare_command_and_verify() # Generate command, run and validate for each platform run_compare_command_and_verify("pc", True, False) - run_compare_command_and_verify("osx_gl", False, True) - run_compare_command_and_verify("pc,osx_gl", True, True) + run_compare_command_and_verify("mac", False, True) + run_compare_command_and_verify("pc,mac", True, True) #run_compare_command_and_verify(None, True, True) # End compare_and_check() @@ -1046,7 +1046,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): "--addDefaultSeedListFiles", "--platform=pc", "--print", - f"--project={workspace.project}" + f"--project-path={workspace.project}" ], universal_newlines=True, ) @@ -1115,7 +1115,7 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): bundle_result_path = os.path.join(bundles_folder, helper.platform_file_name("bundle.pak", workspace.asset_processor_platform)) - bundle_cache_path = os.path.join(workspace.paths.platform_cache(), workspace.project, + bundle_cache_path = os.path.join(workspace.paths.platform_cache(), "Bundles", helper.platform_file_name("bundle.pak", workspace.asset_processor_platform)) @@ -1156,13 +1156,15 @@ class TestsAssetBundlerBatch_WindowsAndMac(object): # fmt:off def test_WindowsAndMac_FilesMarkedSkip_FilesAreSkipped(self, workspace, bundler_batch_helper): expected_assets = [ - "libs/particles/milestone2particles.xml", - "textures/milestone2/particles/fx_sparkstreak_01.dds" + "ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas", + "ui/textures/prefab/button_normal.sprite" ] bundler_batch_helper.call_assetLists( assetListFile=bundler_batch_helper['asset_info_file_request'], - addSeed="libs/particles/milestone2particles.xml", - skip="textures/milestone2/particles/fx_launchermuzzlering_01.dds,textures/milestone2/particles/fx_launchermuzzlefront_01.dds" + addSeed="ui/canvases/lyshineexamples/animation/multiplesequences.uicanvas", + skip="ui/textures/prefab/button_disabled.sprite,ui/scripts/lyshineexamples/animation/multiplesequences.luac," + "ui/textures/prefab/tooltip_sliced.sprite,ui/scripts/lyshineexamples/unloadthiscanvasbutton.luac,fonts/vera.fontfamily,fonts/vera-italic.font," + "fonts/vera.font,fonts/vera-bold.font,fonts/vera-bold-italic.font,fonts/vera-italic.ttf,fonts/vera.ttf,fonts/vera-bold.ttf,fonts/vera-bold-italic.ttf" ) assert os.path.isfile(bundler_batch_helper["asset_info_file_result"]) assets_in_list = [] diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py index 50b3af1438..0d830b39e2 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/asset_processor_batch_tests.py @@ -102,7 +102,7 @@ class TestsAssetProcessorBatch_AllPlatforms(object): def test_RunAPBatch_TwoPlatforms_ExitCodeZero(self, asset_processor): asset_processor.create_temp_asset_root() asset_processor.enable_asset_processor_platform("pc") - asset_processor.enable_asset_processor_platform("osx_gl") + asset_processor.enable_asset_processor_platform("mac") result, _ = asset_processor.batch_process() assert result, "AP Batch failed" diff --git a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py index 6cc3484d96..432b6cdfc8 100755 --- a/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py +++ b/AutomatedTesting/Gem/PythonTests/assetpipeline/asset_processor_tests/missing_dependency_tests.py @@ -84,10 +84,11 @@ class TestsMissingDependencies_WindowsAndMac(object): """Run a single test""" for asset_platform in platforms: - db_product = db_utils.get_product_id_from_relative(self._workspace, source_product, asset_platform) + db_product_path = db_utils.get_db_product_path(self._workspace, source_product, asset_platform) + db_product = db_utils.get_product_id(self._missing_dep_helper.asset_db, db_product_path) if db_product: db_utils.clear_missing_dependencies(self._missing_dep_helper.asset_db, db_product) - expected_product = os.path.join(self._workspace.project, source_product).lower() + expected_product = source_product.lower() dependency_search_params = [f"--dsp={dsp_param}", "--zeroAnalysisMode"] if max_iterations: @@ -112,17 +113,26 @@ class TestsMissingDependencies_WindowsAndMac(object): # Expected missing dependencies expected_dependencies = [ # String Asset # - ("06E9D6633C875400A532BCB2C0CA19D6", "{06E9D663-3C87-5400-A532-BCB2C0CA19D6}:0"), - ("1CB10C43F3245B93A294C602ADEF95F9:[0", "{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0"), - ("58BE9DA51F1753B98CEEEEB10E63454D", "{58BE9DA5-1F17-53B9-8CEE-EEB10E63454D}:914f19b7"), - ("6BDE282B49C957F7B0714B26579BCA9A", "{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0"), - ("747D31D71E62553592226173C49CF97E", "{747D31D7-1E62-5535-9222-6173C49CF97E}:1"), - ("747D31D71E62553592226173C49CF97E", "{747D31D7-1E62-5535-9222-6173C49CF97E}:2"), - ("9886E132-572D-5746-9377-E629AB6C1981", "{9886E132-572D-5746-9377-E629AB6C1981}:0"), - ("33bcee02F3225688ABEE534F6058593F", "{33BCEE02-F322-5688-ABEE-534F6058593F}:0"), - ("B92667DC-9F5B-5D72-A29D-99219DD9B691", "{B92667DC-9F5B-5D72-A29D-99219DD9B691}:0"), - ("D92C4661C8985E19BD3597CB2318CFA6:[0", "{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0"), - ("7364AB2B092F5B0B80601BBC6E53087C", "{7364AB2B-092F-5B0B-8060-1BBC6E53087C}:0"), + ('1CB10C43F3245B93A294C602ADEF95F9:[0', '{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0'), + ('33bcee02F3225688ABEE534F6058593F', '{33BCEE02-F322-5688-ABEE-534F6058593F}:0'), + ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3e8'), + ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3ea'), + ('345E5C660D6254FF8D0F7C8EE66A2249', '{345E5C66-0D62-54FF-8D0F-7C8EE66A2249}:3eb'), + ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3e8'), + ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3ea'), + ('37108522F50459499CD6C8D47A960CF1', '{37108522-F504-5949-9CD6-C8D47A960CF1}:3eb'), + ('6BDE282B49C957F7B0714B26579BCA9A', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'), + ('747D31D71E62553592226173C49CF97E', '{747D31D7-1E62-5535-9222-6173C49CF97E}:1'), + ('747D31D71E62553592226173C49CF97E', '{747D31D7-1E62-5535-9222-6173C49CF97E}:2'), + ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3e8'), + ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3ea'), + ('A26C73D1837E5AE59E68F916FA7C3699', '{A26C73D1-837E-5AE5-9E68-F916FA7C3699}:3eb'), + ('B076CDDC-14DF-50F4-A5E9-7518ABB3E851', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'), + ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3e8'), + ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3ea'), + ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3eb'), + ('C67BEA9F-09FF-59AA-A7F0-A52B8F987508', '{C67BEA9F-09FF-59AA-A7F0-A52B8F987508}:3ec'), + ('D92C4661C8985E19BD3597CB2318CFA6:[0', '{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0'), ] self.do_missing_dependency_test(expected_product, expected_dependencies, "%ValidUUIDsNotDependency.txt") @@ -151,9 +161,9 @@ class TestsMissingDependencies_WindowsAndMac(object): # Expected missing dependencies expected_dependencies = [ # String Asset # - ("2ef92b8D044E5C278E2BB1AC0374A4E7:131072", "{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:20000"), - ("A2482826-053D-5634-A27B-084B1326AAE5}:[196608", "{A2482826-053D-5634-A27B-084B1326AAE5}:30000"), - ("D83B36F1-61A6-5001-B191-4D0CE282E236}-327680", "{D83B36F1-61A6-5001-B191-4D0CE282E236}:50000"), + ('2ef92b8D044E5C278E2BB1AC0374A4E7:1003', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3eb'), + ('A2482826-053D-5634-A27B-084B1326AAE5}:[1002', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'), + ('D83B36F1-61A6-5001-B191-4D0CE282E236}-1002', '{D83B36F1-61A6-5001-B191-4D0CE282E236}:3ea'), ] self.do_missing_dependency_test(expected_product, expected_dependencies, @@ -186,16 +196,13 @@ class TestsMissingDependencies_WindowsAndMac(object): # Expected missing dependencies expected_dependencies = [ # String Asset # - ("Config/Editor.xml", "{06E9D663-3C87-5400-A532-BCB2C0CA19D6}:0"), - (r"TestAssets\WildcardScanTest1.txt", "{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0"), - ("TestAssets/RelativeProductPathsNotDependencies.txt", "{B772953C-A08A-5D20-9491-530E87D11504}:0"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:0"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:10000"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:20000"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:30000"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:40000"), - ("textures/_dev_Purple.tif", "{A2482826-053D-5634-A27B-084B1326AAE5}:50000"), - ("Config/gAME.XML", "{B92667DC-9F5B-5D72-A29D-99219DD9B691}:0"), + ('TestAssets\\WildcardScanTest1.txt', '{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0'), + ('libs/particles/milestone2PARTICLES.XML', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'), + ('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3e8'), + ('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'), + ('textures/_dev_Purple.tif', '{A2482826-053D-5634-A27B-084B1326AAE5}:3eb'), + ('project.json', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'), + ('TestAssets/RelativeProductPathsNotDependencies.txt', '{B772953C-A08A-5D20-9491-530E87D11504}:0'), ] self.do_missing_dependency_test(expected_product, expected_dependencies, @@ -228,24 +235,22 @@ class TestsMissingDependencies_WindowsAndMac(object): expected_product = f"testassets\\relativeproductpathsnotdependencies.txt" expected_dependencies = [ # String Asset # - ("materials/floor_tile.mtl", "{0EFF5E4A-F544-5D87-8696-6DDFA62D6063}:0"), - ("materials/am_grass1.mtl", "{1151F14D-38A6-5579-888A-BE3139882E68}:0"), - ("2ef92b8D044E5C278E2BB1AC0374A4E7:131072", "{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:20000"), - ("ui/milestone2menu.uicanvas", "{445D9AF3-6CA5-5281-82A9-5C570BCD1DB8}:0"), - ("ui/fonts/lyshineexamples/vera.ttf", "{74F5C29E-4749-5EE8-AEC6-A1C540600CE7}:0"), - ("materials/am_rockground.mtl", "{A1DA3D05-A020-5BB5-A608-C4812B7BD733}:0"), - ("textures/_dev_yellow_light.dds.2", "{6C40868F-3FC1-5115-96EA-DD0A9E33DEE4}:20000"), - (r"automatedtesting\textures\_dev_stucco.dds", "{70114D85-D712-5AEB-A816-8FE3A37087AF}:0"), - ("textures/milestone2/ama_grey_02.dds", "{3EE80AAD-EB9C-56BD-9E9C-65410578998C}:0"), - (r"textures\\_dev_tan.dds", "{8F2BCEF5-C8CE-5B80-8103-8C1D694D012C}:0"), - ("textures/_dev_purple.dds", "{A2482826-053D-5634-A27B-084B1326AAE5}:0"), - ("TEXTURES/_DEV_WHITE.dds", "{D83B36F1-61A6-5001-B191-4D0CE282E236}:0"), - ("textures/_dev_woodland.dds", "{F3DD193C-5845-569C-A974-AA338B30CF86}:0"), - ("A2482826-053D-5634-A27B-084B1326AAE5}:[196608", "{A2482826-053D-5634-A27B-084B1326AAE5}:30000"), - ("B92667DC-9F5B-5D72-A29D-99219DD9B691", "{B92667DC-9F5B-5D72-A29D-99219DD9B691}:0"), - ("CEAA362B4E505BCEB827CB92EF40A50E", "{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:1"), - ("CEAA362B4E505BCEB827CB92EF40A50E", "{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:2"), - ("ui/fonts/lyshineexamples/veramono.ttf", "{BAD7FDC5-7BA6-5490-95AA-89078E2FA876}:0"), + ('materials/floor_tile.mtl', '{0EFF5E4A-F544-5D87-8696-6DDFA62D6063}:0'), + ('materials/am_grass1.mtl', '{1151F14D-38A6-5579-888A-BE3139882E68}:0'), + ('2ef92b8D044E5C278E2BB1AC0374A4E7:1002', '{2EF92B8D-044E-5C27-8E2B-B1AC0374A4E7}:3ea'), + ('textures/milestone2/ama_grey_02.tif.streamingimage', '{3EE80AAD-EB9C-56BD-9E9C-65410578998C}:3e8'), + ('ui/milestone2menu.uicanvas', '{445D9AF3-6CA5-5281-82A9-5C570BCD1DB8}:0'), + ('libs/particles/milestone2particles.xml', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'), + ('textures/_dev_yellow_light.tif.1002.imagemipchain', '{6C40868F-3FC1-5115-96EA-DD0A9E33DEE4}:3ea'), + ('textures\\\\_dev_tan.tif.streamingimage', '{8F2BCEF5-C8CE-5B80-8103-8C1D694D012C}:3e8'), + ('materials/am_rockground.mtl', '{A1DA3D05-A020-5BB5-A608-C4812B7BD733}:0'), + ('textures/_dev_purple.tif.streamingimage', '{A2482826-053D-5634-A27B-084B1326AAE5}:3e8'), + ('A2482826-053D-5634-A27B-084B1326AAE5}:[1002', '{A2482826-053D-5634-A27B-084B1326AAE5}:3ea'), + ('project.json', '{B076CDDC-14DF-50F4-A5E9-7518ABB3E851}:0'), + ('CEAA362B4E505BCEB827CB92EF40A50E', '{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:1'), + ('CEAA362B4E505BCEB827CB92EF40A50E', '{CEAA362B-4E50-5BCE-B827-CB92EF40A50E}:2'), + ('TEXTURES/_DEV_WHITE.tif.streamingimage', '{D83B36F1-61A6-5001-B191-4D0CE282E236}:3e8'), + ('textures/_dev_woodland.tif.streamingimage', '{F3DD193C-5845-569C-A974-AA338B30CF86}:3e8'), ] self.do_missing_dependency_test(expected_product, expected_dependencies, @@ -260,8 +265,8 @@ class TestsMissingDependencies_WindowsAndMac(object): helper = self._missing_dep_helper # Relative paths to the txt file with no missing dependencies - expected_product_1 = f"{self._workspace.project}\\testassets\\wildcardscantest1.txt" - expected_product_2 = f"{self._workspace.project}\\testassets\\wildcardscantest2.txt" + expected_product_1 = f"testassets\\wildcardscantest1.txt" + expected_product_2 = f"testassets\\wildcardscantest2.txt" expected_dependencies = [] # Neither file has expected missing dependencies # Run missing dependency scanner and validate results for both files @@ -288,13 +293,13 @@ class TestsMissingDependencies_WindowsAndMac(object): emitting missing dependencies. """ # Relative path to target test file - expected_product = f"testassets\\dependencyscannerasset.dynamicslice" + expected_product = f"testassets\\reportonemissingdependency.txt" # The only expected missing dependency - expected_dependencies = [("Config/Game.xml", "{B92667DC-9F5B-5D72-A29D-99219DD9B691}:0")] + expected_dependencies = [('6BDE282B49C957F7B0714B26579BCA9A', '{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0'),] self.do_missing_dependency_test(expected_product, expected_dependencies, - "%DependencyScannerAsset%.dynamicslice") + "%reportonemissingdependency.txt") @pytest.mark.BAT @pytest.mark.assetpipeline @@ -366,7 +371,7 @@ class TestsMissingDependencies_WindowsAndMac(object): # Expected missing dependency hiding 31 dependencies deep expected_dependencies = [ # String Asset # - ("B92667DC-9F5B-5D72-A29D-99219DD9B691", "{B92667DC-9F5B-5D72-A29D-99219DD9B691}:0") + ("6BDE282B-49C9-57F7-B071-4B26579BCA9A", "{6BDE282B-49C9-57F7-B071-4B26579BCA9A}:0") ] self.do_missing_dependency_test(expected_product, expected_dependencies, @@ -386,11 +391,11 @@ class TestsMissingDependencies_WindowsAndMac(object): # Expected dependencies with valid lengths from file expected_dependencies = [ # String Asset # - ("D92C4661C8985E19BD3597CB2318CFA6", "{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0"), - ("58BE9DA51F1753B98CEEEEB10E63454D", "{58BE9DA5-1F17-53B9-8CEE-EEB10E63454D}:914f19b7"), - ("747D31D71E62553592226173C49CF97E", "{747D31D7-1E62-5535-9222-6173C49CF97E}:1"), - ("747D31D71E62553592226173C49CF97E", "{747D31D7-1E62-5535-9222-6173C49CF97E}:2"), - ("1CB10C43-F324-5B93-A294-C602ADEF95F9", "{1CB10C43-F324-5B93-A294-C602ADEF95F9}:0"), + ('D1265251CC14584AB1CECB10746A2BA0', '{D1265251-CC14-584A-B1CE-CB10746A2BA0}:2'), + ('D1265251CC14584AB1CECB10746A2BA0', '{D1265251-CC14-584A-B1CE-CB10746A2BA0}:1'), + ('D92C4661C8985E19BD3597CB2318CFA6', '{D92C4661-C898-5E19-BD35-97CB2318CFA6}:0'), + ('837412DFD05F576D81AAACF360463749', '{837412DF-D05F-576D-81AA-ACF360463749}:0'), + ('785A05D2483E5B43A2B992ACDAE6E938', '{785A05D2-483E-5B43-A2B9-92ACDAE6E938}:0'), ] self.do_missing_dependency_test( expected_product, expected_dependencies, diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt index 7ffc2072f1..91228bc71c 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/CMakeLists.txt @@ -20,7 +20,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT TEST_SUITE main PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_MainSuite.py TEST_SERIAL - TIMEOUT 300 + TIMEOUT 400 RUNTIME_DEPENDENCIES AssetProcessor AutomatedTesting.Assets @@ -31,7 +31,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_BUILD_TESTS_SUPPORTED AND AutomatedT TEST_SUITE sandbox PATH ${CMAKE_CURRENT_LIST_DIR}/test_Atom_SandboxSuite.py TEST_SERIAL - TIMEOUT 300 + TIMEOUT 400 RUNTIME_DEPENDENCIES AssetProcessor AutomatedTesting.Assets diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py index e701ff8d16..35eaa2e4ce 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_AtomEditorComponents_AddedToEntity.py @@ -77,10 +77,10 @@ def run(): def verify_enter_exit_game_mode(component_name): general.enter_game_mode() - TestHelper.wait_for_condition(lambda: general.is_in_game_mode(), 1.0) + TestHelper.wait_for_condition(lambda: general.is_in_game_mode(), 2.0) general.log(f"{component_name}_test: Entered game mode: {general.is_in_game_mode()}") general.exit_game_mode() - TestHelper.wait_for_condition(lambda: not general.is_in_game_mode(), 1.0) + TestHelper.wait_for_condition(lambda: not general.is_in_game_mode(), 2.0) general.log(f"{component_name}_test: Exit game mode: {not general.is_in_game_mode()}") def verify_hide_unhide_entity(component_name, entity_obj): @@ -97,16 +97,16 @@ def run(): def verify_deletion_undo_redo(component_name, entity_obj): editor.ToolsApplicationRequestBus(bus.Broadcast, "DeleteEntityById", entity_obj.id) - TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0) + TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 2.0) general.log(f"{component_name}_test: Entity deleted: {not hydra.find_entity_by_name(entity_obj.name)}") general.undo() - TestHelper.wait_for_condition(lambda: hydra.find_entity_by_name(entity_obj.name) is not None, 1.0) + TestHelper.wait_for_condition(lambda: hydra.find_entity_by_name(entity_obj.name) is not None, 2.0) general.log(f"{component_name}_test: UNDO entity deletion works: " f"{hydra.find_entity_by_name(entity_obj.name) is not None}") general.redo() - TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 1.0) + TestHelper.wait_for_condition(lambda: not hydra.find_entity_by_name(entity_obj.name), 2.0) general.log(f"{component_name}_test: REDO entity deletion works: " f"{not hydra.find_entity_by_name(entity_obj.name)}") @@ -120,7 +120,7 @@ def run(): f"{not is_component_enabled(entity_obj.components[0])}") for component in components_to_add: entity_obj.add_component(component) - TestHelper.wait_for_condition(lambda: is_component_enabled(entity_obj.components[0]), 1.0) + TestHelper.wait_for_condition(lambda: is_component_enabled(entity_obj.components[0]), 2.0) general.log( f"{component_name}_test: Entity enabled after adding " f"required components: {is_component_enabled(entity_obj.components[0])}" diff --git a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py index 0b75760e05..fccd750573 100644 --- a/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py +++ b/AutomatedTesting/Gem/PythonTests/atom_renderer/test_Atom_MainSuite.py @@ -26,19 +26,23 @@ TEST_DIRECTORY = os.path.join(os.path.dirname(__file__), "atom_hydra_scripts") @pytest.mark.parametrize("launcher_platform", ['windows_editor']) @pytest.mark.parametrize("level", ["auto_test"]) class TestAtomEditorComponentsMain(object): + """Holds tests for Atom components.""" - @pytest.mark.test_case_id( - "C32078130", # Display Mapper - "C32078129", # Light - "C32078131", # Radius Weight Modifier - "C32078127", # PostFX Layer - "C32078125", # Physical Sky - "C32078115", # Global Skylight (IBL) - "C32078121", # Exposure Control - "C32078120", # Directional Light - "C32078119", # DepthOfField - "C32078118") # Decal (Atom) def test_AtomEditorComponents_AddedToEntity(self, request, editor, level, workspace, project, launcher_platform): + """ + Please review the hydra script run by this test for more specific test info. + Tests the following Atom components and verifies all "expected_lines" appear in Editor.log: + 1. Display Mapper + 2. Light + 3. Radius Weight Modifier + 4. PostFX Layer + 5. Physical Sky + 6. Global Skylight (IBL) + 7. Exposure Control + 8. Directional Light + 9. DepthOfField + 10. Decal (Atom) + """ cfg_args = [level] expected_lines = [ @@ -163,7 +167,8 @@ class TestAtomEditorComponentsMain(object): ] unexpected_lines = [ - "failed to open", + "Trace::Assert", + "Trace::Error", "Traceback (most recent call last):", ] diff --git a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py index 75df510db1..38df3906a8 100755 --- a/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py +++ b/AutomatedTesting/Gem/PythonTests/automatedtesting_shared/asset_database_utils.py @@ -47,7 +47,7 @@ def get_active_platforms_from_db(asset_db_path) -> List[str]: # Convert a source product path into a db product path # cache_platform/projectname/product_path def get_db_product_path(workspace, source_path, cache_platform): - product_path = os.path.join(cache_platform, workspace.project, source_path) + product_path = os.path.join(cache_platform, source_path) product_path = product_path.replace('\\', '/') return product_path diff --git a/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt new file mode 100644 index 0000000000..834254134e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/CMakeLists.txt @@ -0,0 +1,57 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +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 + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" + TIMEOUT 1500 + 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} + PYTEST_MARKS "SUITE_periodic" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) + + ly_add_pytest( + NAME AutomatedTesting::EditorTests_Sandbox + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + PYTEST_MARKS "SUITE_sandbox" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Editor + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py new file mode 100644 index 0000000000..5d4218efd0 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/BasicEditorWorkflows_LevelEntityComponentCRUD.py @@ -0,0 +1,160 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + +""" +C6351273: Create a new level +C6384955: Basic Workflow: Entity Manipulation in the Outliner +C16929880: Add Delete Components +C15167490: Save a level +C15167491: Export a level +""" + +import os +import sys +from PySide2 import QtWidgets + +import azlmbr.bus as bus +import azlmbr.editor as editor +import azlmbr.entity as entity +import azlmbr.math as math +import azlmbr.paths + +sys.path.append(os.path.join(azlmbr.paths.devroot, 'AutomatedTesting', 'Gem', 'PythonTests')) +from editor_python_test_tools.editor_test_helper import EditorTestHelper +import editor_python_test_tools.pyside_utils as pyside_utils +import editor_python_test_tools.hydra_editor_utils as hydra + + +class TestBasicEditorWorkflows(EditorTestHelper): + def __init__(self): + EditorTestHelper.__init__(self, log_prefix="BasicEditorWorkflows_LevelEntityComponent", args=["level"]) + + @pyside_utils.wrap_async + async def run_test(self): + """ + Summary: + Open Lumberyard editor and check if basic Editor workflows are completable. + + Expected Behavior: + - A new level can be created + - 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 + + Note: + - This test file must be called from the Lumberyard 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 + """ + + def find_entity_by_name(entity_name): + search_filter = entity.SearchFilter() + search_filter.names = [entity_name] + results = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) + if len(results) > 0: + return results[0] + return None + + # 1) Create a new 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) + active_modal_widget = await pyside_utils.wait_for_modal_widget() + new_level_dlg = active_modal_widget.findChild(QtWidgets.QWidget, "CNewLevelDialog") + if new_level_dlg: + if new_level_dlg.windowTitle() == "New Level": + self.log("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(self.args["level"]) + level_folders = grp_box.findChild(QtWidgets.QComboBox, "LEVEL_FOLDERS") + level_folders.setCurrentText("Levels/") + 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") == self.args["level"], 5.0) + self.test_success = level_create_success + self.log(f"Create and load new level: {level_create_success}") + + # Execute EditorTestHelper setup since level was created outside of EditorTestHelper's methods + self.test_success = self.test_success and self.after_level_load() + + # 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") + 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") + + # Find the new entity + parent_entity_id = find_entity_by_name("Entity1") + parent_entity_success = await pyside_utils.wait_for_condition(lambda: parent_entity_id is not None, 5.0) + self.test_success = self.test_success and parent_entity_success + self.log(f"New entity creation: {parent_entity_success}") + + # TODO: Replace Hydra call to creates child entity and add components with context menu triggering - LYN-3951 + # Create a new child entity + child_entity = hydra.Entity("Child") + entity_position = math.Vector3(0.0, 0.0, 0.0) + components_to_add = [] + child_entity.create_entity(entity_position, components_to_add, parent_entity_id) + + # Verify entity hierarchy + child_entity.get_parent_info() + self.test_success = self.test_success and child_entity.parent_id == parent_entity_id + self.log(f"Create entity hierarchy: {child_entity.parent_id == parent_entity_id}") + + # 3) Add/configure a component on an entity + # Add component and verify success + child_entity.add_component("Box Shape") + component_add_success = self.wait_for_condition(lambda: hydra.has_components(child_entity.id, ["Box Shape"]), 5.0) + self.test_success = self.test_success and component_add_success + self.log(f"Add component: {component_add_success}") + + # Update the component + dimensions_to_set = math.Vector3(16.0, 16.0, 16.0) + child_entity.get_set_test(0, "Box Shape|Box Configuration|Dimensions", dimensions_to_set) + box_shape_dimensions = hydra.get_component_property_value(child_entity.components[0], "Box Shape|Box Configuration|Dimensions") + self.test_success = self.test_success and box_shape_dimensions == dimensions_to_set + self.log(f"Component update: {box_shape_dimensions == dimensions_to_set}") + + # Remove the component + child_entity.remove_component("Box Shape") + component_rem_success = self.wait_for_condition(lambda: not hydra.has_components(child_entity.id, ["Box Shape"]), + 5.0) + self.test_success = self.test_success and component_rem_success + self.log(f"Remove component: {component_rem_success}") + + # 4) Save the level + 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", self.args["level"], "level.pak" + ) + export_success = self.wait_for_condition(lambda: os.path.exists(level_pak_file), 5.0) + self.test_success = self.test_success and export_success + self.log(f"Save and Export: {export_success}") + + +test = TestBasicEditorWorkflows() +test.run() diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py index 208ef40d41..3eeb3ddf84 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_EditMenuOptions.py @@ -64,8 +64,6 @@ class TestEditMenuOptions(EditorTestHelper): ("Modify", "Transform Mode", "Move"), ("Modify", "Transform Mode", "Rotate"), ("Modify", "Transform Mode", "Scale"), - ("Lock Selection",), - ("Unlock All Entities",), ("Editor Settings", "Global Preferences"), ("Editor Settings", "Graphics Settings"), ("Editor Settings", "Editor Settings Manager"), diff --git a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py index 05ee802d19..173d658b3c 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py +++ b/AutomatedTesting/Gem/PythonTests/editor/EditorScripts/Menus_ViewMenuOptions.py @@ -50,7 +50,6 @@ class TestViewMenuOptions(EditorTestHelper): ("Center on Selection",), ("Show Quick Access Bar",), ("Viewport", "Wireframe"), - ("Viewport", "Grid Settings"), ("Viewport", "Go to Position"), ("Viewport", "Center on Selection"), ("Viewport", "Go to Location"), diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py b/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py new file mode 100644 index 0000000000..b045b364a3 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/editor/test_BasicEditorWorkflows.py @@ -0,0 +1,63 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + +import os +import pytest + +# Bail on the test if ly_test_tools doesn't exist. +pytest.importorskip('ly_test_tools') +import ly_test_tools.environment.file_system as file_system +import editor_python_test_tools.hydra_test_utils as hydra + +test_directory = os.path.join(os.path.dirname(__file__), "EditorScripts") +log_monitor_timeout = 180 + + +@pytest.mark.parametrize('project', ['AutomatedTesting']) +@pytest.mark.parametrize('level', ['tmp_level']) +@pytest.mark.usefixtures("automatic_process_killer") +@pytest.mark.parametrize("launcher_platform", ['windows_editor']) +class TestBasicEditorWorkflows(object): + + @pytest.fixture(autouse=True) + def setup_teardown(self, request, workspace, project, level): + 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) + + @pytest.mark.test_case_id("C6351273", "C6384955", "C16929880", "C15167490", "C15167491") + @pytest.mark.SUITE_main + def test_BasicEditorWorkflows_LevelEntityComponentCRUD(self, request, editor, level, launcher_platform): + + expected_lines = [ + "Create and load new level: True", + "New entity creation: True", + "Create entity hierarchy: True", + "Add component: True", + "Component update: True", + "Remove component: True", + "Save and Export: True", + "BasicEditorWorkflows_LevelEntityComponent: result=SUCCESS", + ] + + hydra.launch_and_validate_results( + request, + test_directory, + editor, + "BasicEditorWorkflows_LevelEntityComponentCRUD.py", + expected_lines, + cfg_args=[level], + timeout=log_monitor_timeout, + auto_test_mode=False + ) diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py b/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py index a75b3b36cd..f887560a19 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py +++ b/AutomatedTesting/Gem/PythonTests/editor/test_Docking.py @@ -39,8 +39,8 @@ class TestDocking(object): file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) @pytest.mark.test_case_id("C6376081") - @pytest.mark.SUITE_periodic - def test_basic_docked_tools(self, request, editor, level, launcher_platform): + @pytest.mark.SUITE_sandbox + def test_Docking_BasicDockedTools(self, request, editor, level, launcher_platform): expected_lines = [ "The tools are all docked together in a tabbed widget", "Entity Outliner works when docked, can select an Entity", diff --git a/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py b/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py index 251bd7cfed..c2da1343de 100644 --- a/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py +++ b/AutomatedTesting/Gem/PythonTests/editor/test_Menus.py @@ -39,7 +39,7 @@ class TestMenus(object): file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) @pytest.mark.test_case_id("C16780783", "C2174438") - @pytest.mark.SUITE_periodic + @pytest.mark.SUITE_sandbox def test_Menus_EditMenuOptions_Work(self, request, editor, level, launcher_platform): expected_lines = [ "Undo Action triggered", @@ -59,8 +59,6 @@ class TestMenus(object): "Move Action triggered", "Rotate Action triggered", "Scale Action triggered", - "Lock Selection Action triggered", - "Unlock All Entities Action triggered", "Global Preferences Action triggered", "Graphics Settings Action triggered", "Editor Settings Manager Action triggered", @@ -93,7 +91,6 @@ class TestMenus(object): "Center on Selection Action triggered", "Show Quick Access Bar Action triggered", "Wireframe Action triggered", - "Grid Settings Action triggered", "Go to Position Action triggered", "Center on Selection Action triggered", "Go to Location Action triggered", @@ -116,7 +113,7 @@ class TestMenus(object): ) @pytest.mark.test_case_id("C16780778") - @pytest.mark.SUITE_periodic + @pytest.mark.SUITE_sandbox def test_Menus_FileMenuOptions_Work(self, request, editor, level, launcher_platform): expected_lines = [ "New Level Action triggered", diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt new file mode 100644 index 0000000000..c7fd43c7b2 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/CMakeLists.txt @@ -0,0 +1,185 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS AND PAL_TRAIT_LARGE_WORLDS_TEST_SUPPORTED) + +## DynVeg ## + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationTests_Main + TEST_SERIAL + TEST_SUITE main + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.GameLauncher + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationTests_Sandbox + TEST_SERIAL + TEST_SUITE sandbox + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_sandbox" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.GameLauncher + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationFilterTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_filter" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationModifierTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_modifier" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationRegressionTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_regression" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationAreaTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_area" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationMiscTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_misc" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::DynamicVegetationSurfaceTagTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/dyn_veg + PYTEST_MARKS "SUITE_periodic and dynveg_surfacetagemitter" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) +## LandscapeCanvas ## + + ly_add_pytest( + NAME AutomatedTesting::LandscapeCanvasTests_Main + TEST_SERIAL + TEST_SUITE main + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas + PYTEST_MARKS "not SUITE_sandbox and not SUITE_periodic and not SUITE_benchmark" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + + ly_add_pytest( + NAME AutomatedTesting::LandscapeCanvasTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/landscape_canvas + PYTEST_MARKS "SUITE_periodic" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + +## GradientSignal ## + ly_add_pytest( + NAME AutomatedTesting::GradientSignalTests_Periodic + TEST_SERIAL + TEST_SUITE periodic + PATH ${CMAKE_CURRENT_LIST_DIR}/gradient_signal + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + Legacy::Editor + AutomatedTesting.Assets + COMPONENT + LargeWorlds + ) + +endif() diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py index 4f58a23a19..730a557a9e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/SurfaceMaskFilter_BasicSurfaceTagCreation.py @@ -23,6 +23,25 @@ class TestSurfaceMaskFilter_BasicSurfaceTagCreation(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="TestSurfaceMaskFilter_BasicSurfaceTagCreation", args=["level"]) def run_test(self): + """ + Summary: + Verifies basic surface tag value equality + + Expected Behavior: + Surface tags of the same name are equal, and different names aren't. + + Test Steps: + 1) Open level + 2) Create 2 new surface tags of identical names and verify they resolve as equal. + 3) Create another new tag of a different name and verify they resolve as different. + + Note: + - This test file must be called from the Open 3D Engine 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 + """ self.log("SurfaceTag test started") # Create a level diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py index c25761d655..46c5483988 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/EditorScripts/VegetationInstances_DespawnWhenOutOfRange.py @@ -33,6 +33,25 @@ class TestVegetationInstances_DespawnWhenOutOfRange(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix='VegetationInstances_DespawnWhenOutOfRange', args=['level']) def run_test(self): + """ + Summary: + Verifies that vegetation instances properly spawn/despawn based on camera range. + + Expected Behavior: + Vegetation instances despawn when out of camera range. + + Test Steps: + 1) Create a new level + 2) Create a simple vegetation area, and set the view position near the spawner. Verify instances plant. + 3) Move the view position away from the spawner. Verify instances despawn. + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new level self.test_success = self.create_level( diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py index 9898570692..ead1e8779c 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_DynamicSliceInstanceSpawner.py @@ -41,7 +41,7 @@ class TestDynamicSliceInstanceSpawner(object): return console @pytest.mark.test_case_id("C28851763") - @pytest.mark.SUITE_periodic + @pytest.mark.SUITE_main @pytest.mark.dynveg_area @pytest.mark.parametrize("launcher_platform", ['windows_editor']) def test_DynamicSliceInstanceSpawner_DynamicSliceSpawnerWorks(self, request, editor, level, workspace, project, diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py index 7bd8484cf4..ca71cd2137 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/dyn_veg/test_EmptyInstanceSpawner.py @@ -37,7 +37,7 @@ class TestEmptyInstanceSpawner(object): file_system.delete([os.path.join(workspace.paths.engine_root(), project, "Levels", level)], True, True) @pytest.mark.test_case_id("C28851762") - @pytest.mark.SUITE_periodic + @pytest.mark.SUITE_main @pytest.mark.dynveg_area def test_EmptyInstanceSpawner_EmptySpawnerWorks(self, request, editor, level, launcher_platform): cfg_args = [level] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py index cc9a15bba0..c37bc9780f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientGenerators_Incompatibilities.py @@ -28,8 +28,21 @@ class TestGradientGeneratorIncompatibilities(EditorTestHelper): def run_test(self): """ Summary: - Verify that Entities are not active when a Gradient Generator and incompatible component are both present - on the same Entity. + This test verifies that components are disabled when conflicting components are present on the same entity. + + Expected Behavior: + Gradient Generator components are incompatible with Vegetation area components. + + Test Steps: + 1) Create a new level + 2) Create a new entity in the level + 3) Add each Gradient Generator component to an entity, and add a Vegetation Area component to the same entity + 4) Verify that components are only enabled when entity is free of a conflicting component + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py index b7d12d074a..f2edc2924e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientModifiers_Incompatibilities.py @@ -28,8 +28,21 @@ class TestGradientModifiersIncompatibilities(EditorTestHelper): def run_test(self): """ Summary: - Verify that Entities are not active when a Gradient Modifier and incompatible component are both present - on the same Entity. + This test verifies that components are disabled when conflicting components are present on the same entity. + + Expected Behavior: + Gradient Modifier components are incompatible with Vegetation area components. + + Test Steps: + 1) Create a new level + 2) Create a new entity in the level + 3) Add each Gradient Modifier component to an entity, and add a Vegetation Area component to the same entity + 4) Verify that components are only enabled when entity is free of a conflicting component + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py index c37ee36265..45da74d6cd 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_ClearingPinnedEntitySetsPreviewToOrigin.py @@ -9,19 +9,6 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. """ -""" -The below cases are combined in this script -C2676829 -C3961326 -C3980659 -C3980664 -C3980669 -C3416548 -C2676823 -C3961321 -C2676826 -""" - import os import sys diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py index 5a758b9d89..b8f4114d30 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientPreviewSettings_DefaultPinnedEntityIsSelf.py @@ -44,7 +44,21 @@ class TestGradientPreviewSettings(EditorTestHelper): def run_test(self): """ Summary: - Verify if the current entity is set to the pin preview to shape entity by default for several components. + This test verifies default values for the pinned entity for Gradient Preview settings. + + Expected Behavior: + Pinned entity is self for all gradient generator/modifiers. + + Test Steps: + 1) Create a new level + 2) Create a new entity in the level + 3) Add each Gradient Generator component to an entity, and verify the Pin Preview to Shape property is set to + self + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py index a16e37e0fc..8e2d0611af 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientSurfaceTagEmitter_ComponentDependencies.py @@ -31,11 +31,21 @@ class TestGradientSurfaceTagEmitterDependencies(EditorTestHelper): def run_test(self): """ Summary: - Component has a dependency on a Gradient component + This test verifies that the Gradient Surface Tag Emitter component is dependent on a gradient component. Expected Result: - Component is disabled until a Gradient Generator, Modifier or Gradient Reference component - (and any sub-dependencies) is added to the entity. + Gradient Surface Tag Emitter component is disabled until a Gradient Generator, Modifier or Gradient Reference + component (and any sub-dependencies) is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Gradient Surface Tag Emitter component + 3) Verify the component is disabled until a dependent component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py index e1e901f2f7..2311363db9 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/GradientTransform_RequiresShape.py @@ -28,8 +28,20 @@ class TestGradientTransformRequiresShape(EditorTestHelper): def run_test(self): """ Summary: - Verify that Gradient Transform Modifier component requires a - Shape component before the Entity can become active. + This test verifies that the Gradient Transform Modifier component is dependent on a shape component. + + Expected Result: + Gradient Transform Modifier component is disabled until a shape component is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Gradient Transform Modifier component + 3) Verify the component is disabled until a shape component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py index dab8e6928a..a5d9632fd6 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/gradient_signal/EditorScripts/ImageGradient_RequiresShape.py @@ -28,8 +28,20 @@ class TestImageGradientRequiresShape(EditorTestHelper): def run_test(self): """ Summary: - Verify that Image Gradient component requires a - Shape component before the Entity can become active. + This test verifies that the Image Gradient component is dependent on a shape component. + + Expected Result: + Gradient Transform Modifier component is disabled until a shape component is added to the entity. + + Test Steps: + 1) Open level + 2) Create a new entity with a Image Gradient component + 3) Verify the component is disabled until a shape component is also added to the entity + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py index d1e0b68ef4..c41d153cfa 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_DependentComponentsAdded.py @@ -33,6 +33,26 @@ class TestAreaNodeComponentDependency(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="AreaNodeComponentDependency", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with + proper dependent components. + + Expected Behavior: + All expected component dependencies are met when adding an area node to a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure the proper dependent components are added + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py index 4e429a192b..fb977b4987 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityCreatedOnNodeAdd.py @@ -33,7 +33,25 @@ class TestGradientNodeEntityCreate(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="AreaNodeEntityCreate", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + Expected Behavior: + New entities are created when dragging area nodes to graph area. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure a new entity is created + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId newEntityId = parameters[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py index 38f8641b4c..57ba8fc006 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/AreaNodes_EntityRemovedOnNodeDelete.py @@ -34,7 +34,26 @@ class TestAreaNodeEntityDelete(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="AreaNodeEntityDelete", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Expected Behavior: + Entities are removed when area nodes are deleted from a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the area nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global createdEntityId createdEntityId = parameters[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py index 26062c01f8..60527b64d2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ComponentUpdates_UpdateGraph.py @@ -9,24 +9,6 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. """ - -""" -C22602072 - Graph is updated when underlying components are added/removed - -1. Open Level. -2. Find LandscapeCanvas named entity. -3. Ensure Vegetation Distribution Component is present on the BushSpawner entity. -4. Open graph and ensure Distribution Filter wrapped node is present. -5. Delete the Vegetation Distribution Filter component from the BushSpawner entity via Entity Inspector. -6. Ensure the Vegetation Distribution Filter component was deleted from the BushSpawner entity and node is no longer -present in the graph. -7. Add Vegetation Altitude Filter to the BushSpawner entity through Entity Inspector. -8. Ensure Altitude Filter was added to the BushSpawner node in the open graph. -9. Add a new entity with unique name as a child of the Landscape Canvas entity. -10. Add a Box Shape component to the new child entity. -11. Ensure Box Shape node is present on the open graph. -""" - import os import sys @@ -50,6 +32,36 @@ class TestComponentUpdatesUpdateGraph(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="ComponentUpdatesUpdateGraph", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas graphs update properly when components are added/removed outside of + Landscape Canvas. + + Expected Behavior: + Graphs properly reflect component changes made to entities outside of Landscape Canvas. + + Test Steps: + 1. Open Level + 2. Find LandscapeCanvas named entity + 3. Ensure Vegetation Distribution Component is present on the BushSpawner entity + 4. Open graph and ensure Distribution Filter wrapped node is present + 5. Delete the Vegetation Distribution Filter component from the BushSpawner entity via Entity Inspector + 6. Ensure the Vegetation Distribution Filter component was deleted from the BushSpawner entity and node is + no longer present in the graph + 7. Add Vegetation Altitude Filter to the BushSpawner entity through Entity Inspector + 8. Ensure Altitude Filter was added to the BushSpawner node in the open graph + 9. Add a new entity with unique name as a child of the Landscape Canvas entity + 10. Add a Box Shape component to the new child entity + 11. Ensure Box Shape node is present on the open graph + + Note: + - This test file must be called from the Open 3D Engine 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 + """ + # Create a new empty level and instantiate LC_BushFlowerBlender.slice self.test_success = self.create_level( self.args["level"], diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py index 5fed13985d..4b5e03abbc 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/CreateNewGraph.py @@ -37,6 +37,25 @@ class TestCreateNewGraph(EditorTestHelper): print("New root entity created") def run_test(self): + """ + Summary: + This test verifies that new graphs can be created in Landscape Canvas. + + Expected Behavior: + New graphs can be created, and proper entity is created to hold graph data with a Landscape Canvas component. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Ensures the root entity created contains a Landscape Canvas component + + Note: + - This test file must be called from the Open 3D Engine 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 + """ self.test_success = self.create_level( self.args["level"], heightmap_resolution=128, diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py index 7fd3f075e0..81e24b20e1 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_DisabledNodeDuplication.py @@ -33,7 +33,25 @@ class TestDisabledNodeDuplication(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="DisabledNodeDuplication", args=["level"]) def run_test(self): + """ + Summary: + This test verifies Editor stability after duplicating disabled Landscape Canvas nodes. + Expected Behavior: + Editor remains stable and free of crashes. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Create several new nodes, disable the nodes via disabling/deleting components, and duplicate the nodes + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId newEntityId = parameters[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py index 27ab6fded3..61c4cf9ac2 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Edit_UndoNodeDelete_SliceEntity.py @@ -9,17 +9,6 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. """ - -""" -C30813586 - Editor remains stable after Undoing deletion of a node on a slice entity - -1. Open level with instantiated slice. -2. Open the graph. -3. Find the BushSpawner's Vegetation Layer Spawner node. -4. Delete the node. -5. Undo to restore the node. -""" - import os import sys @@ -44,7 +33,26 @@ class TestUndoNodeDeleteSlice(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="UndoNodeDeleteSlice", args=["level"]) def run_test(self): + """ + Summary: + This test verifies Editor stability after undoing the deletion of nodes on a slice entity. + Expected Behavior: + Editor remains stable and free of crashes. + + Test Steps: + 1) Create a new level + 2) Instantiate a slice with a Landscape Canvas setup + 3) Find a specific node on the graph, and delete it + 4) Restore the node with Undo + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new empty level and instantiate LC_BushFlowerBlender.slice self.test_success = self.create_level( self.args["level"], diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py index ca3bc04f47..124baf9d2e 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientMixer_NodeConstruction.py @@ -34,6 +34,27 @@ class TestGradientMixerNodeConstruction(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientMixerNodeConstruction", args=["level"]) def run_test(self): + """ + Summary: + This test verifies a Gradient Mixer vegetation setup can be constructed through Landscape Canvas. + + Expected Behavior: + Entities contain all required components and component references after creating nodes and setting connections + on a Landscape Canvas graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Add all necessary nodes to the graph and set connections to form a Gradient Mixer setup + 4) Verify all components and component references were properly set during graph construction + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py index d40b19e7db..aa98eb3dc3 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityCreatedOnNodeAdd.py @@ -33,6 +33,25 @@ class TestGradientModifierNodeEntityCreate(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientModifierNodeEntityCreate", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + + Expected Behavior: + New entities are created when dragging Gradient Modifier nodes to graph area. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py index dc263924d1..6a82b05039 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientModifierNodes_EntityRemovedOnNodeDelete.py @@ -34,7 +34,26 @@ class TestGradientModifierNodeEntityDelete(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientModifierNodeEntityDelete", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + Expected Behavior: + Entities are removed when Gradient Modifier nodes are deleted from a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global createdEntityId createdEntityId = parameters[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py index 5e203e1892..f9360fe356 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_DependentComponentsAdded.py @@ -33,6 +33,27 @@ class TestGradientNodeComponentDependency(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientNodeComponentDependency", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities with + proper dependent components. + + Expected Behavior: + All expected component dependencies are met when adding a Gradient Modifier node to a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient Modifier nodes to the graph area, and ensure the proper dependent components are + added + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py index 6d4a2f58a7..8aaad9b81d 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityCreatedOnNodeAdd.py @@ -32,6 +32,25 @@ class TestGradientNodeEntityCreate(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientNodeEntityCreate", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + + Expected Behavior: + New entities are created when dragging Gradient nodes to graph area. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py index 2b49e3a911..d74b86d0bf 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GradientNodes_EntityRemovedOnNodeDelete.py @@ -34,6 +34,26 @@ class TestGradientNodeEntityDelete(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GradientNodeEntityDelete", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + + Expected Behavior: + Entities are removed when Gradient nodes are deleted from a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the Gradient nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global createdEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py index d3ad5c1c1e..6aa539b554 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnEntityDelete.py @@ -31,6 +31,26 @@ class TestGraphClosedOnEntityDelete(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GraphClosedOnEntityDelete", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that Landscape Canvas graphs are auto-closed when the corresponding entity is deleted. + + Expected Behavior: + When a Landscape Canvas root entity is deleted, the corresponding graph automatically closes. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Delete the automatically created entity + 4) Verify the open graph is closed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newRootEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py index b7b0008eb2..ebc75ab621 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_OnLevelChange.py @@ -29,7 +29,26 @@ class TestGraphClosedOnLevelChange(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GraphClosedOnLevelChange", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that Landscape Canvas graphs are auto-closed when the currently open level changes. + Expected Behavior: + When a new level is loaded in the Editor, open Landscape Canvas graphs are automatically closed. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Open a different level + 4) Verify the open graph is closed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new empty level self.test_success = self.create_level( self.args["level"], diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py index efd1cc5a55..4b018aeb45 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphClosed_TabbedGraph.py @@ -29,6 +29,26 @@ class TestGraphClosedTabbedGraph(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GraphClosedTabbedGraph", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that Landscape Canvas tabbed graphs can be independently closed. + + Expected Behavior: + Closing a tabbed graph only closes the appropriate graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create several new graphs + 3) Close one of the open graphs + 4) Ensure the graph properly closed, and other open graphs remain open + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new empty level self.test_success = self.create_level( diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py index f350d37178..f94a6c2e3a 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/GraphUpdates_UpdateComponents.py @@ -9,21 +9,6 @@ remove or modify any license notices. This file is distributed on an "AS IS" BAS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. """ - -""" -C22715182 - Components are updated when nodes are added/removed/updated - -1. Open Level. -2. Open the graph on LC_BushFlowerBlender.slice -3. Find the Rotation Modifier node on the BushSpawner entity -4. Delete the Rotation Modifier node -5. Ensure the Vegetation Rotation Modifier component is removed from the BushSpawner entity -6. Delete the Vegetation Layer Spawner node from the graph -7. Ensure BushSpawner entity is deleted -8. Change connection from second Rotation Modifier node to a different Gradient -9. Ensure Gradient reference on component is updated -""" - import os import sys @@ -50,6 +35,31 @@ class TestGraphUpdatesUpdateComponents(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="GraphUpdatesUpdateComponents", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that components are properly updated as nodes are added/removed/updated. + + Expected Behavior: + Landscape Canvas node CRUD properly updates component entities. + + Test Steps: + 1. Open Level. + 2. Open the graph on LC_BushFlowerBlender.slice + 3. Find the Rotation Modifier node on the BushSpawner entity + 4. Delete the Rotation Modifier node + 5. Ensure the Vegetation Rotation Modifier component is removed from the BushSpawner entity + 6. Delete the Vegetation Layer Spawner node from the graph + 7. Ensure BushSpawner entity is deleted + 8. Change connection from second Rotation Modifier node to a different Gradient + 9. Ensure Gradient reference on component is updated + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new empty level and instantiate LC_BushFlowerBlender.slice self.test_success = self.create_level( self.args["level"], diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py index 176429885f..c3857e1393 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvasComponent_AddedRemoved.py @@ -30,6 +30,26 @@ class TestLandscapeCanvasComponentAddedRemoved(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="LandscapeCanvasComponentAddedRemoved", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas component can be added to/removed from an entity. + + Expected Behavior: + Closing a tabbed graph only closes the appropriate graph. + + Test Steps: + 1) Create a new level + 2) Create a new entity + 3) Add a Landscape Canvas component to the entity + 4) Remove the Landscape Canvas component from the entity + + Note: + - This test file must be called from the Open 3D Engine 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 + """ # Create a new empty level self.test_success = self.create_level( diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py index e0f13adaa9..f174a52610 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LandscapeCanvas_SliceCreateInstantiate.py @@ -30,12 +30,21 @@ class TestLandscapeCanvasSliceCreateInstantiate(EditorTestHelper): def run_test(self): """ Summary: - C22602016 A slice containing the LandscapeCanvas component can be created/instantiated. + A slice containing the LandscapeCanvas component can be created/instantiated. Expected Result: - Slice is created and processed successfully and free of errors/warnings. - Another copy of the slice is instantiated. + Slice is created/processed/instantiated successfully and free of errors/warnings. + Test Steps: + 1) Create a new level + 2) Create a new entity with a Landscape Canvas component + 3) Create a slice of the new entity + 4) Instantiate a new copy of the slice + + Note: + - This test file must be called from the Open 3D Engine 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 """ diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py index ecc529b9b4..82a2abf5ea 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerBlender_NodeConstruction.py @@ -34,6 +34,27 @@ class TestLayerBlenderNodeConstruction(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="LayerBlenderNodeConstruction", args=["level"]) def run_test(self): + """ + Summary: + This test verifies a Layer Blender vegetation setup can be constructed through Landscape Canvas. + + Expected Behavior: + Entities contain all required components and component references after creating nodes and setting connections + on a Landscape Canvas graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Add all necessary nodes to the graph and set connections to form a Layer Blender setup + 4) Verify all components and component references were properly set during graph construction + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py index 00fcb5170c..df3c549fff 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/LayerExtenderNodes_ComponentEntitySync.py @@ -34,6 +34,25 @@ class TestLayerExtenderNodeComponentEntitySync(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="LayerExtenderNodeComponentEntitySync", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that all wrapped nodes can be successfully added to/removed from parent nodes. + + Expected Behavior: + All wrapped extender nodes can be added to/removed from appropriate parent nodes. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Add Area Blender and Layer Spawner nodes to the graph, and add/remove each extender node to/from each + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py index bd10e5f4c6..cd4915ea24 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityCreatedOnNodeAdd.py @@ -33,6 +33,25 @@ class TestShapeNodeEntityCreate(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="ShapeNodeEntityCreate", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas nodes can be added to a graph, and correctly create entities. + + Expected Behavior: + New entities are created when dragging shape nodes to graph area. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created + + Note: + - This test file must be called from the Open 3D Engine 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 + """ def onEntityCreated(parameters): global newEntityId diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py index f71f5ae906..fcfbe03576 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/ShapeNodes_EntityRemovedOnNodeDelete.py @@ -34,7 +34,27 @@ class TestShapeNodeEntityDelete(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="ShapeNodeEntityDelete", args=["level"]) def run_test(self): - + """ + Summary: + This test verifies that the Landscape Canvas node deletion properly cleans up entities in the Editor. + + Expected Behavior: + Entities are removed when shape nodes are deleted from a graph. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the shape nodes to the graph area, and ensure a new entity is created + 4) Delete the nodes, and ensure the newly created entities are removed + + Note: + - This test file must be called from the Open 3D Engine 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 + """ + def onEntityCreated(parameters): global createdEntityId createdEntityId = parameters[0] diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py index 968f39c64d..183c3f7ccb 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/SlotConnections_UpdateComponentReferences.py @@ -33,6 +33,27 @@ class TestSlotConnectionsUpdateComponents(EditorTestHelper): EditorTestHelper.__init__(self, log_prefix="SlotConnectionsUpdateComponents", args=["level"]) def run_test(self): + """ + Summary: + This test verifies that the Landscape Canvas slot connections properly update component references. + + Expected Behavior: + A reference created through slot connections in Landscape Canvas is reflected in the Entity Inspector. + + Test Steps: + 1) Create a new level + 2) Open Landscape Canvas and create a new graph + 3) Several nodes are added to a graph, and connections are set between the nodes + 4) Component references are verified via Entity Inspector + + Note: + - This test file must be called from the Open 3D Engine 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 + """ + # Retrieve the proper component TypeIds per component name componentNames = [ 'Random Noise Gradient', diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py index efeba3b74a..855764fa6f 100755 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/test_GraphComponentSync.py @@ -118,7 +118,7 @@ class TestGraphComponentSync(object): @pytest.mark.test_case_id('C15987206') @pytest.mark.SUITE_main - def test_LandscapeCanvas_GradientMixerNodeConstruction(self, request, editor, level, launcher_platform): + def test_LandscapeCanvas_GradientMixer_NodeConstruction(self, request, editor, level, launcher_platform): """ Verifies a Gradient Mixer can be setup in Landscape Canvas and all references are property set. """ @@ -141,7 +141,7 @@ class TestGraphComponentSync(object): @pytest.mark.test_case_id('C21333743') @pytest.mark.SUITE_periodic - def test_LandscapeCanvas_LayerBlenderNodeConstruction(self, request, editor, level, launcher_platform): + def test_LandscapeCanvas_LayerBlender_NodeConstruction(self, request, editor, level, launcher_platform): """ Verifies a Layer Blender can be setup in Landscape Canvas and all references are property set. """ diff --git a/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt new file mode 100644 index 0000000000..4f89e841df --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/physics/CMakeLists.txt @@ -0,0 +1,52 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::PhysicsTests_Main + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Physics + ) + ly_add_pytest( + NAME AutomatedTesting::PhysicsTests_Periodic + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Physics + ) + ly_add_pytest( + NAME AutomatedTesting::PhysicsTests_Sandbox + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + Physics + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py index 8f1f2f7481..2cf55c7a58 100644 --- a/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/physics/TestSuite_Main.py @@ -42,6 +42,7 @@ class TestAutomation(TestAutomationBase): self._run_test(request, workspace, editor, test_module) @revert_physics_config + @fm.file_override('physxsystemconfiguration.setreg','C4044459_Material_DynamicFriction.setreg_override', 'AutomatedTesting/Registry') def test_C4044459_Material_DynamicFriction(self, request, workspace, editor, launcher_platform): from . import C4044459_Material_DynamicFriction as test_module self._run_test(request, workspace, editor, test_module) diff --git a/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt new file mode 100644 index 0000000000..61f1944974 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/prefab/CMakeLists.txt @@ -0,0 +1,25 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +## Prefab ## +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::PrefabTests + TEST_SUITE main + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Main.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt new file mode 100644 index 0000000000..58507c680c --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/scripting/CMakeLists.txt @@ -0,0 +1,37 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::ScriptCanvasTests_Perodic + TEST_SUITE periodic + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Periodic.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + COMPONENT + ScriptCanvas + ) + ly_add_pytest( + NAME AutomatedTesting::ScriptCanvasTests_Sandbox + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR}/TestSuite_Sandbox.py + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + Legacy::Editor + AZ::AssetProcessor + AutomatedTesting.Assets + ) +endif() diff --git a/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py b/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py new file mode 100644 index 0000000000..3750fd290b --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/scripting/Pane_PropertiesChanged_RetainsOnRestart.py @@ -0,0 +1,161 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + + +class Tests: + test_panes_visible = "All the test panes are opened" + close_pane_1 = "Test pane 1 is closed" + resize_pane_3 = "Test pane 3 resized successfully" + location_changed = "Location of test pane 2 changed successfully" + visiblity_retained = "Test pane retained its visiblity on Editor restart" + location_retained = "Test pane retained its location on Editor restart" + size_retained = "Test pane retained its size on Editor restart" + + +def Pane_PropertiesChanged_RetainsOnRestart(): + """ + Summary: + The Script Canvas window is opened to verify if Script canvas panes can retain its visibility, size and location + upon Editor restart. + + Expected Behavior: + The ScriptCanvas pane retain it's visiblity, size and location upon Editor restart. + + Test Steps: + 1) Open Script Canvas window (Tools > Script Canvas) + 2) Make sure test panes are open and visible + 3) Close test pane 1 + 4) Change dock location of test pane 2 + 5) Resize test pane 3 + 6) Restart Editor + 7) Verify if test pane 1 retain its visiblity + 8) Verify if location of test pane 2 is retained + 9) Verify if size of test pane 3 is retained + 10) Restore default layout and close SC window + + Note: + - This test file must be called from the Open 3D Engine 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 sys + + # Helper imports + from utils import Report + from utils import TestHelper as helper + import pyside_utils + + # Lumberyard Imports + import azlmbr.legacy.general as general + + # Pyside imports + from PySide2 import QtCore, QtWidgets + from PySide2.QtCore import Qt + + # Constants + TEST_CONDITION = sys.argv[1] + TEST_PANE_1 = "NodePalette" # pane used to test visibility + TEST_PANE_2 = "VariableManager" # pane used to test location + TEST_PANE_3 = "NodeInspector" # pane used to test size + SCALE_INT = 10 # Random resize scale integer + DOCKAREA = Qt.TopDockWidgetArea # Preferred top area since no widget is docked on top + + def click_menu_option(window, option_text): + action = pyside_utils.find_child_by_pattern(window, {"text": option_text, "type": QtWidgets.QAction}) + action.trigger() + + def find_pane(window, pane_name): + return window.findChild(QtWidgets.QDockWidget, pane_name) + + # Test starts here + general.idle_enable(True) + + # 1) Open Script Canvas window (Tools > Script Canvas) + general.open_pane("Script Canvas") + helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0) + + if TEST_CONDITION == "before_restart": + # 2) Make sure test panes are open and visible + editor_window = pyside_utils.get_editor_main_window() + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + click_menu_option(sc, "Restore Default Layout") + test_pane_1 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_1) + test_pane_2 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_2) + test_pane_3 = sc.findChild(QtWidgets.QDockWidget, TEST_PANE_3) + + result = test_pane_1.isVisible() and test_pane_2.isVisible() and test_pane_3.isVisible() + Report.info(f"{Tests.test_panes_visible}: {result}") + + # 3) Close test pane + test_pane_1.close() + Report.info(f"{Tests.close_pane_1}: {not test_pane_1.isVisible()}") + + # 4) Change dock location of test pane 2 + sc_main = sc.findChild(QtWidgets.QMainWindow) + sc_main.addDockWidget(DOCKAREA, find_pane(sc_main, TEST_PANE_2), QtCore.Qt.Vertical) + Report.info(f"{Tests.location_changed}: {sc_main.dockWidgetArea(find_pane(sc_main, TEST_PANE_2)) == DOCKAREA}") + + # 5) Resize test pane 3 + initial_size = test_pane_3.frameSize() + test_pane_3.resize(initial_size.width() + SCALE_INT, initial_size.height() + SCALE_INT) + new_size = test_pane_3.frameSize() + resize_success = ( + abs(initial_size.width() - new_size.width()) == abs(initial_size.height() - new_size.height()) == SCALE_INT + ) + Report.info(f"{Tests.resize_pane_3}: {resize_success}") + + if TEST_CONDITION == "after_restart": + try: + # 6) Restart Editor + # Restart is not possible through script and hence it is done by running the same file as 2 tests with a + # condition as before_test and after_test + + # 7) Verify if test pane 1 retain its visiblity + # This pane closed before restart and expected that pane should not be visible. + editor_window = pyside_utils.get_editor_main_window() + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + Report.info(f"{Tests.visiblity_retained}: {not find_pane(sc, TEST_PANE_1).isVisible()}") + + # 8) Verify if location of test pane 2 is retained + # This pane was set at DOCKAREA lcoation before restart + sc_main = sc.findChild(QtWidgets.QMainWindow) + Report.info( + f"{Tests.location_retained}: {sc_main.dockWidgetArea(find_pane(sc_main, TEST_PANE_2)) == DOCKAREA}" + ) + + # 9) Verify if size of test pane 3 is retained + # Verifying if size retained by checking current size not matching with default size + test_pane_3 = find_pane(sc, TEST_PANE_3) + retained_size = test_pane_3.frameSize() + click_menu_option(sc, "Restore Default Layout") + actual_size = test_pane_3.frameSize() + Report.info(f"{Tests.size_retained}: {retained_size != actual_size}") + + finally: + # 10) Restore default layout and close SC window + general.open_pane("Script Canvas") + helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0) + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + click_menu_option(sc, "Restore Default Layout") + sc.close() + + +if __name__ == "__main__": + import ImportPathHelper as imports + + imports.init() + + from utils import Report + + Report.start_test(Pane_PropertiesChanged_RetainsOnRestart) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvent_AddRemoveMethod_UpdatesInSC.py b/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvent_AddRemoveMethod_UpdatesInSC.py new file mode 100644 index 0000000000..21ad40014e --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvent_AddRemoveMethod_UpdatesInSC.py @@ -0,0 +1,202 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + + +# fmt: off +class Tests(): + new_event_created = ("New Script Event created", "New Script Event not created") + child_1_created = ("Initial Child Event created", "Initial Child Event not created") + child_2_created = ("Second Child Event created", "Second Child Event not created") + file_saved = ("Script event file saved", "Script event file did not save") + method_added = ("Method added to scriptevent file", "Method not added to scriptevent file") + method_removed = ("Method removed from scriptevent file", "Method not removed from scriptevent file") +# fmt: on + + +def ScriptEvent_AddRemoveMethod_UpdatesInSC(): + """ + Summary: + Method can be added/removed to an existing .scriptevents file + + Expected Behavior: + The Method is correctly added/removed to the asset, and Script Canvas nodes are updated accordingly. + + Test Steps: + 1) Open Asset Editor and Script Canvas windows + 2) Initially create new Script Event file with one method + 3) Verify if file is created and saved + 4) Add a new child element + 5) Update MethodNames and save file + 6) Verify if the new node exist in SC (search in node palette) + 7) Delete one method and save + 8) Verify if the node is removed in SC + 9) Close Asset Editor + + Note: + - This test file must be called from the Open 3D Engine 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 + from utils import TestHelper as helper + import pyside_utils + + # Open 3D Engine imports + import azlmbr.legacy.general as general + import azlmbr.editor as editor + import azlmbr.bus as bus + + # Pyside imports + from PySide2 import QtWidgets, QtTest, QtCore + + GENERAL_WAIT = 1.0 # seconds + + FILE_PATH = os.path.join("AutomatedTesting", "TestAssets", "test_file.scriptevents") + METHOD_NAME = "test_method_name" + + editor_window = pyside_utils.get_editor_main_window() + asset_editor = asset_editor_widget = container = menu_bar = None + sc = node_palette = tree = search_frame = search_box = None + + def initialize_asset_editor_qt_objects(): + nonlocal asset_editor, asset_editor_widget, container, menu_bar + asset_editor = editor_window.findChild(QtWidgets.QDockWidget, "Asset Editor") + asset_editor_widget = asset_editor.findChild(QtWidgets.QWidget, "AssetEditorWindowClass") + container = asset_editor_widget.findChild(QtWidgets.QWidget, "ContainerForRows") + menu_bar = asset_editor_widget.findChild(QtWidgets.QMenuBar) + + def initialize_sc_qt_objects(): + nonlocal sc, node_palette, tree, search_frame, search_box + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + if sc.findChild(QtWidgets.QDockWidget, "NodePalette") is None: + action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Palette", "type": QtWidgets.QAction}) + action.trigger() + node_palette = sc.findChild(QtWidgets.QDockWidget, "NodePalette") + tree = node_palette.findChild(QtWidgets.QTreeView, "treeView") + search_frame = node_palette.findChild(QtWidgets.QFrame, "searchFrame") + search_box = search_frame.findChild(QtWidgets.QLineEdit, "searchFilter") + + def save_file(): + editor.AssetEditorWidgetRequestsBus(bus.Broadcast, "SaveAssetAs", FILE_PATH) + action = pyside_utils.find_child_by_pattern(menu_bar, {"type": QtWidgets.QAction, "iconText": "Save"}) + action.trigger() + # wait till file is saved, to validate that check the text of QLabel at the bottom of the AssetEditor, + # if there are no unsaved changes we will not have any * in the text + label = asset_editor.findChild(QtWidgets.QLabel, "textEdit") + return helper.wait_for_condition(lambda: "*" not in label.text(), 3.0) + + def expand_container_rows(object_name): + children = container.findChildren(QtWidgets.QFrame, object_name) + for child in children: + check_box = child.findChild(QtWidgets.QCheckBox) + if check_box and not check_box.isChecked(): + QtTest.QTest.mouseClick(check_box, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier) + + def node_palette_search(node_name): + search_box.setText(node_name) + helper.wait_for_condition(lambda: search_box.text() == node_name, 1.0) + # Try clicking ENTER in search box multiple times + for _ in range(10): + QtTest.QTest.keyClick(search_box, QtCore.Qt.Key_Enter, QtCore.Qt.NoModifier) + if pyside_utils.find_child_by_pattern(tree, {"text": node_name}) is not None: + break + + # 1) Open Asset Editor + general.idle_enable(True) + # Initially close the Asset Editor and then reopen to ensure we don't have any existing assets open + general.close_pane("Asset Editor") + general.open_pane("Asset Editor") + helper.wait_for_condition(lambda: general.is_pane_visible("Asset Editor"), 5.0) + + # 2) Initially create new Script Event file with one method + initialize_asset_editor_qt_objects() + action = pyside_utils.find_child_by_pattern(menu_bar, {"type": QtWidgets.QAction, "text": "Script Events"}) + action.trigger() + result = helper.wait_for_condition( + lambda: container.findChild(QtWidgets.QFrame, "Events") is not None + and container.findChild(QtWidgets.QFrame, "Events").findChild(QtWidgets.QToolButton, "") is not None, + 3 * GENERAL_WAIT, + ) + Report.result(Tests.new_event_created, result) + # Add new method + add_event = container.findChild(QtWidgets.QFrame, "Events").findChild(QtWidgets.QToolButton, "") + add_event.click() + result = helper.wait_for_condition( + lambda: asset_editor_widget.findChild(QtWidgets.QFrame, "EventName") is not None, GENERAL_WAIT + ) + Report.result(Tests.child_1_created, result) + editor.AssetEditorWidgetRequestsBus(bus.Broadcast, "SaveAssetAs", FILE_PATH) + + # 3) Verify if file is created and saved + result = helper.wait_for_condition(lambda: os.path.exists(FILE_PATH), 3 * GENERAL_WAIT) + Report.result(Tests.file_saved, result and save_file()) + + # 4) Add a new child element + add_event = container.findChild(QtWidgets.QFrame, "Events").findChild(QtWidgets.QToolButton, "") + add_event.click() + result = helper.wait_for_condition( + lambda: len(asset_editor_widget.findChildren(QtWidgets.QFrame, "EventName")) == 2, 2 * GENERAL_WAIT + ) + Report.result(Tests.child_2_created, result) + + # 5) Update MethodNames and save file, (update all Method names to make it easier to search in SC later) + # Expand the EventName initially + expand_container_rows("EventName") + # Expand Name fields under it + expand_container_rows("Name") + count = 0 # 2 Method names will be updated Ex: test_method_name_0, test_method_name_1 + container = asset_editor_widget.findChild(QtWidgets.QWidget, "ContainerForRows") + children = container.findChildren(QtWidgets.QFrame, "Name") + for child in children: + line_edit = child.findChild(QtWidgets.QLineEdit) + if line_edit and line_edit.text() == "MethodName": + line_edit.setText(f"{METHOD_NAME}_{count}") + count += 1 + save_file() + + # 6) Verify if the new node exist in SC (search in node palette) + general.open_pane("Script Canvas") + helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0) + initialize_sc_qt_objects() + node_palette_search(f"{METHOD_NAME}_1") + get_node_index = lambda: pyside_utils.find_child_by_pattern(tree, {"text": f"{METHOD_NAME}_1"}) is not None + result = helper.wait_for_condition(get_node_index, GENERAL_WAIT) + Report.result(Tests.method_added, result) + + # 7) Delete one method and save + initialize_asset_editor_qt_objects() + for child in container.findChildren(QtWidgets.QFrame, "EventName"): + if child.findChild(QtWidgets.QToolButton, ""): + child.findChild(QtWidgets.QToolButton, "").click() + break + save_file() + + # 8) Verify if the node is removed in SC (search in node palette) + initialize_sc_qt_objects() + node_palette_search(f"{METHOD_NAME}_0") + get_node_index = lambda: pyside_utils.find_child_by_pattern(tree, {"text": f"{METHOD_NAME}_0"}) is None + result = helper.wait_for_condition(get_node_index, GENERAL_WAIT) + Report.result(Tests.method_removed, result) + + # 9) Close Asset Editor + general.close_pane("Asset Editor") + general.close_pane("Script Canvas") + + +if __name__ == "__main__": + import ImportPathHelper as imports + + imports.init() + from utils import Report + + Report.start_test(ScriptEvent_AddRemoveMethod_UpdatesInSC) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvents_AllParamDatatypes_CreationSuccess.py b/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvents_AllParamDatatypes_CreationSuccess.py new file mode 100644 index 0000000000..4beedec7cf --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/scripting/ScriptEvents_AllParamDatatypes_CreationSuccess.py @@ -0,0 +1,210 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + + +# fmt: off +class Tests(): + new_event_created = ("New Script Event created", "New Script Event not created") + child_event_created = ("Child Event created", "Child Event not created") + params_added = ("New parameters added", "New parameters are not added") + file_saved = ("Script event file saved", "Script event file did not save") + node_found = ("Node found in Script Canvas", "Node not found in Script Canvas") +# fmt: on + + +def ScriptEvents_AllParamDatatypes_CreationSuccess(): + """ + Summary: + Parameters of all types can be created. + + Expected Behavior: + The Method handles the large number of Parameters gracefully. + Parameters of all data types can be successfully created. + Updated ScriptEvent toast appears in Script Canvas. + + Test Steps: + 1) Open Asset Editor + 2) Initially create new Script Event file with one method + 3) Add new method and set name to it + 4) Add new parameters of each type + 5) Verify if parameters are added + 6) Expand the parameter rows + 7) Set different names and datatypes for each parameter + 8) Save file and verify node in SC Node Palette + 9) Close Asset Editor + + Note: + - This test file must be called from the Open 3D Engine 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 + from utils import TestHelper as helper + import pyside_utils + + # Open 3D Engine imports + import azlmbr.legacy.general as general + import azlmbr.editor as editor + import azlmbr.bus as bus + + # Pyside imports + from PySide2 import QtWidgets, QtTest, QtCore + + GENERAL_WAIT = 1.0 # seconds + + FILE_PATH = os.path.join("AutomatedTesting", "TestAssets", "test_file.scriptevents") + N_VAR_TYPES = 10 # Top 10 variable types + TEST_METHOD_NAME = "test_method_name" + + editor_window = pyside_utils.get_editor_main_window() + asset_editor = asset_editor_widget = container = menu_bar = None + sc = node_palette = tree = search_frame = search_box = None + + def initialize_asset_editor_qt_objects(): + nonlocal asset_editor, asset_editor_widget, container, menu_bar + asset_editor = editor_window.findChild(QtWidgets.QDockWidget, "Asset Editor") + asset_editor_widget = asset_editor.findChild(QtWidgets.QWidget, "AssetEditorWindowClass") + container = asset_editor_widget.findChild(QtWidgets.QWidget, "ContainerForRows") + menu_bar = asset_editor_widget.findChild(QtWidgets.QMenuBar) + + def initialize_sc_qt_objects(): + nonlocal sc, node_palette, tree, search_frame, search_box + sc = editor_window.findChild(QtWidgets.QDockWidget, "Script Canvas") + if sc.findChild(QtWidgets.QDockWidget, "NodePalette") is None: + action = pyside_utils.find_child_by_pattern(sc, {"text": "Node Palette", "type": QtWidgets.QAction}) + action.trigger() + node_palette = sc.findChild(QtWidgets.QDockWidget, "NodePalette") + tree = node_palette.findChild(QtWidgets.QTreeView, "treeView") + search_frame = node_palette.findChild(QtWidgets.QFrame, "searchFrame") + search_box = search_frame.findChild(QtWidgets.QLineEdit, "searchFilter") + + def save_file(): + editor.AssetEditorWidgetRequestsBus(bus.Broadcast, "SaveAssetAs", FILE_PATH) + action = pyside_utils.find_child_by_pattern(menu_bar, {"type": QtWidgets.QAction, "iconText": "Save"}) + action.trigger() + # wait till file is saved, to validate that check the text of QLabel at the bottom of the AssetEditor, + # if there are no unsaved changes we will not have any * in the text + label = asset_editor.findChild(QtWidgets.QLabel, "textEdit") + return helper.wait_for_condition(lambda: "*" not in label.text(), 3.0) + + def expand_container_rows(object_name): + children = container.findChildren(QtWidgets.QFrame, object_name) + for child in children: + check_box = child.findChild(QtWidgets.QCheckBox) + if check_box and not check_box.isChecked(): + QtTest.QTest.mouseClick(check_box, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier) + + def node_palette_search(node_name): + search_box.setText(node_name) + helper.wait_for_condition(lambda: search_box.text() == node_name, 1.0) + # Try clicking ENTER in search box multiple times + for _ in range(20): + QtTest.QTest.keyClick(search_box, QtCore.Qt.Key_Enter, QtCore.Qt.NoModifier) + if pyside_utils.find_child_by_pattern(tree, {"text": node_name}) is not None: + break + + def verify_added_params(): + for index in range(N_VAR_TYPES): + if container.findChild(QtWidgets.QFrame, f"[{index}]") is None: + return False + return True + + # 1) Open Asset Editor + general.idle_enable(True) + # Initially close the Asset Editor and then reopen to ensure we don't have any existing assets open + general.close_pane("Asset Editor") + general.open_pane("Asset Editor") + helper.wait_for_condition(lambda: general.is_pane_visible("Asset Editor"), 5.0) + + # 2) Initially create new Script Event file with one method + initialize_asset_editor_qt_objects() + action = pyside_utils.find_child_by_pattern(menu_bar, {"type": QtWidgets.QAction, "text": "Script Events"}) + action.trigger() + result = helper.wait_for_condition( + lambda: container.findChild(QtWidgets.QFrame, "Events") is not None + and container.findChild(QtWidgets.QFrame, "Events").findChild(QtWidgets.QToolButton, "") is not None, + 3 * GENERAL_WAIT, + ) + Report.result(Tests.new_event_created, result) + + # 3) Add new method and set name to it + add_event = container.findChild(QtWidgets.QFrame, "Events").findChild(QtWidgets.QToolButton, "") + add_event.click() + result = helper.wait_for_condition( + lambda: asset_editor_widget.findChild(QtWidgets.QFrame, "EventName") is not None, GENERAL_WAIT + ) + Report.result(Tests.child_event_created, result) + expand_container_rows("EventName") + expand_container_rows("Name") + initialize_asset_editor_qt_objects() + children = container.findChildren(QtWidgets.QFrame, "Name") + for child in children: + line_edit = child.findChild(QtWidgets.QLineEdit) + if line_edit is not None and line_edit.text() == "MethodName": + line_edit.setText(TEST_METHOD_NAME) + + # 4) Add new parameters of each type + helper.wait_for_condition(lambda: container.findChild(QtWidgets.QFrame, "Parameters") is not None, 2.0) + parameters = container.findChild(QtWidgets.QFrame, "Parameters") + add_param = parameters.findChild(QtWidgets.QToolButton, "") + for _ in range(N_VAR_TYPES): + add_param.click() + + # 5) Verify if parameters are added + result = helper.wait_for_condition(verify_added_params, 3.0) + Report.result(Tests.params_added, result) + + # 6) Expand the parameter rows (to render QFrame 'Type' for each param) + for index in range(N_VAR_TYPES): + expand_container_rows(f"[{index}]") + + # 7) Set different names and datatypes for each parameter + expand_container_rows("Name") + children = container.findChildren(QtWidgets.QFrame, "Name") + index = 0 + for child in children: + line_edit = child.findChild(QtWidgets.QLineEdit) + if line_edit is not None and line_edit.text() == "ParameterName": + line_edit.setText(f"param_{index}") + index += 1 + + children = container.findChildren(QtWidgets.QFrame, "Type") + index = 0 + for child in children: + combo_box = child.findChild(QtWidgets.QComboBox) + if combo_box is not None and index < N_VAR_TYPES: + combo_box.setCurrentIndex(index) + index += 1 + + # 8) Save file and verify node in SC Node Palette + Report.result(Tests.file_saved, save_file()) + general.open_pane("Script Canvas") + helper.wait_for_condition(lambda: general.is_pane_visible("Script Canvas"), 5.0) + initialize_sc_qt_objects() + node_palette_search(TEST_METHOD_NAME) + get_node_index = lambda: pyside_utils.find_child_by_pattern(tree, {"text": TEST_METHOD_NAME}) is not None + result = helper.wait_for_condition(get_node_index, 2.0) + Report.result(Tests.node_found, result) + + # 9) Close Asset Editor + general.close_pane("Asset Editor") + general.close_pane("Script Canvas") + + +if __name__ == "__main__": + import ImportPathHelper as imports + + imports.init() + from utils import Report + + Report.start_test(ScriptEvents_AllParamDatatypes_CreationSuccess) diff --git a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py similarity index 80% rename from AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py rename to AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py index c42c9f1a03..91d6b3e53e 100755 --- a/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Active.py +++ b/AutomatedTesting/Gem/PythonTests/scripting/TestSuite_Periodic.py @@ -76,14 +76,8 @@ class TestAutomation(TestAutomationBase): from . import ScriptCanvasComponent_OnEntityActivatedDeactivated_PrintMessage as test_module self._run_test(request, workspace, editor, test_module) -<<<<<<< HEAD def test_NodePalette_HappyPath_ClearSelection(self, request, workspace, editor, launcher_platform, project): from . import NodePalette_HappyPath_ClearSelection as test_module -======= - @pytest.mark.test_case_id("T92562993") - def test_NodePalette_ClearSelection(self, request, workspace, editor, launcher_platform, project): - from . import NodePalette_ClearSelection as test_module ->>>>>>> main self._run_test(request, workspace, editor, test_module) @pytest.mark.parametrize("level", ["tmp_level"]) @@ -119,11 +113,6 @@ class TestAutomation(TestAutomationBase): from . import Debugger_HappyPath_TargetMultipleGraphs as test_module self._run_test(request, workspace, editor, test_module) - @pytest.mark.test_case_id("T92569137") - def test_Debugging_TargetMultipleGraphs(self, request, workspace, editor, launcher_platform, project): - from . import Debugging_TargetMultipleGraphs as test_module - self._run_test(request, workspace, editor, test_module) - @pytest.mark.parametrize("level", ["tmp_level"]) def test_Debugger_HappyPath_TargetMultipleEntities(self, request, workspace, editor, launcher_platform, project, level): def teardown(): @@ -262,3 +251,92 @@ class TestScriptCanvasTests(object): auto_test_mode=False, timeout=60, ) + + @pytest.mark.parametrize( + "config", + [ + { + "cfg_args": "before_restart", + "expected_lines": [ + "All the test panes are opened: True", + "Test pane 1 is closed: True", + "Location of test pane 2 changed successfully: True", + "Test pane 3 resized successfully: True", + ], + }, + { + "cfg_args": "after_restart", + "expected_lines": [ + "Test pane retained its visiblity on Editor restart: True", + "Test pane retained its location on Editor restart: True", + "Test pane retained its size on Editor restart: True", + ], + }, + ], + ) + + def test_Pane_PropertiesChanged_RetainsOnRestart(self, request, editor, config, project, launcher_platform): + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "Pane_PropertiesChanged_RetainsOnRestart.py", + config.get('expected_lines'), + cfg_args=[config.get('cfg_args')], + auto_test_mode=False, + timeout=60, + ) + + def test_ScriptEvent_AddRemoveMethod_UpdatesInSC(self, request, workspace, editor, launcher_platform): + def teardown(): + file_system.delete( + [os.path.join(workspace.paths.project(), "TestAssets", "test_file.scriptevents")], True, True + ) + request.addfinalizer(teardown) + file_system.delete( + [os.path.join(workspace.paths.project(), "TestAssets", "test_file.scriptevents")], True, True + ) + expected_lines = [ + "Success: New Script Event created", + "Success: Initial Child Event created", + "Success: Second Child Event created", + "Success: Script event file saved", + "Success: Method added to scriptevent file", + "Success: Method removed from scriptevent file", + ] + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "ScriptEvent_AddRemoveMethod_UpdatesInSC.py", + expected_lines, + auto_test_mode=False, + timeout=60, + ) + + def test_ScriptEvents_AllParamDatatypes_CreationSuccess(self, request, workspace, editor, launcher_platform): + def teardown(): + file_system.delete( + [os.path.join(workspace.paths.project(), "TestAssets", "test_file.scriptevents")], True, True + ) + request.addfinalizer(teardown) + file_system.delete( + [os.path.join(workspace.paths.project(), "TestAssets", "test_file.scriptevents")], True, True + ) + expected_lines = [ + "Success: New Script Event created", + "Success: Child Event created", + "Success: New parameters added", + "Success: Script event file saved", + "Success: Node found in Script Canvas", + ] + hydra.launch_and_validate_results( + request, + TEST_DIRECTORY, + editor, + "ScriptEvents_AllParamDatatypes_CreationSuccess.py", + expected_lines, + auto_test_mode=False, + timeout=60, + ) + \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt new file mode 100644 index 0000000000..a3b6e36250 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/smoke/CMakeLists.txt @@ -0,0 +1,45 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_pytest( + NAME AutomatedTesting::SmokeTest + TEST_SUITE smoke + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + PYTEST_MARKS "SUITE_smoke" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + AZ::PythonBindingsExample + Legacy::Editor + AutomatedTesting.GameLauncher + AutomatedTesting.Assets + COMPONENT + Smoke + ) + + ly_add_pytest( + NAME AutomatedTesting::SandboxTest + TEST_SUITE sandbox + TEST_SERIAL + PATH ${CMAKE_CURRENT_LIST_DIR} + PYTEST_MARKS "SUITE_sandbox" + TIMEOUT 1500 + RUNTIME_DEPENDENCIES + AZ::AssetProcessor + AZ::PythonBindingsExample + Legacy::Editor + AutomatedTesting.GameLauncher + AutomatedTesting.Assets + COMPONENT + Smoke + ) +endif() \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py index 985740307f..e6b072ba58 100644 --- a/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py +++ b/AutomatedTesting/Gem/PythonTests/smoke/test_Editor_NewExistingLevels_Works.py @@ -15,7 +15,7 @@ from automatedtesting_shared.base import TestAutomationBase import ly_test_tools.environment.file_system as file_system -@pytest.mark.SUITE_smoke +@pytest.mark.SUITE_sandbox @pytest.mark.parametrize("launcher_platform", ["windows_editor"]) @pytest.mark.parametrize("project", ["AutomatedTesting"]) @pytest.mark.parametrize("level", ["temp_level"]) diff --git a/AutomatedTesting/Gem/PythonTests/streaming/CMakeLists.txt b/AutomatedTesting/Gem/PythonTests/streaming/CMakeLists.txt new file mode 100644 index 0000000000..10b9fabcc0 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/streaming/CMakeLists.txt @@ -0,0 +1,24 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) + # Unstable, SPEC-3838 will restore + #ly_add_pytest( + # NAME AutomatedTesting::asset_load_benchmark_test + # TEST_SERIAL + # TEST_SUITE benchmark + # PATH ${CMAKE_CURRENT_LIST_DIR}/benchmark/asset_load_benchmark_test.py + # RUNTIME_DEPENDENCIES + # AZ::AssetProcessor + # AZ::AssetProcessorBatch + # AutomatedTesting.GameLauncher + #) +endif() diff --git a/AutomatedTesting/Levels/WaterSample/WaterSample.ly b/AutomatedTesting/Levels/WaterSample/WaterSample.ly deleted file mode 100644 index b1899f3710..0000000000 --- a/AutomatedTesting/Levels/WaterSample/WaterSample.ly +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d49aceca5ad4e0b9f46c8127afb5c53b68aa30272950b1abd66fba310977ff0c -size 15032 diff --git a/AutomatedTesting/Levels/WaterSample/filelist.xml b/AutomatedTesting/Levels/WaterSample/filelist.xml deleted file mode 100644 index d14b2fdaf2..0000000000 --- a/AutomatedTesting/Levels/WaterSample/filelist.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AutomatedTesting/Levels/WaterSample/halfsphere.cgf b/AutomatedTesting/Levels/WaterSample/halfsphere.cgf deleted file mode 100644 index 4426d8a232..0000000000 --- a/AutomatedTesting/Levels/WaterSample/halfsphere.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f221acd847ec8a15e1333a5163d6d0fd886b8eda46fa7b133f76ddbf1d11216 -size 41472 diff --git a/AutomatedTesting/Levels/WaterSample/halfsphere2.cgf b/AutomatedTesting/Levels/WaterSample/halfsphere2.cgf deleted file mode 100644 index c776ff68b8..0000000000 --- a/AutomatedTesting/Levels/WaterSample/halfsphere2.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8e5dcfbe65fd2fd8ea29a38a96e703683c544fd42b9424857b1df3718c7775a -size 41472 diff --git a/AutomatedTesting/Levels/WaterSample/level.pak b/AutomatedTesting/Levels/WaterSample/level.pak deleted file mode 100644 index 1753ef4b93..0000000000 --- a/AutomatedTesting/Levels/WaterSample/level.pak +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0378911c27933302042550d5a031a5f9104296162edc2b21e44893f1b8cff969 -size 44124 diff --git a/AutomatedTesting/Levels/WaterSample/leveldata/Environment.xml b/AutomatedTesting/Levels/WaterSample/leveldata/Environment.xml deleted file mode 100644 index 6a95c631bb..0000000000 --- a/AutomatedTesting/Levels/WaterSample/leveldata/Environment.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/WaterSample/leveldata/TerrainTexture.xml b/AutomatedTesting/Levels/WaterSample/leveldata/TerrainTexture.xml deleted file mode 100644 index 21741afe52..0000000000 --- a/AutomatedTesting/Levels/WaterSample/leveldata/TerrainTexture.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Levels/WaterSample/leveldata/TimeOfDay.xml b/AutomatedTesting/Levels/WaterSample/leveldata/TimeOfDay.xml deleted file mode 100644 index 60ad405904..0000000000 --- a/AutomatedTesting/Levels/WaterSample/leveldata/TimeOfDay.xml +++ /dev/null @@ -1,356 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AutomatedTesting/Levels/WaterSample/leveldata/VegetationMap.dat b/AutomatedTesting/Levels/WaterSample/leveldata/VegetationMap.dat deleted file mode 100644 index dce5631cd0..0000000000 --- a/AutomatedTesting/Levels/WaterSample/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/WaterSample/pool.cgf b/AutomatedTesting/Levels/WaterSample/pool.cgf deleted file mode 100644 index 04bec52a62..0000000000 --- a/AutomatedTesting/Levels/WaterSample/pool.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12ca8f1942331abde4d58724aea22609c8d7951cc415afa6e5f1c550a14e67b0 -size 363624 diff --git a/AutomatedTesting/Levels/WaterSample/pool2.cgf b/AutomatedTesting/Levels/WaterSample/pool2.cgf deleted file mode 100644 index 204306f8a8..0000000000 --- a/AutomatedTesting/Levels/WaterSample/pool2.cgf +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f5b525a410730d84c0b3e97396d392e1e72f4b894742ddef3de4ede5542b0f8e -size 86148 diff --git a/AutomatedTesting/Levels/WaterSample/tags.txt b/AutomatedTesting/Levels/WaterSample/tags.txt deleted file mode 100644 index 0d6c1880e7..0000000000 --- a/AutomatedTesting/Levels/WaterSample/tags.txt +++ /dev/null @@ -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,0,0 diff --git a/AutomatedTesting/Levels/WaterSample/terraintexture.pak b/AutomatedTesting/Levels/WaterSample/terraintexture.pak deleted file mode 100644 index fe3604a050..0000000000 --- a/AutomatedTesting/Levels/WaterSample/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/WaterSample/woodland_canyon_river.mtl b/AutomatedTesting/Levels/WaterSample/woodland_canyon_river.mtl deleted file mode 100644 index 4548bca421..0000000000 --- a/AutomatedTesting/Levels/WaterSample/woodland_canyon_river.mtl +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/AutomatedTesting/Objects/LumberTank/ProxyGray_ddna.tif.exportsettings b/AutomatedTesting/Objects/LumberTank/ProxyGray_ddna.tif.exportsettings index 013c774e9e..a4e1a9a3c5 100644 --- a/AutomatedTesting/Objects/LumberTank/ProxyGray_ddna.tif.exportsettings +++ b/AutomatedTesting/Objects/LumberTank/ProxyGray_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:0,pc:0,provo:0" \ No newline at end of file +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:0,pc:0,provo:0" \ No newline at end of file diff --git a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override index 9fa5e26768..696a0a74da 100644 --- a/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override +++ b/AutomatedTesting/Registry/C3510644_Collider_CollisionGroups.setreg_override @@ -119,6 +119,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override new file mode 100644 index 0000000000..c53b04e5c2 --- /dev/null +++ b/AutomatedTesting/Registry/C4044459_Material_DynamicFriction.setreg_override @@ -0,0 +1,118 @@ +{ + "Amazon": { + "Gems": { + "PhysX": { + "PhysXSystemConfiguration": { + "CollisionConfig": { + "Layers": { + "LayerNames": [ + "Default", + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + {}, + "TouchBend" + ] + }, + "Groups": { + "GroupPresets": [ + { + "Name": "All", + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{CDB6B8D8-5CD0-40A8-874D-839B00A92EBB}" + }, + "Name": "None", + "Group": { + "Mask": 0 + }, + "ReadOnly": true + }, + { + "Id": { + "GroupId": "{22769429-5D46-429B-829A-0115239D9AAA}" + }, + "Name": "All_NoTouchBend", + "Group": { + "Mask": 9223372036854775807 + }, + "ReadOnly": true + } + ] + } + }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, + "MaterialLibrary": { + "assetId": { + "guid": "{6AA79EE4-7EC3-5717-87AE-EDD7D886FD7F}" + }, + "loadBehavior": "QueueLoad", + "assetHint": "levels/physics/c4044459_material_dynamicfriction/dynamic_friction.physmaterial" + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override index afbe6a9d38..5e98e08ede 100644 --- a/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override +++ b/AutomatedTesting/Registry/C4976227_Collider_NewGroup.setreg_override @@ -107,6 +107,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override index 9fa5e26768..696a0a74da 100644 --- a/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override +++ b/AutomatedTesting/Registry/C4976244_Collider_SameGroupSameLayerCollision.setreg_override @@ -119,6 +119,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override index 9fa5e26768..696a0a74da 100644 --- a/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override +++ b/AutomatedTesting/Registry/C4976245_PhysXCollider_CollisionLayerTest.setreg_override @@ -119,6 +119,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override index 9fa5e26768..696a0a74da 100644 --- a/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override +++ b/AutomatedTesting/Registry/C4982593_PhysXCollider_CollisionLayer.setreg_override @@ -119,6 +119,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/Registry/authenticationProvider.setreg b/AutomatedTesting/Registry/authenticationProvider.setreg new file mode 100644 index 0000000000..c90433468c --- /dev/null +++ b/AutomatedTesting/Registry/authenticationProvider.setreg @@ -0,0 +1,5 @@ +{ + "AWS": + { + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/awscoreconfiguration.setreg b/AutomatedTesting/Registry/awscoreconfiguration.setreg new file mode 100644 index 0000000000..ca110eb103 --- /dev/null +++ b/AutomatedTesting/Registry/awscoreconfiguration.setreg @@ -0,0 +1,10 @@ +{ + "Amazon": + { + "AWSCore": + { + "ProfileName": "default", + "ResourceMappingConfigFileName": "aws_resource_mappings.json" + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Registry/physxsystemconfiguration.setreg b/AutomatedTesting/Registry/physxsystemconfiguration.setreg index 02f65b685b..30e9dced44 100644 --- a/AutomatedTesting/Registry/physxsystemconfiguration.setreg +++ b/AutomatedTesting/Registry/physxsystemconfiguration.setreg @@ -101,6 +101,9 @@ ] } }, + "DefaultMaterial": { + "SurfaceType": "Default_1" + }, "MaterialLibrary": { "assetId": { "guid": "{3A055A3F-8CB7-5FEE-B437-EB365FACD0D4}" diff --git a/AutomatedTesting/TestAssets/MaxIteration31Deep.txt b/AutomatedTesting/TestAssets/MaxIteration31Deep.txt index e9e8f94715..d0ac57c883 100644 --- a/AutomatedTesting/TestAssets/MaxIteration31Deep.txt +++ b/AutomatedTesting/TestAssets/MaxIteration31Deep.txt @@ -1,3 +1,3 @@ The dependency scanner has a built in limit to how deep it will recurse when multiple results exist on the same line. This file has a single line with 10 invalid UUIDs, and an 11th valid UUID. -1: 00000000-0000-0000-0000-000000000000, 2: 00000000-0000-0000-0000-000000000000, 3: 00000000-0000-0000-0000-000000000000, 4: 00000000-0000-0000-0000-000000000000, 5: 00000000-0000-0000-0000-000000000000, 6: 00000000-0000-0000-0000-000000000000, 7: 00000000-0000-0000-0000-000000000000, 8: 00000000-0000-0000-0000-000000000000, 9: 00000000-0000-0000-0000-000000000000, 10: 00000000-0000-0000-0000-000000000000, 11: 00000000-0000-0000-0000-000000000000, 12: 00000000-0000-0000-0000-000000000000, 13: 00000000-0000-0000-0000-000000000000, 14: 00000000-0000-0000-0000-000000000000, 15: 00000000-0000-0000-0000-000000000000, 16: 00000000-0000-0000-0000-000000000000, 17: 00000000-0000-0000-0000-000000000000, 18: 00000000-0000-0000-0000-000000000000, 19: 00000000-0000-0000-0000-000000000000, 20: 00000000-0000-0000-0000-000000000000, 21: 00000000-0000-0000-0000-000000000000, 22: 00000000-0000-0000-0000-000000000000, 23: 00000000-0000-0000-0000-000000000000, 24: 00000000-0000-0000-0000-000000000000, 25: 00000000-0000-0000-0000-000000000000, 26: 00000000-0000-0000-0000-000000000000, 27: 00000000-0000-0000-0000-000000000000, 28: 00000000-0000-0000-0000-000000000000, 29: 00000000-0000-0000-0000-000000000000, 30: 00000000-0000-0000-0000-000000000000, 31 (valid UUID, game . xml): B92667DC-9F5B-5D72-A29D-99219DD9B691 +1: 00000000-0000-0000-0000-000000000000, 2: 00000000-0000-0000-0000-000000000000, 3: 00000000-0000-0000-0000-000000000000, 4: 00000000-0000-0000-0000-000000000000, 5: 00000000-0000-0000-0000-000000000000, 6: 00000000-0000-0000-0000-000000000000, 7: 00000000-0000-0000-0000-000000000000, 8: 00000000-0000-0000-0000-000000000000, 9: 00000000-0000-0000-0000-000000000000, 10: 00000000-0000-0000-0000-000000000000, 11: 00000000-0000-0000-0000-000000000000, 12: 00000000-0000-0000-0000-000000000000, 13: 00000000-0000-0000-0000-000000000000, 14: 00000000-0000-0000-0000-000000000000, 15: 00000000-0000-0000-0000-000000000000, 16: 00000000-0000-0000-0000-000000000000, 17: 00000000-0000-0000-0000-000000000000, 18: 00000000-0000-0000-0000-000000000000, 19: 00000000-0000-0000-0000-000000000000, 20: 00000000-0000-0000-0000-000000000000, 21: 00000000-0000-0000-0000-000000000000, 22: 00000000-0000-0000-0000-000000000000, 23: 00000000-0000-0000-0000-000000000000, 24: 00000000-0000-0000-0000-000000000000, 25: 00000000-0000-0000-0000-000000000000, 26: 00000000-0000-0000-0000-000000000000, 27: 00000000-0000-0000-0000-000000000000, 28: 00000000-0000-0000-0000-000000000000, 29: 00000000-0000-0000-0000-000000000000, 30: 00000000-0000-0000-0000-000000000000, 31 (valid UUID, libs / particles / milestone2particles . xml): 6BDE282B-49C9-57F7-B071-4B26579BCA9A diff --git a/AutomatedTesting/TestAssets/OnlyMatchesCorrectLengthUUIDs.txt b/AutomatedTesting/TestAssets/OnlyMatchesCorrectLengthUUIDs.txt index d49108072a..10bdaec686 100644 --- a/AutomatedTesting/TestAssets/OnlyMatchesCorrectLengthUUIDs.txt +++ b/AutomatedTesting/TestAssets/OnlyMatchesCorrectLengthUUIDs.txt @@ -1,15 +1,15 @@ The missing dependency scanner was updated to only look for substrings that are the exact length of UUIDs, separated by word boundaries. This avoids problems with very long numbers causing the scan to stall out and take a long time. -This is the UUID for dev / AutomatedTesting / Config / Game . xml with an extra UUID character at the beginning. It should not show up in scan results. -aB92667DC-9F5B-5D72-A29D-99219DD9B691 +This is the UUID for libs / particles / milestone2particles . xml with an extra UUID character at the beginning. It should not show up in scan results. +a6BDE282B49C957F7B0714B26579BCA9A -This is the UUID for dev / AutomatedTesting / Config / Editor . xml. It has an extra non-UUID character at the end. It should not show up in scan results. -06E9D6633C875400A532BCB2C0CA19D6t +This is the UUID for project . json. It has an extra non-UUID character at the end. It should not show up in scan results. +B076CDDC14DF50F4A5E97518ABB3E851t -Two UUIDs, the first invalid a6BDE282B49C957F7B0714B26579BCA9A mixed with a second valid one 58BE9DA51F1753B98CEEEEB10E63454D the same line. The second should show up in scan results. +Two UUIDs, the first invalid a1CB10C43F3245B93A294C602ADEF95F9 mixed with a second valid one D1265251CC14584AB1CECB10746A2BA0 the same line. The second should show up in scan results. -UUID for slices / MuzzleFlash . slice, after an equal sign should show up in scan results=747D31D71E62553592226173C49CF97E +UUID for TestAssets / DependencyScannerAsset . slice, after an equal sign should show up in scan results=837412DFD05F576D81AAACF360463749 -UUID for TestsAssets / WildcardScanTest1 . txt in quotes, should show up in scan results"1CB10C43-F324-5B93-A294-C602ADEF95F9" +UUID for TestAssets / WildcardScanTest2 . txt in quotes, should show up in scan results"D92C4661C8985E19BD3597CB2318CFA6" -UUID for Objects / Lumbertank_turret . cgf in curly braces, should up show in scan results{D92C4661C8985E19BD3597CB2318CFA6} +UUID for TestAssets / SelfReferenceAssetID. txt in curly braces, should up show in scan results{785A05D2483E5B43A2B992ACDAE6E938} diff --git a/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt b/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt index b2f341a15f..d3975ced7c 100644 --- a/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt +++ b/AutomatedTesting/TestAssets/RelativeProductPathsNotDependencies.txt @@ -1,25 +1,25 @@ These tests are mostly done with files that have a different extension between source and product. The source scan is done first, and will catch files in the source path. Product path searching is resolved using "endsWith" logic. -textures/_dev_purple.dds +textures/_dev_purple.tif.streamingimage Back slashes, and project name in the path -automatedtesting\textures\_dev_stucco.dds +pc/textures/_dev_stucco.tif.streamingimage Double back slashes -textures\\_dev_tan.dds +textures\\_dev_tan.tif.streamingimage Casing doesn't match -TEXTURES/_DEV_WHITE.dds +TEXTURES/_DEV_WHITE.tif.streamingimage Some files have multiple extensions, this verifies that won't trip up the scanner. -textures/_dev_yellow_light.dds.2 -Path inline textures/milestone2/ama_grey_02.dds test -Path after=textures/_dev_woodland.dds equal sign +textures/_dev_yellow_light.tif.1002.imagemipchain +Path inline textures/milestone2/ama_grey_02.tif.streamingimage test +Path after=textures/_dev_woodland.tif.streamingimage equal sign Multiple paths on one line Multiple materials/am_grass1.mtl paths materials/am_rockground.mtl on one line Path before a UUID Path materials/floor_tile.mtl before B92667DC-9F5B-5D72-A29D-99219DD9B691 a UUID Path before an asset ID -Path ui/milestone2menu.uicanvas before an 2ef92b8D044E5C278E2BB1AC0374A4E7:131072 asset ID +Path ui/milestone2menu.uicanvas before an 2ef92b8D044E5C278E2BB1AC0374A4E7:1002 asset ID Path after a UUID -Path after CEAA362B4E505BCEB827CB92EF40A50E a ui/fonts/lyshineexamples/vera.ttf UUID +Path after CEAA362B4E505BCEB827CB92EF40A50E a project.json UUID Path after an asset ID -Path after {A2482826-053D-5634-A27B-084B1326AAE5}:[196608] an ui/fonts/lyshineexamples/veramono.ttf asset ID +Path after {A2482826-053D-5634-A27B-084B1326AAE5}:[1002] an libs/particles/milestone2particles.xml asset ID diff --git a/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt b/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt index 27ac8f02dd..a5ae046b11 100644 --- a/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt +++ b/AutomatedTesting/TestAssets/RelativeSourcePathsNotDependencies.txt @@ -3,6 +3,6 @@ TestAssets/RelativeProductPathsNotDependencies.txt Back slashes TestAssets\WildcardScanTest1.txt Casing doesn't match -Config/gAME.XML -Path inline Config/Editor.xml test +libs/particles/milestone2PARTICLES.XML +Path inline project.json test Path after=textures/_dev_Purple.tif equal sign diff --git a/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt b/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt index 0d677113e0..4cda459232 100644 --- a/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt +++ b/AutomatedTesting/TestAssets/ValidAssetIdNotDependency.txt @@ -1,5 +1,5 @@ -dev/AutomatedTesting/textures/_dev_Purple.tif, the product ID is for one of the mips. -{A2482826-053D-5634-A27B-084B1326AAE5}:[196608] -_dev_Red.tif, another mip, different formatting. -2ef92b8D044E5C278E2BB1AC0374A4E7:131072 -_dev_White.tif, {D83B36F1-61A6-5001-B191-4D0CE282E236}-327680 asset ID inline. + /textures /_dev_Purple . tif, the product ID is for one of the mips. +{A2482826-053D-5634-A27B-084B1326AAE5}:[1002] +_dev_Red . tif, another mip, different formatting. +2ef92b8D044E5C278E2BB1AC0374A4E7:1003 +_dev_White.tif, {D83B36F1-61A6-5001-B191-4D0CE282E236}-1002 asset ID inline. diff --git a/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt b/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt index c6b2cbb0e7..436d6fb628 100644 --- a/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt +++ b/AutomatedTesting/TestAssets/ValidUUIDsNotDependency.txt @@ -1,18 +1,18 @@ Paths are broken up to avoid having them show up as relative path results. -This is the UUID for dev / AutomatedTesting / Config / Game . xml -B92667DC-9F5B-5D72-A29D-99219DD9B691 -This is the UUID for dev / AutomatedTesting / Config / Editor . xml. This tests UUIDs without separators. -06E9D6633C875400A532BCB2C0CA19D6 +This is the UUID for Materials / Default / AM_UV_v1_1K_source . png +C67BEA9F-09FF-59AA-A7F0-A52B8F987508 +This is the UUID for libs / particles / milestone2particles . xml. This tests UUIDs without separators. +6BDE282B49C957F7B0714B26579BCA9A This is the UUID for SelfReferenceUUID.txt. This tests UUIDs with mixed casing. 33bcee02F3225688ABEE534F6058593F -This is a UUID mid-line 9886E132-572D-5746-9377-E629AB6C1981, for gems . json +This is a UUID mid-line B076CDDC-14DF-50F4-A5E9-7518ABB3E851, for project . json Two UUIDs on the same line -Two UUIDs 6BDE282B49C957F7B0714B26579BCA9A mixed on 58BE9DA51F1753B98CEEEEB10E63454D the same line +Two UUIDs 345E5C660D6254FF8D0F7C8EE66A2249 mixed on A26C73D1837E5AE59E68F916FA7C3699 the same line Test UUIDs and Asset IDs mixed on the same line. Relative paths are handled in the relative path tests. UUID: slices / MuzzleFlash . slice, AssetID: TestsAssets / WildcardScanTest1 . txt This 747D31D71E62553592226173C49CF97E uuid is on the line with 1CB10C43F3245B93A294C602ADEF95F9:[0] a valid asset ID UUID: Objects / Lumbertank_turret . cgf, AssetID: TestsAssets / WildcardScanTest2 . txt -This D92C4661C8985E19BD3597CB2318CFA6:[0] uuid is on the line with 7364AB2B092F5B0B80601BBC6E53087C a valid asset ID +This D92C4661C8985E19BD3597CB2318CFA6:[0] uuid is on the line with 37108522F50459499CD6C8D47A960CF1 a valid asset ID diff --git a/AutomatedTesting/preview.png b/AutomatedTesting/preview.png index 2191a0ebc2..3d4fe78063 100644 --- a/AutomatedTesting/preview.png +++ b/AutomatedTesting/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a18fae4040a22d2bb359a8ca642b97bb8f6468eeb52e2826b3b029bd8f1350b6 -size 5466 +oid sha256:40949893ed7009eeaa90b7ce6057cb6be9dfaf7b162e3c26ba9dadf985939d7d +size 2038 diff --git a/AutomatedTesting/surfacetypemateriallibrary.physmaterial b/AutomatedTesting/surfacetypemateriallibrary.physmaterial index 3c39d5521e..434d673998 100644 --- a/AutomatedTesting/surfacetypemateriallibrary.physmaterial +++ b/AutomatedTesting/surfacetypemateriallibrary.physmaterial @@ -1,18 +1,19 @@ - + - - - + + + + - + diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ee08a8d16..387f536966 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,34 +25,13 @@ include(cmake/LySet.cmake) include(cmake/Version.cmake) include(cmake/OutputDirectory.cmake) -# Set the engine_path and engine_json -set(o3de_engine_path ${CMAKE_CURRENT_LIST_DIR}) -set(o3de_engine_json ${o3de_engine_path}/engine.json) - if(NOT PROJECT_NAME) project(O3DE LANGUAGES C CXX VERSION ${LY_VERSION_STRING} ) - - # o3de manifest - include(cmake/o3de_manifest.cmake) endif() -################################################################################ -# Resolve this engines name and restricted path -################################################################################ -o3de_engine_name(${o3de_engine_json} o3de_engine_name) -o3de_restricted_path(${o3de_engine_json} o3de_engine_restricted_path) -message(STATUS "O3DE Engine Name: ${o3de_engine_name}") -message(STATUS "O3DE Engine Path: ${o3de_engine_path}") -if(o3de_engine_restricted_path) - message(STATUS "O3DE Engine Restricted Path: ${o3de_engine_restricted_path}") -endif() - -# add the engines cmake folder to the CMAKE_MODULE_PATH -list(APPEND CMAKE_MODULE_PATH "${o3de_engine_path}/cmake") - ################################################################################ # Initialize ################################################################################ @@ -60,6 +39,7 @@ include(cmake/GeneralSettings.cmake) include(cmake/FileUtil.cmake) include(cmake/PAL.cmake) include(cmake/PALTools.cmake) +include(cmake/RuntimeDependencies.cmake) include(cmake/Install.cmake) include(cmake/Configurations.cmake) # Requires to be after PAL so we get platform variable definitions include(cmake/Dependencies.cmake) @@ -67,88 +47,106 @@ include(cmake/Deployment.cmake) include(cmake/3rdParty.cmake) include(cmake/LYPython.cmake) include(cmake/LYWrappers.cmake) +include(cmake/Gems.cmake) include(cmake/UnitTest.cmake) include(cmake/LYTestWrappers.cmake) include(cmake/Monolithic.cmake) include(cmake/SettingsRegistry.cmake) include(cmake/TestImpactFramework/LYTestImpactFramework.cmake) include(cmake/CMakeFiles.cmake) +include(cmake/O3DEJson.cmake) ################################################################################ # Subdirectory processing ################################################################################ +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}) + endforeach() + + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${engine_external_subdirs}) +endfunction() + # Add the projects first so the Launcher can find them include(cmake/Projects.cmake) if(NOT INSTALLED_ENGINE) + # Add the rest of the targets add_subdirectory(Code) + add_subdirectory(scripts) + + # SPEC-1417 will investigate and fix this + if(NOT PAL_PLATFORM_NAME STREQUAL "Mac") + add_subdirectory(Tools/LyTestTools/tests/) + add_subdirectory(Tools/RemoteConsole/ly_remote_console/tests/) + endif() + + # 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() + 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() + else() ly_find_o3de_packages() endif() -# Add external subdirectories listed in the manifest -list(APPEND LY_EXTERNAL_SUBDIRS ${o3de_engine_external_subdirectories}) - -set(enabled_platforms - ${PAL_PLATFORM_NAME} - ${LY_PAL_TOOLS_ENABLED}) - -# Add any engine restricted platforms as external subdirs -o3de_add_engine_restricted_platform_external_subdirs() - -if(NOT INSTALLED_ENGINE) - add_subdirectory(scripts) -endif() - -# SPEC-1417 will investigate and fix this -if(NOT PAL_PLATFORM_NAME STREQUAL "Mac") - add_subdirectory(Tools/LyTestTools/tests/) - add_subdirectory(Tools/RemoteConsole/ly_remote_console/tests/) -endif() - ################################################################################ # Post-processing ################################################################################ - -# 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}/${directory_name}-${full_directory_hash}) -endforeach() - # The following steps have to be done after all targets are registered: -# 1. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls +# Defer generation of the StaticModules.inl file which is needed to create the AZ::Module derived class in monolithic +# builds until after all the targets are known +ly_delayed_generate_static_modules_inl() + +# 1. Add any dependencies registered via ly_enable_gems +ly_enable_gems_delayed() + +# 2. generate a settings registry .setreg file for all ly_add_project_dependencies() and ly_add_target_dependencies() calls # to provide applications with the filenames of gem modules to load -# This must be done before ly_delayed_target_link_libraries() as that inserts BUILD_DEPENDENCIE as MANUALLY_ADDED_DEPENDENCIES +# This must be done before ly_delayed_target_link_libraries() as that inserts BUILD_DEPENDENCIES as MANUALLY_ADDED_DEPENDENCIES # if the build dependency is a MODULE_LIBRARY. That would cause a false load dependency to be generated ly_delayed_generate_settings_registry() -# 2. link targets where the dependency was yet not declared, we need to have the declaration so we do different + +# 3. link targets where the dependency was yet not declared, we need to have the declaration so we do different # linking logic depending on the type of target ly_delayed_target_link_libraries() -# 3. generate a registry file for unit testing for platforms that support unit testing + +# 4. generate a registry file for unit testing for platforms that support unit testing if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_delayed_generate_unit_test_module_registry() endif() -# 4. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through -# the dependencies -include(cmake/RuntimeDependencies.cmake) -# 5. Perform test impact framework post steps once all of the targets have been enumerated -ly_test_impact_post_step() -# 6. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine -if(NOT INSTALLED_ENGINE) - ly_setup_o3de_install() - # IMPORTANT: must be included last +# 5. inject runtime dependencies to the targets. We need to do this after (1) since we are going to walk through +# the dependencies +ly_delayed_generate_runtime_dependencies() + +# 6. Perform test impact framework post steps once all of the targets have been enumerated +ly_test_impact_post_step() + +# 7. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine +if(NOT INSTALLED_ENGINE) + # 8. Generate the O3DE find file and setup install locations for scripts, tools, assets etc., required by the engine + ly_setup_o3de_install() + # 9. CPack information (to be included after install) include(cmake/Packaging.cmake) endif() diff --git a/Code/CryEngine/CryCommon/IShader.h b/Code/CryEngine/CryCommon/IShader.h index aea0762a81..81fe18706d 100644 --- a/Code/CryEngine/CryCommon/IShader.h +++ b/Code/CryEngine/CryCommon/IShader.h @@ -772,7 +772,6 @@ _MS_ALIGN(16) struct SSkinningData void* pCharInstCB; // used if per char instance cbs are available in renderdll (d3d11+); // members below are for Software Skinning void* pCustomData; // client specific data, used for example for sw-skinning on animation side - SSkinningData** pMasterSkinningDataList; // used by the SkinningData for a Character Instance, contains a list of all Skin Instances which need SW-Skinning SSkinningData* pNextSkinningData; // List to the next element which needs SW-Skinning } _ALIGN(16); diff --git a/Code/CryEngine/CryCommon/ISystem.h b/Code/CryEngine/CryCommon/ISystem.h index f863804f3d..653776f55b 100644 --- a/Code/CryEngine/CryCommon/ISystem.h +++ b/Code/CryEngine/CryCommon/ISystem.h @@ -125,7 +125,7 @@ enum ESystemConfigPlatform { CONFIG_INVALID_PLATFORM = 0, CONFIG_PC = 1, - CONFIG_OSX_GL = 2, + CONFIG_MAC = 2, CONFIG_OSX_METAL = 3, CONFIG_ANDROID = 4, CONFIG_IOS = 5, diff --git a/Code/CryEngine/CryCommon/LyShine/IDraw2d.h b/Code/CryEngine/CryCommon/LyShine/IDraw2d.h index 16fdfceca3..76a71c9e24 100644 --- a/Code/CryEngine/CryCommon/LyShine/IDraw2d.h +++ b/Code/CryEngine/CryCommon/LyShine/IDraw2d.h @@ -11,7 +11,6 @@ */ #pragma once -#include #include #include #include @@ -84,7 +83,7 @@ public: // types //! If this is not passed then the defaults below are used struct TextOptions { - IFFont* font; //!< default is "default" + 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 diff --git a/Code/CryEngine/CrySystem/DebugCallStack.cpp b/Code/CryEngine/CrySystem/DebugCallStack.cpp new file mode 100644 index 0000000000..2a219ce674 --- /dev/null +++ b/Code/CryEngine/CrySystem/DebugCallStack.cpp @@ -0,0 +1,900 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +// Original file Copyright Crytek GMBH or its affiliates, used under license. + +#include "CrySystem_precompiled.h" +#include "DebugCallStack.h" + +#if defined(WIN32) || defined(WIN64) + +#include +#include +#include "System.h" + +#include +#include + +#define VS_VERSION_INFO 1 +#define IDD_CRITICAL_ERROR 101 +#define IDB_CONFIRM_SAVE 102 +#define IDB_DONT_SAVE 103 +#define IDD_CONFIRM_SAVE_LEVEL 127 +#define IDB_CRASH_FACE 128 +#define IDD_EXCEPTION 245 +#define IDC_CALLSTACK 1001 +#define IDC_EXCEPTION_CODE 1002 +#define IDC_EXCEPTION_ADDRESS 1003 +#define IDC_EXCEPTION_MODULE 1004 +#define IDC_EXCEPTION_DESC 1005 +#define IDB_EXIT 1008 +#define IDB_IGNORE 1010 +__pragma(comment(lib, "version.lib")) + +//! Needs one external of DLL handle. +extern HMODULE gDLLHandle; + +#include + +#define MAX_PATH_LENGTH 1024 +#define MAX_SYMBOL_LENGTH 512 + +static HWND hwndException = 0; +static bool g_bUserDialog = true; // true=on crash show dialog box, false=supress user interaction + +static int PrintException(EXCEPTION_POINTERS* pex); + +static bool IsFloatingPointException(EXCEPTION_POINTERS* pex); + +extern LONG WINAPI CryEngineExceptionFilterWER(struct _EXCEPTION_POINTERS* pExceptionPointers); +extern LONG WINAPI CryEngineExceptionFilterMiniDump(struct _EXCEPTION_POINTERS* pExceptionPointers, const char* szDumpPath, MINIDUMP_TYPE mdumpValue); + +//============================================================================= +CONTEXT CaptureCurrentContext() +{ + CONTEXT context; + memset(&context, 0, sizeof(context)); + context.ContextFlags = CONTEXT_FULL; + RtlCaptureContext(&context); + + return context; +} + +LONG __stdcall CryUnhandledExceptionHandler(EXCEPTION_POINTERS* pex) +{ + return DebugCallStack::instance()->handleException(pex); +} + + +BOOL CALLBACK EnumModules( + PCSTR ModuleName, + DWORD64 BaseOfDll, + PVOID UserContext) +{ + DebugCallStack::TModules& modules = *static_cast(UserContext); + modules[(void*)BaseOfDll] = ModuleName; + + return TRUE; +} +//============================================================================= +// Class Statics +//============================================================================= + +// Return single instance of class. +IDebugCallStack* IDebugCallStack::instance() +{ + static DebugCallStack sInstance; + return &sInstance; +} + +//------------------------------------------------------------------------------------------------------------------------ +// Sets up the symbols for functions in the debug file. +//------------------------------------------------------------------------------------------------------------------------ +DebugCallStack::DebugCallStack() + : prevExceptionHandler(0) + , m_pSystem(0) + , m_nSkipNumFunctions(0) + , m_bCrash(false) + , m_szBugMessage(NULL) +{ +} + +DebugCallStack::~DebugCallStack() +{ +} + +void DebugCallStack::RemoveOldFiles() +{ + RemoveFile("error.log"); + RemoveFile("error.bmp"); + RemoveFile("error.dmp"); +} + +void DebugCallStack::RemoveFile(const char* szFileName) +{ + FILE* pFile = nullptr; + azfopen(&pFile, szFileName, "r"); + const bool bFileExists = (pFile != NULL); + + if (bFileExists) + { + fclose(pFile); + + WriteLineToLog("Removing file \"%s\"...", szFileName); + if (remove(szFileName) == 0) + { + WriteLineToLog("File successfully removed."); + } + else + { + WriteLineToLog("Couldn't remove file!"); + } + } +} + +void DebugCallStack::installErrorHandler(ISystem* pSystem) +{ + m_pSystem = pSystem; + prevExceptionHandler = (void*)SetUnhandledExceptionFilter(CryUnhandledExceptionHandler); +} + +////////////////////////////////////////////////////////////////////////// +void DebugCallStack::SetUserDialogEnable(const bool bUserDialogEnable) +{ + g_bUserDialog = bUserDialogEnable; +} + + +DWORD g_idDebugThreads[10]; +const char* g_nameDebugThreads[10]; +int g_nDebugThreads = 0; +volatile int g_lockThreadDumpList = 0; + +void MarkThisThreadForDebugging(const char* name) +{ + EBUS_EVENT(AZ::Debug::EventTraceDrillerSetupBus, SetThreadName, AZStd::this_thread::get_id(), name); + + WriteLock lock(g_lockThreadDumpList); + DWORD id = GetCurrentThreadId(); + if (g_nDebugThreads == sizeof(g_idDebugThreads) / sizeof(g_idDebugThreads[0])) + { + return; + } + for (int i = 0; i < g_nDebugThreads; i++) + { + if (g_idDebugThreads[i] == id) + { + return; + } + } + g_nameDebugThreads[g_nDebugThreads] = name; + g_idDebugThreads[g_nDebugThreads++] = id; + ((CSystem*)gEnv->pSystem)->EnableFloatExceptions(g_cvars.sys_float_exceptions); +} + +void UnmarkThisThreadFromDebugging() +{ + WriteLock lock(g_lockThreadDumpList); + DWORD id = GetCurrentThreadId(); + for (int i = g_nDebugThreads - 1; i >= 0; i--) + { + if (g_idDebugThreads[i] == id) + { + memmove(g_idDebugThreads + i, g_idDebugThreads + i + 1, (g_nDebugThreads - 1 - i) * sizeof(g_idDebugThreads[0])); + memmove(g_nameDebugThreads + i, g_nameDebugThreads + i + 1, (g_nDebugThreads - 1 - i) * sizeof(g_nameDebugThreads[0])); + --g_nDebugThreads; + } + } +} + +extern int prev_sys_float_exceptions; +void UpdateFPExceptionsMaskForThreads() +{ + int mask = -iszero(g_cvars.sys_float_exceptions); + CONTEXT ctx; + for (int i = 0; i < g_nDebugThreads; i++) + { + if (g_idDebugThreads[i] != GetCurrentThreadId()) + { + HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, g_idDebugThreads[i]); + ctx.ContextFlags = CONTEXT_ALL; + SuspendThread(hThread); + GetThreadContext(hThread, &ctx); +#ifndef WIN64 + (ctx.FloatSave.ControlWord |= 7) &= ~5 | mask; + (*(WORD*)(ctx.ExtendedRegisters + 24) |= 0x280) &= ~0x280 | mask; +#else + (ctx.FltSave.ControlWord |= 7) &= ~5 | mask; + (ctx.FltSave.MxCsr |= 0x280) &= ~0x280 | mask; +#endif + SetThreadContext(hThread, &ctx); + ResumeThread(hThread); + } + } +} + +////////////////////////////////////////////////////////////////////////// +int DebugCallStack::handleException(EXCEPTION_POINTERS* exception_pointer) +{ + if (gEnv == NULL) + { + return EXCEPTION_EXECUTE_HANDLER; + } + + ResetFPU(exception_pointer); + + prev_sys_float_exceptions = 0; + const int cached_sys_float_exceptions = g_cvars.sys_float_exceptions; + + ((CSystem*)gEnv->pSystem)->EnableFloatExceptions(0); + + if (g_cvars.sys_WER) + { + gEnv->pLog->FlushAndClose(); + return CryEngineExceptionFilterWER(exception_pointer); + } + + if (g_cvars.sys_no_crash_dialog) + { + DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX); + SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX); + } + + m_bCrash = true; + + if (g_cvars.sys_no_crash_dialog) + { + DWORD dwMode = SetErrorMode(SEM_NOGPFAULTERRORBOX); + SetErrorMode(dwMode | SEM_NOGPFAULTERRORBOX); + } + + static bool firstTime = true; + + if (g_cvars.sys_dump_aux_threads) + { + for (int i = 0; i < g_nDebugThreads; i++) + { + if (g_idDebugThreads[i] != GetCurrentThreadId()) + { + SuspendThread(OpenThread(THREAD_ALL_ACCESS, TRUE, g_idDebugThreads[i])); + } + } + } + + // uninstall our exception handler. + SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)prevExceptionHandler); + + if (!firstTime) + { + WriteLineToLog("Critical Exception! Called Multiple Times!"); + gEnv->pLog->FlushAndClose(); + // Exception called more then once. + return EXCEPTION_EXECUTE_HANDLER; + } + + // Print exception info: + { + char excCode[80]; + char excAddr[80]; + WriteLineToLog(""); + sprintf_s(excAddr, "0x%04X:0x%p", exception_pointer->ContextRecord->SegCs, exception_pointer->ExceptionRecord->ExceptionAddress); + sprintf_s(excCode, "0x%08X", exception_pointer->ExceptionRecord->ExceptionCode); + WriteLineToLog("Exception: %s, at Address: %s", excCode, excAddr); + } + + firstTime = false; + + const int ret = SubmitBug(exception_pointer); + + if (ret != IDB_IGNORE) + { + CryEngineExceptionFilterWER(exception_pointer); + } + + gEnv->pLog->FlushAndClose(); + + if (exception_pointer->ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE) + { + // This is non continuable exception. abort application now. + exit(exception_pointer->ExceptionRecord->ExceptionCode); + } + + //typedef long (__stdcall *ExceptionFunc)(EXCEPTION_POINTERS*); + //ExceptionFunc prevFunc = (ExceptionFunc)prevExceptionHandler; + //return prevFunc( (EXCEPTION_POINTERS*)exception_pointer ); + if (ret == IDB_EXIT) + { + // Immediate exit. + // on windows, exit() and _exit() do all sorts of things, unfortuantely + // TerminateProcess is the only way to die. + TerminateProcess(GetCurrentProcess(), exception_pointer->ExceptionRecord->ExceptionCode); // we crashed, so don't return a zero exit code! + // on linux based systems, _exit will not call ATEXIT and other things, which makes it more suitable for termination in an emergency such + // as an unhandled exception. + // however, this function is a windows exception handler. + } + else if (ret == IDB_IGNORE) + { +#ifndef WIN64 + exception_pointer->ContextRecord->FloatSave.StatusWord &= ~31; + exception_pointer->ContextRecord->FloatSave.ControlWord |= 7; + (*(WORD*)(exception_pointer->ContextRecord->ExtendedRegisters + 24) &= 31) |= 0x1F80; +#else + exception_pointer->ContextRecord->FltSave.StatusWord &= ~31; + exception_pointer->ContextRecord->FltSave.ControlWord |= 7; + (exception_pointer->ContextRecord->FltSave.MxCsr &= 31) |= 0x1F80; +#endif + firstTime = true; + prevExceptionHandler = (void*)SetUnhandledExceptionFilter(CryUnhandledExceptionHandler); + g_cvars.sys_float_exceptions = cached_sys_float_exceptions; + ((CSystem*)gEnv->pSystem)->EnableFloatExceptions(g_cvars.sys_float_exceptions); + return EXCEPTION_CONTINUE_EXECUTION; + } + + // Continue; + return EXCEPTION_EXECUTE_HANDLER; +} + +void DebugCallStack::ReportBug(const char* szErrorMessage) +{ + WriteLineToLog("Reporting bug: %s", szErrorMessage); + + m_szBugMessage = szErrorMessage; + m_context = CaptureCurrentContext(); + SubmitBug(NULL); + m_szBugMessage = NULL; +} + +void DebugCallStack::dumpCallStack(std::vector& funcs) +{ + WriteLineToLog("============================================================================="); + int len = (int)funcs.size(); + for (int i = 0; i < len; i++) + { + const char* str = funcs[i].c_str(); + WriteLineToLog("%2d) %s", len - i, str); + } + WriteLineToLog("============================================================================="); +} + + +////////////////////////////////////////////////////////////////////////// +void DebugCallStack::LogExceptionInfo(EXCEPTION_POINTERS* pex) +{ + string path(""); + if ((gEnv) && (gEnv->pFileIO)) + { + const char* logAlias = gEnv->pFileIO->GetAlias("@log@"); + if (!logAlias) + { + logAlias = gEnv->pFileIO->GetAlias("@root@"); + } + if (logAlias) + { + path = logAlias; + path += "/"; + } + } + + string fileName = path; + fileName += "error.log"; + + struct stat fileInfo; + string timeStamp; + string backupPath; + if (gEnv->IsDedicated()) + { + backupPath = PathUtil::ToUnixPath(PathUtil::AddSlash(path + "DumpBackups")); + gEnv->pFileIO->CreatePath(backupPath.c_str()); + + if (stat(fileName.c_str(), &fileInfo) == 0) + { + // Backup log + tm creationTime; + localtime_s(&creationTime, &fileInfo.st_mtime); + char tempBuffer[32]; + strftime(tempBuffer, sizeof(tempBuffer), "%d %b %Y (%H %M %S)", &creationTime); + timeStamp = tempBuffer; + + string backupFileName = backupPath + timeStamp + " error.log"; + CopyFile(fileName.c_str(), backupFileName.c_str(), true); + } + } + + FILE* f = nullptr; + azfopen(&f, fileName.c_str(), "wt"); + + static char errorString[s_iCallStackSize]; + errorString[0] = 0; + + // Time and Version. + char versionbuf[1024]; + azstrcpy(versionbuf, AZ_ARRAY_SIZE(versionbuf), ""); + PutVersion(versionbuf, AZ_ARRAY_SIZE(versionbuf)); + cry_strcat(errorString, versionbuf); + cry_strcat(errorString, "\n"); + + char excCode[MAX_WARNING_LENGTH]; + char excAddr[80]; + char desc[1024]; + char excDesc[MAX_WARNING_LENGTH]; + + // make sure the mouse cursor is visible + ShowCursor(TRUE); + + const char* excName; + if (m_bIsFatalError || !pex) + { + const char* const szMessage = m_bIsFatalError ? s_szFatalErrorCode : m_szBugMessage; + excName = szMessage; + cry_strcpy(excCode, szMessage); + cry_strcpy(excAddr, ""); + cry_strcpy(desc, ""); + cry_strcpy(m_excModule, ""); + cry_strcpy(excDesc, szMessage); + } + else + { + sprintf_s(excAddr, "0x%04X:0x%p", pex->ContextRecord->SegCs, pex->ExceptionRecord->ExceptionAddress); + sprintf_s(excCode, "0x%08X", pex->ExceptionRecord->ExceptionCode); + excName = TranslateExceptionCode(pex->ExceptionRecord->ExceptionCode); + cry_strcpy(desc, ""); + sprintf_s(excDesc, "%s\r\n%s", excName, desc); + + + if (pex->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) + { + if (pex->ExceptionRecord->NumberParameters > 1) + { + ULONG_PTR iswrite = pex->ExceptionRecord->ExceptionInformation[0]; + DWORD64 accessAddr = pex->ExceptionRecord->ExceptionInformation[1]; + if (iswrite) + { + sprintf_s(desc, "Attempt to write data to address 0x%08llu\r\nThe memory could not be \"written\"", accessAddr); + } + else + { + sprintf_s(desc, "Attempt to read from address 0x%08llu\r\nThe memory could not be \"read\"", accessAddr); + } + } + } + } + + + WriteLineToLog("Exception Code: %s", excCode); + WriteLineToLog("Exception Addr: %s", excAddr); + WriteLineToLog("Exception Module: %s", m_excModule); + WriteLineToLog("Exception Name : %s", excName); + WriteLineToLog("Exception Description: %s", desc); + + + cry_strcpy(m_excDesc, excDesc); + cry_strcpy(m_excAddr, excAddr); + cry_strcpy(m_excCode, excCode); + + + char errs[32768]; + sprintf_s(errs, "Exception Code: %s\nException Addr: %s\nException Module: %s\nException Description: %s, %s\n", + excCode, excAddr, m_excModule, excName, desc); + + + cry_strcat(errs, "\nCall Stack Trace:\n"); + + std::vector funcs; + { + AZ::Debug::StackFrame frames[25]; + AZ::Debug::SymbolStorage::StackLine lines[AZ_ARRAY_SIZE(frames)]; + unsigned int numFrames = AZ::Debug::StackRecorder::Record(frames, AZ_ARRAY_SIZE(frames), 3); + if (numFrames) + { + AZ::Debug::SymbolStorage::DecodeFrames(frames, numFrames, lines); + for (unsigned int i = 0; i < numFrames; i++) + { + funcs.push_back(lines[i]); + } + } + dumpCallStack(funcs); + // Fill call stack. + char str[s_iCallStackSize]; + cry_strcpy(str, ""); + for (unsigned int i = 0; i < funcs.size(); i++) + { + char temp[s_iCallStackSize]; + sprintf_s(temp, "%2zd) %s", funcs.size() - i, (const char*)funcs[i].c_str()); + cry_strcat(str, temp); + cry_strcat(str, "\r\n"); + cry_strcat(errs, temp); + cry_strcat(errs, "\n"); + } + cry_strcpy(m_excCallstack, str); + } + + cry_strcat(errorString, errs); + + if (f) + { + fwrite(errorString, strlen(errorString), 1, f); + { + if (g_cvars.sys_dump_aux_threads) + { + for (int i = 0; i < g_nDebugThreads; i++) + { + if (g_idDebugThreads[i] != GetCurrentThreadId()) + { + fprintf(f, "\n\nSuspended thread (%s):\n", g_nameDebugThreads[i]); + HANDLE hThread = OpenThread(THREAD_ALL_ACCESS, TRUE, g_idDebugThreads[i]); + + // mirrors the AZ::Debug::Trace::PrintCallstack() functionality, but prints to a file + { + AZ::Debug::StackFrame frames[10]; + + // Without StackFrame explicit alignment frames array is aligned to 4 bytes + // which causes the stack tracing to fail. + AZ::Debug::SymbolStorage::StackLine lines[AZ_ARRAY_SIZE(frames)]; + + unsigned int numFrames = AZ::Debug::StackRecorder::Record(frames, AZ_ARRAY_SIZE(frames), 0, hThread); + if (numFrames) + { + AZ::Debug::SymbolStorage::DecodeFrames(frames, numFrames, lines); + for (unsigned int i2 = 0; i2 < numFrames; ++i2) + { + fprintf(f, "%2d) %s\n", numFrames - i2, lines[i2]); + } + } + } + + ResumeThread(hThread); + } + } + } + } + fflush(f); + fclose(f); + } + + if (pex) + { + MINIDUMP_TYPE mdumpValue; + bool bDump = true; + switch (g_cvars.sys_dump_type) + { + case 0: + bDump = false; + break; + case 1: + mdumpValue = MiniDumpNormal; + break; + case 2: + mdumpValue = (MINIDUMP_TYPE)(MiniDumpWithIndirectlyReferencedMemory | MiniDumpWithDataSegs); + break; + case 3: + mdumpValue = MiniDumpWithFullMemory; + break; + default: + mdumpValue = (MINIDUMP_TYPE)g_cvars.sys_dump_type; + break; + } + if (bDump) + { + fileName = path + "error.dmp"; + + if (gEnv->IsDedicated() && stat(fileName.c_str(), &fileInfo) == 0) + { + // Backup dump (use timestamp from error.log if available) + if (timeStamp.empty()) + { + tm creationTime; + localtime_s(&creationTime, &fileInfo.st_mtime); + char tempBuffer[32]; + strftime(tempBuffer, sizeof(tempBuffer), "%d %b %Y (%H %M %S)", &creationTime); + timeStamp = tempBuffer; + } + + string backupFileName = backupPath + timeStamp + " error.dmp"; + CopyFile(fileName.c_str(), backupFileName.c_str(), true); + } + + CryEngineExceptionFilterMiniDump(pex, fileName.c_str(), mdumpValue); + } + } + + //if no crash dialog don't even submit the bug + if (m_postBackupProcess && g_cvars.sys_no_crash_dialog == 0 && g_bUserDialog) + { + m_postBackupProcess(); + } + else + { + // lawsonn: Disabling the JIRA-based crash reporter for now + // we'll need to deal with it our own way, pending QA. + // if you're customizing the engine this is also your opportunity to deal with it. + if (g_cvars.sys_no_crash_dialog != 0 || !g_bUserDialog) + { + // ------------ place custom crash handler here --------------------- + // it should launch an executable! + /// by this time, error.bmp will be in the engine root folder + // error.log and error.dmp will also be present in the engine root folder + // if your error dumper wants those, it should zip them up and send them or offer to do so. + // ------------------------------------------------------------------ + } + } + const bool bQuitting = !gEnv || !gEnv->pSystem || gEnv->pSystem->IsQuitting(); + + //[AlexMcC|16.04.10] When the engine is shutting down, MessageBox doesn't display a box + // and immediately returns IDYES. Avoid this by just not trying to save if we're quitting. + // Don't ask to save if this isn't a real crash (a real crash has exception pointers) + if (g_cvars.sys_no_crash_dialog == 0 && g_bUserDialog && gEnv->IsEditor() && !bQuitting && pex) + { + BackupCurrentLevel(); + + const INT_PTR res = DialogBoxParam(gDLLHandle, MAKEINTRESOURCE(IDD_CONFIRM_SAVE_LEVEL), NULL, DebugCallStack::ConfirmSaveDialogProc, NULL); + if (res == IDB_CONFIRM_SAVE) + { + if (SaveCurrentLevel()) + { + MessageBox(NULL, "Level has been successfully saved!\r\nPress Ok to terminate Editor.", "Save", MB_OK); + } + else + { + MessageBox(NULL, "Error saving level.\r\nPress Ok to terminate Editor.", "Save", MB_OK | MB_ICONWARNING); + } + } + } + + if (g_cvars.sys_no_crash_dialog != 0 || !g_bUserDialog) + { + // terminate immediately - since we're in a crash, there is no point unwinding stack, we've already done access violation or worse. + // calling exit will only cause further death down the line... + TerminateProcess(GetCurrentProcess(), pex->ExceptionRecord->ExceptionCode); + } +} + + +INT_PTR CALLBACK DebugCallStack::ExceptionDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + static EXCEPTION_POINTERS* pex; + + static char errorString[32768] = ""; + + switch (message) + { + case WM_INITDIALOG: + { + pex = (EXCEPTION_POINTERS*)lParam; + HWND h; + + if (pex->ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE) + { + // Disable continue button for non continuable exceptions. + //h = GetDlgItem( hwndDlg,IDB_CONTINUE ); + //if (h) EnableWindow( h,FALSE ); + } + + DebugCallStack* pDCS = static_cast(DebugCallStack::instance()); + + h = GetDlgItem(hwndDlg, IDC_EXCEPTION_DESC); + if (h) + { + SendMessage(h, EM_REPLACESEL, FALSE, (LONG_PTR)pDCS->m_excDesc); + } + + h = GetDlgItem(hwndDlg, IDC_EXCEPTION_CODE); + if (h) + { + SendMessage(h, EM_REPLACESEL, FALSE, (LONG_PTR)pDCS->m_excCode); + } + + h = GetDlgItem(hwndDlg, IDC_EXCEPTION_MODULE); + if (h) + { + SendMessage(h, EM_REPLACESEL, FALSE, (LONG_PTR)pDCS->m_excModule); + } + + h = GetDlgItem(hwndDlg, IDC_EXCEPTION_ADDRESS); + if (h) + { + SendMessage(h, EM_REPLACESEL, FALSE, (LONG_PTR)pDCS->m_excAddr); + } + + // Fill call stack. + HWND callStack = GetDlgItem(hwndDlg, IDC_CALLSTACK); + if (callStack) + { + SendMessage(callStack, WM_SETTEXT, FALSE, (LPARAM)pDCS->m_excCallstack); + } + + if (hwndException) + { + DestroyWindow(hwndException); + hwndException = 0; + } + + if (IsFloatingPointException(pex)) + { + EnableWindow(GetDlgItem(hwndDlg, IDB_IGNORE), TRUE); + } + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDB_EXIT: + case IDB_IGNORE: + // Fall through. + + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + return FALSE; +} + +INT_PTR CALLBACK DebugCallStack::ConfirmSaveDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, [[maybe_unused]] LPARAM lParam) +{ + switch (message) + { + case WM_INITDIALOG: + { + // The user might be holding down the spacebar while the engine crashes. + // If we don't remove keyboard focus from this dialog, the keypress will + // press the default button before the dialog actually appears, even if + // the user has already released the key, which is bad. + SetFocus(NULL); + } break; + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDB_CONFIRM_SAVE: // Fall through + case IDB_DONT_SAVE: + { + EndDialog(hwndDlg, wParam); + return TRUE; + } + } + } break; + } + + return FALSE; +} + +bool DebugCallStack::BackupCurrentLevel() +{ + CSystem* pSystem = static_cast(m_pSystem); + if (pSystem && pSystem->GetUserCallback()) + { + return pSystem->GetUserCallback()->OnBackupDocument(); + } + + return false; +} + +bool DebugCallStack::SaveCurrentLevel() +{ + CSystem* pSystem = static_cast(m_pSystem); + if (pSystem && pSystem->GetUserCallback()) + { + return pSystem->GetUserCallback()->OnSaveDocument(); + } + + return false; +} + +int DebugCallStack::SubmitBug(EXCEPTION_POINTERS* exception_pointer) +{ + int ret = IDB_EXIT; + + assert(!hwndException); + + RemoveOldFiles(); + + AZ::Debug::Trace::PrintCallstack("", 2); + + LogExceptionInfo(exception_pointer); + + if (IsFloatingPointException(exception_pointer)) + { + //! Print exception dialog. + ret = PrintException(exception_pointer); + } + + return ret; +} + +void DebugCallStack::ResetFPU(EXCEPTION_POINTERS* pex) +{ + if (IsFloatingPointException(pex)) + { + // How to reset FPU: http://www.experts-exchange.com/Programming/System/Windows__Programming/Q_10310953.html + _clearfp(); +#ifndef WIN64 + pex->ContextRecord->FloatSave.ControlWord |= 0x2F; + pex->ContextRecord->FloatSave.StatusWord &= ~0x8080; +#endif + } +} + +string DebugCallStack::GetModuleNameForAddr(void* addr) +{ + if (m_modules.empty()) + { + return "[unknown]"; + } + + if (addr < m_modules.begin()->first) + { + return "[unknown]"; + } + + TModules::const_iterator it = m_modules.begin(); + TModules::const_iterator end = m_modules.end(); + for (; ++it != end; ) + { + if (addr < it->first) + { + return (--it)->second; + } + } + + //if address is higher than the last module, we simply assume it is in the last module. + return m_modules.rbegin()->second; +} + +void DebugCallStack::GetProcNameForAddr(void* addr, string& procName, void*& baseAddr, string& filename, int& line) +{ + AZ::Debug::SymbolStorage::StackLine func, file, module; + AZ::Debug::SymbolStorage::FindFunctionFromIP(addr, &func, &file, &module, line, baseAddr); + procName = func; + filename = file; +} + +string DebugCallStack::GetCurrentFilename() +{ + char fullpath[MAX_PATH_LENGTH + 1]; + GetModuleFileName(NULL, fullpath, MAX_PATH_LENGTH); + return fullpath; +} + +static bool IsFloatingPointException(EXCEPTION_POINTERS* pex) +{ + if (!pex) + { + return false; + } + + DWORD exceptionCode = pex->ExceptionRecord->ExceptionCode; + switch (exceptionCode) + { + case EXCEPTION_FLT_DENORMAL_OPERAND: + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + case EXCEPTION_FLT_INEXACT_RESULT: + case EXCEPTION_FLT_INVALID_OPERATION: + case EXCEPTION_FLT_OVERFLOW: + case EXCEPTION_FLT_UNDERFLOW: + case STATUS_FLOAT_MULTIPLE_FAULTS: + case STATUS_FLOAT_MULTIPLE_TRAPS: + return true; + + default: + return false; + } +} + +int DebugCallStack::PrintException(EXCEPTION_POINTERS* exception_pointer) +{ + return (int)DialogBoxParam(gDLLHandle, MAKEINTRESOURCE(IDD_CRITICAL_ERROR), NULL, DebugCallStack::ExceptionDialogProc, (LPARAM)exception_pointer); +} + +#else +void MarkThisThreadForDebugging(const char*) {} +void UnmarkThisThreadFromDebugging() {} +void UpdateFPExceptionsMaskForThreads() {} +#endif //WIN32 diff --git a/Code/CryEngine/CrySystem/DebugCallStack.h b/Code/CryEngine/CrySystem/DebugCallStack.h new file mode 100644 index 0000000000..c37e6ba0d4 --- /dev/null +++ b/Code/CryEngine/CrySystem/DebugCallStack.h @@ -0,0 +1,95 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +// Original file Copyright Crytek GMBH or its affiliates, used under license. + +#ifndef CRYINCLUDE_CRYSYSTEM_DEBUGCALLSTACK_H +#define CRYINCLUDE_CRYSYSTEM_DEBUGCALLSTACK_H +#pragma once + + +#include "IDebugCallStack.h" + +#if defined (WIN32) || defined (WIN64) + +//! Limits the maximal number of functions in call stack. +const int MAX_DEBUG_STACK_ENTRIES_FILE_DUMP = 12; + +struct ISystem; + +//!============================================================================ +//! +//! DebugCallStack class, capture call stack information from symbol files. +//! +//!============================================================================ +class DebugCallStack + : public IDebugCallStack +{ +public: + DebugCallStack(); + virtual ~DebugCallStack(); + + ISystem* GetSystem() { return m_pSystem; }; + + virtual string GetModuleNameForAddr(void* addr); + virtual void GetProcNameForAddr(void* addr, string& procName, void*& baseAddr, string& filename, int& line); + virtual string GetCurrentFilename(); + + void installErrorHandler(ISystem* pSystem); + virtual int handleException(EXCEPTION_POINTERS* exception_pointer); + + virtual void ReportBug(const char*); + + void dumpCallStack(std::vector& functions); + + void SetUserDialogEnable(const bool bUserDialogEnable); + + typedef std::map TModules; +protected: + static void RemoveOldFiles(); + static void RemoveFile(const char* szFileName); + + static int PrintException(EXCEPTION_POINTERS* exception_pointer); + static INT_PTR CALLBACK ExceptionDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); + static INT_PTR CALLBACK ConfirmSaveDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam); + + void LogExceptionInfo(EXCEPTION_POINTERS* exception_pointer); + bool BackupCurrentLevel(); + bool SaveCurrentLevel(); + int SubmitBug(EXCEPTION_POINTERS* exception_pointer); + void ResetFPU(EXCEPTION_POINTERS* pex); + + static const int s_iCallStackSize = 32768; + + char m_excLine[256]; + char m_excModule[128]; + + char m_excDesc[MAX_WARNING_LENGTH]; + char m_excCode[MAX_WARNING_LENGTH]; + char m_excAddr[80]; + char m_excCallstack[s_iCallStackSize]; + + void* prevExceptionHandler; + + bool m_bCrash; + const char* m_szBugMessage; + + ISystem* m_pSystem; + + int m_nSkipNumFunctions; + CONTEXT m_context; + + TModules m_modules; +}; + +#endif //WIN32 + +#endif // CRYINCLUDE_CRYSYSTEM_DEBUGCALLSTACK_H diff --git a/Code/CryEngine/CrySystem/DllMain.cpp b/Code/CryEngine/CrySystem/DllMain.cpp index 7fd620835b..53593821d9 100644 --- a/Code/CryEngine/CrySystem/DllMain.cpp +++ b/Code/CryEngine/CrySystem/DllMain.cpp @@ -14,6 +14,7 @@ #include "CrySystem_precompiled.h" #include "System.h" #include +#include "DebugCallStack.h" #if defined(AZ_RESTRICTED_PLATFORM) #undef AZ_RESTRICTED_SECTION @@ -87,6 +88,16 @@ CRYSYSTEM_API ISystem* CreateSystemInterface(const SSystemInitParams& startupPar startupParams.pUserCallback->OnSystemConnect(pSystem); } +#if defined(WIN32) + // Environment Variable to signal we don't want to override our exception handler - our crash report system will set this + auto envVar = AZ::Environment::FindVariable("ExceptionHandlerIsSet"); + const bool handlerIsSet = (envVar && *envVar); + if (!handlerIsSet) + { + ((DebugCallStack*)IDebugCallStack::instance())->installErrorHandler(pSystem); + } +#endif + bool retVal = false; { AZ::Debug::StartupLogSinkReporter initLogSink; diff --git a/Code/CryEngine/CrySystem/IDebugCallStack.cpp b/Code/CryEngine/CrySystem/IDebugCallStack.cpp new file mode 100644 index 0000000000..c14dd2b0da --- /dev/null +++ b/Code/CryEngine/CrySystem/IDebugCallStack.cpp @@ -0,0 +1,275 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +// Original file Copyright Crytek GMBH or its affiliates, used under license. + +// Description : A multiplatform base class for handling errors and collecting call stacks + + +#include "CrySystem_precompiled.h" +#include "IDebugCallStack.h" +#include "System.h" +#include +#include +#include +#include +//#if !defined(LINUX) + +#include + +const char* const IDebugCallStack::s_szFatalErrorCode = "FATAL_ERROR"; + +IDebugCallStack::IDebugCallStack() + : m_bIsFatalError(false) + , m_postBackupProcess(0) + , m_memAllocFileHandle(AZ::IO::InvalidHandle) +{ +} + +IDebugCallStack::~IDebugCallStack() +{ + StopMemLog(); +} + +#if AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_SINGLETON +IDebugCallStack* IDebugCallStack::instance() +{ + static IDebugCallStack sInstance; + return &sInstance; +} +#endif + +void IDebugCallStack::FileCreationCallback(void (* postBackupProcess)()) +{ + m_postBackupProcess = postBackupProcess; +} +////////////////////////////////////////////////////////////////////////// +void IDebugCallStack::LogCallstack() +{ + AZ::Debug::Trace::PrintCallstack("", 2); +} + +const char* IDebugCallStack::TranslateExceptionCode(DWORD dwExcept) +{ + switch (dwExcept) + { +#if AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_TRANSLATE + case EXCEPTION_ACCESS_VIOLATION: + return "EXCEPTION_ACCESS_VIOLATION"; + break; + case EXCEPTION_DATATYPE_MISALIGNMENT: + return "EXCEPTION_DATATYPE_MISALIGNMENT"; + break; + case EXCEPTION_BREAKPOINT: + return "EXCEPTION_BREAKPOINT"; + break; + case EXCEPTION_SINGLE_STEP: + return "EXCEPTION_SINGLE_STEP"; + break; + case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: + return "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"; + break; + case EXCEPTION_FLT_DENORMAL_OPERAND: + return "EXCEPTION_FLT_DENORMAL_OPERAND"; + break; + case EXCEPTION_FLT_DIVIDE_BY_ZERO: + return "EXCEPTION_FLT_DIVIDE_BY_ZERO"; + break; + case EXCEPTION_FLT_INEXACT_RESULT: + return "EXCEPTION_FLT_INEXACT_RESULT"; + break; + case EXCEPTION_FLT_INVALID_OPERATION: + return "EXCEPTION_FLT_INVALID_OPERATION"; + break; + case EXCEPTION_FLT_OVERFLOW: + return "EXCEPTION_FLT_OVERFLOW"; + break; + case EXCEPTION_FLT_STACK_CHECK: + return "EXCEPTION_FLT_STACK_CHECK"; + break; + case EXCEPTION_FLT_UNDERFLOW: + return "EXCEPTION_FLT_UNDERFLOW"; + break; + case EXCEPTION_INT_DIVIDE_BY_ZERO: + return "EXCEPTION_INT_DIVIDE_BY_ZERO"; + break; + case EXCEPTION_INT_OVERFLOW: + return "EXCEPTION_INT_OVERFLOW"; + break; + case EXCEPTION_PRIV_INSTRUCTION: + return "EXCEPTION_PRIV_INSTRUCTION"; + break; + case EXCEPTION_IN_PAGE_ERROR: + return "EXCEPTION_IN_PAGE_ERROR"; + break; + case EXCEPTION_ILLEGAL_INSTRUCTION: + return "EXCEPTION_ILLEGAL_INSTRUCTION"; + break; + case EXCEPTION_NONCONTINUABLE_EXCEPTION: + return "EXCEPTION_NONCONTINUABLE_EXCEPTION"; + break; + case EXCEPTION_STACK_OVERFLOW: + return "EXCEPTION_STACK_OVERFLOW"; + break; + case EXCEPTION_INVALID_DISPOSITION: + return "EXCEPTION_INVALID_DISPOSITION"; + break; + case EXCEPTION_GUARD_PAGE: + return "EXCEPTION_GUARD_PAGE"; + break; + case EXCEPTION_INVALID_HANDLE: + return "EXCEPTION_INVALID_HANDLE"; + break; + //case EXCEPTION_POSSIBLE_DEADLOCK: return "EXCEPTION_POSSIBLE_DEADLOCK"; break ; + + case STATUS_FLOAT_MULTIPLE_FAULTS: + return "STATUS_FLOAT_MULTIPLE_FAULTS"; + break; + case STATUS_FLOAT_MULTIPLE_TRAPS: + return "STATUS_FLOAT_MULTIPLE_TRAPS"; + break; + + +#endif + default: + return "Unknown"; + break; + } +} + +void IDebugCallStack::PutVersion(char* str, size_t length) +{ +AZ_PUSH_DISABLE_WARNING(4996, "-Wunknown-warning-option") + + if (!gEnv || !gEnv->pSystem) + { + return; + } + + char sFileVersion[128]; + gEnv->pSystem->GetFileVersion().ToString(sFileVersion, sizeof(sFileVersion)); + + char sProductVersion[128]; + gEnv->pSystem->GetProductVersion().ToString(sProductVersion, sizeof(sFileVersion)); + + + //! Get time. + time_t ltime; + time(<ime); + tm* today = localtime(<ime); + + char s[1024]; + //! Use strftime to build a customized time string. + strftime(s, 128, "Logged at %#c\n", today); + azstrcat(str, length, s); + sprintf_s(s, "FileVersion: %s\n", sFileVersion); + azstrcat(str, length, s); + sprintf_s(s, "ProductVersion: %s\n", sProductVersion); + azstrcat(str, length, s); + + if (gEnv->pLog) + { + const char* logfile = gEnv->pLog->GetFileName(); + if (logfile) + { + sprintf (s, "LogFile: %s\n", logfile); + azstrcat(str, length, s); + } + } + + AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath(); + azstrcat(str, length, "ProjectDir: "); + azstrcat(str, length, projectPath.c_str()); + azstrcat(str, length, "\n"); + +#if AZ_LEGACY_CRYSYSTEM_TRAIT_DEBUGCALLSTACK_APPEND_MODULENAME + GetModuleFileNameA(NULL, s, sizeof(s)); + + // Log EXE filename only if possible (not full EXE path which could contain sensitive info) + AZStd::string exeName; + if (AZ::StringFunc::Path::GetFullFileName(s, exeName)) + { + azstrcat(str, length, "Executable: "); + azstrcat(str, length, exeName.c_str()); + +# ifdef AZ_DEBUG_BUILD + azstrcat(str, length, " (debug: yes"); +# else + azstrcat(str, length, " (debug: no"); +# endif + } +#endif +AZ_POP_DISABLE_WARNING +} + + +//Crash the application, in this way the debug callstack routine will be called and it will create all the necessary files (error.log, dump, and eventually screenshot) +void IDebugCallStack::FatalError(const char* description) +{ + m_bIsFatalError = true; + WriteLineToLog(description); + +#ifndef _RELEASE + bool bShowDebugScreen = g_cvars.sys_no_crash_dialog == 0; + // showing the debug screen is not safe when not called from mainthread + // it normally leads to a infinity recursion followed by a stack overflow, preventing + // useful call stacks, thus they are disabled + bShowDebugScreen = bShowDebugScreen && gEnv->mMainThreadId == CryGetCurrentThreadId(); + if (bShowDebugScreen) + { + EBUS_EVENT(AZ::NativeUI::NativeUIRequestBus, DisplayOkDialog, "Open 3D Engine Fatal Error", description, false); + } +#endif + +#if defined(WIN32) || !defined(_RELEASE) + int* p = 0x0; + PREFAST_SUPPRESS_WARNING(6011) * p = 1; // we're intentionally crashing here +#endif +} + +void IDebugCallStack::WriteLineToLog(const char* format, ...) +{ + va_list ArgList; + char szBuffer[MAX_WARNING_LENGTH]; + va_start(ArgList, format); + vsnprintf_s(szBuffer, sizeof(szBuffer), sizeof(szBuffer) - 1, format, ArgList); + cry_strcat(szBuffer, "\n"); + szBuffer[sizeof(szBuffer) - 1] = '\0'; + va_end(ArgList); + + AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle; + AZ::IO::FileIOBase::GetDirectInstance()->Open("@Log@\\error.log", AZ::IO::GetOpenModeFromStringMode("a+t"), fileHandle); + if (fileHandle != AZ::IO::InvalidHandle) + { + AZ::IO::FileIOBase::GetDirectInstance()->Write(fileHandle, szBuffer, strlen(szBuffer)); + AZ::IO::FileIOBase::GetDirectInstance()->Flush(fileHandle); + AZ::IO::FileIOBase::GetDirectInstance()->Close(fileHandle); + } +} + +////////////////////////////////////////////////////////////////////////// +void IDebugCallStack::StartMemLog() +{ + AZ::IO::FileIOBase::GetDirectInstance()->Open("@Log@\\memallocfile.log", AZ::IO::OpenMode::ModeWrite, m_memAllocFileHandle); + + assert(m_memAllocFileHandle != AZ::IO::InvalidHandle); +} + +////////////////////////////////////////////////////////////////////////// +void IDebugCallStack::StopMemLog() +{ + if (m_memAllocFileHandle != AZ::IO::InvalidHandle) + { + AZ::IO::FileIOBase::GetDirectInstance()->Close(m_memAllocFileHandle); + m_memAllocFileHandle = AZ::IO::InvalidHandle; + } +} +//#endif //!defined(LINUX) diff --git a/Code/CryEngine/CrySystem/IDebugCallStack.h b/Code/CryEngine/CrySystem/IDebugCallStack.h new file mode 100644 index 0000000000..f181b73913 --- /dev/null +++ b/Code/CryEngine/CrySystem/IDebugCallStack.h @@ -0,0 +1,90 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +// Original file Copyright Crytek GMBH or its affiliates, used under license. + +// Description : A multiplatform base class for handling errors and collecting call stacks + +#ifndef CRYINCLUDE_CRYSYSTEM_IDEBUGCALLSTACK_H +#define CRYINCLUDE_CRYSYSTEM_IDEBUGCALLSTACK_H +#pragma once + +#include "System.h" + +#if AZ_LEGACY_CRYSYSTEM_TRAIT_FORWARD_EXCEPTION_POINTERS +struct EXCEPTION_POINTERS; +#endif +//! Limits the maximal number of functions in call stack. +enum +{ + MAX_DEBUG_STACK_ENTRIES = 80 +}; + +class IDebugCallStack +{ +public: + // Returns single instance of DebugStack + static IDebugCallStack* instance(); + + virtual int handleException([[maybe_unused]] EXCEPTION_POINTERS* exception_pointer){return 0; } + + // returns the module name of a given address + virtual string GetModuleNameForAddr([[maybe_unused]] void* addr) { return "[unknown]"; } + + // returns the function name of a given address together with source file and line number (if available) of a given address + virtual void GetProcNameForAddr(void* addr, string& procName, void*& baseAddr, string& filename, int& line) + { + filename = "[unknown]"; + line = 0; + baseAddr = addr; +#if defined(PLATFORM_64BIT) + procName.Format("[%016llX]", addr); +#else + procName.Format("[%08X]", addr); +#endif + } + + // returns current filename + virtual string GetCurrentFilename() { return "[unknown]"; } + + //! Dumps Current Call Stack to log. + virtual void LogCallstack(); + //triggers a fatal error, so the DebugCallstack can create the error.log and terminate the application + void FatalError(const char*); + + //Reports a bug and continues execution + virtual void ReportBug(const char*) {} + + virtual void FileCreationCallback(void (* postBackupProcess)()); + + static void WriteLineToLog(const char* format, ...); + + virtual void StartMemLog(); + virtual void StopMemLog(); + +protected: + IDebugCallStack(); + virtual ~IDebugCallStack(); + + static const char* TranslateExceptionCode(DWORD dwExcept); + static void PutVersion(char* str, size_t length); + + bool m_bIsFatalError; + static const char* const s_szFatalErrorCode; + + void (* m_postBackupProcess)(); + + AZ::IO::HandleType m_memAllocFileHandle; +}; + + + +#endif // CRYINCLUDE_CRYSYSTEM_IDEBUGCALLSTACK_H diff --git a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp index ff6ebc0d17..31d1540d77 100644 --- a/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp +++ b/Code/CryEngine/CrySystem/LevelSystem/SpawnableLevelSystem.cpp @@ -36,8 +36,8 @@ namespace LegacyLevelSystem //------------------------------------------------------------------------ static void LoadLevel(const AZ::ConsoleCommandContainer& arguments) { - AZ_Error("SpawnableLevelSystem", arguments.empty(), "LoadLevel requires a level file name to be provided."); - AZ_Error("SpawnableLevelSystem", arguments.size() > 1, "LoadLevel requires a single level file name to be provided."); + AZ_Error("SpawnableLevelSystem", !arguments.empty(), "LoadLevel requires a level file name to be provided."); + AZ_Error("SpawnableLevelSystem", arguments.size() == 1, "LoadLevel requires a single level file name to be provided."); if (!arguments.empty() && gEnv->pSystem && gEnv->pSystem->GetILevelSystem() && !gEnv->IsEditor()) { diff --git a/Code/CryEngine/CrySystem/System.h b/Code/CryEngine/CrySystem/System.h index 631d84d934..a258030f70 100644 --- a/Code/CryEngine/CrySystem/System.h +++ b/Code/CryEngine/CrySystem/System.h @@ -208,6 +208,7 @@ struct SSystemCVars int sys_no_crash_dialog; int sys_no_error_report_window; int sys_dump_aux_threads; + int sys_WER; int sys_dump_type; int sys_ai; int sys_entitysystem; @@ -728,7 +729,7 @@ protected: // ------------------------------------------------------------- CCmdLine* m_pCmdLine; string m_currentLanguageAudio; - string m_systemConfigName; // computed from system_(hardwareplatform)_(assetsPlatform) - eg, system_android_es3.cfg or system_android_opengl.cfg or system_windows_pc.cfg + string m_systemConfigName; // computed from system_(hardwareplatform)_(assetsPlatform) - eg, system_android_android.cfg or system_windows_pc.cfg std::vector< std::pair > m_updateTimes; diff --git a/Code/CryEngine/CrySystem/SystemInit.cpp b/Code/CryEngine/CrySystem/SystemInit.cpp index a2c21ea04c..79041fa233 100644 --- a/Code/CryEngine/CrySystem/SystemInit.cpp +++ b/Code/CryEngine/CrySystem/SystemInit.cpp @@ -121,6 +121,10 @@ # include #endif +#ifdef WIN32 +extern LONG WINAPI CryEngineExceptionFilterWER(struct _EXCEPTION_POINTERS* pExceptionPointers); +#endif + #if defined(AZ_RESTRICTED_PLATFORM) #define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_14 #include AZ_RESTRICTED_FILE(SystemInit_cpp) @@ -860,11 +864,6 @@ bool CSystem::InitShine([[maybe_unused]] const SSystemInitParams& initParams) EBUS_EVENT(UiSystemBus, InitializeSystem); - if (!m_env.pLyShine) - { - AZ_Error(AZ_TRACE_SYSTEM_WINDOW, false, "LYShine System did not initialize correctly. Please check that the LyShine gem is enabled for this project in *_dependencies.cmake."); - return false; - } return true; } @@ -1484,6 +1483,13 @@ AZ_POP_DISABLE_WARNING InlineInitializationProcessing("CSystem::Init LoadConfigurations"); +#ifdef WIN32 + if (g_cvars.sys_WER) + { + SetUnhandledExceptionFilter(CryEngineExceptionFilterWER); + } +#endif + ////////////////////////////////////////////////////////////////////////// // Localization ////////////////////////////////////////////////////////////////////////// @@ -2020,6 +2026,14 @@ void CSystem::CreateSystemVars() REGISTER_CVAR2("sys_update_profile_time", &g_cvars.sys_update_profile_time, 1.0f, 0, "Time to keep updates timings history for."); REGISTER_CVAR2("sys_no_crash_dialog", &g_cvars.sys_no_crash_dialog, m_bNoCrashDialog, VF_NULL, "Whether to disable the crash dialog window"); REGISTER_CVAR2("sys_no_error_report_window", &g_cvars.sys_no_error_report_window, m_bNoErrorReportWindow, VF_NULL, "Whether to disable the error report list"); +#if defined(_RELEASE) + if (!gEnv->IsDedicated()) + { + REGISTER_CVAR2("sys_WER", &g_cvars.sys_WER, 1, 0, "Enables Windows Error Reporting"); + } +#else + REGISTER_CVAR2("sys_WER", &g_cvars.sys_WER, 0, 0, "Enables Windows Error Reporting"); +#endif #ifdef USE_HTTP_WEBSOCKETS REGISTER_CVAR2("sys_simple_http_base_port", &g_cvars.sys_simple_http_base_port, 1880, VF_REQUIRE_APP_RESTART, diff --git a/Code/CryEngine/CrySystem/SystemWin32.cpp b/Code/CryEngine/CrySystem/SystemWin32.cpp index c974365bfc..eb6aa17532 100644 --- a/Code/CryEngine/CrySystem/SystemWin32.cpp +++ b/Code/CryEngine/CrySystem/SystemWin32.cpp @@ -46,6 +46,8 @@ #include #endif +#include "IDebugCallStack.h" + #if defined(APPLE) || defined(LINUX) #include #endif @@ -355,6 +357,7 @@ void CSystem::FatalError(const char* format, ...) } // Dump callstack. + IDebugCallStack::instance()->FatalError(szBuffer); #endif CryDebugBreak(); @@ -396,6 +399,8 @@ void CSystem::ReportBug([[maybe_unused]] const char* format, ...) va_start(ArgList, format); azvsnprintf(szBuffer + strlen(sPrefix), MAX_WARNING_LENGTH - strlen(sPrefix), format, ArgList); va_end(ArgList); + + IDebugCallStack::instance()->ReportBug(szBuffer); #endif } diff --git a/Code/CryEngine/CrySystem/WindowsErrorReporting.cpp b/Code/CryEngine/CrySystem/WindowsErrorReporting.cpp new file mode 100644 index 0000000000..feaffd42aa --- /dev/null +++ b/Code/CryEngine/CrySystem/WindowsErrorReporting.cpp @@ -0,0 +1,137 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +// Original file Copyright Crytek GMBH or its affiliates, used under license. + +// Description : Support for Windows Error Reporting (WER) + + +#include "CrySystem_precompiled.h" + +#ifdef WIN32 + +#include "System.h" +#include +#include +#include "errorrep.h" +#include "ISystem.h" + +#include + +static WCHAR szPath[MAX_PATH + 1]; +static WCHAR szFR[] = L"\\System32\\FaultRep.dll"; + +WCHAR* GetFullPathToFaultrepDll(void) +{ + UINT rc = GetSystemWindowsDirectoryW(szPath, ARRAYSIZE(szPath)); + if (rc == 0 || rc > ARRAYSIZE(szPath) - ARRAYSIZE(szFR) - 1) + { + return NULL; + } + + wcscat_s(szPath, szFR); + return szPath; +} + + +typedef BOOL (WINAPI * MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, + CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, + CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, + CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam + ); + +////////////////////////////////////////////////////////////////////////// +LONG WINAPI CryEngineExceptionFilterMiniDump(struct _EXCEPTION_POINTERS* pExceptionPointers, const char* szDumpPath, MINIDUMP_TYPE DumpType) +{ + // note: In debug mode, this dll is loaded on startup anyway, so this should not incur an additional load unless it crashes + // very early during startup. + + fflush(nullptr); // according to MSDN on fflush, calling fflush on null flushes all buffers. + HMODULE hndDBGHelpDLL = LoadLibraryA("DBGHELP.DLL"); + + if (!hndDBGHelpDLL) + { + CryLogAlways("Failed to record DMP file: Could not open DBGHELP.DLL"); + return EXCEPTION_CONTINUE_SEARCH; + } + + MINIDUMPWRITEDUMP dumpFnPtr = (MINIDUMPWRITEDUMP)::GetProcAddress(hndDBGHelpDLL, "MiniDumpWriteDump"); + if (!dumpFnPtr) + { + CryLogAlways("Failed to record DMP file: Unable to find MiniDumpWriteDump in DBGHELP.DLL"); + return EXCEPTION_CONTINUE_SEARCH; + } + + HANDLE hFile = ::CreateFile(szDumpPath, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + CryLogAlways("Failed to record DMP file: could not open file '%s' for writing - error code: %d", szDumpPath, GetLastError()); + return EXCEPTION_CONTINUE_SEARCH; + } + + _MINIDUMP_EXCEPTION_INFORMATION ExInfo; + ExInfo.ThreadId = ::GetCurrentThreadId(); + ExInfo.ExceptionPointers = pExceptionPointers; + ExInfo.ClientPointers = NULL; + + BOOL bOK = dumpFnPtr(GetCurrentProcess(), GetCurrentProcessId(), hFile, DumpType, &ExInfo, NULL, NULL); + ::CloseHandle(hFile); + + if (bOK) + { + CryLogAlways("Successfully recorded DMP file: '%s'", szDumpPath); + return EXCEPTION_EXECUTE_HANDLER; // SUCCESS! you can execute your handlers now + } + else + { + CryLogAlways("Failed to record DMP file: '%s' - error code: %d", szDumpPath, GetLastError()); + } + + return EXCEPTION_CONTINUE_SEARCH; +} + +////////////////////////////////////////////////////////////////////////// +LONG WINAPI CryEngineExceptionFilterWER(struct _EXCEPTION_POINTERS* pExceptionPointers) +{ + if (g_cvars.sys_WER > 1) + { + char szScratch [_MAX_PATH]; + const char* szDumpPath = gEnv->pCryPak->AdjustFileName("@log@/CE2Dump.dmp", szScratch, AZ_ARRAY_SIZE(szScratch), 0); + + MINIDUMP_TYPE mdumpValue = (MINIDUMP_TYPE)(MiniDumpNormal); + if (g_cvars.sys_WER > 1) + { + mdumpValue = (MINIDUMP_TYPE)(g_cvars.sys_WER - 2); + } + + return CryEngineExceptionFilterMiniDump(pExceptionPointers, szDumpPath, mdumpValue); + } + + LONG lRet = EXCEPTION_CONTINUE_SEARCH; + WCHAR* psz = GetFullPathToFaultrepDll(); + if (psz) + { + HMODULE hFaultRepDll = LoadLibraryW(psz); + if (hFaultRepDll) + { + pfn_REPORTFAULT pfn = (pfn_REPORTFAULT)GetProcAddress(hFaultRepDll, "ReportFault"); + if (pfn) + { + pfn(pExceptionPointers, 0); + lRet = EXCEPTION_EXECUTE_HANDLER; + } + FreeLibrary(hFaultRepDll); + } + } + return lRet; +} + +#endif // WIN32 diff --git a/Code/CryEngine/CrySystem/crysystem_files.cmake b/Code/CryEngine/CrySystem/crysystem_files.cmake index 6a56339b85..84250de95b 100644 --- a/Code/CryEngine/CrySystem/crysystem_files.cmake +++ b/Code/CryEngine/CrySystem/crysystem_files.cmake @@ -15,6 +15,8 @@ set(FILES CmdLineArg.cpp ConsoleBatchFile.cpp ConsoleHelpGen.cpp + DebugCallStack.cpp + IDebugCallStack.cpp Log.cpp System.cpp SystemCFG.cpp @@ -31,6 +33,8 @@ set(FILES CmdLineArg.h ConsoleBatchFile.h ConsoleHelpGen.h + DebugCallStack.h + IDebugCallStack.h Log.h SimpleStringPool.h CrySystem_precompiled.h @@ -72,4 +76,5 @@ set(FILES ViewSystem/ViewSystem.cpp ViewSystem/ViewSystem.h CrySystem_precompiled.cpp + WindowsErrorReporting.cpp ) diff --git a/Code/Framework/AtomCore/AtomCore/std/parallel/concurrency_checker.h b/Code/Framework/AtomCore/AtomCore/std/parallel/concurrency_checker.h index 311b574fdf..4a952721b6 100644 --- a/Code/Framework/AtomCore/AtomCore/std/parallel/concurrency_checker.h +++ b/Code/Framework/AtomCore/AtomCore/std/parallel/concurrency_checker.h @@ -20,10 +20,12 @@ namespace AZStd { - //! Simple class for verifying that no concurrent access is occuring. + //! Simple class for verifying that no concurrent access is occurring. //! This is *not* a synchronization primitive, and is intended simply for checking that no concurrency issues exist. //! It will be compiled out in release builds. //! Use concurrency_checker like a mutex (i.e. call soft_lock() and soft_unlock() around all instances of your data access). + //! Use soft_lock_shared and soft_unlock_shared around places where multiple threads are allowed to have read access + //! at the same time as long as nothing else already has a soft lock //! It will assert if there are multiple threads accessing the locked code/data at the same time. //! Expected use case is for defensive programming: when you do not expect any concurrent access within a system, //! but want to verify that it stays that way in the future, without incurring the overhead of a mutex. @@ -34,7 +36,7 @@ namespace AZStd { #ifdef AZ_CONCURRENCY_CHECKER_ENABLED uint32_t count = ++m_concurrencyCounter; - AZ_Assert(count == 1, "Concurrency check failed. Multiple threads are trying to access data at the same time, or there is a lock/unlock mismatch."); + AZ_Assert(count == 1 && m_sharedConcurrencyCounter == 0, "Concurrency check failed. Multiple threads are trying to access data at the same time, or there is a lock/unlock mismatch."); #endif } @@ -46,9 +48,27 @@ namespace AZStd #endif } + AZ_FORCE_INLINE void soft_lock_shared() + { +#ifdef AZ_CONCURRENCY_CHECKER_ENABLED + AZ_Assert(m_concurrencyCounter == 0, "Concurrency check failed. A soft_lock_shared was attempted when there was already a soft_lock."); + ++m_sharedConcurrencyCounter; +#endif + } + + AZ_FORCE_INLINE void soft_unlock_shared() + { +#ifdef AZ_CONCURRENCY_CHECKER_ENABLED + AZ_Assert(m_sharedConcurrencyCounter != 0, "Concurrency check failed. There is a shared_lock/shared_unlock mismatch."); + --m_sharedConcurrencyCounter; +#endif + } + + private: #ifdef AZ_CONCURRENCY_CHECKER_ENABLED AZStd::atomic_uint32_t m_concurrencyCounter = 0; + AZStd::atomic_uint32_t m_sharedConcurrencyCounter = 0; #endif }; diff --git a/Code/Framework/AtomCore/Tests/ArrayView.cpp b/Code/Framework/AtomCore/Tests/ArrayView.cpp index 83fa20aaf0..56627d280e 100644 --- a/Code/Framework/AtomCore/Tests/ArrayView.cpp +++ b/Code/Framework/AtomCore/Tests/ArrayView.cpp @@ -293,15 +293,12 @@ namespace UnitTest { array_view view({ 1,2,3,4 }); - UnitTest::TestRunner::Instance().StartAssertTests(); + AZ_TEST_START_TRACE_SUPPRESSION; - EXPECT_EQ(0, UnitTest::TestRunner::Instance().m_numAssertsFailed); view[4]; - EXPECT_EQ(1, UnitTest::TestRunner::Instance().m_numAssertsFailed); view[5]; - EXPECT_EQ(2, UnitTest::TestRunner::Instance().m_numAssertsFailed); - UnitTest::TestRunner::Instance().StopAssertTests(); + AZ_TEST_STOP_TRACE_SUPPRESSION(2); } } diff --git a/Code/Framework/AtomCore/Tests/ConcurrencyCheckerTests.cpp b/Code/Framework/AtomCore/Tests/ConcurrencyCheckerTests.cpp new file mode 100644 index 0000000000..7cd1fa27ac --- /dev/null +++ b/Code/Framework/AtomCore/Tests/ConcurrencyCheckerTests.cpp @@ -0,0 +1,100 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include + +using namespace AZStd; + +namespace UnitTest +{ + class ConcurrencyCheckerTestFixture + : public AllocatorsTestFixture + { + + void SetUp() override + { + AllocatorsFixture::SetUp(); + } + }; + + TEST_F(AllocatorsTestFixture, SoftLock_NoContention_NoAsserts) + { + concurrency_checker concurrencyChecker; + concurrencyChecker.soft_lock(); + concurrencyChecker.soft_unlock(); + concurrencyChecker.soft_lock(); + concurrencyChecker.soft_unlock(); + } + + TEST_F(AllocatorsTestFixture, SoftLock_AlreadyLocked_Assert) + { + concurrency_checker concurrencyChecker; + concurrencyChecker.soft_lock(); + AZ_TEST_START_TRACE_SUPPRESSION; + concurrencyChecker.soft_lock(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + + TEST_F(AllocatorsTestFixture, SoftUnlock_NotAlreadyLocked_Assert) + { + concurrency_checker concurrencyChecker; + concurrencyChecker.soft_lock(); + concurrencyChecker.soft_unlock(); + AZ_TEST_START_TRACE_SUPPRESSION; + concurrencyChecker.soft_unlock(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + + TEST_F(AllocatorsTestFixture, SoftLockShared_NoContention_NoAsserts) + { + concurrency_checker concurrencyChecker; + // Multiple shared locks can be made at once, + // as long as they are all unlocked before the next soft_lock + concurrencyChecker.soft_lock_shared(); + concurrencyChecker.soft_lock_shared(); + concurrencyChecker.soft_unlock_shared(); + concurrencyChecker.soft_unlock_shared(); + + concurrencyChecker.soft_lock(); + concurrencyChecker.soft_unlock(); + + concurrencyChecker.soft_lock_shared(); + concurrencyChecker.soft_lock_shared(); + concurrencyChecker.soft_unlock_shared(); + concurrencyChecker.soft_unlock_shared(); + + concurrencyChecker.soft_lock(); + concurrencyChecker.soft_unlock(); + } + + TEST_F(AllocatorsTestFixture, SoftLockShared_SharedLockAfterSoftLock_Assert) + { + concurrency_checker concurrencyChecker; + + concurrencyChecker.soft_lock(); + AZ_TEST_START_TRACE_SUPPRESSION; + concurrencyChecker.soft_lock_shared(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } + + TEST_F(AllocatorsTestFixture, SoftUnlockShared_NotAlreadyLocked_Assert) + { + concurrency_checker concurrencyChecker; + concurrencyChecker.soft_lock_shared(); + concurrencyChecker.soft_unlock_shared(); + AZ_TEST_START_TRACE_SUPPRESSION; + concurrencyChecker.soft_unlock_shared(); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + } +} diff --git a/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake b/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake index 26efd09fe1..24d23cb852 100644 --- a/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake +++ b/Code/Framework/AtomCore/Tests/atomcore_tests_files.cmake @@ -11,6 +11,7 @@ set(FILES ArrayView.cpp + ConcurrencyCheckerTests.cpp InstanceDatabase.cpp JsonSerializationUtilsTests.cpp lru_cache.cpp diff --git a/Code/Framework/AzAndroid/java/com/amazon/lumberyard/LumberyardActivity.java b/Code/Framework/AzAndroid/java/com/amazon/lumberyard/LumberyardActivity.java index b5d3de8164..5c1a120df6 100644 --- a/Code/Framework/AzAndroid/java/com/amazon/lumberyard/LumberyardActivity.java +++ b/Code/Framework/AzAndroid/java/com/amazon/lumberyard/LumberyardActivity.java @@ -244,7 +244,7 @@ public class LumberyardActivity extends NativeActivity boolean useMainObb = GetBooleanResource("use_main_obb"); boolean usePatchObb = GetBooleanResource("use_patch_obb"); - if (IsBootstrapInAPK() && (useMainObb || usePatchObb)) + if (AreAssetsInAPK() && (useMainObb || usePatchObb)) { Log.d(TAG, "Using OBB expansion files for game assets"); @@ -421,12 +421,12 @@ public class LumberyardActivity extends NativeActivity } //////////////////////////////////////////////////////////////// - private boolean IsBootstrapInAPK() + private boolean AreAssetsInAPK() { try { - InputStream bootstrap = getAssets().open("bootstrap.cfg", AssetManager.ACCESS_UNKNOWN); - bootstrap.close(); + InputStream engine = getAssets().open("engine.json", AssetManager.ACCESS_UNKNOWN); + engine.close(); return true; } catch (IOException exception) diff --git a/Code/Framework/AzCore/AzCore/Android/Utils.cpp b/Code/Framework/AzCore/AzCore/Android/Utils.cpp index efbbf50d1d..d6435c67be 100644 --- a/Code/Framework/AzCore/AzCore/Android/Utils.cpp +++ b/Code/Framework/AzCore/AzCore/Android/Utils.cpp @@ -148,7 +148,7 @@ namespace AZ } } - AZ_Assert(false, "Failed to locate the bootstrap.cfg path"); + AZ_Assert(false, "Failed to locate the engine.json path"); return nullptr; } diff --git a/Code/Framework/AzCore/AzCore/Android/Utils.h b/Code/Framework/AzCore/AzCore/Android/Utils.h index 222fac80ad..0862d53aa4 100644 --- a/Code/Framework/AzCore/AzCore/Android/Utils.h +++ b/Code/Framework/AzCore/AzCore/Android/Utils.h @@ -73,8 +73,8 @@ namespace AZ //! \return The pointer position of the relative asset path AZ::IO::FixedMaxPath StripApkPrefix(const char* filePath); - //! Searches application storage and the APK for bootstrap.cfg. Will return nullptr - //! if bootstrap.cfg is not found. + //! Searches application storage and the APK for engine.json. Will return nullptr + //! if engine.json is not found. const char* FindAssetsDirectory(); //! Calls into Java to show the splash screen on the main UI (Java) thread diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h index c5cdbbf331..11f4531124 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h +++ b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h @@ -307,6 +307,8 @@ namespace AZ Asset(AssetLoadBehavior loadBehavior = AssetLoadBehavior::Default); /// Create an asset from a valid asset data (created asset), might not be loaded or currently loading. Asset(AssetData* assetData, AssetLoadBehavior loadBehavior); + /// Create an asset from a valid asset data (created asset) and set the asset id for both, might not be loaded or currently loading. + Asset(const AZ::Data::AssetId& id, AssetData* assetData, AssetLoadBehavior loadBehavior); /// Initialize asset pointer with id, type, and hint. No data construction will occur until QueueLoad is called. Asset(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type, const AZStd::string& hint = AZStd::string()); @@ -787,6 +789,18 @@ namespace AZ SetData(assetData); } + //========================================================================= + template + Asset::Asset(const AssetId& id, AssetData* assetData, AssetLoadBehavior loadBehavior) + : m_assetId(id) + , m_assetType(azrtti_typeid()) + , m_loadBehavior(loadBehavior) + { + AZ_Assert(!assetData->m_assetId.IsValid(), "Asset data already has an ID set."); + assetData->m_assetId = id; + SetData(assetData); + } + //========================================================================= template Asset::Asset(const AssetId& id, const AZ::Data::AssetType& type, const AZStd::string& hint) diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp index 555eedf034..a72fe4e013 100644 --- a/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Asset/AssetJsonSerializer.cpp @@ -133,7 +133,15 @@ namespace AZ if (!id.m_guid.IsNull()) { *instance = AssetManager::Instance().FindOrCreateAsset(id, instance->GetType(), instance->GetAutoLoadBehavior()); - + if (!instance->GetId().IsValid()) + { + // If the asset failed to be created, FindOrCreateAsset returns an asset instance with a null + // id. To preserve the asset id in the source json, reset the asset to an empty one, but with + // the right id. + const auto loadBehavior = instance->GetAutoLoadBehavior(); + *instance = Asset(id, instance->GetType()); + instance->SetAutoLoadBehavior(loadBehavior); + } result.Combine(context.Report(result, "Successfully created Asset with id.")); } diff --git a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp index 8a170f5d89..1010ae3473 100644 --- a/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp +++ b/Code/Framework/AzCore/AzCore/Component/ComponentApplication.cpp @@ -462,8 +462,6 @@ namespace AZ // for the application root. CalculateAppRoot(); - // Merge the bootstrap.cfg file into the Settings Registry as soon as the OSAllocator has been created. - SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(*m_settingsRegistry); SettingsRegistryMergeUtils::MergeSettingsToRegistry_O3deUserRegistry(*m_settingsRegistry, AZ_TRAIT_OS_PLATFORM_CODENAME, {}); SettingsRegistryMergeUtils::MergeSettingsToRegistry_CommandLine(*m_settingsRegistry, m_commandLine, executeRegDumpCommands); SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*m_settingsRegistry); @@ -1262,7 +1260,7 @@ namespace AZ // So auto load is turned off if option "AutoLoad" key is bool that is false if (valueName == "AutoLoad" && !value) { - // Strip off the AutoLoead entry from the path + // Strip off the AutoLoad entry from the path auto autoLoadKey = AZ::StringFunc::TokenizeLast(path, "/"); if (!autoLoadKey) { @@ -1332,7 +1330,7 @@ namespace AZ { auto CompareDynamicModuleDescriptor = [&dynamicLibraryPath](const DynamicModuleDescriptor& entry) { - return entry.m_dynamicLibraryPath.contains(dynamicLibraryPath); + return AZ::IO::PathView(entry.m_dynamicLibraryPath).Stem() == AZ::IO::PathView(dynamicLibraryPath).Stem(); }; if (auto moduleIter = AZStd::find_if(gemModules.begin(), gemModules.end(), CompareDynamicModuleDescriptor); moduleIter == gemModules.end()) diff --git a/Code/Framework/AzCore/AzCore/Component/TransformBus.h b/Code/Framework/AzCore/AzCore/Component/TransformBus.h index 2003b949e2..2a8d82c34c 100644 --- a/Code/Framework/AzCore/AzCore/Component/TransformBus.h +++ b/Code/Framework/AzCore/AzCore/Component/TransformBus.h @@ -172,78 +172,10 @@ namespace AZ //! Rotation modifiers //! @{ - //! @deprecated Use SetLocalRotation() - //! Sets the entity's rotation in the world. - //! The origin of the axes is the entity's position in world space. - //! @param eulerAnglesRadians A three-dimensional vector, containing Euler angles in radians, to rotate the entity by. - virtual void SetRotation([[maybe_unused]] const AZ::Vector3& eulerAnglesRadians) {} - - //! @deprecated Use SetLocalRotation() - //! Sets the entity's rotation around the world's X axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The X coordinate Euler angle in radians to use for the entity's rotation. - virtual void SetRotationX([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use SetLocalRotation() - //! Sets the entity's rotation around the world's Y axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The Y coordinate Euler angle in radians to use for the entity's rotation. - virtual void SetRotationY([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use SetLocalRotation() - //! Sets the entity's rotation around the world's Z axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The Z coordinate Euler angle in radians to use for the entity's rotation. - virtual void SetRotationZ([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use SetLocalRotationQuaternion() //! Sets the entity's rotation in the world in quaternion notation. //! The origin of the axes is the entity's position in world space. //! @param quaternion A quaternion that represents the rotation to use for the entity. - virtual void SetRotationQuaternion([[maybe_unused]] const AZ::Quaternion& quaternion) {} - - //! @deprecated Use RotateAroundLocalX() - //! Rotates the entity around the world's X axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The Euler angle in radians by which to rotate the entity around the X axis. - virtual void RotateByX([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use RotateAroundLocalY() - //! Rotates the entity around the world's Y axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The Euler angle in radians by which to rotate the entity around the Y axis. - virtual void RotateByY([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use RotateAroundLocalZ() - //! Rotates the entity around the world's Z axis. - //! The origin of the axis is the entity's position in world space. - //! @param eulerAngleRadians The Euler angle in radians by which to rotate the entity around the Z axis. - virtual void RotateByZ([[maybe_unused]] float eulerAngleRadian) {} - - //! @deprecated Use GetLocalRotation() - //! Gets the entity's rotation in the world in Euler angles rotation in radians. - //! @return A three-dimensional vector, containing Euler angles in radians, that represents the entity's rotation. - virtual AZ::Vector3 GetRotationEulerRadians() { return AZ::Vector3(FLT_MAX); } - - //! @deprecated Use GetLocalRotationQuaternion() - //! Gets the entity's rotation in the world in quaternion format. - //! @return A quaternion that represents the entity's rotation in world space. - virtual AZ::Quaternion GetRotationQuaternion() { return AZ::Quaternion::CreateZero(); } - - //! @deprecated Use GetLocalRotation() - //! Gets the entity's rotation around the world's X axis. - //! @return The Euler angle in radians by which the the entity is rotated around the X axis in world space. - virtual float GetRotationX() { return FLT_MAX; } - - //! @deprecated Use GetLocalRotation() - //! Gets the entity's rotation around the world's Y axis. - //! @return The Euler angle in radians by which the the entity is rotated around the Y axis in world space. - virtual float GetRotationY() { return FLT_MAX; } - - //! @deprecated Use GetLocalRotation() - //! Gets the entity's rotation around the world's Z axis. - //! @return The Euler angle in radians by which the the entity is rotated around the Z axis in world space. - virtual float GetRotationZ() { return FLT_MAX; } + virtual void SetWorldRotationQuaternion([[maybe_unused]] const AZ::Quaternion& quaternion) {} //! Get angles in radian for each principle axis around which the world transform is //! rotated in the order of z-axis and y-axis and then x-axis. @@ -287,71 +219,21 @@ namespace AZ //! Scale modifiers //! @{ - //! @deprecated Use SetLocalScale() - //! Scales the entity along the world's axes. The origin of the axes is the entity's position in the world. - //! @param scale A three-dimensional vector that represents the multipliers with which to scale the entity in world space. - virtual void SetScale([[maybe_unused]] const AZ::Vector3& scale) {} - - //! @deprecated Use SetLocalScaleX() - //! Scales the entity along the world's X axis. The origin of the axis is the entity's position in the world. - //! @param scaleX The multiplier by which to scale the entity along the X axis in world space. - virtual void SetScaleX([[maybe_unused]] float scaleX) {} - - //! @deprecated Use SetLocalScaleY() - //! Scales the entity along the world's Y axis. The origin of the axis is the entity's position in the world. - //! @param scaleY The multiplier by which to scale the entity along the Y axis in world space. - virtual void SetScaleY([[maybe_unused]] float scaleY) {} - - //! @deprecated Use SetLocalScaleZ() - //! Scales the entity along the world's Z axis. The origin of the axis is the entity's position in the world. - //! @param scaleZ The multiplier by which to scale the entity along the Z axis in world space. - virtual void SetScaleZ([[maybe_unused]] float scaleZ) {} - - //! @deprecated Use GetLocalScale() - //! Gets the scale of the entity in world space. - //! @return A three-dimensional vector that represents the scale of the entity in world space. - virtual AZ::Vector3 GetScale() { return AZ::Vector3(FLT_MAX); } - - //! @deprecated Use GetLocalScale() - //! Gets the amount by which an entity is scaled along the world's X axis. - //! @return The amount by which an entity is scaled along the X axis in world space. - virtual float GetScaleX() { return FLT_MAX; } - - //! @deprecated Use GetLocalScale() - //! Gets the amount by which an entity is scaled along the world's Y axis. - //! @return The amount by which an entity is scaled along the Y axis in world space. - virtual float GetScaleY() { return FLT_MAX; } - - //! @deprecated Use GetLocalScale() - //! Gets the amount by which an entity is scaled along the world's Z axis. - //! @return The amount by which an entity is scaled along the Z axis in world space. - virtual float GetScaleZ() { return FLT_MAX; } - - //! Set local scale of the transform. - //! @param scale The new scale to set along three local axes. - virtual void SetLocalScale([[maybe_unused]] const AZ::Vector3& scale) {} - - //! Set local scale of the transform on x-axis. - //! @param scaleX The new x-axis scale to set. - virtual void SetLocalScaleX([[maybe_unused]] float scaleX) {} - - //! Set local scale of the transform on y-axis. - //! @param scaleY The new y-axis scale to set. - virtual void SetLocalScaleY([[maybe_unused]] float scaleY) {} - - //! Set local scale of the transform on z-axis. - //! @param scaleZ The new z-axis scale to set. - virtual void SetLocalScaleZ([[maybe_unused]] float scaleZ) {} - - //! Get the scale value on each axis in local space - //! @return The scale value of type Vector3 along each axis in local space. + //! @deprecated GetLocalScale is deprecated, and is left only to allow migration of legacy vector scale. + //! Get the legacy vector scale value in local space. + //! @return The scale value in local space. virtual AZ::Vector3 GetLocalScale() { return AZ::Vector3(FLT_MAX); } - //! Get the scale value on each axis in world space. - //! Note the transform will be skewed when it is rotated and has a parent transform scaled, in which - //! case the returned world-scale from this function will be inaccurate. - //! @return The scale value of type Vector3 along each axis in world space. - virtual AZ::Vector3 GetWorldScale() { return AZ::Vector3(FLT_MAX); } + //! Set the uniform scale value in local space. + virtual void SetLocalUniformScale([[maybe_unused]] float scale) {} + + //! Get the uniform scale value in local space. + //! @return The uniform scale value in local space. + virtual float GetLocalUniformScale() { return FLT_MAX; } + + //! Get the uniform scale value in world space. + //! @return The uniform scale value in world space. + virtual float GetWorldUniformScale() { return FLT_MAX; } //! @} //! Transform hierarchy diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h index 61294cd637..6c1b519224 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h @@ -95,6 +95,12 @@ namespace AZ::IO constexpr int Compare(AZStd::string_view pathString) const noexcept; constexpr int Compare(const value_type* pathString) const noexcept; + // Extension for fixed strings + //! extension: fixed string types with MaxPathLength capacity + //! Returns a new instance of an AZStd::fixed_string with capacity of MaxPathLength + //! made from the internal string + constexpr AZStd::fixed_string FixedMaxPathString() const noexcept; + // decomposition //! Given a windows path of "C:\O3DE\foo\bar\name.txt" and a posix path of //! "/O3DE/foo/bar/name.txt" diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl index 1e42fc9df7..05a92c5247 100644 --- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl +++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl @@ -915,6 +915,11 @@ namespace AZ::IO return compare_string_view(path); } + constexpr AZStd::fixed_string PathView::FixedMaxPathString() const noexcept + { + return AZStd::fixed_string(m_path.begin(), m_path.end()); + } + // decomposition constexpr auto PathView::RootName() const -> PathView { diff --git a/Code/Framework/AzCore/AzCore/Math/Aabb.cpp b/Code/Framework/AzCore/AzCore/Math/Aabb.cpp index 3f7cb4ecf5..367594be63 100644 --- a/Code/Framework/AzCore/AzCore/Math/Aabb.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Aabb.cpp @@ -227,7 +227,7 @@ namespace AZ // the min and max of each part and sum them to get the min and max co-ordinate of the transformed box. For a given new axis, // the coefficients for what proportion of each original axis is rotated onto that new axis are the same as the components we // would get by performing the inverse rotation on the new axis, so we need to take the conjugate to get the inverse rotation. - axisCoeffs = transform.GetScale() * (transform.GetRotation().GetConjugate().TransformVector(axis)); + axisCoeffs = transform.GetUniformScale() * (transform.GetRotation().GetConjugate().TransformVector(axis)); a = axisCoeffs * m_min; b = axisCoeffs * m_max; diff --git a/Code/Framework/AzCore/AzCore/Math/Obb.cpp b/Code/Framework/AzCore/AzCore/Math/Obb.cpp index eb511669d0..9226ddd28f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Obb.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Obb.cpp @@ -154,7 +154,7 @@ namespace AZ return Obb::CreateFromPositionRotationAndHalfLengths( transform.TransformPoint(obb.GetPosition()), transform.GetRotation() * obb.GetRotation(), - transform.GetScale() * obb.GetHalfLengths() + transform.GetUniformScale() * obb.GetHalfLengths() ); } } diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp b/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp index 143fe59ca7..06443c0698 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.cpp @@ -348,13 +348,20 @@ namespace AZ return result.GetW() >= 0.0f ? result : -result; } - const Quaternion Quaternion::CreateFromEulerAnglesDegrees(Vector3& anglesInDegrees) + const Quaternion Quaternion::CreateFromEulerAnglesDegrees(const Vector3& anglesInDegrees) { Quaternion result; result.SetFromEulerDegrees(anglesInDegrees); return result; } + const Quaternion Quaternion::CreateFromEulerAnglesRadians(const Vector3& anglesInRadians) + { + Quaternion result; + result.SetFromEulerRadians(anglesInRadians); + return result; + } + Quaternion Quaternion::Slerp(const Quaternion& dest, float t) const { const float DestDot = Dot(dest); diff --git a/Code/Framework/AzCore/AzCore/Math/Quaternion.h b/Code/Framework/AzCore/AzCore/Math/Quaternion.h index c4502063de..4d3b6641db 100644 --- a/Code/Framework/AzCore/AzCore/Math/Quaternion.h +++ b/Code/Framework/AzCore/AzCore/Math/Quaternion.h @@ -83,8 +83,11 @@ namespace AZ static Quaternion CreateShortestArc(const Vector3& v1, const Vector3& v2); - /// Creates a quaternion using rotation in degrees about the axes. First rotated about the X axis, followed by the Y axis, then the Z axis. - static const Quaternion CreateFromEulerAnglesDegrees(Vector3& anglesInDegrees); + //! Creates a quaternion using rotation in degrees about the axes. First rotated about the X axis, followed by the Y axis, then the Z axis. + static const Quaternion CreateFromEulerAnglesDegrees(const Vector3& anglesInDegrees); + + //! Creates a quaternion using rotation in radians about the axes. First rotated about the X axis, followed by the Y axis, then the Z axis. + static const Quaternion CreateFromEulerAnglesRadians(const Vector3& anglesInRadians); //! Stores the vector to an array of 4 floats. The floats need only be 4 byte aligned, 16 byte alignment is not required. void StoreToFloat4(float* values) const; diff --git a/Code/Framework/AzCore/AzCore/Math/Random.h b/Code/Framework/AzCore/AzCore/Math/Random.h index 5ae37433ec..8b2763df50 100644 --- a/Code/Framework/AzCore/AzCore/Math/Random.h +++ b/Code/Framework/AzCore/AzCore/Math/Random.h @@ -86,4 +86,101 @@ namespace AZ Normal, UniformReal }; + + //! Halton sequences are deterministic, quasi-random sequences with low discrepancy. They + //! are useful for generating evenly distributed points. + //! See https://en.wikipedia.org/wiki/Halton_sequence for more information. + + //! Returns a single halton number. + //! @param index The index of the number. Indices start at 1. Using index 0 will return 0. + //! @param base The numerical base of the halton number. + inline float GetHaltonNumber(uint32_t index, uint32_t base) + { + float fraction = 1.0f; + float result = 0.0f; + + while (index > 0) + { + fraction = fraction / base; + result += fraction * (index % base); + index = aznumeric_cast(index / base); + } + + return result; + } + + //! A helper class for generating arrays of Halton sequences in n dimensions. + //! The class holds the state of which bases to use, the starting offset + //! of each dimension and how much to increment between each index for each + //! dimension. + template + class HaltonSequence + { + public: + + //! Initializes a Halton sequence with some bases. By default there is no + //! offset and the index increments by 1 between each number. + HaltonSequence(AZStd::array bases) + : m_bases(bases) + { + m_offsets.fill(1); // Halton sequences start at index 1. + m_increments.fill(1); // By default increment by 1 between each number. + } + + //! Fills a provided container from begin to end with a Halton sequence. + //! Entries are expected to be, or implicitly converted to, AZStd::array. + template + void FillHaltonSequence(Iterator begin, Iterator end) + { + AZStd::array indices = m_offsets; + + // Generator that returns the Halton number for all bases for a single entry. + auto f = [&]() + { + AZStd::array item; + for (auto d = 0; d < Dimensions; ++d) + { + item[d] = GetHaltonNumber(indices[d], m_bases[d]); + indices[d] += m_increments[d]; + } + return item; + }; + + AZStd::generate(begin, end, f); + } + + //! Returns a Halton sequence in an array of N length. + template + AZStd::array, N> GetHaltonSequence() + { + AZStd::array, N> result; + FillHaltonSequence(result.begin(), result.end()); + return result; + } + + //! Sets the offsets per dimension to start generating a sequence from. + //! By default, there is no offset (offset of 0 corresponds to starting at index 1). + void SetOffsets(AZStd::array offsets) + { + m_offsets = offsets; + + // Halton sequences start at index 1, so increment all the indices. + AZStd::for_each(m_offsets.begin(), m_offsets.end(), [](uint32_t &n){ n++; }); + } + + //! Sets the increment between numbers in the halton sequence per dimension + //! By default this is 1, meaning that no numbers are skipped. Can be negative + //! to generate numbers in reverse order. + void SetIncrements(AZStd::array increments) + { + m_increments = increments; + } + + private: + + AZStd::array m_bases; + AZStd::array m_offsets; + AZStd::array m_increments; + + }; } diff --git a/Code/Framework/AzCore/AzCore/Math/Spline.h b/Code/Framework/AzCore/AzCore/Math/Spline.h index 912c10f46f..1adfc9b2fa 100644 --- a/Code/Framework/AzCore/AzCore/Math/Spline.h +++ b/Code/Framework/AzCore/AzCore/Math/Spline.h @@ -441,10 +441,10 @@ namespace AZ const Transform& worldFromLocal, const Vector3& src, const Vector3& dir, const Spline& spline) { Transform worldFromLocalNormalized = worldFromLocal; - const Vector3 scale = worldFromLocalNormalized.ExtractScale(); + const float scale = worldFromLocalNormalized.ExtractUniformScale(); const Transform localFromWorldNormalized = worldFromLocalNormalized.GetInverse(); - const Vector3 localRayOrigin = localFromWorldNormalized.TransformPoint(src) * scale.GetReciprocal(); + const Vector3 localRayOrigin = localFromWorldNormalized.TransformPoint(src) / scale; const Vector3 localRayDirection = localFromWorldNormalized.TransformVector(dir); return spline.GetNearestAddressRay(localRayOrigin, localRayDirection); } diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.cpp b/Code/Framework/AzCore/AzCore/Math/Transform.cpp index bb3f764492..62a390c138 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.cpp +++ b/Code/Framework/AzCore/AzCore/Math/Transform.cpp @@ -130,8 +130,8 @@ namespace AZ const Transform* transform = reinterpret_cast(classPtr); float data[NumFloats]; transform->GetRotation().StoreToFloat4(data); - transform->GetScale().StoreToFloat3(&data[4]); - transform->GetTranslation().StoreToFloat3(&data[7]); + data[4] = transform->GetUniformScale(); + transform->GetTranslation().StoreToFloat3(&data[5]); for (int i = 0; i < NumFloats; i++) { @@ -159,8 +159,8 @@ namespace AZ size_t TransformSerializer::TextToData(const char* text, unsigned int textVersion, IO::GenericStream& stream, bool isDataBigEndian) { - const size_t dataBufferSize = AZStd::max(NumFloatsVersion0, NumFloats); - const size_t numElements = textVersion < 1 ? NumFloatsVersion0 : NumFloats; + const size_t dataBufferSize = AZStd::max(AZStd::max(NumFloatsVersion1, NumFloatsVersion0), NumFloats); + const size_t numElements = textVersion < 1 ? NumFloatsVersion0 : (textVersion == 1 ? NumFloatsVersion1 : NumFloats); size_t nextNumberIndex = 0; AZStd::array data; @@ -201,7 +201,34 @@ namespace AZ return true; } - // otherwise load as a separate rotation, scale and translation + // version 1 had a quaternion rotation, vector3 scale and vector3 translation + else if (version == 1) + { + float data[NumFloatsVersion1]; + if (stream.GetLength() < sizeof(data)) + { + return false; + } + + stream.Read(sizeof(data), reinterpret_cast(data)); + + for (unsigned int i = 0; i < AZ_ARRAY_SIZE(data); ++i) + { + AZ_SERIALIZE_SWAP_ENDIAN(data[i], isDataBigEndian); + } + + Quaternion rotation = Quaternion::CreateFromFloat4(data); + Vector3 vectorScale = Vector3::CreateFromFloat3(&data[4]); + Vector3 translation = Vector3::CreateFromFloat3(&data[7]); + + float uniformScale = vectorScale.GetMaxElement(); + + *reinterpret_cast(classPtr) = + Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateUniformScale(uniformScale); + return true; + } + + // otherwise load as a quaternion rotation, float scale and vector3 translation float data[NumFloats]; if (stream.GetLength() < sizeof(data)) { @@ -216,11 +243,11 @@ namespace AZ } Quaternion rotation = Quaternion::CreateFromFloat4(data); - Vector3 scale = Vector3::CreateFromFloat3(&data[4]); - Vector3 translation = Vector3::CreateFromFloat3(&data[7]); + float scale = data[4]; + Vector3 translation = Vector3::CreateFromFloat3(&data[5]); *reinterpret_cast(classPtr) = - Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateScale(scale); + Transform::CreateFromQuaternionAndTranslation(rotation, translation) * Transform::CreateUniformScale(scale); return true; } @@ -237,7 +264,7 @@ namespace AZ if (serializeContext) { serializeContext->Class() - ->Version(1) + ->Version(2) ->Serializer(); } @@ -250,7 +277,7 @@ namespace AZ Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)-> Attribute(Script::Attributes::Storage, Script::Attributes::StorageType::Value)-> Attribute(Script::Attributes::GenericConstructorOverride, &Internal::TransformDefaultConstructor)-> - Constructor()-> + Constructor()-> Method("GetBasis", &Transform::GetBasis)-> Method("GetBasisX", &Transform::GetBasisX)-> Method("GetBasisY", &Transform::GetBasisY)-> @@ -283,11 +310,11 @@ namespace AZ Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)-> Method("GetRotation", &Transform::GetRotation)-> Method("SetRotation", &Transform::SetRotation)-> - Method("GetScale", &Transform::GetScale)-> - Method("SetScale", &Transform::SetScale)-> - Method("ExtractScale", &Transform::ExtractScale)-> + Method("GetUniformScale", &Transform::GetUniformScale)-> + Method("SetUniformScale", &Transform::SetUniformScale)-> + Method("ExtractUniformScale", &Transform::ExtractUniformScale)-> Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)-> - Method("MultiplyByScale", &Transform::MultiplyByScale)-> + Method("MultiplyByUniformScale", &Transform::MultiplyByUniformScale)-> Method("GetInverse", &Transform::GetInverse)-> Method("Invert", &Transform::Invert)-> Attribute(Script::Attributes::ExcludeFrom, Script::Attributes::ExcludeFlags::All)-> @@ -305,7 +332,7 @@ namespace AZ Method("CreateFromQuaternionAndTranslation", &Transform::CreateFromQuaternionAndTranslation)-> Method("CreateFromMatrix3x3", &Transform::CreateFromMatrix3x3)-> Method("CreateFromMatrix3x3AndTranslation", &Transform::CreateFromMatrix3x3AndTranslation)-> - Method("CreateScale", &Transform::CreateScale)-> + Method("CreateUniformScale", &Transform::CreateUniformScale)-> Method("CreateTranslation", &Transform::CreateTranslation)-> Method("ConstructFromValuesNumeric", &Internal::ConstructTransformFromValues); } @@ -315,7 +342,7 @@ namespace AZ { Transform result; Matrix3x3 tmp = value; - result.m_scale = tmp.ExtractScale(); + result.m_scale = tmp.ExtractScale().GetMaxElement(); result.m_rotation = Quaternion::CreateFromMatrix3x3(tmp); result.m_translation = Vector3::CreateZero(); return result; @@ -325,7 +352,7 @@ namespace AZ { Transform result; Matrix3x3 tmp = value; - result.m_scale = tmp.ExtractScale(); + result.m_scale = tmp.ExtractScale().GetMaxElement(); result.m_rotation = Quaternion::CreateFromMatrix3x3(tmp); result.m_translation = p; return result; @@ -335,7 +362,7 @@ namespace AZ { Transform result; Matrix3x4 tmp = value; - result.m_scale = tmp.ExtractScale(); + result.m_scale = tmp.ExtractScale().GetMaxElement(); result.m_rotation = Quaternion::CreateFromMatrix3x4(tmp); result.m_translation = value.GetTranslation(); return result; diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.h b/Code/Framework/AzCore/AzCore/Math/Transform.h index eb1a12a912..3fe6ddc98a 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.h +++ b/Code/Framework/AzCore/AzCore/Math/Transform.h @@ -25,10 +25,13 @@ namespace AZ : public SerializeContext::IDataSerializer { public: - // number of floats in the serialized representation, 4 for rotation, 3 for scale and 3 for translation - static constexpr int NumFloats = 10; + // number of floats in the serialized representation, 4 for rotation, 1 for scale and 3 for translation + static constexpr int NumFloats = 8; - // number of floats in the old format, which stored a 3x4 matrix + // number of floats in version 1, which used 4 for rotation, 3 for scale and 3 for translation + static constexpr int NumFloatsVersion1 = 10; + + // number of floats in version 0, which stored a 3x4 matrix static constexpr int NumFloatsVersion0 = 12; size_t Save(const void* classPtr, IO::GenericStream& stream, bool isDataBigEndian) override; @@ -45,7 +48,7 @@ namespace AZ static constexpr float MaxTransformScale = 1e9f; //! @} - //! The basic transformation class, represented using a quaternion rotation, vector scale and vector translation. + //! The basic transformation class, represented using a quaternion rotation, float scale and vector translation. //! By design, cannot represent skew transformations. class Transform { @@ -63,7 +66,7 @@ namespace AZ Transform() = default; //! Construct a transform from components. - Transform(const Vector3& translation, const Quaternion& rotation, const Vector3& scale); + Transform(const Vector3& translation, const Quaternion& rotation, float scale); //! Creates an identity transform. static Transform CreateIdentity(); @@ -82,15 +85,22 @@ namespace AZ static Transform CreateFromQuaternionAndTranslation(const class Quaternion& q, const Vector3& p); //! Constructs from a Matrix3x3, translation is set to zero. + //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes, + //! the largest matrix scale value will be used to uniformly scale the Transform. static Transform CreateFromMatrix3x3(const class Matrix3x3& value); - //! Constructs from a Matrix3x3, translation is set to zero. + //! Constructs from a Matrix3x3 and translation Vector3. + //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes, + //! the largest matrix scale value will be used to uniformly scale the Transform. static Transform CreateFromMatrix3x3AndTranslation(const class Matrix3x3& value, const Vector3& p); + //! Constructs from a Matrix3x4. + //! Note that Transform only allows uniform scale, so if the matrix has different scale values along its axes, + //! the largest matrix scale value will be used to uniformly scale the Transform. static Transform CreateFromMatrix3x4(const Matrix3x4& value); - //! Sets the matrix to be a scale matrix, translation is set to zero. - static Transform CreateScale(const Vector3& scale); + //! Sets the transform to apply (uniform) scale only, no rotation or translation. + static Transform CreateUniformScale(const float scale); //! Sets the matrix to be a translation matrix, rotation part is set to identity. static Transform CreateTranslation(const Vector3& translation); @@ -119,13 +129,13 @@ namespace AZ const Quaternion& GetRotation() const; void SetRotation(const Quaternion& rotation); - const Vector3& GetScale() const; - void SetScale(const Vector3& v); + float GetUniformScale() const; + void SetUniformScale(const float scale); - //! Sets the transforms scale to a unit value and returns the previous scale value. - Vector3 ExtractScale(); + //! Sets the transform's scale to a unit value and returns the previous scale value. + float ExtractUniformScale(); - void MultiplyByScale(const Vector3& scale); + void MultiplyByUniformScale(float scale); Transform operator*(const Transform& rhs) const; Transform& operator*=(const Transform& rhs); @@ -159,7 +169,7 @@ namespace AZ private: Quaternion m_rotation; - Vector3 m_scale; + float m_scale; Vector3 m_translation; }; diff --git a/Code/Framework/AzCore/AzCore/Math/Transform.inl b/Code/Framework/AzCore/AzCore/Math/Transform.inl index 63425e6e41..5f71316b52 100644 --- a/Code/Framework/AzCore/AzCore/Math/Transform.inl +++ b/Code/Framework/AzCore/AzCore/Math/Transform.inl @@ -12,7 +12,7 @@ namespace AZ { - AZ_MATH_INLINE Transform::Transform(const Vector3& translation, const Quaternion& rotation, const Vector3& scale) + AZ_MATH_INLINE Transform::Transform(const Vector3& translation, const Quaternion& rotation, float scale) : m_translation(translation) , m_rotation(rotation) , m_scale(scale) @@ -25,7 +25,7 @@ namespace AZ { Transform result; result.m_rotation = Quaternion::CreateIdentity(); - result.m_scale = Vector3::CreateOne(); + result.m_scale = 1.0f; result.m_translation = Vector3::CreateZero(); return result; } @@ -49,7 +49,7 @@ namespace AZ { Transform result; result.m_rotation = q; - result.m_scale = Vector3::CreateOne(); + result.m_scale = 1.0f; result.m_translation = Vector3::CreateZero(); return result; } @@ -58,12 +58,12 @@ namespace AZ { Transform result; result.m_rotation = q; - result.m_scale = Vector3::CreateOne(); + result.m_scale = 1.0f; result.m_translation = p; return result; } - AZ_MATH_INLINE Transform Transform::CreateScale(const Vector3& scale) + AZ_MATH_INLINE Transform Transform::CreateUniformScale(float scale) { Transform result; result.m_rotation = Quaternion::CreateIdentity(); @@ -76,7 +76,7 @@ namespace AZ { Transform result; result.m_rotation = Quaternion::CreateIdentity(); - result.m_scale = Vector3::CreateOne(); + result.m_scale = 1.0f; result.m_translation = translation; return result; } @@ -104,17 +104,17 @@ namespace AZ AZ_MATH_INLINE Vector3 Transform::GetBasisX() const { - return m_rotation.TransformVector(Vector3::CreateAxisX(m_scale.GetX())); + return m_rotation.TransformVector(Vector3::CreateAxisX(m_scale)); } AZ_MATH_INLINE Vector3 Transform::GetBasisY() const { - return m_rotation.TransformVector(Vector3::CreateAxisY(m_scale.GetY())); + return m_rotation.TransformVector(Vector3::CreateAxisY(m_scale)); } AZ_MATH_INLINE Vector3 Transform::GetBasisZ() const { - return m_rotation.TransformVector(Vector3::CreateAxisZ(m_scale.GetZ())); + return m_rotation.TransformVector(Vector3::CreateAxisZ(m_scale)); } AZ_MATH_INLINE void Transform::GetBasisAndTranslation(Vector3* basisX, Vector3* basisY, Vector3* basisZ, Vector3* pos) const @@ -150,24 +150,24 @@ namespace AZ m_rotation = rotation; } - AZ_MATH_INLINE const Vector3& Transform::GetScale() const + AZ_MATH_INLINE float Transform::GetUniformScale() const { return m_scale; } - AZ_MATH_INLINE void Transform::SetScale(const Vector3& scale) + AZ_MATH_INLINE void Transform::SetUniformScale(const float scale) { m_scale = scale; } - AZ_MATH_INLINE Vector3 Transform::ExtractScale() + AZ_MATH_INLINE float Transform::ExtractUniformScale() { - const Vector3 scale = m_scale; - m_scale = Vector3::CreateOne(); + const float scale = m_scale; + m_scale = 1.0f; return scale; } - AZ_MATH_INLINE void Transform::MultiplyByScale(const Vector3& scale) + AZ_MATH_INLINE void Transform::MultiplyByUniformScale(float scale) { m_scale *= scale; } @@ -204,10 +204,9 @@ namespace AZ AZ_MATH_INLINE Transform Transform::GetInverse() const { - // note - need to be careful about how to calculate inverse when there is non-uniform scale Transform out; out.m_rotation = m_rotation.GetConjugate(); - out.m_scale = m_scale.GetReciprocal(); + out.m_scale = 1.0f / m_scale; out.m_translation = -out.m_scale * (out.m_rotation.TransformVector(m_translation)); return out; } @@ -219,27 +218,27 @@ namespace AZ AZ_MATH_INLINE bool Transform::IsOrthogonal(float tolerance) const { - return m_scale.IsClose(Vector3::CreateOne(), tolerance); + return AZ::IsClose(m_scale, 1.0f, tolerance); } AZ_MATH_INLINE Transform Transform::GetOrthogonalized() const { Transform result; result.m_rotation = m_rotation; - result.m_scale = Vector3::CreateOne(); + result.m_scale = 1.0f; result.m_translation = m_translation; return result; } AZ_MATH_INLINE void Transform::Orthogonalize() { - *this = GetOrthogonalized(); + m_scale = 1.0f; } AZ_MATH_INLINE bool Transform::IsClose(const Transform& rhs, float tolerance) const { return m_rotation.IsClose(rhs.m_rotation, tolerance) - && m_scale.IsClose(rhs.m_scale, tolerance) + && AZ::IsClose(m_scale, rhs.m_scale, tolerance) && m_translation.IsClose(rhs.m_translation, tolerance); } @@ -268,21 +267,21 @@ namespace AZ AZ_MATH_INLINE void Transform::SetFromEulerDegrees(const Vector3& eulerDegrees) { m_translation = Vector3::CreateZero(); - m_scale = Vector3::CreateOne(); + m_scale = 1.0f; m_rotation.SetFromEulerDegrees(eulerDegrees); } AZ_MATH_INLINE void Transform::SetFromEulerRadians(const Vector3& eulerRadians) { m_translation = Vector3::CreateZero(); - m_scale = Vector3::CreateOne(); + m_scale = 1.0f; m_rotation.SetFromEulerRadians(eulerRadians); } AZ_MATH_INLINE bool Transform::IsFinite() const { return m_rotation.IsFinite() - && m_scale.IsFinite() + && AZ::IsFiniteFloat(m_scale) && m_translation.IsFinite(); } diff --git a/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp b/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp index 0a3e02ee0d..36c40265af 100644 --- a/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp +++ b/Code/Framework/AzCore/AzCore/Math/TransformSerializer.cpp @@ -60,14 +60,14 @@ namespace AZ { // Scale is transitioning to a single uniform scale value, but since it's still internally represented as a Vector3, // we need to pick one number to use for load/store operations. - float scale = transformInstance->GetScale().GetMaxElement(); + float scale = transformInstance->GetUniformScale(); JSR::ResultCode loadResult = ContinueLoadingFromJsonObjectField(&scale, azrtti_typeid(), inputValue, ScaleTag, context); result.Combine(loadResult); - transformInstance->SetScale(AZ::Vector3(scale)); + transformInstance->SetUniformScale(scale); } return context.Report( @@ -124,8 +124,8 @@ namespace AZ // Scale is transitioning to a single uniform scale value, but since it's still internally represented as a Vector3, // we need to pick one number to use for load/store operations. - float scale = transformInstance->GetScale().GetMaxElement(); - float defaultScale = defaultTransformInstance ? defaultTransformInstance->GetScale().GetMaxElement() : 0.0f; + float scale = transformInstance->GetUniformScale(); + float defaultScale = defaultTransformInstance ? defaultTransformInstance->GetUniformScale() : 0.0f; JSR::ResultCode storeResult = ContinueStoringToJsonObjectField( outputValue, ScaleTag, &scale, defaultTransformInstance ? &defaultScale : nullptr, azrtti_typeid(), diff --git a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp index 78f6ac0fb1..9e5b586c39 100644 --- a/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp +++ b/Code/Framework/AzCore/AzCore/Memory/OverrunDetectionAllocator.cpp @@ -103,7 +103,7 @@ namespace AZ } } - /// Returns a pointer to the beginning of master vector of SmallAllocationGroups. + /// Returns a pointer to the beginning of vector of SmallAllocationGroups. SmallAllocationGroup* ArrayHead() { return this - m_index; @@ -169,7 +169,7 @@ namespace AZ return m_marker == MARKER; } - /// Returns the master index of the SmallAllocationGroup containing this allocation + /// Returns the index of the SmallAllocationGroup containing this allocation uint32_t GetSmallAllocationIndex() const { return (uint32_t)(m_data & 0xFFFFFFFF); diff --git a/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp b/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp index fe41050b00..0ce3ee5d8d 100644 --- a/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp +++ b/Code/Framework/AzCore/AzCore/Module/ModuleManager.cpp @@ -512,7 +512,7 @@ namespace AZ // Load DLLs specified in the application descriptor for (const auto& moduleDescriptor : modules) { - // For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution + // For each module that is loaded, attempt to set the module's folder as a path for dependent module resolution moduleSearchPathHelper.SetModuleSearchPath(moduleDescriptor); LoadModuleOutcome result = LoadDynamicModule(moduleDescriptor.m_dynamicLibraryPath.c_str(), lastStepToPerform, maintainReferences); diff --git a/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.cpp b/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.cpp index 63aad1ecf4..e31c3b0a1e 100644 --- a/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.cpp +++ b/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.cpp @@ -19,7 +19,7 @@ namespace AZ { inline namespace PlatformDefaults { - static const char* PlatformNames[PlatformId::NumPlatformIds] = { PlatformPC, PlatformES3, PlatformIOS, PlatformOSX, PlatformProvo, PlatformSalem, PlatformJasper, PlatformServer, PlatformAll, PlatformAllClient }; + static const char* PlatformNames[PlatformId::NumPlatformIds] = { PlatformPC, PlatformAndroid, PlatformIOS, PlatformMac, PlatformProvo, PlatformSalem, PlatformJasper, PlatformServer, PlatformAll, PlatformAllClient }; const char* PlatformIdToPalFolder(AZ::PlatformId platform) { @@ -31,11 +31,11 @@ namespace AZ { case AZ::PC: return "PC"; - case AZ::ES3: + case AZ::ANDROID_ID: return "Android"; case AZ::IOS: return "iOS"; - case AZ::OSX: + case AZ::MAC_ID: return "Mac"; case AZ::PROVO: return "Provo"; @@ -66,11 +66,11 @@ namespace AZ } else if (osPlatform == PlatformCodeNameMac) { - return PlatformOSX; + return PlatformMac; } else if (osPlatform == PlatformCodeNameAndroid) { - return PlatformES3; + return PlatformAndroid; } else if (osPlatform == PlatformCodeNameiOS) { @@ -207,13 +207,13 @@ namespace AZ platformCodes.emplace_back(PlatformCodeNameWindows); platformCodes.emplace_back(PlatformCodeNameLinux); break; - case PlatformId::ES3: + case PlatformId::ANDROID_ID: platformCodes.emplace_back(PlatformCodeNameAndroid); break; case PlatformId::IOS: platformCodes.emplace_back(PlatformCodeNameiOS); break; - case PlatformId::OSX: + case PlatformId::MAC_ID: platformCodes.emplace_back(PlatformCodeNameMac); break; case PlatformId::PROVO: diff --git a/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.h b/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.h index 2d67c860cd..ba8c55f5f5 100644 --- a/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.h +++ b/Code/Framework/AzCore/AzCore/PlatformId/PlatformDefaults.h @@ -27,9 +27,9 @@ namespace AZ inline namespace PlatformDefaults { constexpr char PlatformPC[] = "pc"; - constexpr char PlatformES3[] = "es3"; + constexpr char PlatformAndroid[] = "android"; constexpr char PlatformIOS[] = "ios"; - constexpr char PlatformOSX[] = "osx_gl"; + constexpr char PlatformMac[] = "mac"; constexpr char PlatformProvo[] = "provo"; constexpr char PlatformSalem[] = "salem"; constexpr char PlatformJasper[] = "jasper"; @@ -54,9 +54,9 @@ namespace AZ AZ_ENUM_WITH_UNDERLYING_TYPE(PlatformId, int, (Invalid, -1), PC, - ES3, + ANDROID_ID, IOS, - OSX, + MAC_ID, PROVO, SALEM, JASPER, @@ -73,9 +73,9 @@ namespace AZ { Platform_NONE = 0x00, Platform_PC = 1 << PlatformId::PC, - Platform_ES3 = 1 << PlatformId::ES3, + Platform_ANDROID = 1 << PlatformId::ANDROID_ID, Platform_IOS = 1 << PlatformId::IOS, - Platform_OSX = 1 << PlatformId::OSX, + Platform_MAC = 1 << PlatformId::MAC_ID, Platform_PROVO = 1 << PlatformId::PROVO, Platform_SALEM = 1 << PlatformId::SALEM, Platform_JASPER = 1 << PlatformId::JASPER, @@ -87,7 +87,7 @@ namespace AZ // A special platform that will always correspond to all non-server platforms, even if new ones are added Platform_ALL_CLIENT = 1ULL << 31, - AllNamedPlatforms = Platform_PC | Platform_ES3 | Platform_IOS | Platform_OSX | Platform_PROVO | Platform_SALEM | Platform_JASPER | Platform_SERVER, + AllNamedPlatforms = Platform_PC | Platform_ANDROID | Platform_IOS | Platform_MAC | Platform_PROVO | Platform_SALEM | Platform_JASPER | Platform_SERVER, }; AZ_DEFINE_ENUM_BITWISE_OPERATORS(PlatformFlags); diff --git a/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.cpp b/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.cpp index 0258869a0c..d56140be28 100644 --- a/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.cpp +++ b/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.cpp @@ -28,8 +28,8 @@ namespace AZ return "Android64"; case PlatformID::PLATFORM_APPLE_IOS: return "iOS"; - case PlatformID::PLATFORM_APPLE_OSX: - return "OSX"; + case PlatformID::PLATFORM_APPLE_MAC: + return "Mac"; #if defined(AZ_EXPAND_FOR_RESTRICTED_PLATFORM) || defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) #define AZ_RESTRICTED_PLATFORM_EXPANSION(CodeName, CODENAME, codename, PrivateName, PRIVATENAME, privatename, PublicName, PUBLICNAME, publicname, PublicAuxName1, PublicAuxName2, PublicAuxName3)\ case PlatformID::PLATFORM_##PUBLICNAME:\ diff --git a/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.h b/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.h index ce1a11d8ce..e8e7cef6dd 100644 --- a/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.h +++ b/Code/Framework/AzCore/AzCore/PlatformId/PlatformId.h @@ -23,7 +23,7 @@ namespace AZ PLATFORM_WINDOWS_64, PLATFORM_LINUX_64, PLATFORM_APPLE_IOS, - PLATFORM_APPLE_OSX, + PLATFORM_APPLE_MAC, PLATFORM_ANDROID_64, // ARMv8 / 64-bit #if defined(AZ_EXPAND_FOR_RESTRICTED_PLATFORM) || defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) #define AZ_RESTRICTED_PLATFORM_EXPANSION(CodeName, CODENAME, codename, PrivateName, PRIVATENAME, privatename, PublicName, PUBLICNAME, publicname, PublicAuxName1, PublicAuxName2, PublicAuxName3)\ diff --git a/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl b/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl index 079c70c878..537d3e5c83 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl +++ b/Code/Framework/AzCore/AzCore/RTTI/AzStdOnDemandReflection.inl @@ -1020,29 +1020,60 @@ namespace AZ } }; - /// OnDemand reflection for AZStd::set + + template + class Iterator_VM> + { + public: + using ContainerType = AZStd::unordered_set; + using IteratorType = typename ContainerType::iterator; + Iterator_VM(ContainerType& container) + : m_iterator(container.begin()) + , m_end(container.end()) + {} + + const t_Key& GetKeyUnchecked() const + { + return *m_iterator; + } + + bool IsNotAtEnd() const + { + return m_iterator != m_end; + } + + t_Key& ModValueUnchecked() + { + return *m_iterator; + } + + void Next() + { + ++m_iterator; + } + + private: + IteratorType m_iterator; + IteratorType m_end; + }; + + /// OnDemand reflection for AZStd::unordered_set template struct OnDemandReflection< AZStd::unordered_set > { using ContainerType = AZStd::unordered_set; using KeyListType = AZStd::vector; - static AZ::Outcome Erase(ContainerType& thisMap, Key& key) + using ValueIteratorType = Iterator_VM; + + static bool EraseCheck_VM(ContainerType& thisSet, Key& key) { - const auto result = thisMap.erase(key); - if (result) - { - return AZ::Success(); - } - else - { - return AZ::Failure(); - } + return thisSet.erase(key) != 0; } - static void Insert(ContainerType& thisSet, Key& key) + static ContainerType& ErasePost_VM(ContainerType& thisSet, [[maybe_unused]] Key&) { - thisSet.insert(key); + return thisSet; } static KeyListType GetKeys(ContainerType& thisSet) @@ -1055,6 +1086,17 @@ namespace AZ return keys; } + static ContainerType& Insert(ContainerType& thisSet, Key& key) + { + thisSet.insert(key); + return thisSet; + } + + static ValueIteratorType Iterate_VM(ContainerType& thisContainer) + { + return ValueIteratorType(thisContainer); + } + static void Swap(ContainerType& thisSet, ContainerType& otherSet) { thisSet.swap(otherSet); @@ -1064,33 +1106,68 @@ namespace AZ { if (BehaviorContext* behaviorContext = azrtti_cast(context)) { + BranchOnResultInfo emptyBranchInfo; + emptyBranchInfo.m_returnResultInBranches = true; + emptyBranchInfo.m_trueToolTip = "The container is empty"; + emptyBranchInfo.m_falseToolTip = "The container is not empty"; + auto ContainsTransparent = [](const ContainerType& containerType, typename ContainerType::key_type& key)->bool { return containerType.contains(key); }; + ExplicitOverloadInfo explicitOverloadInfo; behaviorContext->Class() - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly) ->Attribute(AZ::ScriptCanvasAttributes::PrettyName, ScriptCanvasOnDemandReflection::OnDemandPrettyName::Get(*behaviorContext)) ->Attribute(AZ::Script::Attributes::ToolTip, ScriptCanvasOnDemandReflection::OnDemandToolTip::Get(*behaviorContext)) ->Attribute(AZ::Script::Attributes::Category, ScriptCanvasOnDemandReflection::OnDemandCategoryName::Get(*behaviorContext)) ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::ScriptOwn) ->Method("BucketCount", static_cast(&ContainerType::bucket_count)) - ->Method("Erase", &Erase) - ->Method("Empty", [](ContainerType& thisSet)->bool { return thisSet.empty(); }) + ->Method("Empty", static_cast(&ContainerType::empty), { { { "Container", "The container to check if it is empty", nullptr, {} } } }) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Is Empty", "Containers")) + ->Attribute(AZ::ScriptCanvasAttributes::BranchOnResult, emptyBranchInfo) + ->Method("EraseCheck_VM", &EraseCheck_VM) + ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Method("Erase", &ErasePost_VM) + ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Erase", "Containers")) + ->Attribute(AZ::ScriptCanvasAttributes::CheckedOperation, CheckedOperationInfo("EraseCheck_VM", {}, "Out", "Key Not Found", true)) + ->Attribute(AZ::ScriptCanvasAttributes::OverloadArgumentGroup, AZ::OverloadArgumentGroupInfo({ "ContainerGroup", "" }, { "ContainerGroup" })) ->Method("contains", ContainsTransparent) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Has Key", "Containers")) ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) ->Method("Insert", &Insert) + ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Insert", "Containers")) + ->Attribute(AZ::ScriptCanvasAttributes::OverloadArgumentGroup, AZ::OverloadArgumentGroupInfo({ "ContainerGroup", "", "" }, { "ContainerGroup" })) ->Method(k_sizeName, [](ContainerType* thisPtr) { return aznumeric_cast(thisPtr->size()); }) ->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Length) ->Method("GetKeys", &GetKeys) ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Method("GetSize", [](ContainerType& thisPtr) { return aznumeric_cast(thisPtr.size()); }) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Get Size", "Containers")) + ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) ->Method("Reserve", static_cast(&ContainerType::reserve)) ->Method("Swap", &Swap) + ->Method("Clear", [](ContainerType& thisContainer)->ContainerType& { thisContainer.clear(); return thisContainer; }) + ->Attribute(AZ::Script::Attributes::TreatAsMemberFunction, AZ::AttributeIsValid::IfPresent) + ->Attribute(AZ::ScriptCanvasAttributes::ExplicitOverloadCrc, ExplicitOverloadInfo("Clear All Elements", "Containers")) + ->Attribute(AZ::ScriptCanvasAttributes::OverloadArgumentGroup, AZ::OverloadArgumentGroupInfo({ "ContainerGroup" }, { "ContainerGroup" })) + ->Method(k_iteratorConstructorName, &Iterate_VM) + ; + + behaviorContext->Class() + ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly) + ->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::ScriptOwn) + ->Method(k_iteratorGetKeyName, &ValueIteratorType::GetKeyUnchecked) + ->Method(k_iteratorModValueName, &ValueIteratorType::ModValueUnchecked) + ->Method(k_iteratorIsNotAtEndName, &ValueIteratorType::IsNotAtEnd) + ->Method(k_iteratorNextName, &ValueIteratorType::Next) ; } } - }; template <> diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp index 635d160434..31a2cfc09e 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.cpp @@ -165,7 +165,7 @@ namespace AZ if (HasResult() != overload->HasResult()) { - AZ_Error("Reflection", false, "Overload failure, all methods must have the same result, or none at all"); + AZ_Error("Reflection", false, "Overload failure, all methods must have the same result, or none at all: %s", m_name.c_str()); return false; } @@ -176,7 +176,7 @@ namespace AZ if (!(methodResult->m_typeId == overloadResult->m_typeId && methodResult->m_traits == overloadResult->m_traits)) { - AZ_Error("Reflection", false, "Overload failure, all methods must have the same result, or none at all"); + AZ_Error("Reflection", false, "Overload failure, all methods must have the same result, or none at all: %s", m_name.c_str()); return false; } } @@ -575,7 +575,7 @@ namespace AZ } else { - AZ_Error("BehaviorContext", false, "safety check declared for method %s but it was not found in the class"); + AZ_Error("BehaviorContext", false, "Method: %s, declared safety check: %s, but it was not found in class: %s", method.m_name.c_str(), m_name.c_str(), checkedOperationInfo.m_safetyCheckName.c_str()); } } } diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.cpp b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.cpp index c64b86ae0f..f6aac0fa16 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.cpp +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.cpp @@ -34,10 +34,17 @@ namespace BehaviorContextUtilitiesCPP using argument_type = const BehaviorParameter*; using result_type = size_t; result_type operator()(const argument_type& value) const - { - result_type result = AZStd::hash()(value->m_typeId); - AZStd::hash_combine(result, CleanTraits(value->m_traits)); - return result; + { + if (value) + { + result_type result = AZStd::hash()(value->m_typeId); + AZStd::hash_combine(result, CleanTraits(value->m_traits)); + return result; + } + else + { + return 0; + } } }; @@ -45,7 +52,11 @@ namespace BehaviorContextUtilitiesCPP { bool operator()(const BehaviorParameter* left, const BehaviorParameter* right) const { - return left->m_typeId == right->m_typeId && CleanTraits(left->m_traits) == CleanTraits(right->m_traits); + return (left == nullptr && right == nullptr) + || (left != nullptr + && right != nullptr + && left->m_typeId == right->m_typeId + && CleanTraits(left->m_traits) == CleanTraits(right->m_traits)); } }; @@ -137,7 +148,7 @@ namespace AZ for (size_t argIndex = 0, argSentinel = overload.GetNumArguments(); argIndex < argSentinel; ++argIndex) { auto overloadedArgIter = variance.m_input.find(argIndex); - if (overloadedArgIter != variance.m_input.end()) + if (overloadedArgIter != variance.m_input.end() && overloadedArgIter->second[overloadIndex]) { // if this doesn't work try the type name overloadName += ReplaceCppArtifacts(overloadedArgIter->second[overloadIndex]->m_name); @@ -185,16 +196,24 @@ namespace AZ { auto argument = overloads[overloadIndex].first->GetArgument(0); - const bool isThisPointer - = (argument->m_traits & AZ::BehaviorParameter::Traits::TR_THIS_PTR) != 0 - || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, overloads[overloadIndex].first->m_attributes); + if (argument) + { + const bool isThisPointer + = (argument->m_traits & AZ::BehaviorParameter::Traits::TR_THIS_PTR) != 0 + || AZ::FindAttribute(AZ::Script::Attributes::TreatAsMemberFunction, overloads[overloadIndex].first->m_attributes); - oneArgIsThisPointer = oneArgIsThisPointer || isThisPointer; + oneArgIsThisPointer = oneArgIsThisPointer || isThisPointer; + } types.insert(argument); stripedArgs.emplace_back(argument); } + if (types.size() == overloads.size()) + { + variance.m_unambiguousInput.insert(0); + } + if (types.size() > 1 && (onThis == VariantOnThis::Yes || !oneArgIsThisPointer)) { variance.m_input.insert(AZStd::make_pair(0, stripedArgs)); @@ -210,11 +229,15 @@ namespace AZ for (size_t overloadIndex = 0, overloadSentinel = overloads.size(); overloadIndex < overloadSentinel; ++overloadIndex) { auto argument = overloads[overloadIndex].first->GetArgument(argIndex); - types.insert(argument); stripedArgs.emplace_back(argument); } + if (types.size() == overloads.size()) + { + variance.m_unambiguousInput.insert(0); + } + if (types.size() > 1) { variance.m_input.insert(AZStd::make_pair(argIndex, stripedArgs)); diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.h b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.h index 4663635cdf..0dc9ecc969 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.h +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContextUtilities.h @@ -27,6 +27,8 @@ namespace AZ struct OverloadVariance { AZStd::unordered_map> m_input; + // the indices of inputs that make selection of overload unambiguous + AZStd::unordered_set m_unambiguousInput; AZStd::vector m_output; }; diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp index ac1e61a5aa..9bf6247e97 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptContext.cpp @@ -2048,10 +2048,6 @@ LUA_API const Node* lua_getDummyNode() return true; } - else - { - AZ_Warning("Script", false, "Index %d is not a function!", functionIndex); - } return false; } @@ -2078,7 +2074,6 @@ LUA_API const Node* lua_getDummyNode() } else { - AZ_Warning("Script", lua_isnil(m_nativeContext, -1), "Name %s exists but is not a function!", functionName); lua_pop(m_nativeContext, 1); } @@ -5888,7 +5883,6 @@ LUA_API const Node* lua_getDummyNode() else { lua_pop(m_impl->m_lua, 1); - AZ_Warning("Script", false, "%s is not a function!", functionName); } return false; } @@ -5906,7 +5900,6 @@ LUA_API const Node* lua_getDummyNode() else { lua_pop(m_impl->m_lua, 1); - AZ_Warning("Script", false, "CacheIndex %d is not a function!", cachedIndex); } return false; } diff --git a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp index 015554538f..11d4db2e07 100644 --- a/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp +++ b/Code/Framework/AzCore/AzCore/Script/ScriptSystemComponent.cpp @@ -937,7 +937,7 @@ void ScriptSystemComponent::Reflect(ReflectContext* reflection) ->Enum(PlatformID::PLATFORM_LINUX_64)>("Linux") ->Enum(PlatformID::PLATFORM_ANDROID_64)>("Android64") ->Enum(PlatformID::PLATFORM_APPLE_IOS)>("iOS") - ->Enum(PlatformID::PLATFORM_APPLE_OSX)>("OSX") + ->Enum(PlatformID::PLATFORM_APPLE_MAC)>("Mac") #if defined(AZ_EXPAND_FOR_RESTRICTED_PLATFORM) || defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS) #define AZ_RESTRICTED_PLATFORM_EXPANSION(CodeName, CODENAME, codename, PrivateName, PRIVATENAME, privatename, PublicName, PUBLICNAME, publicname, PublicAuxName1, PublicAuxName2, PublicAuxName3)\ ->Enum(PlatformID::PLATFORM_##PUBLICNAME)>(#CodeName) diff --git a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl index 1016027966..dfd0707ed2 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl +++ b/Code/Framework/AzCore/AzCore/Serialization/EditContextConstants.inl @@ -123,6 +123,7 @@ namespace AZ const static AZ::Crc32 NameLabelOverride = AZ_CRC("NameLabelOverride", 0x9ff79cab); const static AZ::Crc32 AssetPickerTitle = AZ_CRC_CE("AssetPickerTitle"); + const static AZ::Crc32 HideProductFilesInAssetPicker = AZ_CRC_CE("HideProductFilesInAssetPicker"); const static AZ::Crc32 ChildNameLabelOverride = AZ_CRC("ChildNameLabelOverride", 0x73dd2909); //! Container attribute that is used to override labels for its elements given the index of the element const static AZ::Crc32 IndexedChildNameLabelOverride = AZ_CRC("IndexedChildNameLabelOverride", 0x5f313ac2); diff --git a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp index 93d12acba3..9c4641741e 100644 --- a/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp +++ b/Code/Framework/AzCore/AzCore/Serialization/Json/JsonDeserializer.cpp @@ -10,6 +10,7 @@ * */ +#include "AzCore/RTTI/TypeInfo.h" #include #include #include @@ -61,6 +62,13 @@ namespace AZ if (classData->m_azRtti && classData->m_azRtti->GetGenericTypeId() != typeId) { + if (((classData->m_azRtti->GetTypeTraits() & (AZ::TypeTraits::is_signed | AZ::TypeTraits::is_unsigned)) != AZ::TypeTraits{0}) && + context.GetSerializeContext()->GetUnderlyingTypeId(typeId) == classData->m_typeId) + { + // This value is from an enum, where a field has been reflected using ClassBuilder::Field, but the enum + // type itself has not been reflected using EnumBuilder. Treat it as an enum. + return LoadEnum(object, *classData, value, context); + } serializer = context.GetRegistrationContext()->GetSerializerForType(classData->m_azRtti->GetGenericTypeId()); if (serializer) { @@ -77,21 +85,18 @@ namespace AZ { return LoadEnum(object, *classData, value, context); } - else if (classData->m_container) + if (classData->m_container) { return context.Report(Tasks::ReadField, Outcomes::Unsupported, "The Json Serializer uses custom serializers to load containers. If this message is encountered " "then a serializer for the target containers is missing, isn't registered or doesn't exist."); } - else if (value.IsObject()) + if (value.IsObject()) { return LoadClass(object, *classData, value, context); } - else - { - return context.Report(Tasks::ReadField, Outcomes::Unsupported, - AZStd::string::format("Reading into targets of type '%s' is not supported.", classData->m_name)); - } + return context.Report(Tasks::ReadField, Outcomes::Unsupported, + AZStd::string::format("Reading into targets of type '%s' is not supported.", classData->m_name)); } JsonSerializationResult::ResultCode JsonDeserializer::LoadToPointer(void* object, const Uuid& typeId, @@ -233,8 +238,16 @@ namespace AZ AZ::TypeId underlyingTypeId = AZ::TypeId::CreateNull(); if (!attributeReader.Read(underlyingTypeId)) { - return context.Report(Tasks::RetrieveInfo, Outcomes::Unknown, - "Unable to find underlying type of enum in class data."); + // for non-reflected enums, the passed-in classData already represents the enum's underlying type + if (context.GetSerializeContext()->GetUnderlyingTypeId(classData.m_typeId) == classData.m_typeId) + { + underlyingTypeId = classData.m_typeId; + } + else + { + return context.Report(Tasks::RetrieveInfo, Outcomes::Unknown, + "Unable to find underlying type of enum in class data."); + } } const SerializeContext::ClassData* underlyingClassData = context.GetSerializeContext()->FindClassData(underlyingTypeId); diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp index 2421c75be3..3dd4931374 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryImpl.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -880,6 +881,13 @@ namespace AZ const Specializations& specializations, const rapidjson::Pointer& historyPointer, AZStd::string_view folderPath) { using namespace rapidjson; + + if (&lhs == &rhs) + { + // Early return to avoid setting the collisionFound reference to true + // std::sort is allowed to pass in the same memory address for the left and right elements + return false; + } AZ_Assert(!lhs.m_tags.empty(), "Comparing a settings file without at least a name tag."); AZ_Assert(!rhs.m_tags.empty(), "Comparing a settings file without at least a name tag."); @@ -1054,15 +1062,23 @@ namespace AZ jsonPatch.ParseInsitu(scratchBuffer.data()); if (jsonPatch.HasParseError()) { + auto nativeUI = AZ::Interface::Get(); if (jsonPatch.GetParseError() == rapidjson::kParseErrorDocumentEmpty) { - AZ_Warning("Settings Registry", false, R"(Unable to parse registry file "%s" due to json error "%s" at offset %llu.)", + AZ_Warning("Settings Registry", false, R"(Unable to parse registry file "%s" due to json error "%s" at offset %zu.)", path, GetParseError_En(jsonPatch.GetParseError()), jsonPatch.GetErrorOffset()); } else { - AZ_Error("Settings Registry", false, R"(Unable to parse registry file "%s" due to json error "%s" at offset %llu.)", path, + using ErrorString = AZStd::fixed_string<4096>; + auto jsonError = ErrorString::format(R"(Unable to parse registry file "%s" due to json error "%s" at offset %zu.)", path, GetParseError_En(jsonPatch.GetParseError()), jsonPatch.GetErrorOffset()); + AZ_Error("Settings Registry", false, "%s", jsonError.c_str()); + + if (nativeUI) + { + nativeUI->DisplayOkDialog("Setreg(Patch) Merge Issue", AZStd::string_view(jsonError), false); + } } pointer.Create(m_settings, m_settings.GetAllocator()).SetObject() diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp index 82bf1db484..2abef3f808 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.cpp @@ -88,6 +88,35 @@ namespace AZ::Internal m_enginePaths.emplace_back(EngineInfo{AZ::IO::FixedMaxPath{value}.LexicallyNormal(), {}}); } + AZ::SettingsRegistryInterface::VisitResponse Traverse( + [[maybe_unused]] AZStd::string_view path, AZStd::string_view valueName, + AZ::SettingsRegistryInterface::VisitAction action, AZ::SettingsRegistryInterface::Type type) override + { + auto response = AZ::SettingsRegistryInterface::VisitResponse::Continue; + if (action == AZ::SettingsRegistryInterface::VisitAction::Begin) + { + if (type == AZ::SettingsRegistryInterface::Type::Array) + { + if (valueName.compare("engines") != 0) + { + response = AZ::SettingsRegistryInterface::VisitResponse::Skip; + } + } + } + else if (action == AZ::SettingsRegistryInterface::VisitAction::Value) + { + if (type == AZ::SettingsRegistryInterface::Type::String) + { + if (valueName.compare("path") != 0) + { + response = AZ::SettingsRegistryInterface::VisitResponse::Skip; + } + } + } + + return response; + } + AZStd::vector m_enginePaths{}; }; @@ -494,13 +523,6 @@ namespace AZ::SettingsRegistryMergeUtils return configFileParsed; } - void MergeSettingsToRegistry_Bootstrap(SettingsRegistryInterface& registry) - { - ConfigParserSettings parserSettings; - parserSettings.m_registryRootPointerPath = BootstrapSettingsRootKey; - MergeSettingsToRegistry_ConfigFile(registry, "bootstrap.cfg", parserSettings); - } - void MergeSettingsToRegistry_AddRuntimeFilePaths(SettingsRegistryInterface& registry) { using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; diff --git a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h index 576066c29f..b482530d24 100644 --- a/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h +++ b/Code/Framework/AzCore/AzCore/Settings/SettingsRegistryMergeUtils.h @@ -172,9 +172,6 @@ namespace AZ::SettingsRegistryMergeUtils bool MergeSettingsToRegistry_ConfigFile(SettingsRegistryInterface& registry, AZStd::string_view filePath, const ConfigParserSettings& configParserSettings); - //! Loads bootstrap.cfg into the Settings Registry. This file does not support specializations. - void MergeSettingsToRegistry_Bootstrap(SettingsRegistryInterface& registry); - //! Extracts file path information from the environment and bootstrap to calculate the various file paths and adds those //! to the Settings Registry under the FilePathsRootKey. void MergeSettingsToRegistry_AddRuntimeFilePaths(SettingsRegistryInterface& registry); diff --git a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Utils/Utils_UnixLike.cpp b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Utils/Utils_UnixLike.cpp index 9dbe8f7264..7fd8a639c3 100644 --- a/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Utils/Utils_UnixLike.cpp +++ b/Code/Framework/AzCore/Platform/Common/UnixLike/AzCore/Utils/Utils_UnixLike.cpp @@ -41,10 +41,6 @@ namespace AZ if (const char* homePath = std::getenv("HOME"); homePath != nullptr) { AZ::IO::FixedMaxPath path{homePath}; - if (!path.empty()) - { - path /= ".o3de"; - } return path.Native(); } return {}; diff --git a/Code/Framework/AzCore/Platform/Mac/AzCore/PlatformId/PlatformId_Mac.h b/Code/Framework/AzCore/Platform/Mac/AzCore/PlatformId/PlatformId_Mac.h index d361e79f05..42dcd3e2f7 100644 --- a/Code/Framework/AzCore/Platform/Mac/AzCore/PlatformId/PlatformId_Mac.h +++ b/Code/Framework/AzCore/Platform/Mac/AzCore/PlatformId/PlatformId_Mac.h @@ -13,5 +13,5 @@ namespace AZ { - static const PlatformID g_currentPlatform = PlatformID::PLATFORM_APPLE_OSX; + static const PlatformID g_currentPlatform = PlatformID::PLATFORM_APPLE_MAC; } diff --git a/Code/Framework/AzCore/Platform/iOS/AzCore/Module/DynamicModuleHandle_iOS.cpp b/Code/Framework/AzCore/Platform/iOS/AzCore/Module/DynamicModuleHandle_iOS.cpp index 53514c89e4..a389162ccc 100644 --- a/Code/Framework/AzCore/Platform/iOS/AzCore/Module/DynamicModuleHandle_iOS.cpp +++ b/Code/Framework/AzCore/Platform/iOS/AzCore/Module/DynamicModuleHandle_iOS.cpp @@ -40,7 +40,7 @@ namespace AZ // Afterwards use the AZ::IO::Path Append function append the filename as a child // of the framework directory AZ::IO::FixedMaxPathString fileName{ fullPath.Filename().Native() }; - fullPath.ReplaceFilename(AZ::IO::PathView((fileName + ".framework").c_str())); + fullPath.ReplaceFilename(AZ::IO::PathView(AZStd::string_view(fileName + ".framework"))); fullPath /= fileName; } } diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp index 42b77f6976..f9616702f1 100644 --- a/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp +++ b/Code/Framework/AzCore/Tests/AZTestShared/Math/MathTestHelpers.cpp @@ -68,7 +68,7 @@ namespace AZ return os << "translation: " << transform.GetTranslation() << " rotation: " << transform.GetRotation() - << " scale: " << transform.GetScale(); + << " scale: " << transform.GetUniformScale(); } std::ostream& operator<<(std::ostream& os, const Color& color) diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.cpp b/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.cpp index 38b9cd609b..9c6f85f08a 100644 --- a/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.cpp +++ b/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.cpp @@ -31,6 +31,8 @@ namespace UnitTest ErrorHandler::ErrorHandler(const char* errorPattern) : m_errorCount(0) , m_warningCount(0) + , m_expectedErrorCount(0) + , m_expectedWarningCount(0) , m_errorPattern(errorPattern) { AZ::Debug::TraceMessageBus::Handler::BusConnect(); @@ -51,6 +53,16 @@ namespace UnitTest return m_warningCount; } + int ErrorHandler::GetExpectedErrorCount() const + { + return m_expectedErrorCount; + } + + int ErrorHandler::GetExpectedWarningCount() const + { + return m_expectedWarningCount; + } + bool ErrorHandler::SuppressExpectedErrors([[maybe_unused]] const char* window, const char* message) { return AZStd::string(message).find(m_errorPattern) != AZStd::string::npos; @@ -61,7 +73,9 @@ namespace UnitTest [[maybe_unused]] const char* func, const char* message) { m_errorCount++; - return SuppressExpectedErrors(window, message); + bool suppress = SuppressExpectedErrors(window, message); + m_expectedErrorCount += suppress; + return suppress; } bool ErrorHandler::OnPreWarning( @@ -69,7 +83,9 @@ namespace UnitTest [[maybe_unused]] const char* func, const char* message) { m_warningCount++; - return SuppressExpectedErrors(window, message); + bool suppress = SuppressExpectedErrors(window, message); + m_expectedWarningCount += suppress; + return suppress; } bool ErrorHandler::OnPrintf(const char* window, const char* message) diff --git a/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.h b/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.h index 044c3d1111..56ef340d22 100644 --- a/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.h +++ b/Code/Framework/AzCore/Tests/AZTestShared/Utils/Utils.h @@ -30,8 +30,14 @@ namespace UnitTest public: explicit ErrorHandler(const char* errorPattern); ~ErrorHandler(); + //! Returns the total number of errors encountered (including those which match the expected pattern). int GetErrorCount() const; + //! Returns the total number of warnings encountered (including those which match the expected pattern). int GetWarningCount() const; + //! Returns the number of errors encountered which matched the expected pattern. + int GetExpectedErrorCount() const; + //! Returns the number of warnings encountered which matched the expected pattern. + int GetExpectedWarningCount() const; bool SuppressExpectedErrors(const char* window, const char* message); // AZ::Debug::TraceMessageBus @@ -44,6 +50,8 @@ namespace UnitTest AZStd::string m_errorPattern; int m_errorCount; int m_warningCount; + int m_expectedErrorCount; + int m_expectedWarningCount; }; } diff --git a/Code/Framework/AzCore/Tests/Math/MathTestData.h b/Code/Framework/AzCore/Tests/Math/MathTestData.h index cd3ade7854..c82c5caea7 100644 --- a/Code/Framework/AzCore/Tests/Math/MathTestData.h +++ b/Code/Framework/AzCore/Tests/Math/MathTestData.h @@ -61,8 +61,8 @@ namespace MathTestData }; static const AZ::Transform NonOrthogonalTransforms[] = { - AZ::Transform::CreateScale(AZ::Vector3(2.4f, 0.3f, 1.7f)), - AZ::Transform::CreateRotationX(2.2f) * AZ::Transform::CreateScale(AZ::Vector3(0.2f, 0.8f, 1.4f)) + AZ::Transform::CreateUniformScale(2.4f), + AZ::Transform::CreateRotationX(2.2f) * AZ::Transform::CreateUniformScale(0.8f) }; static const AZ::Transform OrthogonalTransforms[] = { diff --git a/Code/Framework/AzCore/Tests/Math/ObbTests.cpp b/Code/Framework/AzCore/Tests/Math/ObbTests.cpp index a90d66f288..de267b4265 100644 --- a/Code/Framework/AzCore/Tests/Math/ObbTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/ObbTests.cpp @@ -59,11 +59,11 @@ namespace UnitTest TEST(MATH_Obb, TestScaleTransform) { Obb obb = Obb::CreateFromPositionRotationAndHalfLengths(position, rotation, halfLengths); - Vector3 scaleFactors = Vector3(1.0f, 2.0f, 3.0f); - Transform transform = Transform::CreateScale(scaleFactors); + float scale = 3.0f; + Transform transform = Transform::CreateUniformScale(scale); obb = transform * obb; - EXPECT_THAT(obb.GetPosition(), IsClose(Vector3(1.0f, 4.0f, 9.0f))); - EXPECT_THAT(obb.GetHalfLengths(), IsClose(Vector3(0.5f, 1.0f, 1.5f))); + EXPECT_THAT(obb.GetPosition(), IsClose(Vector3(3.0f, 6.0f, 9.0f))); + EXPECT_THAT(obb.GetHalfLengths(), IsClose(Vector3(1.5f, 1.5f, 1.5f))); } TEST(MATH_Obb, TestSetPosition) diff --git a/Code/Framework/AzCore/Tests/Math/RandomTests.cpp b/Code/Framework/AzCore/Tests/Math/RandomTests.cpp new file mode 100644 index 0000000000..7fe3acff54 --- /dev/null +++ b/Code/Framework/AzCore/Tests/Math/RandomTests.cpp @@ -0,0 +1,114 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +using namespace AZ; + +namespace UnitTest +{ + TEST(MATH_Random, GetHaltonNumber) + { + EXPECT_FLOAT_EQ(0.5, GetHaltonNumber(1, 2)); + EXPECT_FLOAT_EQ(898.0f / 2187.0f, GetHaltonNumber(1234, 3)); + EXPECT_FLOAT_EQ(5981.0f / 15625.0f, GetHaltonNumber(4321, 5)); + } + + TEST(MATH_Random, HaltonSequenceStandard) + { + HaltonSequence<3> sequence({ 2, 3, 5 }); + auto regularSequence = sequence.GetHaltonSequence<5>(); + + EXPECT_FLOAT_EQ(1.0f / 2.0f, regularSequence[0][0]); + EXPECT_FLOAT_EQ(1.0f / 3.0f, regularSequence[0][1]); + EXPECT_FLOAT_EQ(1.0f / 5.0f, regularSequence[0][2]); + + EXPECT_FLOAT_EQ(1.0f / 4.0f, regularSequence[1][0]); + EXPECT_FLOAT_EQ(2.0f / 3.0f, regularSequence[1][1]); + EXPECT_FLOAT_EQ(2.0f / 5.0f, regularSequence[1][2]); + + EXPECT_FLOAT_EQ(3.0f / 4.0f, regularSequence[2][0]); + EXPECT_FLOAT_EQ(1.0f / 9.0f, regularSequence[2][1]); + EXPECT_FLOAT_EQ(3.0f / 5.0f, regularSequence[2][2]); + + EXPECT_FLOAT_EQ(1.0f / 8.0f, regularSequence[3][0]); + EXPECT_FLOAT_EQ(4.0f / 9.0f, regularSequence[3][1]); + EXPECT_FLOAT_EQ(4.0f / 5.0f, regularSequence[3][2]); + + EXPECT_FLOAT_EQ(5.0f / 8.0f, regularSequence[4][0]); + EXPECT_FLOAT_EQ(7.0f / 9.0f, regularSequence[4][1]); + EXPECT_FLOAT_EQ(1.0f / 25.0f, regularSequence[4][2]); + } + + TEST(MATH_Random, HaltonSequenceOffsets) + { + HaltonSequence<3> sequence({ 2, 3, 5 }); + sequence.SetOffsets({ 1, 2, 3 }); + auto offsetSequence = sequence.GetHaltonSequence<2>(); + + EXPECT_FLOAT_EQ(1.0f / 4.0f, offsetSequence[0][0]); + EXPECT_FLOAT_EQ(1.0f / 9.0f, offsetSequence[0][1]); + EXPECT_FLOAT_EQ(4.0f / 5.0f, offsetSequence[0][2]); + + EXPECT_FLOAT_EQ(3.0f / 4.0f, offsetSequence[1][0]); + EXPECT_FLOAT_EQ(4.0f / 9.0f, offsetSequence[1][1]); + EXPECT_FLOAT_EQ(1.0f / 25.0f, offsetSequence[1][2]); + } + + TEST(MATH_Random, HaltonSequenceIncrements) + { + HaltonSequence<3> sequence({ 2, 3, 5 }); + sequence.SetOffsets({ 1, 2, 3 }); + sequence.SetIncrements({ 1, 2, 3 }); + auto incrementedSequence = sequence.GetHaltonSequence<2>(); + + EXPECT_FLOAT_EQ(1.0f / 4.0f, incrementedSequence[0][0]); + EXPECT_FLOAT_EQ(1.0f / 9.0f, incrementedSequence[0][1]); + EXPECT_FLOAT_EQ(4.0f / 5.0f, incrementedSequence[0][2]); + + EXPECT_FLOAT_EQ(3.0f / 4.0f, incrementedSequence[1][0]); + EXPECT_FLOAT_EQ(7.0f / 9.0f, incrementedSequence[1][1]); + EXPECT_FLOAT_EQ(11.0f / 25.0f, incrementedSequence[1][2]); + } + + TEST(MATH_Random, FillHaltonSequence) + { + HaltonSequence<3> sequence({ 2, 3, 5 }); + auto regularSequence = sequence.GetHaltonSequence<5>(); + + struct Point + { + Point() = default; + Point(AZStd::array arr) + :x(arr[0]) + ,y(arr[1]) + ,z(arr[2]) + {} + + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; + }; + + AZStd::array ownedContainer; + sequence.FillHaltonSequence(ownedContainer.begin(), ownedContainer.end()); + + for (size_t i = 0; i < regularSequence.size(); ++i) + { + EXPECT_FLOAT_EQ(regularSequence[i][0], ownedContainer[i].x); + EXPECT_FLOAT_EQ(regularSequence[i][1], ownedContainer[i].y); + EXPECT_FLOAT_EQ(regularSequence[i][2], ownedContainer[i].z); + } + } + +} diff --git a/Code/Framework/AzCore/Tests/Math/TransformPerformanceTests.cpp b/Code/Framework/AzCore/Tests/Math/TransformPerformanceTests.cpp index 400a845913..943aba9b76 100644 --- a/Code/Framework/AzCore/Tests/Math/TransformPerformanceTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/TransformPerformanceTests.cpp @@ -180,13 +180,13 @@ namespace Benchmark } } - BENCHMARK_F(BM_MathTransform, CreateScale)(benchmark::State& state) + BENCHMARK_F(BM_MathTransform, CreateUniformScale)(benchmark::State& state) { for (auto _ : state) { for (auto& testData : m_testDataArray) { - AZ::Transform result = AZ::Transform::CreateScale(testData.v3); + AZ::Transform result = AZ::Transform::CreateUniformScale(testData.value[0]); benchmark::DoNotOptimize(result); } } @@ -344,39 +344,39 @@ namespace Benchmark } } - BENCHMARK_F(BM_MathTransform, GetScale)(benchmark::State& state) + BENCHMARK_F(BM_MathTransform, GetUniformScale)(benchmark::State& state) { for (auto _ : state) { for (auto& testData : m_testDataArray) { - AZ::Vector3 result = testData.t1.GetScale(); + float result = testData.t1.GetUniformScale(); benchmark::DoNotOptimize(result); } } } - BENCHMARK_F(BM_MathTransform, SetScale)(benchmark::State& state) + BENCHMARK_F(BM_MathTransform, SetUniformScale)(benchmark::State& state) { for (auto _ : state) { for (auto& testData : m_testDataArray) { AZ::Transform testTransform = testData.t2; - testTransform.SetScale(testData.v3); + testTransform.SetUniformScale(testData.value[0]); benchmark::DoNotOptimize(testTransform); } } } - BENCHMARK_F(BM_MathTransform, ExtractScale)(benchmark::State& state) + BENCHMARK_F(BM_MathTransform, ExtractUniformScale)(benchmark::State& state) { for (auto _ : state) { for (auto& testData : m_testDataArray) { AZ::Transform testTransform = testData.t2; - AZ::Vector3 result = testTransform.ExtractScale(); + float result = testTransform.ExtractUniformScale(); benchmark::DoNotOptimize(result); } } diff --git a/Code/Framework/AzCore/Tests/Math/TransformTests.cpp b/Code/Framework/AzCore/Tests/Math/TransformTests.cpp index d0343211c3..529347f31d 100644 --- a/Code/Framework/AzCore/Tests/Math/TransformTests.cpp +++ b/Code/Framework/AzCore/Tests/Math/TransformTests.cpp @@ -159,37 +159,14 @@ namespace UnitTest INSTANTIATE_TEST_CASE_P(MATH_Transform, TransformCreateFromQuaternionFixture, ::testing::ValuesIn(MathTestData::UnitQuaternions)); - using TransformCreateFromMatrix3x3Fixture = ::testing::TestWithParam; - - TEST_P(TransformCreateFromMatrix3x3Fixture, CreateFromMatrix3x3) + TEST(MATH_Transform, CreateUniformScale) { - const AZ::Matrix3x3 matrix3x3 = GetParam(); - const AZ::Transform transform = AZ::Transform::CreateFromMatrix3x3(matrix3x3); - EXPECT_THAT(transform.GetTranslation(), IsClose(AZ::Vector3::CreateZero())); - const AZ::Vector3 vector(2.3f, -0.6, 1.8f); - EXPECT_THAT(transform.TransformPoint(vector), IsClose(matrix3x3 * vector)); - } - - TEST_P(TransformCreateFromMatrix3x3Fixture, CreateFromMatrix3x3AndTranslation) - { - const AZ::Matrix3x3 matrix3x3 = GetParam(); - const AZ::Vector3 translation(-2.6f, 1.7f, 0.8f); - const AZ::Transform transform = AZ::Transform::CreateFromMatrix3x3AndTranslation(matrix3x3, translation); - EXPECT_THAT(transform.GetTranslation(), IsClose(translation)); - const AZ::Vector3 vector(2.3f, -0.6, 1.8f); - EXPECT_THAT(transform.TransformPoint(vector), IsClose(matrix3x3 * vector + translation)); - } - - INSTANTIATE_TEST_CASE_P(MATH_Transform, TransformCreateFromMatrix3x3Fixture, ::testing::ValuesIn(MathTestData::Matrix3x3s)); - - TEST(MATH_Transform, CreateScale) - { - const AZ::Vector3 scale(1.7f, 0.3f, 2.4f); - const AZ::Transform transform = AZ::Transform::CreateScale(scale); + const float scale = 1.7f; + const AZ::Transform transform = AZ::Transform::CreateUniformScale(scale); const AZ::Vector3 vector(0.2f, -1.6f, 0.4f); EXPECT_THAT(transform.GetTranslation(), IsClose(AZ::Vector3::CreateZero())); const AZ::Vector3 transformedVector = transform.TransformPoint(vector); - const AZ::Vector3 expected(0.34f, -0.48f, 0.96f); + const AZ::Vector3 expected(0.34f, -2.72f, 0.68f); EXPECT_THAT(transformedVector, IsClose(expected)); } @@ -237,10 +214,10 @@ namespace UnitTest TEST(MATH_Transform, MultiplyByTransform) { const AZ::Transform transform1 = AZ::Transform::CreateRotationY(0.3f); - const AZ::Transform transform2 = AZ::Transform::CreateScale(AZ::Vector3(1.3f, 1.5f, 0.4f)); + const AZ::Transform transform2 = AZ::Transform::CreateUniformScale(1.3f); const AZ::Transform transform3 = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.42f, 0.46f, -0.66f, 0.42f), AZ::Vector3(2.8f, -3.7f, 1.6f)); - const AZ::Transform transform4 = AZ::Transform::CreateRotationX(-0.7f) * AZ::Transform::CreateScale(AZ::Vector3(0.6f, 1.3f, 0.7f)); + const AZ::Transform transform4 = AZ::Transform::CreateRotationX(-0.7f) * AZ::Transform::CreateUniformScale(0.6f); AZ::Transform transform5 = transform1; transform5 *= transform4; const AZ::Vector3 vector(1.9f, 2.3f, 0.2f); @@ -254,14 +231,14 @@ namespace UnitTest TEST(MATH_Transform, TranslationCorrectInTransformHierarchy) { AZ::Transform parent = AZ::Transform::CreateRotationZ(AZ::DegToRad(45.0f)); - parent.SetScale(AZ::Vector3(3.0f, 2.0f, 1.0f)); + parent.SetUniformScale(3.0f); parent.SetTranslation(AZ::Vector3(0.2f, 0.3f, 0.4f)); AZ::Transform child = AZ::Transform::CreateRotationZ(AZ::DegToRad(90.0f)); child.SetTranslation(AZ::Vector3(0.5f, 0.6f, 0.7f)); const AZ::Transform overallTransform = parent * child; const AZ::Vector3 overallTranslation = overallTransform.GetTranslation(); - const AZ::Vector3 expectedTranslation(0.412132f, 2.20919f, 1.1f); - EXPECT_THAT(overallTranslation, IsClose(AZ::Vector3(0.412132f, 2.20919f, 1.1f))); + const AZ::Vector3 expectedTranslation(-0.012132f, 2.633452f, 2.5f); + EXPECT_THAT(overallTranslation, IsClose(expectedTranslation)); } TEST(MATH_Transform, TransformPointVector3) @@ -337,14 +314,14 @@ namespace UnitTest TEST_P(TransformScaleFixture, Scale) { const AZ::Transform orthogonalTransform = GetParam(); - EXPECT_THAT(orthogonalTransform.GetScale(), IsClose(AZ::Vector3::CreateOne())); + EXPECT_NEAR(orthogonalTransform.GetUniformScale(), 1.0f, AZ::Constants::Tolerance); AZ::Transform unscaledTransform = orthogonalTransform; - unscaledTransform.ExtractScale(); - EXPECT_THAT(unscaledTransform.GetScale(), IsClose(AZ::Vector3::CreateOne())); - const AZ::Vector3 scale(2.8f, 0.7f, 1.3f); + unscaledTransform.ExtractUniformScale(); + EXPECT_NEAR(unscaledTransform.GetUniformScale(), 1.0f, AZ::Constants::Tolerance); + const float scale = 2.8f; AZ::Transform scaledTransform = orthogonalTransform; - scaledTransform.MultiplyByScale(scale); - EXPECT_THAT(scaledTransform.GetScale(), IsClose(scale)); + scaledTransform.MultiplyByUniformScale(scale); + EXPECT_NEAR(scaledTransform.GetUniformScale(), scale, AZ::Constants::Tolerance); } INSTANTIATE_TEST_CASE_P(MATH_Transform, TransformScaleFixture, ::testing::ValuesIn(MathTestData::OrthogonalTransforms)); @@ -353,24 +330,11 @@ namespace UnitTest { EXPECT_TRUE(AZ::Transform::CreateIdentity().IsOrthogonal()); EXPECT_TRUE(AZ::Transform::CreateRotationZ(0.3f).IsOrthogonal()); - EXPECT_FALSE(AZ::Transform::CreateScale(AZ::Vector3(0.8f, 0.3f, 1.2f)).IsOrthogonal()); + EXPECT_FALSE(AZ::Transform::CreateUniformScale(0.8f).IsOrthogonal()); EXPECT_TRUE(AZ::Transform::CreateFromQuaternion(AZ::Quaternion(-0.52f, -0.08f, 0.56f, 0.64f)).IsOrthogonal()); AZ::Transform transform; transform.SetFromEulerRadians(AZ::Vector3(0.2f, 0.4f, 0.1f)); EXPECT_TRUE(transform.IsOrthogonal()); - - // want to test each possible way the transform could fail to be orthogonal, which we can do by testing for one - // axis, then using a rotation which cycles the axes - const AZ::Transform axisCycle = AZ::Transform::CreateFromQuaternion(AZ::Quaternion(0.5f, 0.5f, 0.5f, 0.5f)); - - // a transform which is normalized in 2 axes, but not the third - AZ::Transform nonOrthogonalTransform1 = AZ::Transform::CreateScale(AZ::Vector3(1.0f, 1.0f, 2.0f)); - - for (int i = 0; i < 3; i++) - { - EXPECT_FALSE(nonOrthogonalTransform1.IsOrthogonal()); - nonOrthogonalTransform1 = axisCycle * nonOrthogonalTransform1; - } } using TransformSetFromEulerDegreesFixture = ::testing::TestWithParam; @@ -459,16 +423,17 @@ namespace UnitTest { const char* objectStreamBuffer = R"DELIMITER( - + )DELIMITER"; AZ::Transform* deserializedTransform = AZ::Utils::LoadObjectFromBuffer(objectStreamBuffer, strlen(objectStreamBuffer) + 1); const AZ::Vector3 expectedTranslation(513.7845459f, 492.5420837f, 32.0000000f); - const AZ::Vector3 expectedScale(1.5f, 0.5f, 1.2f); + const float expectedScale = 1.5f; const AZ::Quaternion expectedRotation(0.2624075f, 0.4405251f, 0.2029076f, 0.8342113f); const AZ::Transform expectedTransform = - AZ::Transform::CreateFromQuaternionAndTranslation(expectedRotation, expectedTranslation) * AZ::Transform::CreateScale(expectedScale); + AZ::Transform::CreateFromQuaternionAndTranslation(expectedRotation, expectedTranslation) * + AZ::Transform::CreateUniformScale(expectedScale); EXPECT_TRUE(deserializedTransform->IsClose(expectedTransform)); azfree(deserializedTransform); diff --git a/Code/Framework/AzCore/Tests/ScriptMath.cpp b/Code/Framework/AzCore/Tests/ScriptMath.cpp index cb673e92e7..dce63051c9 100644 --- a/Code/Framework/AzCore/Tests/ScriptMath.cpp +++ b/Code/Framework/AzCore/Tests/ScriptMath.cpp @@ -1275,10 +1275,10 @@ namespace UnitTest script->Execute("AZTestAssert(t1:TransformVector(Vector3(1, 0, 0)):IsClose(Vector3(1, 0, 0)))"); script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 1, 0)):IsClose(Vector3(0, 0.866, 0.5)))"); script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 0, 1)):IsClose(Vector3(0, -0.5, 0.866)))"); - script->Execute("t1 = Transform.CreateScale(Vector3(1, 2, 3))"); - script->Execute("AZTestAssert(t1:TransformVector(Vector3(1, 0, 0)):IsClose(Vector3(1, 0, 0)))"); + script->Execute("t1 = Transform.CreateUniformScale(2)"); + script->Execute("AZTestAssert(t1:TransformVector(Vector3(1, 0, 0)):IsClose(Vector3(2, 0, 0)))"); script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 1, 0)):IsClose(Vector3(0, 2, 0)))"); - script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 0, 1)):IsClose(Vector3(0, 0, 3)))"); + script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 0, 1)):IsClose(Vector3(0, 0, 2)))"); script->Execute("t1 = Transform.CreateTranslation(Vector3(1, 2, 3))"); script->Execute("AZTestAssert(t1:TransformVector(Vector3(1, 0, 0)):IsClose(Vector3(1, 0, 0)))"); script->Execute("AZTestAssert(t1:TransformVector(Vector3(0, 1, 0)):IsClose(Vector3(0, 1, 0)))"); @@ -1341,19 +1341,19 @@ namespace UnitTest script->Execute("AZTestAssert(t3:GetTranslation():IsClose(Vector3(-5.90, 25.415, 19.645), 0.001))"); ////test inverse, should handle non-orthogonal matrices - script->Execute("t1 = Transform.CreateRotationX(1) * Transform.CreateScale(Vector3(1, 2, 3))"); + script->Execute("t1 = Transform.CreateRotationX(1) * Transform.CreateUniformScale(2)"); script->Execute("AZTestAssert((t1*t1:GetInverse()):IsClose(Transform.CreateIdentity()))"); ////scale access - script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(40)) * Transform.CreateScale(Vector3(2, 3, 4))"); - script->Execute("AZTestAssert(t1:GetScale():IsClose(Vector3(2, 3, 4)))"); - script->Execute("AZTestAssert(t1:ExtractScale():IsClose(Vector3(2, 3, 4)))"); - script->Execute("AZTestAssert(t1:GetScale():IsClose(Vector3.CreateOne()))"); - script->Execute("t1:MultiplyByScale(Vector3(3, 4, 5))"); - script->Execute("AZTestAssert(t1:GetScale():IsClose(Vector3(3, 4, 5)))"); + script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(40)) * Transform.CreateUniformScale(3)"); + script->Execute("AZTestAssertFloatClose(t1:GetUniformScale(), 3)"); + script->Execute("AZTestAssertFloatClose(t1:ExtractUniformScale(), 3)"); + script->Execute("AZTestAssertFloatClose(t1:GetUniformScale(), 1)"); + script->Execute("t1:MultiplyByUniformScale(2)"); + script->Execute("AZTestAssertFloatClose(t1:GetUniformScale(), 2)"); ////orthogonalize - script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(30)) * Transform.CreateScale(Vector3(2, 3, 4))"); + script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(30)) * Transform.CreateUniformScale(3)"); script->Execute("t1:SetTranslation(Vector3(1,2,3))"); script->Execute("t2 = t1:GetOrthogonalized()"); script->Execute("AZTestAssertFloatClose(t2:GetBasisX():GetLength(), 1)"); @@ -1372,7 +1372,7 @@ namespace UnitTest script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(30))"); script->Execute("t1:SetTranslation(Vector3(1, 2, 3))"); script->Execute("AZTestAssert(t1:IsOrthogonal(0.05))"); - script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(30)) * Transform.CreateScale(Vector3(2, 3, 4))"); + script->Execute("t1 = Transform.CreateRotationX(Math.DegToRad(30)) * Transform.CreateUniformScale(2)"); script->Execute("AZTestAssert( not t1:IsOrthogonal(0.05))"); ////IsClose diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases.h b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases.h index b01dbe9b0d..ae313632af 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases.h +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases.h @@ -21,7 +21,7 @@ namespace JsonSerializationTests { using JsonSerializationTestCases = ::testing::Types< // Structures - SimpleClass, SimpleInheritence, MultipleInheritence, SimpleNested, SimpleEnumWrapper, + SimpleClass, SimpleInheritence, MultipleInheritence, SimpleNested, SimpleEnumWrapper, NonReflectedEnumWrapper, // Pointers SimpleNullPointer, SimpleAssignedPointer, ComplexAssignedPointer, ComplexNullInheritedPointer, ComplexAssignedDifferentInheritedPointer, ComplexAssignedSameInheritedPointer, diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.cpp index 5be031d70a..6da3120f59 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.cpp @@ -373,6 +373,57 @@ namespace JsonSerializationTests return MakeInstanceWithoutDefaults(AZStd::move(instance), json); } + // NonReflectedEnumWrapper + bool NonReflectedEnumWrapper::Equals(const NonReflectedEnumWrapper& rhs, bool fullReflection) const + { + return !fullReflection || (m_enumClass == rhs.m_enumClass && m_rawEnum== rhs.m_rawEnum); + } + + void NonReflectedEnumWrapper::Reflect(AZStd::unique_ptr& context, bool fullReflection) + { + if (fullReflection) + { + // Note that the enums are not reflected using context->Enum<> + + context->Class() + ->Field("enumClass", &NonReflectedEnumWrapper::m_enumClass) + ->Field("rawEnum", &NonReflectedEnumWrapper::m_rawEnum); + } + } + + InstanceWithSomeDefaults NonReflectedEnumWrapper::GetInstanceWithSomeDefaults() + { + auto instance = AZStd::make_unique(); + instance->m_enumClass = NonReflectedEnumWrapper::SimpleEnumClass::Option2; + + const char* strippedDefaults = R"( + { + "enumClass": 2 + })"; + const char* keptDefaults = R"( + { + "enumClass": 2, + "rawEnum": 0 + })"; + + return MakeInstanceWithSomeDefaults(AZStd::move(instance), + strippedDefaults, keptDefaults); + } + + InstanceWithoutDefaults NonReflectedEnumWrapper::GetInstanceWithoutDefaults() + { + auto instance = AZStd::make_unique(); + instance->m_enumClass = NonReflectedEnumWrapper::SimpleEnumClass::Option2; + instance->m_rawEnum = NonReflectedEnumWrapper::SimpleRawEnum::RawOption1; + + const char* json = R"( + { + "enumClass": 2, + "rawEnum": 1 + })"; + return MakeInstanceWithoutDefaults(AZStd::move(instance), json); + } + // TemplatedClass bool TemplatedClass::Equals(const TemplatedClass& rhs, bool fullReflection) const diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.h b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.h index db5db23fba..1830ca9e6f 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.h +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TestCases_Classes.h @@ -134,6 +134,35 @@ namespace JsonSerializationTests SimpleRawEnum m_rawEnum{}; }; + struct NonReflectedEnumWrapper + { + enum class SimpleEnumClass + { + Option1 = 1, + Option2, + }; + enum SimpleRawEnum + { + RawOption1 = 1, + RawOption2, + }; + AZ_CLASS_ALLOCATOR(NonReflectedEnumWrapper, AZ::SystemAllocator, 0); + AZ_RTTI(NonReflectedEnumWrapper, "{A80D5B6B-2FD1-46E9-A7A9-44C5E2650526}"); + + static constexpr bool SupportsPartialDefaults = true; + + NonReflectedEnumWrapper() = default; + virtual ~NonReflectedEnumWrapper() = default; + + bool Equals(const NonReflectedEnumWrapper& rhs, bool fullReflection) const; + static void Reflect(AZStd::unique_ptr& context, bool fullReflection); + static InstanceWithSomeDefaults GetInstanceWithSomeDefaults(); + static InstanceWithoutDefaults GetInstanceWithoutDefaults(); + + SimpleEnumClass m_enumClass{}; + SimpleRawEnum m_rawEnum{}; + }; + template struct TemplatedClass { @@ -158,5 +187,7 @@ namespace AZ { AZ_TYPE_INFO_SPECIALIZE(JsonSerializationTests::SimpleEnumWrapper::SimpleEnumClass, "{AF6F1964-5B20-4689-BF23-F36B9C9AAE6A}"); AZ_TYPE_INFO_SPECIALIZE(JsonSerializationTests::SimpleEnumWrapper::SimpleRawEnum, "{EB24207F-B48F-4D8B-940D-3CD06A371739}"); + AZ_TYPE_INFO_SPECIALIZE(JsonSerializationTests::NonReflectedEnumWrapper::SimpleEnumClass, "{E80E4A41-B29E-4B7C-B630-3B599172C837}"); + AZ_TYPE_INFO_SPECIALIZE(JsonSerializationTests::NonReflectedEnumWrapper::SimpleRawEnum, "{C42AF28D-4F84-4540-972A-5B6EEFAB13FF}"); AZ_TYPE_INFO_TEMPLATE(JsonSerializationTests::TemplatedClass, "{CA4ADF74-66E7-4D16-B4AC-F71278C60EC7}", AZ_TYPE_INFO_TYPENAME); } diff --git a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp index 12711b1e1a..750f2ebc9c 100644 --- a/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp +++ b/Code/Framework/AzCore/Tests/Serialization/Json/TransformSerializerTests.cpp @@ -44,7 +44,7 @@ namespace JsonSerializationTests AZStd::shared_ptr CreateFullySetInstance() override { return AZStd::make_shared( - AZ::Vector3(1.0f, 2.0f, 3.0f), AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f), AZ::Vector3(9.0f)); + AZ::Vector3(1.0f, 2.0f, 3.0f), AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f), 9.0f); } AZStd::string_view GetJsonForFullySetInstance() override @@ -95,7 +95,7 @@ namespace JsonSerializationTests AZ::Transform expectedTransform( AZ::Vector3(2.25f, 3.5f, 4.75f), AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f), - AZ::Vector3(5.5f)); + 5.5f); rapidjson::Document json; json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })"); @@ -112,7 +112,7 @@ namespace JsonSerializationTests AZ::Transform testTransform = AZ::Transform::CreateIdentity(); AZ::Transform expectedTransform = AZ::Transform::CreateFromQuaternion(AZ::Quaternion(0.25f, 0.5f, 0.75f, 1.0f)); - expectedTransform.SetScale(AZ::Vector3(5.5f)); + expectedTransform.SetUniformScale(5.5f); rapidjson::Document json; json.Parse(R"({ "Rotation": [ 0.25, 0.5, 0.75, 1.0 ], "Scale": 5.5 })"); @@ -128,7 +128,7 @@ namespace JsonSerializationTests { AZ::Transform testTransform = AZ::Transform::CreateIdentity(); AZ::Transform expectedTransform = AZ::Transform::CreateTranslation(AZ::Vector3(2.25f, 3.5f, 4.75f)); - expectedTransform.SetScale(AZ::Vector3(5.5f)); + expectedTransform.SetUniformScale(5.5f); rapidjson::Document json; json.Parse(R"({ "Translation": [ 2.25, 3.5, 4.75 ], "Scale": 5.5 })"); @@ -189,7 +189,7 @@ namespace JsonSerializationTests TEST_F(JsonTransformSerializerTests, Load_FullySetTransform_ReturnsSuccessWithOnlyScale) { AZ::Transform testTransform = AZ::Transform::CreateIdentity(); - AZ::Transform expectedTransform = AZ::Transform::CreateScale(AZ::Vector3(5.5f)); + AZ::Transform expectedTransform = AZ::Transform::CreateUniformScale(5.5f); rapidjson::Document json; json.Parse(R"({ "Scale" : 5.5 })"); diff --git a/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp b/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp index 36b9757ce3..751d9ded6c 100644 --- a/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp +++ b/Code/Framework/AzCore/Tests/SettingsRegistryMergeUtilsTests.cpp @@ -372,15 +372,15 @@ mac_remote_filesystem=0 -- We need to know this before we establish VFS because different platform assets -- are stored in different root folders in the cache. These correspond to the names -- In the asset processor config file. This value also controls what config file is read --- when you read system_xxxx_xxxx.cfg (for example, system_windows_pc.cfg or system_android_es3.cfg) +-- when you read system_xxxx_xxxx.cfg (for example, system_windows_pc.cfg or system_android_android.cfg) -- by default, pc assets (in the 'pc' folder) are used, with RC being fed 'pc' as the platform -- by default on console we use the default assets=pc for better iteration times -- we should turn on console specific assets only when in release and/or testing assets and/or loading performance -- that way most people will not need to have 3 different caches taking up disk space assets = pc -android_assets = es3 +android_assets = android ios_assets = ios -mac_assets = osx_gl +mac_assets = mac -- Add the IP address of your console to the white list that will connect to the asset processor here -- You can list addresses or CIDR's. CIDR's are helpful if you are using DHCP. A CIDR looks like an ip address with @@ -438,9 +438,9 @@ mac_wait_for_connect=0 ConfigFileParams::SettingsKeyValuePair{"/ios_remote_filesystem", AZ::s64{0}}, ConfigFileParams::SettingsKeyValuePair{"/mac_remote_filesystem", AZ::s64{0}}, ConfigFileParams::SettingsKeyValuePair{"/assets", AZStd::string_view{"pc"}}, - ConfigFileParams::SettingsKeyValuePair{"/android_assets", AZStd::string_view{"es3"}}, + ConfigFileParams::SettingsKeyValuePair{"/android_assets", AZStd::string_view{"android"}}, ConfigFileParams::SettingsKeyValuePair{"/ios_assets", AZStd::string_view{"ios"}}, - ConfigFileParams::SettingsKeyValuePair{"/mac_assets", AZStd::string_view{"osx_gl"}}, + ConfigFileParams::SettingsKeyValuePair{"/mac_assets", AZStd::string_view{"mac"}}, ConfigFileParams::SettingsKeyValuePair{"/connect_to_remote", AZ::s64{0}}, ConfigFileParams::SettingsKeyValuePair{"/windows_connect_to_remote", AZ::s64{1}}, ConfigFileParams::SettingsKeyValuePair{"/android_connect_to_remote", AZ::s64{0}}, @@ -478,20 +478,20 @@ test_asset_processor_tag = test_value [Platform pc] tags=tools,renderer,dx12,vulkan -[Platform es3] +[Platform android] tags=android,mobile,renderer,vulkan ; With Comments at the end [Platform ios] tags=mobile,renderer,metal -[Platform osx_gl] +[Platform mac] tags=tools,renderer,metal)" , AZStd::fixed_vector{ ConfigFileParams::SettingsKeyValuePair{"/test_asset_processor_tag", AZStd::string_view{"test_value"}}, ConfigFileParams::SettingsKeyValuePair{"/Platform pc/tags", AZStd::string_view{"tools,renderer,dx12,vulkan"}}, - ConfigFileParams::SettingsKeyValuePair{"/Platform es3/tags", AZStd::string_view{"android,mobile,renderer,vulkan"}}, + ConfigFileParams::SettingsKeyValuePair{"/Platform android/tags", AZStd::string_view{"android,mobile,renderer,vulkan"}}, ConfigFileParams::SettingsKeyValuePair{"/Platform ios/tags", AZStd::string_view{"mobile,renderer,metal"}}, - ConfigFileParams::SettingsKeyValuePair{"/Platform osx_gl/tags", AZStd::string_view{"tools,renderer,metal"}}, + ConfigFileParams::SettingsKeyValuePair{"/Platform mac/tags", AZStd::string_view{"tools,renderer,metal"}}, }} ) ); diff --git a/Code/Framework/AzCore/Tests/azcoretests_files.cmake b/Code/Framework/AzCore/Tests/azcoretests_files.cmake index f90717d003..78b2701d92 100644 --- a/Code/Framework/AzCore/Tests/azcoretests_files.cmake +++ b/Code/Framework/AzCore/Tests/azcoretests_files.cmake @@ -152,6 +152,7 @@ set(FILES Math/PlaneTests.cpp Math/QuaternionPerformanceTests.cpp Math/QuaternionTests.cpp + Math/RandomTests.cpp Math/ShapeIntersectionPerformanceTests.cpp Math/ShapeIntersectionTests.cpp Math/SfmtTests.cpp diff --git a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp index e02892de4e..c65ba373f8 100644 --- a/Code/Framework/AzFramework/AzFramework/Application/Application.cpp +++ b/Code/Framework/AzFramework/AzFramework/Application/Application.cpp @@ -679,8 +679,6 @@ namespace AzFramework { auto fileIoBase = m_archiveFileIO.get(); // Set up the default file aliases based on the settings registry - fileIoBase->SetAlias("@assets@", ""); - fileIoBase->SetAlias("@root@", GetEngineRoot()); fileIoBase->SetAlias("@engroot@", GetEngineRoot()); fileIoBase->SetAlias("@projectroot@", GetEngineRoot()); fileIoBase->SetAlias("@exefolder@", GetExecutableFolder()); @@ -694,8 +692,8 @@ namespace AzFramework pathAliases.clear(); if (m_settingsRegistry->Get(pathAliases.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder)) { - fileIoBase->SetAlias("@projectplatformcache@", pathAliases.c_str()); fileIoBase->SetAlias("@assets@", pathAliases.c_str()); + fileIoBase->SetAlias("@projectplatformcache@", pathAliases.c_str()); fileIoBase->SetAlias("@root@", pathAliases.c_str()); // Deprecated Use @projectplatformcache@ } pathAliases.clear(); diff --git a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp index b0285616df..4a80db2b24 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/Archive.cpp @@ -2008,13 +2008,12 @@ namespace AZ::IO // if no bind root is specified, compute one: strBindRoot = !bindRoot.empty() ? bindRoot : szFullPath->ParentPath().Native(); - // Check if archive file disk exist on disk or inside of pak. - bool bFileExists = IsFileExist(szFullPath->Native()); - - if (!bFileExists && (nFactoryFlags & ZipDir::CacheFactory::FLAGS_READ_ONLY)) + // Check if archive file disk exist on disk. + const bool pakOnDisk = FileIOBase::GetDirectInstance()->Exists(szFullPath->c_str()); + if (!pakOnDisk && (nFactoryFlags & ZipDir::CacheFactory::FLAGS_READ_ONLY)) { // Archive file not found. - AZ_TracePrintf("Archive", "Cannot open Archive file %s\n", szFullPath->c_str()); + AZ_TracePrintf("Archive", "Archive file %s does not exist\n", szFullPath->c_str()); return nullptr; } @@ -2492,8 +2491,6 @@ namespace AZ::IO void Archive::FindCompressionInfo(bool& found, AZ::IO::CompressionInfo& info, const AZStd::string_view filename) { - constexpr uint32_t s_compressionTag = static_cast('Z') << 24 | static_cast('C') << 16 | static_cast('R') << 8 | static_cast('Y'); - if (!found) { auto correctedFilename = AZ::IO::FileIOBase::GetDirectInstance()->ResolvePath(filename); @@ -2519,7 +2516,6 @@ namespace AZ::IO found = true; info.m_archiveFilename.InitFromRelativePath(archive->GetFilePath()); - info.m_compressionTag.m_code = s_compressionTag; info.m_offset = pFileData->GetFileDataOffset(); info.m_compressedSize = entry->desc.lSizeCompressed; info.m_uncompressedSize = entry->desc.lSizeUncompressed; @@ -2539,9 +2535,8 @@ namespace AZ::IO break; } - info.m_decompressor = [&s_compressionTag]([[maybe_unused]] const AZ::IO::CompressionInfo& info, const void* compressed, size_t compressedSize, void* uncompressed, size_t uncompressedBufferSize)->bool + info.m_decompressor = []([[maybe_unused]] const AZ::IO::CompressionInfo& info, const void* compressed, size_t compressedSize, void* uncompressed, size_t uncompressedBufferSize)->bool { - AZ_Assert(info.m_compressionTag.m_code == s_compressionTag, "Provided compression info isn't supported by this decompressor."); size_t nSizeUncompressed = uncompressedBufferSize; return ZipDir::ZipRawUncompress(uncompressed, &nSizeUncompressed, compressed, compressedSize) == 0; }; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/ArchiveFindData.cpp b/Code/Framework/AzFramework/AzFramework/Archive/ArchiveFindData.cpp index 678f4e40bf..1794ae90e7 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/ArchiveFindData.cpp +++ b/Code/Framework/AzFramework/AzFramework/Archive/ArchiveFindData.cpp @@ -50,6 +50,7 @@ namespace AZ::IO , tWrite{ writeTime } { } + ArchiveFileIterator::ArchiveFileIterator(FindData* findData, AZStd::string_view filename, const FileDesc& fileDesc) : m_findData{ findData } , m_filename{ filename } @@ -108,13 +109,10 @@ namespace AZ::IO AZ::StringFunc::Path::GetFullPath(directory.c_str(), searchDirectory); AZ::StringFunc::Path::GetFullFileName(directory.c_str(), pattern); } - AZ::IO::FileIOBase::GetDirectInstance()->FindFiles(searchDirectory.c_str(), pattern.c_str(), [&](const char* filePath) -> bool { AZ::IO::FileDesc fileDesc; - - AZStd::string fullFilePath; - AZ::StringFunc::Path::GetFullFileName(filePath, fullFilePath); + AZStd::string filePathEntry{filePath}; if (AZ::IO::FileIOBase::GetDirectInstance()->IsDirectory(filePath)) { @@ -135,9 +133,8 @@ namespace AZ::IO fileDesc.tAccess = fileDesc.tWrite; fileDesc.tCreate = fileDesc.tWrite; } - [[maybe_unused]] auto result = m_mapFiles.emplace(AZStd::move(fullFilePath), fileDesc); - AZ_Assert(result.second, "Failed to insert FindData entry for %s", fullFilePath.c_str()); - + [[maybe_unused]] auto result = m_mapFiles.emplace(AZStd::move(filePathEntry), fileDesc); + AZ_Assert(result.second, "Failed to insert FindData entry for filePath %s", filePath); return true; }); } @@ -273,7 +270,9 @@ namespace AZ::IO } auto pakFileIter = m_mapFiles.begin(); - fileIterator.m_filename = pakFileIter->first; + AZStd::string fullFilePath; + AZ::StringFunc::Path::GetFullFileName(pakFileIter->first.c_str(), fullFilePath); + fileIterator.m_filename = AZStd::move(fullFilePath); fileIterator.m_fileDesc = pakFileIter->second; fileIterator.m_lastFetchValid = true; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h index f5de1a0f3a..ce8403b033 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/IArchive.h @@ -115,7 +115,7 @@ namespace AZ::IO // If used, the source path will be treated as the destination path // and no transformations will be done. Pass this flag when the path is to be the actual // path on the disk/in the packs and doesn't need adjustment (or after it has come through adjustments already) - // if this is set, AdjustFileName will not map the input path into the master folder (Ex: Shaders will not be converted to Game\Shaders) + // if this is set, AdjustFileName will not map the input path into the folder (Ex: Shaders will not be converted to Game\Shaders) FLAGS_PATH_REAL = 1 << 16, // AdjustFileName will always copy the file path to the destination path: @@ -318,7 +318,6 @@ namespace AZ::IO virtual ArchiveFileIterator FindFirst(AZStd::string_view pDir, uint32_t nFlags = 0, bool bAllowUseFileSystem = false) = 0; virtual ArchiveFileIterator FindNext(AZ::IO::ArchiveFileIterator handle) = 0; virtual bool FindClose(AZ::IO::ArchiveFileIterator handle) = 0; - // virtual bool IsOutOfDate(const char * szCompiledName, const char * szMasterFile)=0; //returns file modification time virtual IArchive::FileTime GetModificationTime(AZ::IO::HandleType fileHandle) = 0; diff --git a/Code/Framework/AzFramework/AzFramework/Archive/INestedArchive.h b/Code/Framework/AzFramework/AzFramework/Archive/INestedArchive.h index 25d36f009b..29a1030cf0 100644 --- a/Code/Framework/AzFramework/AzFramework/Archive/INestedArchive.h +++ b/Code/Framework/AzFramework/AzFramework/Archive/INestedArchive.h @@ -47,7 +47,7 @@ namespace AZ::IO enum EPakFlags { // support for absolute and other complex path specifications - - // all paths will be treated relatively to the current directory (normally MasterCD) + // all paths will be treated relatively to the current directory FLAGS_ABSOLUTE_PATHS = 1, // if this is set, the object will only understand relative to the zip file paths, diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.cpp b/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.cpp index 020feffc47..7280c4af5c 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.cpp @@ -308,6 +308,56 @@ namespace AzFramework } } + //--------------------------------------------------------------------- + GenerateRelativeSourcePathRequest::GenerateRelativeSourcePathRequest(const AZ::OSString& sourcePath) + { + AZ_Assert(!sourcePath.empty(), "GenerateRelativeSourcePathRequest: asset path is empty"); + m_sourcePath = sourcePath; + } + + unsigned int GenerateRelativeSourcePathRequest::GetMessageType() const + { + return MessageType; + } + + void GenerateRelativeSourcePathRequest::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("SourcePath", &GenerateRelativeSourcePathRequest::m_sourcePath); + } + } + + //--------------------------------------------------------------------- + GenerateRelativeSourcePathResponse::GenerateRelativeSourcePathResponse( + bool resolved, const AZ::OSString& relativeSourcePath, const AZ::OSString& rootFolder) + { + m_relativeSourcePath = relativeSourcePath; + m_resolved = resolved; + m_rootFolder = rootFolder; + } + + unsigned int GenerateRelativeSourcePathResponse::GetMessageType() const + { + return GenerateRelativeSourcePathRequest::MessageType; + } + + void GenerateRelativeSourcePathResponse::Reflect(AZ::ReflectContext* context) + { + auto serialize = azrtti_cast(context); + if (serialize) + { + serialize->Class() + ->Version(1) + ->Field("RelativeSourcePath", &GenerateRelativeSourcePathResponse::m_relativeSourcePath) + ->Field("RootFolder", &GenerateRelativeSourcePathResponse::m_rootFolder) + ->Field("Resolved", &GenerateRelativeSourcePathResponse::m_resolved); + } + } + //--------------------------------------------------------------------- GetFullSourcePathFromRelativeProductPathRequest::GetFullSourcePathFromRelativeProductPathRequest(const AZ::OSString& relativeProductPath) { diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.h b/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.h index 9661e61828..c15f75e3e7 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.h +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetProcessorMessages.h @@ -288,6 +288,45 @@ namespace AzFramework bool m_resolved; }; + ////////////////////////////////////////////////////////////////////////// + class GenerateRelativeSourcePathRequest : public BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(GenerateRelativeSourcePathRequest, AZ::OSAllocator, 0); + AZ_RTTI(GenerateRelativeSourcePathRequest, "{B3865033-F5A3-4749-8147-7B1AB04D5F6D}", + BaseAssetProcessorMessage); + static void Reflect(AZ::ReflectContext* context); + + // For people that are debugging the network messages and just see MessageType as a value, + // the CRC value below is 739777771 (0x2C181CEB) + static constexpr unsigned int MessageType = + AZ_CRC_CE("AssetSystem::GenerateRelativeSourcePathRequest"); + + GenerateRelativeSourcePathRequest() = default; + GenerateRelativeSourcePathRequest(const AZ::OSString& sourcePath); + unsigned int GetMessageType() const override; + + AZ::OSString m_sourcePath; + }; + + class GenerateRelativeSourcePathResponse : public BaseAssetProcessorMessage + { + public: + AZ_CLASS_ALLOCATOR(GenerateRelativeSourcePathResponse, AZ::OSAllocator, 0); + AZ_RTTI(GenerateRelativeSourcePathResponse, "{938D33DB-C8F6-4FA4-BC81-2F139A9BE1D7}", + BaseAssetProcessorMessage); + static void Reflect(AZ::ReflectContext* context); + + GenerateRelativeSourcePathResponse() = default; + GenerateRelativeSourcePathResponse( + bool resolved, const AZ::OSString& relativeSourcePath, const AZ::OSString& rootFolder); + unsigned int GetMessageType() const override; + + AZ::OSString m_relativeSourcePath; + AZ::OSString m_rootFolder; ///< This is the folder it was found in (the watched/scanned folder, such as gems /assets/ folder) + bool m_resolved; + }; + ////////////////////////////////////////////////////////////////////////// class GetFullSourcePathFromRelativeProductPathRequest : public BaseAssetProcessorMessage diff --git a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp index 83c4907468..6b19084c2a 100644 --- a/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Asset/AssetSystemComponent.cpp @@ -202,6 +202,7 @@ namespace AzFramework // Requests GetUnresolvedDependencyCountsRequest::Reflect(context); GetRelativeProductPathFromFullSourceOrProductPathRequest::Reflect(context); + GenerateRelativeSourcePathRequest::Reflect(context); GetFullSourcePathFromRelativeProductPathRequest::Reflect(context); SourceAssetInfoRequest::Reflect(context); AssetInfoRequest::Reflect(context); @@ -234,6 +235,7 @@ namespace AzFramework // Responses GetUnresolvedDependencyCountsResponse::Reflect(context); GetRelativeProductPathFromFullSourceOrProductPathResponse::Reflect(context); + GenerateRelativeSourcePathResponse::Reflect(context); GetFullSourcePathFromRelativeProductPathResponse::Reflect(context); SourceAssetInfoResponse::Reflect(context); AssetInfoResponse::Reflect(context); diff --git a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.h b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.h index 682e886061..ee8b79bf06 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.h +++ b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.h @@ -1,22 +1,22 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #pragma once #include #include -#include #include #include +#include namespace AzFramework { @@ -64,15 +64,13 @@ namespace AzFramework the EditContext. TController can friend itself to the editor component to make this work if required. */ template - class ComponentAdapter - : public AZ::Component + class ComponentAdapter : public AZ::Component { public: - AZ_RTTI((ComponentAdapter, "{644A9187-4FDB-42C1-9D59-DD75304B551A}", TController, TConfiguration), AZ::Component); ComponentAdapter() = default; - ComponentAdapter(const TConfiguration& configuration); + explicit ComponentAdapter(const TConfiguration& configuration); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services); static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services); @@ -85,7 +83,6 @@ namespace AzFramework void Deactivate() override; protected: - static void Reflect(AZ::ReflectContext* context); // AZ::Component overrides ... diff --git a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.inl b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.inl index a1b0826193..5c36ff0bf7 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.inl +++ b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapter.inl @@ -1,14 +1,14 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #include @@ -32,10 +32,12 @@ namespace AzFramework if (auto serializeContext = azrtti_cast(context)) { + // clang-format off serializeContext->Class() ->Version(1) ->Field("Controller", &ComponentAdapter::m_controller) ; + // clang-format on } } @@ -66,9 +68,6 @@ namespace AzFramework GetDependentServicesHelper(services, typename AZ::HasComponentDependentServices::type()); } - ////////////////////////////////////////////////////////////////////////// - // AZ::Component interface implementation - template void ComponentAdapter::Init() { @@ -78,7 +77,7 @@ namespace AzFramework template void ComponentAdapter::Activate() { - m_controller.Activate(GetEntityId()); + ComponentActivateHelper::Activate(m_controller, AZ::EntityComponentIdPair(GetEntityId(), GetId())); } template diff --git a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapterHelpers.h b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapterHelpers.h index 158ee95f39..f0ef262a71 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapterHelpers.h +++ b/Code/Framework/AzFramework/AzFramework/Components/ComponentAdapterHelpers.h @@ -13,6 +13,7 @@ #pragma once #include +#include namespace AzFramework { @@ -27,18 +28,43 @@ namespace AzFramework template struct ComponentInitHelper { - static void Init(T& common) + static void Init([[maybe_unused]] T& controller) { - AZ_UNUSED(common); } }; template struct ComponentInitHelper().Init())>> { - static void Init(T& common) + static void Init(T& controller) { - common.Init(); + controller.Init(); + } + }; + + template + struct ComponentActivateHelper + { + static void Activate([[maybe_unused]] T& controller, [[maybe_unused]] const AZ::EntityComponentIdPair& entityComponentIdPair) + { + } + }; + + template + struct ComponentActivateHelper().Activate(AZ::EntityId()))>> + { + static void Activate(T& controller, const AZ::EntityComponentIdPair& entityComponentIdPair) + { + controller.Activate(entityComponentIdPair.GetEntityId()); + } + }; + + template + struct ComponentActivateHelper().Activate(AZ::EntityComponentIdPair()))>> + { + static void Activate(T& controller, const AZ::EntityComponentIdPair& entityComponentIdPair) + { + controller.Activate(entityComponentIdPair); } }; diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp index 9083cb7d0d..b3c4f1b256 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.cpp @@ -327,99 +327,13 @@ namespace AzFramework return localZ; } - void TransformComponent::SetRotation(const AZ::Vector3& eulerAnglesRadian) + void TransformComponent::SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) { - AZ_Warning("TransformComponent", false, "SetRotation is deprecated, please use SetLocalRotation"); - - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(eulerAnglesRadian)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationQuaternion(const AZ::Quaternion& quaternion) - { - AZ_Warning("TransformComponent", false, "SetRotationQuaternion is deprecated, please use SetLocalRotationQuaternion"); - AZ::Transform newWorldTransform = m_worldTM; newWorldTransform.SetRotation(quaternion); SetWorldTM(newWorldTransform); } - void TransformComponent::SetRotationX(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "SetRotationX is deprecated, please use SetLocalRotation"); - - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationX(eulerAngleRadian)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationY(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "SetRotationY is deprecated, please use SetLocalRotation"); - - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationY(eulerAngleRadian)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationZ(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "SetRotationZ is deprecated, please use SetLocalRotation"); - - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationZ(eulerAngleRadian)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::RotateByX(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "RotateByX is deprecated, please use RotateAroundLocalX"); - RotateAroundLocalX(eulerAngleRadian); - } - - void TransformComponent::RotateByY(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "RotateByY is deprecated, please use RotateAroundLocalY"); - RotateAroundLocalY(eulerAngleRadian); - } - - void TransformComponent::RotateByZ(float eulerAngleRadian) - { - AZ_Warning("TransformComponent", false, "RotateByZ is deprecated, please use RotateAroundLocalZ"); - RotateAroundLocalZ(eulerAngleRadian); - } - - AZ::Vector3 TransformComponent::GetRotationEulerRadians() - { - AZ_Warning("TransformComponent", false, "GetRotationEulerRadians is deprecated, please use GetWorldRotation"); - return m_worldTM.GetRotation().GetEulerRadians(); - } - - AZ::Quaternion TransformComponent::GetRotationQuaternion() - { - AZ_Warning("TransformComponent", false, "GetRotationQuaternion is deprecated, please use GetWorldRotationQuaternion"); - return m_worldTM.GetRotation(); - } - - float TransformComponent::GetRotationX() - { - AZ_Warning("TransformComponent", false, "GetRotationX is deprecated, please use GetWorldRotation"); - return GetRotationEulerRadians().GetX(); - } - - float TransformComponent::GetRotationY() - { - AZ_Warning("TransformComponent", false, "GetRotationY is deprecated, please use GetWorldRotation"); - return GetRotationEulerRadians().GetY(); - } - - float TransformComponent::GetRotationZ() - { - AZ_Warning("TransformComponent", false, "GetRotationZ is deprecated, please use GetWorldRotation"); - return GetRotationEulerRadians().GetZ(); - } - AZ::Vector3 TransformComponent::GetWorldRotation() { return m_worldTM.GetRotation().GetEulerRadians(); @@ -432,46 +346,26 @@ namespace AzFramework void TransformComponent::SetLocalRotation(const AZ::Vector3& eulerRadianAngles) { - AZ::Transform newLocalTM = AZ::ConvertEulerRadiansToTransform(eulerRadianAngles); - newLocalTM.SetScale(m_localTM.GetScale()); - newLocalTM.SetTranslation(m_localTM.GetTranslation()); + AZ::Transform newLocalTM = m_localTM; + newLocalTM.SetRotation(AZ::Quaternion::CreateFromEulerAnglesRadians(eulerRadianAngles)); SetLocalTM(newLocalTM); } void TransformComponent::SetLocalRotationQuaternion(const AZ::Quaternion& quaternion) { - AZ::Transform newLocalTM; - newLocalTM.SetScale(m_localTM.GetScale()); - newLocalTM.SetTranslation(m_localTM.GetTranslation()); + AZ::Transform newLocalTM = m_localTM; newLocalTM.SetRotation(quaternion); SetLocalTM(newLocalTM); } static AZ::Transform RotateAroundLocalHelper(float eulerAngleRadian, const AZ::Transform& localTM, AZ::Vector3 axis) { - //get the existing translation and scale - AZ::Vector3 translation = localTM.GetTranslation(); - AZ::Vector3 scale = localTM.GetScale(); - //normalize the axis before creating rotation axis.Normalize(); AZ::Quaternion rotate = AZ::Quaternion::CreateFromAxisAngle(axis, eulerAngleRadian); - //create new rotation transform - AZ::Quaternion currentRotate = localTM.GetRotation(); - AZ::Quaternion newRotate = rotate * currentRotate; - newRotate.Normalize(); - - //scale - AZ::Transform newLocalTM = AZ::Transform::CreateScale(scale); - - //rotate - AZ::Transform rotateLocalTM = AZ::Transform::CreateFromQuaternion(newRotate); - newLocalTM = rotateLocalTM * newLocalTM; - - //translate - newLocalTM.SetTranslation(translation); - + AZ::Transform newLocalTM = localTM; + newLocalTM.SetRotation((rotate * localTM.GetRotation()).GetNormalized()); return newLocalTM; } @@ -512,117 +406,27 @@ namespace AzFramework return m_localTM.GetRotation(); } - void TransformComponent::SetScale(const AZ::Vector3& scale) - { - AZ_Warning("TransformComponent", false, "SetScale is deprecated, please use SetLocalScale"); - - if (!m_worldTM.GetScale().IsClose(scale)) - { - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetScale(scale); - SetWorldTM(newWorldTransform); - } - } - - void TransformComponent::SetScaleX(float scaleX) - { - AZ_Warning("TransformComponent", false, "SetScaleX is deprecated, please use SetLocalScaleX"); - - AZ::Vector3 newScale = m_worldTM.GetScale(); - newScale.SetX(scaleX); - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetScale(newScale); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetScaleY(float scaleY) - { - AZ_Warning("TransformComponent", false, "SetScaleY is deprecated, please use SetLocalScaleY"); - - AZ::Vector3 newScale = m_worldTM.GetScale(); - newScale.SetY(scaleY); - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetScale(newScale); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetScaleZ(float scaleZ) - { - AZ_Warning("TransformComponent", false, "SetScaleZ is deprecated, please use SetLocalScaleZ"); - - AZ::Vector3 newScale = m_worldTM.GetScale(); - newScale.SetZ(scaleZ); - AZ::Transform newWorldTransform = m_worldTM; - newWorldTransform.SetScale(newScale); - SetWorldTM(newWorldTransform); - } - - AZ::Vector3 TransformComponent::GetScale() - { - AZ_Warning("TransformComponent", false, "GetScale is deprecated, please use GetLocalScale"); - return m_worldTM.GetScale(); - } - - float TransformComponent::GetScaleX() - { - AZ_Warning("TransformComponent", false, "GetScaleX is deprecated, please use GetLocalScale"); - return m_worldTM.GetScale().GetX(); - } - - float TransformComponent::GetScaleY() - { - AZ_Warning("TransformComponent", false, "GetScaleY is deprecated, please use GetLocalScale"); - return m_worldTM.GetScale().GetY(); - } - - float TransformComponent::GetScaleZ() - { - AZ_Warning("TransformComponent", false, "GetScaleZ is deprecated, please use GetLocalScale"); - return m_worldTM.GetScale().GetZ(); - } - - void TransformComponent::SetLocalScale(const AZ::Vector3& scale) - { - AZ::Transform newLocalTM = m_localTM; - newLocalTM.SetScale(scale); - SetLocalTM(newLocalTM); - } - - void TransformComponent::SetLocalScaleX(float scaleX) - { - AZ::Transform newLocalTM = m_localTM; - AZ::Vector3 newScale = newLocalTM.GetScale(); - newScale.SetX(scaleX); - newLocalTM.SetScale(newScale); - SetLocalTM(newLocalTM); - } - - void TransformComponent::SetLocalScaleY(float scaleY) - { - AZ::Transform newLocalTM = m_localTM; - AZ::Vector3 newScale = newLocalTM.GetScale(); - newScale.SetY(scaleY); - newLocalTM.SetScale(newScale); - SetLocalTM(newLocalTM); - } - - void TransformComponent::SetLocalScaleZ(float scaleZ) - { - AZ::Transform newLocalTM = m_localTM; - AZ::Vector3 newScale = newLocalTM.GetScale(); - newScale.SetZ(scaleZ); - newLocalTM.SetScale(newScale); - SetLocalTM(newLocalTM); - } - AZ::Vector3 TransformComponent::GetLocalScale() { - return m_localTM.GetScale(); + AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead"); + return AZ::Vector3(m_localTM.GetUniformScale()); } - AZ::Vector3 TransformComponent::GetWorldScale() + void TransformComponent::SetLocalUniformScale(float scale) { - return m_worldTM.GetScale(); + AZ::Transform newLocalTM = m_localTM; + newLocalTM.SetUniformScale(scale); + SetLocalTM(newLocalTM); + } + + float TransformComponent::GetLocalUniformScale() + { + return m_localTM.GetUniformScale(); + } + + float TransformComponent::GetWorldUniformScale() + { + return m_worldTM.GetUniformScale(); } AZStd::vector TransformComponent::GetChildren() @@ -929,45 +733,7 @@ namespace AzFramework ->Event("GetLocalX", &AZ::TransformBus::Events::GetLocalX) ->Event("GetLocalY", &AZ::TransformBus::Events::GetLocalY) ->Event("GetLocalZ", &AZ::TransformBus::Events::GetLocalZ) - ->Event("RotateByX", &AZ::TransformBus::Events::RotateByX) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("RotateByY", &AZ::TransformBus::Events::RotateByY) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("RotateByZ", &AZ::TransformBus::Events::RotateByZ) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetEulerRotation", &AZ::TransformBus::Events::SetRotation) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetRotationQuaternion", &AZ::TransformBus::Events::SetRotationQuaternion) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetRotationX", &AZ::TransformBus::Events::SetRotationX) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetRotationY", &AZ::TransformBus::Events::SetRotationY) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetRotationZ", &AZ::TransformBus::Events::SetRotationZ) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetEulerRotation", &AZ::TransformBus::Events::GetRotationEulerRadians) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetRotationQuaternion", &AZ::TransformBus::Events::GetRotationQuaternion) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetRotationX", &AZ::TransformBus::Events::GetRotationX) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetRotationY", &AZ::TransformBus::Events::GetRotationY) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetRotationZ", &AZ::TransformBus::Events::GetRotationZ) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) + ->Event("SetWorldRotationQuaternion", &AZ::TransformBus::Events::SetWorldRotationQuaternion) ->Event("GetWorldRotation", &AZ::TransformBus::Events::GetWorldRotation) ->Event("GetWorldRotationQuaternion", &AZ::TransformBus::Events::GetWorldRotationQuaternion) ->Event("SetLocalRotation", &AZ::TransformBus::Events::SetLocalRotation) @@ -979,38 +745,11 @@ namespace AzFramework ->Event("GetLocalRotationQuaternion", &AZ::TransformBus::Events::GetLocalRotationQuaternion) ->Attribute("Rotation", AZ::Edit::Attributes::PropertyRotation) ->VirtualProperty("Rotation", "GetLocalRotationQuaternion", "SetLocalRotationQuaternion") - ->Event("SetScale", &AZ::TransformBus::Events::SetScale) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetScaleX", &AZ::TransformBus::Events::SetScaleX) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetScaleY", &AZ::TransformBus::Events::SetScaleY) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetScaleZ", &AZ::TransformBus::Events::SetScaleZ) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetScale", &AZ::TransformBus::Events::GetScale) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetScaleX", &AZ::TransformBus::Events::GetScaleX) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetScaleY", &AZ::TransformBus::Events::GetScaleY) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("GetScaleZ", &AZ::TransformBus::Events::GetScaleZ) - ->Attribute(AZ::Script::Attributes::Deprecated, true) - ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All) - ->Event("SetLocalScale", &AZ::TransformBus::Events::SetLocalScale) - ->Event("SetLocalScaleX", &AZ::TransformBus::Events::SetLocalScaleX) - ->Event("SetLocalScaleY", &AZ::TransformBus::Events::SetLocalScaleY) - ->Event("SetLocalScaleZ", &AZ::TransformBus::Events::SetLocalScaleZ) ->Event("GetLocalScale", &AZ::TransformBus::Events::GetLocalScale) ->Attribute("Scale", AZ::Edit::Attributes::PropertyScale) - ->VirtualProperty("Scale", "GetLocalScale", "SetLocalScale") - ->Event("GetWorldScale", &AZ::TransformBus::Events::GetWorldScale) + ->Event("SetLocalUniformScale", &AZ::TransformBus::Events::SetLocalUniformScale) + ->Event("GetLocalUniformScale", &AZ::TransformBus::Events::GetLocalUniformScale) + ->VirtualProperty("Uniform Scale", "GetLocalUniformScale", "SetLocalUniformScale") ->Event("GetChildren", &AZ::TransformBus::Events::GetChildren) ->Event("GetAllDescendants", &AZ::TransformBus::Events::GetAllDescendants) ->Event("GetEntityAndAllDescendants", &AZ::TransformBus::Events::GetEntityAndAllDescendants) diff --git a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h index 0dd53d84ed..0301334a0d 100644 --- a/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h +++ b/Code/Framework/AzFramework/AzFramework/Components/TransformComponent.h @@ -112,22 +112,7 @@ namespace AzFramework float GetLocalZ() override; // Rotation modifiers - void SetRotation(const AZ::Vector3& eulerAnglesRadian) override; - void SetRotationQuaternion(const AZ::Quaternion& quaternion) override; - void SetRotationX(float eulerAngleRadian) override; - void SetRotationY(float eulerAngleRadian) override; - void SetRotationZ(float eulerAngleRadian) override; - - void RotateByX(float eulerAngleRadian) override; - void RotateByY(float eulerAngleRadian) override; - void RotateByZ(float eulerAngleRadian) override; - - AZ::Vector3 GetRotationEulerRadians() override; - AZ::Quaternion GetRotationQuaternion() override; - - float GetRotationX() override; - float GetRotationY() override; - float GetRotationZ() override; + void SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) override; AZ::Vector3 GetWorldRotation() override; AZ::Quaternion GetWorldRotationQuaternion() override; @@ -143,23 +128,11 @@ namespace AzFramework AZ::Quaternion GetLocalRotationQuaternion() override; // Scale Modifiers - void SetScale(const AZ::Vector3& scale) override; - void SetScaleX(float scaleX) override; - void SetScaleY(float scaleY) override; - void SetScaleZ(float scaleZ) override; - - AZ::Vector3 GetScale() override; - float GetScaleX() override; - float GetScaleY() override; - float GetScaleZ() override; - - void SetLocalScale(const AZ::Vector3& scale) override; - void SetLocalScaleX(float scaleX) override; - void SetLocalScaleY(float scaleY) override; - void SetLocalScaleZ(float scaleZ) override; - AZ::Vector3 GetLocalScale() override; - AZ::Vector3 GetWorldScale() override; + + void SetLocalUniformScale(float scale) override; + float GetLocalUniformScale() override; + float GetWorldUniformScale() override; // Transform hierarchy AZStd::vector GetChildren() override; diff --git a/Code/Framework/AzFramework/AzFramework/Entity/EntityDebugDisplayBus.h b/Code/Framework/AzFramework/AzFramework/Entity/EntityDebugDisplayBus.h index fb6b8d7d72..c3a60f7ec3 100644 --- a/Code/Framework/AzFramework/AzFramework/Entity/EntityDebugDisplayBus.h +++ b/Code/Framework/AzFramework/AzFramework/Entity/EntityDebugDisplayBus.h @@ -60,6 +60,7 @@ namespace AzFramework virtual void DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const AZ::Color& color) { (void)vertices; (void)indices, (void)color; } virtual void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) { (void)min; (void)max; } virtual void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) { (void)min; (void)max; } + virtual void DrawWireOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) { (void)center; (void)axisX; (void)axisY; (void)axisZ; (void)halfExtents; } virtual void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) { (void)center; (void)axisX; (void)axisY; (void)axisZ; (void)halfExtents; } virtual void DrawPoint(const AZ::Vector3& p, int nSize = 1) { (void)p; (void)nSize; } virtual void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) { (void)p1; (void)p2; } @@ -70,18 +71,15 @@ namespace AzFramework virtual void DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) { (void)p1; (void)p2; (void)z; } virtual void DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) { (void)p1; (void)p2; (void)z; (void)firstColor; (void)secondColor; } virtual void DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) { (void)center; (void)radius; (void)z; } - virtual void DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) { (void)worldPos; (void)radius; (void)height; } - virtual void DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) { (void)center; (void)radius; (void)angle1; (void)angle2; (void)height; } virtual void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis = 2) { (void)pos; (void)radius; (void)startAngleDegrees; (void)sweepAngleDegrees; (void)angularStepDegrees; (void)referenceAxis; } virtual void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) { (void)pos; (void)radius; (void)startAngleDegrees; (void)sweepAngleDegrees; (void)angularStepDegrees; (void)fixedAxis; } virtual void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis = 2 /*z axis*/) { (void)pos; (void)radius; (void)nUnchangedAxis; } virtual void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis = 2 /*z axis*/) { (void)pos; (void)radius; (void)viewPos; (void)nUnchangedAxis; } - virtual void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) { (void)pos; (void)dir; (void)radius; (void)height; (void)drawShaded; } + virtual void DrawWireCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height) { (void)pos; (void)dir; (void)radius; (void)height; } + virtual void DrawSolidCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) { (void)pos; (void)dir; (void)radius; (void)height; (void)drawShaded; } virtual void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) { (void)center; (void)axis; (void)radius; (void)height; } virtual void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded = true) { (void)center; (void)axis; (void)radius; (void)height; (void)drawShaded; } virtual void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float heightStraightSection) { (void)center; (void)axis; (void)radius; (void)heightStraightSection; } - virtual void DrawTerrainRect(float x1, float y1, float x2, float y2, float height) { (void)x1; (void)y1; (void)x2; (void)y2; (void)height; } - virtual void DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) { (void)worldPos1; (void)worldPos2; } virtual void DrawWireSphere(const AZ::Vector3& pos, float radius) { (void)pos; (void)radius; } virtual void DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) { (void)pos; (void)radius; } virtual void DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) { (void)pos; (void)dir; (void)radius; } @@ -91,11 +89,8 @@ namespace AzFramework virtual void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter = false, int srcOffsetX = 0, int srcOffsetY = 0) { (void)pos; (void)size; (void)text; (void)bCenter; (void)srcOffsetX; (void)srcOffsetY; } virtual void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter = false) { (void)x; (void)y; (void)size; (void)text; (void)bCenter; } virtual void DrawTextOn2DBox(const AZ::Vector3& pos, const char* text, float textScale, const AZ::Vector4& TextColor, const AZ::Vector4& TextBackColor) { (void)pos; (void)text; (void)textScale; (void)TextColor; (void)TextBackColor; } - virtual void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) { (void)texture; (void)pos; (void)sizeX; (void)sizeY; (void)texIconFlags; } - virtual void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) { (void)textureId; (void)pos; (void)sizeX; (void)sizeY; (void)texIconFlags; } virtual void SetLineWidth(float width) { (void)width; } virtual bool IsVisible(const AZ::Aabb& bounds) { (void)bounds; return false; } - virtual int SetFillMode(int nFillMode) { (void)nFillMode; return 0; } virtual float GetLineWidth() { return 0.0f; } virtual float GetAspectRatio() { return 0.0f; } virtual void DepthTestOff() {} diff --git a/Code/Framework/AzFramework/AzFramework/Font/FontInterface.h b/Code/Framework/AzFramework/AzFramework/Font/FontInterface.h index b64b61e22c..04a0572bb9 100644 --- a/Code/Framework/AzFramework/AzFramework/Font/FontInterface.h +++ b/Code/Framework/AzFramework/AzFramework/Font/FontInterface.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -42,11 +43,15 @@ namespace AzFramework { ViewportId m_drawViewportId = InvalidViewportId; //!< Viewport to draw into AZ::Vector3 m_position; //!< world space position for 3d draws, screen space x,y,depth for 2d. - AZ::Color m_color = AZ::Colors::White; //!< Color to draw the text + AZ::Color m_color = AZ::Colors::White; //!< Color to draw the text + unsigned int m_effectIndex = 0; //!< effect index to apply AZ::Vector2 m_scale = AZ::Vector2(1.0f); //!< font scale - float m_lineSpacing; //!< Spacing between new lines, as a percentage of m_scale. + float m_textSizeFactor = 12.0f; //!< font size in pixels + float m_lineSpacing = 1.0f; //!< Spacing between new lines, as a percentage of m_scale. TextHorizontalAlignment m_hAlign = TextHorizontalAlignment::Left; //!< Horizontal text alignment TextVerticalAlignment m_vAlign = TextVerticalAlignment::Top; //!< Vertical text alignment + bool m_useTransform = false; //!< Use specified transform + AZ::Matrix3x4 m_transform = AZ::Matrix3x4::Identity(); //!< Transform to apply to text quads bool m_monospace = false; //!< disable character proportional spacing bool m_depthTest = false; //!< Test character against the depth buffer bool m_virtual800x600ScreenSize = true; //!< Text placement and size are scaled relative to a virtual 800x600 resolution diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Character.h b/Code/Framework/AzFramework/AzFramework/Physics/Character.h index 19a6cbfe03..2401c9c5b9 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Character.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Character.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -36,7 +37,7 @@ namespace Physics static void Reflect(AZ::ReflectContext* context); AZStd::string m_name; - ShapeConfigurationList m_shapes; + AzPhysics::ShapeColliderPairList m_shapes; }; class CharacterColliderConfiguration diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp b/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp index eb74390638..4f206858af 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/ClassConverters.cpp @@ -57,7 +57,7 @@ namespace Physics classElement.RemoveElement(shapesIndex); // add a new vector in the new format - const int newShapesIndex = classElement.AddElement(context, "shapes"); + const int newShapesIndex = classElement.AddElement(context, "shapes"); if (newShapesIndex != -1) { AZ::SerializeContext::DataElementNode& newShapesElement = classElement.GetSubElement(newShapesIndex); @@ -65,7 +65,9 @@ namespace Physics // convert the old shapes into the new format and add to the vector for (AZ::SerializeContext::DataElementNode shape : shapesCopy) { - const int pairIndex = newShapesElement.AddElementWithData(context, "element", ShapeConfigurationPair()); + const int pairIndex = newShapesElement.AddElementWithData( + context, "element", AzPhysics::ShapeColliderPair()); + AZ::SerializeContext::DataElementNode& pairElement = newShapesElement.GetSubElement(pairIndex); ColliderConfiguration colliderConfig; @@ -131,8 +133,8 @@ namespace Physics AZ::SerializeContext::DataElementNode* baseBaseClass1 = baseClass1->FindSubElement(AZ_CRC("BaseClass1", 0xd4925735)); if (baseBaseClass1 && baseBaseClass1->FindSubElementAndGetData(AZ_CRC("name", 0x5e237e06), name)) { - ShapeConfigurationList shapes; - if (nodeElement.FindSubElementAndGetData(AZ_CRC("shapes", 0x93dba512), shapes)) + AzPhysics::ShapeColliderPairList shapes; + if (nodeElement.FindSubElementAndGetData(AZ_CRC("shapes", 0x93dba512), shapes)) { CharacterColliderNodeConfiguration newColliderNodeConfig; newColliderNodeConfig.m_name = name; @@ -257,11 +259,18 @@ namespace Physics if (success) { - success = success && dataElement.RemoveElementByName(AZ_CRC("MaterialId", 0x9360e002)); + dataElement.RemoveElementByName(AZ_CRC("MaterialId", 0x9360e002)); + success = success && (dataElement.FindElement(AZ_CRC("MaterialId", 0x9360e002)) < 0); success = success && dataElement.AddElementWithData(context, "MaterialIds", AZStd::vector { materialId }); } } + if (success && dataElement.GetVersion() <= 2) + { + dataElement.RemoveElementByName(AZ_CRC_CE("Material")); + success = success && (dataElement.FindElement(AZ_CRC_CE("Material")) < 0); + } + return success; } } // namespace ClassConverters diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h index d5a82c0367..a3a34dc1df 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsEvents.h @@ -58,9 +58,18 @@ namespace AzPhysics //! When triggered will send the handle to the old Scene (after this call, the Handle will be invalid). using OnSceneRemovedEvent = AZ::Event; - //! Event that triggers when the default material library changes. + //! Event that triggers when the material library changes. //! When triggered the event will send the Asset Id of the new material library. - using OnDefaultMaterialLibraryChangedEvent = AZ::Event; + using OnMaterialLibraryChangedEvent = AZ::Event; + + enum class MaterialLibraryLoadErrorType : uint8_t + { + InvalidId, + ErrorLoading + }; + + //! Event that triggers when the default material library has loaded with errors. + using OnMaterialLibraryLoadErrorEvent = AZ::Event; //! Event that triggers when the default scene configuration changes. //! When triggered the event will send the new default scene configuration. diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.h index ed8a68dc24..9d45a17edc 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsSimulatedBody.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,22 @@ namespace AzPhysics return m_customUserData; } + //! Helper functions for setting frame ID. + //! @param frameId Optionally set frame ID for the systems moving the actors back in time. + void SetFrameId(uint32_t frameId) + { + m_frameId = frameId; + } + + //! Helper functions for getting the set frame ID. + //! @return Will return the frame ID. + uint32_t GetFrameId() const + { + return m_frameId; + } + + static constexpr uint32_t UndefinedFrameId = AZStd::numeric_limits::max(); + //! Perform a ray cast on this Simulated Body. //! @param request The request to make. //! @return Returns the closest hit, if any, against this simulated body. @@ -126,6 +143,7 @@ namespace AzPhysics SimulatedBodyEvents::OnTriggerExit m_triggerExitEvent; void* m_customUserData = nullptr; + uint32_t m_frameId = UndefinedFrameId; // helpers for reflecting to behavior context SimulatedBodyEvents::OnCollisionBegin* GetOnCollisionBeginEvent(); diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsTypes.h b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsTypes.h index 5158da275e..b2b5fd1511 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsTypes.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Common/PhysicsTypes.h @@ -70,7 +70,10 @@ namespace AzPhysics using SimulatedBodyHandleList = AZStd::vector; //! Helper used for pairing the ShapeConfiguration and ColliderConfiguration together which is used when creating a Simulated Body. - using ShapeColliderPair = AZStd::pair; + using ShapeColliderPair = AZStd::pair< + AZStd::shared_ptr, + AZStd::shared_ptr>; + using ShapeColliderPairList = AZStd::vector; //! Flags used to specifying which properties of a body to compute. enum class MassComputeFlags : AZ::u8 diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp index 01bff3ccbb..4aea643c6c 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.cpp @@ -30,6 +30,16 @@ namespace AzPhysics classElement.AddElementWithData(context, "name", name); return true; } + + bool SimulatedBodyVersionConverter([[maybe_unused]] AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) + { + if (classElement.GetVersion() <= 1) + { + classElement.RemoveElementByName(AZ_CRC_CE("scale")); + } + + return true; + } } AZ_CLASS_ALLOCATOR_IMPL(SimulatedBodyConfiguration, AZ::SystemAllocator, 0); @@ -40,11 +50,10 @@ namespace AzPhysics { serializeContext->ClassDeprecate("WorldBodyConfiguration", "{6EEB377C-DC60-4E10-AF12-9626C0763B2D}", &Internal::DeprecateWorldBodyConfiguration); serializeContext->Class() - ->Version(1) + ->Version(2, &Internal::SimulatedBodyVersionConverter) ->Field("name", &SimulatedBodyConfiguration::m_debugName) ->Field("position", &SimulatedBodyConfiguration::m_position) ->Field("orientation", &SimulatedBodyConfiguration::m_orientation) - ->Field("scale", &SimulatedBodyConfiguration::m_scale) ->Field("entityId", &SimulatedBodyConfiguration::m_entityId) ->Field("startSimulationEnabled", &SimulatedBodyConfiguration::m_startSimulationEnabled) ; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.h index 6862bfccb8..5ac920ab9d 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SimulatedBodyConfiguration.h @@ -38,7 +38,6 @@ namespace AzPhysics // Basic initial settings. AZ::Vector3 m_position = AZ::Vector3::CreateZero(); AZ::Quaternion m_orientation = AZ::Quaternion::CreateIdentity(); - AZ::Vector3 m_scale = AZ::Vector3::CreateOne(); bool m_startSimulationEnabled = true; // Entity/object association. diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp index 497d67bef1..d7532cbfea 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.cpp @@ -21,7 +21,7 @@ namespace AzPhysics namespace { const float TimestepMin = 0.001f; //1000fps - const float TimestepMax = 0.05f; //20fps + const float TimestepMax = 0.1f; //10fps } AZ_CLASS_ALLOCATOR_IMPL(SystemConfiguration, AZ::SystemAllocator, 0); @@ -39,6 +39,8 @@ namespace AzPhysics ->Field("ShapecastBufferSize", &SystemConfiguration::m_shapecastBufferSize) ->Field("OverlapBufferSize", &SystemConfiguration::m_overlapBufferSize) ->Field("CollisionConfig", &SystemConfiguration::m_collisionConfig) + ->Field("DefaultMaterial", &SystemConfiguration::m_defaultMaterialConfiguration) + ->Field("MaterialLibrary", &SystemConfiguration::m_materialLibraryAsset) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -79,7 +81,9 @@ namespace AzPhysics m_overlapBufferSize == other.m_overlapBufferSize && AZ::IsClose(m_maxTimestep, other.m_maxTimestep) && AZ::IsClose(m_fixedTimestep, other.m_fixedTimestep) && - m_collisionConfig == other.m_collisionConfig + m_collisionConfig == other.m_collisionConfig && + m_defaultMaterialConfiguration == other.m_defaultMaterialConfiguration && + m_materialLibraryAsset == other.m_materialLibraryAsset ; } diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h index 3de4dafd8c..56fe9a68c4 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Configuration/SystemConfiguration.h @@ -13,6 +13,7 @@ #include #include +#include namespace AZ { @@ -34,7 +35,7 @@ namespace AzPhysics static constexpr float DefaultFixedTimestep = 0.0166667f; //! Value represents 1/60th or 60 FPS. - float m_maxTimestep = 1.f / 20.f; //!< Maximum fixed timestep in seconds to run the physics update. + float m_maxTimestep = 0.1f; //!< Maximum fixed timestep in seconds to run the physics update (10FPS). float m_fixedTimestep = DefaultFixedTimestep; //!< Timestep in seconds to run the physics update. See DefaultFixedTimestep. AZ::u64 m_raycastBufferSize = 32; //!< Maximum number of hits that will be returned from a raycast. @@ -45,6 +46,9 @@ namespace AzPhysics //! Each Physics Scene uses this as a base and will override as needed. CollisionConfiguration m_collisionConfig; + Physics::MaterialConfiguration m_defaultMaterialConfiguration; //!< Default material parameters for the project. + AZ::Data::Asset m_materialLibraryAsset = AZ::Data::AssetLoadBehavior::NoLoad; //!< Material Library exposed by the system component SystemBus API. + //! Controls whether the Physics System will self register to the TickBus and call StartSimulation / FinishSimulation on each Scene. //! Disable this to manually control Physics Scene simulation logic. bool m_autoManageSimulationUpdate = true; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp index 5552cef448..78e0431753 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.cpp @@ -49,10 +49,7 @@ namespace Physics { materialSelection->SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); } - if (materialSelection->IsDefaultMaterialLibraryAsset()) - { - materialSelection->SyncSelectionToMaterialLibrary(); - } + materialSelection->SyncSelectionToMaterialLibrary(); } }; @@ -122,6 +119,24 @@ namespace Physics } } + bool MaterialConfiguration::operator==(const MaterialConfiguration& other) const + { + return m_surfaceType == other.m_surfaceType && + AZ::IsClose(m_dynamicFriction, other.m_dynamicFriction) && + AZ::IsClose(m_staticFriction, other.m_staticFriction) && + AZ::IsClose(m_restitution, other.m_restitution) && + AZ::IsClose(m_density, other.m_density) && + m_restitutionCombine == other.m_restitutionCombine && + m_frictionCombine == other.m_frictionCombine && + m_debugColor == other.m_debugColor + ; + } + + bool MaterialConfiguration::operator!=(const MaterialConfiguration& other) const + { + return !(*this == other); + } + AZ::Color MaterialConfiguration::GenerateDebugColor(const char* materialName) { static const AZ::Color colors[] = @@ -191,51 +206,25 @@ namespace Physics ////////////////////////////////////////////////////////////////////////// - void MaterialLibraryAssetReflectionWrapper::Reflect(AZ::ReflectContext* context) - { - AZ::SerializeContext* serializeContext = azrtti_cast(context); - if (serializeContext) - { - serializeContext->Class() - ->Version(1) - ->Field("Asset", &MaterialLibraryAssetReflectionWrapper::m_asset) - ; - - AZ::EditContext* editContext = serializeContext->GetEditContext(); - if (editContext) - { - editContext->Class("", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialLibraryAssetReflectionWrapper::m_asset, "Physics Material Library", "Physics Material Library") - ->Attribute("EditButton", "") - ; - } - } - } - - ////////////////////////////////////////////////////////////////////////// - - - void DefaultMaterialLibraryAssetReflectionWrapper::Reflect(AZ::ReflectContext* context) + void MaterialInfoReflectionWrapper::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class() + serializeContext->Class() ->Version(1) - ->Field("Asset", &DefaultMaterialLibraryAssetReflectionWrapper::m_asset) + ->Field("DefaultMaterial", &MaterialInfoReflectionWrapper::m_defaultMaterialConfiguration) + ->Field("Asset", &MaterialInfoReflectionWrapper::m_materialLibraryAsset) ; AZ::EditContext* editContext = serializeContext->GetEditContext(); if (editContext) { - editContext->Class("", "") + editContext->Class("Physics Materials", "") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, "") - ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->DataElement(AZ::Edit::UIHandlers::Default, &DefaultMaterialLibraryAssetReflectionWrapper::m_asset, "Default Physics Material Library", "Library to use by default") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialInfoReflectionWrapper::m_defaultMaterialConfiguration, "Default Physics Material", "Material used by default") + ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialInfoReflectionWrapper::m_materialLibraryAsset, "Physics Material Library", "Library to use for the project") ->Attribute(AZ::Edit::Attributes::AllowClearAsset, false) ->Attribute("EditButton", "") ; @@ -269,6 +258,17 @@ namespace Physics } } + bool MaterialFromAssetConfiguration::operator==(const MaterialFromAssetConfiguration& other) const + { + return m_configuration == other.m_configuration && + m_id == other.m_id; + } + + bool MaterialFromAssetConfiguration::operator!=(const MaterialFromAssetConfiguration& other) const + { + return !(*this == other); + } + ////////////////////////////////////////////////////////////////////////// bool MaterialLibraryAsset::GetDataForMaterialId(const MaterialId& materialId, MaterialFromAssetConfiguration& configuration) const @@ -370,9 +370,8 @@ namespace Physics if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(2, &ClassConverters::MaterialSelectionConverter) + ->Version(3, &ClassConverters::MaterialSelectionConverter) ->EventHandler() - ->Field("Material", &MaterialSelection::m_materialLibrary) ->Field("MaterialIds", &MaterialSelection::m_materialIdsAssignedToSlots) ; @@ -381,14 +380,8 @@ namespace Physics editContext->Class("Physics Material", "Select physics material library and which materials to use for the object") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialSelection::m_materialLibrary, "Library", "Physics material library to use for this object") - ->Attribute(AZ::Edit::Attributes::ContainerCanBeModified, true) - ->Attribute("EditButton", "") - ->Attribute("EditDescription", "Open in Asset Editor") - ->Attribute(AZ::Edit::Attributes::DefaultAsset, &MaterialSelection::GetDefaultMaterialLibraryId) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &MaterialSelection::OnMaterialLibraryChanged) ->DataElement(AZ::Edit::UIHandlers::Default, &MaterialSelection::m_materialIdsAssignedToSlots, "Mesh Surfaces", "Specify which Physics Material to use for each element of this object") - ->ElementAttribute(Attributes::MaterialLibraryAssetId, &MaterialSelection::GetMaterialLibraryAssetId) + ->ElementAttribute(Attributes::MaterialLibraryAssetId, &MaterialSelection::GetMaterialLibraryId) ->Attribute(AZ::Edit::Attributes::IndexedChildNameLabelOverride, &MaterialSelection::GetMaterialSlotLabel) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->ElementAttribute(AZ::Edit::Attributes::ReadOnly, &MaterialSelection::AreMaterialSlotsReadOnly) @@ -398,12 +391,6 @@ namespace Physics } } - AZ::u32 MaterialSelection::OnMaterialLibraryChanged() - { - SyncSelectionToMaterialLibrary(); - return AZ::Edit::PropertyRefreshLevels::EntireTree; - } - AZStd::string MaterialSelection::GetMaterialSlotLabel(int index) { if (index < m_materialSlots.size()) @@ -425,28 +412,9 @@ namespace Physics } } - AZ::Data::AssetId MaterialSelection::GetMaterialLibraryAssetId() const + void MaterialSelection::OnMaterialLibraryChanged([[maybe_unused]] const AZ::Data::AssetId& defaultMaterialLibraryId) { - return GetMaterialLibraryAsset().GetId(); - } - - const Physics::MaterialLibraryAsset* MaterialSelection::GetMaterialLibraryAssetData() const - { - return GetMaterialLibraryAsset().Get(); - } - - const AZStd::string& MaterialSelection::GetMaterialLibraryAssetHint() const - { - return m_materialLibrary.GetHint(); - } - - void MaterialSelection::OnDefaultMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId) - { - AZ_UNUSED(defaultMaterialLibraryId); - if (IsDefaultMaterialLibraryAsset()) - { - OnMaterialLibraryChanged(); - } + SyncSelectionToMaterialLibrary(); } void MaterialSelection::SetSlotsReadOnly(bool readOnly) @@ -454,45 +422,6 @@ namespace Physics m_slotsReadOnly = readOnly; } - bool MaterialSelection::IsMaterialLibraryValid() const - { - if (GetMaterialLibraryAssetId().IsValid()) - { - auto materialAsset = LoadAsset(); - const auto& materialsData = materialAsset.Get()->GetMaterialsData(); - - if (materialsData.size() != 0) - { - return true; - } - } - return false; - } - - bool MaterialSelection::GetMaterialConfiguration(Physics::MaterialFromAssetConfiguration& configuration, const Physics::MaterialId& materialId) const - { - if (IsMaterialLibraryValid()) - { - auto materialAsset = LoadAsset(); - if (materialAsset.Get()) - { - return materialAsset.Get()->GetDataForMaterialId(materialId, configuration); - } - } - return false; - } - - void MaterialSelection::SetMaterialLibrary(const AZ::Data::AssetId& assetId) - { - m_materialLibrary = AZ::Data::AssetManager::Instance().GetAsset(assetId, m_materialLibrary.GetAutoLoadBehavior()); - m_materialLibrary.BlockUntilLoadComplete(); - } - - void MaterialSelection::ResetToDefaultMaterialLibrary() - { - m_materialLibrary = {}; - } - void MaterialSelection::SetMaterialSlots(const SlotsArray& slots) { if (slots.empty()) @@ -533,74 +462,45 @@ namespace Physics m_materialIdsAssignedToSlots[slotIndex] = materialId; } - AZ::Data::Asset MaterialSelection::LoadAsset() const - { - AZ::Data::Asset asset = AZ::Data::AssetManager::Instance() - .GetAsset(GetMaterialLibraryAssetId(), AZ::Data::AssetLoadBehavior::Default); - - asset.BlockUntilLoadComplete(); - - return asset; - } - void MaterialSelection::SyncSelectionToMaterialLibrary() { - if (GetMaterialLibraryAssetId().IsValid()) + auto* materialLibrary = GetMaterialLibrary().Get(); + if (!materialLibrary) { - auto materialLibraryAsset = AZ::Data::AssetManager::Instance().GetAsset(GetMaterialLibraryAssetId(), AZ::Data::AssetLoadBehavior::Default); + return; + } - materialLibraryAsset.BlockUntilLoadComplete(); - - // We try to check whether existing selection matches any materials in the newly assigned library and do one of the following: - // 1. If previous MaterialId is invalid for this material library, and it is not the Default material, we set it to the Default material from the library. - // 2. If it's valid, or it is the Default material, we don't change it (useful when user accidentally re-assigns the same library: previous selection won't go away). - - if (materialLibraryAsset.Get()) + for (Physics::MaterialId& materialId : m_materialIdsAssignedToSlots) + { + // Leave nulls (default) unchanged. + if (materialId.IsNull()) { - for (Physics::MaterialId& materialId : m_materialIdsAssignedToSlots) - { - if (!materialLibraryAsset.Get()->HasDataForMaterialId(materialId) - && !materialId.IsNull()) // Null materialId is the Default material. - { - materialId = MaterialId(); - } - } + continue; } - else + + // If the material id is not present in the library anymore, set it to default + if (!materialLibrary->HasDataForMaterialId(materialId)) { - AZ_Warning("PhysX", false, "MaterialSelection: invalid material library"); + materialId = MaterialId(); } } } - const AZ::Data::Asset& MaterialSelection::GetMaterialLibraryAsset() const - { - if (IsDefaultMaterialLibraryAsset()) - { - const AZ::Data::Asset& defaultMaterialLibrary = GetDefaultMaterialLibrary(); - return defaultMaterialLibrary; - } - - return m_materialLibrary; - } - - bool MaterialSelection::IsDefaultMaterialLibraryAsset() const - { - return !m_materialLibrary.GetId().IsValid(); - } - - const AZ::Data::Asset& MaterialSelection::GetDefaultMaterialLibrary() + const AZ::Data::Asset& MaterialSelection::GetMaterialLibrary() { if (auto* physicsSystem = AZ::Interface::Get()) { - return physicsSystem->GetDefaultMaterialLibrary(); + if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) + { + return physicsConfiguration->m_materialLibraryAsset; + } } return s_invalidMaterialLibrary; } - const AZ::Data::AssetId& MaterialSelection::GetDefaultMaterialLibraryId() + const AZ::Data::AssetId& MaterialSelection::GetMaterialLibraryId() { - return GetDefaultMaterialLibrary().GetId(); + return GetMaterialLibrary().GetId(); } bool MaterialSelection::AreMaterialSlotsReadOnly() const diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Material.h b/Code/Framework/AzFramework/AzFramework/Physics/Material.h index e9eaae929f..69edf3ed25 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Material.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Material.h @@ -29,7 +29,6 @@ namespace Physics /// ========================= /// This is the interface to the wrapper around native material type (such as PxMaterial in PhysX gem) /// that stores extra metadata, like Surface Type name. - /// To see more details about PhysX implementation please refer to PhysX::Material class /// /// Usage example /// ------------------------- @@ -37,14 +36,7 @@ namespace Physics /// /// Physics::MaterialConfiguration materialProperties; /// AZStd::shared_ptr newMaterial = AZ::Interface::Get()->CreateMaterial(materialProperties); - /// - /// To get PxMaterial use GetNativePointer function - /// - /// physx::PxMaterial* material = static_cast(newMaterial->GetNativePointer()); - /// - /// You can use retrieved PxMaterial pointer on its own, provided you increment its reference count. - /// If this class goes out of scope, the PxMaterial pointer will be valid, but its userData - /// will be cleaned up to point to nullptr. + /// class Material { public: @@ -63,9 +55,9 @@ namespace Physics /// Returns AZ::Crc32 of the surface name. virtual AZ::Crc32 GetSurfaceType() const = 0; - virtual void SetSurfaceType(AZ::Crc32 surfaceType) = 0; virtual const AZStd::string& GetSurfaceTypeName() const = 0; + virtual void SetSurfaceTypeName(const AZStd::string& surfaceTypeName) = 0; virtual float GetDynamicFriction() const = 0; virtual void SetDynamicFriction(float dynamicFriction) = 0; @@ -85,6 +77,9 @@ namespace Physics virtual float GetDensity() const = 0; virtual void SetDensity(float density) = 0; + virtual AZ::Color GetDebugColor() const = 0; + virtual void SetDebugColor(const AZ::Color& debugColor) = 0; + /// If the name of this material matches the name of one of the CrySurface types, it will return its CrySurface Id.\n /// If there's no match it will return default CrySurface Id.\n /// CrySurface types are defined in libs/materialeffects/surfacetypes.xml @@ -122,6 +117,10 @@ namespace Physics Material::CombineMode m_frictionCombine = Material::CombineMode::Average; AZ::Color m_debugColor = AZ::Colors::White; + + bool operator==(const MaterialConfiguration& other) const; + bool operator!=(const MaterialConfiguration& other) const; + private: static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); static AZ::Color GenerateDebugColor(const char* materialName); @@ -147,6 +146,7 @@ namespace Physics static MaterialId FromUUID(const AZ::Uuid& uuid); bool IsNull() const { return m_id.IsNull(); } bool operator==(const MaterialId& other) const { return m_id == other.m_id; } + bool operator!=(const MaterialId& other) const { return !(*this == other); } const AZ::Uuid& GetUuid() const { return m_id; } private: @@ -166,6 +166,9 @@ namespace Physics MaterialConfiguration m_configuration; MaterialId m_id; + + bool operator==(const MaterialFromAssetConfiguration& other) const; + bool operator!=(const MaterialFromAssetConfiguration& other) const; }; /// An asset that holds a list of materials to be edited and assigned in Open 3D Engine Editor @@ -222,40 +225,27 @@ namespace Physics AZStd::vector m_materialLibrary; }; - /// The class is used to expose a MaterialLibraryAsset to Edit Context + /// The class is used to expose a default material and material library asset to Edit Context /// ======================================================================= /// /// Since AZ::Data::Asset doesn't reflect the data to EditContext /// we have to have a wrapper doing it. - class MaterialLibraryAssetReflectionWrapper + class MaterialInfoReflectionWrapper { public: - AZ_CLASS_ALLOCATOR(MaterialLibraryAssetReflectionWrapper, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(Physics::MaterialLibraryAssetReflectionWrapper, "{3D2EF5DF-EFD0-47EB-B88F-3E6FE1FEE5B0}"); + AZ_CLASS_ALLOCATOR(MaterialInfoReflectionWrapper, AZ::SystemAllocator, 0); + AZ_TYPE_INFO(Physics::MaterialInfoReflectionWrapper, "{02AB8CBC-D35B-4E0F-89BA-A96D94DAD4F9}"); static void Reflect(AZ::ReflectContext* context); - AZ::Data::Asset m_asset = + Physics::MaterialConfiguration m_defaultMaterialConfiguration; + AZ::Data::Asset m_materialLibraryAsset = AZ::Data::AssetLoadBehavior::NoLoad; }; - /// Customized material library for use as default material library - class DefaultMaterialLibraryAssetReflectionWrapper : public Physics::MaterialLibraryAssetReflectionWrapper - { - public: - AZ_CLASS_ALLOCATOR(MaterialLibraryAssetReflectionWrapper, AZ::SystemAllocator, 0); - AZ_TYPE_INFO(Physics::DefaultMaterialLibraryAssetReflectionWrapper, "{02AB8CBC-D35B-4E0F-89BA-A96D94DAD4F9}"); - static void Reflect(AZ::ReflectContext* context); - - AZ::Data::Asset m_asset = - AZ::Data::AssetLoadBehavior::NoLoad; - }; - - /// The class is used to store a MaterialLibraryAsset and a vector of MaterialIds selected from the library + /// The class is used to store a vector of MaterialIds selected from the library /// ======================================================================= /// - /// This class is used to store a reference to the library asset and user's - /// selection of the materials from this library.\n - /// It also reflects UI controls for assigning MaterialLibraryAsset and selecting a material from it. + /// This class is used to store the user's selection of the materials from this library. /// You can reflect this class in EditorContext to provide UI for selecting materials /// on any custom component or QWidget. class MaterialSelection @@ -269,27 +259,6 @@ namespace Physics static void Reflect(AZ::ReflectContext* context); - /// Returns whether MaterialLibraryAsset assigned to this selection exists and valid. Attempts to load - /// the library if it's not loaded yet. - /// @return true if MaterialLibraryAsset has a valid AssetId, loaded and isn't empty - bool IsMaterialLibraryValid() const; - - /// Looks up MaterialLibraryAsset for MaterialFromAssetConfiguration with MaterialId that is stored intrenally. - /// @param configuration contains material data if there is a material selected by user - /// and if it exists in the MaterialLibraryAsset - /// @param materialId MaterialId to retrieve MaterialFromAssetConfiguration for - /// @return true if lookup was successful. - bool GetMaterialConfiguration(Physics::MaterialFromAssetConfiguration& configuration, const Physics::MaterialId& materialId) const; - - /// Sets and loads MaterialLibraryAsset with specified AssetId. - /// It is used to construct MaterialSelection at runtime. - /// It is not a typical use case and mostly needed to convert legacy entities and auto-generate material libraries - /// @param assetId AssetId to create MaterialLibraryAsset with - void SetMaterialLibrary(const AZ::Data::AssetId& assetId); - - /// Sets the material library to none, this will cause to use the project-wide default material library - void ResetToDefaultMaterialLibrary(); - /// Sets an array of material slots to pick MaterialIds for. Having multiple slots is required for assigning multiple materials on a mesh /// or heightfield object. SlotsArray can be empty and in this case Default slot will be created. /// @param slots Array of names for slots. Can be empty, in this case Default slot will be created @@ -298,48 +267,34 @@ namespace Physics /// Returns a list of MaterialId that were assigned for each corresponding slot. const AZStd::vector& GetMaterialIdsAssignedToSlots() const; - /// Sets the MaterialId from MaterialLibraryAsset as the selected material at a specific slotIndex. - /// @param materialId MaterialId that user selected from the MaterialLibraryAsset - /// @param slotIndex index of the slot to set MaterialId for + /// Sets the MaterialId as the selected material at a specific slotIndex. + /// @param materialId MaterialId that user selected + /// @param slotIndex Index of the slot to set the MaterialId void SetMaterialId(const Physics::MaterialId& materialId, int slotIndex = 0); - /// Returns the material library asset id. - AZ::Data::AssetId GetMaterialLibraryAssetId() const; - /// Returns the material id assigned to this selection at a specific slotIndex. - /// @param slotIndex index of the slot to retrieve MaterialId for + /// @param slotIndex Index of the slot to retrieve the MaterialId Physics::MaterialId GetMaterialId(int slotIndex = 0) const; - /// Returns the material library asset. - const Physics::MaterialLibraryAsset* GetMaterialLibraryAssetData() const; - - /// Returns the material library asset hint(UI display string) - const AZStd::string& GetMaterialLibraryAssetHint() const; - /// Called when the material library has changed - void OnDefaultMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId); + void OnMaterialLibraryChanged(const AZ::Data::AssetId& defaultMaterialLibraryId); /// Set if the material slots are editable in the edit context void SetSlotsReadOnly(bool readOnly); private: - AZ::Data::Asset m_materialLibrary { AZ::Data::AssetLoadBehavior::NoLoad }; AZStd::vector m_materialIdsAssignedToSlots; SlotsArray m_materialSlots; bool m_slotsReadOnly = false; - const AZ::Data::Asset& GetMaterialLibraryAsset() const; - AZ::Data::Asset LoadAsset() const; - bool IsDefaultMaterialLibraryAsset() const; void SyncSelectionToMaterialLibrary(); - static const AZ::Data::Asset& GetDefaultMaterialLibrary(); - static const AZ::Data::AssetId& GetDefaultMaterialLibraryId(); + static const AZ::Data::Asset& GetMaterialLibrary(); + static const AZ::Data::AssetId& GetMaterialLibraryId(); bool AreMaterialSlotsReadOnly() const; // EditorContext callbacks - AZ::u32 OnMaterialLibraryChanged(); AZStd::string GetMaterialSlotLabel(int index); }; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h b/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h index edfa3096d3..a7e4869df1 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/MaterialBus.h @@ -25,21 +25,26 @@ namespace Physics static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; // Implemented by sole owner of materials, e.g. class MaterialManager in PhysX gem. - /// Get default material + /// Get default material. virtual AZStd::shared_ptr GetGenericDefaultMaterial() = 0; /// Returns weak pointers to physics materials. /// Connect to PhysicsMaterialNotifications::MaterialsReleased to be informed when material pointers are deleted by owner. virtual void GetMaterials(const MaterialSelection& materialSelection - , AZStd::vector>& outMaterials) = 0; + , AZStd::vector>& outMaterials) = 0; + + /// Returns a weak pointer to physics material with the given id. + virtual AZStd::shared_ptr GetMaterialById(Physics::MaterialId id) = 0; /// Returns a weak pointer to physics material with the given name. - virtual AZStd::weak_ptr GetMaterialByName(const AZStd::string& name) = 0; + virtual AZStd::shared_ptr GetMaterialByName(const AZStd::string& name) = 0; - /// Returns index of the first selected material in MaterialSelection's material library. - /// A MaterialSelection can contain multiple material selections. - /// Returned index is 0-based where 0 is the Default material, and materials from the material library are 1 and onwards. - virtual AZ::u32 GetFirstSelectedMaterialIndex(const MaterialSelection& materialSelection) = 0; + /// Updates the material selection from the physics asset or sets it to default if there's no asset provided. + /// @param shapeConfiguration The shape information that contains the physics asset. + /// @param materialSelection The material selection to update. + virtual void UpdateMaterialSelectionFromPhysicsAsset( + const ShapeConfiguration& shapeConfiguration, + MaterialSelection& materialSelection) = 0; }; using PhysicsMaterialRequestBus = AZ::EBus; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h index e3ed449046..36ae4dbecb 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/PhysicsSystem.h @@ -130,13 +130,6 @@ namespace AzPhysics //! @param forceReinitialization Flag to force a reinitialization of the physics system. Default false. virtual void UpdateConfiguration(const SystemConfiguration* newConfig, bool forceReinitialization = false) = 0; - //! Update the default material library. - //! @param materialLibrary The new material library asset to use. - virtual void UpdateDefaultMaterialLibrary(const AZ::Data::Asset& materialLibrary) = 0; - - //! Accessor to get the current Material Library. This is also available in the PhysXSystemConfiguration. - virtual const AZ::Data::Asset& GetDefaultMaterialLibrary() const = 0; - //! Update the current default scene configuration. //! This is the configuration used to to create scenes without a custom configuration. //! @param sceneConfiguration The new configuration to apply. @@ -169,9 +162,12 @@ namespace AzPhysics //! Register to receive notifications when the SystemConfiguration changes. //! @param handler The handler to receive the event. void RegisterSystemConfigurationChangedEvent(SystemEvents::OnConfigurationChangedEvent::Handler& handler) { handler.Connect(m_configChangeEvent); } - //! Register a handler to receive an event when the default material library changes. + //! Register a handler to receive an event when the material library changes. //! @param handler The handler to receive the event. - void RegisterOnDefaultMaterialLibraryChangedEventHandler(SystemEvents::OnDefaultMaterialLibraryChangedEvent::Handler& handler) { handler.Connect(m_onDefaultMaterialLibraryChangedEvent); } + void RegisterOnMaterialLibraryChangedEventHandler(SystemEvents::OnMaterialLibraryChangedEvent::Handler& handler) { handler.Connect(m_onMaterialLibraryChangedEvent); } + //! Register a handler to receive an event when the material library fails to load on startup. + //! @param handler The handler to receive the event. + void RegisterOnMaterialLibraryLoadErrorEventHandler(SystemEvents::OnMaterialLibraryLoadErrorEvent::Handler& handler) { handler.Connect(m_onMaterialLibraryLoadErrorEvent); } //! Register a handler to receive an event when the default SceneConfiguration changes. //! @param handler The handler to receive the event. void RegisterOnDefaultSceneConfigurationChangedEventHandler(SystemEvents::OnDefaultSceneConfigurationChangedEvent::Handler& handler) { handler.Connect(m_onDefaultSceneConfigurationChangedEvent); } @@ -185,7 +181,8 @@ namespace AzPhysics SystemEvents::OnSceneAddedEvent m_sceneAddedEvent; SystemEvents::OnSceneRemovedEvent m_sceneRemovedEvent; SystemEvents::OnConfigurationChangedEvent m_configChangeEvent; - SystemEvents::OnDefaultMaterialLibraryChangedEvent m_onDefaultMaterialLibraryChangedEvent; + SystemEvents::OnMaterialLibraryChangedEvent m_onMaterialLibraryChangedEvent; + SystemEvents::OnMaterialLibraryLoadErrorEvent m_onMaterialLibraryLoadErrorEvent; SystemEvents::OnDefaultSceneConfigurationChangedEvent m_onDefaultSceneConfigurationChangedEvent; }; } // namespace AzPhysics diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Ragdoll.h b/Code/Framework/AzFramework/AzFramework/Physics/Ragdoll.h index 239d93cf32..97c841e8f8 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Ragdoll.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Ragdoll.h @@ -102,7 +102,7 @@ namespace Physics /// Is the ragdoll currently simulated? /// @result True in case the ragdoll is simulated, false if not. - virtual bool IsSimulated() = 0; + virtual bool IsSimulated() const = 0; /// Writes the state for all of the bodies in the ragdoll to the provided output. /// The caller owns the output state and can safely manipulate it without affecting the physics simulation. diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Shape.h b/Code/Framework/AzFramework/AzFramework/Physics/Shape.h index 115503c536..2ac38690ff 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Shape.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/Shape.h @@ -80,9 +80,6 @@ namespace Physics void OnContactOffsetChanged(); }; - using ShapeConfigurationPair = AZStd::pair, AZStd::shared_ptr>; - using ShapeConfigurationList = AZStd::vector; - struct RayCastRequest; class Shape diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp index a535f5f65d..275103bc28 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.cpp @@ -17,6 +17,21 @@ namespace Physics { + namespace Internal + { + bool ShapeConfigurationVersionConverter( + [[maybe_unused]] AZ::SerializeContext& context, + AZ::SerializeContext::DataElementNode& classElement) + { + if (classElement.GetVersion() <= 1) + { + classElement.RemoveElementByName(AZ_CRC_CE("UseMaterialsFromAsset")); + } + + return true; + } + } + void ShapeConfiguration::Reflect(AZ::ReflectContext* context) { if (auto serializeContext = azrtti_cast(context)) @@ -166,10 +181,9 @@ namespace Physics ->RegisterGenericType>(); serializeContext->Class() - ->Version(1) + ->Version(2, &Internal::ShapeConfigurationVersionConverter) ->Field("PhysicsAsset", &PhysicsAssetShapeConfiguration::m_asset) ->Field("AssetScale", &PhysicsAssetShapeConfiguration::m_assetScale) - ->Field("UseMaterialsFromAsset", &PhysicsAssetShapeConfiguration::m_useMaterialsFromAsset) ->Field("SubdivisionLevel", &PhysicsAssetShapeConfiguration::m_subdivisionLevel) ; @@ -182,7 +196,6 @@ namespace Physics ->DataElement(AZ::Edit::UIHandlers::Default, &PhysicsAssetShapeConfiguration::m_assetScale, "Asset Scale", "The scale of the asset shape") ->Attribute(AZ::Edit::Attributes::Min, 0.0f) ->Attribute(AZ::Edit::Attributes::Step, 0.01f) - ->DataElement(AZ::Edit::UIHandlers::Default, &PhysicsAssetShapeConfiguration::m_useMaterialsFromAsset, "Physics Materials from Mesh", "Auto-set physics materials using Mesh's material surfaces names") ; } } diff --git a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h index b3d04a10c9..8234ef9173 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/ShapeConfiguration.h @@ -140,7 +140,7 @@ namespace Physics AZ::Data::Asset m_asset{ AZ::Data::AssetLoadBehavior::PreLoad }; AZ::Vector3 m_assetScale = AZ::Vector3::CreateOne(); - bool m_useMaterialsFromAsset = true; + bool m_useMaterialsFromAsset = false; // Not reflected or exposed to the user until there is a way to auto-match mesh's materials with physics materials AZ::u8 m_subdivisionLevel = 4; ///< The level of subdivision if a primitive shape is replaced with a convex mesh due to scaling. }; diff --git a/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h b/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h index f198551148..8cdd0e0cf0 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h +++ b/Code/Framework/AzFramework/AzFramework/Physics/SystemBus.h @@ -142,24 +142,12 @@ namespace Physics virtual AZStd::shared_ptr CreateShape(const ColliderConfiguration& colliderConfiguration, const ShapeConfiguration& configuration) = 0; + virtual AZStd::shared_ptr CreateMaterial(const Physics::MaterialConfiguration& materialConfiguration) = 0; + /// Releases the mesh object created by the physics backend. /// @param nativeMeshObject Pointer to the mesh object. virtual void ReleaseNativeMeshObject(void* nativeMeshObject) = 0; - ////////////////////////////////////////////////////////////////////////// - //// Physics Materials - - virtual AZStd::shared_ptr CreateMaterial(const Physics::MaterialConfiguration& materialConfiguration) = 0; - virtual AZStd::shared_ptr GetDefaultMaterial() = 0; - virtual AZStd::vector> CreateMaterialsFromLibrary(const Physics::MaterialSelection& materialSelection) = 0; - - - /// Updates the collider material selection from the physics asset or sets it to default if there's no asset provided. - /// @param shapeConfiguration The shape information - /// @param colliderConfiguration The collider information - virtual bool UpdateMaterialSelection(const Physics::ShapeConfiguration& shapeConfiguration, - Physics::ColliderConfiguration& colliderConfiguration) = 0; - ////////////////////////////////////////////////////////////////////////// //// Joints diff --git a/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp b/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp index b5f113582b..2c3b62bb88 100644 --- a/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp +++ b/Code/Framework/AzFramework/AzFramework/Physics/Utils.cpp @@ -119,8 +119,7 @@ namespace Physics AzPhysics::SceneConfiguration::Reflect(context); MaterialConfiguration::Reflect(context); MaterialLibraryAsset::Reflect(context); - MaterialLibraryAssetReflectionWrapper::Reflect(context); - DefaultMaterialLibraryAssetReflectionWrapper::Reflect(context); + MaterialInfoReflectionWrapper::Reflect(context); JointLimitConfiguration::Reflect(context); AzPhysics::SimulatedBodyConfiguration::Reflect(context); AzPhysics::RigidBodyConfiguration::Reflect(context); diff --git a/Code/Framework/AzFramework/AzFramework/ProjectManager/ProjectManager.cpp b/Code/Framework/AzFramework/AzFramework/ProjectManager/ProjectManager.cpp index 985bc4665d..2742b90f4c 100644 --- a/Code/Framework/AzFramework/AzFramework/ProjectManager/ProjectManager.cpp +++ b/Code/Framework/AzFramework/AzFramework/ProjectManager/ProjectManager.cpp @@ -46,7 +46,6 @@ namespace AzFramework::ProjectManager // Store the Command line to the Setting Registry AZ::SettingsRegistryImpl settingsRegistry; AZ::SettingsRegistryMergeUtils::StoreCommandLineToRegistry(settingsRegistry, commandLine); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(settingsRegistry); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_O3deUserRegistry(settingsRegistry, AZ_TRAIT_OS_PLATFORM_CODENAME, {}); // Retrieve Command Line from Settings Registry, it may have been updated by the call to FindEngineRoot() // in MergeSettingstoRegistry_ConfigFile @@ -99,51 +98,18 @@ namespace AzFramework::ProjectManager AZ::AllocatorInstance::Create(); } { - const char projectsScript[] = "projects.py"; + AZStd::string filename = "o3de"; + AZ::IO::FixedMaxPath executablePath = AZ::Utils::GetExecutableDirectory(); + executablePath /= filename + AZ_TRAIT_OS_EXECUTABLE_EXTENSION; - AZ_Warning("ProjectManager", false, "No project provided - launching project selector."); - - if (engineRootPath.empty()) + if (!AZ::IO::SystemFile::Exists(executablePath.c_str())) { - AZ_Error("ProjectManager", false, "Couldn't find engine root"); + AZ_Error("ProjectManager", false, "%s not found", executablePath.c_str()); return false; } - auto projectManagerPath = engineRootPath / "scripts" / "project_manager"; - - if (!AZ::IO::SystemFile::Exists((projectManagerPath / projectsScript).c_str())) - { - AZ_Error("ProjectManager", false, "%s not found at %s!", projectsScript, projectManagerPath.c_str()); - return false; - } - AZ::IO::FixedMaxPathString executablePath; - AZ::Utils::GetExecutablePathReturnType result = AZ::Utils::GetExecutablePath(executablePath.data(), executablePath.capacity()); - if (result.m_pathStored != AZ::Utils::ExecutablePathResult::Success) - { - AZ_Error("ProjectManager", false, "Could not determine executable path!"); - return false; - } - AZ::IO::FixedMaxPath parentPath(executablePath.c_str()); - auto exeFolder = parentPath.ParentPath(); - AZStd::fixed_string<8> debugOption; - auto lastSep = exeFolder.Native().find_last_of(AZ_CORRECT_FILESYSTEM_SEPARATOR); - if (lastSep != AZStd::string_view::npos) - { - exeFolder = exeFolder.Native().substr(lastSep + 1); - } - if (exeFolder == "debug") - { - // We need to use the debug version of the python interpreter to load up our debug version of our libraries which work with the debug version of QT living in this folder - debugOption = "debug "; - } - AZ::IO::FixedMaxPath pythonPath = engineRootPath / "python"; - pythonPath /= AZ_TRAIT_AZFRAMEWORK_PYTHON_SHELL; - auto cmdPath = AZ::IO::FixedMaxPathString::format("%s %s%s --executable_path=%s --parent_pid=%" PRIu32, pythonPath.Native().c_str(), - debugOption.c_str(), (projectManagerPath / projectsScript).c_str(), executablePath.c_str(), AZ::Platform::GetCurrentProcessId()); AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; - - processLaunchInfo.m_commandlineParameters = cmdPath; - processLaunchInfo.m_showWindow = false; + processLaunchInfo.m_commandlineParameters = executablePath.String(); launchSuccess = AzFramework::ProcessLauncher::LaunchUnwatchedProcess(processLaunchInfo); } if (ownsSystemAllocator) diff --git a/Code/Framework/AzFramework/AzFramework/Render/GeometryIntersectionBus.h b/Code/Framework/AzFramework/AzFramework/Render/GeometryIntersectionBus.h index ba1d2d1e06..749f457286 100644 --- a/Code/Framework/AzFramework/AzFramework/Render/GeometryIntersectionBus.h +++ b/Code/Framework/AzFramework/AzFramework/Render/GeometryIntersectionBus.h @@ -12,6 +12,7 @@ #pragma once #include +#include #include namespace AzFramework @@ -35,12 +36,12 @@ namespace AzFramework AzFramework::EntityContextId m_contextId; }; - //! Interface for intersection requests, implement this interface for making your component - //! render geometry intersectable. + //! Interface for intersection requests. + //! Implement this interface to make your component 'intersectable'. class IntersectionRequests : public AZ::EBusTraits { - //! Policy for notifying the Intersector bus of entities connected/disconnected to this ebus + //! Policy for notifying the Intersector bus of entities connected/disconnected to this EBus //! so it updates the internal data of the entities template struct IntersectionRequestsConnectionPolicy diff --git a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp index cdfad7f116..4f8da821c1 100644 --- a/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Script/ScriptComponent.cpp @@ -264,12 +264,12 @@ namespace AzFramework // SampleRPC = // { // // Two callbacks can be registered to the NetRPC - // // A function to be invoked on the Master - OnMaster + // // A function to be invoked on the main server - OnServer // // and a function to be invoked on the Proxy - OnProxy // // - // // Every NetRPC needs to have a valid OnMaster function, while OnProxy is optional. - // OnMaster = function() - // Debug.Log("Function to be invoked on the Master."); + // // Every NetRPC needs to have a valid OnServer function, while OnProxy is optional. + // OnServer = function() + // Debug.Log("Function to be invoked on the server."); // end // // OnProxy = function() diff --git a/Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h b/Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h new file mode 100644 index 0000000000..47388c56c3 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/ISessionHandlingRequests.h @@ -0,0 +1,78 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#include + +namespace AzFramework +{ + //! SessionConnectionConfig + //! The properties for handling join session request. + struct SessionConnectionConfig + { + // A unique identifier for registered player in session. + AZStd::string m_playerSessionId; + + // The DNS identifier assigned to the instance that is running the session. + AZStd::string m_dnsName; + + // The IP address of the session. + AZStd::string m_ipAddress; + + // The port number for the session. + uint16_t m_port; + }; + + //! SessionConnectionConfig + //! The properties for handling player connect/disconnect + struct PlayerConnectionConfig + { + // A unique identifier for player connection. + uint32_t m_playerConnectionId; + + // A unique identifier for registered player in session. + AZStd::string m_playerSessionId; + }; + + //! ISessionHandlingClientRequests + //! The session handling events to invoke multiplayer component handle the work on client side + class ISessionHandlingClientRequests + { + public: + // Handle the player join session process + // @param sessionConnectionConfig The required properties to handle the player join session process + // @return The result of player join session process + virtual bool HandlePlayerJoinSession(const SessionConnectionConfig& sessionConnectionConfig) = 0; + + // Handle the player leave session process + virtual void HandlePlayerLeaveSession() = 0; + }; + + //! ISessionHandlingServerRequests + //! The session handling events to invoke server provider handle the work on server side + class ISessionHandlingServerRequests + { + public: + // Handle the destroy session process + virtual void HandleDestroySession() = 0; + + // Validate the player join session process + // @param playerConnectionConfig The required properties to validate the player join session process + // @return The result of player join session validation + virtual bool ValidatePlayerJoinSession(const PlayerConnectionConfig& playerConnectionConfig) = 0; + + // Handle the player leave session process + // @param playerConnectionConfig The required properties to handle the player leave session process + virtual void HandlePlayerLeaveSession(const PlayerConnectionConfig& playerConnectionConfig) = 0; + }; +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.cpp b/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.cpp new file mode 100644 index 0000000000..4eb42ab815 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.cpp @@ -0,0 +1,130 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include +#include + +namespace AzFramework +{ + void CreateSessionRequest::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("creatorId", &CreateSessionRequest::m_creatorId) + ->Field("sessionProperties", &CreateSessionRequest::m_sessionProperties) + ->Field("sessionName", &CreateSessionRequest::m_sessionName) + ->Field("maxPlayer", &CreateSessionRequest::m_maxPlayer) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("CreateSessionRequest", "The container for CreateSession request parameters") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &CreateSessionRequest::m_creatorId, + "CreatorId", "A unique identifier for a player or entity creating the session") + ->DataElement(AZ::Edit::UIHandlers::Default, &CreateSessionRequest::m_sessionProperties, + "SessionProperties", "A collection of custom properties for a session") + ->DataElement(AZ::Edit::UIHandlers::Default, &CreateSessionRequest::m_sessionName, + "SessionName", "A descriptive label that is associated with a session") + ->DataElement(AZ::Edit::UIHandlers::Default, &CreateSessionRequest::m_maxPlayer, + "MaxPlayer", "The maximum number of players that can be connected simultaneously to the session") + ; + } + } + } + + void SearchSessionsRequest::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("filterExpression", &SearchSessionsRequest::m_filterExpression) + ->Field("sortExpression", &SearchSessionsRequest::m_sortExpression) + ->Field("maxResult", &SearchSessionsRequest::m_maxResult) + ->Field("nextToken", &SearchSessionsRequest::m_nextToken) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("SearchSessionsRequest", "The container for SearchSessions request parameters") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsRequest::m_filterExpression, + "FilterExpression", "String containing the search criteria for the session search") + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsRequest::m_sortExpression, + "SortExpression", "Instructions on how to sort the search results") + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsRequest::m_maxResult, + "MaxResult", "The maximum number of results to return") + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsRequest::m_nextToken, + "NextToken", "A token that indicates the start of the next sequential page of results") + ; + } + } + } + + void SearchSessionsResponse::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("sessionConfigs", &SearchSessionsResponse::m_sessionConfigs) + ->Field("nextToken", &SearchSessionsResponse::m_nextToken) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("SearchSessionsResponse", "The container for SearchSession request results") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsResponse::m_sessionConfigs, + "SessionConfigs", "A collection of sessions that match the search criteria and sorted in specific order") + ->DataElement(AZ::Edit::UIHandlers::Default, &SearchSessionsResponse::m_nextToken, + "NextToken", "A token that indicates the start of the next sequential page of results") + ; + } + } + } + + void JoinSessionRequest::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("sessionId", &JoinSessionRequest::m_sessionId) + ->Field("playerId", &JoinSessionRequest::m_playerId) + ->Field("playerData", &JoinSessionRequest::m_playerData) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("JoinSessionRequest", "The container for JoinSession request parameters") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &JoinSessionRequest::m_sessionId, + "SessionId", "A unique identifier for the session") + ->DataElement(AZ::Edit::UIHandlers::Default, &JoinSessionRequest::m_playerId, + "PlayerId", "A unique identifier for a player. Player IDs are developer-defined") + ->DataElement(AZ::Edit::UIHandlers::Default, &JoinSessionRequest::m_playerData, + "PlayerData", "Developer-defined information related to a player") + ; + } + } + } +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h b/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h new file mode 100644 index 0000000000..9d21a7f282 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/ISessionRequests.h @@ -0,0 +1,192 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace AzFramework +{ + struct SessionConfig; + + //! CreateSessionRequest + //! The container for CreateSession request parameters. + struct CreateSessionRequest + { + AZ_RTTI(CreateSessionRequest, "{E39C2A45-89C9-4CFB-B337-9734DC798930}"); + static void Reflect(AZ::ReflectContext* context); + + CreateSessionRequest() = default; + virtual ~CreateSessionRequest() = default; + + // A unique identifier for a player or entity creating the session. + AZStd::string m_creatorId; + + // A collection of custom properties for a session. + AZStd::unordered_map m_sessionProperties; + + // A descriptive label that is associated with a session. + AZStd::string m_sessionName; + + // The maximum number of players that can be connected simultaneously to the session. + uint64_t m_maxPlayer; + }; + + //! SearchSessionsRequest + //! The container for SearchSessions request parameters. + struct SearchSessionsRequest + { + AZ_RTTI(SearchSessionsRequest, "{B49207A8-8549-4ADB-B7D9-D7A4932F9B4B}"); + static void Reflect(AZ::ReflectContext* context); + + SearchSessionsRequest() = default; + virtual ~SearchSessionsRequest() = default; + + // String containing the search criteria for the session search. If no filter expression is included, the request returns results + // for all active sessions. + AZStd::string m_filterExpression; + + // Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. + AZStd::string m_sortExpression; + + // The maximum number of results to return. + uint8_t m_maxResult; + + // A token that indicates the start of the next sequential page of results. + AZStd::string m_nextToken; + }; + + //! SearchSessionsResponse + //! The container for SearchSession request results. + struct SearchSessionsResponse + { + AZ_RTTI(SearchSessionsResponse, "{F93DE7DC-D381-4E08-8A3B-0B08F7C38714}"); + static void Reflect(AZ::ReflectContext* context); + + SearchSessionsResponse() = default; + virtual ~SearchSessionsResponse() = default; + + // A collection of sessions that match the search criteria and sorted in specific order. + AZStd::vector m_sessionConfigs; + + // A token that indicates the start of the next sequential page of results. + AZStd::string m_nextToken; + }; + + //! JoinSessionRequest + //! The container for JoinSession request parameters. + struct JoinSessionRequest + { + AZ_RTTI(JoinSessionRequest, "{519769E8-3CDE-4385-A0D7-24DBB3685657}"); + static void Reflect(AZ::ReflectContext* context); + + JoinSessionRequest() = default; + virtual ~JoinSessionRequest() = default; + + // A unique identifier for the session. + AZStd::string m_sessionId; + + // A unique identifier for a player. Player IDs are developer-defined. + AZStd::string m_playerId; + + // Developer-defined information related to a player. + AZStd::string m_playerData; + }; + + //! ISessionRequests + //! Pure virtual session interface class to abstract the details of session handling from application code. + class ISessionRequests + { + public: + AZ_RTTI(ISessionRequests, "{D6C41A71-DD8D-47FE-8515-FAF90670AE2F}"); + + ISessionRequests() = default; + virtual ~ISessionRequests() = default; + + // Create a session for players to find and join. + // @param createSessionRequest The request of CreateSession operation + // @return The request id if session creation request succeeds; empty if it fails + virtual AZStd::string CreateSession(const CreateSessionRequest& createSessionRequest) = 0; + + // Retrieve all active sessions that match the given search criteria and sorted in specific order. + // @param searchSessionsRequest The request of SearchSessions operation + // @return The response of SearchSessions operation + virtual SearchSessionsResponse SearchSessions(const SearchSessionsRequest& searchSessionsRequest) const = 0; + + // Reserve an open player slot in a session, and perform connection from client to server. + // @param joinSessionRequest The request of JoinSession operation + // @return True if joining session succeeds; False otherwise + virtual bool JoinSession(const JoinSessionRequest& joinSessionRequest) = 0; + + // Disconnect player from session. + virtual void LeaveSession() = 0; + }; + + //! ISessionAsyncRequests + //! Async version of ISessionRequests + class ISessionAsyncRequests + { + public: + AZ_RTTI(ISessionAsyncRequests, "{471542AF-96B9-4930-82FE-242A4E68432D}"); + + ISessionAsyncRequests() = default; + virtual ~ISessionAsyncRequests() = default; + + // CreateSession Async + // @param createSessionRequest The request of CreateSession operation + virtual void CreateSessionAsync(const CreateSessionRequest& createSessionRequest) = 0; + + // SearchSessions Async + // @param searchSessionsRequest The request of SearchSessions operation + virtual void SearchSessionsAsync(const SearchSessionsRequest& searchSessionsRequest) const = 0; + + // JoinSession Async + // @param joinSessionRequest The request of JoinSession operation + virtual void JoinSessionAsync(const JoinSessionRequest& joinSessionRequest) = 0; + + // LeaveSession Async + virtual void LeaveSessionAsync() = 0; + }; + + //! SessionAsyncRequestNotifications + //! The notifications correspond to session async requests + class SessionAsyncRequestNotifications + : public AZ::EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + ////////////////////////////////////////////////////////////////////////// + + // OnCreateSessionAsyncComplete is fired once CreateSessionAsync completes + // @param createSessionResponse The request id if session creation request succeeds; empty if it fails + virtual void OnCreateSessionAsyncComplete(const AZStd::string& createSessionReponse) = 0; + + // OnSearchSessionsAsyncComplete is fired once SearchSessionsAsync completes + // @param searchSessionsResponse The response of SearchSessions call + virtual void OnSearchSessionsAsyncComplete(const SearchSessionsResponse& searchSessionsResponse) = 0; + + // OnJoinSessionAsyncComplete is fired once JoinSessionAsync completes + // @param joinSessionsResponse True if joining session succeeds; False otherwise + virtual void OnJoinSessionAsyncComplete(bool joinSessionsResponse) = 0; + + // OnLeaveSessionAsyncComplete is fired once LeaveSessionAsync completes + virtual void OnLeaveSessionAsyncComplete() = 0; + }; + using SessionAsyncRequestNotificationBus = AZ::EBus; +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp b/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp new file mode 100644 index 0000000000..12c5163031 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.cpp @@ -0,0 +1,74 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include + +namespace AzFramework +{ + void SessionConfig::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("creationTime", &SessionConfig::m_creationTime) + ->Field("terminationTime", &SessionConfig::m_terminationTime) + ->Field("creatorId", &SessionConfig::m_creatorId) + ->Field("sessionProperties", &SessionConfig::m_sessionProperties) + ->Field("sessionId", &SessionConfig::m_sessionId) + ->Field("sessionName", &SessionConfig::m_sessionName) + ->Field("dnsName", &SessionConfig::m_dnsName) + ->Field("ipAddress", &SessionConfig::m_ipAddress) + ->Field("port", &SessionConfig::m_port) + ->Field("maxPlayer", &SessionConfig::m_maxPlayer) + ->Field("currentPlayer", &SessionConfig::m_currentPlayer) + ->Field("status", &SessionConfig::m_status) + ->Field("statusReason", &SessionConfig::m_statusReason) + ; + + if (AZ::EditContext* editContext = serializeContext->GetEditContext()) + { + editContext->Class("SessionConfig", "Properties describing a session") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_creationTime, + "CreationTime", "A time stamp indicating when this session was created. Format is a number expressed in Unix time as milliseconds.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_terminationTime, + "TerminationTime", "A time stamp indicating when this data object was terminated. Same format as creation time.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_creatorId, + "CreatorId", "A unique identifier for a player or entity creating the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionProperties, + "SessionProperties", "A collection of custom properties for a session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionId, + "SessionId", "A unique identifier for the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_sessionName, + "SessionName", "A descriptive label that is associated with a session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_dnsName, + "DnsName", "The DNS identifier assigned to the instance that is running the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_ipAddress, + "IpAddress", "The IP address of the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_port, + "Port", "The port number for the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_maxPlayer, + "MaxPlayer", "The maximum number of players that can be connected simultaneously to the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_currentPlayer, + "CurrentPlayer", "Number of players currently in the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_status, + "Status", "Current status of the session.") + ->DataElement(AZ::Edit::UIHandlers::Default, &AzFramework::SessionConfig::m_statusReason, + "StatusReason", "Provides additional information about session status."); + } + } + } +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h b/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h new file mode 100644 index 0000000000..22d1c9e875 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/SessionConfig.h @@ -0,0 +1,70 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +namespace AzFramework +{ + //! SessionConfig + //! Properties describing a session. + struct SessionConfig + { + AZ_RTTI(SessionConfig, "{992DD4BE-8BA5-4071-8818-B99FD2952086}"); + static void Reflect(AZ::ReflectContext* context); + + SessionConfig() = default; + virtual ~SessionConfig() = default; + + // A time stamp indicating when this session was created. Format is a number expressed in Unix time as milliseconds. + uint64_t m_creationTime; + + // A time stamp indicating when this data object was terminated. Same format as creation time. + uint64_t m_terminationTime; + + // A unique identifier for a player or entity creating the session. + AZStd::string m_creatorId; + + // A collection of custom properties for a session. + AZStd::unordered_map m_sessionProperties; + + // A unique identifier for the session. + AZStd::string m_sessionId; + + // A descriptive label that is associated with a session. + AZStd::string m_sessionName; + + // The DNS identifier assigned to the instance that is running the session. + AZStd::string m_dnsName; + + // The IP address of the session. + AZStd::string m_ipAddress; + + // The port number for the session. + uint16_t m_port; + + // The maximum number of players that can be connected simultaneously to the session. + uint64_t m_maxPlayer; + + // Number of players currently in the session. + uint64_t m_currentPlayer; + + // Current status of the session. + AZStd::string m_status; + + // Provides additional information about session status. + AZStd::string m_statusReason; + }; +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h b/Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h new file mode 100644 index 0000000000..a61c995db7 --- /dev/null +++ b/Code/Framework/AzFramework/AzFramework/Session/SessionNotifications.h @@ -0,0 +1,47 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#include + +namespace AzFramework +{ + struct SessionConfig; + + //! SessionNotifications + //! The session notifications to listen for performing required operations + class SessionNotifications + : public AZ::EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + ////////////////////////////////////////////////////////////////////////// + + // OnSessionHealthCheck is fired in health check process + // @return The result of all OnSessionHealthCheck + virtual bool OnSessionHealthCheck() = 0; + + // OnCreateSessionBegin is fired at the beginning of session creation + // @param sessionConfig The properties to describe a session + // @return The result of all OnCreateSessionBegin notifications + virtual bool OnCreateSessionBegin(const SessionConfig& sessionConfig) = 0; + + // OnDestroySessionBegin is fired at the beginning of session termination + // @return The result of all OnDestroySessionBegin notifications + virtual bool OnDestroySessionBegin() = 0; + }; + using SessionNotificationBus = AZ::EBus; +} // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/Spawnable.h b/Code/Framework/AzFramework/AzFramework/Spawnable/Spawnable.h index 5e507b3498..79cea647e4 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/Spawnable.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/Spawnable.h @@ -19,10 +19,13 @@ #include #include -namespace AzFramework +namespace AZ { class ReflectContext; +} +namespace AzFramework +{ class Spawnable final : public AZ::Data::AssetData { diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp index b3ba1568bd..da046ff172 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.cpp @@ -10,6 +10,7 @@ * */ +#include #include #include #include @@ -88,4 +89,10 @@ namespace AzFramework { extensions.push_back(Spawnable::FileExtension); } + + uint32_t SpawnableAssetHandler::BuildSubId(AZStd::string_view id) + { + AZ::Uuid subIdHash = AZ::Uuid::CreateData(id.data(), id.size()); + return azlossy_caster(subIdHash.GetHash()); + } } // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h index deef314955..78268bf71a 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableAssetHandler.h @@ -47,6 +47,7 @@ namespace AzFramework const char* GetGroup() const override; const char* GetBrowserIcon() const override; void GetAssetTypeExtensions(AZStd::vector& extensions) override; + static uint32_t BuildSubId(AZStd::string_view id); protected: LoadResult LoadAssetData( diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.cpp index a528797f63..97169ebeb3 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.cpp @@ -14,6 +14,10 @@ namespace AzFramework { + // + // SpawnableEntityContainerView + // + SpawnableEntityContainerView::SpawnableEntityContainerView(AZ::Entity** begin, size_t length) : m_begin(begin) , m_end(begin + length) @@ -52,6 +56,9 @@ namespace AzFramework } + // + // SpawnableConstEntityContainerView + // SpawnableConstEntityContainerView::SpawnableConstEntityContainerView(AZ::Entity** begin, size_t length) : m_begin(begin) @@ -91,6 +98,136 @@ namespace AzFramework } + // + // SpawnableIndexEntityPair + // + + SpawnableIndexEntityPair::SpawnableIndexEntityPair(AZ::Entity** entityIterator, size_t* indexIterator) + : m_entity(entityIterator) + , m_index(indexIterator) + { + } + + AZ::Entity* SpawnableIndexEntityPair::GetEntity() + { + return *m_entity; + } + + const AZ::Entity* SpawnableIndexEntityPair::GetEntity() const + { + return *m_entity; + } + + size_t SpawnableIndexEntityPair::GetIndex() const + { + return *m_index; + } + + // + // SpawnableIndexEntityIterator + // + + SpawnableIndexEntityIterator::SpawnableIndexEntityIterator(AZ::Entity** entityIterator, size_t* indexIterator) + : m_value(entityIterator, indexIterator) + { + } + + SpawnableIndexEntityIterator& SpawnableIndexEntityIterator::operator++() + { + ++m_value.m_entity; + ++m_value.m_index; + return *this; + } + + SpawnableIndexEntityIterator SpawnableIndexEntityIterator::operator++(int) + { + SpawnableIndexEntityIterator result = *this; + ++m_value.m_entity; + ++m_value.m_index; + return result; + } + + SpawnableIndexEntityIterator& SpawnableIndexEntityIterator::operator--() + { + --m_value.m_entity; + --m_value.m_index; + return *this; + } + + SpawnableIndexEntityIterator SpawnableIndexEntityIterator::operator--(int) + { + SpawnableIndexEntityIterator result = *this; + --m_value.m_entity; + --m_value.m_index; + return result; + } + + bool SpawnableIndexEntityIterator::operator==(const SpawnableIndexEntityIterator& rhs) + { + return m_value.m_entity == rhs.m_value.m_entity && m_value.m_index == rhs.m_value.m_index; + } + + bool SpawnableIndexEntityIterator::operator!=(const SpawnableIndexEntityIterator& rhs) + { + return m_value.m_entity != rhs.m_value.m_entity || m_value.m_index != rhs.m_value.m_index; + } + + SpawnableIndexEntityPair& SpawnableIndexEntityIterator::operator*() + { + return m_value; + } + + const SpawnableIndexEntityPair& SpawnableIndexEntityIterator::operator*() const + { + return m_value; + } + + SpawnableIndexEntityPair* SpawnableIndexEntityIterator::operator->() + { + return &m_value; + } + + const SpawnableIndexEntityPair* SpawnableIndexEntityIterator::operator->() const + { + return &m_value; + } + + + // + // SpawnableConstIndexEntityContainerView + // + + SpawnableConstIndexEntityContainerView::SpawnableConstIndexEntityContainerView( + AZ::Entity** beginEntity, size_t* beginIndices, size_t length) + : m_begin(beginEntity, beginIndices) + , m_end(beginEntity + length, beginIndices + length) + { + } + + const SpawnableIndexEntityIterator& SpawnableConstIndexEntityContainerView::begin() + { + return m_begin; + } + + const SpawnableIndexEntityIterator& SpawnableConstIndexEntityContainerView::end() + { + return m_end; + } + + const SpawnableIndexEntityIterator& SpawnableConstIndexEntityContainerView::cbegin() + { + return m_begin; + } + + const SpawnableIndexEntityIterator& SpawnableConstIndexEntityContainerView::cend() + { + return m_end; + } + + + // + // EntitySpawnTicket + // EntitySpawnTicket::EntitySpawnTicket(EntitySpawnTicket&& rhs) : m_payload(rhs.m_payload) diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h index 95d0b9e3a7..69bca8e111 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesInterface.h @@ -58,6 +58,72 @@ namespace AzFramework AZ::Entity** m_end; }; + class SpawnableIndexEntityPair + { + public: + friend class SpawnableIndexEntityIterator; + + AZ::Entity* GetEntity(); + const AZ::Entity* GetEntity() const; + size_t GetIndex() const; + + private: + SpawnableIndexEntityPair() = default; + SpawnableIndexEntityPair(const SpawnableIndexEntityPair&) = default; + SpawnableIndexEntityPair(SpawnableIndexEntityPair&&) = default; + SpawnableIndexEntityPair(AZ::Entity** entityIterator, size_t* indexIterator); + + SpawnableIndexEntityPair& operator=(const SpawnableIndexEntityPair&) = default; + SpawnableIndexEntityPair& operator=(SpawnableIndexEntityPair&&) = default; + + AZ::Entity** m_entity { nullptr }; + size_t* m_index { nullptr }; + }; + + class SpawnableIndexEntityIterator + { + public: + // Limited to bidirectional iterator as there's no use case for extending it further, but can be extended if a use case is found. + using iterator_category = AZStd::bidirectional_iterator_tag; + using value_type = SpawnableIndexEntityPair; + using difference_type = size_t; + using pointer = SpawnableIndexEntityPair*; + using reference = SpawnableIndexEntityPair&; + + SpawnableIndexEntityIterator(AZ::Entity** entityIterator, size_t* indexIterator); + + SpawnableIndexEntityIterator& operator++(); + SpawnableIndexEntityIterator operator++(int); + SpawnableIndexEntityIterator& operator--(); + SpawnableIndexEntityIterator operator--(int); + + bool operator==(const SpawnableIndexEntityIterator& rhs); + bool operator!=(const SpawnableIndexEntityIterator& rhs); + + SpawnableIndexEntityPair& operator*(); + const SpawnableIndexEntityPair& operator*() const; + SpawnableIndexEntityPair* operator->(); + const SpawnableIndexEntityPair* operator->() const; + + private: + SpawnableIndexEntityPair m_value; + }; + + class SpawnableConstIndexEntityContainerView + { + public: + SpawnableConstIndexEntityContainerView(AZ::Entity** beginEntity, size_t* beginIndices, size_t length); + + const SpawnableIndexEntityIterator& begin(); + const SpawnableIndexEntityIterator& end(); + const SpawnableIndexEntityIterator& cbegin(); + const SpawnableIndexEntityIterator& cend(); + + private: + SpawnableIndexEntityIterator m_begin; + SpawnableIndexEntityIterator m_end; + }; + //! Requests to the SpawnableEntitiesInterface require a ticket with a valid spawnable that be used as a template. A ticket can //! be reused for multiple calls on the same spawnable and is safe to use by multiple threads at the same time. Entities created //! from the spawnable may be tracked by the ticket and so using the same ticket is needed to despawn the exact entities created @@ -84,9 +150,11 @@ namespace AzFramework }; using EntitySpawnCallback = AZStd::function; + using EntityPreInsertionCallback = AZStd::function; using EntityDespawnCallback = AZStd::function; using ReloadSpawnableCallback = AZStd::function; using ListEntitiesCallback = AZStd::function; + using ListIndicesEntitiesCallback = AZStd::function; using ClaimEntitiesCallback = AZStd::function; using BarrierCallback = AZStd::function; @@ -110,7 +178,8 @@ namespace AzFramework //! @param completionCallback Optional callback that's called when spawning entities has completed. This can be called from //! a different thread than the one that made the function call. The returned list of entities contains all the newly //! created entities. - virtual void SpawnAllEntities(EntitySpawnTicket& ticket, EntitySpawnCallback completionCallback = {}) = 0; + virtual void SpawnAllEntities(EntitySpawnTicket& ticket, EntityPreInsertionCallback preInsertionCallback = {}, + EntitySpawnCallback completionCallback = {}) = 0; //! Spawn instances of some entities in the spawnable. //! @param ticket Stores the results of the call. Use this ticket to spawn additional entities or to despawn them. //! @param entityIndices The indices into the template entities stored in the spawnable that will be used to spawn entities from. @@ -118,7 +187,7 @@ namespace AzFramework //! a different thread than the one that made this function call. The returned list of entities contains all the newly //! created entities. virtual void SpawnEntities(EntitySpawnTicket& ticket, AZStd::vector entityIndices, - EntitySpawnCallback completionCallback = {}) = 0; + EntityPreInsertionCallback preInsertionCallback = {}, EntitySpawnCallback completionCallback = {}) = 0; //! Removes all entities in the provided list from the environment. //! @param ticket The ticket previously used to spawn entities with. //! @param completionCallback Optional callback that's called when despawning entities has completed. This can be called from @@ -138,6 +207,15 @@ namespace AzFramework //! @param ticket Only the entities associated with this ticket will be listed. //! @param listCallback Required callback that will be called to list the entities on. virtual void ListEntities(EntitySpawnTicket& ticket, ListEntitiesCallback listCallback) = 0; + //! List all entities that are spawned using this ticket with their spawnable index. + //! Spawnables contain a flat list of entities, which are used as templates to spawn entities from. For every spawned entity + //! the index of the entity in the spawnable that was used as a template is stored. This version of ListEntities will return + //! both the entities and this index. The index can be used with SpawnEntities to create the same entities again. Note that + //! the same index may appear multiple times as there are no restriction on how many instance of a specific entity can be + //! created. + //! @param ticket Only the entities associated with this ticket will be listed. + //! @param listCallback Required callback that will be called to list the entities and indices on. + virtual void ListIndicesAndEntities(EntitySpawnTicket& ticket, ListIndicesEntitiesCallback listCallback) = 0; //! Claim all entities that are spawned using this ticket. Ownership of the entities is transferred from the ticket to the //! caller through the callback. After this call the ticket will have no entities associated with it. The caller of //! this function will need to manage the entities after this call. diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp index 3ab004b516..7e20f7b265 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.cpp @@ -11,20 +11,26 @@ */ #include +#include #include #include #include +#include #include #include #include namespace AzFramework { - void SpawnableEntitiesManager::SpawnAllEntities(EntitySpawnTicket& ticket, EntitySpawnCallback completionCallback) + void SpawnableEntitiesManager::SpawnAllEntities(EntitySpawnTicket& ticket, EntityPreInsertionCallback preInsertionCallback, + EntitySpawnCallback completionCallback) { + AZ_Assert(ticket.IsValid(), "Ticket provided to SpawnAllEntities hasn't been initialized."); + SpawnAllEntitiesCommand queueEntry; queueEntry.m_ticket = &ticket; queueEntry.m_completionCallback = AZStd::move(completionCallback); + queueEntry.m_preInsertionCallback = AZStd::move(preInsertionCallback); { AZStd::scoped_lock queueLock(m_pendingRequestQueueMutex); queueEntry.m_ticketId = GetTicketPayload(ticket).m_nextTicketId++; @@ -32,13 +38,17 @@ namespace AzFramework } } - void SpawnableEntitiesManager::SpawnEntities(EntitySpawnTicket& ticket, AZStd::vector entityIndices, - EntitySpawnCallback completionCallback) + void SpawnableEntitiesManager::SpawnEntities( + EntitySpawnTicket& ticket, AZStd::vector entityIndices, + EntityPreInsertionCallback preInsertionCallback, EntitySpawnCallback completionCallback) { + AZ_Assert(ticket.IsValid(), "Ticket provided to SpawnEntities hasn't been initialized."); + SpawnEntitiesCommand queueEntry; queueEntry.m_ticket = &ticket; queueEntry.m_entityIndices = AZStd::move(entityIndices); queueEntry.m_completionCallback = AZStd::move(completionCallback); + queueEntry.m_preInsertionCallback = AZStd::move(preInsertionCallback); { AZStd::scoped_lock queueLock(m_pendingRequestQueueMutex); queueEntry.m_ticketId = GetTicketPayload(ticket).m_nextTicketId++; @@ -48,6 +58,8 @@ namespace AzFramework void SpawnableEntitiesManager::DespawnAllEntities(EntitySpawnTicket& ticket, EntityDespawnCallback completionCallback) { + AZ_Assert(ticket.IsValid(), "Ticket provided to DespawnAllEntities hasn't been initialized."); + DespawnAllEntitiesCommand queueEntry; queueEntry.m_ticket = &ticket; queueEntry.m_completionCallback = AZStd::move(completionCallback); @@ -61,6 +73,8 @@ namespace AzFramework void SpawnableEntitiesManager::ReloadSpawnable(EntitySpawnTicket& ticket, AZ::Data::Asset spawnable, ReloadSpawnableCallback completionCallback) { + AZ_Assert(ticket.IsValid(), "Ticket provided to ReloadSpawnable hasn't been initialized."); + ReloadSpawnableCommand queueEntry; queueEntry.m_ticket = &ticket; queueEntry.m_spawnable = AZStd::move(spawnable); @@ -75,6 +89,7 @@ namespace AzFramework void SpawnableEntitiesManager::ListEntities(EntitySpawnTicket& ticket, ListEntitiesCallback listCallback) { AZ_Assert(listCallback, "ListEntities called on spawnable entities without a valid callback to use."); + AZ_Assert(ticket.IsValid(), "Ticket provided to ListEntities hasn't been initialized."); ListEntitiesCommand queueEntry; queueEntry.m_ticket = &ticket; @@ -86,9 +101,25 @@ namespace AzFramework } } + void SpawnableEntitiesManager::ListIndicesAndEntities(EntitySpawnTicket& ticket, ListIndicesEntitiesCallback listCallback) + { + AZ_Assert(listCallback, "ListEntities called on spawnable entities without a valid callback to use."); + AZ_Assert(ticket.IsValid(), "Ticket provided to ListEntities hasn't been initialized."); + + ListIndicesEntitiesCommand queueEntry; + queueEntry.m_ticket = &ticket; + queueEntry.m_listCallback = AZStd::move(listCallback); + { + AZStd::scoped_lock queueLock(m_pendingRequestQueueMutex); + queueEntry.m_ticketId = GetTicketPayload(ticket).m_nextTicketId++; + m_pendingRequestQueue.push(AZStd::move(queueEntry)); + } + } + void SpawnableEntitiesManager::ClaimEntities(EntitySpawnTicket& ticket, ClaimEntitiesCallback listCallback) { AZ_Assert(listCallback, "ClaimEntities called on spawnable entities without a valid callback to use."); + AZ_Assert(ticket.IsValid(), "Ticket provided to ClaimEntities hasn't been initialized."); ClaimEntitiesCommand queueEntry; queueEntry.m_ticket = &ticket; @@ -103,6 +134,7 @@ namespace AzFramework void SpawnableEntitiesManager::Barrier(EntitySpawnTicket& ticket, BarrierCallback completionCallback) { AZ_Assert(completionCallback, "Barrier on spawnable entities called without a valid callback to use."); + AZ_Assert(ticket.IsValid(), "Ticket provided to Barrier hasn't been initialized."); BarrierCommand queueEntry; queueEntry.m_ticket = &ticket; @@ -205,32 +237,85 @@ namespace AzFramework AZ::Entity* clone = serializeContext.CloneObject(&entityTemplate); AZ_Assert(clone != nullptr, "Failed to clone spawnable entity."); clone->SetId(AZ::Entity::MakeId()); + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, clone); return clone; } + AZ::Entity* SpawnableEntitiesManager::CloneSingleEntity(const AZ::Entity& entityTemplate, + EntityIdMap& templateToCloneEntityIdMap, AZ::SerializeContext& serializeContext) + { + return AZ::IdUtils::Remapper::CloneObjectAndGenerateNewIdsAndFixRefs( + &entityTemplate, templateToCloneEntityIdMap, &serializeContext); + } + bool SpawnableEntitiesManager::ProcessRequest(SpawnAllEntitiesCommand& request, AZ::SerializeContext& serializeContext) { Ticket& ticket = GetTicketPayload(*request.m_ticket); if (ticket.m_spawnable.IsReady() && request.m_ticketId == ticket.m_currentTicketId) { - size_t spawnedEntitiesCount = ticket.m_spawnedEntities.size(); + AZStd::vector& spawnedEntities = ticket.m_spawnedEntities; + AZStd::vector& spawnedEntityIndices = ticket.m_spawnedEntityIndices; - const Spawnable::EntityList& entities = ticket.m_spawnable->GetEntities(); - size_t entitiesSize = entities.size(); - ticket.m_spawnedEntities.reserve(ticket.m_spawnedEntities.size() + entitiesSize); - ticket.m_spawnedEntityIndices.reserve(ticket.m_spawnedEntityIndices.size() + entitiesSize); + // Keep track how many entities there were in the array initially + size_t spawnedEntitiesInitialCount = spawnedEntities.size(); - for(size_t i=0; iGetEntities(); + size_t entitiesToSpawnSize = entitiesToSpawn.size(); + + // Map keeps track of ids from template (spawnable) to clone (instance) + // Allowing patch ups of fields referring to entityIds outside of a given entity + EntityIdMap templateToCloneEntityIdMap; + + // Reserve buffers + spawnedEntities.reserve(spawnedEntities.size() + entitiesToSpawnSize); + spawnedEntityIndices.reserve(spawnedEntityIndices.size() + entitiesToSpawnSize); + templateToCloneEntityIdMap.reserve(entitiesToSpawnSize); + + // Mark all indices as spawned + for (size_t i = 0; i < entitiesToSpawnSize; ++i) { - ticket.m_spawnedEntities.push_back(SpawnSingleEntity(*entities[i], serializeContext)); - ticket.m_spawnedEntityIndices.push_back(i); + const AZ::Entity& entityTemplate = *entitiesToSpawn[i]; + + AZ::Entity* clone = CloneSingleEntity(entityTemplate, templateToCloneEntityIdMap, serializeContext); + + AZ_Assert(clone != nullptr, "Failed to clone spawnable entity."); + + spawnedEntities.emplace_back(clone); + spawnedEntityIndices.push_back(i); } + // loadAll is true if every entity has been spawned only once + if (spawnedEntities.size() == entitiesToSpawnSize) + { + ticket.m_loadAll = true; + } + else + { + // Case where there were already spawns from a previous request + ticket.m_loadAll = false; + } + + // Let other systems know about newly spawned entities for any pre-processing before adding to the scene/game context. + if (request.m_preInsertionCallback) + { + request.m_preInsertionCallback(*request.m_ticket, SpawnableEntityContainerView( + ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end())); + } + + // Add to the game context, now the entities are active + AZStd::for_each(ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end(), + [](AZ::Entity* entity) + { + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, entity); + }); + + // Let other systems know about newly spawned entities for any post-processing after adding to the scene/game context. if (request.m_completionCallback) { request.m_completionCallback(*request.m_ticket, SpawnableConstEntityContainerView( - ticket.m_spawnedEntities.begin() + spawnedEntitiesCount, ticket.m_spawnedEntities.end())); + ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end())); } m_onSpawnedEvent.Signal(ticket.m_spawnable); @@ -249,24 +334,56 @@ namespace AzFramework Ticket& ticket = GetTicketPayload(*request.m_ticket); if (ticket.m_spawnable.IsReady() && request.m_ticketId == ticket.m_currentTicketId) { - size_t spawnedEntitiesCount = ticket.m_spawnedEntities.size(); + AZStd::vector& spawnedEntities = ticket.m_spawnedEntities; + AZStd::vector& spawnedEntityIndices = ticket.m_spawnedEntityIndices; - const Spawnable::EntityList& entities = ticket.m_spawnable->GetEntities(); - size_t entitiesSize = entities.size(); - ticket.m_spawnedEntities.reserve(ticket.m_spawnedEntities.size() + entitiesSize); - ticket.m_spawnedEntityIndices.reserve(ticket.m_spawnedEntityIndices.size() + entitiesSize); + // Keep track how many entities there were in the array initially + size_t spawnedEntitiesInitialCount = spawnedEntities.size(); + + // These are 'template' entities we'll be cloning from + const Spawnable::EntityList& entitiesToSpawn = ticket.m_spawnable->GetEntities(); + size_t entitiesToSpawnSize = request.m_entityIndices.size(); + + spawnedEntities.reserve(spawnedEntities.size() + entitiesToSpawnSize); + spawnedEntityIndices.reserve(spawnedEntityIndices.size() + entitiesToSpawnSize); for (size_t index : request.m_entityIndices) { - ticket.m_spawnedEntities.push_back(SpawnSingleEntity(*entities[index], serializeContext)); - ticket.m_spawnedEntityIndices.push_back(index); + if (index < entitiesToSpawn.size()) + { + const AZ::Entity& entityTemplate = *entitiesToSpawn[index]; + + AZ::Entity* clone = serializeContext.CloneObject(&entityTemplate); + AZ_Assert(clone != nullptr, "Failed to clone spawnable entity."); + clone->SetId(AZ::Entity::MakeId()); + + spawnedEntities.push_back(clone); + spawnedEntityIndices.push_back(index); + + } } ticket.m_loadAll = false; + // Let other systems know about newly spawned entities for any pre-processing before adding to the scene/game context. + if (request.m_preInsertionCallback) + { + request.m_preInsertionCallback( + *request.m_ticket, + SpawnableEntityContainerView( + ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end())); + } + + // Add to the game context, now the entities are active + AZStd::for_each(ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end(), + [](AZ::Entity* entity) + { + GameEntityContextRequestBus::Broadcast(&GameEntityContextRequestBus::Events::AddGameEntity, entity); + }); + if (request.m_completionCallback) { request.m_completionCallback(*request.m_ticket, SpawnableConstEntityContainerView( - ticket.m_spawnedEntities.begin() + spawnedEntitiesCount, ticket.m_spawnedEntities.end())); + ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end())); } m_onSpawnedEvent.Signal(ticket.m_spawnable); @@ -343,10 +460,23 @@ namespace AzFramework // to load every, simply start over. ticket.m_spawnedEntityIndices.clear(); - size_t entitiesSize = entities.size(); - for (size_t i = 0; i < entitiesSize; ++i) + size_t entitiesToSpawnSize = entities.size(); + + // Map keeps track of ids from template (spawnable) to clone (instance) + // Allowing patch ups of fields referring to entityIds outside of a given entity + EntityIdMap templateToCloneEntityIdMap; + templateToCloneEntityIdMap.reserve(entitiesToSpawnSize); + + // Mark all indices as spawned + for (size_t i = 0; i < entitiesToSpawnSize; ++i) { - ticket.m_spawnedEntities.push_back(SpawnSingleEntity(*entities[i], serializeContext)); + const AZ::Entity& entityTemplate = *entities[i]; + + AZ::Entity* clone = CloneSingleEntity(entityTemplate, templateToCloneEntityIdMap, serializeContext); + + AZ_Assert(clone != nullptr, "Failed to clone spawnable entity."); + + ticket.m_spawnedEntities.emplace_back(clone); ticket.m_spawnedEntityIndices.push_back(i); } } @@ -395,6 +525,27 @@ namespace AzFramework } } + bool SpawnableEntitiesManager::ProcessRequest(ListIndicesEntitiesCommand& request, [[maybe_unused]] AZ::SerializeContext& serializeContext) + { + Ticket& ticket = GetTicketPayload(*request.m_ticket); + if (request.m_ticketId == ticket.m_currentTicketId) + { + AZ_Assert( + ticket.m_spawnedEntities.size() == ticket.m_spawnedEntityIndices.size(), + "Entities and indices on spawnable ticket have gone out of sync."); + request.m_listCallback( + *request.m_ticket, + SpawnableConstIndexEntityContainerView( + ticket.m_spawnedEntities.begin(), ticket.m_spawnedEntityIndices.begin(), ticket.m_spawnedEntities.size())); + ticket.m_currentTicketId++; + return true; + } + else + { + return false; + } + } + bool SpawnableEntitiesManager::ProcessRequest(ClaimEntitiesCommand& request, [[maybe_unused]] AZ::SerializeContext& serializeContext) { Ticket& ticket = GetTicketPayload(*request.m_ticket); diff --git a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.h b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.h index c70b9ccaa6..3481ab180a 100644 --- a/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.h +++ b/Code/Framework/AzFramework/AzFramework/Spawnable/SpawnableEntitiesManager.h @@ -29,11 +29,14 @@ namespace AZ namespace AzFramework { + using EntityIdMap = AZStd::unordered_map; + class SpawnableEntitiesManager : public SpawnableEntitiesInterface::Registrar { public: AZ_RTTI(AzFramework::SpawnableEntitiesManager, "{6E14333F-128C-464C-94CA-A63B05A5E51C}"); + AZ_CLASS_ALLOCATOR(SpawnableEntitiesManager, AZ::SystemAllocator, 0); enum class CommandQueueStatus : bool { @@ -47,8 +50,8 @@ namespace AzFramework // The following functions are thread safe // - void SpawnAllEntities(EntitySpawnTicket& ticket, EntitySpawnCallback completionCallback = {}) override; - void SpawnEntities(EntitySpawnTicket& ticket, AZStd::vector entityIndices, + void SpawnAllEntities(EntitySpawnTicket& ticket, EntityPreInsertionCallback preInsertionCallback = {}, EntitySpawnCallback completionCallback = {}) override; + void SpawnEntities(EntitySpawnTicket& ticket, AZStd::vector entityIndices, EntityPreInsertionCallback preInsertionCallback = {}, EntitySpawnCallback completionCallback = {}) override; void DespawnAllEntities(EntitySpawnTicket& ticket, EntityDespawnCallback completionCallback = {}) override; @@ -56,6 +59,7 @@ namespace AzFramework ReloadSpawnableCallback completionCallback = {}) override; void ListEntities(EntitySpawnTicket& ticket, ListEntitiesCallback listCallback) override; + void ListIndicesAndEntities(EntitySpawnTicket& ticket, ListIndicesEntitiesCallback listCallback) override; void ClaimEntities(EntitySpawnTicket& ticket, ClaimEntitiesCallback listCallback) override; void Barrier(EntitySpawnTicket& spawnInfo, BarrierCallback completionCallback) override; @@ -90,6 +94,7 @@ namespace AzFramework struct SpawnAllEntitiesCommand { EntitySpawnCallback m_completionCallback; + EntityPreInsertionCallback m_preInsertionCallback; EntitySpawnTicket* m_ticket; uint32_t m_ticketId; }; @@ -97,6 +102,7 @@ namespace AzFramework { AZStd::vector m_entityIndices; EntitySpawnCallback m_completionCallback; + EntityPreInsertionCallback m_preInsertionCallback; EntitySpawnTicket* m_ticket; uint32_t m_ticketId; }; @@ -119,6 +125,12 @@ namespace AzFramework EntitySpawnTicket* m_ticket; uint32_t m_ticketId; }; + struct ListIndicesEntitiesCommand + { + ListIndicesEntitiesCallback m_listCallback; + EntitySpawnTicket* m_ticket; + uint32_t m_ticketId; + }; struct ClaimEntitiesCommand { ClaimEntitiesCallback m_listCallback; @@ -137,16 +149,22 @@ namespace AzFramework uint32_t m_ticketId; }; - using Requests = AZStd::variant; + using Requests = AZStd::variant< + SpawnAllEntitiesCommand, SpawnEntitiesCommand, DespawnAllEntitiesCommand, ReloadSpawnableCommand, ListEntitiesCommand, + ListIndicesEntitiesCommand, ClaimEntitiesCommand, BarrierCommand, DestroyTicketCommand>; - AZ::Entity* SpawnSingleEntity(const AZ::Entity& entityTemplate, AZ::SerializeContext& serializeContext); + AZ::Entity* SpawnSingleEntity(const AZ::Entity& entityTemplate, + AZ::SerializeContext& serializeContext); + + AZ::Entity* CloneSingleEntity(const AZ::Entity& entityTemplate, + EntityIdMap& templateToCloneEntityIdMap, AZ::SerializeContext& serializeContext); bool ProcessRequest(SpawnAllEntitiesCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(SpawnEntitiesCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(DespawnAllEntitiesCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(ReloadSpawnableCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(ListEntitiesCommand& request, AZ::SerializeContext& serializeContext); + bool ProcessRequest(ListIndicesEntitiesCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(ClaimEntitiesCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(BarrierCommand& request, AZ::SerializeContext& serializeContext); bool ProcessRequest(DestroyTicketCommand& request, AZ::SerializeContext& serializeContext); diff --git a/Code/Framework/AzFramework/AzFramework/TargetManagement/NeighborhoodAPI.cpp b/Code/Framework/AzFramework/AzFramework/TargetManagement/NeighborhoodAPI.cpp index 44c601f5f5..7f3d0770c0 100644 --- a/Code/Framework/AzFramework/AzFramework/TargetManagement/NeighborhoodAPI.cpp +++ b/Code/Framework/AzFramework/AzFramework/TargetManagement/NeighborhoodAPI.cpp @@ -41,7 +41,7 @@ namespace Neighborhood { //--------------------------------------------------------------------- void NeighborReplica::OnReplicaActivate(const GridMate::ReplicaContext& /*rc*/) { - // TODO: Should we send the message to ourselves as well (master)? + // TODO: Should we send the message to ourselves as well? if (IsProxy()) { AZ_Assert(m_persistentName.Get().c_str(), "Received NeighborReplica with missing persistent name!"); @@ -52,7 +52,7 @@ namespace Neighborhood { //--------------------------------------------------------------------- void NeighborReplica::OnReplicaDeactivate(const GridMate::ReplicaContext& /*rc*/) { - // TODO: Should we send the message to ourselves as well (master)? + // TODO: Should we send the message to ourselves as well? if (IsProxy()) { EBUS_EVENT(NeighborhoodBus, OnNodeLeft, *this); diff --git a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp index daf2c63921..d5f02c957c 100644 --- a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp +++ b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.cpp @@ -18,7 +18,6 @@ #include #include #include -#include namespace AzFramework { @@ -30,7 +29,8 @@ namespace AzFramework AZ_CVAR(float, ed_cameraSystemOrbitDollyScrollSpeed, 0.02f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); AZ_CVAR(float, ed_cameraSystemOrbitDollyCursorSpeed, 0.01f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); AZ_CVAR(float, ed_cameraSystemScrollTranslateSpeed, 0.02f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); - AZ_CVAR(float, ed_cameraSystemMaxOrbitDistance, 60.0f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); + AZ_CVAR(float, ed_cameraSystemMinOrbitDistance, 6.0f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); + AZ_CVAR(float, ed_cameraSystemMaxOrbitDistance, 50.0f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); AZ_CVAR(float, ed_cameraSystemLookSmoothness, 5.0f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); AZ_CVAR(float, ed_cameraSystemTranslateSmoothness, 5.0f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); AZ_CVAR(float, ed_cameraSystemRotateSpeed, 0.005f, nullptr, AZ::ConsoleFunctorFlags::Null, ""); @@ -144,7 +144,7 @@ namespace AzFramework z = AZStd::atan2(-orientation.GetElement(1, 2), orientation.GetElement(1, 1)); } - return {x, y, z}; + return { x, y, z }; } void UpdateCameraFromTransform(Camera& camera, const AZ::Transform& transform) @@ -159,24 +159,27 @@ namespace AzFramework bool CameraSystem::HandleEvents(const InputEvent& event) { - if (const auto& cursor = AZStd::get_if(&event)) + if (const auto& horizonalMotion = AZStd::get_if(&event)) { - m_cursorState.SetCurrentPosition(cursor->m_position); + m_motionDelta.m_x = horizonalMotion->m_delta; + } + else if (const auto& verticalMotion = AZStd::get_if(&event)) + { + m_motionDelta.m_y = verticalMotion->m_delta; } else if (const auto& scroll = AZStd::get_if(&event)) { m_scrollDelta = scroll->m_delta; } - return m_cameras.HandleEvents(event, m_cursorState.CursorDelta(), m_scrollDelta); + return m_cameras.HandleEvents(event, m_motionDelta, m_scrollDelta); } Camera CameraSystem::StepCamera(const Camera& targetCamera, const float deltaTime) { - const auto nextCamera = m_cameras.StepCamera(targetCamera, m_cursorState.CursorDelta(), m_scrollDelta, deltaTime); - - m_cursorState.Update(); + const auto nextCamera = m_cameras.StepCamera(targetCamera, m_motionDelta, m_scrollDelta, deltaTime); + m_motionDelta = ScreenVector{ 0, 0 }; m_scrollDelta = 0.0f; return nextCamera; @@ -192,13 +195,12 @@ namespace AzFramework bool handling = false; for (auto& cameraInput : m_activeCameraInputs) { - cameraInput->HandleEvents(event, cursorDelta, scrollDelta); - handling = !cameraInput->Idle() || handling; + handling = cameraInput->HandleEvents(event, cursorDelta, scrollDelta) || handling; } for (auto& cameraInput : m_idleCameraInputs) { - cameraInput->HandleEvents(event, cursorDelta, scrollDelta); + handling = cameraInput->HandleEvents(event, cursorDelta, scrollDelta) || handling; } return handling; @@ -211,7 +213,10 @@ namespace AzFramework auto& cameraInput = m_idleCameraInputs[i]; const bool canBegin = cameraInput->Beginning() && AZStd::all_of(m_activeCameraInputs.cbegin(), m_activeCameraInputs.cend(), - [](const auto& input) { return !input->Exclusive(); }) && + [](const auto& input) + { + return !input->Exclusive(); + }) && (!cameraInput->Exclusive() || (cameraInput->Exclusive() && m_activeCameraInputs.empty())); if (canBegin) @@ -229,7 +234,8 @@ namespace AzFramework const Camera nextCamera = AZStd::accumulate( AZStd::begin(m_activeCameraInputs), AZStd::end(m_activeCameraInputs), targetCamera, - [cursorDelta, scrollDelta, deltaTime](Camera acc, auto& camera) { + [cursorDelta, scrollDelta, deltaTime](Camera acc, auto& camera) + { acc = camera->StepCamera(acc, cursorDelta, scrollDelta, deltaTime); return acc; }); @@ -261,19 +267,29 @@ namespace AzFramework { m_activeCameraInputs[i]->Reset(); m_idleCameraInputs.push_back(m_activeCameraInputs[i]); - m_activeCameraInputs[i] = m_activeCameraInputs[m_activeCameraInputs.size() - 1]; + using AZStd::swap; + swap(m_activeCameraInputs[i], m_activeCameraInputs[m_activeCameraInputs.size() - 1]); m_activeCameraInputs.pop_back(); } } + void Cameras::Clear() + { + Reset(); + AZ_Assert(m_activeCameraInputs.empty(), "Active Camera Inputs is not empty"); + + m_idleCameraInputs.clear(); + } + RotateCameraInput::RotateCameraInput(const InputChannelId rotateChannelId) : m_rotateChannelId(rotateChannelId) { } - void RotateCameraInput::HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) + bool RotateCameraInput::HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { - const ClickDetector::ClickEvent clickEvent = [&event, this] { + const ClickDetector::ClickEvent clickEvent = [&event, this] + { if (const auto& input = AZStd::get_if(&event)) { if (input->m_channelId == m_rotateChannelId) @@ -303,6 +319,11 @@ namespace AzFramework // noop break; } + + // note - must also check !ending to ensure the mouse up (release) event + // is not consumed and can be propagated to other systems. + // (don't swallow mouse up events) + return !Idle() && !Ending(); } Camera RotateCameraInput::StepCamera( @@ -314,7 +335,10 @@ namespace AzFramework nextCamera.m_pitch -= float(cursorDelta.m_y) * ed_cameraSystemRotateSpeed; nextCamera.m_yaw -= float(cursorDelta.m_x) * ed_cameraSystemRotateSpeed; - const auto clampRotation = [](const float angle) { return AZStd::fmod(angle + AZ::Constants::TwoPi, AZ::Constants::TwoPi); }; + const auto clampRotation = [](const float angle) + { + return AZStd::fmod(angle + AZ::Constants::TwoPi, AZ::Constants::TwoPi); + }; nextCamera.m_yaw = clampRotation(nextCamera.m_yaw); // clamp pitch to be +-90 degrees @@ -329,7 +353,7 @@ namespace AzFramework { } - void PanCameraInput::HandleEvents( + bool PanCameraInput::HandleEvents( const InputEvent& event, [[maybe_unused]] const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { if (const auto& input = AZStd::get_if(&event)) @@ -346,6 +370,8 @@ namespace AzFramework } } } + + return !Idle(); } Camera PanCameraInput::StepCamera( @@ -359,9 +385,10 @@ namespace AzFramework const auto deltaPanX = float(cursorDelta.m_x) * panAxes.m_horizontalAxis * ed_cameraSystemPanSpeed; const auto deltaPanY = float(cursorDelta.m_y) * panAxes.m_verticalAxis * ed_cameraSystemPanSpeed; - const auto inv = [](const bool invert) { - constexpr float Dir[] = {1.0f, -1.0f}; - return Dir[static_cast(invert)]; + const auto inv = [](const bool invert) + { + constexpr float Dir[] = { 1.0f, -1.0f }; + return Dir[aznumeric_cast(invert)]; }; nextCamera.m_lookAt += deltaPanX * inv(ed_cameraSystemPanInvertX); @@ -410,7 +437,7 @@ namespace AzFramework { } - void TranslateCameraInput::HandleEvents( + bool TranslateCameraInput::HandleEvents( const InputEvent& event, [[maybe_unused]] const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { if (const auto& input = AZStd::get_if(&event)) @@ -428,7 +455,8 @@ namespace AzFramework m_boost = true; } } - else if (input->m_state == InputChannel::State::Ended) + // ensure we don't process end events in the idle state + else if (input->m_state == InputChannel::State::Ended && !Idle()) { m_translation &= ~(translationFromKey(input->m_channelId)); if (m_translation == TranslationType::Nil) @@ -441,6 +469,8 @@ namespace AzFramework } } } + + return !Idle(); } Camera TranslateCameraInput::StepCamera( @@ -454,7 +484,8 @@ namespace AzFramework const auto axisY = translationBasis.GetBasisY(); const auto axisZ = translationBasis.GetBasisZ(); - const float speed = [boost = m_boost]() { + const float speed = [boost = m_boost]() + { return ed_cameraSystemTranslateSpeed * (boost ? ed_cameraSystemBoostMultiplier : 1.0f); }(); @@ -502,7 +533,7 @@ namespace AzFramework m_boost = false; } - void OrbitCameraInput::HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) + bool OrbitCameraInput::HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) { if (const auto* input = AZStd::get_if(&event)) { @@ -521,8 +552,10 @@ namespace AzFramework if (Active()) { - m_orbitCameras.HandleEvents(event, cursorDelta, scrollDelta); + return m_orbitCameras.HandleEvents(event, cursorDelta, scrollDelta); } + + return !Idle(); } Camera OrbitCameraInput::StepCamera( @@ -532,20 +565,41 @@ namespace AzFramework if (Beginning()) { - float hit_distance = 0.0f; - AZ::Plane::CreateFromNormalAndPoint(AZ::Vector3::CreateAxisZ(), AZ::Vector3::CreateAxisZ(ed_cameraSystemDefaultPlaneHeight)) - .CastRay(targetCamera.Translation(), targetCamera.Rotation().GetBasisY(), hit_distance); + const auto hasLookAt = [&nextCamera, &targetCamera, &lookAtFn = m_lookAtFn] + { + if (lookAtFn) + { + // pass through the camera's position and look vector for use in the lookAt function + if (const auto lookAt = lookAtFn(targetCamera.Translation(), targetCamera.Rotation().GetBasisY())) + { + auto transform = AZ::Transform::CreateLookAt(targetCamera.m_lookAt, *lookAt); + nextCamera.m_lookDist = -lookAt->GetDistance(targetCamera.m_lookAt); + UpdateCameraFromTransform(nextCamera, transform); - if (hit_distance > 0.0f) + return true; + } + } + return false; + }(); + + if (!hasLookAt) { - hit_distance = AZStd::min(hit_distance, ed_cameraSystemMaxOrbitDistance); - nextCamera.m_lookDist = -hit_distance; - nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * hit_distance; - } - else - { - nextCamera.m_lookDist = -ed_cameraSystemMaxOrbitDistance; - nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * ed_cameraSystemMaxOrbitDistance; + float hit_distance = 0.0f; + AZ::Plane::CreateFromNormalAndPoint(AZ::Vector3::CreateAxisZ(), AZ::Vector3::CreateAxisZ(ed_cameraSystemDefaultPlaneHeight)) + .CastRay(targetCamera.Translation(), targetCamera.Rotation().GetBasisY(), hit_distance); + + if (hit_distance > 0.0f) + { + hit_distance = AZStd::min(hit_distance, ed_cameraSystemMaxOrbitDistance); + nextCamera.m_lookDist = -hit_distance; + nextCamera.m_lookAt = targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * hit_distance; + } + else + { + nextCamera.m_lookDist = -ed_cameraSystemMinOrbitDistance; + nextCamera.m_lookAt = + targetCamera.Translation() + targetCamera.Rotation().GetBasisY() * ed_cameraSystemMinOrbitDistance; + } } } @@ -565,13 +619,15 @@ namespace AzFramework return nextCamera; } - void OrbitDollyScrollCameraInput::HandleEvents( + bool OrbitDollyScrollCameraInput::HandleEvents( const InputEvent& event, [[maybe_unused]] const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { if (const auto* scroll = AZStd::get_if(&event)) { BeginActivation(); } + + return !Idle(); } Camera OrbitDollyScrollCameraInput::StepCamera( @@ -589,7 +645,7 @@ namespace AzFramework { } - void OrbitDollyCursorMoveCameraInput::HandleEvents( + bool OrbitDollyCursorMoveCameraInput::HandleEvents( const InputEvent& event, [[maybe_unused]] const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { if (const auto& input = AZStd::get_if(&event)) @@ -606,6 +662,8 @@ namespace AzFramework } } } + + return !Idle(); } Camera OrbitDollyCursorMoveCameraInput::StepCamera( @@ -617,13 +675,15 @@ namespace AzFramework return nextCamera; } - void ScrollTranslationCameraInput::HandleEvents( + bool ScrollTranslationCameraInput::HandleEvents( const InputEvent& event, [[maybe_unused]] const ScreenVector& cursorDelta, [[maybe_unused]] float scrollDelta) { if (const auto* scroll = AZStd::get_if(&event)) { BeginActivation(); } + + return !Idle(); } Camera ScrollTranslationCameraInput::StepCamera( @@ -644,14 +704,20 @@ namespace AzFramework Camera SmoothCamera(const Camera& currentCamera, const Camera& targetCamera, const float deltaTime) { - const auto clamp_rotation = [](const float angle) { return AZStd::fmod(angle + AZ::Constants::TwoPi, AZ::Constants::TwoPi); }; + const auto clamp_rotation = [](const float angle) + { + return AZStd::fmod(angle + AZ::Constants::TwoPi, AZ::Constants::TwoPi); + }; // keep yaw in 0 - 360 range float targetYaw = clamp_rotation(targetCamera.m_yaw); const float currentYaw = clamp_rotation(currentCamera.m_yaw); // return the sign of the float input (-1, 0, 1) - const auto sign = [](const float value) { return aznumeric_cast((0.0f < value) - (value < 0.0f)); }; + const auto sign = [](const float value) + { + return aznumeric_cast((0.0f < value) - (value < 0.0f)); + }; // ensure smooth transition when moving across 0 - 360 boundary const float yawDelta = targetYaw - currentYaw; @@ -674,31 +740,33 @@ namespace AzFramework return camera; } - InputEvent BuildInputEvent(const InputChannel& inputChannel, const WindowSize& windowSize) + InputEvent BuildInputEvent(const InputChannel& inputChannel) { const auto& inputChannelId = inputChannel.GetInputChannelId(); const auto& inputDeviceId = inputChannel.GetInputDevice().GetInputDeviceId(); - const bool wasMouseButton = - AZStd::any_of(InputDeviceMouse::Button::All.begin(), InputDeviceMouse::Button::All.end(), [inputChannelId](const auto& button) { + const bool wasMouseButton = AZStd::any_of( + InputDeviceMouse::Button::All.begin(), InputDeviceMouse::Button::All.end(), + [inputChannelId](const auto& button) + { return button == inputChannelId; }); - if (inputChannelId == InputDeviceMouse::Movement::X || inputChannelId == InputDeviceMouse::Movement::Y) + if (inputChannelId == InputDeviceMouse::Movement::X) { - const auto* position = inputChannel.GetCustomData(); - AZ_Assert(position, "Expected PositionData2D but found nullptr"); - - return CursorEvent{ScreenPoint( - position->m_normalizedPosition.GetX() * windowSize.m_width, position->m_normalizedPosition.GetY() * windowSize.m_height)}; + return HorizontalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; + } + else if (inputChannelId == InputDeviceMouse::Movement::Y) + { + return VerticalMotionEvent{ aznumeric_cast(inputChannel.GetValue()) }; } else if (inputChannelId == InputDeviceMouse::Movement::Z) { - return ScrollEvent{inputChannel.GetValue()}; + return ScrollEvent{ inputChannel.GetValue() }; } else if (wasMouseButton || InputDeviceKeyboard::IsKeyboardDevice(inputDeviceId)) { - return DiscreteInputEvent{inputChannelId, inputChannel.GetState()}; + return DiscreteInputEvent{ inputChannelId, inputChannel.GetState() }; } return AZStd::monostate{}; diff --git a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.h b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.h index 41d7f11385..a02f796899 100644 --- a/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.h +++ b/Code/Framework/AzFramework/AzFramework/Viewport/CameraInput.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include @@ -35,9 +34,9 @@ namespace AzFramework AZ::Vector3 m_lookAt = AZ::Vector3::CreateZero(); //!< Position of camera when m_lookDist is zero, //!< or position of m_lookAt when m_lookDist is greater //!< than zero. - float m_yaw{0.0}; - float m_pitch{0.0}; - float m_lookDist{0.0}; //!< Zero gives first person free look, otherwise orbit about m_lookAt + float m_yaw{ 0.0 }; + float m_pitch{ 0.0 }; + float m_lookDist{ 0.0 }; //!< Zero gives first person free look, otherwise orbit about m_lookAt //! View camera transform (v in MVP). AZ::Transform View() const; @@ -72,11 +71,16 @@ namespace AzFramework void UpdateCameraFromTransform(Camera& camera, const AZ::Transform& transform); - struct CursorEvent + //! Generic motion type + template + struct MotionEvent { - ScreenPoint m_position; + int m_delta; }; + using HorizontalMotionEvent = MotionEvent; + using VerticalMotionEvent = MotionEvent; + struct ScrollEvent { float m_delta; @@ -88,7 +92,7 @@ namespace AzFramework InputChannel::State m_state; //!< Channel state. (e.g. Begin/update/end event). }; - using InputEvent = AZStd::variant; + using InputEvent = AZStd::variant; class CameraInput { @@ -149,7 +153,7 @@ namespace AzFramework ResetImpl(); } - virtual void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) = 0; + virtual bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) = 0; virtual Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) = 0; virtual bool Exclusive() const @@ -171,16 +175,34 @@ namespace AzFramework class Cameras { public: - void AddCamera(AZStd::shared_ptr cameraInput); bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta); Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime); + + void AddCamera(AZStd::shared_ptr cameraInput); + //! Reset the state of all cameras. void Reset(); + //! Remove all cameras that were added. + void Clear(); + //! Is one of the cameras in the active camera inputs marked as 'exclusive'. + //! @note This implies no other sibling cameras can begin while the exclusive camera is running. + bool Exclusive() const; private: AZStd::vector> m_activeCameraInputs; AZStd::vector> m_idleCameraInputs; }; + inline bool Cameras::Exclusive() const + { + return AZStd::any_of( + m_activeCameraInputs.begin(), m_activeCameraInputs.end(), + [](const auto& cameraInput) + { + return cameraInput->Exclusive(); + }); + } + + //! Responsible for updating a series of cameras given various inputs. class CameraSystem { public: @@ -190,8 +212,8 @@ namespace AzFramework Cameras m_cameras; private: - CursorState m_cursorState; - float m_scrollDelta = 0.0f; + ScreenVector m_motionDelta; //!< The delta used for look/orbit/pan (rotation + translation) - two dimensional. + float m_scrollDelta = 0.0f; //!< The delta used for dolly/movement (translation) - one dimensional. }; class RotateCameraInput : public CameraInput @@ -199,7 +221,8 @@ namespace AzFramework public: explicit RotateCameraInput(InputChannelId rotateChannelId); - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; private: @@ -218,7 +241,7 @@ namespace AzFramework inline PanAxes LookPan(const Camera& camera) { const AZ::Matrix3x3 orientation = camera.Rotation(); - return {orientation.GetBasisX(), orientation.GetBasisZ()}; + return { orientation.GetBasisX(), orientation.GetBasisZ() }; } inline PanAxes OrbitPan(const Camera& camera) @@ -226,12 +249,13 @@ namespace AzFramework const AZ::Matrix3x3 orientation = camera.Rotation(); const auto basisX = orientation.GetBasisX(); - const auto basisY = [&orientation] { + const auto basisY = [&orientation] + { const auto forward = orientation.GetBasisY(); return AZ::Vector3(forward.GetX(), forward.GetY(), 0.0f).GetNormalized(); }(); - return {basisX, basisY}; + return { basisX, basisY }; } class PanCameraInput : public CameraInput @@ -239,7 +263,8 @@ namespace AzFramework public: PanCameraInput(InputChannelId panChannelId, PanAxesFn panAxesFn); - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; private: @@ -265,7 +290,8 @@ namespace AzFramework const AZ::Matrix3x3 orientation = camera.Rotation(); const auto basisX = orientation.GetBasisX(); - const auto basisY = [&orientation] { + const auto basisY = [&orientation] + { const auto forward = orientation.GetBasisY(); return AZ::Vector3(forward.GetX(), forward.GetY(), 0.0f).GetNormalized(); }(); @@ -279,7 +305,8 @@ namespace AzFramework public: explicit TranslateCameraInput(TranslationAxesFn translationAxesFn); - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; void ResetImpl() override; @@ -348,7 +375,8 @@ namespace AzFramework class OrbitDollyScrollCameraInput : public CameraInput { public: - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; }; @@ -357,7 +385,8 @@ namespace AzFramework public: explicit OrbitDollyCursorMoveCameraInput(InputChannelId dollyChannelId); - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; private: @@ -367,25 +396,40 @@ namespace AzFramework class ScrollTranslationCameraInput : public CameraInput { public: - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; }; class OrbitCameraInput : public CameraInput { public: - void HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; + using LookAtFn = AZStd::function(const AZ::Vector3& position, const AZ::Vector3& direction)>; + + // CameraInput overrides ... + bool HandleEvents(const InputEvent& event, const ScreenVector& cursorDelta, float scrollDelta) override; Camera StepCamera(const Camera& targetCamera, const ScreenVector& cursorDelta, float scrollDelta, float deltaTime) override; - bool Exclusive() const override - { - return true; - } + bool Exclusive() const override; Cameras m_orbitCameras; + + //! Override the default behavior for how a look-at point is calculated. + void SetLookAtFn(const LookAtFn& lookAtFn); + + private: + LookAtFn m_lookAtFn; }; - struct WindowSize; + inline void OrbitCameraInput::SetLookAtFn(const LookAtFn& lookAtFn) + { + m_lookAtFn = lookAtFn; + } + + inline bool OrbitCameraInput::Exclusive() const + { + return true; + } //! Map from a generic InputChannel event to a camera specific InputEvent. - InputEvent BuildInputEvent(const InputChannel& inputChannel, const WindowSize& windowSize); + InputEvent BuildInputEvent(const InputChannel& inputChannel); } // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.cpp b/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.cpp index 4b8fbca36a..c276463554 100644 --- a/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.cpp +++ b/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.cpp @@ -17,6 +17,17 @@ namespace AzFramework { ClickDetector::ClickOutcome ClickDetector::DetectClick(const ClickEvent clickEvent, const ScreenVector& cursorDelta) { + const auto previousDetectionState = m_detectionState; + if (previousDetectionState == DetectionState::WaitingForMove) + { + // only allow the action to begin if the mouse has been moved a small amount + m_moveAccumulator += ScreenVectorLength(cursorDelta); + if (m_moveAccumulator > m_deadZone) + { + m_detectionState = DetectionState::Moved; + } + } + if (clickEvent == ClickEvent::Down) { const auto now = std::chrono::steady_clock::now(); @@ -52,15 +63,9 @@ namespace AzFramework return clickOutcome; } - if (m_detectionState == DetectionState::WaitingForMove) + if (previousDetectionState == DetectionState::WaitingForMove && m_detectionState == DetectionState::Moved) { - // only allow the action to begin if the mouse has been moved a small amount - m_moveAccumulator += ScreenVectorLength(cursorDelta); - if (m_moveAccumulator > m_deadZone) - { - m_detectionState = DetectionState::Moved; - return ClickOutcome::Move; - } + return ClickOutcome::Move; } return ClickOutcome::Nil; diff --git a/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.h b/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.h index 997ccd07d9..a595735d28 100644 --- a/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.h +++ b/Code/Framework/AzFramework/AzFramework/Viewport/ClickDetector.h @@ -50,7 +50,11 @@ namespace AzFramework //! Called from any type of 'handle event' function. ClickOutcome DetectClick(ClickEvent clickEvent, const ScreenVector& cursorDelta); + //! Override the default double click interval. + //! @note Default is 400ms - system default. void SetDoubleClickInterval(float doubleClickInterval); + //! Override the dead zone before a 'move' outcome will be triggered. + void SetDeadZone(float deadZone); private: //! Internal state of ClickDetector based on incoming events. @@ -72,4 +76,9 @@ namespace AzFramework { m_doubleClickInterval = doubleClickInterval; } + + inline void ClickDetector::SetDeadZone(const float deadZone) + { + m_deadZone = deadZone; + } } // namespace AzFramework diff --git a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp index cdb7ce0dd9..9ca17a6736 100644 --- a/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp +++ b/Code/Framework/AzFramework/AzFramework/Visibility/OctreeSystemComponent.cpp @@ -123,8 +123,9 @@ namespace AzFramework OctreeNode* insertCheck = this; while (insertCheck != nullptr) { - if (AZ::ShapeIntersection::Contains(insertCheck->m_bounds, boundingVolume)) + if (AZ::ShapeIntersection::Contains(insertCheck->m_bounds, boundingVolume) || !insertCheck->m_parent) { + // Insert here if the entry is fully contained or if we've reached the root node return insertCheck->Insert(octreeScene, entry); } insertCheck = insertCheck->m_parent; diff --git a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake index 8cff479ec8..13dff43f68 100644 --- a/Code/Framework/AzFramework/AzFramework/azframework_files.cmake +++ b/Code/Framework/AzFramework/AzFramework/azframework_files.cmake @@ -188,6 +188,12 @@ set(FILES Script/ScriptDebugMsgReflection.h Script/ScriptRemoteDebugging.cpp Script/ScriptRemoteDebugging.h + Session/ISessionHandlingRequests.h + Session/ISessionRequests.cpp + Session/ISessionRequests.h + Session/SessionConfig.cpp + Session/SessionConfig.h + Session/SessionNotifications.h StreamingInstall/StreamingInstall.h StreamingInstall/StreamingInstall.cpp StreamingInstall/StreamingInstallRequests.h diff --git a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp index 1ae3945bd6..d501271f59 100644 --- a/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp +++ b/Code/Framework/AzFramework/Platform/Linux/AzFramework/Asset/AssetSystemComponentHelper_Linux.cpp @@ -35,7 +35,8 @@ namespace AzFramework::AssetSystem::Platform if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { // Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure. - assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor"; + assetProcessorPath = + AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor"; if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { diff --git a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp index 6f1f860932..890b6b32c3 100644 --- a/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp +++ b/Code/Framework/AzFramework/Platform/Mac/AzFramework/Asset/AssetSystemComponentHelper_Mac.cpp @@ -34,7 +34,8 @@ namespace AzFramework::AssetSystem::Platform if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { // Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure. - assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.app"; + assetProcessorPath = + AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.app"; if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { diff --git a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp index b716778cf4..b0debfd3b0 100644 --- a/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp +++ b/Code/Framework/AzFramework/Platform/Windows/AzFramework/Asset/AssetSystemComponentHelper_Windows.cpp @@ -71,7 +71,8 @@ namespace AzFramework::AssetSystem::Platform if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { // Check for existence of one under a "bin" directory, i.e. engineRoot is an SDK structure. - assetProcessorPath = AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.exe"; + assetProcessorPath = + AZ::IO::FixedMaxPath{engineRoot} / "bin" / AZ_TRAIT_OS_PLATFORM_NAME / AZ_BUILD_CONFIGURATION_TYPE / "AssetProcessor.exe"; if (!AZ::IO::SystemFile::Exists(assetProcessorPath.c_str())) { diff --git a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h index 884562d7e8..28971dc779 100644 --- a/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h +++ b/Code/Framework/AzManipulatorTestFramework/Include/AzManipulatorTestFramework/ViewportInteraction.h @@ -41,6 +41,7 @@ namespace AzManipulatorTestFramework AZStd::optional ViewportScreenToWorld(const AzFramework::ScreenPoint& screenPosition, float depth) override; AZStd::optional ViewportScreenToWorldRay( const AzFramework::ScreenPoint& screenPosition) override; + float DeviceScalingFactor() override; private: // ViewportInteractionRequestBus ... bool GridSnappingEnabled(); diff --git a/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp b/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp index ebef9dea30..7d32187a74 100644 --- a/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp +++ b/Code/Framework/AzManipulatorTestFramework/Source/ViewportInteraction.cpp @@ -127,4 +127,9 @@ namespace AzManipulatorTestFramework { return {}; } -} // namespace AzManipulatorTestFramework + + float ViewportInteraction::DeviceScalingFactor() + { + return 1.0f; + } +}// namespace AzManipulatorTestFramework diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworking.h b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworking.h index 72ffce4202..fb6d217b80 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/INetworking.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/INetworking.h @@ -19,6 +19,8 @@ namespace AzNetworking { + using NetworkInterfaces = AZStd::unordered_map>; + //! @class INetworking //! @brief The interface for creating and working with network interfaces. class INetworking @@ -60,5 +62,25 @@ namespace AzNetworking //! @param name The name of the Compressor factory to unregister, must match result of factory->GetFactoryName() //! @return Whether the factory was found and unregistered virtual bool UnregisterCompressorFactory(AZ::Name name) = 0; + + //! Returns the raw network interfaces owned by the networking instance. + //! @return the raw network interfaces owned by the networking instance + virtual const NetworkInterfaces& GetNetworkInterfaces() const = 0; + + //! Returns the number of sockets monitored by our TcpListenThread. + //! @return the number of sockets monitored by our TcpListenThread + virtual uint32_t GetTcpListenThreadSocketCount() const = 0; + + //! Returns the total time spent updating our TcpListenThread. + //! @return the total time spent updating our TcpListenThread + virtual AZ::TimeMs GetTcpListenThreadUpdateTime() const = 0; + + //! Returns the number of sockets monitored by our UdpReaderThread. + //! @return the number of sockets monitored by our UdpReaderThread + virtual uint32_t GetUdpReaderThreadSocketCount() const = 0; + + //! Returns the total time spent updating our UdpReaderThread. + //! @return the total time spent updating our UdpReaderThread + virtual AZ::TimeMs GetUdpReaderThreadUpdateTime() const = 0; }; } diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.cpp b/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.cpp index c275ad9057..1a1476dcc8 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.cpp @@ -149,12 +149,37 @@ namespace AzNetworking return m_compressorFactories.erase(name) > 0; } + const NetworkInterfaces& NetworkingSystemComponent::GetNetworkInterfaces() const + { + return m_networkInterfaces; + } + + uint32_t NetworkingSystemComponent::GetTcpListenThreadSocketCount() const + { + return m_listenThread->GetSocketCount(); + } + + AZ::TimeMs NetworkingSystemComponent::GetTcpListenThreadUpdateTime() const + { + return m_listenThread->GetUpdateTimeMs(); + } + + uint32_t NetworkingSystemComponent::GetUdpReaderThreadSocketCount() const + { + return m_readerThread->GetSocketCount(); + } + + AZ::TimeMs NetworkingSystemComponent::GetUdpReaderThreadUpdateTime() const + { + return m_readerThread->GetUpdateTimeMs(); + } + void NetworkingSystemComponent::DumpStats([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) { - AZLOG_INFO("Total sockets monitored by TcpListenThread: %u", m_listenThread->GetSocketCount()); - AZLOG_INFO("Total time spent updating TcpListenThread: %lld", aznumeric_cast(m_listenThread->GetUpdateTimeMs())); - AZLOG_INFO("Total sockets monitored by UdpReaderThread: %u", m_readerThread->GetSocketCount()); - AZLOG_INFO("Total time spent updating UdpReaderThread: %lld", aznumeric_cast(m_readerThread->GetUpdateTimeMs())); + AZLOG_INFO("Total sockets monitored by TcpListenThread: %u", GetTcpListenThreadSocketCount()); + AZLOG_INFO("Total time spent updating TcpListenThread: %lld", aznumeric_cast(GetTcpListenThreadUpdateTime())); + AZLOG_INFO("Total sockets monitored by UdpReaderThread: %u", GetUdpReaderThreadSocketCount()); + AZLOG_INFO("Total time spent updating UdpReaderThread: %lld", aznumeric_cast(GetUdpReaderThreadUpdateTime())); for (auto& networkInterface : m_networkInterfaces) { diff --git a/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.h b/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.h index b0b4d83d54..2fdc773fb0 100644 --- a/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.h +++ b/Code/Framework/AzNetworking/AzNetworking/Framework/NetworkingSystemComponent.h @@ -63,6 +63,11 @@ namespace AzNetworking void RegisterCompressorFactory(ICompressorFactory* factory) override; AZStd::unique_ptr CreateCompressor(AZ::Name name) override; bool UnregisterCompressorFactory(AZ::Name name) override; + const NetworkInterfaces& GetNetworkInterfaces() const override; + uint32_t GetTcpListenThreadSocketCount() const override; + AZ::TimeMs GetTcpListenThreadUpdateTime() const override; + uint32_t GetUdpReaderThreadSocketCount() const override; + AZ::TimeMs GetUdpReaderThreadUpdateTime() const override; //! @} //! Console commands. @@ -74,7 +79,6 @@ namespace AzNetworking AZ_CONSOLEFUNC(NetworkingSystemComponent, DumpStats, AZ::ConsoleFunctorFlags::Null, "Dumps stats for all instantiated network interfaces"); - using NetworkInterfaces = AZStd::unordered_map>; NetworkInterfaces m_networkInterfaces; AZStd::unique_ptr m_listenThread; AZStd::unique_ptr m_readerThread; diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp index 78020cb09d..70000dc9a8 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocket.cpp @@ -116,8 +116,8 @@ namespace AzNetworking int32_t TcpSocket::Receive(uint8_t* outData, uint32_t size) const { - AZ_Assert(size > 0, "Invalid data size for send"); - AZ_Assert(outData != nullptr, "NULL data pointer passed to send"); + AZ_Assert(size > 0, "Invalid data size for receive"); + AZ_Assert(outData != nullptr, "NULL data pointer passed to receive"); if (!IsOpen()) { return SocketOpResultErrorNotOpen; @@ -176,7 +176,7 @@ namespace AzNetworking if (::bind(aznumeric_cast(m_socketFd), (const sockaddr*)&hints, sizeof(hints)) != 0) { const int32_t error = GetLastNetworkError(); - AZLOG_ERROR("Failed to bind socket (%d:%s)", error, GetNetworkErrorDesc(error)); + AZLOG_ERROR("Failed to bind TCP socket to port %u (%d:%s)", uint32_t(port), error, GetNetworkErrorDesc(error)); return false; } diff --git a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocketManager_Select.cpp b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocketManager_Select.cpp index 4070f74d67..e8b2527638 100644 --- a/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocketManager_Select.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/TcpTransport/TcpSocketManager_Select.cpp @@ -46,6 +46,12 @@ namespace AzNetworking void TcpSocketManager::ProcessEvents(AZ::TimeMs maxBlockMs, const SocketEventCallback& readCallback, const SocketEventCallback& writeCallback) { + if(static_cast(m_maxFd) <= 0 && m_socketFds.empty()) + { + // There are no available sockets to process + return; + } + m_readerFdSet = m_sourceFdSet; m_writerFdSet = m_sourceFdSet; diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp index 870545e6c8..5676d48150 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpNetworkInterface.cpp @@ -162,7 +162,7 @@ namespace AzNetworking const UdpReaderThread::ReceivedPackets* packets = m_readerThread.GetReceivedPackets(m_socket.get()); if (packets == nullptr) { - AZ_Assert(false, "nullptr was retrieved for the received packet buffer, check that the socket has been registered with the reader thread"); + // Socket is not yet registered with the reader thread and is likely still pending, try again later return; } diff --git a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp index e642c87623..cbb5f8e6c0 100644 --- a/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp +++ b/Code/Framework/AzNetworking/AzNetworking/UdpTransport/UdpSocket.cpp @@ -82,7 +82,7 @@ namespace AzNetworking if (::bind(static_cast(m_socketFd), (const sockaddr *)&hints, sizeof(hints)) != 0) { const int32_t error = GetLastNetworkError(); - AZLOG_ERROR("Failed to bind socket to port %u (%d:%s)", uint32_t(port), error, GetNetworkErrorDesc(error)); + AZLOG_ERROR("Failed to bind UDP socket to port %u (%d:%s)", uint32_t(port), error, GetNetworkErrorDesc(error)); return false; } } diff --git a/Code/Framework/AzNetworking/CMakeLists.txt b/Code/Framework/AzNetworking/CMakeLists.txt index 0fe95441ce..c6673058d7 100644 --- a/Code/Framework/AzNetworking/CMakeLists.txt +++ b/Code/Framework/AzNetworking/CMakeLists.txt @@ -65,5 +65,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME AZ::AzNetworking.Tests ) + + ly_add_googletest( + NAME AZ::AzNetworking.Tests.Sandbox + TARGET AZ::AzNetworking.Tests + TEST_SUITE sandbox + ) + endif() diff --git a/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp b/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp index eed12e1881..7cc3af5a51 100644 --- a/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp +++ b/Code/Framework/AzNetworking/Tests/TcpTransport/TcpTransportTests.cpp @@ -129,7 +129,7 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS TEST_F(TcpTransportTests, DISABLED_TestSingleClient) #else - TEST_F(TcpTransportTests, TestSingleClient) + TEST_F(TcpTransportTests, SUITE_sandbox_TestSingleClient) #endif // AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS { TestTcpServer testServer; @@ -157,7 +157,7 @@ namespace UnitTest #if AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS TEST_F(TcpTransportTests, DISABLED_TestMultipleClients) #else - TEST_F(TcpTransportTests, TestMultipleClients) + TEST_F(TcpTransportTests, SUITE_sandbox_TestMultipleClients) #endif // AZ_TRAIT_DISABLE_FAILED_NETWORKING_TESTS { constexpr uint32_t NumTestClients = 50; diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss index af9c675f23..7f48637cc8 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/Menu.qss @@ -49,7 +49,7 @@ QMenu::right-arrow QMenu::icon { - right: 8px; + right: 20px; } QMenu::indicator:checked diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Local.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Local.svg new file mode 100644 index 0000000000..2017cabe21 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Local.svg @@ -0,0 +1,8 @@ + + + Icon / Local + + + + + \ No newline at end of file diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Parent.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Parent.svg new file mode 100644 index 0000000000..c0b9580985 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/Parent.svg @@ -0,0 +1,8 @@ + + + Icon / Parent + + + + + \ No newline at end of file diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/World.svg b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/World.svg new file mode 100644 index 0000000000..4d77775e3d --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/img/UI20/toolbar/World.svg @@ -0,0 +1,8 @@ + + + Icon / World + + + + + \ No newline at end of file diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc index 8ea4755a24..00fa95d094 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc +++ b/Code/Framework/AzQtComponents/AzQtComponents/Components/resources.qrc @@ -354,6 +354,7 @@ img/UI20/toolbar/Grid.svg img/UI20/toolbar/Lighting.svg img/UI20/toolbar/Load.svg + img/UI20/toolbar/Local.svg img/UI20/toolbar/Locked.svg img/UI20/toolbar/LUA.svg img/UI20/toolbar/Material.svg @@ -362,6 +363,7 @@ img/UI20/toolbar/Object_follow_terrain.svg img/UI20/toolbar/Object_height.svg img/UI20/toolbar/Object_list.svg + img/UI20/toolbar/Parent.svg img/UI20/toolbar/particle.svg img/UI20/toolbar/Play.svg img/UI20/toolbar/Redo.svg @@ -380,6 +382,7 @@ img/UI20/toolbar/undo.svg img/UI20/toolbar/Unlocked.svg img/UI20/toolbar/Vertex_snapping.svg + img/UI20/toolbar/World.svg img/UI20/toolbar/X_axis.svg img/UI20/toolbar/Y_axis.svg img/UI20/toolbar/Z_axis.svg diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg b/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg new file mode 100644 index 0000000000..dfd21d157f --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Images/Notifications/link.svg @@ -0,0 +1,4 @@ + + + + diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc index dbbf0e78e2..7b0c6530ab 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc +++ b/Code/Framework/AzQtComponents/AzQtComponents/Images/resources.qrc @@ -13,5 +13,6 @@ Notifications/checkmark.svg Notifications/download.svg + Notifications/link.svg diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.cpp b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.cpp new file mode 100644 index 0000000000..ed7fda7fa8 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.cpp @@ -0,0 +1,167 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace AzQtComponents +{ + SelectionProxyModel::SelectionProxyModel(QItemSelectionModel* sourceSelectionModel, QAbstractProxyModel* proxyModel, QObject* parent) + : QItemSelectionModel(proxyModel, parent) + , m_sourceSelectionModel(sourceSelectionModel) + { + connect(sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged); + connect(sourceSelectionModel, &QItemSelectionModel::currentChanged, this, &SelectionProxyModel::OnSourceSelectionCurrentChanged); + connect(proxyModel, &QAbstractItemModel::rowsInserted, this, &SelectionProxyModel::OnProxyModelRowsInserted); + connect(this, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnProxySelectionChanged); + + // Find the chain of proxy models + QAbstractProxyModel* sourceProxyModel = proxyModel; + while (sourceProxyModel) + { + m_proxyModels.push_back(sourceProxyModel); + sourceProxyModel = qobject_cast(sourceProxyModel->sourceModel()); + } + + const QItemSelection currentSelection = mapFromSource(m_sourceSelectionModel->selection()); + QItemSelectionModel::select(currentSelection, QItemSelectionModel::ClearAndSelect); + + const QModelIndex currentModelIndex = mapFromSource(m_sourceSelectionModel->currentIndex()); + QItemSelectionModel::setCurrentIndex(currentModelIndex, QItemSelectionModel::ClearAndSelect); + } + + void SelectionProxyModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) + { + const QModelIndex sourcetIndex = mapToSource(index); + m_sourceSelectionModel->setCurrentIndex(sourcetIndex, command); + } + + void SelectionProxyModel::select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) + { + const QModelIndex sourceIndex = mapToSource(index); + m_sourceSelectionModel->select(sourceIndex, command); + } + + void SelectionProxyModel::select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) + { + const QItemSelection sourceSelection = mapToSource(selection); + m_sourceSelectionModel->select(sourceSelection, command); + } + + void SelectionProxyModel::clear() + { + m_sourceSelectionModel->clear(); + } + + void SelectionProxyModel::reset() + { + m_sourceSelectionModel->reset(); + } + + void SelectionProxyModel::clearCurrentIndex() + { + m_sourceSelectionModel->clearCurrentIndex(); + } + + void SelectionProxyModel::OnSourceSelectionCurrentChanged(const QModelIndex& current, [[maybe_unused]] const QModelIndex& previous) + { + QModelIndex targetCurrent = mapFromSource(current); + QItemSelectionModel::setCurrentIndex(targetCurrent, QItemSelectionModel::NoUpdate); + } + + void SelectionProxyModel::OnSourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) + { + QItemSelection targetSelected = mapFromSource(selected); + QItemSelection targetDeselected = mapFromSource(deselected); + + QItemSelectionModel::select(targetSelected, QItemSelectionModel::Select); + QItemSelectionModel::select(targetDeselected, QItemSelectionModel::Deselect); + } + + void SelectionProxyModel::OnProxySelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) + { + const QItemSelection sourceSelected = mapToSource(selected); + const QItemSelection sourceDeselected = mapToSource(deselected); + + // Disconnect from the selectionChanged signal in the source model to prevent recursion. We could also block the signals + // of the source selection model, but someone else may be connected to its signals and expect to get an update. + disconnect(m_sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged); + if (selected.empty() && deselected.empty()) + { + // Force the signal to fire + emit m_sourceSelectionModel->selectionChanged({}, {}); + } + else + { + m_sourceSelectionModel->select(sourceSelected, QItemSelectionModel::Select); + m_sourceSelectionModel->select(sourceDeselected, QItemSelectionModel::Deselect); + } + connect(m_sourceSelectionModel, &QItemSelectionModel::selectionChanged, this, &SelectionProxyModel::OnSourceSelectionChanged); + } + + void SelectionProxyModel::OnProxyModelRowsInserted([[maybe_unused]] const QModelIndex& parent, [[maybe_unused]] int first, [[maybe_unused]] int last) + { + QModelIndex sourceIndex = m_sourceSelectionModel->currentIndex(); + QModelIndex targetIndex = mapFromSource(sourceIndex); + if (targetIndex != currentIndex()) + { + QItemSelectionModel::setCurrentIndex(targetIndex, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); + } + + QItemSelection sourceSelection = m_sourceSelectionModel->selection(); + QItemSelection targetSelection = mapFromSource(sourceSelection); + if (targetSelection != selection()) + { + QItemSelectionModel::select(targetSelection, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + } + } + + QModelIndex SelectionProxyModel::mapFromSource(const QModelIndex& sourceIndex) + { + QModelIndex mappedIndex = sourceIndex; + for (QVector::const_reverse_iterator itProxy = m_proxyModels.rbegin(); itProxy != m_proxyModels.rend(); ++itProxy) + { + mappedIndex = (*itProxy)->mapFromSource(mappedIndex); + } + return mappedIndex; + } + + QItemSelection SelectionProxyModel::mapFromSource(const QItemSelection& sourceSelection) + { + QItemSelection mappedSelection = sourceSelection; + for (QVector::const_reverse_iterator itProxy = m_proxyModels.rbegin(); itProxy != m_proxyModels.rend(); ++itProxy) + { + mappedSelection = (*itProxy)->mapSelectionFromSource(mappedSelection); + } + return mappedSelection; + } + + QModelIndex SelectionProxyModel::mapToSource(const QModelIndex& targetIndex) + { + QModelIndex mappedIndex = targetIndex; + for (QVector::const_iterator itProxy = m_proxyModels.begin(); itProxy != m_proxyModels.end(); ++itProxy) + { + mappedIndex = (*itProxy)->mapToSource(mappedIndex); + } + return mappedIndex; + } + + QItemSelection SelectionProxyModel::mapToSource(const QItemSelection& targetSelection) + { + QItemSelection mappedSelection = targetSelection; + for (QVector::const_iterator itProxy = m_proxyModels.begin(); itProxy != m_proxyModels.end(); ++itProxy) + { + mappedSelection = (*itProxy)->mapSelectionToSource(mappedSelection); + } + return mappedSelection; + } +} // namespace AzQtComponents diff --git a/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.h b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.h new file mode 100644 index 0000000000..5187ed9cb0 --- /dev/null +++ b/Code/Framework/AzQtComponents/AzQtComponents/Utilities/SelectionProxyModel.h @@ -0,0 +1,66 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QAbstractProxyModel) + +namespace AzQtComponents +{ + //! This class is a QItemSelectionModel that syncs through proxy models and maintains + //! selection. In Qt we can have a model being filtered/sorted by proxy models. If the + //! selection model is connected to the original model, the view needs a new selection + //! model that understands the filtering. This class does that conversion. + //! @Note: this class does not support changing proxy models (anywhere in the chain). + //! The class will have to be recreated with the new proxy model. + class AZ_QT_COMPONENTS_API SelectionProxyModel + : public QItemSelectionModel + { + Q_OBJECT // AUTOMOC + + public: + SelectionProxyModel(QItemSelectionModel* sourceSelectionModel, QAbstractProxyModel* proxyModel, QObject* parent = nullptr); + + void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) override; + void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) override; + void select(const QItemSelection &selection, QItemSelectionModel::SelectionFlags command) override; + void clear() override; + void reset() override; + void clearCurrentIndex() override; + + private slots: + void OnSourceSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); + void OnSourceSelectionCurrentChanged(const QModelIndex& current, const QModelIndex& previous); + void OnProxySelectionChanged(const QItemSelection& selected, const QItemSelection& deselected); + void OnProxyModelRowsInserted(const QModelIndex& parent, int first, int last); + + private: + QModelIndex mapFromSource(const QModelIndex& sourceIndex); + QItemSelection mapFromSource(const QItemSelection& sourceSelection); + + QModelIndex mapToSource(const QModelIndex& targetIndex); + QItemSelection mapToSource(const QItemSelection& targetSelection); + + // Contains the chain of proxy models that leads us to the real model. The outer-most proxy model + // comes first and is followed by inner proxy models. + AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING + QVector m_proxyModels; + AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING + QItemSelectionModel* m_sourceSelectionModel; + }; +} // namespace AzQtComponents diff --git a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake index 30929b712b..33a35e0524 100644 --- a/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake +++ b/Code/Framework/AzQtComponents/AzQtComponents/azqtcomponents_files.cmake @@ -287,6 +287,8 @@ set(FILES Utilities/ScreenUtilities.cpp Utilities/ScreenGrabber.h Utilities/ScopedCleanup.h + Utilities/SelectionProxyModel.cpp + Utilities/SelectionProxyModel.h Utilities/TextUtilities.cpp Utilities/TextUtilities.h ) diff --git a/Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h b/Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h index 0090ce066b..855b4fe416 100644 --- a/Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h +++ b/Code/Framework/AzTest/AzTest/Platform/Linux/AzTest_Traits_Linux.h @@ -39,4 +39,3 @@ #define AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_EDITOR_TESTS true #define AZ_TRAIT_DISABLE_FAILED_METRICS_TESTS true -#define AZ_TRAIT_DISABLE_ASSET_JOB_PARALLEL_TESTS true diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorAssetSystemAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorAssetSystemAPI.h index 98e4c6b5eb..715de30bfa 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorAssetSystemAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorAssetSystemAPI.h @@ -60,10 +60,20 @@ namespace AzToolsFramework //! and is generally checked into source control. virtual const char* GetAbsoluteDevRootFolderPath() = 0; - /// Convert a full source path like "c:\\dev\gamename\\blah\\test.tga" into a relative product path. + /// Convert a full source path like "c:\\dev\\gamename\\blah\\test.tga" into a relative product path. /// asset paths never mention their alias and are relative to the asset cache root virtual bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& relativeProductPath) = 0; + /** Convert a source path like "c:\\dev\\gamename\\blah\\test.tga" into a relative source path, like "blah/test.tga". + * If no valid relative path could be created, the input source path will be returned in relativePath. + * @param sourcePath partial or full path to a source file. (The file doesn't need to exist) + * @param relativePath the output relative path for the source file, if a valid one could be created + * @param rootFilePath the root path that relativePath is relative to + * @return true if a valid relative path was created, false if it wasn't + */ + virtual bool GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& rootFilePath) = 0; + /// Convert a relative asset path like "blah/test.tga" to a full source path path. /// Once the asset processor has finished building, this function is capable of handling even when the extension changes /// or when the source is in a different folder or in a different location (such as inside gems) @@ -110,14 +120,14 @@ namespace AzToolsFramework /** * Query to see if a specific asset platform is enabled - * @param platform the asset platform to check e.g. es3, ios, etc. + * @param platform the asset platform to check e.g. android, ios, etc. * @return true if enabled, false otherwise */ virtual bool IsAssetPlatformEnabled(const char* platform) = 0; /** * Get the total number of pending assets left to process for a specific asset platform - * @param platform the asset platform to check e.g. es3, ios, etc. + * @param platform the asset platform to check e.g. android, ios, etc. * @return -1 if the process fails, a positive number otherwise */ virtual int GetPendingAssetsForPlatform(const char* platform) = 0; @@ -302,7 +312,7 @@ namespace AzToolsFramework inline const char* GetHostAssetPlatform() { #if defined(AZ_PLATFORM_MAC) - return "osx_gl"; + return "mac"; #elif defined(AZ_PLATFORM_WINDOWS) return "pc"; #elif defined(AZ_PLATFORM_LINUX) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorEntityAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorEntityAPI.h index f51af58c51..6c230ff5c7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorEntityAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorEntityAPI.h @@ -52,6 +52,21 @@ namespace AzToolsFramework * Deletes all entities in the provided list, as well as their transform descendants. */ virtual void DeleteEntitiesAndAllDescendants(const EntityIdList& entities) = 0; + + /** + * Duplicate all currently-selected entities. + */ + virtual void DuplicateSelected() = 0; + + /** + * Duplicates the specified entity. + */ + virtual void DuplicateEntityById(AZ::EntityId entityId) = 0; + + /** + * Duplicates all specified entities. + */ + virtual void DuplicateEntities(const EntityIdList& entities) = 0; }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorViewportIconDisplayInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorViewportIconDisplayInterface.h new file mode 100644 index 0000000000..a2264b5058 --- /dev/null +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/EditorViewportIconDisplayInterface.h @@ -0,0 +1,80 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include +#include + +#include + +namespace AzToolsFramework +{ + //! An interface for loading simple icon assets and rendering them to screen on a per-viewport basis. + class EditorViewportIconDisplayInterface + { + public: + AZ_RTTI(EditorViewportIconDisplayInterface, "{D5190B58-2561-4F3F-B793-F1E7D454CDF2}"); + + using IconId = AZ::s32; + static constexpr IconId InvalidIconId = -1; + + enum class CoordinateSpace : AZ::u8 + { + ScreenSpace, + WorldSpace + }; + + //! These draw parameters control rendering for a single icon to a single viewport. + struct DrawParameters + { + //! The ViewportId to render to. + AzFramework::ViewportId m_viewport = AzFramework::InvalidViewportId; + //! The icon ID, retrieved from GetOrLoadIconForPath, to render to screen. + IconId m_icon = InvalidIconId; + //! The color, including opacity, to render the icon with. White will render the icon as opaque in its original color. + AZ::Color m_color = AZ::Colors::White; + //! The position to render the icon to, in world or screen space depending on m_positionSpace. + AZ::Vector3 m_position; + //! The coordinate system to use for m_position. + //! ScreenSpace will accept m_position in the form of [X, Y, Depth], where X & Y are screen coordinates in + //! pixels and Depth is a z-ordering depth value from 0.0f to 1.0f. + //! WorldSpace will accept a 3D vector in world space coordinates that will be translated back into screen + //! space when the icon is rendered. + CoordinateSpace m_positionSpace = CoordinateSpace::ScreenSpace; + //! The size to render the icon as, in pixels. + AZ::Vector2 m_size; + }; + + //! The current load status of an icon retrieved by GetOrLoadIconForPath. + enum class IconLoadStatus : AZ::u8 + { + Unloaded, + Loading, + Loaded, + Error + }; + + //! Draws an icon to a viewport given a set of draw parameters. + //! Requires an IconId retrieved from GetOrLoadIconForPath. + virtual void DrawIcon(const DrawParameters& drawParameters) = 0; + //! Retrieves a reusable IconId for an icon at a given path. + //! This will load the icon, if it has not already been loaded. + //! @param path should be a relative asset path to an icon image asset. + //! png and svg icons are currently supported. + virtual IconId GetOrLoadIconForPath(AZStd::string_view path) = 0; + //! Gets the current load status of an icon retrieved via GetOrLoadIconForPath. + virtual IconLoadStatus GetIconLoadStatus(IconId icon) = 0; + }; + + using EditorViewportIconDisplay = AZ::Interface; +} //namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h index 82fa3f94f5..72150b1b57 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/API/ToolsApplicationAPI.h @@ -239,6 +239,11 @@ namespace AzToolsFramework */ virtual int RemoveDirtyEntity(AZ::EntityId target) = 0; + /*! + * Clears the dirty entity set. + */ + virtual void ClearDirtyEntities() = 0; + /*! * \return true if an undo/redo operation is in progress. */ diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp index 80d7fc7c5a..880217e807 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.cpp @@ -43,7 +43,7 @@ namespace AzToolsFramework void EditorEntityManager::DeleteEntityById(AZ::EntityId entityId) { - DeleteEntities({entityId}); + DeleteEntities(EntityIdList{ entityId }); } void EditorEntityManager::DeleteEntities(const EntityIdList& entities) @@ -53,12 +53,30 @@ namespace AzToolsFramework void EditorEntityManager::DeleteEntityAndAllDescendants(AZ::EntityId entityId) { - DeleteEntitiesAndAllDescendants({entityId}); + DeleteEntitiesAndAllDescendants(EntityIdList{ entityId }); } void EditorEntityManager::DeleteEntitiesAndAllDescendants(const EntityIdList& entities) { m_prefabPublicInterface->DeleteEntitiesAndAllDescendantsInInstance(entities); } + + void EditorEntityManager::DuplicateSelected() + { + EntityIdList selectedEntities; + ToolsApplicationRequestBus::BroadcastResult(selectedEntities, &ToolsApplicationRequests::GetSelectedEntities); + + m_prefabPublicInterface->DuplicateEntitiesInInstance(selectedEntities); + } + + void EditorEntityManager::DuplicateEntityById(AZ::EntityId entityId) + { + DuplicateEntities(EntityIdList{ entityId }); + } + + void EditorEntityManager::DuplicateEntities(const EntityIdList& entities) + { + m_prefabPublicInterface->DuplicateEntitiesInInstance(entities); + } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h index 580ad22bda..939f73729e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/EditorEntityManager.h @@ -31,6 +31,9 @@ namespace AzToolsFramework void DeleteEntities(const EntityIdList& entities) override; void DeleteEntityAndAllDescendants(AZ::EntityId entityId) override; void DeleteEntitiesAndAllDescendants(const EntityIdList& entities) override; + void DuplicateSelected() override; + void DuplicateEntityById(AZ::EntityId entityId) override; + void DuplicateEntities(const EntityIdList& entities) override; private: Prefab::PrefabPublicInterface* m_prefabPublicInterface = nullptr; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp index e77704c920..88057787bb 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.cpp @@ -1354,6 +1354,11 @@ namespace AzToolsFramework return static_cast(m_dirtyEntities.erase(entityId)); } + void ToolsApplication::ClearDirtyEntities() + { + m_dirtyEntities.clear(); + } + void ToolsApplication::UndoPressed() { if (m_undoStack) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h index 6c836ac888..bafced67bd 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Application/ToolsApplication.h @@ -85,6 +85,7 @@ namespace AzToolsFramework void AddDirtyEntity(AZ::EntityId entityId) override; int RemoveDirtyEntity(AZ::EntityId entityId) override; + void ClearDirtyEntities() override; bool IsDuringUndoRedo() override { return m_isDuringUndoRedo; } void UndoPressed() override; void RedoPressed() override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.cpp index 5529829913..4966d9cce9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.cpp @@ -265,6 +265,30 @@ namespace AzToolsFramework return response.m_resolved; } + bool AssetSystemComponent::GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& rootFilePath) + { + AzFramework::SocketConnection* engineConnection = AzFramework::SocketConnection::GetInstance(); + if (!engineConnection || !engineConnection->IsConnected()) + { + relativePath = sourcePath; + return false; + } + + AzFramework::AssetSystem::GenerateRelativeSourcePathRequest request(sourcePath); + AzFramework::AssetSystem::GenerateRelativeSourcePathResponse response; + if (!SendRequest(request, response)) + { + AZ_Error("Editor", false, "Failed to send GenerateRelativeSourcePath request for %s", sourcePath.c_str()); + relativePath = sourcePath; + return false; + } + + relativePath = response.m_relativeSourcePath; + rootFilePath = response.m_rootFolder; + return response.m_resolved; + } + bool AssetSystemComponent::GetFullSourcePathFromRelativeProductPath(const AZStd::string& relPath, AZStd::string& fullPath) { auto foundIt = m_assetSourceRelativePathToFullPathCache.find(relPath); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.h index 399ee1ac9d..9d839c60f5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Asset/AssetSystemComponent.h @@ -63,6 +63,8 @@ namespace AzToolsFramework const char* GetAbsoluteDevGameFolderPath() override; const char* GetAbsoluteDevRootFolderPath() override; bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& outputPath) override; + bool GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& outputPath, AZStd::string& watchFolder) override; bool GetFullSourcePathFromRelativeProductPath(const AZStd::string& relPath, AZStd::string& fullPath) override; bool GetAssetInfoById(const AZ::Data::AssetId& assetId, const AZ::Data::AssetType& assetType, const AZStd::string& platformName, AZ::Data::AssetInfo& assetInfo, AZStd::string& rootFilePath) override; bool GetSourceInfoBySourcePath(const char* sourcePath, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder) override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp index 9ab50a803c..92711f45b2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetPicker/AssetPickerDialog.cpp @@ -81,9 +81,20 @@ namespace AzToolsFramework m_ui->m_assetBrowserTreeViewWidget->SetName("AssetBrowserTreeView_" + name); + bool selectedAsset = false; + for (auto& assetId : selection.GetSelectedAssetIds()) { - m_ui->m_assetBrowserTreeViewWidget->SelectProduct(assetId); + if (assetId.IsValid()) + { + selectedAsset = true; + m_ui->m_assetBrowserTreeViewWidget->SelectProduct(assetId); + } + } + + if (!selectedAsset) + { + m_ui->m_assetBrowserTreeViewWidget->SelectFolder(selection.GetDefaultDirectory()); } setWindowTitle(tr("Pick %1").arg(m_selection.GetTitle())); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp index 65f361dc83..83734a24c3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.cpp @@ -93,6 +93,16 @@ namespace AzToolsFramework m_selectedAssetIds.push_back(selectedAssetId); } + void AssetSelectionModel::SetDefaultDirectory(AZStd::string_view defaultDirectory) + { + m_defaultDirectory = defaultDirectory; + } + + AZStd::string_view AssetSelectionModel::GetDefaultDirectory() const + { + return m_defaultDirectory; + } + AZStd::vector& AssetSelectionModel::GetResults() { return m_results; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h index 59cc9d05e2..5e9d23602a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/AssetSelectionModel.h @@ -47,6 +47,9 @@ namespace AzToolsFramework const AZStd::vector& GetSelectedAssetIds() const; void SetSelectedAssetIds(const AZStd::vector& selectedAssetIds); void SetSelectedAssetId(const AZ::Data::AssetId& selectedAssetId); + + void SetDefaultDirectory(AZStd::string_view defaultDirectory); + AZStd::string_view GetDefaultDirectory() const; AZStd::vector& GetResults(); const AssetBrowserEntry* GetResult(); @@ -72,6 +75,7 @@ namespace AzToolsFramework AZStd::vector m_selectedAssetIds; AZStd::vector m_results; + AZStd::string m_defaultDirectory; QString m_title; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp index eeee433835..6cd60b0015 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include @@ -270,7 +271,20 @@ namespace AzToolsFramework return false; } - bool AssetBrowserTreeView::SelectEntry(const QModelIndex& idxParent, const AZStd::vector& entries, const uint32_t entryPathIndex) + void AssetBrowserTreeView::SelectFolder(AZStd::string_view folderPath) + { + if (folderPath.size() == 0) + { + return; + } + + AZStd::vector entries; + AZ::StringFunc::Tokenize(folderPath, entries, "/"); + + SelectEntry(QModelIndex(), entries, 0, true); + } + + bool AssetBrowserTreeView::SelectEntry(const QModelIndex& idxParent, const AZStd::vector& entries, const uint32_t entryPathIndex, bool useDisplayName) { if (entries.empty()) { @@ -285,30 +299,43 @@ namespace AzToolsFramework auto rowIdx = model()->index(idx, 0, idxParent); auto rowEntry = GetEntryFromIndex(rowIdx); - // Check if this entry name matches the query - if (rowEntry && AzFramework::StringFunc::Equal(entry.c_str(), rowEntry->GetName().c_str(), true)) + if (rowEntry) { - // Final entry found - set it as the selected element - if (entryPathIndex == entries.size() - 1) - { - selectionModel()->clear(); - selectionModel()->select(rowIdx, QItemSelectionModel::Select); - setCurrentIndex(rowIdx); - return true; - } + // Check if this entry name matches the query + AZStd::string_view compareName = useDisplayName ? (const char*)(rowEntry->GetDisplayName().toUtf8()) : rowEntry->GetName().c_str(); - // If this isn't the final entry, it needs to be a folder for the path to be valid (otherwise, early out) - if (rowEntry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Folder) + if (AzFramework::StringFunc::Equal(entry.c_str(), compareName, true)) { - // Folder found - if the final entry is found, expand this folder so the final entry is viewable in the Asset Browser (otherwise, early out) - if (SelectEntry(rowIdx, entries, entryPathIndex + 1)) + // Final entry found - set it as the selected element + if (entryPathIndex == entries.size() - 1) { - expand(rowIdx); + if (rowEntry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Folder) + { + // Expand the item itself if it is a folder + expand(rowIdx); + } + + selectionModel()->clear(); + selectionModel()->select(rowIdx, QItemSelectionModel::Select); + setCurrentIndex(rowIdx); + return true; } + + // If this isn't the final entry, it needs to be a folder for the path to be valid (otherwise, early out) + if (rowEntry->GetEntryType() == AssetBrowserEntry::AssetEntryType::Folder) + { + // Folder found - if the final entry is found, expand this folder so the final entry is viewable in the Asset + // Browser (otherwise, early out) + if (SelectEntry(rowIdx, entries, entryPathIndex + 1, useDisplayName)) + { + expand(rowIdx); + return true; + } + } + + return false; } - - return false; } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h index 697396b09e..19cbd3745a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetBrowser/Views/AssetBrowserTreeView.h @@ -60,6 +60,8 @@ namespace AzToolsFramework AZStd::vector GetSelectedAssets() const; + void SelectFolder(AZStd::string_view folderPath); + ////////////////////////////////////////////////////////////////////////// // AssetBrowserViewRequestBus void SelectProduct(AZ::Data::AssetId assetID) override; @@ -67,6 +69,7 @@ namespace AzToolsFramework void ClearFilter() override; void Update() override; + ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -105,7 +108,7 @@ namespace AzToolsFramework QString m_name; bool SelectProduct(const QModelIndex& idxParent, AZ::Data::AssetId assetID); - bool SelectEntry(const QModelIndex& idxParent, const AZStd::vector& entryPathTokens, const uint32_t entryPathIndex = 0); + bool SelectEntry(const QModelIndex& idxParent, const AZStd::vector& entryPathTokens, const uint32_t entryPathIndex = 0, bool useDisplayName = false); //! Grab one entry from the source thumbnail list and update it void UpdateSCThumbnails(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp index 706d8243e2..a59b29ddf8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/AssetEditor/AssetEditorWidget.cpp @@ -483,6 +483,8 @@ namespace AzToolsFramework } } + m_dirty = false; + AddRecentPath(targetFilePath); SetStatusText(Status::assetCreated); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h index 19c236f509..32ea9db3da 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h @@ -12,6 +12,7 @@ #pragma once +#include #include #include #include @@ -46,10 +47,16 @@ namespace AzToolsFramework virtual Prefab::InstanceOptionalReference GetRootPrefabInstance() = 0; + //! Get all Assets generated by Prefab processing when entering Play-In Editor mode (Ctrl+G) + //! /return The vector of Assets generated by Prefab processing + virtual const AZStd::vector>& GetPlayInEditorAssetData() = 0; + virtual bool LoadFromStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) = 0; virtual bool SaveToStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) = 0; virtual void StartPlayInEditor() = 0; virtual void StopPlayInEditor() = 0; + + virtual void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) = 0; }; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp index 02243a8c77..7fd11ff9bf 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.cpp @@ -14,9 +14,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -55,7 +57,6 @@ namespace AzToolsFramework "Couldn't get prefab loader interface, it's a requirement for PrefabEntityOwnership system to work"); m_rootInstance = AZStd::unique_ptr(m_prefabSystemComponent->CreatePrefab({}, {}, "NewLevel.prefab")); - m_sliceOwnershipService.BusConnect(m_entityContextId); m_sliceOwnershipService.m_shouldAssertForLegacySlicesUsage = m_shouldAssertForLegacySlicesUsage; m_editorSliceOwnershipService.BusConnect(); @@ -89,14 +90,17 @@ namespace AzToolsFramework void PrefabEditorEntityOwnershipService::Reset() { - Prefab::TemplateId templateId = m_rootInstance->GetTemplateId(); - if (templateId != Prefab::InvalidTemplateId) + if (m_rootInstance) { - m_rootInstance->SetTemplateId(Prefab::InvalidTemplateId); - m_prefabSystemComponent->RemoveTemplate(templateId); + Prefab::TemplateId templateId = m_rootInstance->GetTemplateId(); + if (templateId != Prefab::InvalidTemplateId) + { + m_rootInstance->SetTemplateId(Prefab::InvalidTemplateId); + m_prefabSystemComponent->RemoveTemplate(templateId); + } + m_rootInstance->Reset(); + m_rootInstance->SetContainerEntityName("Level"); } - m_rootInstance->Reset(); - m_rootInstance->SetContainerEntityName("Level"); AzFramework::EntityOwnershipServiceNotificationBus::Event( m_entityContextId, &AzFramework::EntityOwnershipServiceNotificationBus::Events::OnEntityOwnershipServiceReset); @@ -200,7 +204,7 @@ namespace AzToolsFramework } m_rootInstance->SetTemplateId(templateId); - m_rootInstance->SetTemplateSourcePath(m_loaderInterface->GetRelativePathToProject(filename)); + m_rootInstance->SetTemplateSourcePath(m_loaderInterface->GenerateRelativePath(filename)); m_rootInstance->SetContainerEntityName("Level"); m_prefabSystemComponent->PropagateTemplateChanges(templateId); @@ -218,16 +222,15 @@ namespace AzToolsFramework bool PrefabEditorEntityOwnershipService::SaveToStream(AZ::IO::GenericStream& stream, AZStd::string_view filename) { - AZ::IO::Path relativePath = m_loaderInterface->GetRelativePathToProject(filename); + AZ::IO::Path relativePath = m_loaderInterface->GenerateRelativePath(filename); AzToolsFramework::Prefab::TemplateId templateId = m_prefabSystemComponent->GetTemplateIdFromFilePath(relativePath); m_rootInstance->SetTemplateSourcePath(relativePath); + if (templateId == AzToolsFramework::Prefab::InvalidTemplateId) { - // This has not been loaded yet, this is the case of being saved with a different name. - // Create it m_rootInstance->m_containerEntity->AddComponent(aznew Prefab::EditorPrefabComponent()); - HandleEntitiesAdded({m_rootInstance->m_containerEntity.get()}); + HandleEntitiesAdded({ m_rootInstance->m_containerEntity.get() }); AzToolsFramework::Prefab::PrefabDom dom; bool success = AzToolsFramework::Prefab::PrefabDomUtils::StoreInstanceInPrefabDom(*m_rootInstance, dom); @@ -236,7 +239,8 @@ namespace AzToolsFramework AZ_Error("Prefab", false, "Failed to convert current root instance into a DOM when saving file '%.*s'", AZ_STRING_ARG(filename)); return false; } - templateId = m_prefabSystemComponent->AddTemplate(relativePath, std::move(dom)); + templateId = m_prefabSystemComponent->AddTemplate(relativePath, AZStd::move(dom)); + if (templateId == AzToolsFramework::Prefab::InvalidTemplateId) { AZ_Error("Prefab", false, "Couldn't add new template id '%i' when saving file '%.*s'", templateId, AZ_STRING_ARG(filename)); @@ -263,6 +267,71 @@ namespace AzToolsFramework return false; } + void PrefabEditorEntityOwnershipService::CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) + { + AZ::IO::Path relativePath = m_loaderInterface->GenerateRelativePath(filename); + AzToolsFramework::Prefab::TemplateId templateId = m_prefabSystemComponent->GetTemplateIdFromFilePath(relativePath); + + m_rootInstance->SetTemplateSourcePath(relativePath); + + AZStd::string watchFolder; + AZ::Data::AssetInfo assetInfo; + bool sourceInfoFound = false; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + sourceInfoFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, templateFilename.c_str(), + assetInfo, watchFolder); + + if (sourceInfoFound) + { + AZStd::string fullPath; + AZ::StringFunc::Path::Join(watchFolder.c_str(), assetInfo.m_relativePath.c_str(), fullPath); + + // Get the default prefab and copy the Dom over to the new template being saved + Prefab::TemplateId defaultId = m_loaderInterface->LoadTemplateFromFile(fullPath.c_str()); + Prefab::PrefabDom& dom = m_prefabSystemComponent->FindTemplateDom(defaultId); + + Prefab::PrefabDom levelDefaultDom; + levelDefaultDom.CopyFrom(dom, levelDefaultDom.GetAllocator()); + + Prefab::PrefabDomPath sourcePath("/Source"); + sourcePath.Set(levelDefaultDom, relativePath.c_str()); + + templateId = m_prefabSystemComponent->AddTemplate(relativePath, AZStd::move(levelDefaultDom)); + } + else + { + m_rootInstance->m_containerEntity->AddComponent(aznew Prefab::EditorPrefabComponent()); + HandleEntitiesAdded({ m_rootInstance->m_containerEntity.get() }); + + AzToolsFramework::Prefab::PrefabDom dom; + bool success = AzToolsFramework::Prefab::PrefabDomUtils::StoreInstanceInPrefabDom(*m_rootInstance, dom); + if (!success) + { + AZ_Error( + "Prefab", false, "Failed to convert current root instance into a DOM when saving file '%.*s'", AZ_STRING_ARG(filename)); + return; + } + templateId = m_prefabSystemComponent->AddTemplate(relativePath, std::move(dom)); + } + + if (templateId == AzToolsFramework::Prefab::InvalidTemplateId) + { + AZ_Error("Prefab", false, "Couldn't create new template id '%i' when creating new level '%.*s'", templateId, AZ_STRING_ARG(filename)); + return; + } + + Prefab::TemplateId prevTemplateId = m_rootInstance->GetTemplateId(); + m_rootInstance->SetTemplateId(templateId); + + if (prevTemplateId != Prefab::InvalidTemplateId && templateId != prevTemplateId) + { + // Make sure we only have one level template loaded at a time + m_prefabSystemComponent->RemoveTemplate(prevTemplateId); + } + + m_prefabSystemComponent->PropagateTemplateChanges(templateId); + } + Prefab::InstanceOptionalReference PrefabEditorEntityOwnershipService::CreatePrefab( const AZStd::vector& entities, AZStd::vector>&& nestedPrefabInstances, AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder) @@ -311,7 +380,17 @@ namespace AzToolsFramework Prefab::InstanceOptionalReference PrefabEditorEntityOwnershipService::GetRootPrefabInstance() { AZ_Assert(m_rootInstance, "A valid root prefab instance couldn't be found in PrefabEditorEntityOwnershipService."); - return *m_rootInstance; + if (m_rootInstance) + { + return *m_rootInstance; + } + + return AZStd::nullopt; + } + + const AZStd::vector>& PrefabEditorEntityOwnershipService::GetPlayInEditorAssetData() + { + return m_playInEditorData.m_assets; } void PrefabEditorEntityOwnershipService::OnEntityRemoved(AZ::EntityId entityId) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h index 48e07df091..d8eb81dd40 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/PrefabEditorEntityOwnershipService.h @@ -170,6 +170,8 @@ namespace AzToolsFramework void StartPlayInEditor() override; void StopPlayInEditor() override; + void CreateNewLevelPrefab(AZStd::string_view filename, const AZStd::string& templateFilename) override; + protected: AZ::SliceComponent::SliceInstanceAddress GetOwningSlice() override; @@ -195,6 +197,8 @@ namespace AzToolsFramework AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder) override; Prefab::InstanceOptionalReference GetRootPrefabInstance() override; + + const AZStd::vector>& GetPlayInEditorAssetData() override; ////////////////////////////////////////////////////////////////////////// void OnEntityRemoved(AZ::EntityId entityId); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp index 906ea98357..14dcf5e55d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Entity/SliceEditorEntityOwnershipService.cpp @@ -614,7 +614,7 @@ namespace AzToolsFramework AZ::Quaternion oldEntityRotation; AZ::TransformBus::EventResult(oldEntityRotation, id, &AZ::TransformBus::Events::GetWorldRotationQuaternion); - transformComponent->SetRotationQuaternion(oldEntityRotation); + transformComponent->SetWorldRotationQuaternion(oldEntityRotation); // Ensure the existing hierarchy is maintained AZ::EntityId oldParentEntityId; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LineSegmentSelectionManipulator.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LineSegmentSelectionManipulator.cpp index a8fe0e55bd..8874e0dcd9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LineSegmentSelectionManipulator.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LineSegmentSelectionManipulator.cpp @@ -31,7 +31,7 @@ namespace AzToolsFramework rayProportion, lineSegmentProportion, worldClosestPositionRay, worldClosestPositionLineSegment); AZ::Transform worldFromLocalNormalized = worldFromLocal; - const AZ::Vector3 scale = worldFromLocalNormalized.ExtractScale() * nonUniformScale; + const AZ::Vector3 scale = worldFromLocalNormalized.ExtractUniformScale() * nonUniformScale; const AZ::Transform localFromWorldNormalized = worldFromLocalNormalized.GetInverse(); return { (localFromWorldNormalized.TransformPoint(worldClosestPositionLineSegment)) / scale }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LinearManipulator.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LinearManipulator.cpp index 87d966fe84..aa84fc5752 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LinearManipulator.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/LinearManipulator.cpp @@ -59,7 +59,7 @@ namespace AzToolsFramework ? CalculateSnappedOffset(localTransform.GetTranslation(), axis, gridSize * scaleRecip) : AZ::Vector3::CreateZero(); - const AZ::Vector3 localScale = localTransform.GetScale(); + const AZ::Vector3 localScale = AZ::Vector3(localTransform.GetUniformScale()); const AZ::Quaternion localRotation = QuaternionFromTransformNoScaling(localTransform); // calculate scale amount to snap, to align to round scale value const AZ::Vector3 scaleSnapOffset = snapping && !gridSnapAction.m_localSnapping diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.h index db0baa1479..e6c70079df 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSnapping.h @@ -113,7 +113,7 @@ namespace AzToolsFramework /// noise in the value returned when dealing with values far from the origin. inline float ScaleReciprocal(const AZ::Transform& transform) { - return Round3(transform.GetScale().GetReciprocal().GetMinElement()); + return Round3(1.0f / transform.GetUniformScale()); } /// Find the reciprocal of the non-uniform scale. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp index fba7e35078..b3f691a62f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorSpace.cpp @@ -39,7 +39,7 @@ namespace AzToolsFramework AZ::Transform result; result.SetRotation(m_space.GetRotation() * localTransform.GetRotation()); result.SetTranslation(m_space.TransformPoint(m_nonUniformScale * localTransform.GetTranslation())); - result.SetScale(m_space.GetScale() * localTransform.GetScale()); + result.SetUniformScale(m_space.GetUniformScale() * localTransform.GetUniformScale()); return result; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorView.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorView.cpp index ce151f2078..150e23041d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorView.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ManipulatorView.cpp @@ -447,17 +447,14 @@ namespace AzToolsFramework m_radius * viewScale); debugDisplay.SetColor(ViewColor(manipulatorState.m_mouseOver, m_color, m_mouseOverColor).GetAsVector4()); - - // show wireframe if the axis has been corrected/flipped - // note: please see IRenderAuxGeom.h for the definition of e_FillModeWireframe and e_FillModeSolid. - // it is not possible to include IRenderAuxGeom from here and we also don't want to introduce that dependency. - // these legacy enums should be wrapped so set SetFillMode can be used in a type safe way, until then, - // use the values directly until the API has been updated. - const AZ::u32 prevFillMode = debugDisplay.SetFillMode( - m_shouldCorrect ? /*e_FillModeWireframe =*/ 0x1 << 26 : /*e_FillModeSolid =*/ 0); - - debugDisplay.DrawCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height, false); - debugDisplay.SetFillMode(prevFillMode); + if (m_shouldCorrect) + { + debugDisplay.DrawWireCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height); + } + else + { + debugDisplay.DrawSolidCone(coneBound.m_base, coneBound.m_axis, coneBound.m_radius, coneBound.m_height, false); + } RefreshBoundInternal(managerId, manipulatorId, coneBound); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ScaleManipulators.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ScaleManipulators.cpp index 3af09f644d..caeedd834f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ScaleManipulators.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Manipulators/ScaleManipulators.cpp @@ -82,9 +82,7 @@ namespace AzToolsFramework m_uniformScaleManipulator->SetVisualOrientationOverride( QuaternionFromTransformNoScaling(localTransform)); - m_uniformScaleManipulator->SetLocalTransform( - AZ::Transform::CreateTranslation(localTransform.GetTranslation()) * - AZ::Transform::CreateScale(localTransform.GetScale())); + m_uniformScaleManipulator->SetLocalOrientation(AZ::Quaternion::CreateIdentity()); } void ScaleManipulators::SetLocalPositionImpl(const AZ::Vector3& localPosition) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h index 247be33839..a3cc12566f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Maths/TransformUtils.h @@ -23,7 +23,7 @@ namespace AzToolsFramework inline AZ::Transform TransformNormalizedScale(const AZ::Transform& transform) { AZ::Transform transformNormalizedScale = transform; - transformNormalizedScale.SetScale(AZ::Vector3::CreateOne()); + transformNormalizedScale.SetUniformScale(1.0f); return transformNormalizedScale; } @@ -33,8 +33,7 @@ namespace AzToolsFramework inline AZ::Transform TransformUniformScale(const AZ::Transform& transform) { AZ::Transform transformUniformScale = transform; - const float maxScale = transformUniformScale.GetScale().GetMaxElement(); - transformUniformScale.SetScale(AZ::Vector3(maxScale)); + transformUniformScale.SetUniformScale(transformUniformScale.GetUniformScale()); return transformUniformScale; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp index 836140eb74..39351df486 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceSerializer.cpp @@ -124,7 +124,7 @@ namespace AzToolsFramework "PrefabLoaderInterface could not be found. It is required to load Prefab Instances"); // Make sure we have a relative path - instance->m_templateSourcePath = loaderInterface->GetRelativePathToProject(instance->m_templateSourcePath); + instance->m_templateSourcePath = loaderInterface->GenerateRelativePath(instance->m_templateSourcePath); TemplateId templateId = prefabSystemComponentInterface->GetTemplateIdFromFilePath(instance->GetTemplateSourcePath()); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceToTemplatePropagator.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceToTemplatePropagator.cpp index a21c5301aa..6d3ddedd51 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceToTemplatePropagator.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceToTemplatePropagator.cpp @@ -276,18 +276,14 @@ namespace AzToolsFramework PrefabDomValueReference linkPatchesReference = PrefabDomUtils::FindPrefabDomValue(linkDom, PrefabDomUtils::PatchesName); - // This logic only covers addition of patches. If patches already exists, the given list of patches must be appended to them. - if (!linkPatchesReference.has_value()) - { - /* - If the original allocator the patches were created with gets destroyed, then the patches would become garbage in the - linkDom. Since we cannot guarantee the lifecycle of the patch allocators, we are doing a copy of the patches here to - associate them with the linkDom's allocator. - */ - PrefabDom patchesCopy; - patchesCopy.CopyFrom(patches, linkDom.GetAllocator()); - linkDom.AddMember(rapidjson::StringRef(PrefabDomUtils::PatchesName), patchesCopy, linkDom.GetAllocator()); - } + /* + If the original allocator the patches were created with gets destroyed, then the patches would become garbage in the + linkDom. Since we cannot guarantee the lifecycle of the patch allocators, we are doing a copy of the patches here to + associate them with the linkDom's allocator. + */ + PrefabDom patchesCopy; + patchesCopy.CopyFrom(patches, linkDom.GetAllocator()); + linkDom.AddMember(rapidjson::StringRef(PrefabDomUtils::PatchesName), patchesCopy, linkDom.GetAllocator()); } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceUpdateExecutor.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceUpdateExecutor.cpp index fa03ab22e5..e0d29f2ab1 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceUpdateExecutor.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Instance/InstanceUpdateExecutor.cpp @@ -134,9 +134,13 @@ namespace AzToolsFramework } } - auto findInstancesResult = m_templateInstanceMapperInterface->FindInstancesOwnedByTemplate(instanceTemplateId)->get(); + auto findInstancesResult = m_templateInstanceMapperInterface->FindInstancesOwnedByTemplate(instanceTemplateId); + AZ_Assert( + findInstancesResult.has_value(), "Prefab Instances corresponding to template with id %llu couldn't be found.", + instanceTemplateId); - if (findInstancesResult.find(instanceToUpdate) == findInstancesResult.end()) + if (findInstancesResult == AZStd::nullopt || + findInstancesResult->get().find(instanceToUpdate) == findInstancesResult->get().end()) { // Since nested instances get reconstructed during propagation, remove any nested instance that no longer // maps to a template. diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.cpp index e0834ed53b..2fb22ea8e8 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.cpp @@ -182,16 +182,16 @@ namespace AzToolsFramework else { AZ::JsonSerializationResult::ResultCode applyPatchResult = AZ::JsonSerialization::ApplyPatch( - linkedInstanceDom, + sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator(), - sourceTemplatePrefabDom, patchesReference->get(), AZ::JsonMergeApproach::JsonPatch); + linkedInstanceDom.CopyFrom(sourceTemplateDomCopy, targetTemplatePrefabDom.GetAllocator()); if (applyPatchResult.GetProcessing() != AZ::JsonSerializationResult::Processing::Completed) { - AZ_Error("Prefab", false, - "Link::UpdateTarget - " - "ApplyPatches failed for Prefab DOM from source Template '%u' and target Template '%u'.", + AZ_Error( + "Prefab", false, + "Link::UpdateTarget - ApplyPatches failed for Prefab DOM from source Template '%u' and target Template '%u'.", m_sourceTemplateId, m_targetTemplateId); return false; } @@ -234,5 +234,10 @@ namespace AzToolsFramework } } + PrefabDomValueReference Link::GetLinkPatches() + { + return PrefabDomUtils::FindPrefabDomValue(m_linkDom, PrefabDomUtils::PatchesName); + } + } // namespace Prefab } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.h index 073e619f20..c8f43b291e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Link/Link.h @@ -79,6 +79,8 @@ namespace AzToolsFramework */ void AddLinkIdToInstanceDom(PrefabDomValue& instanceDomValue); + PrefabDomValueReference GetLinkPatches(); + private: /** diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h index 5ee91c85ae..4feecb9da3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabDomUtils.h @@ -28,6 +28,7 @@ namespace AzToolsFramework inline static const char* PatchesName = "Patches"; inline static const char* SourceName = "Source"; inline static const char* LinkIdName = "LinkId"; + inline static const char* EntityIdName = "Id"; inline static const char* EntitiesName = "Entities"; inline static const char* ContainerEntityName = "ContainerEntity"; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp index 7b4761c39a..e4507227b5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.cpp @@ -18,7 +18,9 @@ #include #include +#include #include +#include #include #include #include @@ -41,7 +43,7 @@ namespace AzToolsFramework [[maybe_unused]] bool result = settingsRegistry->Get(m_projectPathWithOsSeparator.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_ProjectPath); - AZ_Assert(result, "Couldn't retrieve project root path"); + AZ_Warning("Prefab", result, "Couldn't retrieve project root path"); m_projectPathWithSlashSeparator = AZ::IO::Path(m_projectPathWithOsSeparator.Native(), '/').MakePreferred(); AZ::Interface::Register(this); @@ -112,7 +114,7 @@ namespace AzToolsFramework return InvalidTemplateId; } - AZ::IO::Path relativePath = GetRelativePathToProject(originPath); + AZ::IO::Path relativePath = GenerateRelativePath(originPath); // Cyclical dependency detected if the prefab file is already part of the progressed // file path set. @@ -385,21 +387,100 @@ namespace AzToolsFramework AZ::IO::Path pathWithOSSeparator = AZ::IO::Path(path).MakePreferred(); if (pathWithOSSeparator.IsAbsolute()) { + // If an absolute path was passed in, just return it as-is. return path; } - return AZ::IO::Path(m_projectPathWithOsSeparator).Append(pathWithOSSeparator); + // A relative path was passed in, so try to turn it back into an absolute path. + + AZ::IO::Path fullPath; + + bool pathFound = false; + AZ::Data::AssetInfo assetInfo; + AZStd::string rootFolder; + AZStd::string inputPath(path.Native()); + + // Given an input path that's expected to exist, try to look it up. + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + pathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, + inputPath.c_str(), assetInfo, rootFolder); + + if (pathFound) + { + // The asset system provided us with a valid root folder and relative path, so return it. + fullPath = AZ::IO::Path(rootFolder) / assetInfo.m_relativePath; + } + else + { + // If for some reason the Asset system couldn't provide a relative path, provide some fallback logic. + + // Check to see if the AssetProcessor is ready. If it *is* and we didn't get a path, print an error then follow + // the fallback logic. If it's *not* ready, we're probably either extremely early in a tool startup flow or inside + // a unit test, so just execute the fallback logic without an error. + [[maybe_unused]] bool assetProcessorReady = false; + AzFramework::AssetSystemRequestBus::BroadcastResult( + assetProcessorReady, &AzFramework::AssetSystemRequestBus::Events::AssetProcessorIsReady); + + AZ_Error( + "Prefab", !assetProcessorReady, "Full source path for '%.*s' could not be determined. Using fallback logic.", + AZ_STRING_ARG(path.Native())); + + // If a relative path was passed in, make it relative to the project root. + fullPath = AZ::IO::Path(m_projectPathWithOsSeparator).Append(pathWithOSSeparator); + } + + return fullPath; } - AZ::IO::Path PrefabLoader::GetRelativePathToProject(AZ::IO::PathView path) + AZ::IO::Path PrefabLoader::GenerateRelativePath(AZ::IO::PathView path) { - AZ::IO::Path pathWithOSSeparator = AZ::IO::Path(path.Native()).MakePreferred(); - if (!pathWithOSSeparator.IsAbsolute()) + bool pathFound = false; + + AZStd::string relativePath; + AZStd::string rootFolder; + AZ::IO::Path finalPath; + + // The asset system allows for paths to be relative to multiple root folders, using a priority system. + // This request will make the input path relative to the most appropriate, highest-priority root folder. + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + pathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GenerateRelativeSourcePath, path.Native(), + relativePath, rootFolder); + + if (pathFound && !relativePath.empty()) { - return path; + // A relative path was generated successfully, so return it. + finalPath = relativePath; + } + else + { + // If for some reason the Asset system couldn't provide a relative path, provide some fallback logic. + + // Check to see if the AssetProcessor is ready. If it *is* and we didn't get a path, print an error then follow + // the fallback logic. If it's *not* ready, we're probably either extremely early in a tool startup flow or inside + // a unit test, so just execute the fallback logic without an error. + [[maybe_unused]] bool assetProcessorReady = false; + AzFramework::AssetSystemRequestBus::BroadcastResult( + assetProcessorReady, &AzFramework::AssetSystemRequestBus::Events::AssetProcessorIsReady); + + AZ_Error("Prefab", !assetProcessorReady, + "Relative source path for '%.*s' could not be determined. Using project path as relative root.", + AZ_STRING_ARG(path.Native())); + + AZ::IO::Path pathWithOSSeparator = AZ::IO::Path(path.Native()).MakePreferred(); + + if (pathWithOSSeparator.IsAbsolute()) + { + // If an absolute path was passed in, make it relative to the project path. + finalPath = AZ::IO::Path(path.Native(), '/').MakePreferred().LexicallyRelative(m_projectPathWithSlashSeparator); + } + else + { + // If a relative path was passed in, just return it. + finalPath = path; + } } - return AZ::IO::Path(path.Native(), '/').MakePreferred().LexicallyRelative(m_projectPathWithSlashSeparator); + return finalPath; } AZ::IO::Path PrefabLoaderInterface::GeneratePath() diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.h index d11cb62ca3..aed24e153e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoader.h @@ -91,9 +91,11 @@ namespace AzToolsFramework //! The path will always have the correct separator for the current OS AZ::IO::Path GetFullPath(AZ::IO::PathView path) override; - //! Converts path into a relative path to the project, this will be the paths in .prefab file. - //! The path will always have '/' separator. - AZ::IO::Path GetRelativePathToProject(AZ::IO::PathView path) override; + //! Converts path into a path that's relative to the highest-priority containing folder of all the folders registered + //! with the engine. + //! This path will be the path that appears in the .prefab file. + //! The path will always use the '/' separator. + AZ::IO::Path GenerateRelativePath(AZ::IO::PathView path) override; //! Returns if the path is a valid path for a prefab static bool IsValidPrefabPath(AZ::IO::PathView path); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoaderInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoaderInterface.h index a4055fb15a..d71fbff80f 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoaderInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabLoaderInterface.h @@ -74,9 +74,11 @@ namespace AzToolsFramework //! The path will always have the correct separator for the current OS virtual AZ::IO::Path GetFullPath(AZ::IO::PathView path) = 0; - //! Converts path into a relative path to the current project, this will be the paths in .prefab file. - //! The path will always have '/' separator. - virtual AZ::IO::Path GetRelativePathToProject(AZ::IO::PathView path) = 0; + //! Converts path into a path that's relative to the highest-priority containing folder of all the folders registered + //! with the engine. + //! This path will be the path that appears in the .prefab file. + //! The path will always use the '/' separator. + virtual AZ::IO::Path GenerateRelativePath(AZ::IO::PathView path) = 0; protected: diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp index 200a5c96fb..9dd5199ea2 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.cpp @@ -10,9 +10,9 @@ * */ -#include - #include +#include +#include #include #include @@ -26,11 +26,14 @@ #include #include #include +#include #include #include #include #include +#include + namespace AzToolsFramework { namespace Prefab @@ -83,7 +86,9 @@ namespace AzToolsFramework commonRootInstanceDomBeforeCreate, commonRootEntityOwningInstance->get()); AZStd::vector entities; - AZStd::vector> instances; + AZStd::vector> instancePtrs; + AZStd::vector instances; + AZStd::unordered_map nestedInstanceLinkPatchesMap; // Retrieve all entities affected and identify Instances if (!RetrieveAndSortPrefabEntitiesAndInstances(inputEntityList, commonRootEntityOwningInstance->get(), entities, instances)) @@ -92,11 +97,38 @@ namespace AzToolsFramework AZStd::string("Could not create a new prefab out of the entities provided - invalid selection.")); } + AZStd::unordered_map oldEntityAliases; + + // Detach the retrieved entities + for (AZ::Entity* entity : entities) + { + AZ::EntityId entityId = entity->GetId(); + oldEntityAliases.emplace(entityId, commonRootEntityOwningInstance->get().GetEntityAlias(entityId)->get()); + commonRootEntityOwningInstance->get().DetachEntity(entity->GetId()).release(); + } + // When we create a prefab with other prefab instances, we have to remove the existing links between the source and // target templates of the other instances. for (auto& nestedInstance : instances) { - RemoveLink(nestedInstance, commonRootEntityOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch()); + AZStd::unique_ptr outInstance = commonRootEntityOwningInstance->get().DetachNestedInstance(nestedInstance->GetInstanceAlias()); + + LinkId detachingInstanceLinkId = nestedInstance->GetLinkId(); + auto linkRef = m_prefabSystemComponentInterface->FindLink(detachingInstanceLinkId); + AZ_Assert(linkRef.has_value(), "Unable to find link with id '%llu' during prefab creation.", detachingInstanceLinkId); + + PrefabDomValueReference linkPatches = linkRef->get().GetLinkPatches(); + AZ_Assert( + linkPatches.has_value(), "Unable to get patches on link with id '%llu' during prefab creation.", + detachingInstanceLinkId); + + PrefabDom linkPatchesCopy; + linkPatchesCopy.CopyFrom(linkPatches->get(), linkPatchesCopy.GetAllocator()); + nestedInstanceLinkPatchesMap.emplace(nestedInstance, AZStd::move(linkPatchesCopy)); + + RemoveLink(outInstance, commonRootEntityOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch()); + + instancePtrs.emplace_back(AZStd::move(outInstance)); } PrefabUndoHelpers::UpdatePrefabInstance( @@ -112,7 +144,7 @@ namespace AzToolsFramework // Create the Prefab instanceToCreate = prefabEditorEntityOwnershipInterface->CreatePrefab( - entities, AZStd::move(instances), filePath, commonRootEntityOwningInstance); + entities, AZStd::move(instancePtrs), filePath, commonRootEntityOwningInstance); if (!instanceToCreate) { @@ -122,11 +154,17 @@ namespace AzToolsFramework AZ::EntityId containerEntityId = instanceToCreate->get().GetContainerEntityId(); - // Parent the entities to the container entity. Parenting the container entities of the instances passed to createPrefab - // will be done during the creation of links below. - for (AZ::Entity* topLevelEntity : entities) + // Apply the correct transform to the container for the new instance, and store the patch for use when creating the link. + PrefabDom patch = ApplyContainerTransformAndGeneratePatch(containerEntityId, commonRootEntityId, topLevelEntities); + + // Parent the non-container top level entities to the container entity. + // Parenting the top level container entities will be done during the creation of links. + for (AZ::Entity* topLevelEntity : topLevelEntities) { - AZ::TransformBus::Event(topLevelEntity->GetId(), &AZ::TransformBus::Events::SetParent, containerEntityId); + if (!IsInstanceContainerEntity(topLevelEntity->GetId())) + { + AZ::TransformBus::Event(topLevelEntity->GetId(), &AZ::TransformBus::Events::SetParent, containerEntityId); + } } // Update the template of the instance since the entities are modified since the template creation. @@ -138,35 +176,74 @@ namespace AzToolsFramework instanceToCreate->get().GetNestedInstances([&](AZStd::unique_ptr& nestedInstance) { AZ_Assert(nestedInstance, "Invalid nested instance found in the new prefab created."); + EntityOptionalReference nestedInstanceContainerEntity = nestedInstance->GetContainerEntity(); AZ_Assert( nestedInstanceContainerEntity, "Invalid container entity found for the nested instance used in prefab creation."); + AZ::EntityId nestedInstanceContainerEntityId = nestedInstanceContainerEntity->get().GetId(); + PrefabDom previousPatch; + + // Retrieve the previous patch if it exists + if (nestedInstanceLinkPatchesMap.contains(nestedInstance.get())) + { + previousPatch = AZStd::move(nestedInstanceLinkPatchesMap[nestedInstance.get()]); + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + previousPatch.Accept(writer); + QString previousPatchString(buffer.GetString()); + + for (AZ::Entity* entity : entities) + { + AZ::EntityId entityId = entity->GetId(); + AZStd::string oldEntityAlias = oldEntityAliases[entityId]; + EntityAliasOptionalReference newEntityAlias = instanceToCreate->get().GetEntityAlias(entityId); + AZ_Assert( + newEntityAlias.has_value(), + "Could not fetch entity alias for entity with id '%llu' during prefab creation.", + static_cast(entityId)); + ReplaceOldAliases(previousPatchString, oldEntityAlias, newEntityAlias->get()); + } + + previousPatch.Parse(previousPatchString.toUtf8().constData()); + } + // These link creations shouldn't be undone because that would put the template in a non-usable state if a user // chooses to instantiate the template after undoing the creation. - CreateLink( - {&nestedInstanceContainerEntity->get()}, *nestedInstance, instanceToCreate->get().GetTemplateId(), - undoBatch.GetUndoBatch(), containerEntityId, false); - }); + CreateLink(*nestedInstance, instanceToCreate->get().GetTemplateId(), undoBatch.GetUndoBatch(), AZStd::move(previousPatch), false); + // If this nested instance's container is a top level entity in the new prefab, re-parent it and apply the change. + if (AZStd::find(topLevelEntities.begin(), topLevelEntities.end(), &nestedInstanceContainerEntity->get()) != topLevelEntities.end()) + { + Prefab::PrefabDom containerEntityDomBefore; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomBefore, *nestedInstanceContainerEntity); + + AZ::TransformBus::Event(nestedInstanceContainerEntityId, &AZ::TransformBus::Events::SetParent, containerEntityId); + + PrefabDom containerEntityDomAfter; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomAfter, *nestedInstanceContainerEntity); + + PrefabDom reparentPatch; + m_instanceToTemplateInterface->GeneratePatch(reparentPatch, containerEntityDomBefore, containerEntityDomAfter); + m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(reparentPatch, nestedInstanceContainerEntityId); + + // We won't parent this undo node to the undo batch so that the newly created template and link will remain + // unaffected by undo actions. This is needed so that any future instantiations of the template will work. + PrefabUndoLinkUpdate linkUpdate = PrefabUndoLinkUpdate(AZStd::to_string(static_cast(nestedInstanceContainerEntityId))); + linkUpdate.Capture(reparentPatch, nestedInstance->GetLinkId()); + linkUpdate.Redo(); + } + }); + // Create a link between the templates of the newly created instance and the instance it's being parented under. CreateLink( - topLevelEntities, instanceToCreate->get(), commonRootEntityOwningInstance->get().GetTemplateId(), - undoBatch.GetUndoBatch(), commonRootEntityId); + instanceToCreate->get(), commonRootEntityOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch(), + AZStd::move(patch)); - for (AZ::Entity* topLevelEntity : topLevelEntities) - { - AZ::EntityId topLevelEntityId = topLevelEntity->GetId(); - if (topLevelEntityId.IsValid()) - { - m_prefabUndoCache.UpdateCache(topLevelEntity->GetId()); - - // Parenting entities would mark entities as dirty. But we want to unmark the top level entities as dirty because - // if we don't, the template created would be updated and cause issues with undo operation followed by instantiation. - ToolsApplicationRequests::Bus::Broadcast( - &ToolsApplicationRequests::Bus::Events::RemoveDirtyEntity, topLevelEntity->GetId()); - } - } + // This clears any entities marked as dirty due to reparenting of entities during the process of creating a prefab. + // We are doing this so that the changes in those enities are not queued up twice for propagation. + AzToolsFramework::ToolsApplicationRequestBus::Broadcast( + &AzToolsFramework::ToolsApplicationRequestBus::Events::ClearDirtyEntities); // Select Container Entity { @@ -182,6 +259,40 @@ namespace AzToolsFramework return AZ::Success(); } + PrefabDom PrefabPublicHandler::ApplyContainerTransformAndGeneratePatch(AZ::EntityId containerEntityId, AZ::EntityId parentEntityId, const EntityList& childEntities) + { + AZ::Entity* containerEntity = GetEntityById(containerEntityId); + AZ_Assert(containerEntity, "Invalid container entity passed to ApplyContainerTransformAndGeneratePatch."); + + // Generate the transform for the container entity out of the top level entities, and set it + // This step needs to be done before anything is parented to the container, else children position will be wrong + Prefab::PrefabDom containerEntityDomBefore; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomBefore, *containerEntity); + + AZ::Vector3 containerEntityTranslation(AZ::Vector3::CreateZero()); + AZ::Quaternion containerEntityRotation(AZ::Quaternion::CreateZero()); + + // Set container entity to be child of common root + AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetParent, parentEntityId); + + // Set the transform (translation, rotation) of the container entity + GenerateContainerEntityTransform(childEntities, containerEntityTranslation, containerEntityRotation); + AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetLocalTranslation, containerEntityTranslation); + AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetLocalRotationQuaternion, containerEntityRotation); + + PrefabDom containerEntityDomAfter; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomAfter, *containerEntity); + + PrefabDom patch; + m_instanceToTemplateInterface->GeneratePatch(patch, containerEntityDomBefore, containerEntityDomAfter); + m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, containerEntityId); + + // Update the cache - this prevents these changes from being stored in the regular undo/redo nodes + m_prefabUndoCache.Store(containerEntityId, AZStd::move(containerEntityDomAfter)); + + return AZStd::move(patch); + } + PrefabOperationResult PrefabPublicHandler::InstantiatePrefab( AZStd::string_view filePath, AZ::EntityId parent, const AZ::Vector3& position) { @@ -207,7 +318,7 @@ namespace AzToolsFramework } //Detect whether this instantiation would produce a cyclical dependency - auto relativePath = m_prefabLoaderInterface->GetRelativePathToProject(filePath); + auto relativePath = m_prefabLoaderInterface->GenerateRelativePath(filePath); Prefab::TemplateId templateId = m_prefabSystemComponentInterface->GetTemplateIdFromFilePath(relativePath); if (templateId == InvalidTemplateId) @@ -232,10 +343,10 @@ namespace AzToolsFramework // Initialize Undo Batch object ScopedUndoBatch undoBatch("Instantiate Prefab"); + // Instantiate the Prefab PrefabDom instanceToParentUnderDomBeforeCreate; m_instanceToTemplateInterface->GenerateDomForInstance(instanceToParentUnderDomBeforeCreate, instanceToParentUnder->get()); - // Instantiate the Prefab auto instanceToCreate = prefabEditorEntityOwnershipInterface->InstantiatePrefab(relativePath, instanceToParentUnder); if (!instanceToCreate) @@ -247,11 +358,32 @@ namespace AzToolsFramework PrefabUndoHelpers::UpdatePrefabInstance( instanceToParentUnder->get(), "Update prefab instance", instanceToParentUnderDomBeforeCreate, undoBatch.GetUndoBatch()); - CreateLink({}, instanceToCreate->get(), instanceToParentUnder->get().GetTemplateId(), undoBatch.GetUndoBatch(), parent); + // Create Link with correct container patches AZ::EntityId containerEntityId = instanceToCreate->get().GetContainerEntityId(); + AZ::Entity* containerEntity = GetEntityById(containerEntityId); + AZ_Assert(containerEntity, "Invalid container entity detected in InstantiatePrefab."); - // Apply position + Prefab::PrefabDom containerEntityDomBefore; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomBefore, *containerEntity); + + // Set container entity's parent + AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetParent, parent); + + // Set the position of the container entity AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetWorldTranslation, position); + + PrefabDom containerEntityDomAfter; + m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomAfter, *containerEntity); + + // Generate patch to be stored in the link + PrefabDom patch; + m_instanceToTemplateInterface->GeneratePatch(patch, containerEntityDomBefore, containerEntityDomAfter); + m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, containerEntityId); + + CreateLink(instanceToCreate->get(), instanceToParentUnder->get().GetTemplateId(), undoBatch.GetUndoBatch(), AZStd::move(patch)); + + // Update the cache - this prevents these changes from being stored in the regular undo/redo nodes + m_prefabUndoCache.Store(containerEntityId, AZStd::move(containerEntityDomAfter)); } return AZ::Success(); @@ -282,7 +414,7 @@ namespace AzToolsFramework // Find common root and top level entities bool entitiesHaveCommonRoot = false; - AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( + AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult( entitiesHaveCommonRoot, &AzToolsFramework::ToolsApplicationRequests::FindCommonRootInactive, inputEntityList, commonRootEntityId, &topLevelEntities); @@ -318,33 +450,9 @@ namespace AzToolsFramework } void PrefabPublicHandler::CreateLink( - const EntityList& topLevelEntities, Instance& sourceInstance, TemplateId targetTemplateId, - UndoSystem::URSequencePoint* undoBatch, AZ::EntityId commonRootEntityId, const bool isUndoRedoSupportNeeded) + Instance& sourceInstance, TemplateId targetTemplateId, + UndoSystem::URSequencePoint* undoBatch, PrefabDom patch, const bool isUndoRedoSupportNeeded) { - AZ::EntityId containerEntityId = sourceInstance.GetContainerEntityId(); - AZ::Entity* containerEntity = GetEntityById(containerEntityId); - Prefab::PrefabDom containerEntityDomBefore; - m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomBefore, *containerEntity); - - AZ::Vector3 containerEntityTranslation(AZ::Vector3::CreateZero()); - AZ::Quaternion containerEntityRotation(AZ::Quaternion::CreateZero()); - - // Set the transform (translation, rotation) of the container entity - GenerateContainerEntityTransform(topLevelEntities, containerEntityTranslation, containerEntityRotation); - - // Set container entity to be child of common root - AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetParent, commonRootEntityId); - - AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetLocalTranslation, containerEntityTranslation); - AZ::TransformBus::Event(containerEntityId, &AZ::TransformBus::Events::SetLocalRotationQuaternion, containerEntityRotation); - - PrefabDom containerEntityDomAfter; - m_instanceToTemplateInterface->GenerateDomForEntity(containerEntityDomAfter, *containerEntity); - - PrefabDom patch; - m_instanceToTemplateInterface->GeneratePatch(patch, containerEntityDomBefore, containerEntityDomAfter); - m_instanceToTemplateInterface->AppendEntityAliasToPatchPaths(patch, containerEntityId); - LinkId linkId; if (isUndoRedoSupportNeeded) { @@ -360,9 +468,6 @@ namespace AzToolsFramework } sourceInstance.SetLinkId(linkId); - - // Update the cache - this prevents these changes from being stored in the regular undo/redo nodes - m_prefabUndoCache.Store(containerEntityId, AZStd::move(containerEntityDomAfter)); } void PrefabPublicHandler::RemoveLink( @@ -631,6 +736,143 @@ namespace AzToolsFramework return DeleteFromInstance(entityIds, true); } + PrefabOperationResult PrefabPublicHandler::DuplicateEntitiesInInstance(const EntityIdList& entityIds) + { + if (entityIds.empty()) + { + return AZ::Failure(AZStd::string("No entities to duplicate.")); + } + + if (!EntitiesBelongToSameInstance(entityIds)) + { + return AZ::Failure(AZStd::string("Cannot duplicate multiple " + "entities belonging to different instances with one operation.")); + } + + // We've already verified the entities are all owned by the same instance, + // so we can just retrieve our instance from the first entity in the list. + InstanceOptionalReference commonEntityOwningInstance = GetOwnerInstanceByEntityId(entityIds[0]); + AZ_Assert( + commonEntityOwningInstance.has_value(), + "Failed to duplicate : Couldn't get a valid owning instance for the common root entity of the entities provided"); + + // This will cull out any entities that have ancestors in the list, since we will end up duplicating + // the full nested hierarchy with what is returned from RetrieveAndSortPrefabEntitiesAndInstances + AzToolsFramework::EntityIdSet duplicationSet = AzToolsFramework::GetCulledEntityHierarchy(entityIds); + + AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + + ScopedUndoBatch undoBatch("Duplicate Entities"); + + { + AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "DuplicateEntitiesInInstance::UndoCaptureAndDuplicateEntities"); + + // Take a snapshot of the instance DOM before we manipulate it + Prefab::PrefabDom instanceDomBefore; + m_instanceToTemplateInterface->GenerateDomForInstance(instanceDomBefore, commonEntityOwningInstance->get()); + + AZStd::vector entities; + AZStd::vector instances; + + // Gather all entities/instances in the hierarchy, but don't detach them because we are duplicating not deleting. + EntityList inputEntityList = EntityIdSetToEntityList(duplicationSet); + bool success = RetrieveAndSortPrefabEntitiesAndInstances(inputEntityList, commonEntityOwningInstance->get(), entities, instances); + + if (!success) + { + return AZ::Failure(AZStd::string("Failed to retrieve entities and instances from the given list of entity ids for duplication")); + } + + // Make a copy of our before instance DOM where we will add our duplicated entities + Prefab::PrefabDom instanceDomAfter; + instanceDomAfter.CopyFrom(instanceDomBefore, instanceDomAfter.GetAllocator()); + + AZStd::unordered_map oldAliasToNewAliasMap; + AZStd::unordered_map aliasToEntityDomMap; + + for (AZ::Entity* entity : entities) + { + EntityAliasOptionalReference oldAliasRef = commonEntityOwningInstance->get().GetEntityAlias(entity->GetId()); + AZ_Assert(oldAliasRef.has_value(), "No alias found for Entity in the DOM"); + EntityAlias oldAlias = oldAliasRef.value(); + + // Give this the outer allocator so that the memory reference will be valid when + // it gets used for AddMember + Prefab::PrefabDom entityDomBefore(&instanceDomAfter.GetAllocator()); + m_instanceToTemplateInterface->GenerateDomForEntity(entityDomBefore, *entity); + + // Keep track of the old alias <-> new alias mapping for this duplicated entity + // so we can fixup references later + EntityAlias newEntityAlias = Instance::GenerateEntityAlias(); + oldAliasToNewAliasMap.insert(AZStd::make_pair(oldAlias, newEntityAlias)); + + rapidjson::StringBuffer buffer; + rapidjson::Writer writer(buffer); + entityDomBefore.Accept(writer); + + // Store our duplicated Entity DOM with its new alias as a string + // so that we can fixup entity alias references before adding it + // to the Entities member of our instance DOM + QString entityDomString(buffer.GetString()); + aliasToEntityDomMap.insert(AZStd::make_pair(newEntityAlias, entityDomString)); + } + + auto entitiesIter = instanceDomAfter.FindMember(PrefabDomUtils::EntitiesName); + AZ_Assert(entitiesIter != instanceDomAfter.MemberEnd(), "Instance DOM missing the Entities member."); + + // Now that all the duplicated Entity DOMs have been created, we need to iterate + // through them and replace any previous EntityAlias references with the new ones. + // These are more than just parent entity references for nested entities, this will + // also cover any EntityId references that were made in the components between them. + for (auto aliasEntityPair : aliasToEntityDomMap) + { + EntityAlias newEntityAlias = aliasEntityPair.first; + QString newEntityDomString = aliasEntityPair.second; + + // Replace all of the old alias references with the new ones + // We bookend the aliases with \" and also with a / as an extra precaution to prevent + // inadvertently replacing a matching string vs. where an actual EntityId is expected + // This will cover both cases where an alias could be used in a normal entity vs. an instance + for (auto aliasMapIter : oldAliasToNewAliasMap) + { + ReplaceOldAliases(newEntityDomString, aliasMapIter.first, aliasMapIter.second); + } + + // Create the new Entity DOM from parsing the JSON string + Prefab::PrefabDom entityDomAfter(&instanceDomAfter.GetAllocator()); + entityDomAfter.Parse(newEntityDomString.toUtf8().constData()); + + // Add the new Entity DOM to the Entities member of the instance + rapidjson::Value aliasName(newEntityAlias.c_str(), newEntityAlias.length(), instanceDomAfter.GetAllocator()); + entitiesIter->value.AddMember(AZStd::move(aliasName), entityDomAfter, instanceDomAfter.GetAllocator()); + } + + PrefabUndoInstance* command = aznew PrefabUndoInstance("Entity duplication"); + command->SetParent(undoBatch.GetUndoBatch()); + command->Capture(instanceDomBefore, instanceDomAfter, commonEntityOwningInstance->get().GetTemplateId()); + command->RunRedo(); + + EntityIdList duplicatedEntityIds; + for (auto aliasMapIter : oldAliasToNewAliasMap) + { + EntityAlias newEntityAlias = aliasMapIter.second; + + AliasPath absoluteEntityPath = commonEntityOwningInstance->get().GetAbsoluteInstanceAliasPath(); + absoluteEntityPath.Append(newEntityAlias); + + AZ::EntityId newEntityId = InstanceEntityIdMapper::GenerateEntityIdForAliasPath(absoluteEntityPath); + duplicatedEntityIds.push_back(newEntityId); + } + + // Select the duplicated entities + auto selectionUndo = aznew SelectionCommand(duplicatedEntityIds, "Select Duplicated Entities"); + selectionUndo->SetParent(undoBatch.GetUndoBatch()); + ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequestBus::Events::RunRedoSeparately, selectionUndo); + } + + return AZ::Success(); + } + PrefabOperationResult PrefabPublicHandler::DeleteFromInstance(const EntityIdList& entityIds, bool deleteDescendants) { if (entityIds.empty()) @@ -658,17 +900,7 @@ namespace AzToolsFramework AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); - UndoSystem::URSequencePoint* currentUndoBatch = nullptr; - ToolsApplicationRequests::Bus::BroadcastResult(currentUndoBatch, &ToolsApplicationRequests::Bus::Events::GetCurrentUndoBatch); - - bool createdUndo = false; - if (!currentUndoBatch) - { - createdUndo = true; - ToolsApplicationRequests::Bus::BroadcastResult( - currentUndoBatch, &ToolsApplicationRequests::Bus::Events::BeginUndoBatch, "Delete Selected"); - AZ_Assert(currentUndoBatch, "Failed to create new undo batch."); - } + ScopedUndoBatch undoBatch("Delete Selected"); // In order to undo DeleteSelected, we have to create a selection command which selects the current selection // and then add the deletion as children. @@ -696,7 +928,7 @@ namespace AzToolsFramework if (deleteDescendants) { AZStd::vector entities; - AZStd::vector> instances; + AZStd::vector instances; bool success = RetrieveAndSortPrefabEntitiesAndInstances(inputEntityList, commonOwningInstance->get(), entities, instances); @@ -707,13 +939,15 @@ namespace AzToolsFramework for (AZ::Entity* entity : entities) { + commonOwningInstance->get().DetachEntity(entity->GetId()).release(); AZ::ComponentApplicationBus::Broadcast(&AZ::ComponentApplicationRequests::DeleteEntity, entity->GetId()); } for (auto& nestedInstance : instances) { - RemoveLink(nestedInstance, commonOwningInstance->get().GetTemplateId(), currentUndoBatch); - nestedInstance.reset(); + AZStd::unique_ptr outInstance = commonOwningInstance->get().DetachNestedInstance(nestedInstance->GetInstanceAlias()); + RemoveLink(outInstance, commonOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch()); + outInstance.reset(); } } else @@ -725,7 +959,7 @@ namespace AzToolsFramework if (owningInstance->get().GetContainerEntityId() == entityId) { auto instancePtr = commonOwningInstance->get().DetachNestedInstance(owningInstance->get().GetInstanceAlias()); - RemoveLink(instancePtr, commonOwningInstance->get().GetTemplateId(), currentUndoBatch); + RemoveLink(instancePtr, commonOwningInstance->get().GetTemplateId(), undoBatch.GetUndoBatch()); } else { @@ -743,17 +977,12 @@ namespace AzToolsFramework command->SetParent(selCommand); } - selCommand->SetParent(currentUndoBatch); + selCommand->SetParent(undoBatch.GetUndoBatch()); { AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzToolsFramework, "Internal::DeleteEntities:RunRedo"); selCommand->RunRedo(); } - if (createdUndo) - { - ToolsApplicationRequestBus::Broadcast(&ToolsApplicationRequests::EndUndoBatch); - } - return AZ::Success(); } @@ -865,7 +1094,7 @@ namespace AzToolsFramework bool PrefabPublicHandler::RetrieveAndSortPrefabEntitiesAndInstances( const EntityList& inputEntities, Instance& commonRootEntityOwningInstance, - EntityList& outEntities, AZStd::vector>& outInstances) const + EntityList& outEntities, AZStd::vector& outInstances) const { if (inputEntities.size() == 0) { @@ -949,14 +1178,14 @@ namespace AzToolsFramework for (AZ::Entity* entity : entities) { - outEntities.emplace_back(commonRootEntityOwningInstance.DetachEntity(entity->GetId()).release()); + outEntities.emplace_back(entity); } outInstances.clear(); outInstances.reserve(instances.size()); for (Instance* instancePtr : instances) { - outInstances.push_back(AZStd::move(commonRootEntityOwningInstance.DetachNestedInstance(instancePtr->GetInstanceAlias()))); + outInstances.push_back(instancePtr); } return (outEntities.size() + outInstances.size()) > 0; @@ -1007,5 +1236,18 @@ namespace AzToolsFramework return true; } + + void PrefabPublicHandler::ReplaceOldAliases(QString& stringToReplace, AZStd::string_view oldAlias, AZStd::string_view newAlias) + { + QString oldAliasQuotes = QString("\"%1\"").arg(oldAlias.data()); + QString newAliasQuotes = QString("\"%1\"").arg(newAlias.data()); + + stringToReplace.replace(oldAliasQuotes, newAliasQuotes); + + QString oldAliasPathRef = QString("/%1").arg(oldAlias.data()); + QString newAliasPathRef = QString("/%1").arg(newAlias.data()); + + stringToReplace.replace(oldAliasPathRef, newAliasPathRef); + } } // namespace Prefab } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h index d88086dda9..7e2357dd44 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicHandler.h @@ -14,12 +14,15 @@ #include #include +#include #include #include #include #include +class QString; + namespace AzToolsFramework { using EntityList = AZStd::vector; @@ -27,7 +30,6 @@ namespace AzToolsFramework namespace Prefab { class Instance; - class InstanceEntityMapperInterface; class InstanceToTemplateInterface; class PrefabLoaderInterface; @@ -60,28 +62,41 @@ namespace AzToolsFramework PrefabOperationResult DeleteEntitiesInInstance(const EntityIdList& entityIds) override; PrefabOperationResult DeleteEntitiesAndAllDescendantsInInstance(const EntityIdList& entityIds) override; + PrefabOperationResult DuplicateEntitiesInInstance(const EntityIdList& entityIds) override; private: PrefabOperationResult DeleteFromInstance(const EntityIdList& entityIds, bool deleteDescendants); bool RetrieveAndSortPrefabEntitiesAndInstances(const EntityList& inputEntities, Instance& commonRootEntityOwningInstance, - EntityList& outEntities, AZStd::vector>& outInstances) const; + EntityList& outEntities, AZStd::vector& outInstances) const; InstanceOptionalReference GetOwnerInstanceByEntityId(AZ::EntityId entityId) const; bool EntitiesBelongToSameInstance(const EntityIdList& entityIds) const; + + /** + * Applies the correct transform changes to the container entity based on the parent and child entities provided, and returns an appropriate patch. + * The container will be parented to parentId, moved to the average transform of the future direct children and its cache will be updated. + * This helper function won't support undo/redo, update the templates or create any links. All that needs to be done by the caller. + * + * \param containerEntityId The container to apply the changes to. + * \param parentEntityId The id of the entity the container should be parented to. + * \param childEntities A list of entities that will subsequently be parented to this container. + * \return The PrefabDom containing the patches that should be stored in the parent link. + */ + PrefabDom ApplyContainerTransformAndGeneratePatch( + AZ::EntityId containerEntityId, AZ::EntityId parentEntityId, const EntityList& childEntities); /** * Creates a link between the templates of an instance and its parent. * - * \param topLevelEntities The list of entities that are immediate children to the container entity of the instance. * \param sourceInstance The instance that corresponds to the source template of the link. * \param targetInstance The id of the target template. * \param undoBatch The undo batch to set as parent for this create link action. - * \param commonRootEntityId The id of the entity that the source instance should be parented under. + * \param patch The patch to store in the newly created link dom. * \param isUndoRedoSupportNeeded The flag indicating whether the link should be created with undo/redo support or not. */ void CreateLink( - const EntityList& topLevelEntities, Instance& sourceInstance, TemplateId targetTemplateId, - UndoSystem::URSequencePoint* undoBatch, AZ::EntityId commonRootEntityId, const bool isUndoRedoSupportNeeded = true); + Instance& sourceInstance, TemplateId targetTemplateId, UndoSystem::URSequencePoint* undoBatch, + PrefabDom patch, const bool isUndoRedoSupportNeeded = true); /** * Removes the link between template of the sourceInstance and the template corresponding to targetTemplateId. @@ -117,6 +132,8 @@ namespace AzToolsFramework bool IsCyclicalDependencyFound( InstanceOptionalConstReference instance, const AZStd::unordered_set& templateSourcePaths); + void ReplaceOldAliases(QString& stringToReplace, AZStd::string_view oldAlias, AZStd::string_view newAlias); + static Instance* GetParentInstance(Instance* instance); static Instance* GetAncestorOfInstanceThatIsChildOfRoot(const Instance* ancestor, Instance* descendant); static void GenerateContainerEntityTransform(const EntityList& topLevelEntities, AZ::Vector3& translation, AZ::Quaternion& rotation); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h index 1a8da0dfe0..0750c4d264 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabPublicInterface.h @@ -143,6 +143,13 @@ namespace AzToolsFramework * @return An outcome object; on failure, it comes with an error message detailing the cause of the error. */ virtual PrefabOperationResult DeleteEntitiesAndAllDescendantsInInstance(const EntityIdList& entityIds) = 0; + + /** + * Duplicates all entities in the owning instance. Bails if the entities don't all belong to the same instance. + * @param entities The entities to duplicate. + * @return An outcome object; on failure, it comes with an error message detailing the cause of the error. + */ + virtual PrefabOperationResult DuplicateEntitiesInInstance(const EntityIdList& entityIds) = 0; }; } // namespace Prefab diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp index c4e6415b02..0136f791b3 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/PrefabSystemComponent.cpp @@ -95,7 +95,7 @@ namespace AzToolsFramework const AZStd::vector& entities, AZStd::vector>&& instancesToConsume, AZ::IO::PathView filePath, AZStd::unique_ptr containerEntity, bool shouldCreateLinks) { - AZ::IO::Path relativeFilePath = m_prefabLoader.GetRelativePathToProject(filePath); + AZ::IO::Path relativeFilePath = m_prefabLoader.GenerateRelativePath(filePath); if (GetTemplateIdFromFilePath(relativeFilePath) != InvalidTemplateId) { AZ_Error("Prefab", false, diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp index 78d1332a71..050afd813d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Prefab/Spawnable/ProcesedObjectStore.cpp @@ -10,7 +10,7 @@ * */ -#include +#include #include namespace AzToolsFramework::Prefab::PrefabConversionUtils @@ -73,8 +73,7 @@ namespace AzToolsFramework::Prefab::PrefabConversionUtils uint32_t ProcessedObjectStore::BuildSubId(AZStd::string_view id) { - AZ::Uuid subIdHash = AZ::Uuid::CreateData(id.data(), id.size()); - return azlossy_caster(subIdHash.GetHash()); + return AzFramework::SpawnableAssetHandler::BuildSubId(id); } const AZStd::string& ProcessedObjectStore::GetId() const diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp index 4b73166b3d..38a6156ec5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Slice/SliceUtilities.cpp @@ -1475,10 +1475,8 @@ namespace AzToolsFramework // to avoid pushing them to the slice. // Only scale is preserved on the root entity of a slice. transformComponent->SetParent(AZ::EntityId()); - AZ::Vector3 scale = transformComponent->GetLocalScale(); transformComponent->SetWorldTranslation(AZ::Vector3::CreateZero()); transformComponent->SetLocalRotation(AZ::Vector3::CreateZero()); - transformComponent->SetLocalScale(scale); } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.h index 6950717499..0ca5853adc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.h @@ -1,22 +1,22 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #pragma once -#include -#include -#include #include #include +#include +#include +#include namespace AzToolsFramework { @@ -31,7 +31,7 @@ namespace AzToolsFramework To use the EditorComponentAdapter, 3 classes are required: - a class that implements the functions required for TController (see below) - a configuration struct/class which extends AZ::ComponentConfig - - A runtime component that will be generated by the editor comoinent on export + - A runtime component that will be generated by the editor component on export The concrete component extends the adapter and implements behavior which is unique to the component. @@ -64,15 +64,15 @@ namespace AzToolsFramework the EditContext. TController can friend itself to the editor component to make this work if required. */ template - class EditorComponentAdapter - : public EditorComponentBase + class EditorComponentAdapter : public EditorComponentBase { public: - - AZ_RTTI((EditorComponentAdapter, "{2F5A3669-FFE9-4CD7-B9E2-7FC8100CF1A2}", TController, TRuntimeComponent, TConfiguration), EditorComponentBase); + AZ_RTTI( + (EditorComponentAdapter, "{2F5A3669-FFE9-4CD7-B9E2-7FC8100CF1A2}", TController, TRuntimeComponent, TConfiguration), + EditorComponentBase); EditorComponentAdapter() = default; - EditorComponentAdapter(const TConfiguration& configuration); + explicit EditorComponentAdapter(const TConfiguration& configuration); static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services); static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services); @@ -86,7 +86,6 @@ namespace AzToolsFramework void BuildGameEntity(AZ::Entity* gameEntity) override; protected: - static void Reflect(AZ::ReflectContext* context); // AZ::Component overrides ... diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.inl b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.inl index 04619b079d..b8bd24589a 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.inl +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorComponentAdapter.inl @@ -1,14 +1,14 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #include @@ -28,23 +28,21 @@ namespace AzToolsFramework template void EditorComponentAdapter::Reflect(AZ::ReflectContext* context) { - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() - ->Version(1) - ->Field("Controller", &EditorComponentAdapter::m_controller) - ; + serializeContext->Class()->Version(1)->Field( + "Controller", &EditorComponentAdapter::m_controller); if (AZ::EditContext* editContext = serializeContext->GetEditContext()) { - editContext->Class( - "EditorComponentAdapter", "") + // clang-format off + editContext->Class("EditorComponentAdapter", "") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Default, &EditorComponentAdapter::m_controller, "Controller", "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) - ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorComponentAdapter::OnConfigurationChanged) - ; + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorComponentAdapter::OnConfigurationChanged); + // clang-format on } } } @@ -53,27 +51,35 @@ namespace AzToolsFramework // Get*Services functions template - void EditorComponentAdapter::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& services) + void EditorComponentAdapter::GetProvidedServices( + AZ::ComponentDescriptor::DependencyArrayType& services) { - AzFramework::Components::GetProvidedServicesHelper(services, typename AZ::HasComponentProvidedServices::type()); + AzFramework::Components::GetProvidedServicesHelper( + services, typename AZ::HasComponentProvidedServices::type()); } template - void EditorComponentAdapter::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& services) + void EditorComponentAdapter::GetRequiredServices( + AZ::ComponentDescriptor::DependencyArrayType& services) { - AzFramework::Components::GetRequiredServicesHelper(services, typename AZ::HasComponentRequiredServices::type()); + AzFramework::Components::GetRequiredServicesHelper( + services, typename AZ::HasComponentRequiredServices::type()); } template - void EditorComponentAdapter::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& services) + void EditorComponentAdapter::GetIncompatibleServices( + AZ::ComponentDescriptor::DependencyArrayType& services) { - AzFramework::Components::GetIncompatibleServicesHelper(services, typename AZ::HasComponentIncompatibleServices::type()); + AzFramework::Components::GetIncompatibleServicesHelper( + services, typename AZ::HasComponentIncompatibleServices::type()); } template - void EditorComponentAdapter::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& services) + void EditorComponentAdapter::GetDependentServices( + AZ::ComponentDescriptor::DependencyArrayType& services) { - AzFramework::Components::GetDependentServicesHelper(services, typename AZ::HasComponentDependentServices::type()); + AzFramework::Components::GetDependentServicesHelper( + services, typename AZ::HasComponentDependentServices::type()); } ////////////////////////////////////////////////////////////////////////// @@ -99,7 +105,8 @@ namespace AzToolsFramework if (ShouldActivateController()) { - m_controller.Activate(GetEntityId()); + AzFramework::Components::ComponentActivateHelper::Activate( + m_controller, AZ::EntityComponentIdPair(GetEntityId(), GetId())); } } @@ -122,7 +129,8 @@ namespace AzToolsFramework } template - bool EditorComponentAdapter::WriteOutConfig(AZ::ComponentConfig* outBaseConfig) const + bool EditorComponentAdapter::WriteOutConfig( + AZ::ComponentConfig* outBaseConfig) const { if (auto config = azrtti_cast(outBaseConfig)) { @@ -139,7 +147,8 @@ namespace AzToolsFramework if (ShouldActivateController()) { - m_controller.Activate(GetEntityId()); + AzFramework::Components::ComponentActivateHelper::Activate( + m_controller, AZ::EntityComponentIdPair(GetEntityId(), GetId())); } return AZ::Edit::PropertyRefreshLevels::None; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorEntityIconComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorEntityIconComponent.cpp index 48a7a37487..c46bb158c6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorEntityIconComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorEntityIconComponent.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -313,8 +314,7 @@ namespace AzToolsFramework // if we do not yet have a valid texture id, request it using the entity icon path if (m_entityIconTextureId == 0) { - EditorRequestBus::BroadcastResult( - m_entityIconTextureId, &EditorRequests::GetIconTextureIdFromEntityIconPath, m_entityIconPath); + m_entityIconTextureId = EditorViewportIconDisplay::Get()->GetOrLoadIconForPath(m_entityIconPath); } return m_entityIconTextureId; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp index 97e27ac748..497bcf15d7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/EditorNonUniformScaleComponentMode.cpp @@ -28,7 +28,7 @@ namespace AzToolsFramework AZ::Transform worldFromLocal = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult(worldFromLocal, m_entityComponentIdPair.GetEntityId(), &AZ::TransformBus::Events::GetWorldTM); - worldFromLocal.ExtractScale(); + worldFromLocal.ExtractUniformScale(); m_manipulators = AZStd::make_unique(worldFromLocal); m_manipulators->Register(g_mainManipulatorManagerId); m_manipulators->SetAxes(AZ::Vector3::CreateAxisX(), AZ::Vector3::CreateAxisY(), AZ::Vector3::CreateAxisZ()); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp index 519b6d0b26..3e13e6226b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -50,10 +49,10 @@ namespace AzToolsFramework { const AZ::u32 ParentEntityCRC = AZ_CRC("Parent Entity", 0x5b1b276c); - // Decompose a transform into euler angles in degrees, scale (along basis, any shear will be dropped), and translation. - void DecomposeTransform(const AZ::Transform& transform, AZ::Vector3& translation, AZ::Vector3& rotation, AZ::Vector3& scale) + // Decompose a transform into euler angles in degrees, uniform scale, and translation. + void DecomposeTransform(const AZ::Transform& transform, AZ::Vector3& translation, AZ::Vector3& rotation, float& scale) { - scale = transform.GetScale(); + scale = transform.GetUniformScale(); translation = transform.GetTranslation(); rotation = transform.GetRotation().GetEulerDegrees(); } @@ -120,7 +119,7 @@ namespace AzToolsFramework // Decompose the old slice-relative transform and set it as a our editor transform, // since the entity is now our parent. EditorTransform editorTransform; - DecomposeTransform(sliceRelTransform, editorTransform.m_translate, editorTransform.m_rotate, editorTransform.m_scale); + DecomposeTransform(sliceRelTransform, editorTransform.m_translate, editorTransform.m_rotate, editorTransform.m_uniformScale); editorTransformElement.Convert(context); editorTransformElement.SetData(context, editorTransform); } @@ -170,6 +169,23 @@ namespace AzToolsFramework return true; } + + bool EditorTransformDataConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) + { + if (classElement.GetVersion() < 3) + { + // version 3 replaces vector scale with uniform scale but does not yet delete the legacy scale data + // in order to allow for migration + AZ::Vector3 vectorScale; + if (classElement.FindSubElementAndGetData(AZ_CRC_CE("Scale"), vectorScale)) + { + const float uniformScale = vectorScale.GetMaxElement(); + classElement.AddElementWithData(context, "UniformScale", uniformScale); + } + } + + return true; + } } // namespace Internal TransformComponent::TransformComponent() @@ -357,7 +373,7 @@ namespace AzToolsFramework AZ::Transform TransformComponent::GetLocalScaleTM() const { - return AZ::Transform::CreateScale(m_editorTransform.m_scale); + return AZ::Transform::CreateUniformScale(m_editorTransform.m_uniformScale); } const AZ::Transform& TransformComponent::GetLocalTM() @@ -374,12 +390,13 @@ namespace AzToolsFramework // given a local transform, update local transform. void TransformComponent::SetLocalTM(const AZ::Transform& finalTx) { - AZ::Vector3 tx, rot, scale; - Internal::DecomposeTransform(finalTx, tx, rot, scale); + AZ::Vector3 tx, rot; + float uniformScale; + Internal::DecomposeTransform(finalTx, tx, rot, uniformScale); m_editorTransform.m_translate = tx; m_editorTransform.m_rotate = rot; - m_editorTransform.m_scale = scale; + m_editorTransform.m_uniformScale = uniformScale; TransformChanged(); } @@ -520,91 +537,13 @@ namespace AzToolsFramework return m_editorTransform.m_translate.GetZ(); } - void TransformComponent::SetRotation(const AZ::Vector3& eulerAnglesRadians) + void TransformComponent::SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetRotation is deprecated, please use SetLocalRotation"); - AZ::Transform newWorldTransform = GetWorldTM(); - newWorldTransform.SetRotation(AZ::ConvertEulerRadiansToQuaternion(eulerAnglesRadians)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationQuaternion(const AZ::Quaternion& quaternion) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetRotationQuaternion is deprecated, please use SetLocalRotation"); AZ::Transform newWorldTransform = GetWorldTM(); newWorldTransform.SetRotation(quaternion); SetWorldTM(newWorldTransform); } - void TransformComponent::SetRotationX(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetRotationX is deprecated, please use SetLocalRotation"); - AZ::Transform newWorldTransform = GetWorldTM(); - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationX(eulerAngleRadians)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationY(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetRotationY is deprecated, please use SetLocalRotation"); - AZ::Transform newWorldTransform = GetWorldTM(); - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationY(eulerAngleRadians)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetRotationZ(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetRotationZ is deprecated, please use SetLocalRotation"); - AZ::Transform newWorldTransform = GetWorldTM(); - newWorldTransform.SetRotation(AZ::Quaternion::CreateRotationZ(eulerAngleRadians)); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::RotateByX(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "RotateByX is deprecated, please use RotateAroundLocalX"); - SetWorldTM(GetWorldTM() * AZ::Transform::CreateRotationX(eulerAngleRadians)); - } - - void TransformComponent::RotateByY(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "RotateByY is deprecated, please use RotateAroundLocalY"); - SetWorldTM(GetWorldTM() * AZ::Transform::CreateRotationY(eulerAngleRadians)); - } - - void TransformComponent::RotateByZ(float eulerAngleRadians) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "RotateByZ is deprecated, please use RotateAroundLocalZ"); - SetWorldTM(GetWorldTM() * AZ::Transform::CreateRotationZ(eulerAngleRadians)); - } - - AZ::Vector3 TransformComponent::GetRotationEulerRadians() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetRotationEulerRadians is deprecated, please use GetWorldRotation"); - return GetWorldTM().GetRotation().GetEulerRadians(); - } - - AZ::Quaternion TransformComponent::GetRotationQuaternion() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetRotationQuaternion is deprecated, please use GetWorldRotationQuaternion"); - return GetWorldTM().GetRotation(); - } - - float TransformComponent::GetRotationX() - { - return GetRotationEulerRadians().GetX(); - } - - float TransformComponent::GetRotationY() - { - return GetRotationEulerRadians().GetY(); - } - - float TransformComponent::GetRotationZ() - { - return GetRotationEulerRadians().GetZ(); - } - AZ::Vector3 TransformComponent::GetWorldRotation() { return GetWorldTM().GetRotation().GetEulerRadians(); @@ -677,108 +616,26 @@ namespace AzToolsFramework return result; } - void TransformComponent::SetScale(const AZ::Vector3& newScale) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetScale is deprecated, please use SetLocalScale"); - - AZ::Transform newWorldTransform = GetWorldTM(); - AZ::Vector3 prevScale = newWorldTransform.ExtractScale(); - if (!prevScale.IsClose(newScale)) - { - newWorldTransform.MultiplyByScale(newScale); - SetWorldTM(newWorldTransform); - } - } - - void TransformComponent::SetScaleX(float newScale) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetScaleX is deprecated, please use SetLocalScaleX"); - - AZ::Transform newWorldTransform = GetWorldTM(); - AZ::Vector3 scale = newWorldTransform.ExtractScale(); - scale.SetX(newScale); - newWorldTransform.MultiplyByScale(scale); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetScaleY(float newScale) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetScaleY is deprecated, please use SetLocalScaleY"); - - AZ::Transform newWorldTransform = GetWorldTM(); - AZ::Vector3 scale = newWorldTransform.ExtractScale(); - scale.SetY(newScale); - newWorldTransform.MultiplyByScale(scale); - SetWorldTM(newWorldTransform); - } - - void TransformComponent::SetScaleZ(float newScale) - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "SetScaleZ is deprecated, please use SetLocalScaleZ"); - - AZ::Transform newWorldTransform = GetWorldTM(); - AZ::Vector3 scale = newWorldTransform.ExtractScale(); - scale.SetZ(newScale); - newWorldTransform.MultiplyByScale(scale); - SetWorldTM(newWorldTransform); - } - - AZ::Vector3 TransformComponent::GetScale() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetScale is deprecated, please use GetLocalScale"); - return GetWorldTM().GetScale(); - } - - float TransformComponent::GetScaleX() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetScaleX is deprecated, please use GetLocalScale"); - return GetWorldTM().GetScale().GetX(); - } - - float TransformComponent::GetScaleY() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetScaleY is deprecated, please use GetLocalScale"); - return GetWorldTM().GetScale().GetY(); - } - - float TransformComponent::GetScaleZ() - { - AZ_Warning("AzToolsFramework::TransformComponent", false, "GetScaleZ is deprecated, please use GetLocalScale"); - return GetWorldTM().GetScale().GetZ(); - } - - void TransformComponent::SetLocalScale(const AZ::Vector3& scale) - { - m_editorTransform.m_scale = scale; - TransformChanged(); - } - - void TransformComponent::SetLocalScaleX(float scaleX) - { - m_editorTransform.m_scale.SetX(scaleX); - TransformChanged(); - } - - void TransformComponent::SetLocalScaleY(float scaleY) - { - m_editorTransform.m_scale.SetY(scaleY); - TransformChanged(); - } - - void TransformComponent::SetLocalScaleZ(float scaleZ) - { - m_editorTransform.m_scale.SetZ(scaleZ); - TransformChanged(); - } - AZ::Vector3 TransformComponent::GetLocalScale() { - return m_editorTransform.m_scale; + AZ_WarningOnce("TransformComponent", false, "GetLocalScale is deprecated, please use GetLocalUniformScale instead"); + return m_editorTransform.m_legacyScale; } - AZ::Vector3 TransformComponent::GetWorldScale() + void TransformComponent::SetLocalUniformScale(float scale) { - return GetWorldTM().GetScale(); + m_editorTransform.m_uniformScale = scale; + TransformChanged(); + } + + float TransformComponent::GetLocalUniformScale() + { + return m_editorTransform.m_uniformScale; + } + + float TransformComponent::GetWorldUniformScale() + { + return GetWorldTM().GetUniformScale(); } const AZ::Transform& TransformComponent::GetParentWorldTM() const @@ -1183,12 +1040,6 @@ namespace AzToolsFramework ModifyEditorTransform(m_editorTransform.m_rotate, data, parent); } - void TransformComponent::ScaleBy(const AZ::Vector3& data) - { - //scale is always local - ModifyEditorTransform(m_editorTransform.m_scale, data, AZ::Transform::Identity()); - } - AZ::EntityId TransformComponent::GetSliceEntityParentId() { return GetParentId(); @@ -1297,9 +1148,10 @@ namespace AzToolsFramework serializeContext->Class()-> Field("Translate", &EditorTransform::m_translate)-> Field("Rotate", &EditorTransform::m_rotate)-> - Field("Scale", &EditorTransform::m_scale)-> + Field("Scale", &EditorTransform::m_legacyScale)-> Field("Locked", &EditorTransform::m_locked)-> - Version(2); + Field("UniformScale", &EditorTransform::m_uniformScale)-> + Version(3, &Internal::EditorTransformDataConverter); serializeContext->Class()-> Field("Parent Entity", &TransformComponent::m_parentEntityId)-> @@ -1358,7 +1210,7 @@ namespace AzToolsFramework Attribute(AZ::Edit::Attributes::Suffix, " deg")-> Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked)-> Attribute(AZ::Edit::Attributes::SliceFlags, AZ::Edit::SliceFlags::NotPushableOnSliceRoot)-> - DataElement(TransformScaleHandler, &EditorTransform::m_scale, "Scale", "Local Scale")-> + DataElement(AZ::Edit::UIHandlers::Default, &EditorTransform::m_uniformScale, "Uniform Scale", "Local Uniform Scale")-> Attribute(AZ::Edit::Attributes::Step, 0.1f)-> Attribute(AZ::Edit::Attributes::ReadOnly, &EditorTransform::m_locked) ; @@ -1386,7 +1238,8 @@ namespace AzToolsFramework { AzToolsFramework::ScopedUndoBatch undo("Reset transform values"); m_editorTransform.m_translate = AZ::Vector3::CreateZero(); - m_editorTransform.m_scale = AZ::Vector3::CreateOne(); + m_editorTransform.m_legacyScale = AZ::Vector3::CreateOne(); + m_editorTransform.m_uniformScale = 1.0f; m_editorTransform.m_rotate = AZ::Vector3::CreateZero(); OnTransformChanged(); SetDirty(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h index 3d1e1ed672..80db5e10fb 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponent.h @@ -99,22 +99,7 @@ namespace AzToolsFramework float GetLocalZ() override; // Rotation modifiers - void SetRotation(const AZ::Vector3& eulerAnglesRadians) override; - void SetRotationQuaternion(const AZ::Quaternion& quaternion) override; - void SetRotationX(float eulerAngleRadians) override; - void SetRotationY(float eulerAngleRadians) override; - void SetRotationZ(float eulerAngleRadians) override; - - void RotateByX(float eulerAngleRadians) override; - void RotateByY(float eulerAngleRadians) override; - void RotateByZ(float eulerAngleRadians) override; - - AZ::Vector3 GetRotationEulerRadians() override; - AZ::Quaternion GetRotationQuaternion() override; - - float GetRotationX() override; - float GetRotationY() override; - float GetRotationZ() override; + void SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) override; AZ::Vector3 GetWorldRotation() override; AZ::Quaternion GetWorldRotationQuaternion() override; @@ -130,23 +115,11 @@ namespace AzToolsFramework AZ::Quaternion GetLocalRotationQuaternion() override; // Scale Modifiers - void SetScale(const AZ::Vector3& newScale) override; - void SetScaleX(float newScale) override; - void SetScaleY(float newScale) override; - void SetScaleZ(float newScale) override; - - AZ::Vector3 GetScale() override; - float GetScaleX() override; - float GetScaleY() override; - float GetScaleZ() override; - - void SetLocalScale(const AZ::Vector3& scale) override; - void SetLocalScaleX(float scaleX) override; - void SetLocalScaleY(float scaleY) override; - void SetLocalScaleZ(float scaleZ) override; - AZ::Vector3 GetLocalScale() override; - AZ::Vector3 GetWorldScale() override; + + void SetLocalUniformScale(float scale) override; + float GetLocalUniformScale() override; + float GetWorldUniformScale() override; AZ::EntityId GetParentId() override; AZ::TransformInterface* GetParent() override; @@ -161,7 +134,6 @@ namespace AzToolsFramework // TransformComponentMessages::Bus void TranslateBy(const AZ::Vector3&) override; void RotateBy(const AZ::Vector3&) override; // euler in degrees - void ScaleBy(const AZ::Vector3&) override; const EditorTransform& GetLocalEditorTransform() override; void SetLocalEditorTransform(const EditorTransform& dest) override; bool IsTransformLocked() override; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h index f1cb8459c4..26fa4d758e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformComponentBus.h @@ -30,7 +30,8 @@ namespace AzToolsFramework EditorTransform() { m_translate = AZ::Vector3::CreateZero(); - m_scale = AZ::Vector3::CreateOne(); + m_legacyScale = AZ::Vector3::CreateOne(); + m_uniformScale = 1.0f; m_rotate = AZ::Vector3::CreateZero(); m_locked = false; } @@ -40,9 +41,10 @@ namespace AzToolsFramework return EditorTransform(); } - AZ::Vector3 m_translate; //! Translation in engine units (meters) - AZ::Vector3 m_scale; - AZ::Vector3 m_rotate; //! Rotation in degrees + AZ::Vector3 m_translate; //!< Translation in engine units (meters) + AZ::Vector3 m_legacyScale; //!< Legacy vector scale value, retained only for migration. + float m_uniformScale; //!< Single scale value applied uniformly. + AZ::Vector3 m_rotate; //!< Rotation in degrees bool m_locked; }; @@ -65,7 +67,6 @@ namespace AzToolsFramework virtual void TranslateBy(const AZ::Vector3&) = 0; virtual void RotateBy(const AZ::Vector3&) = 0; - virtual void ScaleBy(const AZ::Vector3&) = 0; virtual bool IsTransformLocked() = 0; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp deleted file mode 100644 index 94d0113bcf..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include "AzToolsFramework_precompiled.h" -#include -#include -#include - -namespace AzToolsFramework -{ - void RegisterTransformScaleHandler() - { - PropertyTypeRegistrationMessages::Bus::Broadcast(&PropertyTypeRegistrationMessages::RegisterPropertyType, aznew Components::TransformScalePropertyHandler()); - } - - namespace Components - { - AZ::u32 TransformScalePropertyHandler::GetHandlerName(void) const - { - return TransformScaleHandler; - } - - QWidget* TransformScalePropertyHandler::CreateGUI(QWidget* parent) - { - AzQtComponents::DoubleSpinBox* newCtrl = new AzQtComponents::DoubleSpinBox(parent); - connect(newCtrl, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), newCtrl, [newCtrl]() - { - AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, newCtrl); - }); - - newCtrl->setMinimum(AZ::MinTransformScale); - newCtrl->setMaximum(AZ::MaxTransformScale); - - return newCtrl; - } - - void TransformScalePropertyHandler::ConsumeAttribute(AzQtComponents::DoubleSpinBox* GUI, AZ::u32 attrib, - AzToolsFramework::PropertyAttributeReader* attrValue, [[maybe_unused]] const char* debugName) - { - if (attrib == AZ::Edit::Attributes::Suffix) - { - AZStd::string label; - if (attrValue->Read(label)) - { - GUI->setSuffix(label.c_str()); - } - } - } - - void TransformScalePropertyHandler::WriteGUIValuesIntoProperty([[maybe_unused]] size_t index, AzQtComponents::DoubleSpinBox* GUI, - AZ::Vector3& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) - { - const float value = aznumeric_cast(GUI->value()); - const float currentMaxElement = instance.GetMaxElement(); - if (currentMaxElement != 0.0f) - { - instance *= value / currentMaxElement; - } - else - { - instance = AZ::Vector3(value); - } - } - - bool TransformScalePropertyHandler::ReadValuesIntoGUI([[maybe_unused]] size_t index, AzQtComponents::DoubleSpinBox* GUI, - const AZ::Vector3& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) - { - QSignalBlocker signalBlocker(GUI); - GUI->setValue(instance.GetMaxElement()); - return true; - } - } // namespace Components -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h deleted file mode 100644 index f13aa37904..0000000000 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ToolsComponents/TransformScalePropertyHandler.h +++ /dev/null @@ -1,56 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#if !defined(Q_MOC_RUN) -#include -#include -#include -#endif - -namespace AzToolsFramework -{ - namespace Components - { - static const AZ::Crc32 TransformScaleHandler = AZ_CRC_CE("TransformScale"); - - //! Handler to allow the scale field inside the Transform Component to be represented as a single value in - //! the editor, but stored internally as a Vector3. - //! The purpose for this is to prevent any new entities being created with non-uniform scale on the Transform - //! Component, but preserve the data required for migrating any existing entities to use the Non-Uniform Scale - //! Component, until all migration work is completed. - //! The value shown in the editor will be the maximum value from the scale vector, and changing the value in - //! the editor will update the vector so that its maximum value matches the newly edited value, but its - //! components retain their existing proportion. - //! For example, if the current vector scale is (2, 3, 4), the value in the editor will appear as 4. If the value - //! in the editor is updated to 2, then the vector scale will update to (1, 1.5, 2), keeping the same proportion - //! between the x, y and z components. - class TransformScalePropertyHandler - : public QObject - , public AzToolsFramework::PropertyHandler - { - Q_OBJECT //AUTOMOC - public: - AZ_CLASS_ALLOCATOR(TransformScalePropertyHandler, AZ::SystemAllocator, 0); - - AZ::u32 GetHandlerName(void) const override; - QWidget* CreateGUI(QWidget* parent) override; - void ConsumeAttribute(AzQtComponents::DoubleSpinBox* GUI, AZ::u32 attrib, - AzToolsFramework::PropertyAttributeReader* attrValue, const char* debugName) override; - void WriteGUIValuesIntoProperty(size_t index, AzQtComponents::DoubleSpinBox* GUI, - AZ::Vector3& instance, AzToolsFramework::InstanceDataNode* node) override; - bool ReadValuesIntoGUI(size_t index, AzQtComponents::DoubleSpinBox* GUI, - const AZ::Vector3& instance, AzToolsFramework::InstanceDataNode* node) override; - }; - } // namespace Components -} // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp index 5b44594398..4a72afb16b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerListModel.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include //////////////////////////////////////////////////////////////////////////// @@ -1409,6 +1410,16 @@ namespace AzToolsFramework { (void)name; QueueEntityUpdate(entityId); + + bool isSelected = false; + AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( + isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId); + + if (isSelected) + { + // Ask the system to scroll to the entity in case it is off screen after the rename + EntityOutlinerModelNotificationBus::Broadcast(&EntityOutlinerModelNotifications::QueueScrollToNewContent, entityId); + } } void EntityOutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp index cc65b61908..8293614525 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.cpp @@ -172,7 +172,7 @@ namespace AzToolsFramework const int autoExpandDelayMilliseconds = 2500; m_gui->m_objectTree->setSelectionMode(QAbstractItemView::ExtendedSelection); - m_gui->m_objectTree->setEditTriggers(QAbstractItemView::EditKeyPressed); + SetDefaultTreeViewEditTriggers(); m_gui->m_objectTree->setAutoExpandDelay(autoExpandDelayMilliseconds); m_gui->m_objectTree->setDragEnabled(true); m_gui->m_objectTree->setDropIndicatorShown(true); @@ -850,6 +850,11 @@ namespace AzToolsFramework addAction(m_actionGoToEntitiesInViewport); } + void EntityOutlinerWidget::SetDefaultTreeViewEditTriggers() + { + m_gui->m_objectTree->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::EditKeyPressed); + } + void EntityOutlinerWidget::OnEntityPickModeStarted() { m_gui->m_objectTree->setDragEnabled(false); @@ -862,7 +867,7 @@ namespace AzToolsFramework { m_gui->m_objectTree->setDragEnabled(true); m_gui->m_objectTree->setSelectionMode(QAbstractItemView::ExtendedSelection); - m_gui->m_objectTree->setEditTriggers(QAbstractItemView::SelectedClicked | QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed); + SetDefaultTreeViewEditTriggers(); m_inObjectPickMode = false; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx index 9a02febab2..6e3979a21e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Outliner/EntityOutlinerWidget.hxx @@ -166,6 +166,8 @@ namespace AzToolsFramework // to a given entity void QueueScrollToNewContent(const AZ::EntityId& entityId) override; + void SetDefaultTreeViewEditTriggers(); + void ScrollToNewContent(); bool m_scrollToNewContentQueued; bool m_scrollToSelectedEntity; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp index bc7afbf085..61d4433c0e 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/Prefab/PrefabIntegrationManager.cpp @@ -93,28 +93,12 @@ namespace AzToolsFramework EditorContextMenuBus::Handler::BusConnect(); PrefabInstanceContainerNotificationBus::Handler::BusConnect(); AZ::Interface::Register(this); - - bool prefabWipFeaturesEnabled = false; - AzFramework::ApplicationRequests::Bus::BroadcastResult( - prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled); - - if (prefabWipFeaturesEnabled) - { - AssetBrowser::AssetBrowserSourceDropBus::Handler::BusConnect(s_prefabFileExtension); - } + AssetBrowser::AssetBrowserSourceDropBus::Handler::BusConnect(s_prefabFileExtension); } PrefabIntegrationManager::~PrefabIntegrationManager() { - bool prefabWipFeaturesEnabled = false; - AzFramework::ApplicationRequests::Bus::BroadcastResult( - prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled); - - if (prefabWipFeaturesEnabled) - { - AssetBrowser::AssetBrowserSourceDropBus::Handler::BusDisconnect(); - } - + AssetBrowser::AssetBrowserSourceDropBus::Handler::BusDisconnect(); AZ::Interface::Unregister(this); PrefabInstanceContainerNotificationBus::Handler::BusDisconnect(); EditorContextMenuBus::Handler::BusDisconnect(); @@ -137,66 +121,63 @@ namespace AzToolsFramework void PrefabIntegrationManager::PopulateEditorGlobalContextMenu(QMenu* menu) const { - bool prefabWipFeaturesEnabled = false; - AzFramework::ApplicationRequests::Bus::BroadcastResult( - prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled); - AzToolsFramework::EntityIdList selectedEntities; AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult( selectedEntities, &AzToolsFramework::ToolsApplicationRequests::GetSelectedEntities); - if (prefabWipFeaturesEnabled) + bool prefabWipFeaturesEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult( + prefabWipFeaturesEnabled, &AzFramework::ApplicationRequests::ArePrefabWipFeaturesEnabled); + + // Create Prefab { - // Create Prefab + if (!selectedEntities.empty()) { - if (!selectedEntities.empty()) + // Hide if the only selected entity is the Level Container + if (selectedEntities.size() > 1 || !s_prefabPublicInterface->IsLevelInstanceContainerEntity(selectedEntities[0])) { - // Hide if the only selected entity is the Level Container - if (selectedEntities.size() > 1 || !s_prefabPublicInterface->IsLevelInstanceContainerEntity(selectedEntities[0])) + bool layerInSelection = false; + + for (AZ::EntityId entityId : selectedEntities) { - bool layerInSelection = false; - - for (AZ::EntityId entityId : selectedEntities) - { - if (!layerInSelection) - { - AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult( - layerInSelection, entityId, - &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); - - if (layerInSelection) - { - break; - } - } - } - - // Layers can't be in prefabs. if (!layerInSelection) { - QAction* createAction = menu->addAction(QObject::tr("Create Prefab...")); - createAction->setToolTip(QObject::tr("Creates a prefab out of the currently selected entities.")); + AzToolsFramework::Layers::EditorLayerComponentRequestBus::EventResult( + layerInSelection, entityId, + &AzToolsFramework::Layers::EditorLayerComponentRequestBus::Events::HasLayer); - QObject::connect(createAction, &QAction::triggered, createAction, [this, selectedEntities] { - ContextMenu_CreatePrefab(selectedEntities); - }); + if (layerInSelection) + { + break; + } } } + + // Layers can't be in prefabs. + if (!layerInSelection) + { + QAction* createAction = menu->addAction(QObject::tr("Create Prefab...")); + createAction->setToolTip(QObject::tr("Creates a prefab out of the currently selected entities.")); + + QObject::connect(createAction, &QAction::triggered, createAction, [this, selectedEntities] { + ContextMenu_CreatePrefab(selectedEntities); + }); + } } } - - // Instantiate Prefab - { - QAction* instantiateAction = menu->addAction(QObject::tr("Instantiate Prefab...")); - instantiateAction->setToolTip(QObject::tr("Instantiates a prefab file in the scene.")); - - QObject::connect( - instantiateAction, &QAction::triggered, instantiateAction, [this] { ContextMenu_InstantiatePrefab(); }); - } - - menu->addSeparator(); } + // Instantiate Prefab + { + QAction* instantiateAction = menu->addAction(QObject::tr("Instantiate Prefab...")); + instantiateAction->setToolTip(QObject::tr("Instantiates a prefab file in the scene.")); + + QObject::connect( + instantiateAction, &QAction::triggered, instantiateAction, [this] { ContextMenu_InstantiatePrefab(); }); + } + + menu->addSeparator(); + bool itemWasShown = false; // Edit/Save Prefab @@ -352,7 +333,8 @@ namespace AzToolsFramework } } - auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab(selectedEntities, s_prefabLoaderInterface->GetRelativePathToProject(prefabFilePath.data())); + auto createPrefabOutcome = s_prefabPublicInterface->CreatePrefab( + selectedEntities, s_prefabLoaderInterface->GenerateRelativePath(prefabFilePath.data())); if (!createPrefabOutcome.IsSuccess()) { diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GenericComboBoxCtrl.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GenericComboBoxCtrl.h index 48b5148d3c..4cf6d077e7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GenericComboBoxCtrl.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/GenericComboBoxCtrl.h @@ -83,7 +83,7 @@ namespace AzToolsFramework protected: QWidget* GetFirstInTabOrder() override; QWidget* GetLastInTabOrder() override; - void UpdateTabOrder() override; + void UpdateTabOrder() override; void onChildComboBoxValueChange(int comboBoxIndex) override; @@ -93,7 +93,7 @@ namespace AzToolsFramework void addElementImpl(const AZStd::pair& genericValue); - QLabel* m_warningLabel = nullptr; + QLabel* m_warningLabel = nullptr; DHQComboBox* m_pComboBox; AZStd::vector> m_values; AZ::AttributeFunction * m_postChangeNotifyCB{}; @@ -131,6 +131,11 @@ namespace AzToolsFramework template AzToolsFramework::PropertyHandlerBase* RegisterGenericComboBoxHandler() { + if (!AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) + { + return nullptr; + } + auto propertyHandler = aznew GenericComboBoxHandler(); AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, propertyHandler); return propertyHandler; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp index a96ba2881f..68f6a4f493 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/Model/AssetCompleterModel.cpp @@ -140,8 +140,7 @@ namespace AzToolsFramework ProductAssetBrowserEntry* productEntry = static_cast(childEntry); AZStd::string assetName; AzFramework::StringFunc::Path::GetFileName(productEntry->GetFullPath().c_str(), assetName); - m_assets.push_back({ - assetName, productEntry->GetFullPath(), productEntry->GetAssetId() + m_assets.push_back({ productEntry->GetName(), productEntry->GetFullPath(), productEntry->GetAssetId() }); } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp index d69eb5559f..169a90497b 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.cpp @@ -769,6 +769,31 @@ namespace AzToolsFramework // Request the AssetBrowser Dialog and set a type filter AssetSelectionModel selection = GetAssetSelectionModel(); selection.SetSelectedAssetId(m_selectedAssetID); + + AZStd::string defaultDirectory; + if (m_defaultDirectoryCallback) + { + m_defaultDirectoryCallback->Invoke(m_editNotifyTarget, defaultDirectory); + selection.SetDefaultDirectory(defaultDirectory); + } + + if (m_hideProductFilesInAssetPicker) + { + FilterConstType displayFilter = selection.GetDisplayFilter(); + + EntryTypeFilter* productsFilter = new EntryTypeFilter(); + productsFilter->SetEntryType(AssetBrowserEntry::AssetEntryType::Product); + + InverseFilter* noProductsFilter = new InverseFilter(); + noProductsFilter->SetFilter(FilterConstType(productsFilter)); + + CompositeFilter* compFilter = new CompositeFilter(CompositeFilter::LogicOperatorType::AND); + compFilter->AddFilter(FilterConstType(displayFilter)); + compFilter->AddFilter(FilterConstType(noProductsFilter)); + + selection.SetDisplayFilter(FilterConstType(compFilter)); + } + AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, parentWidget()); if (selection.IsValid()) { @@ -928,11 +953,16 @@ namespace AzToolsFramework return; } - const AZ::Data::AssetId assetID = GetCurrentAssetID(); - m_currentAssetHint = ""; - - if (!m_unnamedType) + const AZStd::string& folderPath = GetFolderSelection(); + if (!folderPath.empty()) { + m_currentAssetHint = folderPath; + } + else + { + const AZ::Data::AssetId assetID = GetCurrentAssetID(); + m_currentAssetHint = ""; + AZ::Outcome jobOutcome = AZ::Failure(); AssetSystemJobRequestBus::BroadcastResult(jobOutcome, &AssetSystemJobRequestBus::Events::GetAssetJobsInfoByAssetID, assetID, false, false); @@ -946,7 +976,7 @@ namespace AzToolsFramework if (!jobs.empty()) { - // The default behavior is show to the source filename. + // The default behavior is to show the source filename. assetPath = jobs[0].m_sourceFile; AZStd::string errorLog; @@ -1080,6 +1110,11 @@ namespace AzToolsFramework m_editNotifyCallback = editNotifyCallback; } + void PropertyAssetCtrl::SetDefaultDirectoryCallback(DefaultDirectoryCallbackType* callback) + { + m_defaultDirectoryCallback = callback; + } + void PropertyAssetCtrl::SetClearNotifyCallback(ClearCallbackType* clearNotifyCallback) { m_clearNotifyCallback = clearNotifyCallback; @@ -1159,6 +1194,16 @@ namespace AzToolsFramework return m_showProductAssetName; } + void PropertyAssetCtrl::SetHideProductFilesInAssetPicker(bool hide) + { + m_hideProductFilesInAssetPicker = hide; + } + + bool PropertyAssetCtrl::GetHideProductFilesInAssetPicker() const + { + return m_hideProductFilesInAssetPicker; + } + void PropertyAssetCtrl::SetShowThumbnail(bool enable) { m_showThumbnail = enable; @@ -1214,6 +1259,11 @@ namespace AzToolsFramework GUI->SetTitle(title.c_str()); } } + else if (attrib == AZ_CRC_CE("DefaultStartingDirectoryCallback")) + { + // This is assumed to be an Asset Browser path to a specific folder to be used as a default by the asset picker if provided + GUI->SetDefaultDirectoryCallback(azdynamic_cast(attrValue->GetAttribute())); + } else if (attrib == AZ_CRC("EditCallback", 0xb74f2ee1)) { PropertyAssetCtrl::EditCallbackType* func = azdynamic_cast(attrValue->GetAttribute()); @@ -1279,6 +1329,14 @@ namespace AzToolsFramework GUI->SetShowProductAssetName(showProductAssetName); } } + else if(attrib == AZ::Edit::Attributes::HideProductFilesInAssetPicker) + { + bool hideProductFilesInAssetPicker = false; + if (attrValue->Read(hideProductFilesInAssetPicker)) + { + GUI->SetHideProductFilesInAssetPicker(hideProductFilesInAssetPicker); + } + } else if (attrib == AZ::Edit::Attributes::ClearNotify) { PropertyAssetCtrl::ClearCallbackType* func = azdynamic_cast(attrValue->GetAttribute()); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx index e845cdf4fb..5a6310eb35 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyAssetCtrl.hxx @@ -68,6 +68,7 @@ namespace AzToolsFramework // This is meant to be used with the "EditCallback" Attribute using EditCallbackType = AZ::Edit::AttributeFunction; using ClearCallbackType = AZ::Edit::AttributeFunction; + using DefaultDirectoryCallbackType = AZ::Edit::AttributeFunction; PropertyAssetCtrl(QWidget *pParent = NULL, QString optionalValidDragDropExtensions = QString()); virtual ~PropertyAssetCtrl(); @@ -119,6 +120,7 @@ namespace AzToolsFramework EditCallbackType* m_editNotifyCallback = nullptr; ClearCallbackType* m_clearNotifyCallback = nullptr; QString m_optionalValidDragDropExtensions; + DefaultDirectoryCallbackType* m_defaultDirectoryCallback = nullptr; //! The number of characters after which the autocompleter dropdown will be shown. // Prevents showing too many options. @@ -156,6 +158,10 @@ namespace AzToolsFramework //! Assets can be either source or product assets generated from source assets. By default, source assets are shown in the property asset. You can override that with this flag. bool m_showProductAssetName = true; + //! Assets can be either source or product assets generated from source assets. + //! By default the asset picker shows both on an AZ::Asset<> property. You can hide product assets with this flag. + bool m_hideProductFilesInAssetPicker = false; + bool m_showThumbnail = false; bool m_showThumbnailDropDownButton = false; EditCallbackType* m_thumbnailCallback = nullptr; @@ -196,6 +202,7 @@ namespace AzToolsFramework void SetEditNotifyTarget(void* editNotifyTarget); void SetEditNotifyCallback(EditCallbackType* editNotifyCallback); // This is meant to be used with the "EditCallback" Attribute void SetClearNotifyCallback(ClearCallbackType* clearNotifyCallback); // This is meant to be used with the "ClearNotify" Attribute + void SetDefaultDirectoryCallback(DefaultDirectoryCallbackType* callback); // This is meant to be used with the "DefaultStartingDirectoryCallback" Attribute void SetEditButtonEnabled(bool enabled); void SetEditButtonVisible(bool visible); void SetEditButtonIcon(const QIcon& icon); @@ -208,6 +215,9 @@ namespace AzToolsFramework void SetShowProductAssetName(bool enable); bool GetShowProductAssetName() const; + void SetHideProductFilesInAssetPicker(bool hide); + bool GetHideProductFilesInAssetPicker() const; + void SetShowThumbnail(bool enable); bool GetShowThumbnail() const; void SetShowThumbnailDropDownButton(bool enable); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp index bd61e6ceed..6dc5bdd001 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyManagerComponent.cpp @@ -16,7 +16,6 @@ #include #include #include -#include namespace AzToolsFramework { @@ -38,7 +37,6 @@ namespace AzToolsFramework void RegisterButtonPropertyHandlers(); void RegisterMultiLineEditHandler(); void RegisterCrcHandler(); - void RegisterTransformScaleHandler(); void ReflectPropertyEditor(AZ::ReflectContext* context); namespace Components @@ -192,7 +190,6 @@ namespace AzToolsFramework RegisterVectorHandlers(); RegisterButtonPropertyHandlers(); RegisterMultiLineEditHandler(); - RegisterTransformScaleHandler(); // GenericComboBoxHandlers RegisterGenericComboBoxHandler(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp index 8c371baf8c..890253b528 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.cpp @@ -27,6 +27,7 @@ AZ_PUSH_DISABLE_WARNING(4244 4251 4800, "-Wunknown-warning-option") // 4244: con #include #include #include +#include AZ_POP_DISABLE_WARNING static const int LabelColumnStretch = 2; @@ -121,6 +122,19 @@ namespace AzToolsFramework setLayout(m_mainLayout); } + void PropertyRowWidget::paintEvent(QPaintEvent* event) + { + QStylePainter p(this); + + if (CanBeReordered()) + { + const QPen linePen(QColor(0x3B3E3F)); + p.setPen(linePen); + int indent = m_treeDepth * m_treeIndentation; + p.drawLine(event->rect().topLeft() + QPoint(indent, 0), event->rect().topRight()); + } + } + bool PropertyRowWidget::HasChildWidgetAlready() const { return m_childWidget != nullptr; @@ -1661,6 +1675,20 @@ namespace AzToolsFramework m_nameLabel->setFilter(m_currentFilterString); } + bool PropertyRowWidget::CanChildrenBeReordered() const + { + return m_containerEditable; + } + + bool PropertyRowWidget::CanBeReordered() const + { + if (!m_parentRow) + { + return false; + } + + return m_parentRow->CanChildrenBeReordered(); + } } #include "UI/PropertyEditor/moc_PropertyRowWidget.cpp" diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx index e4b538ccdc..79121403c9 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UI/PropertyEditor/PropertyRowWidget.hxx @@ -44,6 +44,7 @@ namespace AzToolsFramework Q_PROPERTY(bool hasChildRows READ HasChildRows); Q_PROPERTY(bool isTopLevel READ IsTopLevel); Q_PROPERTY(int getLevel READ GetLevel); + Q_PROPERTY(bool canBeReordered READ CanBeReordered); Q_PROPERTY(bool appendDefaultLabelToName READ GetAppendDefaultLabelToName WRITE AppendDefaultLabelToName) public: AZ_CLASS_ALLOCATOR(PropertyRowWidget, AZ::SystemAllocator, 0) @@ -126,6 +127,7 @@ namespace AzToolsFramework void SetSelectionEnabled(bool selectionEnabled); void SetSelected(bool selected); bool eventFilter(QObject *watched, QEvent *event) override; + void paintEvent(QPaintEvent*) override; /// Apply tooltip to widget and some of its children. void SetDescription(const QString& text); @@ -146,6 +148,9 @@ namespace AzToolsFramework QLabel* GetNameLabel() { return m_nameLabel; } void SetIndentSize(int w); void SetAsCustom(bool custom) { m_custom = custom; } + + bool CanChildrenBeReordered() const; + bool CanBeReordered() const; protected: int CalculateLabelWidth() const; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h index 53dab661ce..276982d46d 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/UnitTest/AzToolsFrameworkTestHelpers.h @@ -138,7 +138,7 @@ namespace UnitTest if (!GetApplication()) { // Create & Start a new ToolsApplication if there's no existing one - m_app = AZStd::make_unique("ToolsApplication"); + m_app = CreateTestApplication(); m_app->Start(AzFramework::Application::Descriptor()); } @@ -216,6 +216,12 @@ namespace UnitTest TestEditorActions m_editorActions; ToolsApplicationMessageHandler m_messageHandler; // used to suppress trace messages in test output + // Override this if your test fixture needs to use a custom TestApplication + virtual AZStd::unique_ptr CreateTestApplication() + { + return AZStd::make_unique("ToolsApplication"); + } + private: AZStd::unique_ptr m_app; }; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.h b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.h index ee95412376..91eee18cb7 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/Viewport/ViewportMessages.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -164,15 +165,18 @@ namespace AzToolsFramework virtual bool AngleSnappingEnabled() = 0; /// Return the angle snapping/step size. virtual float AngleStep() = 0; - /// Transform a point in world space to screen space coordinates. + /// Transform a point in world space to screen space coordinates in Qt Widget space. + /// Multiply by DeviceScalingFactor to get the position in viewport pixel space. virtual AzFramework::ScreenPoint ViewportWorldToScreen(const AZ::Vector3& worldPosition) = 0; - /// Transform a point in screen space coordinates to a vector in world space based on clip space depth. + /// Transform a point from Qt widget screen space to world space based on the given clip space depth. /// Depth specifies a relative camera depth to project in the range of [0.f, 1.f]. /// Returns the world space position if successful. virtual AZStd::optional ViewportScreenToWorld(const AzFramework::ScreenPoint& screenPosition, float depth) = 0; /// Casts a point in screen space to a ray in world space originating from the viewport camera frustum's near plane. /// Returns a ray containing the ray's origin and a direction normal, if successful. virtual AZStd::optional ViewportScreenToWorldRay(const AzFramework::ScreenPoint& screenPosition) = 0; + /// Gets the DPI scaling factor that translates Qt widget space into viewport pixel space. + virtual float DeviceScalingFactor() = 0; protected: ~ViewportInteractionRequests() = default; @@ -304,4 +308,24 @@ namespace AzToolsFramework return entityContextId; } + + //! Maps a mouse interaction event to a ClickDetector event. + //! @note Function only cares about up or down events, all other events are mapped to Nil (ignored). + inline AzFramework::ClickDetector::ClickEvent ClickDetectorEventFromViewportInteraction( + const ViewportInteraction::MouseInteractionEvent& mouseInteraction) + { + if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Left()) + { + if (mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Down) + { + return AzFramework::ClickDetector::ClickEvent::Down; + } + + if (mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Up) + { + return AzFramework::ClickDetector::ClickEvent::Up; + } + } + return AzFramework::ClickDetector::ClickEvent::Nil; + } } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp index 2e467caa4c..531cffb561 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.cpp @@ -14,6 +14,7 @@ #include #include +#include #include @@ -27,8 +28,11 @@ namespace AzToolsFramework { AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); - if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Left() && - mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Down) + m_cursorState.SetCurrentPosition(mouseInteraction.m_mouseInteraction.m_mousePick.m_screenCoordinates); + + const auto selectClickEvent = ClickDetectorEventFromViewportInteraction(mouseInteraction); + const auto clickOutcome = m_clickDetector.DetectClick(selectClickEvent, m_cursorState.CursorDelta()); + if (clickOutcome == AzFramework::ClickDetector::ClickOutcome::Move) { if (m_leftMouseDown) { @@ -58,8 +62,7 @@ namespace AzToolsFramework } } - if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Left() && - mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Up) + if (clickOutcome == AzFramework::ClickDetector::ClickOutcome::Release) { if (m_leftMouseUp) { @@ -77,6 +80,8 @@ namespace AzToolsFramework { AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); + m_cursorState.Update(); + if (m_boxSelectRegion) { debugDisplay.DepthTestOff(); diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.h index 7f50b16325..c115220755 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorBoxSelect.h @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include @@ -26,49 +28,49 @@ namespace AzFramework namespace AzToolsFramework { - /// Utility to provide box select (click and drag) support for viewport types. - /// Users can override the mouse event callbacks and display scene function to customize behavior. + //! Utility to provide box select (click and drag) support for viewport types. + //! Users can override the mouse event callbacks and display scene function to customize behavior. class EditorBoxSelect { public: EditorBoxSelect() = default; - /// Return if a box select action is currently taking place. + //! Return if a box select action is currently taking place. bool Active() const { return m_boxSelectRegion.has_value(); } - /// Update the box select for various mouse events. - /// Call HandleMouseInteraction from type/system implementing MouseViewportRequests interface. + //! Update the box select for various mouse events. + //! Call HandleMouseInteraction from type/system implementing MouseViewportRequests interface. void HandleMouseInteraction( const ViewportInteraction::MouseInteractionEvent& mouseInteraction); - /// Responsible for drawing the 2d box representing the selection in screen space. + //! Responsible for drawing the 2d box representing the selection in screen space. void Display2d(const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); - /// Custom drawing behavior to happen during a box select. + //! Custom drawing behavior to happen during a box select. void DisplayScene( const AzFramework::ViewportInfo& viewportInfo, AzFramework::DebugDisplayRequests& debugDisplay); - /// Set the left mouse down callback. + //! Set the left mouse down callback. void InstallLeftMouseDown( const AZStd::function& leftMouseDown); - /// Set the mouse move callback. + //! Set the mouse move callback. void InstallMouseMove( const AZStd::function& mouseMove); - /// Set the left mouse up callback. + //! Set the left mouse up callback. void InstallLeftMouseUp( const AZStd::function& leftMouseUp); - /// Set the display scene callback. + //! Set the display scene callback. void InstallDisplayScene( const AZStd::function& displayScene); - /// Return the box select region. - /// If a box selection is being made, return the current rectangle representing the area. - /// If there is currently no active box select, then the Maybe type will be empty (there will be no region/area). + //! Return the box select region. + //! If a box selection is being made, return the current rectangle representing the area. + //! If there is currently no active box select, then the Maybe type will be empty (there will be no region/area). const AZStd::optional& BoxRegion() const { return m_boxSelectRegion; } - /// Return the active modifiers from the previous frame. + //! Return the active modifiers from the previous frame. ViewportInteraction::KeyboardModifiers PreviousModifiers() const { return m_previousModifiers; } private: @@ -79,7 +81,9 @@ namespace AzToolsFramework AZStd::function m_displayScene; - AZStd::optional m_boxSelectRegion; ///< Maybe/optional value to store box select region while active. - ViewportInteraction::KeyboardModifiers m_previousModifiers; ///< Modifier keys active on the previous frame. + AZStd::optional m_boxSelectRegion; //!< Maybe/optional value to store box select region while active. + ViewportInteraction::KeyboardModifiers m_previousModifiers; //!< Modifier keys active on the previous frame. + AzFramework::ClickDetector m_clickDetector; //!< Utility type to detect if a mouse click or move has occurred. + AzFramework::CursorState m_cursorState; //!< Utility type to track the current cursor position (and movement/delta). }; } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp index d649e036ee..31da01fadc 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp @@ -21,6 +21,7 @@ #include #include #include +#include AZ_CVAR( bool, ed_visibility_showAggregateEntitySelectionBounds, false, nullptr, AZ::ConsoleFunctorFlags::Null, @@ -232,10 +233,14 @@ namespace AzToolsFramework return AZ::Color(1.0f, 1.0f, 1.0f, 1.0f); }(); - debugDisplay.SetColor(iconHighlight); - debugDisplay.DrawTextureLabel( - iconTextureId, entityPosition, iconSize, iconSize, - /*DisplayContext::ETextureIconFlags::TEXICON_ON_TOP=*/ 0x0008); + EditorViewportIconDisplay::Get()->DrawIcon({ + viewportInfo.m_viewportId, + iconTextureId, + iconHighlight, + entityPosition, + EditorViewportIconDisplayInterface::CoordinateSpace::WorldSpace, + AZ::Vector2{iconSize, iconSize} + }); } } } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp index 6e49f7c601..3507f532b5 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.cpp @@ -435,7 +435,7 @@ namespace AzToolsFramework } } - static void DestroyTransformModeSelectionCluster(const ViewportUi::ClusterId clusterId) + static void DestroyCluster(const ViewportUi::ClusterId clusterId) { ViewportUi::ViewportUiRequestBus::Event( ViewportUi::DefaultViewportId, @@ -483,6 +483,26 @@ namespace AzToolsFramework return worldFromLocal.TransformPoint(CalculateCenterOffset(entityId, pivot)); } + void EditorTransformComponentSelection::UpdateSpaceCluster(const ReferenceFrame referenceFrame) + { + auto buttonIdFromFrameFn = [this](const ReferenceFrame referenceFrame) { + switch (referenceFrame) + { + case ReferenceFrame::Local: + return m_spaceCluster.m_localButtonId; + case ReferenceFrame::Parent: + return m_spaceCluster.m_parentButtonId; + case ReferenceFrame::World: + return m_spaceCluster.m_worldButtonId; + } + return m_spaceCluster.m_parentButtonId; + }; + + ViewportUi::ViewportUiRequestBus::Event( + ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::SetClusterActiveButton, m_spaceCluster.m_spaceClusterId, + buttonIdFromFrameFn(referenceFrame)); + } + namespace ETCS { PivotOrientationResult CalculatePivotOrientation( @@ -789,14 +809,12 @@ namespace AzToolsFramework EntityIdManipulators& entityIdManipulators, OptionalFrame& pivotOverrideFrame, ViewportInteraction::KeyboardModifiers& prevModifiers, - bool& transformChangedInternally) + bool& transformChangedInternally, const AZStd::optional spaceLock) { AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); entityIdManipulators.m_manipulators->SetLocalPosition(action.LocalPosition()); - const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(action.m_modifiers); - if (action.m_modifiers.Ctrl()) { // moving with ctrl - setting override @@ -806,6 +824,8 @@ namespace AzToolsFramework } else { + const ReferenceFrame referenceFrame = spaceLock.value_or(ReferenceFrameFromModifiers(action.m_modifiers)); + // note: used for parent and world depending on the current reference frame const auto pivotOrientation = ETCS::CalculateSelectionPivotOrientation( @@ -1027,6 +1047,7 @@ namespace AzToolsFramework EditorManipulatorCommandUndoRedoRequestBus::Handler::BusConnect(entityContextId); CreateTransformModeSelectionCluster(); + CreateSpaceSelectionCluster(); RegisterActions(); SetupBoxSelect(); RefreshSelectedEntityIdsAndRegenerateManipulators(); @@ -1037,7 +1058,9 @@ namespace AzToolsFramework m_selectedEntityIds.clear(); DestroyManipulators(m_entityIdManipulators); - DestroyTransformModeSelectionCluster(m_transformModeClusterId); + DestroyCluster(m_transformModeClusterId); + DestroyCluster(m_spaceCluster.m_spaceClusterId); + UnregisterActions(); m_pivotOverrideFrame.Reset(); @@ -1274,8 +1297,8 @@ namespace AzToolsFramework [this, prevModifiers, manipulatorEntityIds](const LinearManipulator::Action& action) mutable -> void { UpdateTranslationManipulator( - action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, - m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally); + action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers, + m_transformChangedInternally, m_spaceCluster.m_spaceLock); }); translationManipulators->InstallLinearManipulatorMouseUpCallback( @@ -1305,8 +1328,8 @@ namespace AzToolsFramework [this, prevModifiers, manipulatorEntityIds](const PlanarManipulator::Action& action) mutable -> void { UpdateTranslationManipulator( - action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, - m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally); + action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers, + m_transformChangedInternally, m_spaceCluster.m_spaceLock); }); translationManipulators->InstallPlanarManipulatorMouseUpCallback( @@ -1335,8 +1358,8 @@ namespace AzToolsFramework [this, prevModifiers, manipulatorEntityIds](const SurfaceManipulator::Action& action) mutable -> void { UpdateTranslationManipulator( - action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, - m_pivotOverrideFrame, prevModifiers, m_transformChangedInternally); + action, manipulatorEntityIds->m_entityIds, m_entityIdManipulators, m_pivotOverrideFrame, prevModifiers, + m_transformChangedInternally, m_spaceCluster.m_spaceLock); }); translationManipulators->InstallSurfaceManipulatorMouseUpCallback( @@ -1414,8 +1437,7 @@ namespace AzToolsFramework [this, prevModifiers, sharedRotationState] (const AngularManipulator::Action& action) mutable -> void { - const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(action.m_modifiers); - + const ReferenceFrame referenceFrame = m_spaceCluster.m_spaceLock.value_or(ReferenceFrameFromModifiers(action.m_modifiers)); const AZ::Quaternion manipulatorOrientation = action.m_start.m_rotation * action.m_current.m_delta; // store the pivot override frame when positioning the manipulator manually (ctrl) // so we don't lose the orientation when adding/removing entities from the selection @@ -1474,7 +1496,7 @@ namespace AzToolsFramework { const AZ::Quaternion rotation = entityIdLookupIt->second.m_initial.GetRotation().GetNormalized(); const AZ::Vector3 position = entityIdLookupIt->second.m_initial.GetTranslation(); - const AZ::Vector3 scale = entityIdLookupIt->second.m_initial.GetScale(); + const float scale = entityIdLookupIt->second.m_initial.GetUniformScale(); const AZ::Vector3 centerOffset = CalculateCenterOffset(entityId, m_pivotMode); @@ -1485,7 +1507,7 @@ namespace AzToolsFramework AZ::Transform::CreateFromQuaternion(rotation) * AZ::Transform::CreateTranslation(centerOffset) * offsetRotation * AZ::Transform::CreateTranslation(-centerOffset) * - AZ::Transform::CreateScale(scale)); + AZ::Transform::CreateUniformScale(scale)); } break; case ReferenceFrame::Parent: @@ -1597,16 +1619,15 @@ namespace AzToolsFramework } const AZ::Transform initial = entityIdLookupIt->second.m_initial; - const AZ::Vector3 initialScale = initial.GetScale(); + const float initialScale = initial.GetUniformScale(); const auto sumVectorElements = [](const AZ::Vector3& vec) { return vec.GetX() + vec.GetY() + vec.GetZ(); }; - const AZ::Vector3 uniformScale = AZ::Vector3(action.m_start.m_sign * sumVectorElements(action.LocalScaleOffset())); - const AZ::Vector3 scale = (AZ::Vector3::CreateOne() + - (uniformScale / initialScale)).GetClamp(AZ::Vector3(AZ::MinTransformScale), AZ::Vector3(AZ::MaxTransformScale)); - const AZ::Transform scaleTransform = AZ::Transform::CreateScale(scale); + const float uniformScale = action.m_start.m_sign * sumVectorElements(action.LocalScaleOffset()); + const float scale = AZ::GetClamp(1.0f + uniformScale / initialScale, AZ::MinTransformScale, AZ::MaxTransformScale); + const AZ::Transform scaleTransform = AZ::Transform::CreateUniformScale(scale); if (action.m_modifiers.Alt()) { @@ -1782,22 +1803,7 @@ namespace AzToolsFramework m_cachedEntityIdUnderCursor = m_editorHelpers->HandleMouseInteraction(cameraState, mouseInteraction); - const AzFramework::ClickDetector::ClickEvent selectClickEvent = [&mouseInteraction] { - if (mouseInteraction.m_mouseInteraction.m_mouseButtons.Left()) - { - if (mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Down) - { - return AzFramework::ClickDetector::ClickEvent::Down; - } - - if (mouseInteraction.m_mouseEvent == ViewportInteraction::MouseEvent::Up) - { - return AzFramework::ClickDetector::ClickEvent::Up; - } - } - return AzFramework::ClickDetector::ClickEvent::Nil; - }(); - + const auto selectClickEvent = ClickDetectorEventFromViewportInteraction(mouseInteraction); m_cursorState.SetCurrentPosition(mouseInteraction.m_mouseInteraction.m_mousePick.m_screenCoordinates); const auto clickOutcome = m_clickDetector.DetectClick(selectClickEvent, m_cursorState.CursorDelta()); @@ -1887,7 +1893,7 @@ namespace AzToolsFramework CopyOrientationToSelectedEntitiesGroup(QuaternionFromTransformNoScaling(worldFromLocal)); break; case Mode::Scale: - CopyScaleToSelectedEntitiesIndividualWorld(worldFromLocal.GetScale()); + CopyScaleToSelectedEntitiesIndividualWorld(worldFromLocal.GetUniformScale()); break; case Mode::Translation: CopyTranslationToSelectedEntitiesGroup(worldFromLocal.GetTranslation()); @@ -1916,7 +1922,7 @@ namespace AzToolsFramework CopyOrientationToSelectedEntitiesIndividual(QuaternionFromTransformNoScaling(worldFromLocal)); break; case Mode::Scale: - CopyScaleToSelectedEntitiesIndividualWorld(worldFromLocal.GetScale()); + CopyScaleToSelectedEntitiesIndividualWorld(worldFromLocal.GetUniformScale()); break; case Mode::Translation: CopyTranslationToSelectedEntitiesIndividual(worldFromLocal.GetTranslation()); @@ -2409,7 +2415,7 @@ namespace AzToolsFramework ResetOrientationForSelectedEntitiesLocal(); break; case Mode::Scale: - CopyScaleToSelectedEntitiesIndividualLocal(AZ::Vector3::CreateOne()); + CopyScaleToSelectedEntitiesIndividualLocal(1.0f); break; case Mode::Translation: ResetTranslationForSelectedEntitiesLocal(); @@ -2435,7 +2441,7 @@ namespace AzToolsFramework ResetOrientationForSelectedEntitiesLocal(); break; case Mode::Scale: - CopyScaleToSelectedEntitiesIndividualWorld(AZ::Vector3::CreateOne()); + CopyScaleToSelectedEntitiesIndividualWorld(1.0f); break; case Mode::Translation: // do nothing @@ -2582,6 +2588,64 @@ namespace AzToolsFramework m_transformModeSelectionHandler); } + void EditorTransformComponentSelection::CreateSpaceSelectionCluster() + { + // create the cluster for switching spaces/reference frames + ViewportUi::ViewportUiRequestBus::EventResult( + m_spaceCluster.m_spaceClusterId, ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::CreateCluster, + ViewportUi::Alignment::TopRight); + + // create and register the buttons (strings correspond to icons even if the values appear different) + m_spaceCluster.m_worldButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "World"); + m_spaceCluster.m_parentButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "Parent"); + m_spaceCluster.m_localButtonId = RegisterClusterButton(m_spaceCluster.m_spaceClusterId, "Local"); + + auto onButtonClicked = [this](ViewportUi::ButtonId buttonId) { + if (buttonId == m_spaceCluster.m_localButtonId) + { + // Unlock + if (m_spaceCluster.m_spaceLock.has_value() && m_spaceCluster.m_spaceLock.value() == ReferenceFrame::Local) + { + m_spaceCluster.m_spaceLock = AZStd::nullopt; + } + else + { + m_spaceCluster.m_spaceLock = ReferenceFrame::Local; + } + } + else if (buttonId == m_spaceCluster.m_parentButtonId) + { + // Unlock + if (m_spaceCluster.m_spaceLock.has_value() && m_spaceCluster.m_spaceLock.value() == ReferenceFrame::Parent) + { + m_spaceCluster.m_spaceLock = AZStd::nullopt; + } + else + { + m_spaceCluster.m_spaceLock = ReferenceFrame::Parent; + } + } + else if (buttonId == m_spaceCluster.m_worldButtonId) + { + // Unlock + if (m_spaceCluster.m_spaceLock.has_value() && m_spaceCluster.m_spaceLock.value() == ReferenceFrame::World) + { + m_spaceCluster.m_spaceLock = AZStd::nullopt; + } + else + { + m_spaceCluster.m_spaceLock = ReferenceFrame::World; + } + } + }; + + m_spaceCluster.m_spaceSelectionHandler = AZ::Event::Handler(onButtonClicked); + + ViewportUi::ViewportUiRequestBus::Event( + ViewportUi::DefaultViewportId, &ViewportUi::ViewportUiRequestBus::Events::RegisterClusterEventHandler, + m_spaceCluster.m_spaceClusterId, m_spaceCluster.m_spaceSelectionHandler); + } + EditorTransformComponentSelectionRequests::Mode EditorTransformComponentSelection::GetTransformMode() { return m_mode; @@ -2955,7 +3019,7 @@ namespace AzToolsFramework } } - void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualWorld(const AZ::Vector3& scale) + void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualWorld(float scale) { AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); @@ -2970,7 +3034,7 @@ namespace AzToolsFramework const auto transformsBefore = RecordTransformsBefore(manipulatorEntityIds.m_entityIds); // update scale relative to initial - const AZ::Transform scaleTransform = AZ::Transform::CreateScale(scale); + const AZ::Transform scaleTransform = AZ::Transform::CreateUniformScale(scale); for (AZ::EntityId entityId : manipulatorEntityIds.m_entityIds) { ScopedUndoBatch::MarkEntityDirty(entityId); @@ -2979,7 +3043,7 @@ namespace AzToolsFramework if (transformIt != transformsBefore.end()) { AZ::Transform transformBefore = transformIt->second; - transformBefore.ExtractScale(); + transformBefore.ExtractUniformScale(); AZ::Transform newWorldFromLocal = transformBefore * scaleTransform; SetEntityWorldTransform(entityId, newWorldFromLocal); @@ -2989,7 +3053,7 @@ namespace AzToolsFramework RefreshUiAfterChange(manipulatorEntityIds.m_entityIds); } - void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualLocal(const AZ::Vector3& scale) + void EditorTransformComponentSelection::CopyScaleToSelectedEntitiesIndividualLocal(float scale) { AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzToolsFramework); @@ -3035,9 +3099,9 @@ namespace AzToolsFramework if (transformIt != transformsBefore.end()) { AZ::Transform newWorldFromLocal = transformIt->second; - const AZ::Vector3 scale = newWorldFromLocal.GetScale(); + const float scale = newWorldFromLocal.GetUniformScale(); newWorldFromLocal.SetRotation(orientation); - newWorldFromLocal *= AZ::Transform::CreateScale(scale); + newWorldFromLocal *= AZ::Transform::CreateUniformScale(scale); SetEntityWorldTransform(entityId, newWorldFromLocal); } @@ -3293,7 +3357,9 @@ namespace AzToolsFramework ViewportInteraction::BuildMouseButtons( QGuiApplication::mouseButtons()), m_boxSelect.Active()); - const ReferenceFrame referenceFrame = ReferenceFrameFromModifiers(modifiers); + const ReferenceFrame referenceFrame = m_spaceCluster.m_spaceLock.value_or(ReferenceFrameFromModifiers(modifiers)); + + UpdateSpaceCluster(referenceFrame); bool refresh = false; if (referenceFrame != m_referenceFrame) @@ -3684,7 +3750,7 @@ namespace AzToolsFramework } void EditorTransformComponentSelection::SetEntityLocalScale( - const AZ::EntityId entityId, const AZ::Vector3& localScale) + const AZ::EntityId entityId, const float localScale) { ETCS::SetEntityLocalScale(entityId, localScale, m_transformChangedInternally); } @@ -3737,11 +3803,11 @@ namespace AzToolsFramework entityId, &AZ::TransformBus::Events::SetWorldTM, worldTransform); } - void SetEntityLocalScale(AZ::EntityId entityId, const AZ::Vector3& localScale, bool& internal) + void SetEntityLocalScale(AZ::EntityId entityId, float localScale, bool& internal) { ScopeSwitch sw(internal); AZ::TransformBus::Event( - entityId, &AZ::TransformBus::Events::SetLocalScale, localScale); + entityId, &AZ::TransformBus::Events::SetLocalUniformScale, localScale); } void SetEntityLocalRotation(AZ::EntityId entityId, const AZ::Vector3& localRotation, bool& internal) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h index 7514f5153b..2bc4d7cbf6 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelection.h @@ -106,6 +106,22 @@ namespace AzToolsFramework World, //!< World space (space aligned to world axes - identity). }; + //! Grouping of viewport ui related state for controlling the current reference space of the Editor. + struct SpaceCluster + { + SpaceCluster() = default; + // disable copying and moving (implicit) + SpaceCluster(const SpaceCluster&) = delete; + SpaceCluster& operator=(const SpaceCluster&) = delete; + + ViewportUi::ClusterId m_spaceClusterId; //!< The id identifying the reference space cluster. + ViewportUi::ButtonId m_localButtonId; //!< Local reference space button id. + ViewportUi::ButtonId m_parentButtonId; //!< Parent reference space button id. + ViewportUi::ButtonId m_worldButtonId; //!< World reference space button id. + AZ::Event::Handler m_spaceSelectionHandler; //!< Callback for when a space cluster button is pressed. + AZStd::optional m_spaceLock; //!< Locked reference frame to use if set. + }; + //! Entity selection/interaction handling. //! Provide a suite of functionality for manipulating entities, primarily through their TransformComponent. class EditorTransformComponentSelection @@ -160,6 +176,7 @@ namespace AzToolsFramework void RegenerateManipulators(); void CreateTransformModeSelectionCluster(); + void CreateSpaceSelectionCluster(); void ClearManipulatorTranslationOverride(); void ClearManipulatorOrientationOverride(); @@ -214,8 +231,8 @@ namespace AzToolsFramework void CopyOrientationToSelectedEntitiesIndividual(const AZ::Quaternion& orientation); void CopyOrientationToSelectedEntitiesGroup(const AZ::Quaternion& orientation); void ResetOrientationForSelectedEntitiesLocal(); - void CopyScaleToSelectedEntitiesIndividualLocal(const AZ::Vector3& scale); - void CopyScaleToSelectedEntitiesIndividualWorld(const AZ::Vector3& scale); + void CopyScaleToSelectedEntitiesIndividualLocal(float scale); + void CopyScaleToSelectedEntitiesIndividualWorld(float scale); // EditorManipulatorCommandUndoRedoRequestBus ... void UndoRedoEntityManipulatorCommand( @@ -250,9 +267,12 @@ namespace AzToolsFramework void SetEntityWorldTranslation(AZ::EntityId entityId, const AZ::Vector3& worldTranslation); void SetEntityLocalTranslation(AZ::EntityId entityId, const AZ::Vector3& localTranslation); void SetEntityWorldTransform(AZ::EntityId entityId, const AZ::Transform& worldTransform); - void SetEntityLocalScale(AZ::EntityId entityId, const AZ::Vector3& localScale); + void SetEntityLocalScale(AZ::EntityId entityId, float localScale); void SetEntityLocalRotation(AZ::EntityId entityId, const AZ::Vector3& localRotation); + // Responsible for keeping the space cluster in sync with the current reference frame. + void UpdateSpaceCluster(ReferenceFrame referenceFrame); + AZ::EntityId m_hoveredEntityId; //!< What EntityId is the mouse currently hovering over (if any). AZ::EntityId m_cachedEntityIdUnderCursor; //!< Store the EntityId on each mouse move for use in Display. AZ::EntityId m_editorCameraComponentEntityId; //!< The EditorCameraComponent EntityId if it is set. @@ -285,6 +305,7 @@ namespace AzToolsFramework AZ::Event::Handler m_transformModeSelectionHandler; //!< Event handler for the Viewport UI cluster. AzFramework::ClickDetector m_clickDetector; //!< Detect different types of mouse click. AzFramework::CursorState m_cursorState; //!< Track the mouse position and delta movement each frame. + SpaceCluster m_spaceCluster; //!< Related viewport ui state for controlling the current reference space. }; //! The ETCS (EntityTransformComponentSelection) namespace contains functions and data used exclusively by @@ -320,7 +341,7 @@ namespace AzToolsFramework void SetEntityWorldTranslation(AZ::EntityId entityId, const AZ::Vector3& worldTranslation, bool& internal); void SetEntityLocalTranslation(AZ::EntityId entityId, const AZ::Vector3& localTranslation, bool& internal); void SetEntityWorldTransform(AZ::EntityId entityId, const AZ::Transform& worldTransform, bool& internal); - void SetEntityLocalScale(AZ::EntityId entityId, const AZ::Vector3& localScale, bool& internal); + void SetEntityLocalScale(AZ::EntityId entityId, float localScale, bool& internal); void SetEntityLocalRotation(AZ::EntityId entityId, const AZ::Vector3& localRotation, bool& internal); } // namespace ETCS } // namespace AzToolsFramework diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h index 59c250b8f7..9cd78f8c50 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorTransformComponentSelectionRequestBus.h @@ -101,10 +101,10 @@ namespace AzToolsFramework virtual void ResetOrientationForSelectedEntitiesLocal() = 0; /// Copy scale to each individual entity in local space without moving position. - virtual void CopyScaleToSelectedEntitiesIndividualLocal(const AZ::Vector3& scale) = 0; + virtual void CopyScaleToSelectedEntitiesIndividualLocal(float scale) = 0; /// Copy scale to to each individual entity in world (absolute) space. - virtual void CopyScaleToSelectedEntitiesIndividualWorld(const AZ::Vector3& scale) = 0; + virtual void CopyScaleToSelectedEntitiesIndividualWorld(float scale) = 0; protected: ~EditorTransformComponentSelectionRequests() = default; diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake index 45f52704bf..8d0180f6ce 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/aztoolsframework_files.cmake @@ -46,6 +46,7 @@ set(FILES API/EditorWindowRequestBus.h API/EntityCompositionRequestBus.h API/EntityCompositionNotificationBus.h + API/EditorViewportIconDisplayInterface.h API/ViewPaneOptions.h Application/Ticker.h Application/Ticker.cpp @@ -292,8 +293,6 @@ set(FILES ToolsComponents/TransformComponent.h ToolsComponents/TransformComponent.cpp ToolsComponents/TransformComponentBus.h - ToolsComponents/TransformScalePropertyHandler.cpp - ToolsComponents/TransformScalePropertyHandler.h ToolsComponents/ScriptEditorComponent.cpp ToolsComponents/ScriptEditorComponent.h ToolsComponents/ToolsAssetCatalogComponent.cpp diff --git a/Code/Framework/AzToolsFramework/Tests/AssetSeedManager.cpp b/Code/Framework/AzToolsFramework/Tests/AssetSeedManager.cpp index 5ccbd95f09..33009bc0da 100644 --- a/Code/Framework/AzToolsFramework/Tests/AssetSeedManager.cpp +++ b/Code/Framework/AzToolsFramework/Tests/AssetSeedManager.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,12 @@ namespace UnitTest m_assetSeedManager = new AzToolsFramework::AssetSeedManager(); m_assetRegistry = new AzFramework::AssetRegistry(); + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_application->Start(AzFramework::Application::Descriptor()); for (int idx = 0; idx < s_totalAssets; idx++) @@ -75,7 +82,7 @@ namespace UnitTest } m_testPlatforms[0] = AzFramework::PlatformId::PC; - m_testPlatforms[1] = AzFramework::PlatformId::ES3; + m_testPlatforms[1] = AzFramework::PlatformId::ANDROID_ID; int platformCount = 0; for(auto thisPlatform : m_testPlatforms) @@ -163,20 +170,20 @@ namespace UnitTest AzFramework::AssetCatalog assetCatalog(useRequestBus); AZStd::string pcCatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::PC); - AZStd::string es3CatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ES3); + AZStd::string androidCatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ANDROID_ID); if (!assetCatalog.SaveCatalog(pcCatalogFile.c_str(), m_assetRegistry)) { GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to save the asset catalog (PC) file.\n").c_str()); } - if (!assetCatalog.SaveCatalog(es3CatalogFile.c_str(), m_assetRegistry)) + if (!assetCatalog.SaveCatalog(androidCatalogFile.c_str(), m_assetRegistry)) { - GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to save the asset catalog (ES3) file.\n").c_str()); + GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to save the asset catalog (ANDROID) file.\n").c_str()); } m_pcCatalog = new AzToolsFramework::PlatformAddressedAssetCatalog(AzFramework::PlatformId::PC); - m_es3Catalog = new AzToolsFramework::PlatformAddressedAssetCatalog(AzFramework::PlatformId::ES3); + m_androidCatalog = new AzToolsFramework::PlatformAddressedAssetCatalog(AzFramework::PlatformId::ANDROID_ID); const AZStd::string engroot = AZ::Test::GetEngineRootPath(); AZ::IO::FileIOBase::GetInstance()->SetAlias("@engroot@", engroot.c_str()); @@ -220,21 +227,21 @@ namespace UnitTest } auto pcCatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::PC); - auto es3CatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ES3); + auto androidCatalogFile = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ANDROID_ID); if (fileIO->Exists(pcCatalogFile.c_str())) { fileIO->Remove(pcCatalogFile.c_str()); } - if (fileIO->Exists(es3CatalogFile.c_str())) + if (fileIO->Exists(androidCatalogFile.c_str())) { - fileIO->Remove(es3CatalogFile.c_str()); + fileIO->Remove(androidCatalogFile.c_str()); } delete m_assetSeedManager; delete m_assetRegistry; delete m_pcCatalog; - delete m_es3Catalog; + delete m_androidCatalog; m_application->Stop(); delete m_application; } @@ -335,10 +342,10 @@ namespace UnitTest m_assetSeedManager->AddSeedAsset(assets[2], AzFramework::PlatformFlags::Platform_PC); // Step we are testing - m_assetSeedManager->AddPlatformToAllSeeds(AzFramework::PlatformId::ES3); + m_assetSeedManager->AddPlatformToAllSeeds(AzFramework::PlatformId::ANDROID_ID); // Verification - AzFramework::PlatformFlags expectedPlatformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3; + AzFramework::PlatformFlags expectedPlatformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID; for (const auto& seedInfo : m_assetSeedManager->GetAssetSeedList()) { EXPECT_EQ(seedInfo.m_platformFlags, expectedPlatformFlags); @@ -351,14 +358,14 @@ namespace UnitTest m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC); m_assetSeedManager->AddSeedAsset(assets[1], AzFramework::PlatformFlags::Platform_PC); - m_es3Catalog->UnregisterAsset(assets[2]); + m_androidCatalog->UnregisterAsset(assets[2]); m_assetSeedManager->AddSeedAsset(assets[2], AzFramework::PlatformFlags::Platform_PC); // Step we are testing - m_assetSeedManager->AddPlatformToAllSeeds(AzFramework::PlatformId::ES3); + m_assetSeedManager->AddPlatformToAllSeeds(AzFramework::PlatformId::ANDROID_ID); // Verification - AzFramework::PlatformFlags expectedPlatformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3; + AzFramework::PlatformFlags expectedPlatformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID; for (const auto& seedInfo : m_assetSeedManager->GetAssetSeedList()) { if (seedInfo.m_assetId == assets[2]) @@ -376,14 +383,14 @@ namespace UnitTest { // Setup m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC); - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_ANDROID); m_assetSeedManager->AddSeedAsset(assets[1], AzFramework::PlatformFlags::Platform_PC); - m_assetSeedManager->AddSeedAsset(assets[1], AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->AddSeedAsset(assets[1], AzFramework::PlatformFlags::Platform_ANDROID); m_assetSeedManager->AddSeedAsset(assets[2], AzFramework::PlatformFlags::Platform_PC); - m_assetSeedManager->AddSeedAsset(assets[2], AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->AddSeedAsset(assets[2], AzFramework::PlatformFlags::Platform_ANDROID); // Step we are testing - m_assetSeedManager->RemovePlatformFromAllSeeds(AzFramework::PlatformId::ES3); + m_assetSeedManager->RemovePlatformFromAllSeeds(AzFramework::PlatformId::ANDROID_ID); // Verification for (const auto& seedInfo : m_assetSeedManager->GetAssetSeedList()) @@ -507,8 +514,8 @@ namespace UnitTest void DependencyValidation_MultipleAssetSeeds_MultiplePlatformFlags_ListValid() { - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3); - m_assetSeedManager->AddSeedAsset(assets[5], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID); + m_assetSeedManager->AddSeedAsset(assets[5], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID); AzToolsFramework::AssetFileInfoList assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::PC); @@ -524,7 +531,7 @@ namespace UnitTest assetList.m_fileInfoList.clear(); - m_assetSeedManager->AddSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->AddSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID); assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::PC); @@ -540,7 +547,7 @@ namespace UnitTest EXPECT_TRUE(Search(assetList, assets[8])); assetList.m_fileInfoList.clear(); - m_assetSeedManager->RemoveSeedAsset(assets[5], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->RemoveSeedAsset(assets[5], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID); assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::PC); @@ -555,7 +562,7 @@ namespace UnitTest EXPECT_TRUE(Search(assetList, assets[8])); // Removing the android flag from the asset should still produce the same result - m_assetSeedManager->RemoveSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_ES3); + m_assetSeedManager->RemoveSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_ANDROID); assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::PC); @@ -569,7 +576,7 @@ namespace UnitTest EXPECT_TRUE(Search(assetList, assets[7])); EXPECT_TRUE(Search(assetList, assets[8])); - assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::ES3); + assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::ANDROID_ID); EXPECT_EQ(assetList.m_fileInfoList.size(), 5); EXPECT_TRUE(Search(assetList, assets[0])); @@ -579,8 +586,8 @@ namespace UnitTest EXPECT_TRUE(Search(assetList, assets[4])); // Adding the android flag again to the asset - m_assetSeedManager->AddSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_ES3); - assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::ES3); + m_assetSeedManager->AddSeedAsset(assets[8], AzFramework::PlatformFlags::Platform_ANDROID); + assetList = m_assetSeedManager->GetDependencyList(AzFramework::PlatformId::ANDROID_ID); EXPECT_EQ(assetList.m_fileInfoList.size(), 8); EXPECT_TRUE(Search(assetList, assets[0])); @@ -766,7 +773,7 @@ namespace UnitTest AzFramework::AssetRegistry* m_assetRegistry; ToolsTestApplication* m_application; AzToolsFramework::PlatformAddressedAssetCatalog* m_pcCatalog; - AzToolsFramework::PlatformAddressedAssetCatalog* m_es3Catalog; + AzToolsFramework::PlatformAddressedAssetCatalog* m_androidCatalog; AZ::IO::FileIOStream m_fileStreams[s_totalTestPlatforms][s_totalAssets]; AzFramework::PlatformId m_testPlatforms[s_totalTestPlatforms]; AZStd::string m_assetsPath[s_totalAssets]; @@ -929,7 +936,7 @@ namespace UnitTest TEST_F(AssetSeedManagerTest, AddSeedAssetForValidPlatforms_AllPlatformsValid_SeedAddedForEveryInputPlatform) { using namespace AzFramework; - PlatformFlags validPlatforms = PlatformFlags::Platform_PC | PlatformFlags::Platform_ES3; + PlatformFlags validPlatforms = PlatformFlags::Platform_PC | PlatformFlags::Platform_ANDROID; AZStd::pair result = m_assetSeedManager->AddSeedAssetForValidPlatforms(TestDynamicSliceAssetPath, validPlatforms); // Verify the function outputs @@ -946,8 +953,8 @@ namespace UnitTest TEST_F(AssetSeedManagerTest, AddSeedAssetForValidPlatforms_SomePlatformsValid_SeedAddedForEveryValidPlatform) { using namespace AzFramework; - PlatformFlags validPlatforms = PlatformFlags::Platform_PC | PlatformFlags::Platform_ES3; - PlatformFlags inputPlatforms = validPlatforms | PlatformFlags::Platform_OSX; + PlatformFlags validPlatforms = PlatformFlags::Platform_PC | PlatformFlags::Platform_ANDROID; + PlatformFlags inputPlatforms = validPlatforms | PlatformFlags::Platform_MAC; AZStd::pair result = m_assetSeedManager->AddSeedAssetForValidPlatforms(TestDynamicSliceAssetPath, inputPlatforms); // Verify the function outputs @@ -964,7 +971,7 @@ namespace UnitTest TEST_F(AssetSeedManagerTest, AddSeedAssetForValidPlatforms_NoPlatformsValid_NoSeedAdded) { using namespace AzFramework; - PlatformFlags inputPlatforms = PlatformFlags::Platform_OSX; + PlatformFlags inputPlatforms = PlatformFlags::Platform_MAC; AZStd::pair result = m_assetSeedManager->AddSeedAssetForValidPlatforms(TestDynamicSliceAssetPath, inputPlatforms); // Verify the function outputs @@ -978,30 +985,30 @@ namespace UnitTest TEST_F(AssetSeedManagerTest, Valid_Seed_Remove_ForAllPlatform_OK) { - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); - m_assetSeedManager->RemoveSeedAsset(assets[0].ToString(), AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->RemoveSeedAsset(assets[0].ToString(), AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); const AzFramework::AssetSeedList& seedList = m_assetSeedManager->GetAssetSeedList(); EXPECT_EQ(seedList.size(), 0); - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); - m_assetSeedManager->RemoveSeedAsset("asset0.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->RemoveSeedAsset("asset0.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList(); EXPECT_EQ(secondSeedList.size(), 0); } TEST_F(AssetSeedManagerTest, Valid_Seed_Remove_ForSpecificPlatform_OK) { - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); - m_assetSeedManager->RemoveSeedAsset(assets[0].ToString(), AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->RemoveSeedAsset(assets[0].ToString(), AzFramework::PlatformFlags::Platform_MAC); const AzFramework::AssetSeedList& seedList = m_assetSeedManager->GetAssetSeedList(); EXPECT_EQ(seedList.size(), 1); - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); m_assetSeedManager->RemoveSeedAsset("asset0.txt", AzFramework::PlatformFlags::Platform_PC); const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList(); @@ -1010,14 +1017,14 @@ namespace UnitTest TEST_F(AssetSeedManagerTest, Invalid_NotRemove_SeedForAllPlatform_Ok) { - m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->AddSeedAsset(assets[0], AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); - m_assetSeedManager->RemoveSeedAsset(assets[1].ToString(), AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->RemoveSeedAsset(assets[1].ToString(), AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); const AzFramework::AssetSeedList& seedList = m_assetSeedManager->GetAssetSeedList(); EXPECT_EQ(seedList.size(), 1); - m_assetSeedManager->RemoveSeedAsset("asset1.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_OSX); + m_assetSeedManager->RemoveSeedAsset("asset1.txt", AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_MAC); const AzFramework::AssetSeedList& secondSeedList = m_assetSeedManager->GetAssetSeedList(); EXPECT_EQ(secondSeedList.size(), 1); } diff --git a/Code/Framework/AzToolsFramework/Tests/AssetSystemMocks.h b/Code/Framework/AzToolsFramework/Tests/AssetSystemMocks.h index 1e01229d73..8a394d3ab5 100644 --- a/Code/Framework/AzToolsFramework/Tests/AssetSystemMocks.h +++ b/Code/Framework/AzToolsFramework/Tests/AssetSystemMocks.h @@ -25,6 +25,8 @@ namespace UnitTests MOCK_METHOD0(GetAbsoluteDevGameFolderPath, const char* ()); MOCK_METHOD0(GetAbsoluteDevRootFolderPath, const char* ()); MOCK_METHOD2(GetRelativeProductPathFromFullSourceOrProductPath, bool(const AZStd::string& fullPath, AZStd::string& relativeProductPath)); + MOCK_METHOD3(GenerateRelativeSourcePath, + bool(const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& watchFolder)); MOCK_METHOD2(GetFullSourcePathFromRelativeProductPath, bool(const AZStd::string& relPath, AZStd::string& fullSourcePath)); MOCK_METHOD5(GetAssetInfoById, bool(const AZ::Data::AssetId& assetId, const AZ::Data::AssetType& assetType, const AZStd::string& platformName, AZ::Data::AssetInfo& assetInfo, AZStd::string& rootFilePath)); MOCK_METHOD3(GetSourceInfoBySourcePath, bool(const char* sourcePath, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder)); diff --git a/Code/Framework/AzToolsFramework/Tests/PlatformAddressedAssetCatalogTests.cpp b/Code/Framework/AzToolsFramework/Tests/PlatformAddressedAssetCatalogTests.cpp index 328bf5dea5..0b705338d9 100644 --- a/Code/Framework/AzToolsFramework/Tests/PlatformAddressedAssetCatalogTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/PlatformAddressedAssetCatalogTests.cpp @@ -10,6 +10,8 @@ * */ +#include +#include #include #include #include @@ -49,6 +51,14 @@ namespace UnitTest using namespace AZ::Data; m_application = new ToolsTestApplication("AddressedAssetCatalogManager"); // Shorter name because Setting Registry // specialization are 32 characters max. + + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_application->Start(AzFramework::Application::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash @@ -174,13 +184,13 @@ namespace UnitTest TEST_F(PlatformAddressedAssetCatalogManagerTest, PlatformAddressedAssetCatalogManager_CatalogExistsChecks_Success) { - EXPECT_EQ(AzToolsFramework::PlatformAddressedAssetCatalog::CatalogExists(AzFramework::PlatformId::ES3), true); - AZStd::string es3CatalogPath = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ES3); - if (AZ::IO::FileIOBase::GetInstance()->Exists(es3CatalogPath.c_str())) + EXPECT_EQ(AzToolsFramework::PlatformAddressedAssetCatalog::CatalogExists(AzFramework::PlatformId::ANDROID_ID), true); + AZStd::string androidCatalogPath = AzToolsFramework::PlatformAddressedAssetCatalog::GetCatalogRegistryPathForPlatform(AzFramework::PlatformId::ANDROID_ID); + if (AZ::IO::FileIOBase::GetInstance()->Exists(androidCatalogPath.c_str())) { - AZ::IO::FileIOBase::GetInstance()->Remove(es3CatalogPath.c_str()); + AZ::IO::FileIOBase::GetInstance()->Remove(androidCatalogPath.c_str()); } - EXPECT_EQ(AzToolsFramework::PlatformAddressedAssetCatalog::CatalogExists(AzFramework::PlatformId::ES3), false); + EXPECT_EQ(AzToolsFramework::PlatformAddressedAssetCatalog::CatalogExists(AzFramework::PlatformId::ANDROID_ID), false); } class PlatformAddressedAssetCatalogMessageTest : public AzToolsFramework::PlatformAddressedAssetCatalog @@ -241,7 +251,7 @@ namespace UnitTest AzFramework::AssetSystem::NetworkAssetUpdateInterface* notificationInterface = AZ::Interface::Get(); EXPECT_NE(notificationInterface, nullptr); - auto* mockCatalog = new ::testing::NiceMock(AzFramework::PlatformId::ES3); + auto* mockCatalog = new ::testing::NiceMock(AzFramework::PlatformId::ANDROID_ID); AZStd::unique_ptr< ::testing::NiceMock> catalogHolder; catalogHolder.reset(mockCatalog); @@ -249,7 +259,7 @@ namespace UnitTest EXPECT_CALL(*mockCatalog, AssetChanged(testing::_)).Times(0); notificationInterface->AssetChanged(testMessage); - testMessage.m_platform = "es3"; + testMessage.m_platform = "android"; EXPECT_CALL(*mockCatalog, AssetChanged(testing::_)).Times(1); notificationInterface->AssetChanged(testMessage); @@ -260,7 +270,7 @@ namespace UnitTest EXPECT_CALL(*mockCatalog, AssetRemoved(testing::_)).Times(0); notificationInterface->AssetRemoved(testMessage); - testMessage.m_platform = "es3"; + testMessage.m_platform = "android"; EXPECT_CALL(*mockCatalog, AssetRemoved(testing::_)).Times(1); notificationInterface->AssetRemoved(testMessage); } diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabDuplicateTests.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabDuplicateTests.cpp new file mode 100644 index 0000000000..514942166f --- /dev/null +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabDuplicateTests.cpp @@ -0,0 +1,129 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include +#include +#include + +namespace UnitTest +{ + using PrefabDuplicateTest = PrefabTestFixture; + + TEST_F(PrefabDuplicateTest, PrefabDuplicate_DuplicateSingleEntitySucceeds) + { + AZStd::string entityName("Same Name"); + AZ::Entity* entity1 = CreateEntity(entityName.c_str()); + entity1->Deactivate(); + entity1->CreateComponent(); + entity1->Activate(); + + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, AzToolsFramework::EntityList{ entity1 }); + AZStd::unique_ptr newInstance = m_prefabSystemComponent->CreatePrefab( + { entity1 }, + {}, + PrefabMockFilePath); + + // We've created a prefab with a single Entity, so there should only be one EntityAlias in our instance + EXPECT_EQ(newInstance->GetEntityAliases().size(), 1); + + // Duplicate the Entity and trigger the UpdateTemplateInstancesInQueue so the changes get propagated + m_prefabPublicInterface->DuplicateEntitiesInInstance(AzToolsFramework::EntityIdList{ entity1->GetId() }); + m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); + + // We duplicated a single Entity, so there should now be two EntityAliases + EXPECT_EQ(newInstance->GetEntityAliases().size(), 2); + + newInstance->GetConstEntities([&](const AZ::Entity& entity) + { + // Both of the entities should have the same name + EXPECT_EQ(entity.GetName(), entityName); + + // Both of the entities should have the PrefabTestComponent we added + auto testComponent = entity.FindComponent(); + EXPECT_NE(nullptr, testComponent); + + return true; + }); + } + + TEST_F(PrefabDuplicateTest, PrefabDuplicate_DuplicateMultipleEntitiesAndFixesReferences) + { + AZ::Entity* parentEntity = CreateEntity("Parent Entity"); + + AZ::Entity* childEntity = CreateEntity("Child Entity"); + childEntity->Deactivate(); + auto newComponent = childEntity->CreateComponent(); + childEntity->Activate(); + + // Set the EntityId reference property on our PrefabTestComponent so we can + // verify that arbitrary EntityId's are fixed up properly + newComponent->m_entityIdProperty = parentEntity->GetId(); + + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequests::HandleEntitiesAdded, AzToolsFramework::EntityList{ parentEntity, childEntity }); + + AZStd::unique_ptr newInstance = m_prefabSystemComponent->CreatePrefab( + { parentEntity, childEntity }, + {}, + PrefabMockFilePath); + + // We've created a prefab with two entities, so there should be two EntityAliases in our instance + EXPECT_EQ(newInstance->GetEntityAliases().size(), 2); + + // Duplicate the entities and trigger the UpdateTemplateInstancesInQueue so the changes get propagated + m_prefabPublicInterface->DuplicateEntitiesInInstance(AzToolsFramework::EntityIdList{ parentEntity->GetId(), childEntity->GetId() }); + m_instanceUpdateExecutorInterface->UpdateTemplateInstancesInQueue(); + + // We duplicated two entities, so there should now be four EntityAliases + EXPECT_EQ(newInstance->GetEntityAliases().size(), 4); + + AzToolsFramework::EntityIdList parentEntityIds; + newInstance->GetConstEntities([&](const AZ::Entity& entity) + { + // Gather the parent EntityIds by tracking which entities don't have a PrefabTestComponent + auto testComponent = entity.FindComponent(); + if (!testComponent) + { + parentEntityIds.push_back(entity.GetId()); + } + + return true; + }); + + // There should only be two parents + EXPECT_EQ(parentEntityIds.size(), 2); + + // Verify that the EntityId reference on the PrefabTestComponent on the children correspond + // to unique entities, which will verify that the EntityIds are fixed up on duplicate + newInstance->GetConstEntities([&](const AZ::Entity& entity) + { + // Only the child entities have a PrefabTestComponent + auto testComponent = entity.FindComponent(); + if (testComponent) + { + auto it = AZStd::find(parentEntityIds.begin(), parentEntityIds.end(), testComponent->m_entityIdProperty); + EXPECT_NE(it, parentEntityIds.end()); + + // Erase when we find it so that the matches will be unique + parentEntityIds.erase(it); + } + + return true; + }); + + // Verify we matched each of the parent EntityIds + EXPECT_EQ(parentEntityIds.size(), 0); + } +} diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.cpp b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.cpp index 3a8d9cc7eb..ace2356732 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.cpp @@ -20,6 +20,17 @@ namespace UnitTest { + PrefabTestToolsApplication::PrefabTestToolsApplication(AZStd::string appName) + : ToolsTestApplication(AZStd::move(appName)) + { + } + + bool PrefabTestToolsApplication::IsPrefabSystemEnabled() const + { + // Make sure our prefab tests always run with prefabs enabled + return true; + } + void PrefabTestFixture::SetUpEditorFixtureImpl() { // Acquire the system entity @@ -32,6 +43,9 @@ namespace UnitTest m_prefabLoaderInterface = AZ::Interface::Get(); EXPECT_TRUE(m_prefabLoaderInterface); + m_prefabPublicInterface = AZ::Interface::Get(); + EXPECT_TRUE(m_prefabPublicInterface); + m_instanceUpdateExecutorInterface = AZ::Interface::Get(); EXPECT_TRUE(m_instanceUpdateExecutorInterface); @@ -41,6 +55,11 @@ namespace UnitTest GetApplication()->RegisterComponentDescriptor(PrefabTestComponent::CreateDescriptor()); } + AZStd::unique_ptr PrefabTestFixture::CreateTestApplication() + { + return AZStd::make_unique("PrefabTestApplication"); + } + AZ::Entity* PrefabTestFixture::CreateEntity(const char* entityName, const bool shouldActivate) { // Circumvent the EntityContext system and generate a new entity with a transformcomponent diff --git a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.h b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.h index af90309867..ee471cf192 100644 --- a/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.h +++ b/Code/Framework/AzToolsFramework/Tests/Prefab/PrefabTestFixture.h @@ -31,6 +31,16 @@ namespace UnitTest using namespace AzToolsFramework::Prefab; using namespace PrefabTestUtils; + class PrefabTestToolsApplication + : public ToolsTestApplication + { + public: + PrefabTestToolsApplication(AZStd::string appName); + + // Make sure our prefab tests always run with prefabs enabled + bool IsPrefabSystemEnabled() const override; + }; + class PrefabTestFixture : public ToolsApplicationFixture, public UnitTest::TraceBusRedirector @@ -45,6 +55,8 @@ namespace UnitTest void SetUpEditorFixtureImpl() override; + AZStd::unique_ptr CreateTestApplication() override; + AZ::Entity* CreateEntity(const char* entityName, const bool shouldActivate = true); void CompareInstances(const Instance& instanceA, const Instance& instanceB, bool shouldCompareLinkIds = true, @@ -57,6 +69,7 @@ namespace UnitTest PrefabSystemComponent* m_prefabSystemComponent = nullptr; PrefabLoaderInterface* m_prefabLoaderInterface = nullptr; + PrefabPublicInterface* m_prefabPublicInterface = nullptr; InstanceUpdateExecutorInterface* m_instanceUpdateExecutorInterface = nullptr; InstanceToTemplateInterface* m_instanceToTemplateInterface = nullptr; }; diff --git a/Code/Framework/AzToolsFramework/Tests/Slice.cpp b/Code/Framework/AzToolsFramework/Tests/Slice.cpp index 33160b9c20..7b67481684 100644 --- a/Code/Framework/AzToolsFramework/Tests/Slice.cpp +++ b/Code/Framework/AzToolsFramework/Tests/Slice.cpp @@ -483,6 +483,9 @@ namespace UnitTest { AUTO_RESULT_IF_SETTING_TRUE(UnitTest::prefabSystemSetting, true) + // Swallow deprecation warnings from the Transform component as they are not relevant to this test + UnitTest::ErrorHandler errorHandler("GetScale is deprecated"); + // Create a parent entity with a transform component AZ::Entity* parentEntity = aznew AZ::Entity("TestParentEntity"); parentEntity->CreateComponent(); diff --git a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp index 8455e6d669..5dcdaa045c 100644 --- a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp +++ b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.cpp @@ -141,7 +141,7 @@ namespace UnitTest // Set the new entity's transform to non zero values // This helps validate in comparison tests that the transform values of created entities persist during slice operations - entityTransform->SetLocalScale(AZ::Vector3(5, 5, 5)); + entityTransform->SetLocalUniformScale(5); entityTransform->SetLocalRotation(AZ::Vector3RadToDeg(AZ::Vector3(90, 90, 90))); entityTransform->SetLocalTranslation(AZ::Vector3(100, 100, 100)); diff --git a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.h b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.h index 57ac16673d..7d3d312cdb 100644 --- a/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.h +++ b/Code/Framework/AzToolsFramework/Tests/SliceStabilityTests/SliceStabilityTestFramework.h @@ -149,6 +149,9 @@ namespace UnitTest const char* GetAbsoluteDevGameFolderPath() override { return ""; } const char* GetAbsoluteDevRootFolderPath() override { return ""; } bool GetRelativeProductPathFromFullSourceOrProductPath([[maybe_unused]] const AZStd::string& fullPath, [[maybe_unused]] AZStd::string& relativeProductPath) override { return false; } + bool GenerateRelativeSourcePath( + [[maybe_unused]] const AZStd::string& sourcePath, [[maybe_unused]] AZStd::string& relativePath, + [[maybe_unused]] AZStd::string& watchFolder) override { return false; } bool GetFullSourcePathFromRelativeProductPath([[maybe_unused]] const AZStd::string& relPath, [[maybe_unused]] AZStd::string& fullSourcePath) override { return false; } bool GetAssetInfoById([[maybe_unused]] const AZ::Data::AssetId& assetId, [[maybe_unused]] const AZ::Data::AssetType& assetType, [[maybe_unused]] const AZStd::string& platformName, [[maybe_unused]] AZ::Data::AssetInfo& assetInfo, [[maybe_unused]] AZStd::string& rootFilePath) override { return false; } bool GetSourceInfoBySourcePath(const char* sourcePath, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder) override; diff --git a/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorLayerComponentTests.cpp b/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorLayerComponentTests.cpp index 7b03b63dd0..2177b9e1b2 100644 --- a/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorLayerComponentTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorLayerComponentTests.cpp @@ -610,15 +610,15 @@ namespace AzToolsFramework m_layerEntity.m_layer->ClearUnsavedChanges(); // Change the scale of the child entity so it registers as an unsaved change on the layer. - AZ::Vector3 scale(-1.0f,0.0f,0.0f); + float scale = 0.0f; AZ::TransformBus::EventResult( scale, childEntity->GetId(), - &AZ::TransformBus::Events::GetLocalScale); - scale.SetX(scale.GetX() + 1.0f); + &AZ::TransformBus::Events::GetLocalUniformScale); + scale += 1.0f; AZ::TransformBus::Event( childEntity->GetId(), - &AZ::TransformBus::Events::SetLocalScale, + &AZ::TransformBus::Events::SetLocalUniformScale, scale); bool hasUnsavedChanges = false; diff --git a/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorTransformComponentTests.cpp b/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorTransformComponentTests.cpp index 62cf16f9a7..fcc4aa49e5 100644 --- a/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorTransformComponentTests.cpp +++ b/Code/Framework/AzToolsFramework/Tests/ToolsComponents/EditorTransformComponentTests.cpp @@ -52,19 +52,19 @@ namespace AzToolsFramework TransformTestEntityHierarchy hierarchy = BuildTestHierarchy(); // Set scale to parent entity - const AZ::Vector3 parentScale(2.0f, 1.0f, 3.0f); - AZ::TransformBus::Event(hierarchy.m_parentId, &AZ::TransformInterface::SetLocalScale, parentScale); + const float parentScale = 2.0f; + AZ::TransformBus::Event(hierarchy.m_parentId, &AZ::TransformInterface::SetLocalUniformScale, parentScale); // Set scale to child entity - const AZ::Vector3 childScale(5.0f, 6.0f, 10.0f); - AZ::TransformBus::Event(hierarchy.m_childId, &AZ::TransformInterface::SetLocalScale, childScale); + const float childScale = 5.0f; + AZ::TransformBus::Event(hierarchy.m_childId, &AZ::TransformInterface::SetLocalUniformScale, childScale); - const AZ::Vector3 expectedScale = childScale * parentScale; + const float expectedScale = childScale * parentScale; - AZ::Vector3 childWorldScale = AZ::Vector3::CreateOne(); - AZ::TransformBus::EventResult(childWorldScale, hierarchy.m_childId, &AZ::TransformBus::Events::GetWorldScale); + float childWorldScale = 1.0f; + AZ::TransformBus::EventResult(childWorldScale, hierarchy.m_childId, &AZ::TransformBus::Events::GetWorldUniformScale); - EXPECT_THAT(childWorldScale, UnitTest::IsClose(expectedScale)); + EXPECT_NEAR(childWorldScale, expectedScale, AZ::Constants::Tolerance); } TEST_F(EditorTransformComponentTest, TransformTests_GetChildren_DirectChildrenMatchHierarchy) diff --git a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake index e54aa187e4..cd3796a64e 100644 --- a/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake +++ b/Code/Framework/AzToolsFramework/Tests/aztoolsframeworktests_files.cmake @@ -54,6 +54,7 @@ set(FILES Prefab/Spawnable/SpawnableMetaDataTests.cpp Prefab/MockPrefabFileIOActionValidator.cpp Prefab/MockPrefabFileIOActionValidator.h + Prefab/PrefabDuplicateTests.cpp Prefab/PrefabEntityAliasTests.cpp Prefab/PrefabInstanceToTemplatePropagatorTests.cpp Prefab/PrefabInstantiateTests.cpp diff --git a/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.cpp b/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.cpp index 99f38f3171..f5fb0cb721 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.cpp @@ -296,7 +296,7 @@ DefaultTrafficControl::OnReceived(TrafficControlConnectionId id, DataGramControl if (m_maxRecvPackets != 0) { --cd->m_recvPacketAllowance; - if (cd->m_recvPacketAllowance == 0) // hit the limit -> let's blacklist connection + if (cd->m_recvPacketAllowance == 0) // hit the limit { cd->m_canReceiveData = false; } diff --git a/Code/Framework/GridMate/GridMate/Serialize/CompressionMarshal.cpp b/Code/Framework/GridMate/GridMate/Serialize/CompressionMarshal.cpp index 751e151ec6..1714ee5aa5 100644 --- a/Code/Framework/GridMate/GridMate/Serialize/CompressionMarshal.cpp +++ b/Code/Framework/GridMate/GridMate/Serialize/CompressionMarshal.cpp @@ -488,18 +488,17 @@ void TransformCompressor::Marshal(WriteBuffer& wb, const AZ::Transform& value) c { AZ::u8 flags = 0; auto flagsMarker = wb.InsertMarker(flags); - AZ::Matrix3x3 m33 = AZ::Matrix3x3::CreateFromTransform(value); - AZ::Vector3 scale = m33.ExtractScale(); - AZ::Quaternion rot = AZ::Quaternion::CreateFromMatrix3x3(m33.GetOrthogonalized()); + float scale = value.GetUniformScale(); + AZ::Quaternion rot = value.GetRotation(); if (!rot.IsIdentity()) { flags |= HAS_ROT; wb.Write(rot, QuatCompMarshaler()); } - if (!scale.IsClose(AZ::Vector3::CreateOne())) + if (!AZ::IsClose(scale, 1.0f, AZ::Constants::Tolerance)) { flags |= HAS_SCALE; - wb.Write(scale, Vec3CompMarshaler()); + wb.Write(scale, HalfMarshaler()); } AZ::Vector3 pos = value.GetTranslation(); if (!pos.IsZero()) @@ -527,9 +526,9 @@ void TransformCompressor::Unmarshal(AZ::Transform& value, ReadBuffer& rb) const } if (flags & HAS_SCALE) { - AZ::Vector3 scale; - rb.Read(scale, Vec3CompMarshaler()); - xform.MultiplyByScale(scale); + float scale; + rb.Read(scale, HalfMarshaler()); + xform.MultiplyByUniformScale(scale); } if (flags & HAS_POS) { diff --git a/Code/Framework/Tests/ArchiveCompressionTests.cpp b/Code/Framework/Tests/ArchiveCompressionTests.cpp index fb6beca0b5..c648262599 100644 --- a/Code/Framework/Tests/ArchiveCompressionTests.cpp +++ b/Code/Framework/Tests/ArchiveCompressionTests.cpp @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -40,6 +41,13 @@ namespace UnitTest void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_application->Start({}); // 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 diff --git a/Code/Framework/Tests/ArchiveTests.cpp b/Code/Framework/Tests/ArchiveTests.cpp index aaca043c4b..6dc081ee72 100644 --- a/Code/Framework/Tests/ArchiveTests.cpp +++ b/Code/Framework/Tests/ArchiveTests.cpp @@ -16,6 +16,7 @@ #include #include // for max path decl +#include #include #include #include // for function<> in the find files callback. @@ -42,6 +43,14 @@ namespace UnitTest { AZ::ComponentApplication::Descriptor descriptor; descriptor.m_stackRecordLevels = 30; + + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_application->Start(descriptor); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash diff --git a/Code/Framework/Tests/AssetCatalog.cpp b/Code/Framework/Tests/AssetCatalog.cpp index 8a89ba349c..1575b0a469 100644 --- a/Code/Framework/Tests/AssetCatalog.cpp +++ b/Code/Framework/Tests/AssetCatalog.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -304,6 +305,13 @@ namespace UnitTest m_app.reset(aznew AzFramework::Application()); AZ::ComponentApplication::Descriptor desc; desc.m_useExistingAllocator = true; + + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app->Start(desc); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Code/Framework/Tests/CameraInputTests.cpp b/Code/Framework/Tests/CameraInputTests.cpp new file mode 100644 index 0000000000..3fc826975e --- /dev/null +++ b/Code/Framework/Tests/CameraInputTests.cpp @@ -0,0 +1,87 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class CameraInputFixture : public AllocatorsTestFixture + { + public: + AzFramework::Camera m_camera; + AzFramework::Camera m_targetCamera; + AZStd::shared_ptr m_cameraSystem; + + bool HandleEventAndUpdate(const AzFramework::InputEvent& event) + { + constexpr float deltaTime = 0.01666f; // 60fps + const bool consumed = m_cameraSystem->HandleEvents(event); + m_camera = m_cameraSystem->StepCamera(m_targetCamera, deltaTime); + return consumed; + } + + void SetUp() override + { + AllocatorsTestFixture::SetUp(); + + AzFramework::ReloadCameraKeyBindings(); + + m_cameraSystem = AZStd::make_shared(); + + auto firstPersonRotateCamera = AZStd::make_shared(AzFramework::InputDeviceMouse::Button::Right); + auto firstPersonTranslateCamera = AZStd::make_shared(AzFramework::LookTranslation); + + auto orbitCamera = AZStd::make_shared(); + auto orbitRotateCamera = AZStd::make_shared(AzFramework::InputDeviceMouse::Button::Left); + auto orbitTranslateCamera = AZStd::make_shared(AzFramework::OrbitTranslation); + + orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera); + orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera); + + m_cameraSystem->m_cameras.AddCamera(firstPersonRotateCamera); + m_cameraSystem->m_cameras.AddCamera(firstPersonTranslateCamera); + m_cameraSystem->m_cameras.AddCamera(orbitCamera); + } + + void TearDown() override + { + m_cameraSystem->m_cameras.Clear(); + m_cameraSystem.reset(); + + AllocatorsTestFixture::TearDown(); + } + }; + + TEST_F(CameraInputFixture, BeginEndOrbitCameraConsumesCorrectEvents) + { + // begin orbit camera + const bool consumed1 = HandleEventAndUpdate( + AzFramework::DiscreteInputEvent{AzFramework::InputDeviceKeyboard::Key::ModifierAltL, AzFramework::InputChannel::State::Began}); + // begin listening for orbit rotate (click detector) - event is not consumed + const bool consumed2 = HandleEventAndUpdate( + AzFramework::DiscreteInputEvent{AzFramework::InputDeviceMouse::Button::Left, AzFramework::InputChannel::State::Began}); + // begin orbit rotate (mouse has moved sufficient distance to initiate) + const bool consumed3 = HandleEventAndUpdate(AzFramework::HorizontalMotionEvent{5}); + // end orbit (mouse up) - event is not consumed + const bool consumed4 = HandleEventAndUpdate( + AzFramework::DiscreteInputEvent{AzFramework::InputDeviceMouse::Button::Left, AzFramework::InputChannel::State::Ended}); + + const auto allConsumed = AZStd::vector{consumed1, consumed2, consumed3, consumed4}; + + using ::testing::ElementsAre; + EXPECT_THAT(allConsumed, ElementsAre(true, false, true, false)); + } +} // namespace UnitTest diff --git a/Code/Framework/Tests/ClickDetectorTests.cpp b/Code/Framework/Tests/ClickDetectorTests.cpp index 7e6f9634c8..64f06ee66c 100644 --- a/Code/Framework/Tests/ClickDetectorTests.cpp +++ b/Code/Framework/Tests/ClickDetectorTests.cpp @@ -139,4 +139,21 @@ namespace UnitTest EXPECT_THAT(secondaryDownOutcome, Eq(ClickDetector::ClickOutcome::Nil)); // ignored double click EXPECT_THAT(secondaryUpOutcome, Eq(ClickDetector::ClickOutcome::Nil)); // click not registered } + + // if the click detector registers a mouse down event, but then all intermediate calls are ignored + // (another system may start intercepting events and swallowing them) then when we do receive a mouse + // up event we should ensure we take into account the current delta - if the delta is large, then the + // outcome will be release + TEST_F(ClickDetectorFixture, ClickIsNotRegisteredAfterIgnoringMouseMovesBeforeMouseUpWithLargeDelta) + { + using ::testing::Eq; + + const ClickDetector::ClickOutcome downOutcome = + m_clickDetector.DetectClick(ClickDetector::ClickEvent::Down, ScreenVector(0, 0)); + const ClickDetector::ClickOutcome upOutcome = + m_clickDetector.DetectClick(ClickDetector::ClickEvent::Up, ScreenVector(50, 50)); + + EXPECT_THAT(downOutcome, Eq(ClickDetector::ClickOutcome::Nil)); + EXPECT_THAT(upOutcome, Eq(ClickDetector::ClickOutcome::Release)); + } } // namespace UnitTest diff --git a/Code/Framework/Tests/ComponentAddRemove.cpp b/Code/Framework/Tests/ComponentAddRemove.cpp index 4fd6db7dde..f635a5ee3b 100644 --- a/Code/Framework/Tests/ComponentAddRemove.cpp +++ b/Code/Framework/Tests/ComponentAddRemove.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -572,6 +573,12 @@ namespace UnitTest { AllocatorsTestFixture::SetUp(); + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + AzFramework::Application::Descriptor descriptor; descriptor.m_enableDrilling = false; m_app.Start(descriptor); diff --git a/Code/Framework/Tests/FileFunc.cpp b/Code/Framework/Tests/FileFunc.cpp index d703164582..8db77fd79b 100644 --- a/Code/Framework/Tests/FileFunc.cpp +++ b/Code/Framework/Tests/FileFunc.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -278,6 +279,12 @@ namespace UnitTest { FrameworkApplicationFixture::SetUp(); + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_serializeContext = AZStd::make_unique(); m_jsonRegistrationContext = AZStd::make_unique(); m_jsonSystemComponent = AZStd::make_unique(); diff --git a/Code/Framework/Tests/FileTagTests.cpp b/Code/Framework/Tests/FileTagTests.cpp index 989c811111..b94131afee 100644 --- a/Code/Framework/Tests/FileTagTests.cpp +++ b/Code/Framework/Tests/FileTagTests.cpp @@ -83,6 +83,7 @@ namespace UnitTest void SetUp() override { AllocatorsFixture::SetUp(); + m_data = AZStd::make_unique(); using namespace AzFramework::FileTag; AZ::ComponentApplication::Descriptor desc; diff --git a/Code/Framework/Tests/FrameworkApplicationFixture.h b/Code/Framework/Tests/FrameworkApplicationFixture.h index f3a90864e7..c2fea389e0 100644 --- a/Code/Framework/Tests/FrameworkApplicationFixture.h +++ b/Code/Framework/Tests/FrameworkApplicationFixture.h @@ -54,7 +54,7 @@ namespace UnitTest }; void SetUp() override - { + { m_appDescriptor.m_allocationRecords = true; m_appDescriptor.m_allocationRecordsSaveNames = true; m_appDescriptor.m_recordingMode = AZ::Debug::AllocationRecords::Mode::RECORD_FULL; diff --git a/Code/Framework/Tests/GenericComponentWrapperTest.cpp b/Code/Framework/Tests/GenericComponentWrapperTest.cpp index b3dac90777..25af10b339 100644 --- a/Code/Framework/Tests/GenericComponentWrapperTest.cpp +++ b/Code/Framework/Tests/GenericComponentWrapperTest.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,12 @@ class WrappedEditorComponentTest protected: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AZ::ComponentApplication::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is @@ -178,6 +185,12 @@ class FindWrappedComponentsTest public: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AzFramework::Application::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Code/Framework/Tests/OctreeTests.cpp b/Code/Framework/Tests/OctreeTests.cpp index 29c7ef3ff3..27c4fdf0eb 100644 --- a/Code/Framework/Tests/OctreeTests.cpp +++ b/Code/Framework/Tests/OctreeTests.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -94,6 +95,20 @@ namespace UnitTest AZ::Console* m_console; }; + void ValidateEntryCountEqualsExpectedCount(const IVisibilityScene* visScene, uint32_t expectedEntryCount) + { + // InsertOrUpdateEntry assumes that updating an existing entry won't change the count + // so it doesn't modify the counter used by GetEntryCount. + // If an entry is removed from the octree as an unintended side effect of updating an existing entry, + // GetEntryCount can't be relied upon to report the actual entry count. + // So manually count the entries when using the entry count for validation. + uint32_t manualEntryCount = 0; + visScene->EnumerateNoCull([&manualEntryCount](const AzFramework::IVisibilityScene::NodeData& nodeData) { manualEntryCount += nodeData.m_entries.size(); }); + + EXPECT_EQ(manualEntryCount, expectedEntryCount); + EXPECT_EQ(visScene->GetEntryCount(), expectedEntryCount); + } + TEST_F(OctreeTests, InsertDeleteSingleEntry) { AzFramework::VisibilityEntry visEntry; @@ -102,11 +117,11 @@ namespace UnitTest m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); m_octreeScene->RemoveEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0); EXPECT_TRUE(true); //TEST } @@ -121,34 +136,34 @@ namespace UnitTest m_octreeScene->InsertOrUpdateEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode != nullptr); EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node EXPECT_TRUE(visEntry[1].m_internalNode != nullptr); EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node EXPECT_TRUE(visEntry[2].m_internalNode != nullptr); EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); m_octreeScene->RemoveEntry(visEntry[2]); EXPECT_TRUE(visEntry[2].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); m_octreeScene->RemoveEntry(visEntry[1]); EXPECT_TRUE(visEntry[1].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); m_octreeScene->RemoveEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0); } TEST_F(OctreeTests, UpdateSingleEntry) @@ -159,19 +174,19 @@ namespace UnitTest m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); visEntry.m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.5f), AZ::Vector3(0.5f)); m_octreeScene->InsertOrUpdateEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode != nullptr); EXPECT_TRUE(visEntry.m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); m_octreeScene->RemoveEntry(visEntry); EXPECT_TRUE(visEntry.m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); } @@ -185,19 +200,19 @@ namespace UnitTest m_octreeScene->InsertOrUpdateEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode != nullptr); EXPECT_TRUE(visEntry[0].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); m_octreeScene->InsertOrUpdateEntry(visEntry[1]); // This should force a split of the root node EXPECT_TRUE(visEntry[1].m_internalNode != nullptr); EXPECT_TRUE(visEntry[1].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); m_octreeScene->InsertOrUpdateEntry(visEntry[2]); // This should force a split of the roots +/+/+ child node EXPECT_TRUE(visEntry[2].m_internalNode != nullptr); EXPECT_TRUE(visEntry[2].m_internalNodeIndex == 0); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); visEntry[1].m_boundingVolume = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-0.9f), AZ::Vector3(-0.6f)); @@ -206,22 +221,22 @@ namespace UnitTest m_octreeScene->InsertOrUpdateEntry(visEntry[0]); m_octreeScene->InsertOrUpdateEntry(visEntry[1]); m_octreeScene->InsertOrUpdateEntry(visEntry[2]); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 3); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 3); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + (2 * m_octreeScene->GetChildNodeCount())); m_octreeScene->RemoveEntry(visEntry[2]); EXPECT_TRUE(visEntry[2].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 2); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 2); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1 + m_octreeScene->GetChildNodeCount()); m_octreeScene->RemoveEntry(visEntry[1]); EXPECT_TRUE(visEntry[1].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 1); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 1); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); m_octreeScene->RemoveEntry(visEntry[0]); EXPECT_TRUE(visEntry[0].m_internalNode == nullptr); - EXPECT_TRUE(m_octreeScene->GetEntryCount() == 0); + ValidateEntryCountEqualsExpectedCount(m_octreeScene, 0); EXPECT_TRUE(m_octreeScene->GetNodeCount() == 1); } @@ -365,4 +380,48 @@ namespace UnitTest AZ::Frustum bound3 = AZ::Frustum(AZ::ViewFrustumAttributes(frustumTransform, 1.0f, 2.0f * atanf(0.5f), 2.6f, 2.9f)); EnumerateMultipleEntriesHelper(m_octreeScene, bound1, bound2, bound3); } + + TEST_F(OctreeTests, InsertOrUpdateEntry_OverFillRootNodeWithLargeEntries_EntriesAreNotLost) + { + // Validate that the octree works if you exceed the max entry count with large entries, + // which will overfill the root node since they can't be distributed to child nodes + + // Get the max extents and entries-per-node for the octree + AZ::IConsole* console = AZ::Interface::Get(); + EXPECT_TRUE(console); + + float maxExtents = 0.0f; + AZ::GetValueResult getCvarResult = console->GetCvarValue("bg_octreeMaxWorldExtents", maxExtents); + EXPECT_EQ(getCvarResult, AZ::GetValueResult::Success); + + uint32_t maxEntriesPerNode = 0; + getCvarResult = console->GetCvarValue("bg_octreeNodeMaxEntries", maxEntriesPerNode); + EXPECT_EQ(getCvarResult, AZ::GetValueResult::Success); + + // Create root entries that would exceed the size of the root node + AZ::Aabb exceedMaxExtents = AZ::Aabb::CreateFromMinMax(AZ::Vector3(-maxExtents - 1.0f), AZ::Vector3(maxExtents + 1.0f)); + uint32_t exceedMaxEntriesPerNode = maxEntriesPerNode + 1; + + AzFramework::VisibilityEntry visEntry; + visEntry.m_boundingVolume = exceedMaxExtents; + AZStd::vector visEntries(exceedMaxEntriesPerNode, visEntry); + + // Insert them all into the scene + for (AzFramework::VisibilityEntry& entry : visEntries) + { + m_octreeScene->InsertOrUpdateEntry(entry); + } + + // Expect all the entries to be in the scene + ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size()); + + // Update them, without making any actual changes + for (AzFramework::VisibilityEntry& entry : visEntries) + { + m_octreeScene->InsertOrUpdateEntry(entry); + } + + // Expect all the entries to be in the scene + ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size()); + } } diff --git a/Code/Framework/Tests/PlatformHelper.cpp b/Code/Framework/Tests/PlatformHelper.cpp index 1ad7794c58..9a23fb8d25 100644 --- a/Code/Framework/Tests/PlatformHelper.cpp +++ b/Code/Framework/Tests/PlatformHelper.cpp @@ -30,11 +30,11 @@ TEST_F(PlatformHelperTest, SinglePlatformFlags_PlatformId_Valid) TEST_F(PlatformHelperTest, MultiplePlatformFlags_PlatformId_Valid) { - AzFramework::PlatformFlags platformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ES3; + AzFramework::PlatformFlags platformFlags = AzFramework::PlatformFlags::Platform_PC | AzFramework::PlatformFlags::Platform_ANDROID; auto platforms = AzFramework::PlatformHelper::GetPlatforms(platformFlags); EXPECT_EQ(platforms.size(), 2); EXPECT_EQ(platforms[0], "pc"); - EXPECT_EQ(platforms[1], "es3"); + EXPECT_EQ(platforms[1], "android"); } TEST_F(PlatformHelperTest, SpecialAllFlag_PlatformId_Valid) @@ -42,7 +42,7 @@ TEST_F(PlatformHelperTest, SpecialAllFlag_PlatformId_Valid) AzFramework::PlatformFlags platformFlags = AzFramework::PlatformFlags::Platform_ALL; auto platforms = AzFramework::PlatformHelper::GetPlatformsInterpreted(platformFlags); EXPECT_EQ(platforms.size(), AzFramework::NumPlatforms); - EXPECT_THAT(platforms, testing::UnorderedElementsAre("pc", "es3", "ios", "osx_gl", "provo", "salem", "jasper", "server")); + EXPECT_THAT(platforms, testing::UnorderedElementsAre("pc", "android", "ios", "mac", "provo", "salem", "jasper", "server")); } TEST_F(PlatformHelperTest, SpecialAllClientFlag_PlatformId_Valid) @@ -50,7 +50,7 @@ TEST_F(PlatformHelperTest, SpecialAllClientFlag_PlatformId_Valid) AzFramework::PlatformFlags platformFlags = AzFramework::PlatformFlags::Platform_ALL_CLIENT; auto platforms = AzFramework::PlatformHelper::GetPlatformsInterpreted(platformFlags); EXPECT_EQ(platforms.size(), AzFramework::NumClientPlatforms); - EXPECT_THAT(platforms, testing::UnorderedElementsAre("pc", "es3", "ios", "osx_gl", "provo", "salem", "jasper")); + EXPECT_THAT(platforms, testing::UnorderedElementsAre("pc", "android", "ios", "mac", "provo", "salem", "jasper")); } TEST_F(PlatformHelperTest, InvalidPlatformFlags_PlatformId_Empty) diff --git a/Code/Framework/Tests/Slices.cpp b/Code/Framework/Tests/Slices.cpp index 6a9ce858c0..8a20c43fb5 100644 --- a/Code/Framework/Tests/Slices.cpp +++ b/Code/Framework/Tests/Slices.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1059,6 +1060,12 @@ namespace UnitTest void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AzFramework::Application::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Code/Framework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp b/Code/Framework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp new file mode 100644 index 0000000000..1fa50fff52 --- /dev/null +++ b/Code/Framework/Tests/Spawnable/SpawnableEntitiesManagerTests.cpp @@ -0,0 +1,158 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class TestApplication : public AzFramework::Application + { + public: + // ComponentApplication + void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override + { + Application::SetSettingsRegistrySpecializations(specializations); + specializations.Append("test"); + specializations.Append("spawnable"); + } + }; + + class SpawnableEntitiesManagerTest : public AllocatorsFixture + { + public: + void SetUp() override + { + AllocatorsFixture::SetUp(); + + m_application = new TestApplication(); + AZ::ComponentApplication::Descriptor descriptor; + m_application->Start(descriptor); + + 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); + + auto managerInterface = AzFramework::SpawnableEntitiesInterface::Get(); + m_manager = azrtti_cast(managerInterface); + } + + void TearDown() override + { + delete m_ticket; + m_ticket = nullptr; + // One more tick on the spawnable entities manager in order to delete the ticket fully. + m_manager->ProcessQueue(); + + delete m_spawnableAsset; + m_spawnableAsset = nullptr; + // This will also delete m_spawnable. + + delete m_application; + m_application = nullptr; + + AllocatorsFixture::TearDown(); + } + + void FillSpawnable(size_t numElements) + { + AzFramework::Spawnable::EntityList& entities = m_spawnable->GetEntities(); + entities.reserve(numElements); + for (size_t i=0; i()); + } + } + + protected: + AZ::Data::Asset* m_spawnableAsset { nullptr }; + AzFramework::SpawnableEntitiesManager* m_manager { nullptr }; + AzFramework::EntitySpawnTicket* m_ticket { nullptr }; + AzFramework::Spawnable* m_spawnable { nullptr }; + TestApplication* m_application { nullptr }; + }; + + TEST_F(SpawnableEntitiesManagerTest, SpawnAllEntities_Call_AllEntitiesSpawned) + { + static constexpr size_t NumEntities = 4; + FillSpawnable(NumEntities); + + size_t spawnedEntitiesCount = 0; + auto callback = + [&spawnedEntitiesCount](AzFramework::EntitySpawnTicket&, AzFramework::SpawnableConstEntityContainerView entities) + { + spawnedEntitiesCount += entities.size(); + }; + m_manager->SpawnAllEntities(*m_ticket, {}, AZStd::move(callback)); + m_manager->ProcessQueue(); + + EXPECT_EQ(NumEntities, spawnedEntitiesCount); + } + + TEST_F(SpawnableEntitiesManagerTest, ListEntities_Call_AllEntitiesAreReported) + { + static constexpr size_t NumEntities = 4; + FillSpawnable(NumEntities); + + bool allValidEntityIds = true; + size_t spawnedEntitiesCount = 0; + auto callback = [&allValidEntityIds, &spawnedEntitiesCount] + (AzFramework::EntitySpawnTicket&, AzFramework::SpawnableConstEntityContainerView entities) + { + for (auto&& entity : entities) + { + allValidEntityIds = entity->GetId().IsValid() && allValidEntityIds; + } + spawnedEntitiesCount += entities.size(); + }; + + m_manager->SpawnAllEntities(*m_ticket); + m_manager->ListEntities(*m_ticket, AZStd::move(callback)); + m_manager->ProcessQueue(); + + EXPECT_TRUE(allValidEntityIds); + EXPECT_EQ(NumEntities, spawnedEntitiesCount); + } + + TEST_F(SpawnableEntitiesManagerTest, ListIndicesAndEntities_Call_AllEntitiesAreReportedAndIncrementByOne) + { + static constexpr size_t NumEntities = 4; + FillSpawnable(NumEntities); + + bool allValidEntityIds = true; + size_t spawnedEntitiesCount = 0; + auto callback = [&allValidEntityIds, &spawnedEntitiesCount] + (AzFramework::EntitySpawnTicket&, AzFramework::SpawnableConstIndexEntityContainerView entities) + { + for (auto&& indexEntityPair : entities) + { + // Since all entities are spawned a single time, the indices should be 0..NumEntities. + if (indexEntityPair.GetIndex() == spawnedEntitiesCount) + { + spawnedEntitiesCount++; + } + allValidEntityIds = indexEntityPair.GetEntity()->GetId().IsValid() && allValidEntityIds; + } + }; + + m_manager->SpawnAllEntities(*m_ticket); + m_manager->ListIndicesAndEntities(*m_ticket, AZStd::move(callback)); + m_manager->ProcessQueue(); + + EXPECT_TRUE(allValidEntityIds); + EXPECT_EQ(NumEntities, spawnedEntitiesCount); + } +} // namespace UnitTest diff --git a/Code/Framework/Tests/TransformComponent.cpp b/Code/Framework/Tests/TransformComponent.cpp index c2615f2a30..707c4d66ec 100644 --- a/Code/Framework/Tests/TransformComponent.cpp +++ b/Code/Framework/Tests/TransformComponent.cpp @@ -24,6 +24,8 @@ #include #include +#include + using namespace AZ; using namespace AzFramework; @@ -362,8 +364,8 @@ namespace UnitTest TEST_F(TransformComponentTransformMatrixSetGet, SetLocalRotation_SimpleValues_Set) { // add some scale first - float sx = 1.03f, sy = 0.67f, sz = 1.23f; - Transform tm = Transform::CreateScale(Vector3(sx, sy, sz)); + float scale = 1.23f; + Transform tm = Transform::CreateUniformScale(scale); TransformBus::Event(m_childId, &TransformBus::Events::SetLocalTM, tm); float rx = 42.435f; @@ -379,13 +381,13 @@ namespace UnitTest Matrix3x3 finalRotate = rotateX * rotateY * rotateZ; Vector3 basisX = tm.GetBasisX(); - Vector3 expectedBasisX = finalRotate.GetBasisX() * sx; + Vector3 expectedBasisX = finalRotate.GetBasisX() * scale; EXPECT_TRUE(basisX.IsClose(expectedBasisX)); Vector3 basisY = tm.GetBasisY(); - Vector3 expectedBasisY = finalRotate.GetBasisY() * sy; + Vector3 expectedBasisY = finalRotate.GetBasisY() * scale; EXPECT_TRUE(basisY.IsClose(expectedBasisY)); Vector3 basisZ = tm.GetBasisZ(); - Vector3 expectedBasisZ = finalRotate.GetBasisZ() * sz; + Vector3 expectedBasisZ = finalRotate.GetBasisZ() * scale; EXPECT_TRUE(basisZ.IsClose(expectedBasisZ)); } @@ -476,18 +478,15 @@ namespace UnitTest { TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalX, rx); } - Vector3 localScale; - TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalScale); - EXPECT_TRUE(localScale.IsClose(Vector3(1.0f, 1.0f, 1.0f))); + float localScale = FLT_MAX; + TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalUniformScale); + EXPECT_NEAR(localScale, 1.0f, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, RotateAroundLocalX_ScaleDoesNotSkewRotation) { - float sx = 42.564f; - float sy = 12.460f; - float sz = 28.692f; - Vector3 expectedScales(sx, sy, sz); - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScale, expectedScales); + float expectedScale = 42.564f; + TransformBus::Event(m_childId, &TransformBus::Events::SetLocalUniformScale, expectedScale); float rx = 1.43f; TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalX, rx); @@ -513,18 +512,15 @@ namespace UnitTest { TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalY, ry); } - Vector3 localScale; - TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalScale); - EXPECT_TRUE(localScale.IsClose(Vector3(1.0f, 1.0f, 1.0f))); + float localScale = FLT_MAX; + TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalUniformScale); + EXPECT_NEAR(localScale, 1.0f, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, RotateAroundLocalY_ScaleDoesNotSkewRotation) { - float sx = 42.564f; - float sy = 12.460f; - float sz = 28.692f; - Vector3 expectedScales(sx, sy, sz); - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScale, expectedScales); + float expectedScale = 42.564f; + TransformBus::Event(m_childId, &TransformBus::Events::SetLocalUniformScale, expectedScale); float ry = 1.43f; TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalY, ry); @@ -550,18 +546,15 @@ namespace UnitTest { TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalZ, rz); } - Vector3 localScale; - TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalScale); - EXPECT_TRUE(localScale.IsClose(Vector3(1.0f, 1.0f, 1.0f))); + float localScale = FLT_MAX; + TransformBus::EventResult(localScale, m_childId, &TransformBus::Events::GetLocalUniformScale); + EXPECT_NEAR(localScale, 1.0f, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, RotateAroundLocalZ_ScaleDoesNotSkewRotation) { - float sx = 42.564f; - float sy = 12.460f; - float sz = 28.692f; - Vector3 expectedScales(sx, sy, sz); - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScale, expectedScales); + float expectedScale = 42.564f; + TransformBus::Event(m_childId, &TransformBus::Events::SetLocalUniformScale, expectedScale); float rz = 1.43f; TransformBus::Event(m_childId, &TransformBus::Events::RotateAroundLocalZ, rz); @@ -572,110 +565,50 @@ namespace UnitTest TEST_F(TransformComponentTransformMatrixSetGet, SetLocalScale_SimpleValues_Set) { - float sx = 42.564f; - float sy = 12.460f; - float sz = 28.692f; - Vector3 expectedScales(sx, sy, sz); - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScale, expectedScales); + float expectedScale = 42.564f; + TransformBus::Event(m_childId, &TransformBus::Events::SetLocalUniformScale, expectedScale); - Transform tm ; - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 scales = tm.GetScale(); - EXPECT_TRUE(scales.IsClose(expectedScales)); - } - - TEST_F(TransformComponentTransformMatrixSetGet, SetLocalScaleX_SimpleValues_Set) - { - float sx = 64.336f; Transform tm; TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 expectedScales = tm.GetScale(); - expectedScales.SetX(sx); - - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScaleX, sx); - - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 scales = tm.GetScale(); - EXPECT_TRUE(scales.IsClose(expectedScales)); - } - - TEST_F(TransformComponentTransformMatrixSetGet, SetLocalScaleY_SimpleValues_Set) - { - float sy = 23.754f; - Transform tm; - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 expectedScales = tm.GetScale(); - expectedScales.SetY(sy); - - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScaleY, sy); - - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 scales = tm.GetScale(); - EXPECT_TRUE(scales.IsClose(expectedScales)); - } - - TEST_F(TransformComponentTransformMatrixSetGet, SetLocalScaleZ_SimpleValues_Set) - { - float sz = 65.140f; - Transform tm; - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 expectedScales = tm.GetScale(); - expectedScales.SetZ(sz); - - TransformBus::Event(m_childId, &TransformBus::Events::SetLocalScaleZ, sz); - - TransformBus::EventResult(tm, m_childId, &TransformBus::Events::GetLocalTM); - Vector3 scales = tm.GetScale(); - EXPECT_TRUE(scales.IsClose(expectedScales)); + float scale = tm.GetUniformScale(); + EXPECT_NEAR(scale, expectedScale, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, GetLocalScale_SimpleValues_Return) { - float sx = 43.463f; - float sy = 346.22f; - float sz = 863.32f; - Vector3 expectedScales(sx, sy, sz); - Transform scaleTM = Transform::CreateScale(expectedScales); + float expectedScale = 43.463f; + Transform scaleTM = Transform::CreateUniformScale(expectedScale); TransformBus::Event(m_childId, &TransformBus::Events::SetLocalTM, scaleTM); - Vector3 scales; - TransformBus::EventResult(scales, m_childId, &TransformBus::Events::GetLocalScale); - EXPECT_TRUE(scales.IsClose(expectedScales)); + float scale; + TransformBus::EventResult(scale, m_childId, &TransformBus::Events::GetLocalUniformScale); + EXPECT_NEAR(scale, expectedScale, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, GetWorldScale_ChildHasNoScale_ReturnScaleSameAsParent) { - float sx = 43.463f; - float sy = 346.22f; - float sz = 863.32f; - Vector3 expectedScales(sx, sy, sz); - Transform scaleTM = Transform::CreateScale(expectedScales); + float expectedScale = 43.463f; + Transform scaleTM = Transform::CreateUniformScale(expectedScale); TransformBus::Event(m_parentId, &TransformBus::Events::SetLocalTM, scaleTM); - Vector3 scales; - TransformBus::EventResult(scales, m_childId, &TransformBus::Events::GetWorldScale); - EXPECT_TRUE(scales.IsClose(expectedScales)); + float scale = FLT_MAX; + TransformBus::EventResult(scale, m_childId, &TransformBus::Events::GetWorldUniformScale); + EXPECT_NEAR(scale, expectedScale, AZ::Constants::Tolerance); } TEST_F(TransformComponentTransformMatrixSetGet, GetWorldScale_ChildHasScale_ReturnCompoundScale) { - float sx = 4.463f; - float sy = 3.22f; - float sz = 8.32f; - Vector3 parentScales(sx, sy, sz); - Transform parentScaleTM = Transform::CreateScale(parentScales); + float parentScale = 4.463f; + Transform parentScaleTM = Transform::CreateUniformScale(parentScale); TransformBus::Event(m_parentId, &TransformBus::Events::SetLocalTM, parentScaleTM); - float csx = 1.64f; - float csy = 9.35f; - float csz = 1.57f; - Vector3 childScales(csx, csy, csz); - Transform childScaleTM = Transform::CreateScale(childScales); + float childScale = 1.64f; + Transform childScaleTM = Transform::CreateUniformScale(childScale); TransformBus::Event(m_childId, &TransformBus::Events::SetLocalTM, childScaleTM); - Vector3 scales; - TransformBus::EventResult(scales, m_childId, &TransformBus::Events::GetWorldScale); - EXPECT_TRUE(scales.IsClose(parentScales * childScales)); + float scale = FLT_MAX; + TransformBus::EventResult(scale, m_childId, &TransformBus::Events::GetWorldUniformScale); + EXPECT_NEAR(scale, parentScale * childScale, AZ::Constants::Tolerance); } class TransformComponentHierarchy diff --git a/Code/Framework/Tests/frameworktests_files.cmake b/Code/Framework/Tests/frameworktests_files.cmake index e249cf6e64..3fc84eb788 100644 --- a/Code/Framework/Tests/frameworktests_files.cmake +++ b/Code/Framework/Tests/frameworktests_files.cmake @@ -11,12 +11,14 @@ set(FILES ../AzCore/Tests/Main.cpp + Spawnable/SpawnableEntitiesManagerTests.cpp ArchiveCompressionTests.cpp ArchiveTests.cpp BehaviorEntityTests.cpp BinToTextEncode.cpp ComponentAddRemove.cpp ComponentAdapterTests.cpp + CameraInputTests.cpp ClickDetectorTests.cpp CursorStateTests.cpp EntityContext.cpp diff --git a/Code/LauncherUnified/Launcher.cpp b/Code/LauncherUnified/Launcher.cpp index 1f29478399..922397c325 100644 --- a/Code/LauncherUnified/Launcher.cpp +++ b/Code/LauncherUnified/Launcher.cpp @@ -488,8 +488,8 @@ namespace O3DELauncher const AZStd::string_view buildTargetName = GetBuildTargetName(); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddBuildSystemTargetSpecialization(*settingsRegistry, buildTargetName); - AZ_TracePrintf("Launcher", R"(Running project "%.*s.)" "\n" - R"(The project name value has been successfully set in the Settings Registry at key "%s/project_name)" + AZ_TracePrintf("Launcher", R"(Running project "%.*s")" "\n" + R"(The project name has been successfully set in the Settings Registry at key "%s/project_name")" R"( for Launcher target "%.*s")" "\n", aznumeric_cast(launcherProjectName.size()), launcherProjectName.data(), AZ::SettingsRegistryMergeUtils::ProjectSettingsRootKey, @@ -643,7 +643,8 @@ namespace O3DELauncher if (gEnv && gEnv->pConsole) { // Execute autoexec.cfg to load the initial level - AZ::Interface::Get()->ExecuteConfigFile("autoexec.cfg"); + auto autoExecFile = AZ::IO::FixedMaxPath{pathToAssets} / "autoexec.cfg"; + AZ::Interface::Get()->ExecuteConfigFile(autoExecFile.Native()); // Find out if console command file was passed // via --console-command-file=%filename% and execute it diff --git a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake index bcef59ec5a..35c89caf15 100644 --- a/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake +++ b/Code/LauncherUnified/Platform/Windows/launcher_project_windows.cmake @@ -10,6 +10,11 @@ # set(ICON_FILE ${project_real_path}/Gem/Resources/GameSDK.ico) +if(NOT EXISTS ${ICON_FILE}) + # Try another project-relative path + set(ICON_FILE ${project_real_path}/Resources/GameSDK.ico) +endif() + if(NOT EXISTS ${ICON_FILE}) # Try the common LauncherUnified icon instead set(ICON_FILE Resources/GameSDK.ico) diff --git a/Code/LauncherUnified/launcher_generator.cmake b/Code/LauncherUnified/launcher_generator.cmake index 28429729e1..c5d60eb29e 100644 --- a/Code/LauncherUnified/launcher_generator.cmake +++ b/Code/LauncherUnified/launcher_generator.cmake @@ -9,6 +9,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # + +set_property(GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) # Launcher targets for a project need to be generated when configuring a project. # When building the engine source, this file will be included by LauncherUnified's CMakeLists.txt # When using an installed engine, this file will be included by the FindLauncherGenerator.cmake script @@ -40,28 +42,8 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC # In the monolithic case, we need to register the gem modules, to do so we will generate a StaticModules.inl # file from StaticModules.in - + set_property(GLOBAL APPEND PROPERTY LY_STATIC_MODULE_PROJECTS_NAME ${project_name}) get_property(game_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.GameLauncher) - - unset(extern_module_declarations) - unset(module_invocations) - - foreach(game_gem_dependency ${game_gem_dependencies}) - # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix - # and remove the ".Static" from the suffix - string(REGEX REPLACE "^Gem::" "Gem_" game_gem_dependency ${game_gem_dependency}) - string(REGEX REPLACE "^Project::" "Project_" game_gem_dependency ${game_gem_dependency}) - # Replace "." with "_" - string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency}) - - string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${game_gem_dependency}();\n") - string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${game_gem_dependency}());\n") - - endforeach() - - configure_file(StaticModules.in - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.GameLauncher/Includes/StaticModules.inl - ) set(game_build_dependencies ${game_gem_dependencies} @@ -70,29 +52,9 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) get_property(server_gem_dependencies GLOBAL PROPERTY LY_DELAYED_DEPENDENCIES_${project_name}.ServerLauncher) - - unset(extern_module_declarations) - unset(module_invocations) - - foreach(server_gem_dependency ${server_gem_dependencies}) - # To match the convention on how gems targets vs gem modules are named, we remove the "Gem::" from prefix - # and remove the ".Static" from the suffix - string(REGEX REPLACE "^Gem::" "Gem_" server_gem_dependency ${server_gem_dependency}) - string(REGEX REPLACE "^Project::" "Project_" server_gem_dependency ${server_gem_dependency}) - # Replace "." with "_" - string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency}) - - string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_${server_gem_dependency}();\n") - string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_${server_gem_dependency}());\n") - - endforeach() - - configure_file(StaticModules.in - ${CMAKE_CURRENT_BINARY_DIR}/${project_name}.ServerLauncher/Includes/StaticModules.inl - ) set(server_build_dependencies - ${game_gem_dependencies} + ${server_gem_dependencies} Legacy::CrySystem ) endif() @@ -186,3 +148,65 @@ foreach(project_name project_path IN ZIP_LISTS LY_PROJECTS_TARGET_NAME LY_PROJEC endif() endforeach() + +#! Defer generation of the StaticModules.inl file needed in monolithic builds until after all the CMake targets are known +# This is that the GEM_MODULE target runtime dependencies can be parsed to discover the list of dependent modules +# to load +function(ly_delayed_generate_static_modules_inl) + if(LY_MONOLITHIC_GAME) + get_property(launcher_unified_binary_dir GLOBAL PROPERTY LAUNCHER_UNIFIED_BINARY_DIR) + get_property(project_names GLOBAL PROPERTY LY_STATIC_MODULE_PROJECTS_NAME) + foreach(project_name ${project_names}) + + unset(extern_module_declarations) + unset(module_invocations) + + unset(all_game_gem_dependencies) + ly_get_gem_load_dependencies(all_game_gem_dependencies ${project_name}.GameLauncher) + + foreach(game_gem_dependency ${all_game_gem_dependencies}) + # To match the convention on how gems targets vs gem modules are named, + # we remove the ".Static" from the suffix + # Replace "." with "_" + string(REPLACE "." "_" game_gem_dependency ${game_gem_dependency}) + + string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_Gem_${game_gem_dependency}();\n") + string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_Gem_${game_gem_dependency}());\n") + + endforeach() + + configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/StaticModules.in + ${launcher_unified_binary_dir}/${project_name}.GameLauncher/Includes/StaticModules.inl + ) + + ly_target_link_libraries(${project_name}.GameLauncher PRIVATE ${all_game_gem_dependencies}) + if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) + get_property(server_gem_dependencies GLOBAL PROPERTY LY_STATIC_MODULE_PROJECTS_DEPENDENCIES_${project_name}.ServerLauncher) + + unset(extern_module_declarations) + unset(module_invocations) + + unset(all_server_gem_dependencies) + ly_get_gem_load_dependencies(all_server_gem_dependencies ${project_name}.ServerLauncher) + foreach(server_gem_dependency ${server_gem_dependencies}) + ly_get_gem_load_dependencies(server_gem_load_dependencies ${server_gem_dependency}) + list(APPEND all_server_gem_dependencies ${server_gem_load_dependencies} ${server_gem_dependency}) + endforeach() + foreach(server_gem_dependency ${all_server_gem_dependencies}) + # Replace "." with "_" + string(REPLACE "." "_" server_gem_dependency ${server_gem_dependency}) + + string(APPEND extern_module_declarations "extern \"C\" AZ::Module* CreateModuleClass_Gem_${server_gem_dependency}();\n") + string(APPEND module_invocations " modulesOut.push_back(CreateModuleClass_Gem_${server_gem_dependency}());\n") + + endforeach() + + configure_file(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/StaticModules.in + ${launcher_unified_binary_dir}/${project_name}.ServerLauncher/Includes/StaticModules.inl + ) + + ly_target_link_libraries(${project_name}.ServerLauncher PRIVATE ${all_server_gem_dependencies}) + endif() + endforeach() + endif() +endfunction() diff --git a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp index c8bd157b65..e0ba106875 100644 --- a/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp +++ b/Code/Sandbox/Editor/AzAssetBrowser/AzAssetBrowserRequestHandler.cpp @@ -137,8 +137,20 @@ namespace AzAssetBrowserRequestHandlerPrivate entityName = AZStd::string::format("Entity%d", GetIEditor()->GetObjectManager()->GetObjectCount()); } - AZ::Entity* newEntity = aznew AZ::Entity(entityName.c_str()); - EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequests::AddRequiredComponents, *newEntity); + AZ::EntityId targetEntityId; + EditorRequests::Bus::BroadcastResult(targetEntityId, &EditorRequests::CreateNewEntityAtPosition, worldTransform.GetTranslation(), AZ::EntityId()); + + AZ::Entity* newEntity = nullptr; + AZ::ComponentApplicationBus::BroadcastResult(newEntity, &AZ::ComponentApplicationRequests::FindEntity, targetEntityId); + + if (newEntity == nullptr) + { + return; + } + + newEntity->SetName(entityName); + + newEntity->Deactivate(); // Create component. AZ::Component* newComponent = newEntity->CreateComponent(componentTypeId); @@ -151,15 +163,7 @@ namespace AzAssetBrowserRequestHandlerPrivate newEntity->AddComponent(newComponent); } - // Set entity position. - auto* transformComponent = newEntity->FindComponent(); - if (transformComponent) - { - transformComponent->SetWorldTM(worldTransform); - } - - // Add the entity to the editor context, which activates it and creates the sandbox object. - EditorEntityContextRequestBus::Broadcast(&EditorEntityContextRequests::AddEditorEntity, newEntity); + newEntity->Activate(); // set asset after components have been activated in AddEditorEntity method if (newComponent) diff --git a/Code/Sandbox/Editor/CMakeLists.txt b/Code/Sandbox/Editor/CMakeLists.txt index c62e05f012..7be9947e99 100644 --- a/Code/Sandbox/Editor/CMakeLists.txt +++ b/Code/Sandbox/Editor/CMakeLists.txt @@ -129,6 +129,8 @@ ly_add_target( 3rdParty::AWSNativeSDK::Core 3rdParty::Qt::Network Legacy::EditorCore + RUNTIME_DEPENDENCIES + Gem::AtomViewportDisplayInfo ) ly_add_source_properties( SOURCES CryEdit.cpp @@ -173,6 +175,7 @@ ly_add_target( RUNTIME_DEPENDENCIES Legacy::CrySystem Legacy::EditorLib + ProjectManager ) ly_add_translations( TARGETS Editor @@ -243,7 +246,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Legacy::CryCommon AZ::AzToolsFramework Legacy::EditorLib - Gem::LmbrCentral + RUNTIME_DEPENDENCIES + Gem::LmbrCentral ) ly_add_googletest( NAME Legacy::EditorLib.Tests diff --git a/Code/Sandbox/Editor/CryEdit.cpp b/Code/Sandbox/Editor/CryEdit.cpp index 0bbc48d5f9..a0ff5d7eff 100644 --- a/Code/Sandbox/Editor/CryEdit.cpp +++ b/Code/Sandbox/Editor/CryEdit.cpp @@ -69,6 +69,7 @@ AZ_POP_DISABLE_WARNING #include #include #include +#include #include // AzQtComponents @@ -3105,6 +3106,15 @@ CCryEditApp::ECreateLevelResult CCryEditApp::CreateLevel(const QString& levelNam GetIEditor()->GetDocument()->SetPathName(fullyQualifiedLevelName); GetIEditor()->GetGameEngine()->SetLevelPath(levelPath); + if (usePrefabSystemForLevels) + { + auto* service = AZ::Interface::Get(); + if (service) + { + service->CreateNewLevelPrefab(fullyQualifiedLevelName.toUtf8().constData(), DefaultLevelTemplateName); + } + } + if (GetIEditor()->GetDocument()->Save()) { if (!usePrefabSystemForLevels) diff --git a/Code/Sandbox/Editor/CryEdit.h b/Code/Sandbox/Editor/CryEdit.h index 2e71ca6a58..d4c1304b6a 100644 --- a/Code/Sandbox/Editor/CryEdit.h +++ b/Code/Sandbox/Editor/CryEdit.h @@ -358,6 +358,8 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING private: + static inline constexpr const char* DefaultLevelTemplateName = "Prefabs/Default_Level.prefab"; + struct PythonOutputHandler; AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZStd::shared_ptr m_pythonOutputHandler; diff --git a/Code/Sandbox/Editor/CryEditDoc.cpp b/Code/Sandbox/Editor/CryEditDoc.cpp index a6c5f73c7f..747921d401 100644 --- a/Code/Sandbox/Editor/CryEditDoc.cpp +++ b/Code/Sandbox/Editor/CryEditDoc.cpp @@ -58,13 +58,11 @@ #include "LevelFileDialog.h" #include "StatObjBus.h" -// LmbrCentral -#include #include #include -#include // for LmbrCentral::EditorLightComponentRequestBus - +// LmbrCentral +#include // for LmbrCentral::EditorLightComponentRequestBus //#define PROFILE_LOADING_WITH_VTUNE diff --git a/Code/Sandbox/Editor/CryEditPy.cpp b/Code/Sandbox/Editor/CryEditPy.cpp index 135dd9878c..edbeccb04f 100644 --- a/Code/Sandbox/Editor/CryEditPy.cpp +++ b/Code/Sandbox/Editor/CryEditPy.cpp @@ -533,7 +533,7 @@ namespace AzToolsFramework ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); behaviorContext->EnumProperty("SystemConfigPlatform_Pc") ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); - behaviorContext->EnumProperty("SystemConfigPlatform_OsxGl") + behaviorContext->EnumProperty("SystemConfigPlatform_Mac") ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); behaviorContext->EnumProperty("SystemConfigPlatform_OsxMetal") ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Automation); diff --git a/Code/Sandbox/Editor/EditorViewportWidget.cpp b/Code/Sandbox/Editor/EditorViewportWidget.cpp index 436d4bba63..989d6e407d 100644 --- a/Code/Sandbox/Editor/EditorViewportWidget.cpp +++ b/Code/Sandbox/Editor/EditorViewportWidget.cpp @@ -49,9 +49,11 @@ #include #include #include +#include // AtomToolsFramework #include +#include // CryCommon #include @@ -74,7 +76,6 @@ #include "EditorPreferencesPageGeneral.h" #include "ViewportManipulatorController.h" #include "LegacyViewportCameraController.h" -#include "ModernViewportCameraController.h" #include "EditorViewportSettings.h" #include "ViewPane.h" @@ -456,15 +457,6 @@ void EditorViewportWidget::Update() return; } - static bool sentOnWindowCreated = false; - if (!sentOnWindowCreated && windowHandle()->isActive()) - { - sentOnWindowCreated = true; - AzFramework::WindowSystemNotificationBus::Broadcast( - &AzFramework::WindowSystemNotificationBus::Handler::OnWindowCreated, - reinterpret_cast(winId())); - } - m_updatingCameraPosition = true; if (!ed_useNewCameraSystem) { @@ -1228,36 +1220,73 @@ void EditorViewportWidget::SetViewportId(int id) { AzFramework::ReloadCameraKeyBindings(); - auto controller = AZStd::make_shared(); - controller->SetCameraListBuilderCallback([](AzFramework::Cameras& cameras) - { - auto firstPersonRotateCamera = AZStd::make_shared(AzFramework::CameraFreeLookButton); - auto firstPersonPanCamera = - AZStd::make_shared(AzFramework::CameraFreePanButton, AzFramework::LookPan); - auto firstPersonTranslateCamera = AZStd::make_shared(AzFramework::LookTranslation); - auto firstPersonWheelCamera = AZStd::make_shared(); + auto controller = AZStd::make_shared(); + controller->SetCameraListBuilderCallback( + [](AzFramework::Cameras& cameras) + { + auto firstPersonRotateCamera = AZStd::make_shared(AzFramework::CameraFreeLookButton); + auto firstPersonPanCamera = + AZStd::make_shared(AzFramework::CameraFreePanButton, AzFramework::LookPan); + auto firstPersonTranslateCamera = AZStd::make_shared(AzFramework::LookTranslation); + auto firstPersonWheelCamera = AZStd::make_shared(); - auto orbitCamera = AZStd::make_shared(); - auto orbitRotateCamera = AZStd::make_shared(AzFramework::CameraOrbitLookButton); - auto orbitTranslateCamera = AZStd::make_shared(AzFramework::OrbitTranslation); - auto orbitDollyWheelCamera = AZStd::make_shared(); - auto orbitDollyMoveCamera = - AZStd::make_shared(AzFramework::CameraOrbitDollyButton); - auto orbitPanCamera = - AZStd::make_shared(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan); + auto orbitCamera = AZStd::make_shared(); + orbitCamera->SetLookAtFn( + [](const AZ::Vector3& position, const AZ::Vector3& direction) -> AZStd::optional + { + AZStd::optional manipulatorTransform; + AzToolsFramework::EditorTransformComponentSelectionRequestBus::EventResult( + manipulatorTransform, AzToolsFramework::GetEntityContextId(), + &AzToolsFramework::EditorTransformComponentSelectionRequestBus::Events::GetManipulatorTransform); - orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera); - orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera); + // initially attempt to use manipulator transform if one exists (there is a selection) + if (manipulatorTransform) + { + return manipulatorTransform->GetTranslation(); + } - cameras.AddCamera(firstPersonRotateCamera); - cameras.AddCamera(firstPersonPanCamera); - cameras.AddCamera(firstPersonTranslateCamera); - cameras.AddCamera(firstPersonWheelCamera); - cameras.AddCamera(orbitCamera); - }); + const float RayDistance = 1000.0f; + AzFramework::RenderGeometry::RayRequest ray; + ray.m_startWorldPosition = position; + ray.m_endWorldPosition = position + direction * RayDistance; + ray.m_onlyVisible = true; + + AzFramework::RenderGeometry::RayResult renderGeometryIntersectionResult; + AzFramework::RenderGeometry::IntersectorBus::EventResult( + renderGeometryIntersectionResult, AzToolsFramework::GetEntityContextId(), + &AzFramework::RenderGeometry::IntersectorInterface::RayIntersect, ray); + + // attempt a ray intersection with any visible mesh and return the intersection position if successful + if (renderGeometryIntersectionResult) + { + return renderGeometryIntersectionResult.m_worldPosition; + } + + // if there is no selection or no intersection, fallback to default camera orbit behavior (ground plane + // intersection) + return {}; + }); + + auto orbitRotateCamera = AZStd::make_shared(AzFramework::CameraOrbitLookButton); + auto orbitTranslateCamera = AZStd::make_shared(AzFramework::OrbitTranslation); + auto orbitDollyWheelCamera = AZStd::make_shared(); + auto orbitDollyMoveCamera = + AZStd::make_shared(AzFramework::CameraOrbitDollyButton); + auto orbitPanCamera = + AZStd::make_shared(AzFramework::CameraOrbitPanButton, AzFramework::OrbitPan); + + orbitCamera->m_orbitCameras.AddCamera(orbitRotateCamera); + orbitCamera->m_orbitCameras.AddCamera(orbitTranslateCamera); + orbitCamera->m_orbitCameras.AddCamera(orbitDollyWheelCamera); + orbitCamera->m_orbitCameras.AddCamera(orbitDollyMoveCamera); + orbitCamera->m_orbitCameras.AddCamera(orbitPanCamera); + + cameras.AddCamera(firstPersonRotateCamera); + cameras.AddCamera(firstPersonPanCamera); + cameras.AddCamera(firstPersonTranslateCamera); + cameras.AddCamera(firstPersonWheelCamera); + cameras.AddCamera(orbitCamera); + }); m_renderViewport->GetControllerList()->Add(controller); } diff --git a/Code/Sandbox/Editor/GotoPositionDlg.cpp b/Code/Sandbox/Editor/GotoPositionDlg.cpp index a09f594b7b..f52a45cad4 100644 --- a/Code/Sandbox/Editor/GotoPositionDlg.cpp +++ b/Code/Sandbox/Editor/GotoPositionDlg.cpp @@ -34,6 +34,7 @@ CGotoPositionDlg::CGotoPositionDlg(QWidget* pParent /*=NULL*/) { m_ui->setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setFixedSize(size()); OnInitDialog(); auto doubleValueChanged = static_cast(&QDoubleSpinBox::valueChanged); @@ -98,6 +99,9 @@ void CGotoPositionDlg::OnInitDialog() m_ui->m_dymSegX->setVisible(false); m_ui->m_dymSegY->setVisible(false); + // Ensure the goto button is highlighted correctly. + m_ui->pushButton->setDefault(true); + OnUpdateNumbers(); } diff --git a/Code/Sandbox/Editor/GotoPositionDlg.ui b/Code/Sandbox/Editor/GotoPositionDlg.ui index 4c93c8f037..9791b5bff1 100644 --- a/Code/Sandbox/Editor/GotoPositionDlg.ui +++ b/Code/Sandbox/Editor/GotoPositionDlg.ui @@ -6,189 +6,210 @@ 0 0 - 358 - 198 + 290 + 180 Go to Position - - - - - Go To - - - - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 22 - 20 - - - - - - - - - - - - - - - - - - - - - - - Z: - - - - - - - Y: - - - - - - - Enter position here: - - - - - - - X: - - - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Position: - - - - - - - X: - - - - - - - X: - - - - - - - - - - Y: - - - - - - - Y: - - - - - - - Z: - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 22 - 20 - - - - - - - - Angles: - - - - - - - Segments: - - - - - - - - - - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 22 + 20 + + + + + + + + + + + + + + + + + + + + + + + Z: + + + + + + + Y: + + + + + + + Enter position here: + + + + + + + X: + + + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Position: + + + + + + + X: + + + + + + + X: + + + + + + + + + + Y: + + + + + + + Y: + + + + + + + Z: + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 22 + 20 + + + + + + + + Angles: + + + + + + + Segments: + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + Go To + + + + + + + Cancel + + + + + + m_posEdit diff --git a/Code/Sandbox/Editor/Objects/SelectionGroup.cpp b/Code/Sandbox/Editor/Objects/SelectionGroup.cpp index a2c88c7302..aacf531203 100644 --- a/Code/Sandbox/Editor/Objects/SelectionGroup.cpp +++ b/Code/Sandbox/Editor/Objects/SelectionGroup.cpp @@ -482,28 +482,6 @@ void CSelectionGroup::StartScaling() } -void CSelectionGroup::FinishScaling(const Vec3& scale, [[maybe_unused]] int referenceCoordSys) -{ - if (fabs(scale.x - scale.y) < 0.001f && - fabs(scale.y - scale.z) < 0.001f && - fabs(scale.z - scale.x) < 0.001f) - { - return; - } - - for (int i = 0; i < GetFilteredCount(); ++i) - { - CBaseObject* obj = GetFilteredObject(i); - Vec3 OriginalScale; - if (obj->GetUntransformedScale(OriginalScale)) - { - obj->TransformScale(scale); - obj->SetScale(OriginalScale); - } - } -} - - ////////////////////////////////////////////////////////////////////////// void CSelectionGroup::Align() { diff --git a/Code/Sandbox/Editor/Objects/SelectionGroup.h b/Code/Sandbox/Editor/Objects/SelectionGroup.h index 277ff2a492..9f672f28b2 100644 --- a/Code/Sandbox/Editor/Objects/SelectionGroup.h +++ b/Code/Sandbox/Editor/Objects/SelectionGroup.h @@ -103,7 +103,6 @@ public: void StartScaling(); void Scale(const Vec3& scale, int referenceCoordSys); void SetScale(const Vec3& scale, int referenceCoordSys); - void FinishScaling(const Vec3& scale, int referenceCoordSys); //! Align objects in selection to surface normal void Align(); //! Very special method to move contents of a voxel. diff --git a/Code/Sandbox/Editor/RenderViewport.cpp b/Code/Sandbox/Editor/RenderViewport.cpp index f199590e4f..8cef9e802c 100644 --- a/Code/Sandbox/Editor/RenderViewport.cpp +++ b/Code/Sandbox/Editor/RenderViewport.cpp @@ -1259,9 +1259,6 @@ CBaseObject* CRenderViewport::GetCameraObject() const ////////////////////////////////////////////////////////////////////////// void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event) { - static ICVar* outputToHMD = gEnv->pConsole->GetCVar("output_to_hmd"); - AZ_Assert(outputToHMD, "cvar output_to_hmd is undeclared"); - switch (event) { case eNotify_OnBeginGameMode: @@ -1282,7 +1279,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event) if (deviceInfo) { - outputToHMD->Set(1); m_previousContext = SetCurrentContext(deviceInfo->renderWidth, deviceInfo->renderHeight); if (m_renderer->GetIStereoRenderer()) { @@ -1313,10 +1309,6 @@ void CRenderViewport::OnEditorNotifyEvent(EEditorNotifyEvent event) // failed to set the context back when done, or set it back to the wrong one. CryWarning(VALIDATOR_MODULE_3DENGINE, VALIDATOR_WARNING, "RenderViewport render context was not correctly restored by someone else."); } - if (gSettings.bEnableGameModeVR) - { - outputToHMD->Set(0); - } RestorePreviousContext(m_previousContext); m_bInRotateMode = false; m_bInMoveMode = false; diff --git a/Code/Sandbox/Editor/RenderViewport.h b/Code/Sandbox/Editor/RenderViewport.h index d70dd59b98..b45c92b1c8 100644 --- a/Code/Sandbox/Editor/RenderViewport.h +++ b/Code/Sandbox/Editor/RenderViewport.h @@ -200,6 +200,7 @@ public: { return {}; } + float DeviceScalingFactor() override { return 1.0f; } // AzToolsFramework::ViewportFreezeRequestBus bool IsViewportInputFrozen() override; diff --git a/Code/Sandbox/Editor/Style/Editor.qss b/Code/Sandbox/Editor/Style/Editor.qss index 0c3f64b85c..fa7d67dd43 100644 --- a/Code/Sandbox/Editor/Style/Editor.qss +++ b/Code/Sandbox/Editor/Style/Editor.qss @@ -38,6 +38,11 @@ AzToolsFramework--ComponentPaletteWidget > QTreeView background-color: #222222; } +AzToolsFramework--PropertyRowWidget[canBeReordered="true"] QLabel#Name +{ + font-weight: bold; +} + /* Style for visualizing property values overridden from their prefab values */ AzToolsFramework--PropertyRowWidget[IsOverridden=true] #Name QLabel, AzToolsFramework--ComponentEditorHeader #Title[IsOverridden="true"] diff --git a/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp b/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp index ae7077b4fc..35306b9535 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewAnimNode.cpp @@ -2012,9 +2012,9 @@ void CTrackViewAnimNode::SetPosRotScaleTracksDefaultValues(bool positionAllowed, } if (scaleAllowed) { - AZ::Vector3 scale = AZ::Vector3::CreateOne(); - AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldScale); - m_animNode->SetScale(time, AZVec3ToLYVec3(scale)); + float scale = 1.0f; + AZ::TransformBus::EventResult(scale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale); + m_animNode->SetScale(time, Vec3(scale, scale, scale)); } } } diff --git a/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp b/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp index f915c804f8..d26c8fd973 100644 --- a/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp +++ b/Code/Sandbox/Editor/TrackView/TrackViewSequence.cpp @@ -828,7 +828,7 @@ void CTrackViewSequence::SyncSelectedTracksToBase() const Vec3 scale = pAnimNode->GetScale(); AZ::Transform transform = AZ::Transform::CreateIdentity(); - transform.SetScale(LYVec3ToAZVec3(scale)); + transform.SetUniformScale(LYVec3ToAZVec3(scale).GetMaxElement()); transform.SetRotation(LYQuaternionToAZQuaternion(rotation)); transform.SetTranslation(LYVec3ToAZVec3(position)); @@ -870,7 +870,7 @@ void CTrackViewSequence::SyncSelectedTracksFromBase() pAnimNode->SetPos(AZVec3ToLYVec3(transform.GetTranslation())); pAnimNode->SetRotation(AZQuaternionToLYQuaternion(transform.GetRotation())); - pAnimNode->SetScale(AZVec3ToLYVec3(transform.GetScale())); + pAnimNode->SetScale(AZVec3ToLYVec3(AZ::Vector3(transform.GetUniformScale()))); bNothingWasSynced = false; } diff --git a/Code/Sandbox/Editor/editor_lib_files.cmake b/Code/Sandbox/Editor/editor_lib_files.cmake index 0646fb566e..e1cf18df55 100644 --- a/Code/Sandbox/Editor/editor_lib_files.cmake +++ b/Code/Sandbox/Editor/editor_lib_files.cmake @@ -823,9 +823,6 @@ set(FILES ViewportManipulatorController.h LegacyViewportCameraController.cpp LegacyViewportCameraController.h - ModernViewportCameraController.cpp - ModernViewportCameraController.h - ModernViewportCameraControllerRequestBus.h RenderViewport.cpp RenderViewport.h TopRendererWnd.cpp diff --git a/Code/Sandbox/Editor/res/o3de_editor.ico b/Code/Sandbox/Editor/res/o3de_editor.ico index 0680ceea19..e7b77c35bf 100644 --- a/Code/Sandbox/Editor/res/o3de_editor.ico +++ b/Code/Sandbox/Editor/res/o3de_editor.ico @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a -size 107016 +oid sha256:d717f77fe01f45df934a61bbc215e5322447d21e16f3cebcf2a02f148178f266 +size 106449 diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt index 72d88b06b4..53e04e1dee 100644 --- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt +++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/CMakeLists.txt @@ -35,9 +35,12 @@ ly_add_target( AZ::AzToolsFramework Legacy::CryCommon Legacy::EditorLib - Gem::LmbrCentral AZ::AtomCore Gem::Atom_RPI.Public + Gem::AtomToolsFramework.Static + Gem::LmbrCentral.Editor + RUNTIME_DEPENDENCIES + Gem::LmbrCentral.Editor ) ly_add_dependencies(Editor ComponentEntityEditorPlugin) @@ -67,7 +70,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzToolsFrameworkTestCommon Legacy::CryCommon Legacy::EditorLib - Gem::LmbrCentral + Gem::LmbrCentral.Editor + RUNTIME_DEPENDENCIES + Gem::LmbrCentral.Editor ) ly_add_googletest( NAME Legacy::ComponentEntityEditorPlugin.Tests diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp index 027487a435..5ff2debe3d 100644 --- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp +++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -65,8 +66,8 @@ #include #include +#include -#include #include "Objects/ComponentEntityObject.h" #include "ISourceControl.h" @@ -192,6 +193,9 @@ void SandboxIntegrationManager::Setup() (m_prefabIntegrationInterface != nullptr), "SandboxIntegrationManager requires a PrefabIntegrationInterface instance to be present on Setup()."); + m_editorEntityAPI = AZ::Interface::Get(); + AZ_Assert(m_editorEntityAPI, "SandboxIntegrationManager requires an EditorEntityAPI instance to be present on Setup()."); + AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusConnect(); } @@ -378,11 +382,6 @@ void SandboxIntegrationManager::Teardown() { AzToolsFramework::Layers::EditorLayerComponentNotificationBus::Handler::BusDisconnect(); AzFramework::DisplayContextRequestBus::Handler::BusDisconnect(); - if( m_debugDisplayBusImplementationActive) - { - AzFramework::DebugDisplayRequestBus::Handler::BusDisconnect(); - m_debugDisplayBusImplementationActive = false; - } AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect(); AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); @@ -1215,9 +1214,20 @@ void SandboxIntegrationManager::CloneSelection(bool& handled) if (!duplicationSet.empty()) { - AZStd::unordered_set clonedEntities; - handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities); - m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end()); + bool prefabSystemEnabled = false; + AzFramework::ApplicationRequests::Bus::BroadcastResult(prefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled); + + if (prefabSystemEnabled) + { + m_editorEntityAPI->DuplicateSelected(); + handled = true; + } + else + { + AZStd::unordered_set clonedEntities; + handled = AzToolsFramework::CloneInstantiatedEntities(duplicationSet, clonedEntities); + m_unsavedEntities.insert(clonedEntities.begin(), clonedEntities.end()); + } } else { @@ -1726,9 +1736,9 @@ void SandboxIntegrationManager::GoToEntitiesInViewports(const AzToolsFramework:: const AZ::Transform nextCameraTransform = AZ::Transform::CreateLookAt(aabb.GetCenter() - (forward * distanceToTarget), aabb.GetCenter()); - SandboxEditor::ModernViewportCameraControllerRequestBus::Event( - viewportContext->GetId(), &SandboxEditor::ModernViewportCameraControllerRequestBus::Events::InterpolateToTransform, - nextCameraTransform); + AtomToolsFramework::ModularViewportCameraControllerRequestBus::Event( + viewportContext->GetId(), + &AtomToolsFramework::ModularViewportCameraControllerRequestBus::Events::InterpolateToTransform, nextCameraTransform); } } } @@ -2026,678 +2036,6 @@ void SandboxIntegrationManager::BrowseForAssets(AssetSelectionModel& selection) AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, GetMainWindow()); } -void SandboxIntegrationManager::SetColor(float r, float g, float b, float a) -{ - if (m_dc) - { - m_dc->SetColor(Vec3(r, g, b), a); - } -} - -void SandboxIntegrationManager::SetColor(const AZ::Color& color) -{ - if (m_dc) - { - m_dc->SetColor(AZColorToLYColorF(color)); - } -} - -void SandboxIntegrationManager::SetColor(const AZ::Vector4& color) -{ - if (m_dc) - { - m_dc->SetColor(AZVec3ToLYVec3(color.GetAsVector3()), color.GetW()); - } -} - -void SandboxIntegrationManager::SetAlpha(float a) -{ - if (m_dc) - { - m_dc->SetAlpha(a); - } -} - -void SandboxIntegrationManager::DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) -{ - if (m_dc) - { - m_dc->DrawQuad( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2), - AZVec3ToLYVec3(p3), - AZVec3ToLYVec3(p4)); - } -} - -void SandboxIntegrationManager::DrawQuad(float width, float height) -{ - if (m_dc) - { - m_dc->DrawQuad(width, height); - } -} - -void SandboxIntegrationManager::DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) -{ - if (m_dc) - { - m_dc->DrawWireQuad( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2), - AZVec3ToLYVec3(p3), - AZVec3ToLYVec3(p4)); - } -} - -void SandboxIntegrationManager::DrawWireQuad(float width, float height) -{ - if (m_dc) - { - m_dc->DrawWireQuad(width, height); - } -} - -void SandboxIntegrationManager::DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) -{ - if (m_dc) - { - m_dc->DrawQuadGradient( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2), - AZVec3ToLYVec3(p3), - AZVec3ToLYVec3(p4), - ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()), - ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW())); - } -} - -void SandboxIntegrationManager::DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3) -{ - if (m_dc) - { - m_dc->DrawTri( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2), - AZVec3ToLYVec3(p3)); - } -} - -void SandboxIntegrationManager::DrawTriangles(const AZStd::vector& vertices, const AZ::Color& color) -{ - if (m_dc) - { - // transform to world space - const auto vecTransform = [this](const AZ::Vector3& vec) - { - return m_dc->GetMatrix() * AZVec3ToLYVec3(vec); - }; - - AZStd::vector cryVertices; - cryVertices.reserve(vertices.size()); - AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform); - m_dc->DrawTriangles( - cryVertices, - AZColorToLYColorF(color)); - } -} - -void SandboxIntegrationManager::DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const AZ::Color& color) -{ - if (m_dc) - { - // transform to world space - const auto vecTransform = [this](const AZ::Vector3& vec) - { - return m_dc->GetMatrix() * AZVec3ToLYVec3(vec); - }; - - AZStd::vector cryVertices; - cryVertices.reserve(vertices.size()); - AZStd::transform(vertices.begin(), vertices.end(), AZStd::back_inserter(cryVertices), vecTransform); - m_dc->DrawTrianglesIndexed( - cryVertices, - indices, - AZColorToLYColorF(color)); - } -} - -void SandboxIntegrationManager::DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) -{ - if (m_dc) - { - m_dc->DrawWireBox( - AZVec3ToLYVec3(min), - AZVec3ToLYVec3(max)); - } -} - -void SandboxIntegrationManager::DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) -{ - if (m_dc) - { - m_dc->DrawSolidBox( - AZVec3ToLYVec3(min), - AZVec3ToLYVec3(max)); - } -} - -void SandboxIntegrationManager::DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) -{ - if (m_dc) - { - m_dc->DrawSolidOBB(AZVec3ToLYVec3(center), AZVec3ToLYVec3(axisX), AZVec3ToLYVec3(axisY), AZVec3ToLYVec3(axisZ), AZVec3ToLYVec3(halfExtents)); - } -} - -void SandboxIntegrationManager::DrawPoint(const AZ::Vector3& p, int nSize) -{ - if (m_dc) - { - m_dc->DrawPoint(AZVec3ToLYVec3(p), nSize); - } -} - -void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) -{ - if (m_dc) - { - m_dc->DrawLine( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2)); - } -} - -void SandboxIntegrationManager::DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2) -{ - if (m_dc) - { - m_dc->DrawLine( - AZVec3ToLYVec3(p1), - AZVec3ToLYVec3(p2), - ColorF(AZVec3ToLYVec3(col1.GetAsVector3()), col1.GetW()), - ColorF(AZVec3ToLYVec3(col2.GetAsVector3()), col2.GetW())); - } -} - -void SandboxIntegrationManager::DrawLines(const AZStd::vector& lines, const AZ::Color& color) -{ - if (m_dc) - { - // transform to world space - const auto vecTransform = [this](const AZ::Vector3& vec) - { - return m_dc->GetMatrix() * AZVec3ToLYVec3(vec); - }; - - AZStd::vector cryLines; - cryLines.reserve(cryLines.size()); - AZStd::transform(lines.begin(), lines.end(), AZStd::back_inserter(cryLines), vecTransform); - m_dc->DrawLines(cryLines, AZColorToLYColorF(color)); - } -} - -void SandboxIntegrationManager::DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled) -{ - if (m_dc) - { - Vec3* points = new Vec3[numPoints]; - for (int i = 0; i < numPoints; ++i) - { - points[i] = AZVec3ToLYVec3(pnts[i]); - } - - m_dc->DrawPolyLine(points, numPoints, cycled); - - delete[] points; - } -} - -void SandboxIntegrationManager::DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) -{ - if (m_dc) - { - m_dc->DrawWireQuad2d( - QPoint(static_cast(p1.GetX()), static_cast(p1.GetY())), - QPoint(static_cast(p2.GetX()), static_cast(p2.GetY())), - z); - } -} - -void SandboxIntegrationManager::DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) -{ - if (m_dc) - { - m_dc->DrawLine2d( - QPoint(static_cast(p1.GetX()), static_cast(p1.GetY())), - QPoint(static_cast(p2.GetX()), static_cast(p2.GetY())), - z); - } -} - -void SandboxIntegrationManager::DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) -{ - if (m_dc) - { - m_dc->DrawLine2dGradient( - QPoint(static_cast(p1.GetX()), static_cast(p1.GetY())), - QPoint(static_cast(p2.GetX()), static_cast(p2.GetY())), - z, - ColorF(AZVec3ToLYVec3(firstColor.GetAsVector3()), firstColor.GetW()), - ColorF(AZVec3ToLYVec3(secondColor.GetAsVector3()), secondColor.GetW())); - } -} - -void SandboxIntegrationManager::DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) -{ - if (m_dc) - { - m_dc->DrawWireCircle2d( - QPoint(static_cast(center.GetX()), static_cast(center.GetY())), - radius, z); - } -} - -void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) -{ - if (m_dc) - { - m_dc->DrawTerrainCircle( - AZVec3ToLYVec3(worldPos), radius, height); - } -} - -void SandboxIntegrationManager::DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) -{ - if (m_dc) - { - m_dc->DrawTerrainCircle( - AZVec3ToLYVec3(center), radius, angle1, angle2, height); - } -} - -void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis) -{ - if (m_dc) - { - m_dc->DrawArc( - AZVec3ToLYVec3(pos), - radius, - startAngleDegrees, - sweepAngleDegrees, - angularStepDegrees, - referenceAxis); - } -} - -void SandboxIntegrationManager::DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) -{ - if (m_dc) - { - m_dc->DrawArc( - AZVec3ToLYVec3(pos), - radius, - startAngleDegrees, - sweepAngleDegrees, - angularStepDegrees, - AZVec3ToLYVec3(fixedAxis)); - } -} - -void SandboxIntegrationManager::DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis) -{ - if (m_dc) - { - m_dc->DrawCircle( - AZVec3ToLYVec3(pos), - radius, - nUnchangedAxis); - } -} - -void SandboxIntegrationManager::DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis) -{ - if (m_dc) - { - m_dc->DrawHalfDottedCircle( - AZVec3ToLYVec3(pos), - radius, - AZVec3ToLYVec3(viewPos), - nUnchangedAxis); - } -} - -void SandboxIntegrationManager::DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded) -{ - if (m_dc) - { - m_dc->DrawCone( - AZVec3ToLYVec3(pos), - AZVec3ToLYVec3(dir), - radius, - height, - drawShaded); - } -} - -void SandboxIntegrationManager::DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) -{ - if (m_dc) - { - m_dc->DrawWireCylinder( - AZVec3ToLYVec3(center), - AZVec3ToLYVec3(axis), - radius, - height); - } -} - -void SandboxIntegrationManager::DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded) -{ - if (m_dc) - { - m_dc->DrawSolidCylinder( - AZVec3ToLYVec3(center), - AZVec3ToLYVec3(axis), - radius, - height, - drawShaded); - } -} - -void SandboxIntegrationManager::DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) -{ - if (m_dc) - { - m_dc->DrawWireCapsule( - AZVec3ToLYVec3(center), - AZVec3ToLYVec3(axis), - radius, - height); - } -} - -void SandboxIntegrationManager::DrawTerrainRect(float x1, float y1, float x2, float y2, float height) -{ - if (m_dc) - { - m_dc->DrawTerrainRect(x1, y1, x2, y2, height); - } -} - -void SandboxIntegrationManager::DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) -{ - if (m_dc) - { - m_dc->DrawTerrainLine( - AZVec3ToLYVec3(worldPos1), - AZVec3ToLYVec3(worldPos2)); - } -} - -void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, float radius) -{ - if (m_dc) - { - m_dc->DrawWireSphere(AZVec3ToLYVec3(pos), radius); - } -} - -void SandboxIntegrationManager::DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) -{ - if (m_dc) - { - m_dc->DrawWireSphere( - AZVec3ToLYVec3(pos), - AZVec3ToLYVec3(radius)); - } -} - -void SandboxIntegrationManager::DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) -{ - if (m_dc) - { - m_dc->DrawWireDisk( - AZVec3ToLYVec3(pos), - AZVec3ToLYVec3(dir), - radius); - } -} - -void SandboxIntegrationManager::DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded) -{ - if (m_dc) - { - m_dc->DrawBall(AZVec3ToLYVec3(pos), radius, drawShaded); - } -} - -void SandboxIntegrationManager::DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) -{ - if (m_dc) - { - m_dc->DrawDisk( - AZVec3ToLYVec3(pos), - AZVec3ToLYVec3(dir), - radius); - } -} - -void SandboxIntegrationManager::DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow) -{ - if (m_dc) - { - m_dc->DrawArrow( - AZVec3ToLYVec3(src), - AZVec3ToLYVec3(trg), - fHeadScale, - b2SidedArrow); - } -} - -void SandboxIntegrationManager::DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int srcOffsetY) -{ - if (m_dc) - { - m_dc->DrawTextLabel( - AZVec3ToLYVec3(pos), - size, - text, - bCenter, - srcOffsetX, - srcOffsetY); - } -} - -void SandboxIntegrationManager::Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter) -{ - if (m_dc) - { - m_dc->Draw2dTextLabel(x, y, size, text, bCenter); - } -} - -void SandboxIntegrationManager::DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) -{ - if (m_dc) - { - if (texture) - { - float textureWidth = aznumeric_caster(texture->GetWidth()); - float textureHeight = aznumeric_caster(texture->GetHeight()); - - // resize the label in proportion to the actual texture size - if (textureWidth > textureHeight) - { - sizeY = sizeX * (textureHeight / textureWidth); - } - else - { - sizeX = sizeY * (textureWidth / textureHeight); - } - - m_dc->DrawTextureLabel(AZVec3ToLYVec3(pos), sizeX, sizeY, texture->GetTextureID(), texIconFlags); - } - } -} - -void SandboxIntegrationManager::DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) -{ - // ToDo: With Atom? - AZ_UNUSED(textureId); - AZ_UNUSED(pos); - AZ_UNUSED(sizeX); - AZ_UNUSED(sizeY); - AZ_UNUSED(texIconFlags); -} - -void SandboxIntegrationManager::SetLineWidth(float width) -{ - if (m_dc) - { - m_dc->SetLineWidth(width); - } -} - -bool SandboxIntegrationManager::IsVisible(const AZ::Aabb& bounds) -{ - if (m_dc) - { - const AABB aabb( - AZVec3ToLYVec3(bounds.GetMin()), - AZVec3ToLYVec3(bounds.GetMax())); - - return m_dc->IsVisible(aabb); - } - - return 0; -} - -int SandboxIntegrationManager::SetFillMode(int nFillMode) -{ - if (m_dc) - { - return m_dc->SetFillMode(nFillMode); - } - - return 0; -} - -float SandboxIntegrationManager::GetLineWidth() -{ - if (m_dc) - { - return m_dc->GetLineWidth(); - } - - return 0.f; -} - -float SandboxIntegrationManager::GetAspectRatio() -{ - if (m_dc && m_dc->GetView()) - { - return m_dc->GetView()->GetAspectRatio(); - } - - return 0.f; -} - -void SandboxIntegrationManager::DepthTestOff() -{ - if (m_dc) - { - m_dc->DepthTestOff(); - } -} - -void SandboxIntegrationManager::DepthTestOn() -{ - if (m_dc) - { - m_dc->DepthTestOn(); - } -} - -void SandboxIntegrationManager::DepthWriteOff() -{ - if (m_dc) - { - m_dc->DepthWriteOff(); - } -} - -void SandboxIntegrationManager::DepthWriteOn() -{ - if (m_dc) - { - m_dc->DepthWriteOn(); - } -} - -void SandboxIntegrationManager::CullOff() -{ - if (m_dc) - { - m_dc->CullOff(); - } -} - -void SandboxIntegrationManager::CullOn() -{ - if (m_dc) - { - m_dc->CullOn(); - } -} - -bool SandboxIntegrationManager::SetDrawInFrontMode(bool bOn) -{ - if (m_dc) - { - return m_dc->SetDrawInFrontMode(bOn); - } - - return 0.f; -} - -AZ::u32 SandboxIntegrationManager::GetState() -{ - if (m_dc) - { - return m_dc->GetState(); - } - - return 0; -} - -AZ::u32 SandboxIntegrationManager::SetState(AZ::u32 state) -{ - if (m_dc) - { - return m_dc->SetState(state); - } - - return 0; -} - -void SandboxIntegrationManager::PushMatrix(const AZ::Transform& tm) -{ - if (m_dc) - { - const Matrix34 m = AZTransformToLYTransform(tm); - m_dc->PushMatrix(m); - } -} - -void SandboxIntegrationManager::PopMatrix() -{ - if (m_dc) - { - m_dc->PopMatrix(); - } -} - bool SandboxIntegrationManager::DisplayHelpersVisible() { return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers(); diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h index 14f52591a4..6d714b67df 100644 --- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h +++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h @@ -77,6 +77,7 @@ class CHyperGraph; namespace AzToolsFramework { + class EditorEntityAPI; class EditorEntityUiInterface; namespace AssetBrowser @@ -99,7 +100,6 @@ class SandboxIntegrationManager , private AzToolsFramework::EditorEvents::Bus::Handler , private AzToolsFramework::EditorWindowRequests::Bus::Handler , private AzFramework::AssetCatalogEventBus::Handler - , private AzFramework::DebugDisplayRequestBus::Handler , private AzFramework::DisplayContextRequestBus::Handler , private AzToolsFramework::EditorEntityContextNotificationBus::Handler , private AzToolsFramework::SliceEditorEntityOwnershipServiceNotificationBus::Handler @@ -201,70 +201,6 @@ private: const AzFramework::SliceInstantiationTicket& ticket) override; ////////////////////////////////////////////////////////////////////////// - // AzToolsFramework::DebugDisplayRequestBus - void SetColor(float r, float g, float b, float a) override; - void SetColor(const AZ::Color& color) override; - void SetColor(const AZ::Vector4& color) override; - void SetAlpha(float a) override; - void DrawQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override; - void DrawQuad(float width, float height) override; - void DrawWireQuad(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4) override; - void DrawWireQuad(float width, float height) override; - void DrawQuadGradient(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3, const AZ::Vector3& p4, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override; - void DrawTri(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector3& p3) override; - void DrawTriangles(const AZStd::vector& vertices, const AZ::Color& color) override; - void DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const AZ::Color& color) override; - void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) override; - void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) override; - void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) override; - void DrawPoint(const AZ::Vector3& p, int nSize) override; - void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) override; - void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2, const AZ::Vector4& col1, const AZ::Vector4& col2) override; - void DrawLines(const AZStd::vector& lines, const AZ::Color& color) override; - void DrawPolyLine(const AZ::Vector3* pnts, int numPoints, bool cycled) override; - void DrawWireQuad2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override; - void DrawLine2d(const AZ::Vector2& p1, const AZ::Vector2& p2, float z) override; - void DrawLine2dGradient(const AZ::Vector2& p1, const AZ::Vector2& p2, float z, const AZ::Vector4& firstColor, const AZ::Vector4& secondColor) override; - void DrawWireCircle2d(const AZ::Vector2& center, float radius, float z) override; - void DrawTerrainCircle(const AZ::Vector3& worldPos, float radius, float height) override; - void DrawTerrainCircle(const AZ::Vector3& center, float radius, float angle1, float angle2, float height) override; - void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, int referenceAxis) override; - void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) override; - void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded = true) override; - void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis) override; - void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis) override; - void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override; - void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded = true) override; - void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override; - void DrawTerrainRect(float x1, float y1, float x2, float y2, float height) override; - void DrawTerrainLine(AZ::Vector3 worldPos1, AZ::Vector3 worldPos2) override; - void DrawWireSphere(const AZ::Vector3& pos, float radius) override; - void DrawWireSphere(const AZ::Vector3& pos, const AZ::Vector3 radius) override; - void DrawWireDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override; - void DrawBall(const AZ::Vector3& pos, float radius, bool drawShaded = true) override; - void DrawDisk(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius) override; - void DrawArrow(const AZ::Vector3& src, const AZ::Vector3& trg, float fHeadScale, bool b2SidedArrow) override; - void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter, int srcOffsetX, int scrOffsetY) override; - void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter) override; - void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; - void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; - void SetLineWidth(float width) override; - bool IsVisible(const AZ::Aabb& bounds) override; - int SetFillMode(int nFillMode) override; - float GetLineWidth() override; - float GetAspectRatio() override; - void DepthTestOff() override; - void DepthTestOn() override; - void DepthWriteOff() override; - void DepthWriteOn() override; - void CullOff() override; - void CullOn() override; - bool SetDrawInFrontMode(bool bOn) override; - AZ::u32 GetState() override; - AZ::u32 SetState(AZ::u32 state) override; - void PushMatrix(const AZ::Transform& tm) override; - void PopMatrix() override; - // AzFramework::DisplayContextRequestBus (and @deprecated EntityDebugDisplayRequestBus) // AzFramework::DisplayContextRequestBus void SetDC(DisplayContext* dc) override; @@ -371,6 +307,7 @@ private: AzToolsFramework::EditorEntityUiInterface* m_editorEntityUiInterface = nullptr; AzToolsFramework::Prefab::PrefabIntegrationInterface* m_prefabIntegrationInterface = nullptr; + AzToolsFramework::EditorEntityAPI* m_editorEntityAPI = nullptr; // Overrides UI styling and behavior for Layer Entities AzToolsFramework::LayerUiHandler m_layerUiOverrideHandler; diff --git a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp index ac9b92adce..11c279c7f7 100644 --- a/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp +++ b/Code/Sandbox/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp @@ -65,6 +65,7 @@ #include "OutlinerTreeView.hxx" #include "Include/ICommandManager.h" #include "Include/IObjectManager.h" +#include "OutlinerCacheBus.h" #include #include @@ -1538,6 +1539,16 @@ void OutlinerListModel::OnEntityInfoUpdatedName(AZ::EntityId entityId, const AZS { (void)name; QueueEntityUpdate(entityId); + + bool isSelected = false; + AzToolsFramework::ToolsApplicationRequests::Bus::BroadcastResult( + isSelected, &AzToolsFramework::ToolsApplicationRequests::IsSelected, entityId); + + if (isSelected) + { + // Ask the system to scroll to the entity in case it is off screen after the rename + OutlinerModelNotificationBus::Broadcast(&OutlinerModelNotifications::QueueScrollToNewContent, entityId); + } } void OutlinerListModel::OnEntityInfoUpdatedUnsavedChanges(AZ::EntityId entityId) diff --git a/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp b/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp index c04f81f50c..ba705295ae 100644 --- a/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp +++ b/Code/Sandbox/Plugins/EditorAssetImporter/AssetImporterPlugin.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,10 @@ AssetImporterPlugin::AssetImporterPlugin(IEditor* editor) opt.showInMenu = false; // this view pane is used to display scene settings, but the user never opens it directly through the Tools menu opt.saveKeyName = "Scene Settings (PREVIEW)"; // user settings for this pane were originally saved with PREVIEW, so ensure that's how they are loaded as well, even after the PREVIEW is removed from the name AzToolsFramework::RegisterViewPane(m_toolName.c_str(), LyViewPane::CategoryTools, opt); + + AzToolsFramework::ToolsApplicationRequestBus::Broadcast( + &AzToolsFramework::ToolsApplicationRequests::CreateAndAddEntityFromComponentTags, + AZStd::vector({ AZ::SceneAPI::Events::AssetImportRequest::GetAssetImportRequestComponentTag() }), "AssetImportersEntity"); } void AssetImporterPlugin::Release() diff --git a/Code/Tools/AssetBundler/tests/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetBundler/tests/AssetProcessorPlatformConfig.setreg index 81fcdbcf12..ac546d4f39 100644 --- a/Code/Tools/AssetBundler/tests/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetBundler/tests/AssetProcessorPlatformConfig.setreg @@ -3,7 +3,7 @@ "AssetProcessor": { "Settings": { "Platforms": { - "es3": "enabled" + "android": "enabled" } } } diff --git a/Code/Tools/AssetBundler/tests/applicationManagerTests.cpp b/Code/Tools/AssetBundler/tests/applicationManagerTests.cpp index 4156a6790d..be6cf61c29 100644 --- a/Code/Tools/AssetBundler/tests/applicationManagerTests.cpp +++ b/Code/Tools/AssetBundler/tests/applicationManagerTests.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -57,6 +58,22 @@ namespace AssetBundler UnitTest::ScopedAllocatorSetupFixture::SetUp(); m_data = AZStd::make_unique(); + AZ::SettingsRegistryInterface* registry = nullptr; + if (!AZ::SettingsRegistry::Get()) + { + AZ::SettingsRegistry::Register(&m_registry); + registry = &m_registry; + } + else + { + registry = AZ::SettingsRegistry::Get(); + } + auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + + m_data->m_applicationManager.reset(aznew MockApplicationManagerTest(0, 0)); m_data->m_applicationManager->Start(AzFramework::Application::Descriptor()); @@ -84,6 +101,12 @@ namespace AssetBundler delete m_data->m_localFileIO; AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO); + auto settingsRegistry = AZ::SettingsRegistry::Get(); + if(settingsRegistry == &m_registry) + { + AZ::SettingsRegistry::Unregister(settingsRegistry); + } + m_data->m_applicationManager->Stop(); m_data->m_applicationManager.reset(); m_data.reset(); @@ -99,6 +122,7 @@ namespace AssetBundler }; AZStd::unique_ptr m_data; + AZ::SettingsRegistryImpl m_registry; }; TEST_F(ApplicationManagerTest, ValidatePlatformFlags_ReadConfigFiles_OK) @@ -126,7 +150,7 @@ namespace AssetBundler AzFramework::PlatformFlags platformFlags = GetEnabledPlatformFlags(m_data->m_testEngineRoot.c_str(), m_data->m_testEngineRoot.c_str(), DummyProjectName); AzFramework::PlatformFlags hostPlatformFlag = AzFramework::PlatformHelper::GetPlatformFlag(AzToolsFramework::AssetSystem::GetHostAssetPlatform()); - AzFramework::PlatformFlags expectedFlags = AzFramework::PlatformFlags::Platform_ES3 | AzFramework::PlatformFlags::Platform_IOS | AzFramework::PlatformFlags::Platform_PROVO | hostPlatformFlag; + AzFramework::PlatformFlags expectedFlags = AzFramework::PlatformFlags::Platform_ANDROID | AzFramework::PlatformFlags::Platform_IOS | AzFramework::PlatformFlags::Platform_PROVO | hostPlatformFlag; ASSERT_EQ(platformFlags, expectedFlags); } diff --git a/Code/Tools/AssetBundler/tests/tests_main.cpp b/Code/Tools/AssetBundler/tests/tests_main.cpp index 9e12623b0d..71046a576a 100644 --- a/Code/Tools/AssetBundler/tests/tests_main.cpp +++ b/Code/Tools/AssetBundler/tests/tests_main.cpp @@ -40,14 +40,14 @@ namespace AssetBundler TEST_F(AssetBundlerBatchUtilsTest, SplitFilename_MacFile_OutputBaseNameAndPlatform) { - AZStd::string filePath = "assetInfoFile_osx_gl.xml"; + AZStd::string filePath = "assetInfoFile_mac.xml"; AZStd::string baseFilename; AZStd::string platformIdentifier; AzToolsFramework::SplitFilename(filePath, baseFilename, platformIdentifier); ASSERT_EQ(baseFilename, "assetInfoFile"); - ASSERT_EQ(platformIdentifier, "osx_gl"); + ASSERT_EQ(platformIdentifier, "mac"); } TEST_F(AssetBundlerBatchUtilsTest, SplitFilename_PcFile_OutputBaseNameAndPlatform) @@ -64,14 +64,14 @@ namespace AssetBundler TEST_F(AssetBundlerBatchUtilsTest, SplitFilename_MacFileWithUnderScoreInFileName_OutputBaseNameAndPlatform) { - AZStd::string filePath = "assetInfoFile_test_osx_gl.xml"; + AZStd::string filePath = "assetInfoFile_test_mac.xml"; AZStd::string baseFilename; AZStd::string platformIdentifier; AzToolsFramework::SplitFilename(filePath, baseFilename, platformIdentifier); ASSERT_EQ(baseFilename, "assetInfoFile_test"); - ASSERT_EQ(platformIdentifier, "osx_gl"); + ASSERT_EQ(platformIdentifier, "mac"); } TEST_F(AssetBundlerBatchUtilsTest, SplitFilename_PcFileWithUnderScoreInFileName_OutputBaseNameAndPlatform) @@ -97,7 +97,28 @@ namespace AssetBundler { public: void SetUp() override - { + { + AZ::SettingsRegistryInterface* registry = nullptr; + if (!AZ::SettingsRegistry::Get()) + { + AZ::SettingsRegistry::Register(&m_registry); + registry = &m_registry; + } + else + { + registry = AZ::SettingsRegistry::Get(); + } + auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + + AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath(); + if (engineRoot.empty()) + { + GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to locate engine root.\n").c_str()); + } + m_data = AZStd::make_unique(); m_data->m_application.reset(aznew AzToolsFramework::ToolsApplication()); m_data->m_application.get()->Start(AzFramework::Application::Descriptor()); @@ -107,19 +128,6 @@ namespace AssetBundler // in the unit tests. AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize); - if (!AZ::SettingsRegistry::Get()) - { - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(m_registry); - AZ::SettingsRegistry::Register(&m_registry); - } - - AZ::IO::FixedMaxPath engineRoot = AZ::Utils::GetEnginePath(); - if (engineRoot.empty()) - { - GTEST_FATAL_FAILURE_(AZStd::string::format("Unable to locate engine root.\n").c_str()); - } - - m_data->m_testEngineRoot = (engineRoot / RelativeTestFolder).LexicallyNormal().String(); m_data->m_localFileIO = aznew AZ::IO::LocalFileIO(); @@ -144,14 +152,24 @@ namespace AssetBundler } void TearDown() override { - AZ::IO::FileIOBase::SetInstance(nullptr); - delete m_data->m_localFileIO; - AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO); + if (m_data) + { + AZ::IO::FileIOBase::SetInstance(nullptr); + delete m_data->m_localFileIO; + AZ::IO::FileIOBase::SetInstance(m_data->m_priorFileIO); + + m_data->m_gemInfoList.set_capacity(0); + m_data->m_gemSeedFilePairList.set_capacity(0); + m_data->m_application.get()->Stop(); + m_data->m_application.reset(); + } + + if(auto settingsRegistry = AZ::SettingsRegistry::Get(); + settingsRegistry == &m_registry) + { + AZ::SettingsRegistry::Unregister(settingsRegistry); + } - m_data->m_gemInfoList.set_capacity(0); - m_data->m_gemSeedFilePairList.set_capacity(0); - m_data->m_application.get()->Stop(); - m_data->m_application.reset(); } void AddGemData(const char* engineRoot, const char* gemName, bool seedFileExists = true) diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp index c477ec2c9e..4f8b4b9144 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.cpp @@ -78,17 +78,17 @@ namespace AssetBuilderSDK { return AssetBuilderSDK::Platform_PC; } - if (azstricmp(newPlatformName, "es3") == 0) + if (azstricmp(newPlatformName, "android") == 0) { - return AssetBuilderSDK::Platform_ES3; + return AssetBuilderSDK::Platform_ANDROID; } if (azstricmp(newPlatformName, "ios") == 0) { return AssetBuilderSDK::Platform_IOS; } - if (azstricmp(newPlatformName, "osx_gl") == 0) + if (azstricmp(newPlatformName, "mac") == 0) { - return AssetBuilderSDK::Platform_OSX; + return AssetBuilderSDK::Platform_MAC; } if (azstricmp(newPlatformName, "provo") == 0) { @@ -115,12 +115,12 @@ namespace AssetBuilderSDK { case AssetBuilderSDK::Platform_PC: return "pc"; - case AssetBuilderSDK::Platform_ES3: - return "es3"; + case AssetBuilderSDK::Platform_ANDROID: + return "android"; case AssetBuilderSDK::Platform_IOS: return "ios"; - case AssetBuilderSDK::Platform_OSX: - return "osx_gl"; + case AssetBuilderSDK::Platform_MAC: + return "mac"; case AssetBuilderSDK::Platform_PROVO: return "provo"; case AssetBuilderSDK::Platform_SALEM: diff --git a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h index a11cc9a80d..126ecda2ba 100644 --- a/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h +++ b/Code/Tools/AssetProcessor/AssetBuilderSDK/AssetBuilderSDK/AssetBuilderSDK.h @@ -148,15 +148,15 @@ namespace AssetBuilderSDK { Platform_NONE = 0x00, Platform_PC = 0x01, - Platform_ES3 = 0x02, + Platform_ANDROID = 0x02, Platform_IOS = 0x04, - Platform_OSX = 0x08, + Platform_MAC = 0x08, Platform_PROVO = 0x20, Platform_SALEM = 0x40, Platform_JASPER = 0x80, //! if you add a new platform entry to this enum, you must add it to allplatforms as well otherwise that platform would not be considered valid. - AllPlatforms = Platform_PC | Platform_ES3 | Platform_IOS | Platform_OSX | Platform_PROVO | Platform_SALEM | Platform_JASPER + AllPlatforms = Platform_PC | Platform_ANDROID | Platform_IOS | Platform_MAC | Platform_PROVO | Platform_SALEM | Platform_JASPER }; #endif // defined(ENABLE_LEGACY_PLATFORMFLAGS_SUPPORT) //! Map data structure to holder parameters that are passed into a job for ProcessJob requests. @@ -503,7 +503,7 @@ namespace AssetBuilderSDK AZ_CLASS_ALLOCATOR(PlatformInfo, AZ::SystemAllocator, 0); AZ_TYPE_INFO(PlatformInfo, "{F7DA39A5-C319-4552-954B-3479E2454D3F}"); - AZStd::string m_identifier; ///< like "pc" or "es3" or "ios"... + AZStd::string m_identifier; ///< like "pc" or "android" or "ios"... AZStd::unordered_set m_tags; ///< The tags like "console" or "tools" on that platform PlatformInfo() = default; diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp index 196f6b0543..8bc6d0b6f7 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.cpp @@ -655,6 +655,80 @@ namespace AssetProcessor return true; } + bool AssetCatalog::GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& rootFolder) + { + QString normalizedSourcePath = AssetUtilities::NormalizeFilePath(sourcePath.c_str()); + QDir inputPath(normalizedSourcePath); + QString scanFolder; + QString relativeName; + + bool validResult = false; + + AZ_TracePrintf(AssetProcessor::DebugChannel, "ProcessGenerateRelativeSourcePathRequest: %s...\n", sourcePath.c_str()); + + if (sourcePath.empty()) + { + // For an empty input path, do nothing, we'll return an empty, invalid result. + // (We check fullPath instead of inputPath, because an empty fullPath actually produces "." for inputPath) + } + else if (inputPath.isAbsolute()) + { + // For an absolute path, try to convert it to a relative path, based on the existing scan folders. + // To get the inputPath, we use absolutePath() instead of path() so that any . or .. entries get collapsed. + validResult = m_platformConfig->ConvertToRelativePath(inputPath.absolutePath(), relativeName, scanFolder); + } + else if (inputPath.isRelative()) + { + // For a relative path, concatenate it with each scan folder, and see if a valid relative path emerges. + int scanFolders = m_platformConfig->GetScanFolderCount(); + for (int scanIdx = 0; scanIdx < scanFolders; scanIdx++) + { + auto& scanInfo = m_platformConfig->GetScanFolderAt(scanIdx); + QDir possibleRoot(scanInfo.ScanPath()); + QDir possibleAbsolutePath = possibleRoot.filePath(normalizedSourcePath); + // To get the inputPath, we use absolutePath() instead of path() so that any . or .. entries get collapsed. + if (m_platformConfig->ConvertToRelativePath(possibleAbsolutePath.absolutePath(), relativeName, scanFolder)) + { + validResult = true; + break; + } + } + } + + // The input has produced a valid relative path. However, the path might match multiple nested scan folders, + // so look to see if a higher-priority folder has a better match. + if (validResult) + { + QString overridingFile = m_platformConfig->GetOverridingFile(relativeName, scanFolder); + + if (!overridingFile.isEmpty()) + { + overridingFile = AssetUtilities::NormalizeFilePath(overridingFile); + validResult = m_platformConfig->ConvertToRelativePath(overridingFile, relativeName, scanFolder); + } + } + + if (!validResult) + { + // if we are here it means we have failed to determine the relativePath, so we will send back the original path + AZ_TracePrintf(AssetProcessor::DebugChannel, + "GenerateRelativeSourcePath found no valid result, returning original path: %s...\n", sourcePath.c_str()); + + rootFolder.clear(); + relativePath.clear(); + relativePath = sourcePath; + return false; + } + + relativePath = relativeName.toUtf8().data(); + rootFolder = scanFolder.toUtf8().data(); + + AZ_Assert(!relativePath.empty(), "ConvertToRelativePath returned true, but relativePath is empty"); + + return true; + } + bool AssetCatalog::GetFullSourcePathFromRelativeProductPath(const AZStd::string& relPath, AZStd::string& fullSourcePath) { ProcessGetFullSourcePathFromRelativeProductPathRequest(relPath, fullSourcePath); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.h b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.h index f515fa3658..13dc7892b1 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.h +++ b/Code/Tools/AssetProcessor/native/AssetManager/AssetCatalog.h @@ -95,6 +95,12 @@ namespace AssetProcessor const char* GetAbsoluteDevGameFolderPath() override; const char* GetAbsoluteDevRootFolderPath() override; bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& relativeProductPath) override; + + //! Given a partial or full source file path, respond with its relative path and the watch folder it is relative to. + //! The input source path does not need to exist, so this can be used for new files that haven't been saved yet. + bool GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& watchFolder) override; + bool GetFullSourcePathFromRelativeProductPath(const AZStd::string& relPath, AZStd::string& fullSourcePath) override; bool GetAssetInfoById(const AZ::Data::AssetId& assetId, const AZ::Data::AssetType& assetType, const AZStd::string& platformName, AZ::Data::AssetInfo& assetInfo, AZStd::string& rootFilePath) override; bool GetSourceInfoBySourcePath(const char* sourcePath, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder) override; diff --git a/Code/Tools/AssetProcessor/native/AssetManager/AssetRequestHandler.cpp b/Code/Tools/AssetProcessor/native/AssetManager/AssetRequestHandler.cpp index 97b28691dc..2d22d3d136 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/AssetRequestHandler.cpp +++ b/Code/Tools/AssetProcessor/native/AssetManager/AssetRequestHandler.cpp @@ -104,6 +104,27 @@ namespace return GetRelativeProductPathFromFullSourceOrProductPathResponse(relPathFound, relProductPath); } + GenerateRelativeSourcePathResponse HandleGenerateRelativeSourcePathRequest( + MessageData messageData) + { + bool relPathFound = false; + AZStd::string relPath; + AZStd::string watchFolder; + + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + relPathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GenerateRelativeSourcePath, + messageData.m_message->m_sourcePath, relPath, watchFolder); + + if (!relPathFound) + { + AZ_TracePrintf( + AssetProcessor::ConsoleChannel, "Could not find relative source path for the source file (%s).", + messageData.m_message->m_sourcePath.c_str()); + } + + return GenerateRelativeSourcePathResponse(relPathFound, relPath, watchFolder); + } + SourceAssetInfoResponse HandleSourceAssetInfoRequest(MessageData messageData) { SourceAssetInfoResponse response; @@ -407,6 +428,7 @@ AssetRequestHandler::AssetRequestHandler() m_requestRouter.RegisterMessageHandler(&HandleGetFullSourcePathFromRelativeProductPathRequest); m_requestRouter.RegisterMessageHandler(&HandleGetRelativeProductPathFromFullSourceOrProductPathRequest); + m_requestRouter.RegisterMessageHandler(&HandleGenerateRelativeSourcePathRequest); m_requestRouter.RegisterMessageHandler(&HandleSourceAssetInfoRequest); m_requestRouter.RegisterMessageHandler(&HandleSourceAssetProductsInfoRequest); m_requestRouter.RegisterMessageHandler(&HandleGetScanFoldersRequest); diff --git a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h index 88f74c886b..3dc8bd7a00 100644 --- a/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h +++ b/Code/Tools/AssetProcessor/native/AssetManager/assetProcessorManager.h @@ -57,6 +57,9 @@ namespace AzFramework class GetRelativeProductPathFromFullSourceOrProductPathRequest; class GetRelativeProductPathFromFullSourceOrProductPathResponse; + class GenerateRelativeSourcePathRequest; + class GenerateRelativeSourcePathResponse; + class GetFullSourcePathFromRelativeProductPathRequest; class GetFullSourcePathFromRelativeProductPathResponse; class AssetNotificationMessage; @@ -104,6 +107,8 @@ namespace AssetProcessor using GetAbsoluteAssetDatabaseLocationResponse = AzToolsFramework::AssetSystem::GetAbsoluteAssetDatabaseLocationResponse; using GetRelativeProductPathFromFullSourceOrProductPathRequest = AzFramework::AssetSystem::GetRelativeProductPathFromFullSourceOrProductPathRequest; using GetRelativeProductPathFromFullSourceOrProductPathResponse = AzFramework::AssetSystem::GetRelativeProductPathFromFullSourceOrProductPathResponse; + using GenerateRelativeSourcePathRequest = AzFramework::AssetSystem::GenerateRelativeSourcePathRequest; + using GenerateRelativeSourcePathResponse = AzFramework::AssetSystem::GenerateRelativeSourcePathResponse; using GetFullSourcePathFromRelativeProductPathRequest = AzFramework::AssetSystem::GetFullSourcePathFromRelativeProductPathRequest; using GetFullSourcePathFromRelativeProductPathResponse = AzFramework::AssetSystem::GetFullSourcePathFromRelativeProductPathResponse; diff --git a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp index 523e39d622..3d7cc3b8b4 100644 --- a/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp +++ b/Code/Tools/AssetProcessor/native/InternalBuilders/SettingsRegistryBuilder.cpp @@ -291,7 +291,6 @@ namespace AssetProcessor } } - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(registry); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_EngineRegistry(registry, platform, specialization, &scratchBuffer); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_GemRegistries(registry, platform, specialization, &scratchBuffer); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_ProjectRegistry(registry, platform, specialization, &scratchBuffer); diff --git a/Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp b/Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp index e92e9afba5..303f0ad0e8 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetCatalog/AssetCatalogUnitTests.cpp @@ -130,6 +130,9 @@ namespace AssetProcessor auto cacheRootKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_cache_path"; settingsRegistry->Set(cacheRootKey, m_data->m_temporarySourceDir.absoluteFilePath("Cache").toUtf8().constData()); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + settingsRegistry->Set(projectPathKey, "AutomatedTesting"); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry); AssetUtilities::ComputeProjectCacheRoot(m_data->m_cacheRootDir); QString normalizedCacheRoot = AssetUtilities::NormalizeDirectoryPath(m_data->m_cacheRootDir.absolutePath()); @@ -221,20 +224,28 @@ namespace AssetProcessor dbConn->SetScanFolder(newScanFolder); } - // build some default configs. - void BuildConfig(const QDir& tempPath, AssetDatabaseConnection* dbConn, PlatformConfiguration& config) + virtual void AddScanFolders( + const QDir& tempPath, AssetDatabaseConnection* dbConn, PlatformConfiguration& config, + const AZStd::vector& platforms) { - config.EnablePlatform({ "pc" ,{ "desktop", "renderer" } }, true); - config.EnablePlatform({ "es3" ,{ "mobile", "renderer" } }, true); - config.EnablePlatform({ "fandango" ,{ "console", "renderer" } }, false); - AZStd::vector platforms; - config.PopulatePlatformsForScanFolder(platforms); // PATH DisplayName PortKey root recurse platforms order AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder4"), "subfolder4", "subfolder4", false, false, platforms, -6), config, dbConn); // subfolder 4 overrides subfolder3 AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder3"), "subfolder3", "subfolder3", false, false, platforms, -5), config, dbConn); // subfolder 3 overrides subfolder2 AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder2"), "subfolder2", "subfolder2", false, true, platforms, -2), config, dbConn); // subfolder 2 overrides subfolder1 AddScanFolder(ScanFolderInfo(tempPath.filePath("subfolder1"), "subfolder1", "subfolder1", false, true, platforms, -1), config, dbConn); // subfolder1 overrides root AddScanFolder(ScanFolderInfo(tempPath.absolutePath(), "temp", "tempfolder", true, false, platforms, 0), config, dbConn); // add the root + } + + // build some default configs. + void BuildConfig(const QDir& tempPath, AssetDatabaseConnection* dbConn, PlatformConfiguration& config) + { + config.EnablePlatform({ "pc" ,{ "desktop", "renderer" } }, true); + config.EnablePlatform({ "android" ,{ "mobile", "renderer" } }, true); + config.EnablePlatform({ "fandango" ,{ "console", "renderer" } }, false); + AZStd::vector platforms; + config.PopulatePlatformsForScanFolder(platforms); + + AddScanFolders(tempPath, dbConn, config, platforms); config.AddMetaDataType("exportsettings", QString()); @@ -243,22 +254,22 @@ namespace AssetProcessor AssetRecognizer rec; AssetPlatformSpec specpc; - AssetPlatformSpec speces3; + AssetPlatformSpec specandroid; - speces3.m_extraRCParams = "somerandomparam"; + specandroid.m_extraRCParams = "somerandomparam"; rec.m_name = "random files"; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.random", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); config.AddRecognizer(rec); specpc.m_extraRCParams = ""; // blank must work - speces3.m_extraRCParams = "testextraparams"; + specandroid.m_extraRCParams = "testextraparams"; const char* builderTxt1Name = "txt files"; rec.m_name = builderTxt1Name; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); - rec.m_platformSpecs.insert("es3", speces3); + rec.m_platformSpecs.insert("android", specandroid); config.AddRecognizer(rec); @@ -269,7 +280,7 @@ namespace AssetProcessor ignore_rec.m_name = "ignore files"; ignore_rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.ignore", AssetBuilderSDK::AssetBuilderPattern::Wildcard); ignore_rec.m_platformSpecs.insert("pc", specpc); - ignore_rec.m_platformSpecs.insert("es3", ignore_spec); + ignore_rec.m_platformSpecs.insert("android", ignore_spec); config.AddRecognizer(ignore_rec); ExcludeAssetRecognizer excludeRecogniser; @@ -356,7 +367,8 @@ namespace AssetProcessor return false; } - // Calls the GetFullSourcePathFromRelativeProductPath function and checks the return results, returning true if it matches both of the expected results + // Calls the GetFullSourcePathFromRelativeProductPath function and checks the return results, returning true if it matches both of + // the expected results bool TestGetFullSourcePath(const QString& fileToCheck, const QDir& tempPath, bool expectToFind, const char* expectedPath) { bool fullPathfound = false; @@ -528,6 +540,177 @@ namespace AssetProcessor ASSERT_TRUE(TestGetRelativeProductPath(fileToCheck, true, { "aaa/basefile.txt" })); } + class AssetCatalogTestRelativeSourcePath : public AssetCatalogTest + { + public: + QDir GetRoot() + { + // Return an OS-friendly absolute root directory for our tests ("C:/sourceRoot" or "/sourceRoot"). It doesn't + // need to exist, it just needs to be an absolute path. + return QDir::root().filePath("sourceRoot"); + } + + // Set up custom scan folders for the "relative source path" tests, so that we can try out specific combinations of watch folders + void AddScanFolders( + [[maybe_unused]] const QDir& tempPath, AssetDatabaseConnection* dbConn, PlatformConfiguration& config, + const AZStd::vector& platforms) override + { + QDir root = GetRoot(); + + // This will set up the following watch folders, in highest to lowest priority: + + // /sourceRoot/recurseNested/nested (recurse) + // /sourceRoot/noRecurse (no recurse) + // /sourceRoot/recurseNotNested (recurse) + // /sourceRoot/recurseNested (recurse) + + AddScanFolder( + ScanFolderInfo(root.filePath("recurseNested/nested"), "nested", "nested", false, true, platforms, -4), config, dbConn); + AddScanFolder( + ScanFolderInfo(root.filePath("noRecurse"), "noRecurse", "noRecurse", false, false, platforms, -3), config, dbConn); + AddScanFolder( + ScanFolderInfo(root.filePath("recurseNotNested"), "recurseNotNested", "recurseNotNested", false, true, platforms, -2), + config, dbConn); + AddScanFolder( + ScanFolderInfo(root.filePath("recurseNested"), "recurseNested", "recurseNested", false, true, platforms, -1), + config, dbConn); + } + + // Calls the GenerateRelativeSourcePath function and validates that the results match the expected inputs. + void TestGetRelativeSourcePath( + const AZStd::string& sourcePath, bool expectedToFind, const AZStd::string& expectedPath, const AZStd::string& expectedRoot) + { + bool relPathFound = false; + AZStd::string relPath; + AZStd::string rootFolder; + + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + relPathFound, &AzToolsFramework::AssetSystem::AssetSystemRequest::GenerateRelativeSourcePath, sourcePath, + relPath, rootFolder); + + EXPECT_EQ(relPathFound, expectedToFind); + EXPECT_EQ(relPath, expectedPath); + EXPECT_EQ(rootFolder, expectedRoot); + } + }; + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_EmptySourcePath_ReturnsNoMatch) + { + // Test passes in an empty source path, which shouldn't produce a valid result. + // Input: empty source path + // Output: empty, not found result + TestGetRelativeSourcePath("", false, "", ""); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_AbsolutePathOutsideWatchFolders_ReturnsNoMatch) + { + // Test passes in an invalid absolute source path, which shouldn't produce a valid result. + // Input: "/sourceRoot/noWatchFolder/test.txt" + // Output: not found result, which also returns the input as the relative file name + QDir watchFolder = GetRoot().filePath("noWatchFolder/"); + QString fileToCheck = watchFolder.filePath("test.txt"); + + TestGetRelativeSourcePath(fileToCheck.toUtf8().constData(), false, fileToCheck.toUtf8().constData(), ""); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_AbsolutePathUnderWatchFolder_ReturnsRelativePath) + { + // Test passes in a valid absolute source path, which should produce a valid relative path + // Input: "/sourceRoot/noRecurse/test.txt" + // Output: "test.txt" in folder "/sourceRoot/noRecurse/" + QDir watchFolder = GetRoot().filePath("noRecurse/"); + QString fileToCheck = watchFolder.filePath("test.txt"); + + TestGetRelativeSourcePath(fileToCheck.toUtf8().constData(), true, "test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_AbsolutePathUnderNestedWatchFolders_ReturnsRelativePath) + { + // Test passes in a valid absolute source path that matches a watch folder and a nested watch folder. + // The output relative path should match the nested folder, because the nested folder has a higher priority registered with the AP. + // Input: "/sourceRoot/recurseNested/nested/test.txt" + // Output: "test.txt" in folder "/sourceRoot/recurseNested/nested/" + QDir watchFolder = GetRoot().filePath("recurseNested/nested/"); + QString fileToCheck = watchFolder.filePath("test.txt"); + + TestGetRelativeSourcePath(fileToCheck.toUtf8().constData(), true, "test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_BareFileNameValidInWatchFolder_ReturnsHighestPriorityWatchFolder) + { + // Test passes in a simple file name. The output should be relative to the highest-priority watch folder. + // Input: "test.txt" + // Output: "test.txt" in folder "/sourceRoot/recurseNested/nested/" + QDir watchFolder = GetRoot().filePath("recurseNested/nested/"); + + TestGetRelativeSourcePath("test.txt", true, "test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathValidInWatchFolder_ReturnsHighestPriorityWatchFolder) + { + // Test passes in a relative path. The output should preserve the relative path, but list it as relative to the highest-priority + // watch folder. + // Input: "a/b/c/test.txt" + // Output: "a/b/c/test.txt" in folder "/sourceRoot/recurseNested/nested/" + QDir watchFolder = GetRoot().filePath("recurseNested/nested/"); + + TestGetRelativeSourcePath("a/b/c/test.txt", true, "a/b/c/test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathNotInWatchFolder_ReturnsNoMatch) + { + // Test passes in a relative path that "backs up" two directories. This will be invalid, because no matter which watch directory + // we start at, the result will be outside of any watch directory. + // Input: "../../test.txt" + // Output: not found result, which also returns the input as the relative file name + TestGetRelativeSourcePath("../../test.txt", false, "../../test.txt", ""); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathValidFromNestedWatchFolder_ReturnsOuterFolder) + { + // Test passes in a relative path that "backs up" one directory. This will produce a valid result, because we can back up from + // the "recurseNested/nested/" watch folder to "recurseNested", which is also a valid watch folder. + // Input: "../test.txt" + // Output: "test.txt" in folder "/sourceRoot/recurseNested" + QDir watchFolder = GetRoot().filePath("recurseNested/"); + TestGetRelativeSourcePath("../test.txt", true, "test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathMovesToParentWatchFolder_ReturnsOuterFolder) + { + // Test passes in a relative path that backs up one directory and then forward into a directory. This will produce a valid + // result, because it can validly start in the highest-priority watch folder (recurseNested/nested), move back one into the + // outer watch folder (recurseNested), and then have a subdirectory within it. + // Note that it would also be valid to move from recurseNested to recurseNotNested, but that won't be the result of this test + // because that's a lower-priority match. + // Input: "../recurseNotNested/test.txt" + // Output: "recurseNotNested/test.txt" in folder "/sourceRoot/recurseNested/" + QDir watchFolder = GetRoot().filePath("recurseNested/"); + + TestGetRelativeSourcePath("../recurseNotNested/test.txt", true, "recurseNotNested/test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathMovesToSiblingWatchFolder_ReturnsSiblingFolder) + { + // Test passes in a relative path that backs up two directories and then forward into a directory. This will produce a valid + // result, because it can validly start in the recurseNested/nested folder, move back two folders, then forward into the sibling + // recurseNotNested folder. The result will be a relative path to the sibling folder. + // Input: "../../recurseNotNested/test.txt" + // Output: "test.txt" in folder "/sourceRoot/recurseNotNested/" + QDir watchFolder = GetRoot().filePath("recurseNotNested/"); + + TestGetRelativeSourcePath("../../recurseNotNested/test.txt", true, "test.txt", watchFolder.path().toUtf8().constData()); + } + + TEST_F(AssetCatalogTestRelativeSourcePath, GenerateRelativeSourcePath_RelativePathBacksOutOfWatchFolder_ReturnsNoMatch) + { + // Test passes in a relative path that adds a directory, then "backs up" three directories. This will be invalid, because no + // matter which watch directory we start at, the result will be outside of any watch directory. + // Input: "../test.txt" + // Output: "test.txt" in folder "/sourceRoot/recurseNested" + TestGetRelativeSourcePath("a/../../../test.txt", false, "a/../../../test.txt", ""); + } + class AssetCatalogTest_GetFullSourcePath : public AssetCatalogTest { @@ -909,7 +1092,7 @@ namespace AssetProcessor { AssetCatalogTest::SetUp(); m_platforms.push_back("pc"); - m_platforms.push_back("es3"); + m_platforms.push_back("android"); // 4 products for one platform, 1 product for the other. m_platformToProductsForSourceWithDifferentProducts["pc"].push_back("subfolder3/basefilez.arc2"); @@ -917,7 +1100,7 @@ namespace AssetProcessor m_platformToProductsForSourceWithDifferentProducts["pc"].push_back("subfolder3/basefile.arc2"); m_platformToProductsForSourceWithDifferentProducts["pc"].push_back("subfolder3/basefile.azm2"); - m_platformToProductsForSourceWithDifferentProducts["es3"].push_back("subfolder3/es3exclusivefile.azm2"); + m_platformToProductsForSourceWithDifferentProducts["android"].push_back("subfolder3/androidexclusivefile.azm2"); m_sourceFileWithDifferentProductsPerPlatform = AZ::Uuid::CreateString("{38032FC9-2838-4D6A-9DA0-79E5E4F20C1B}"); m_sourceFileWithDependency = AZ::Uuid::CreateString("{807C4174-1D19-42AD-B8BC-A59291D9388C}"); @@ -930,7 +1113,7 @@ namespace AssetProcessor // resulting in image processing jobs having different products per platform. Because of this, the material jobs will then have different // dependencies per platform, because each material will depend on a referenced texture and all of that texture's mipmaps. - // Add a source file with 4 products on pc, but 1 on es3 + // Add a source file with 4 products on pc, but 1 on android bool result = AddSourceAndJobForMultiplePlatforms( "subfolder3", "MultiplatformFile.txt", @@ -945,7 +1128,7 @@ namespace AssetProcessor result = AddSourceAndJobForMultiplePlatforms("subfolder3", "FileWithDependency.txt", &(m_data->m_dbConn), sourceFileWithSameProductsJobsPerPlatform, m_platforms, m_sourceFileWithDependency); EXPECT_TRUE(result); - const AZStd::string fileWithDependencyProductPath = "subfolder3/es3exclusivefile.azm2"; + const AZStd::string fileWithDependencyProductPath = "subfolder3/androidexclusivefile.azm2"; for (const AZStd::string& platform : m_platforms) { diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorMessagesTests.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorMessagesTests.cpp index c33943f9a7..04949c82a9 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorMessagesTests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorMessagesTests.cpp @@ -265,6 +265,9 @@ namespace AssetProcessorMessagesTests addPairFunc(new GetFullSourcePathFromRelativeProductPathRequest(), new GetFullSourcePathFromRelativeProductPathResponse()); addPairFunc(new GetRelativeProductPathFromFullSourceOrProductPathRequest(), new GetRelativeProductPathFromFullSourceOrProductPathResponse()); + addPairFunc( + new GenerateRelativeSourcePathRequest(), + new GenerateRelativeSourcePathResponse()); addPairFunc(new SourceAssetInfoRequest(), new SourceAssetInfoResponse()); addPairFunc(new SourceAssetProductsInfoRequest(), new SourceAssetProductsInfoResponse()); addPairFunc(new GetScanFoldersRequest(), new GetScanFoldersResponse()); diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp index d04e13aef2..7b88321ad9 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.cpp @@ -12,7 +12,7 @@ #include "AssetProcessorTest.h" - +#include #include #include "BaseAssetProcessorTest.h" @@ -67,6 +67,12 @@ namespace AssetProcessor static char processName[] = {"AssetProcessorBatch"}; static char* namePtr = &processName[0]; static char** paramStringArray = &namePtr; + + auto registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); m_application.reset(new UnitTestAppManager(&numParams, ¶mStringArray)); ASSERT_EQ(m_application->BeforeRun(), ApplicationManager::Status_Success); diff --git a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.h b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.h index c866a933dd..4ea0695f1c 100644 --- a/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.h +++ b/Code/Tools/AssetProcessor/native/tests/AssetProcessorTest.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include // for the assert absorber. @@ -44,7 +45,18 @@ namespace AssetProcessor AZ::AllocatorInstance::Create(); } m_errorAbsorber = new UnitTestUtils::AssertAbsorber(); + m_application = AZStd::make_unique(); + + // Inject the AutomatedTesting project as a project path into test fixture + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + constexpr auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + if(auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + settingsRegistry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry); + } } void TearDown() override diff --git a/Code/Tools/AssetProcessor/native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp index c2931c6a09..671d8d96a9 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetBuilderSDK/assetBuilderSDKTest.cpp @@ -28,7 +28,7 @@ namespace AssetProcessor createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} } }; ASSERT_EQ(createJobsRequest.GetEnabledPlatformsCount(), 2); @@ -48,19 +48,19 @@ namespace AssetProcessor ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_NONE); createJobsRequest.m_enabledPlatforms = { - { "es3", {} + { "android", {} } }; - ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(0), AssetBuilderSDK::Platform_ES3); + ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(0), AssetBuilderSDK::Platform_ANDROID); ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_NONE); createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} } }; ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(0), AssetBuilderSDK::Platform_PC); - ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ES3); + ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ANDROID); ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(2), AssetBuilderSDK::Platform_NONE); createJobsRequest.m_enabledPlatforms = { @@ -72,24 +72,24 @@ namespace AssetProcessor createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} }, { "ios", {} - }, { "osx_gl", {} + }, { "mac", {} } }; ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(0), AssetBuilderSDK::Platform_PC); - ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ES3); + ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ANDROID); ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(2), AssetBuilderSDK::Platform_IOS); - ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(3), AssetBuilderSDK::Platform_OSX); + ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(3), AssetBuilderSDK::Platform_MAC); ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(4), AssetBuilderSDK::Platform_NONE); createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} } }; ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(0), AssetBuilderSDK::Platform_PC); - ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ES3); + ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(1), AssetBuilderSDK::Platform_ANDROID); ASSERT_EQ(createJobsRequest.GetEnabledPlatformAt(2), AssetBuilderSDK::Platform_NONE); // using a deprecated API should have generated warnings. // but we can't test for it because these warnings are WarningOnce and some other unit test might have already triggered it @@ -106,23 +106,23 @@ namespace AssetProcessor } }; ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_PC)); - ASSERT_FALSE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ES3)); + ASSERT_FALSE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ANDROID)); createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} } }; ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_PC)); - ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ES3)); + ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ANDROID)); createJobsRequest.m_enabledPlatforms = { { "pc", {} - }, { "es3", {} + }, { "android", {} } }; ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_PC)); - ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ES3)); + ASSERT_TRUE(createJobsRequest.IsPlatformEnabled(AssetBuilderSDK::Platform_ANDROID)); // using a deprecated API should have generated warnings. // but we can't test for it because these warnings are WarningOnce and some other unit test might have already triggered it } @@ -133,9 +133,9 @@ namespace AssetProcessor UnitTestUtils::AssertAbsorber absorb; ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_PC)); - ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_ES3)); + ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_ANDROID)); ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_IOS)); - ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_OSX)); + ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_MAC)); ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_PROVO)); ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_SALEM)); ASSERT_TRUE(createJobsRequest.IsPlatformValid(AssetBuilderSDK::Platform_JASPER)); diff --git a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp index 07d1e48229..bd99cf7a94 100644 --- a/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/assetmanager/AssetProcessorManagerTest.cpp @@ -204,6 +204,9 @@ void AssetProcessorManagerTest::SetUp() auto cacheRootKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_cache_path"; registry->Set(cacheRootKey, tempPath.absoluteFilePath("Cache").toUtf8().constData()); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); m_data->m_databaseLocationListener.BusConnect(); @@ -4017,15 +4020,15 @@ TEST_F(ModtimeScanningTest, ModtimeSkipping_EnablePlatform_ShouldProcessFilesFor m_assetProcessorManager->m_allowModtimeSkippingFeature = true; AssetUtilities::SetUseFileHashOverride(true, true); - // Enable es3 platform after the initial SetUp has already processed the files for pc + // Enable android platform after the initial SetUp has already processed the files for pc QDir tempPath(m_tempDir.path()); - AssetBuilderSDK::PlatformInfo es3Platform("es3", { "host", "renderer" }); - m_config->EnablePlatform(es3Platform, true); + AssetBuilderSDK::PlatformInfo androidPlatform("android", { "host", "renderer" }); + m_config->EnablePlatform(androidPlatform, true); // There's no way to remove scanfolders and adding a new one after enabling the platform will cause the pc assets to build as well, which we don't want // Instead we'll just const cast the vector and modify the enabled platforms for the scanfolder auto& platforms = const_cast&>(m_config->GetScanFolderAt(0).GetPlatforms()); - platforms.push_back(es3Platform); + platforms.push_back(androidPlatform); // We need the builder fingerprints to be updated to reflect the newly enabled platform m_assetProcessorManager->ComputeBuilderDirty(); @@ -4033,10 +4036,10 @@ TEST_F(ModtimeScanningTest, ModtimeSkipping_EnablePlatform_ShouldProcessFilesFor QSet filePaths = BuildFileSet(); SimulateAssetScanner(filePaths); - ExpectWork(4, 2); // CreateJobs = 4, 2 files * 2 platforms. ProcessJobs = 2, just the es3 platform jobs (pc is already processed) + ExpectWork(4, 2); // CreateJobs = 4, 2 files * 2 platforms. ProcessJobs = 2, just the android platform jobs (pc is already processed) - ASSERT_TRUE(m_data->m_processResults[0].m_destinationPath.contains("es3")); - ASSERT_TRUE(m_data->m_processResults[1].m_destinationPath.contains("es3")); + ASSERT_TRUE(m_data->m_processResults[0].m_destinationPath.contains("android")); + ASSERT_TRUE(m_data->m_processResults[1].m_destinationPath.contains("android")); } TEST_F(ModtimeScanningTest, ModtimeSkipping_ModifyTimestamp) diff --git a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp index 31e4996b1e..9c80b267eb 100644 --- a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp +++ b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.cpp @@ -39,7 +39,6 @@ void PlatformConfigurationUnitTests::SetUp() m_qApp = new QCoreApplication(m_argc, m_argv); AssetProcessorTest::SetUp(); AssetUtilities::ResetAssetRoot(); - } void PlatformConfigurationUnitTests::TearDown() @@ -121,14 +120,14 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Regular_Platforms) // verify the data. ASSERT_NE(config.GetPlatformByIdentifier(AzToolsFramework::AssetSystem::GetHostAssetPlatform()), nullptr); - ASSERT_NE(config.GetPlatformByIdentifier("es3"), nullptr); + ASSERT_NE(config.GetPlatformByIdentifier("android"), nullptr); ASSERT_NE(config.GetPlatformByIdentifier("server"), nullptr); - ASSERT_TRUE(config.GetPlatformByIdentifier("es3")->HasTag("mobile")); - ASSERT_TRUE(config.GetPlatformByIdentifier("es3")->HasTag("renderer")); - ASSERT_TRUE(config.GetPlatformByIdentifier("es3")->HasTag("android")); + ASSERT_TRUE(config.GetPlatformByIdentifier("android")->HasTag("mobile")); + ASSERT_TRUE(config.GetPlatformByIdentifier("android")->HasTag("renderer")); + ASSERT_TRUE(config.GetPlatformByIdentifier("android")->HasTag("android")); ASSERT_TRUE(config.GetPlatformByIdentifier("server")->HasTag("server")); - ASSERT_FALSE(config.GetPlatformByIdentifier("es3")->HasTag("server")); + ASSERT_FALSE(config.GetPlatformByIdentifier("android")->HasTag("server")); ASSERT_FALSE(config.GetPlatformByIdentifier("server")->HasTag("renderer")); } @@ -398,7 +397,7 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_RegularScanfolderP AZStd::vector platforms = config.GetScanFolderAt(0).GetPlatforms(); ASSERT_EQ(platforms.size(), 4); ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo(AzToolsFramework::AssetSystem::GetHostAssetPlatform(), AZStd::unordered_set{})) != platforms.end()); - ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("es3", AZStd::unordered_set{})) != platforms.end()); + ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("android", AZStd::unordered_set{})) != platforms.end()); ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("ios", AZStd::unordered_set{})) != platforms.end()); ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("server", AZStd::unordered_set{})) != platforms.end()); @@ -406,12 +405,12 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_RegularScanfolderP platforms = config.GetScanFolderAt(1).GetPlatforms(); ASSERT_EQ(platforms.size(), 2); ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo(AzToolsFramework::AssetSystem::GetHostAssetPlatform(), AZStd::unordered_set{})) != platforms.end()); - ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("es3", AZStd::unordered_set{})) != platforms.end()); + ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("android", AZStd::unordered_set{})) != platforms.end()); ASSERT_EQ(config.GetScanFolderAt(2).GetDisplayName(), QString("folder1output")); platforms = config.GetScanFolderAt(2).GetPlatforms(); ASSERT_EQ(platforms.size(), 1); - ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("es3", AZStd::unordered_set{})) != platforms.end()); + ASSERT_TRUE(AZStd::find(platforms.begin(), platforms.end(), AssetBuilderSDK::PlatformInfo("android", AZStd::unordered_set{})) != platforms.end()); ASSERT_EQ(config.GetScanFolderAt(3).GetDisplayName(), QString("folder2output")); platforms = config.GetScanFolderAt(3).GetPlatforms(); @@ -455,7 +454,7 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Recognizers) using namespace AzToolsFramework::AssetSystem; using namespace AssetProcessor; #if defined(AZ_PLATFORM_WINDOWS) - const char* platformWhichIsNotCurrentPlatform = "osx_gl"; + const char* platformWhichIsNotCurrentPlatform = "mac"; #else const char* platformWhichIsNotCurrentPlatform = "pc"; #endif @@ -476,27 +475,27 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Recognizers) ASSERT_EQ(recogs["i_caf"].m_patternMatcher.GetBuilderPattern().m_pattern, "*.i_caf"); ASSERT_EQ(recogs["i_caf"].m_patternMatcher.GetBuilderPattern().m_type, AssetBuilderSDK::AssetBuilderPattern::Wildcard); ASSERT_EQ(recogs["i_caf"].m_platformSpecs.size(), 2); - ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); ASSERT_FALSE(recogs["i_caf"].m_platformSpecs.contains("server")); // server has been set to skip. - ASSERT_EQ(recogs["i_caf"].m_platformSpecs["es3"].m_extraRCParams, "mobile"); + ASSERT_EQ(recogs["i_caf"].m_platformSpecs["android"].m_extraRCParams, "mobile"); ASSERT_EQ(recogs["i_caf"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, "defaultparams"); ASSERT_TRUE(recogs.contains("caf")); - ASSERT_TRUE(recogs["caf"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["caf"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["caf"].m_platformSpecs.contains("server")); ASSERT_TRUE(recogs["caf"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); ASSERT_EQ(recogs["caf"].m_platformSpecs.size(), 3); - ASSERT_EQ(recogs["caf"].m_platformSpecs["es3"].m_extraRCParams, "rendererparams"); + ASSERT_EQ(recogs["caf"].m_platformSpecs["android"].m_extraRCParams, "rendererparams"); ASSERT_EQ(recogs["caf"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, "rendererparams"); ASSERT_EQ(recogs["caf"].m_platformSpecs["server"].m_extraRCParams, "copy"); ASSERT_TRUE(recogs.contains("mov")); - ASSERT_TRUE(recogs["mov"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["mov"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["mov"].m_platformSpecs.contains("server")); ASSERT_TRUE(recogs["mov"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); ASSERT_EQ(recogs["mov"].m_platformSpecs.size(), 3); - ASSERT_EQ(recogs["mov"].m_platformSpecs["es3"].m_extraRCParams, "platformspecificoverride"); + ASSERT_EQ(recogs["mov"].m_platformSpecs["android"].m_extraRCParams, "platformspecificoverride"); ASSERT_EQ(recogs["mov"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, "rendererparams"); ASSERT_EQ(recogs["mov"].m_platformSpecs["server"].m_extraRCParams, "copy"); @@ -504,27 +503,27 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Recognizers) // (but platforms can override it) ASSERT_TRUE(recogs.contains("rend")); ASSERT_TRUE(recogs["rend"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); - ASSERT_TRUE(recogs["rend"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["rend"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["rend"].m_platformSpecs.contains("server")); ASSERT_FALSE(recogs["rend"].m_platformSpecs.contains(platformWhichIsNotCurrentPlatform)); // this is not an enabled platform and should not be there. ASSERT_EQ(recogs["rend"].m_platformSpecs.size(), 3); ASSERT_EQ(recogs["rend"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, "rendererparams"); - ASSERT_EQ(recogs["rend"].m_platformSpecs["es3"].m_extraRCParams, "rendererparams"); + ASSERT_EQ(recogs["rend"].m_platformSpecs["android"].m_extraRCParams, "rendererparams"); ASSERT_EQ(recogs["rend"].m_platformSpecs["server"].m_extraRCParams, ""); // default if not specified is empty string ASSERT_TRUE(recogs.contains("alldefault")); ASSERT_TRUE(recogs["alldefault"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); - ASSERT_TRUE(recogs["alldefault"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["alldefault"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["alldefault"].m_platformSpecs.contains("server")); ASSERT_FALSE(recogs["alldefault"].m_platformSpecs.contains(platformWhichIsNotCurrentPlatform)); // this is not an enabled platform and should not be there. ASSERT_EQ(recogs["alldefault"].m_platformSpecs.size(), 3); ASSERT_EQ(recogs["alldefault"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, ""); - ASSERT_EQ(recogs["alldefault"].m_platformSpecs["es3"].m_extraRCParams, ""); + ASSERT_EQ(recogs["alldefault"].m_platformSpecs["android"].m_extraRCParams, ""); ASSERT_EQ(recogs["alldefault"].m_platformSpecs["server"].m_extraRCParams, ""); ASSERT_TRUE(recogs.contains("skipallbutone")); ASSERT_FALSE(recogs["skipallbutone"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); - ASSERT_FALSE(recogs["skipallbutone"].m_platformSpecs.contains("es3")); + ASSERT_FALSE(recogs["skipallbutone"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["skipallbutone"].m_platformSpecs.contains("server")); // server is only one enabled (set to copy) ASSERT_EQ(recogs["skipallbutone"].m_platformSpecs.size(), 1); ASSERT_EQ(recogs["skipallbutone"].m_platformSpecs["server"].m_extraRCParams, "copy"); @@ -550,7 +549,7 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Overrides) // verify the data. ASSERT_NE(config.GetPlatformByIdentifier(AzToolsFramework::AssetSystem::GetHostAssetPlatform()), nullptr); - ASSERT_NE(config.GetPlatformByIdentifier("es3"), nullptr); + ASSERT_NE(config.GetPlatformByIdentifier("android"), nullptr); ASSERT_NE(config.GetPlatformByIdentifier("provo"), nullptr); // this override swaps server with provo in that it turns ON provo, turns off server ASSERT_EQ(config.GetPlatformByIdentifier("server"), nullptr); // this should be off due to overrides @@ -567,11 +566,11 @@ TEST_F(PlatformConfigurationUnitTests, TestFailReadConfigFile_Overrides) ASSERT_EQ(recogs["i_caf"].m_patternMatcher.GetBuilderPattern().m_pattern, "*.i_caf"); ASSERT_EQ(recogs["i_caf"].m_patternMatcher.GetBuilderPattern().m_type, AssetBuilderSDK::AssetBuilderPattern::Wildcard); ASSERT_EQ(recogs["i_caf"].m_platformSpecs.size(), 3); - ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains("es3")); + ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains("android")); ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains("provo")); ASSERT_TRUE(recogs["i_caf"].m_platformSpecs.contains(AzToolsFramework::AssetSystem::GetHostAssetPlatform())); ASSERT_FALSE(recogs["i_caf"].m_platformSpecs.contains("server")); // server has been set to skip. - ASSERT_EQ(recogs["i_caf"].m_platformSpecs["es3"].m_extraRCParams, "mobile"); + ASSERT_EQ(recogs["i_caf"].m_platformSpecs["android"].m_extraRCParams, "mobile"); ASSERT_EQ(recogs["i_caf"].m_platformSpecs[AzToolsFramework::AssetSystem::GetHostAssetPlatform()].m_extraRCParams, "defaultparams"); ASSERT_EQ(recogs["i_caf"].m_platformSpecs["provo"].m_extraRCParams, "copy"); diff --git a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.h b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.h index fe669460a8..0fb67ab947 100644 --- a/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.h +++ b/Code/Tools/AssetProcessor/native/tests/platformconfiguration/platformconfigurationtests.h @@ -37,6 +37,5 @@ private: int m_argc; char** m_argv; QCoreApplication* m_qApp; - }; diff --git a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCControllerTest.cpp b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCControllerTest.cpp index b08fbc28d5..1da4703f3d 100644 --- a/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCControllerTest.cpp +++ b/Code/Tools/AssetProcessor/native/tests/resourcecompiler/RCControllerTest.cpp @@ -224,7 +224,7 @@ void RCcontrollerTest_Simple::SubmitJob() // This is a regresssion test to ensure the rccontroller can handle multiple jobs for the same file being completed before // the APM has a chance to send OnFinishedProcesssingJob events -TEST_F(RCcontrollerTest_Simple, SameJobIsCompletedMultipleTimes_CompletesWithoutError) +TEST_F(RCcontrollerTest_Simple, DISABLED_SameJobIsCompletedMultipleTimes_CompletesWithoutError) { using namespace AssetProcessor; diff --git a/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp index 5efef8166c..68ba64ea1a 100644 --- a/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/ProductAssetTreeModel.cpp @@ -14,6 +14,7 @@ #include "ProductAssetTreeItemData.h" #include +#include #include namespace AssetProcessor @@ -159,31 +160,33 @@ namespace AssetProcessor return; } + AZ::IO::Path productNamePath(product.m_productName, AZ::IO::PosixPathSeparator); - AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(product.m_productName.c_str(), tokens, AZ_CORRECT_DATABASE_SEPARATOR, false, true); - - if (tokens.empty()) + if (productNamePath.empty()) { AZ_Warning("AssetProcessor", false, "Product id %d has an invalid name: %s", product.m_productID, product.m_productName.c_str()); return; } AssetTreeItem* parentItem = m_root.get(); - AZStd::string fullFolderName; - for (int i = 0; i < tokens.size() - 1; ++i) + AZ::IO::Path currentFullFolderPath; + const AZ::IO::PathView filename = productNamePath.Filename(); + const AZ::IO::PathView fullPathWithoutFilename = productNamePath.RemoveFilename(); + AZStd::fixed_string currentPath; + for (auto pathIt = fullPathWithoutFilename.begin(); pathIt != fullPathWithoutFilename.end(); ++pathIt) { - AzFramework::StringFunc::AssetDatabasePath::Join(fullFolderName.c_str(), tokens[i].c_str(), fullFolderName); - AssetTreeItem* nextParent = parentItem->GetChildFolder(tokens[i].c_str()); + currentPath = pathIt->FixedMaxPathString(); + currentFullFolderPath /= currentPath; + AssetTreeItem* nextParent = parentItem->GetChildFolder(currentPath.c_str()); if (!nextParent) { if (!modelIsResetting) { - QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem); + QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem); beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount()); } - nextParent = parentItem->CreateChild(ProductAssetTreeItemData::MakeShared(nullptr, fullFolderName, tokens[i].c_str(), true, AZ::Uuid::CreateNull())); - m_productToTreeItem[fullFolderName] = nextParent; + nextParent = parentItem->CreateChild(ProductAssetTreeItemData::MakeShared(nullptr, currentFullFolderPath.Native(), currentPath.c_str(), true, AZ::Uuid::CreateNull())); + m_productToTreeItem[currentFullFolderPath.Native()] = nextParent; // m_productIdToTreeItem is not used for folders, folders don't have product IDs. if (!modelIsResetting) @@ -205,12 +208,12 @@ namespace AssetProcessor if (!modelIsResetting) { - QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem); + QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem); beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount()); } AZStd::shared_ptr productItemData = - ProductAssetTreeItemData::MakeShared(&product, product.m_productName, tokens[tokens.size() - 1].c_str(), false, sourceId); + ProductAssetTreeItemData::MakeShared(&product, product.m_productName, AZStd::fixed_string(filename.Native()).c_str(), false, sourceId); m_productToTreeItem[product.m_productName] = parentItem->CreateChild(productItemData); m_productIdToTreeItem[product.m_productID] = m_productToTreeItem[product.m_productName]; diff --git a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp index dda0a58837..69e60f6733 100644 --- a/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp +++ b/Code/Tools/AssetProcessor/native/ui/SourceAssetTreeModel.cpp @@ -63,8 +63,7 @@ namespace AssetProcessor } - auto fullPath = AZ::IO::Path(scanFolder.m_scanFolder) / source.m_sourceName; - + AZ::IO::Path fullPath = AZ::IO::Path(scanFolder.m_scanFolder, AZ::IO::PosixPathSeparator) / source.m_sourceName; // It's common for Open 3D Engine game projects and scan folders to be in a subfolder // of the engine install. To improve readability of the source files, strip out @@ -78,34 +77,35 @@ namespace AssetProcessor AzFramework::StringFunc::Replace(fullPath.Native(), m_assetRoot.absolutePath().toUtf8(), ""); } - - AZStd::vector tokens; - AzFramework::StringFunc::Tokenize(fullPath.c_str(), tokens, AZ_CORRECT_DATABASE_SEPARATOR, false, true); - - if (tokens.empty()) + if (fullPath.empty()) { - AZ_Warning("AssetProcessor", false, "Source id %s has an invalid name: %s", - source.m_sourceGuid.ToString().c_str(), source.m_sourceName.c_str()); + AZ_Warning( + "AssetProcessor", false, "Source id %s has an invalid name: %s", source.m_sourceGuid.ToString().c_str(), + source.m_sourceName.c_str()); return; } QModelIndex newIndicesStart; AssetTreeItem* parentItem = m_root.get(); - AZStd::string fullFolderName; - for (int i = 0; i < tokens.size() - 1; ++i) + AZ::IO::Path currentFullFolderPath; + const AZ::IO::PathView filename = fullPath.Filename(); + const AZ::IO::PathView fullPathWithoutFilename = fullPath.RemoveFilename(); + AZStd::fixed_string currentPath; + for (auto pathIt = fullPathWithoutFilename.begin(); pathIt != fullPathWithoutFilename.end(); ++pathIt) { - AzFramework::StringFunc::AssetDatabasePath::Join(fullFolderName.c_str(), tokens[i].c_str(), fullFolderName); - AssetTreeItem* nextParent = parentItem->GetChildFolder(tokens[i].c_str()); + currentPath = pathIt->FixedMaxPathString(); + currentFullFolderPath /= currentPath; + AssetTreeItem* nextParent = parentItem->GetChildFolder(currentPath.c_str()); if (!nextParent) { if (!modelIsResetting) { - QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem); + QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem); beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount()); } - nextParent = parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(nullptr, nullptr, fullFolderName, tokens[i].c_str(), true)); - m_sourceToTreeItem[fullFolderName] = nextParent; + nextParent = parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(nullptr, nullptr, currentFullFolderPath.Native(), currentPath.c_str(), true)); + m_sourceToTreeItem[currentFullFolderPath.Native()] = nextParent; // Folders don't have source IDs, don't add to m_sourceIdToTreeItem if (!modelIsResetting) { @@ -117,12 +117,12 @@ namespace AssetProcessor if (!modelIsResetting) { - QModelIndex parentIndex = parentItem == m_root.get() ? QModelIndex() : createIndex(parentItem->GetRow(), 0, parentItem); + QModelIndex parentIndex = createIndex(parentItem->GetRow(), 0, parentItem); beginInsertRows(parentIndex, parentItem->getChildCount(), parentItem->getChildCount()); } m_sourceToTreeItem[source.m_sourceName] = - parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(&source, &scanFolder, source.m_sourceName, tokens[tokens.size() - 1].c_str(), false)); + parentItem->CreateChild(SourceAssetTreeItemData::MakeShared(&source, &scanFolder, source.m_sourceName, AZStd::fixed_string(filename.Native()).c_str(), false)); m_sourceIdToTreeItem[source.m_sourceID] = m_sourceToTreeItem[source.m_sourceName]; if (!modelIsResetting) { diff --git a/Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp index 5940caadb7..079cdb7c66 100644 --- a/Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/AssetProcessorManagerUnitTests.cpp @@ -51,6 +51,8 @@ namespace AssetProcessor public: using GetRelativeProductPathFromFullSourceOrProductPathRequest = AzFramework::AssetSystem::GetRelativeProductPathFromFullSourceOrProductPathRequest; using GetRelativeProductPathFromFullSourceOrProductPathResponse = AzFramework::AssetSystem::GetRelativeProductPathFromFullSourceOrProductPathResponse; + using GenerateRelativeSourcePathRequest = AzFramework::AssetSystem::GenerateRelativeSourcePathRequest; + using GenerateRelativeSourcePathResponse = AzFramework::AssetSystem::GenerateRelativeSourcePathResponse; using GetFullSourcePathFromRelativeProductPathRequest = AzFramework::AssetSystem::GetFullSourcePathFromRelativeProductPathRequest; using GetFullSourcePathFromRelativeProductPathResponse = AzFramework::AssetSystem::GetFullSourcePathFromRelativeProductPathResponse; }; @@ -88,34 +90,34 @@ namespace AssetProcessor //AZ_TracePrintf("test", "-------------------------\n"); } - void ComputeFingerprints(unsigned int& fingerprintForPC, unsigned int& fingerprintForES3, PlatformConfiguration& config, QString scanFolderPath, QString relPath) + void ComputeFingerprints(unsigned int& fingerprintForPC, unsigned int& fingerprintForANDROID, PlatformConfiguration& config, QString scanFolderPath, QString relPath) { QString extraInfoForPC; - QString extraInfoForES3; + QString extraInfoForANDROID; RecognizerPointerContainer output; QString filePath = scanFolderPath + "/" + relPath; config.GetMatchingRecognizers(filePath, output); for (const AssetRecognizer* assetRecogniser : output) { extraInfoForPC.append(assetRecogniser->m_platformSpecs["pc"].m_extraRCParams); - extraInfoForES3.append(assetRecogniser->m_platformSpecs["es3"].m_extraRCParams); + extraInfoForANDROID.append(assetRecogniser->m_platformSpecs["android"].m_extraRCParams); extraInfoForPC.append(assetRecogniser->m_version); - extraInfoForES3.append(assetRecogniser->m_version); + extraInfoForANDROID.append(assetRecogniser->m_version); } - //Calculating fingerprints for the file for pc and es3 platforms + //Calculating fingerprints for the file for pc and android platforms AZ::Uuid sourceId = AZ::Uuid("{2206A6E0-FDBC-45DE-B6FE-C2FC63020BD5}"); JobEntry jobEntryPC(scanFolderPath, relPath, relPath, 0, { "pc", {"desktop", "renderer"} }, "", 0, 1, sourceId); - JobEntry jobEntryES3(scanFolderPath, relPath, relPath, 0, { "es3", {"mobile", "renderer"} }, "", 0, 2, sourceId); + JobEntry jobEntryANDROID(scanFolderPath, relPath, relPath, 0, { "android", {"mobile", "renderer"} }, "", 0, 2, sourceId); JobDetails jobDetailsPC; jobDetailsPC.m_extraInformationForFingerprinting = extraInfoForPC.toUtf8().constData(); jobDetailsPC.m_jobEntry = jobEntryPC; - JobDetails jobDetailsES3; - jobDetailsES3.m_extraInformationForFingerprinting = extraInfoForES3.toUtf8().constData(); - jobDetailsES3.m_jobEntry = jobEntryES3; + JobDetails jobDetailsANDROID; + jobDetailsANDROID.m_extraInformationForFingerprinting = extraInfoForANDROID.toUtf8().constData(); + jobDetailsANDROID.m_jobEntry = jobEntryANDROID; fingerprintForPC = AssetUtilities::GenerateFingerprint(jobDetailsPC); - fingerprintForES3 = AssetUtilities::GenerateFingerprint(jobDetailsES3); + fingerprintForANDROID = AssetUtilities::GenerateFingerprint(jobDetailsANDROID); } } @@ -240,7 +242,7 @@ namespace AssetProcessor PlatformConfiguration config; config.EnablePlatform({ "pc",{ "desktop", "renderer" } }, true); - config.EnablePlatform({ "es3",{ "mobile", "renderer" } }, true); + config.EnablePlatform({ "android",{ "mobile", "renderer" } }, true); config.EnablePlatform({ "fandago",{ "console", "renderer" } }, false); AZStd::vector platforms; config.PopulatePlatformsForScanFolder(platforms); @@ -259,9 +261,9 @@ namespace AssetProcessor AssetRecognizer rec; AssetPlatformSpec specpc; - AssetPlatformSpec speces3; + AssetPlatformSpec specandroid; - speces3.m_extraRCParams = "somerandomparam"; + specandroid.m_extraRCParams = "somerandomparam"; rec.m_name = "random files"; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.random", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); @@ -269,13 +271,13 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(mockAppManager.RegisterAssetRecognizerAsBuilder(rec)); specpc.m_extraRCParams = ""; // blank must work - speces3.m_extraRCParams = "testextraparams"; + specandroid.m_extraRCParams = "testextraparams"; const char* builderTxt1Name = "txt files"; rec.m_name = builderTxt1Name; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); - rec.m_platformSpecs.insert("es3", speces3); + rec.m_platformSpecs.insert("android", specandroid); config.AddRecognizer(rec); @@ -305,21 +307,21 @@ namespace AssetProcessor rec.m_testLockSource = false; specpc.m_extraRCParams = "pcparams"; - speces3.m_extraRCParams = "es3params"; + specandroid.m_extraRCParams = "androidparams"; rec.m_name = "xxx files"; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.xxx", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); - rec.m_platformSpecs.insert("es3", speces3); + rec.m_platformSpecs.insert("android", specandroid); config.AddRecognizer(rec); mockAppManager.RegisterAssetRecognizerAsBuilder(rec); // two recognizers for the same pattern. rec.m_name = "xxx files 2 (builder2)"; specpc.m_extraRCParams = "pcparams2"; - speces3.m_extraRCParams = "es3params2"; + specandroid.m_extraRCParams = "androidparams2"; rec.m_platformSpecs.insert("pc", specpc); - rec.m_platformSpecs.insert("es3", speces3); + rec.m_platformSpecs.insert("android", specandroid); config.AddRecognizer(rec); mockAppManager.RegisterAssetRecognizerAsBuilder(rec); @@ -330,7 +332,7 @@ namespace AssetProcessor ignore_rec.m_name = "ignore files"; ignore_rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.ignore", AssetBuilderSDK::AssetBuilderPattern::Wildcard); ignore_rec.m_platformSpecs.insert("pc", specpc); - ignore_rec.m_platformSpecs.insert("es3", ignore_spec); + ignore_rec.m_platformSpecs.insert("android", ignore_spec); config.AddRecognizer(ignore_rec); mockAppManager.RegisterAssetRecognizerAsBuilder(ignore_rec); @@ -432,7 +434,7 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 1); // 1, since we have one recognizer for .ignore, but the 'es3' platform is marked as skip + UNIT_TEST_EXPECT_TRUE(processResults.size() == 1); // 1, since we have one recognizer for .ignore, but the 'android' platform is marked as skip UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "pc")); @@ -455,16 +457,16 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); - QList es3JobsIndex; + QList androidJobsIndex; QList pcJobsIndex; for (int checkIdx = 0; checkIdx < 4; ++checkIdx) { @@ -662,19 +664,19 @@ namespace AssetProcessor // ---------- test successes ---------- - QStringList es3outs; - es3outs.push_back(cacheRoot.filePath(QString("es3/basefile.arc1"))); - es3outs.push_back(cacheRoot.filePath(QString("es3/basefile.arc2"))); + QStringList androidouts; + androidouts.push_back(cacheRoot.filePath(QString("android/basefile.arc1"))); + androidouts.push_back(cacheRoot.filePath(QString("android/basefile.arc2"))); // feed it the messages its waiting for (create the files) - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[0], "products.")); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[1], "products.")) + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[0], "products.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[1], "products.")) - //Invoke Asset Processed for es3 platform , txt files job description + //Invoke Asset Processed for android platform , txt files job description AssetBuilderSDK::ProcessJobResponse response; response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[1].toUtf8().constData(), AZ::Uuid::CreateNull(), 2)); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[1].toUtf8().constData(), AZ::Uuid::CreateNull(), 2)); // make sure legacy SubIds get stored in the DB and in asset response messages. // also make sure they don't get filed for the wrong asset. @@ -693,8 +695,8 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(changedInputResults.size() == 1); // always RELATIVE, always with the product name. - UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "es3"); - UNIT_TEST_EXPECT_TRUE(assetMessages[1].m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "android"); + UNIT_TEST_EXPECT_TRUE(assetMessages[1].m_platform == "android"); UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_data == "basefile.arc1"); UNIT_TEST_EXPECT_TRUE(assetMessages[1].m_data == "basefile.arc2"); UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_type == AzFramework::AssetSystem::AssetNotificationMessage::AssetChanged); @@ -793,14 +795,14 @@ namespace AssetProcessor changedInputResults.clear(); assetMessages.clear(); - es3outs.clear(); - es3outs.push_back(cacheRoot.filePath(QString("es3/basefile.azm"))); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[0], "products.")); + androidouts.clear(); + androidouts.push_back(cacheRoot.filePath(QString("android/basefile.azm"))); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[0], "products.")); - //Invoke Asset Processed for es3 platform , txt files2 job description + //Invoke Asset Processed for android platform , txt files2 job description response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); @@ -812,7 +814,7 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(changedInputResults.size() == 1); // always RELATIVE, always with the product name. - UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "android"); UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_data == "basefile.azm"); changedInputResults.clear(); @@ -1002,11 +1004,11 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); @@ -1025,25 +1027,25 @@ namespace AssetProcessor // this time make different products: - QStringList oldes3outs; + QStringList oldandroidouts; QStringList oldpcouts; - oldes3outs = es3outs; + oldandroidouts = androidouts; oldpcouts.append(pcouts); - QStringList es3outs2; + QStringList androidouts2; QStringList pcouts2; - es3outs.clear(); + androidouts.clear(); pcouts.clear(); - es3outs.push_back(cacheRoot.filePath(QString("es3/basefilea.arc1"))); - es3outs2.push_back(cacheRoot.filePath(QString("es3/basefilea.azm"))); - // note that the ES3 outs have changed + androidouts.push_back(cacheRoot.filePath(QString("android/basefilea.arc1"))); + androidouts2.push_back(cacheRoot.filePath(QString("android/basefilea.azm"))); + // note that the android outs have changed // but the pc outs are still the same. pcouts.push_back(cacheRoot.filePath(QString("pc/basefile.arc1"))); pcouts2.push_back(cacheRoot.filePath(QString("pc/basefile.azm"))); // feed it the messages its waiting for (create the files) - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[0], "newfile.")); UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcouts[0], "newfile.")); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs2[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts2[0], "newfile.")); UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcouts2[0], "newfile.")); QCoreApplication::processEvents(QEventLoop::AllEvents | QEventLoop::WaitForMoreEvents, 50); @@ -1055,12 +1057,12 @@ namespace AssetProcessor response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs2[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); @@ -1083,12 +1085,12 @@ namespace AssetProcessor // The files removed should be the ones we did not emit this time // note that order isn't guarantee but an example output it this - // [0] Removed: ES3, basefile.arc1 - // [1] Removed: ES3, basefile.arc2 - // [2] Changed: ES3, basefilea.arc1 (added) + // [0] Removed: ANDROID, basefile.arc1 + // [1] Removed: ANDROID, basefile.arc2 + // [2] Changed: ANDROID, basefilea.arc1 (added) - // [3] Removed: ES3, basefile.azm - // [4] Changed: ES3, basefilea.azm (added) + // [3] Removed: ANDROID, basefile.azm + // [4] Changed: ANDROID, basefilea.azm (added) // [5] changed: PC, basefile.arc1 (changed) // [6] changed: PC, basefile.azm (changed) @@ -1110,18 +1112,18 @@ namespace AssetProcessor if (element.m_data == "basefilea.arc1") { UNIT_TEST_EXPECT_TRUE(element.m_type == AzFramework::AssetSystem::AssetNotificationMessage::AssetChanged); - UNIT_TEST_EXPECT_TRUE(element.m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(element.m_platform == "android"); } if (element.m_data == "basefile.arc2") { UNIT_TEST_EXPECT_TRUE(element.m_type == AzFramework::AssetSystem::AssetNotificationMessage::AssetRemoved); - UNIT_TEST_EXPECT_TRUE(element.m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(element.m_platform == "android"); } } // original products must no longer exist since it should have found and deleted them! - for (QString outFile: oldes3outs) + for (QString outFile: oldandroidouts) { UNIT_TEST_EXPECT_FALSE(QFile::exists(outFile)); } @@ -1145,11 +1147,11 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // pc and es3 + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // pc and android UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); @@ -1169,12 +1171,12 @@ namespace AssetProcessor response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs2[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); @@ -1205,11 +1207,11 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); @@ -1220,12 +1222,12 @@ namespace AssetProcessor response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs2[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); @@ -1243,9 +1245,9 @@ namespace AssetProcessor // deleting the fingerprint file should not have erased the products UNIT_TEST_EXPECT_TRUE(QFile::exists(pcouts[0])); - UNIT_TEST_EXPECT_TRUE(QFile::exists(es3outs[0])); + UNIT_TEST_EXPECT_TRUE(QFile::exists(androidouts[0])); UNIT_TEST_EXPECT_TRUE(QFile::exists(pcouts2[0])); - UNIT_TEST_EXPECT_TRUE(QFile::exists(es3outs2[0])); + UNIT_TEST_EXPECT_TRUE(QFile::exists(androidouts2[0])); changedInputResults.clear(); assetMessages.clear(); @@ -1304,9 +1306,9 @@ namespace AssetProcessor } UNIT_TEST_EXPECT_FALSE(QFile::exists(pcouts[0])); - UNIT_TEST_EXPECT_FALSE(QFile::exists(es3outs[0])); + UNIT_TEST_EXPECT_FALSE(QFile::exists(androidouts[0])); UNIT_TEST_EXPECT_FALSE(QFile::exists(pcouts2[0])); - UNIT_TEST_EXPECT_FALSE(QFile::exists(es3outs2[0])); + UNIT_TEST_EXPECT_FALSE(QFile::exists(androidouts2[0])); changedInputResults.clear(); assetMessages.clear(); @@ -1321,28 +1323,28 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[0], "newfile.")); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs2[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts2[0], "newfile.")); UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcouts2[0], "newfile.")); // send both done messages simultaneously! response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs2[0].toUtf8().constData())); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData())); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); // send one failure only for PC : @@ -1420,12 +1422,12 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(changedInputResults.size() == 3); UNIT_TEST_EXPECT_TRUE(assetMessages.size() == 3); - // which should be for the ES3: + // which should be for the ANDROID: UNIT_TEST_EXPECT_TRUE(AssetUtilities::NormalizeFilePath(changedInputResults[0].first) == absolutePath); // always RELATIVE, always with the product name. UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_data == "basefilea.arc1" || assetMessages[0].m_data == "basefilea.azm"); - UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "android"); for (auto& payload : payloadList) { @@ -1526,28 +1528,28 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); - es3outs.clear(); - es3outs2.clear(); + androidouts.clear(); + androidouts2.clear(); pcouts.clear(); pcouts2.clear(); - es3outs.push_back(cacheRoot.filePath(QString("es3/basefilez.arc2"))); - es3outs2.push_back(cacheRoot.filePath(QString("es3/basefileaz.azm2"))); - // note that the ES3 outs have changed + androidouts.push_back(cacheRoot.filePath(QString("android/basefilez.arc2"))); + androidouts2.push_back(cacheRoot.filePath(QString("android/basefileaz.azm2"))); + // note that the android outs have changed // but the pc outs are still the same. pcouts.push_back(cacheRoot.filePath(QString("pc/basefile.arc2"))); pcouts2.push_back(cacheRoot.filePath(QString("pc/basefile.azm2"))); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts[0], "newfile.")); UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcouts[0], "newfile.")); - UNIT_TEST_EXPECT_TRUE(CreateDummyFile(es3outs2[0], "newfile.")); + UNIT_TEST_EXPECT_TRUE(CreateDummyFile(androidouts2[0], "newfile.")); UNIT_TEST_EXPECT_TRUE(CreateDummyFile(pcouts2[0], "newfile.")); changedInputResults.clear(); assetMessages.clear(); @@ -1555,12 +1557,12 @@ namespace AssetProcessor // send all the done messages simultaneously: response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 1)); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[0].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(es3outs2[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 2)); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(androidouts2[0].toUtf8().constData(), AZ::Uuid::CreateNull(), 2)); QMetaObject::invokeMethod(&apm, "AssetProcessed", Qt::QueuedConnection, Q_ARG(JobEntry, processResults[1].m_jobEntry), Q_ARG(AssetBuilderSDK::ProcessJobResponse, response)); response.m_outputProducts.clear(); @@ -1620,11 +1622,11 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); // --------- same result as above ---------- - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and es3,since we have two recognizer for .txt file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // 2 each for pc and android,since we have two recognizer for .txt file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_computedFingerprint != 0); @@ -1645,9 +1647,9 @@ namespace AssetProcessor absolutePath = watchFolderPath + "/" + relativePathFromWatchFolder; unsigned int fingerprintForPC = 0; - unsigned int fingerprintForES3 = 0; + unsigned int fingerprintForANDROID = 0; - ComputeFingerprints(fingerprintForPC, fingerprintForES3, config, watchFolderPath, relativePathFromWatchFolder); + ComputeFingerprints(fingerprintForPC, fingerprintForANDROID, config, watchFolderPath, relativePathFromWatchFolder); processResults.clear(); QMetaObject::invokeMethod(&apm, "AssessModifiedFile", Qt::QueuedConnection, Q_ARG(QString, absolutePath)); @@ -1655,11 +1657,11 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // // 2 each for pc and es3,since we have two recognizer for .xxx file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // // 2 each for pc and android,since we have two recognizer for .xxx file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); @@ -1681,11 +1683,11 @@ namespace AssetProcessor // we never actually submitted any fingerprints or indicated success, so the same number of jobs should occur as before sortAssetToProcessResultList(processResults); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // // 2 each for pc and es3,since we have two recognizer for .xxx file + UNIT_TEST_EXPECT_TRUE(processResults.size() == 4); // // 2 each for pc and android,since we have two recognizer for .xxx file UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == processResults[1].m_jobEntry.m_platformInfo.m_identifier); UNIT_TEST_EXPECT_TRUE(processResults[2].m_jobEntry.m_platformInfo.m_identifier == processResults[3].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); UNIT_TEST_EXPECT_TRUE((processResults[2].m_jobEntry.m_platformInfo.m_identifier == "pc")); UNIT_TEST_EXPECT_TRUE((processResults[3].m_jobEntry.m_platformInfo.m_identifier == "pc")); @@ -1705,7 +1707,7 @@ namespace AssetProcessor // now re-perform the same test, this time only the pc ones should re-appear. // this should happen because we're changing the extra params, which should be part of the fingerprint // if this unit test fails, check to make sure that the extra params are being ingested into the fingerprint computation functions - // and also make sure that the jobs that are for the remaining es3 platform don't change. + // and also make sure that the jobs that are for the remaining android platform don't change. // store the UUID so that we can insert the new one with the same UUID AZStd::shared_ptr builderTxt2Builder; @@ -1743,12 +1745,12 @@ namespace AssetProcessor // --------------------- unsigned int newfingerprintForPC = 0; - unsigned int newfingerprintForES3 = 0; + unsigned int newfingerprintForANDROID = 0; - ComputeFingerprints(newfingerprintForPC, newfingerprintForES3, config, watchFolderPath, relativePathFromWatchFolder); + ComputeFingerprints(newfingerprintForPC, newfingerprintForANDROID, config, watchFolderPath, relativePathFromWatchFolder); UNIT_TEST_EXPECT_TRUE(newfingerprintForPC != fingerprintForPC);//Fingerprints should be different - UNIT_TEST_EXPECT_TRUE(newfingerprintForES3 == fingerprintForES3);//Fingerprints are same + UNIT_TEST_EXPECT_TRUE(newfingerprintForANDROID == fingerprintForANDROID);//Fingerprints are same config.RemoveRecognizer("xxx files 2 (builder2)"); mockAppManager.UnRegisterAssetRecognizerAsBuilder("xxx files 2 (builder2)"); @@ -1763,18 +1765,18 @@ namespace AssetProcessor absolutePath = AssetUtilities::NormalizeFilePath(absolutePath); QMetaObject::invokeMethod(&apm, "AssessModifiedFile", Qt::QueuedConnection, Q_ARG(QString, absolutePath)); UNIT_TEST_EXPECT_TRUE(BlockUntil(idling, 5000)); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 2); // pc and es3 + UNIT_TEST_EXPECT_TRUE(processResults.size() == 2); // pc and android UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier != processResults[1].m_jobEntry.m_platformInfo.m_identifier); - UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "pc") || (processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3")); - UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "pc") || (processResults[1].m_jobEntry.m_platformInfo.m_identifier == "es3")); + UNIT_TEST_EXPECT_TRUE((processResults[0].m_jobEntry.m_platformInfo.m_identifier == "pc") || (processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android")); + UNIT_TEST_EXPECT_TRUE((processResults[1].m_jobEntry.m_platformInfo.m_identifier == "pc") || (processResults[1].m_jobEntry.m_platformInfo.m_identifier == "android")); unsigned int newfingerprintForPCAfterVersionChange = 0; - unsigned int newfingerprintForES3AfterVersionChange = 0; + unsigned int newfingerprintForANDROIDAfterVersionChange = 0; - ComputeFingerprints(newfingerprintForPCAfterVersionChange, newfingerprintForES3AfterVersionChange, config, watchFolderPath, relativePathFromWatchFolder); + ComputeFingerprints(newfingerprintForPCAfterVersionChange, newfingerprintForANDROIDAfterVersionChange, config, watchFolderPath, relativePathFromWatchFolder); UNIT_TEST_EXPECT_TRUE((newfingerprintForPCAfterVersionChange != fingerprintForPC) || (newfingerprintForPCAfterVersionChange != newfingerprintForPC));//Fingerprints should be different - UNIT_TEST_EXPECT_TRUE((newfingerprintForES3AfterVersionChange != fingerprintForES3) || (newfingerprintForES3AfterVersionChange != newfingerprintForES3));//Fingerprints should be different + UNIT_TEST_EXPECT_TRUE((newfingerprintForANDROIDAfterVersionChange != fingerprintForANDROID) || (newfingerprintForANDROIDAfterVersionChange != newfingerprintForANDROID));//Fingerprints should be different //------Test for Files which are excluded processResults.clear(); @@ -1919,7 +1921,7 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(processResults.size() == 0); // nothing to process - // we are aware that 4 products went missing (es3 and pc versions of the 2 files since we renamed the SOURCE folder) + // we are aware that 4 products went missing (android and pc versions of the 2 files since we renamed the SOURCE folder) UNIT_TEST_EXPECT_TRUE(assetMessages.size() == 4); for (auto element : assetMessages) { @@ -2178,8 +2180,8 @@ namespace AssetProcessor UNIT_TEST_EXPECT_TRUE(assetMessages[2].m_assetId != AZ::Data::AssetId()); UNIT_TEST_EXPECT_TRUE(assetMessages[3].m_assetId != AZ::Data::AssetId()); - UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "es3"); - UNIT_TEST_EXPECT_TRUE(assetMessages[1].m_platform == "es3"); + UNIT_TEST_EXPECT_TRUE(assetMessages[0].m_platform == "android"); + UNIT_TEST_EXPECT_TRUE(assetMessages[1].m_platform == "android"); UNIT_TEST_EXPECT_TRUE(assetMessages[2].m_platform == "pc"); UNIT_TEST_EXPECT_TRUE(assetMessages[3].m_platform == "pc"); @@ -2212,12 +2214,12 @@ namespace AssetProcessor mockAppManager.UnRegisterAllBuilders(); AssetRecognizer abt_rec1; - AssetPlatformSpec abt_speces3; + AssetPlatformSpec abt_specandroid; abt_rec1.m_name = "UnitTestTextBuilder1"; abt_rec1.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard); //abt_rec1.m_regexp.setPatternSyntax(QRegExp::Wildcard); //abt_rec1.m_regexp.setPattern("*.txt"); - abt_rec1.m_platformSpecs.insert("es3", speces3); + abt_rec1.m_platformSpecs.insert("android", specandroid); mockAppManager.RegisterAssetRecognizerAsBuilder(abt_rec1); AssetRecognizer abt_rec2; @@ -2266,8 +2268,8 @@ namespace AssetProcessor sortAssetToProcessResultList(processResults); - UNIT_TEST_EXPECT_TRUE(processResults.size() == 2); // 1 for pc and es3 - UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == "es3"); + UNIT_TEST_EXPECT_TRUE(processResults.size() == 2); // 1 for pc and android + UNIT_TEST_EXPECT_TRUE(processResults[0].m_jobEntry.m_platformInfo.m_identifier == "android"); UNIT_TEST_EXPECT_TRUE(processResults[1].m_jobEntry.m_platformInfo.m_identifier == "pc"); UNIT_TEST_EXPECT_TRUE(QString::compare(processResults[0].m_jobEntry.GetAbsoluteSourcePath(), absolutePath, Qt::CaseInsensitive) == 0); UNIT_TEST_EXPECT_TRUE(QString::compare(processResults[1].m_jobEntry.GetAbsoluteSourcePath(), absolutePath, Qt::CaseInsensitive) == 0); diff --git a/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp index 29a0570d39..992cf09539 100644 --- a/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/ConnectionUnitTests.cpp @@ -17,16 +17,16 @@ void ConnectionUnitTest::StartTest() m_testConnection.SetAssetPlatformsString("pc"); AzFramework::AssetSystem::AssetNotificationMessage testMessage; EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(0); - m_testConnection.SendPerPlatform(0, testMessage, "osx_gl"); + m_testConnection.SendPerPlatform(0, testMessage, "mac"); EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(1); m_testConnection.SendPerPlatform(0, testMessage, "pc"); - m_testConnection.SetAssetPlatformsString("pc,es3"); + m_testConnection.SetAssetPlatformsString("pc,android"); EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(1); m_testConnection.SendPerPlatform(0, testMessage, "pc"); EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(0); - m_testConnection.SendPerPlatform(0, testMessage, "osx_gl"); + m_testConnection.SendPerPlatform(0, testMessage, "mac"); EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(1); - m_testConnection.SendPerPlatform(0, testMessage, "es3"); + m_testConnection.SendPerPlatform(0, testMessage, "android"); EXPECT_CALL(m_testConnection, Send(testing::_, testing::_)).Times(0); // Intended partial string match test - shouldn't send m_testConnection.SendPerPlatform(0, testMessage, "es"); diff --git a/Code/Tools/AssetProcessor/native/unittests/MockConnectionHandler.h b/Code/Tools/AssetProcessor/native/unittests/MockConnectionHandler.h index f0553d5e84..75ffdfe218 100644 --- a/Code/Tools/AssetProcessor/native/unittests/MockConnectionHandler.h +++ b/Code/Tools/AssetProcessor/native/unittests/MockConnectionHandler.h @@ -63,7 +63,7 @@ namespace AssetProcessor size_t SendPerPlatform(unsigned int serial, const AzFramework::AssetSystem::BaseAssetProcessorMessage& message, const QString& platform) override { - if (QString::compare(platform, "pc", Qt::CaseInsensitive) == 0 || QString::compare(platform, "es3", Qt::CaseInsensitive) == 0) + if (QString::compare(platform, "pc", Qt::CaseInsensitive) == 0 || QString::compare(platform, "android", Qt::CaseInsensitive) == 0) { return Send(serial, message); } @@ -72,7 +72,7 @@ namespace AssetProcessor size_t SendRawPerPlatform(unsigned int type, unsigned int serial, const QByteArray& data, const QString& platform) override { - if (QString::compare(platform, "pc", Qt::CaseInsensitive) == 0 || QString::compare(platform, "es3", Qt::CaseInsensitive) == 0) + if (QString::compare(platform, "pc", Qt::CaseInsensitive) == 0 || QString::compare(platform, "android", Qt::CaseInsensitive) == 0) { return SendRaw(type, serial, data); } diff --git a/Code/Tools/AssetProcessor/native/unittests/PlatformConfigurationUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/PlatformConfigurationUnitTests.cpp index e09a6366a1..ff29cf2ca9 100644 --- a/Code/Tools/AssetProcessor/native/unittests/PlatformConfigurationUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/PlatformConfigurationUnitTests.cpp @@ -64,7 +64,7 @@ void PlatformConfigurationTests::StartTest() PlatformConfiguration config; config.EnablePlatform({ "pc",{ "desktop", "host" } }, true); - config.EnablePlatform({ "es3",{ "mobile", "android" } }, true); + config.EnablePlatform({ "android",{ "mobile", "android" } }, true); config.EnablePlatform({ "fandago",{ "console" } }, false); AZStd::vector platforms; config.PopulatePlatformsForScanFolder(platforms); @@ -88,15 +88,15 @@ void PlatformConfigurationTests::StartTest() AssetRecognizer rec; AssetPlatformSpec specpc; - AssetPlatformSpec speces3; + AssetPlatformSpec specandroid; AssetPlatformSpec specfandago; specpc.m_extraRCParams = ""; // blank must work - speces3.m_extraRCParams = "testextraparams"; + specandroid.m_extraRCParams = "testextraparams"; rec.m_name = "txt files"; rec.m_patternMatcher = AssetBuilderSDK::FilePatternMatcher("*.txt", AssetBuilderSDK::AssetBuilderPattern::Wildcard); rec.m_platformSpecs.insert("pc", specpc); - rec.m_platformSpecs.insert("es3", speces3); + rec.m_platformSpecs.insert("android", specandroid); rec.m_platformSpecs.insert("fandago", specfandago); config.AddRecognizer(rec); @@ -111,7 +111,7 @@ void PlatformConfigurationTests::StartTest() UNIT_TEST_EXPECT_TRUE(config.GetEnabledPlatforms().size() == 2); UNIT_TEST_EXPECT_TRUE(config.GetEnabledPlatforms()[0].m_identifier == "pc"); - UNIT_TEST_EXPECT_TRUE(config.GetEnabledPlatforms()[1].m_identifier == "es3"); + UNIT_TEST_EXPECT_TRUE(config.GetEnabledPlatforms()[1].m_identifier == "android"); UNIT_TEST_EXPECT_TRUE(config.GetScanFolderCount() == 11); UNIT_TEST_EXPECT_FALSE(config.GetScanFolderAt(0).IsRoot()); diff --git a/Code/Tools/AssetProcessor/native/unittests/RCcontrollerUnitTests.cpp b/Code/Tools/AssetProcessor/native/unittests/RCcontrollerUnitTests.cpp index 0e771f7fd1..02b98e5e33 100644 --- a/Code/Tools/AssetProcessor/native/unittests/RCcontrollerUnitTests.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/RCcontrollerUnitTests.cpp @@ -239,14 +239,14 @@ void RCcontrollerUnitTests::RunRCControllerTests() createdJobs.push_back(job); } - // double them up for "es3" to make sure that platform is respected + // double them up for "android" to make sure that platform is respected for (QString name : tempJobNames) { AZ::Uuid uuidOfSource = AZ::Uuid::CreateName(name.toUtf8().constData()); RCJob* job0 = new RCJob(rcJobListModel); AssetProcessor::JobDetails jobDetails; jobDetails.m_jobEntry.m_databaseSourceName = jobDetails.m_jobEntry.m_pathRelativeToWatchFolder = name; - jobDetails.m_jobEntry.m_platformInfo = { "es3" ,{ "mobile", "renderer" } }; + jobDetails.m_jobEntry.m_platformInfo = { "android" ,{ "mobile", "renderer" } }; jobDetails.m_jobEntry.m_jobKey = "Compile Other Stuff"; jobDetails.m_jobEntry.m_sourceFileUUID = uuidOfSource; job0->Init(jobDetails); @@ -490,7 +490,7 @@ void RCcontrollerUnitTests::RunRCControllerTests() UNIT_TEST_EXPECT_FALSE(gotJobsInQueueCall); // submit same job but different platform: - details.m_jobEntry = JobEntry("d:/test", "test1.txt", "test1.txt", AZ::Uuid("{7954065D-CFD1-4666-9E4C-3F36F417C7AC}"), { "es3" ,{ "mobile", "renderer" } }, "Test Job", 1234, 3, sourceId); + details.m_jobEntry = JobEntry("d:/test", "test1.txt", "test1.txt", AZ::Uuid("{7954065D-CFD1-4666-9E4C-3F36F417C7AC}"), { "android" ,{ "mobile", "renderer" } }, "Test Job", 1234, 3, sourceId); m_rcController.JobSubmitted(details); QCoreApplication::processEvents(QEventLoop::AllEvents); diff --git a/Code/Tools/AssetProcessor/native/unittests/UnitTestRunner.cpp b/Code/Tools/AssetProcessor/native/unittests/UnitTestRunner.cpp index 1e10002b53..650f3120dd 100644 --- a/Code/Tools/AssetProcessor/native/unittests/UnitTestRunner.cpp +++ b/Code/Tools/AssetProcessor/native/unittests/UnitTestRunner.cpp @@ -54,7 +54,7 @@ namespace UnitTestUtils { void SleepForMinimumFileSystemTime() { - // note that on OSX, the file system has a resolution of 1 second, and since we're using modtime for a bunch of things, + // note that on Mac, the file system has a resolution of 1 second, and since we're using modtime for a bunch of things, // not the actual hash files, we have to wait different amount depending on the OS. #ifdef AZ_PLATFORM_WINDOWS int milliseconds = 1; diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp index c85801a074..579c7f93d3 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManager.cpp @@ -622,13 +622,14 @@ bool ApplicationManager::Activate() { if (!AssetUtilities::ComputeAssetRoot(m_systemRoot)) { + AZ_Error(AssetProcessor::ConsoleChannel, false, "Unable to compute the asset root for the project, this application cannot launch until this is fixed."); return false; } auto projectName = AssetUtilities::ComputeProjectName(); if (projectName.isEmpty()) { - AZ_Error(AssetProcessor::ConsoleChannel, false, "Unable to detect name of current game project. Is bootstrap.cfg appropriately configured?"); + AZ_Error(AssetProcessor::ConsoleChannel, false, "Unable to detect name of current game project. Configure your game project name to launch this application."); return false; } diff --git a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp index a17819bba2..7c4f429da4 100644 --- a/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp +++ b/Code/Tools/AssetProcessor/native/utilities/ApplicationManagerBase.cpp @@ -1191,6 +1191,7 @@ bool ApplicationManagerBase::Activate() QDir projectCache; if (!AssetUtilities::ComputeProjectCacheRoot(projectCache)) { + AZ_Error("AssetProcessor", false, "Could not compute project cache root, please configure your project correctly to launch Asset Processor."); return false; } @@ -1200,22 +1201,27 @@ bool ApplicationManagerBase::Activate() // Shutdown if the disk has less than 128MB of free space if (!CheckSufficientDiskSpace(projectCache.absolutePath(), 128 * 1024 * 1024, true)) { + // CheckSufficientDiskSpace reports an error if disk space is low. return false; } bool appInited = InitApplicationServer(); if (!appInited) { + AZ_Error( + "AssetProcessor", false, "InitApplicationServer failed, something internal to Asset Processor has failed, please report this to support if you encounter this error."); return false; } if (!InitAssetDatabase()) { + // AssetDatabaseConnection::OpenDatabase reports any errors it encounters. return false; } if (!ApplicationManager::Activate()) { + // ApplicationManager::Activate() reports any errors it encounters. return false; } @@ -1230,6 +1236,7 @@ bool ApplicationManagerBase::Activate() m_isCurrentlyLoadingGems = true; if (!ActivateModules()) { + // ActivateModules reports any errors it encounters. m_isCurrentlyLoadingGems = false; return false; } @@ -1299,6 +1306,7 @@ bool ApplicationManagerBase::Activate() { if (!m_applicationServer->startListening()) { + // startListening reports any errors it encounters. return false; } } diff --git a/Code/Tools/AssetProcessor/testdata/config_broken_badplatform/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_broken_badplatform/AssetProcessorPlatformConfig.setreg index 468ab68f5d..05ed19cb74 100644 --- a/Code/Tools/AssetProcessor/testdata/config_broken_badplatform/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetProcessor/testdata/config_broken_badplatform/AssetProcessorPlatformConfig.setreg @@ -5,11 +5,11 @@ "Platform pc": { "tags": "tools,renderer" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer" }, "Platforms": { - "es3": "enabled" + "android": "enabled" }, "ScanFolder Game": { "watch": "@PROJECTROOT@", diff --git a/Code/Tools/AssetProcessor/testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg index 507fe4afb1..23f5725548 100644 --- a/Code/Tools/AssetProcessor/testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetProcessor/testdata/config_broken_noscans/AssetProcessorPlatformConfig.setreg @@ -5,7 +5,7 @@ "Platform pc": { "tags": "tools,renderer" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer" }, "RC i_caf": { diff --git a/Code/Tools/AssetProcessor/testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg index 0e687062b2..32c0af0593 100644 --- a/Code/Tools/AssetProcessor/testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetProcessor/testdata/config_broken_recognizers/AssetProcessorPlatformConfig.setreg @@ -5,7 +5,7 @@ "Platform pc": { "tags": "tools,renderer" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer" }, "ScanFolder Game": { diff --git a/Code/Tools/AssetProcessor/testdata/config_regular/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_regular/AssetProcessorPlatformConfig.setreg index 1c5c487a46..c43996f3d5 100644 --- a/Code/Tools/AssetProcessor/testdata/config_regular/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetProcessor/testdata/config_regular/AssetProcessorPlatformConfig.setreg @@ -5,17 +5,17 @@ "Platform pc": { "tags": "tools,renderer" }, - "Platform es3": { + "Platform android": { "tags": "android,mobile,renderer" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer" }, "Platform server": { "tags": "server" }, "Platforms": { - "es3": "enabled", + "android": "enabled", "server": "enabled" }, "Jobs": { @@ -56,7 +56,7 @@ "glob": "*.i_caf", "params": "defaultparams", "server": "skip", - "es3": "mobile", + "android": "mobile", "priority": 5, "checkServer": true }, @@ -68,7 +68,7 @@ "RC mov": { "glob": "*.mov", "params": "copy", - "es3": "platformspecificoverride", + "android": "platformspecificoverride", "renderer": "rendererparams" }, "RC rend": { diff --git a/Code/Tools/AssetProcessor/testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg b/Code/Tools/AssetProcessor/testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg index e1c2d6e8cc..5fe1071fd5 100644 --- a/Code/Tools/AssetProcessor/testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg +++ b/Code/Tools/AssetProcessor/testdata/config_regular_platform_scanfolder/AssetProcessorPlatformConfig.setreg @@ -5,13 +5,13 @@ "Platform pc": { "tags": "tools,renderer" }, - "Platform es3": { + "Platform android": { "tags": "android,mobile,renderer" }, "Platform ios": { "tags": "mobile,renderer" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer" }, "Platform server": { @@ -21,7 +21,7 @@ "tags": "console,renderer" }, "Platforms": { - "es3": "enabled", + "android": "enabled", "ios": "enabled", "server": "enabled" }, @@ -54,14 +54,14 @@ "display": "folder1output", "recursive": 1, "order": 50000, - "include": "es3" + "include": "android" }, "ScanFolder Folder2": { "watch": "@ENGINEROOT@/Folder2", "display": "folder2output", "recursive": 1, "order": 60000, - "exclude": "es3" + "exclude": "android" }, "ScanFolder Folder3": { "watch": "@ENGINEROOT@/Folder3", @@ -80,7 +80,7 @@ "glob": "*.i_caf", "params": "defaultparams", "server": "skip", - "es3": "mobile", + "android": "mobile", "test": "copy", "priority": 5 }, @@ -92,7 +92,7 @@ "RC mov": { "glob": "*.mov", "params": "copy", - "es3": "platformspecificoverride", + "android": "platformspecificoverride", "renderer": "rendererparams" }, "RC rend": { diff --git a/Code/Tools/DeltaCataloger/Tests/tests_main.cpp b/Code/Tools/DeltaCataloger/Tests/tests_main.cpp index 67d6767a17..887889edcb 100644 --- a/Code/Tools/DeltaCataloger/Tests/tests_main.cpp +++ b/Code/Tools/DeltaCataloger/Tests/tests_main.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -45,6 +46,12 @@ public: protected: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + AZ::ComponentApplication::Descriptor desc; desc.m_useExistingAllocator = true; desc.m_enableDrilling = false; // we already created a memory driller for the test (AllocatorsFixture) diff --git a/Code/Tools/GridHub/GridHub/gridhub.cpp b/Code/Tools/GridHub/GridHub/gridhub.cpp index 7f85ade238..4b2d8e425b 100644 --- a/Code/Tools/GridHub/GridHub/gridhub.cpp +++ b/Code/Tools/GridHub/GridHub/gridhub.cpp @@ -552,7 +552,7 @@ GridHubComponent::OnMemberJoined([[maybe_unused]] GridMate::GridSession* session switch( member->GetPlatformId() ) { case AZ::PlatformID::PLATFORM_WINDOWS_64: - case AZ::PlatformID::PLATFORM_APPLE_OSX: + case AZ::PlatformID::PLATFORM_APPLE_MAC: { GridMate::string localMachineName = GridMate::Utils::GetMachineAddress(); if( member->GetMachineName() == localMachineName ) diff --git a/Code/Tools/ProjectManager/CMakeLists.txt b/Code/Tools/ProjectManager/CMakeLists.txt index e2b5aaf696..a655600325 100644 --- a/Code/Tools/ProjectManager/CMakeLists.txt +++ b/Code/Tools/ProjectManager/CMakeLists.txt @@ -37,11 +37,8 @@ ly_add_target( PRIVATE PY_PACKAGE="${python_package_name}" INCLUDE_DIRECTORIES - PUBLIC - . PRIVATE Source - BUILD_DEPENDENCIES PRIVATE 3rdParty::Qt::Core diff --git a/Code/Tools/ProjectManager/Resources/Add.svg b/Code/Tools/ProjectManager/Resources/Add.svg index d2b9b2e0a6..4fa30932fb 100644 --- a/Code/Tools/ProjectManager/Resources/Add.svg +++ b/Code/Tools/ProjectManager/Resources/Add.svg @@ -1,4 +1,3 @@ - diff --git a/Code/Tools/ProjectManager/Resources/AddOffset.svg b/Code/Tools/ProjectManager/Resources/AddOffset.svg new file mode 100644 index 0000000000..4c62234070 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/AddOffset.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/AddOffset_Hover.svg b/Code/Tools/ProjectManager/Resources/AddOffset_Hover.svg new file mode 100644 index 0000000000..a0e2a07eda --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/AddOffset_Hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/ArrowBack.svg b/Code/Tools/ProjectManager/Resources/ArrowBack.svg new file mode 100644 index 0000000000..749bb5a02e --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/ArrowBack.svg @@ -0,0 +1,3 @@ + + + diff --git a/Code/Tools/ProjectManager/Resources/ArrowDownLine.svg b/Code/Tools/ProjectManager/Resources/ArrowDownLine.svg new file mode 100644 index 0000000000..8418431f11 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/ArrowDownLine.svg @@ -0,0 +1,3 @@ + + + diff --git a/Code/Tools/ProjectManager/Resources/ArrowUpLine.svg b/Code/Tools/ProjectManager/Resources/ArrowUpLine.svg new file mode 100644 index 0000000000..d7f26fdad5 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/ArrowUpLine.svg @@ -0,0 +1,3 @@ + + + diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg b/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg new file mode 100644 index 0000000000..bfa5f83cf6 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/FirstTimeBackgroundImage.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7088e902885d98953f6a1715efab319c063a4ab8918fd0e810251c8ed82b8514 +size 542983 diff --git a/Code/Tools/ProjectManager/Resources/Backgrounds/LICENSE.TXT b/Code/Tools/ProjectManager/Resources/Backgrounds/LICENSE.TXT new file mode 100644 index 0000000000..5adf81a289 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/Backgrounds/LICENSE.TXT @@ -0,0 +1,4 @@ +SPDX-FileCopyrightText: Unsplash grants you an irrevocable, nonexclusive, worldwide copyright license to download, copy, +SPDX-FileCopyrightText: modify, distribute, perform, and use photos from Unsplash for free, including for commercial +SPDX-FileCopyrightText: purposes, without permission from or attributing the photographer or Unsplash. This license does +SPDX-FileCopyrightText: not include the right to compile photos from Unsplash to replicate a similar or competing service. \ No newline at end of file diff --git a/Code/Tools/ProjectManager/Resources/DefaultProjectImage.png b/Code/Tools/ProjectManager/Resources/DefaultProjectImage.png new file mode 100644 index 0000000000..cc1eda5bb8 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/DefaultProjectImage.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f82f22df64b93d4bec91e56b60efa3d5ce2915ce388a2dc627f1ab720678e3d5 +size 334987 diff --git a/Code/Tools/ProjectManager/Resources/FolderOffset.svg b/Code/Tools/ProjectManager/Resources/FolderOffset.svg new file mode 100644 index 0000000000..a048fbcc39 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/FolderOffset.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/FolderOffset_Hover.svg b/Code/Tools/ProjectManager/Resources/FolderOffset_Hover.svg new file mode 100644 index 0000000000..fb13cd8558 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/FolderOffset_Hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qrc b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc new file mode 100644 index 0000000000..04d5e98a10 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qrc @@ -0,0 +1,30 @@ + + + ProjectManager.qss + + + Add.svg + AddOffset.svg + AddOffset_Hover.svg + ArrowBack.svg + build.svg + FolderOffset.svg + FolderOffset_Hover.svg + Select_Folder.svg + o3de_editor.ico + Windows.svg + Android.svg + iOS.svg + Linux.svg + macOS.svg + DefaultProjectImage.png + ArrowDownLine.svg + ArrowUpLine.svg + o3de.svg + menu.svg + menu_hover.svg + Backgrounds/FirstTimeBackgroundImage.jpg + ArrowDownLine.svg + ArrowUpLine.svg + + diff --git a/Code/Tools/ProjectManager/Resources/ProjectManager.qss b/Code/Tools/ProjectManager/Resources/ProjectManager.qss index e69de29bb2..a85b911c15 100644 --- a/Code/Tools/ProjectManager/Resources/ProjectManager.qss +++ b/Code/Tools/ProjectManager/Resources/ProjectManager.qss @@ -0,0 +1,366 @@ +/************** General (MainWindow) **************/ +QMainWindow { + background:#131313 url(:/o3de.svg) no-repeat top left; + /* position the logo using padding and background-origin, Qt does not support background-position pixels */ + background-origin:content; + padding:25px 16px; + margin:0; +} + +QPushButton:focus { + outline: none; + border:1px solid #1e70eb; +} + +QTabBar { + background-color: transparent; +} +QTabWidget::tab-bar +{ + left: 78px; /* make room for the logo */ +} +QTabBar::tab { + height:82px; + background-color: transparent; + font-size:24px; + min-width:100px; + margin-right:40px; + border-bottom: 3px solid transparent; +} +QTabBar::tab:text +{ + text-align:left; +} +QTabWidget::pane { + background-color: #333333; + border:0 none; +} +QTabBar::tab:selected +{ + border-bottom: 3px solid #1e70eb; + color: #1e70eb; +} +QTabBar::tab:hover +{ + color: #1e70eb; +} +QTabBar::tab:pressed +{ + color: #0e60eb; +} + +/************** General (Forms) **************/ + +#formLineEditWidget, +#formBrowseEditWidget { + max-width: 890px; +} + +#formFrame { + max-width: 840px; + background-color: #444444; + border:1px solid #dddddd; + border-radius: 4px; + padding: 0px 10px 2px 6px; + margin-top:10px; + margin-left:50px; +} + +#formFrame[Focus="true"] { + border:1px solid #1e70eb; +} + +#formFrame[Valid="false"] { + border:1px solid red; +} + +#formFrame QLabel { + font-size: 13px; + color: #cccccc; +} + +#formFrame QPushButton { + background-color: transparent; + background:transparent url(:/Select_Folder.svg) no-repeat center; + qproperty-flat: true; +} + +#formFrame QPushButton:focus { + border:none; +} + +#formFrame QLineEdit { + background-color: rgba(0,0,0,0); + font-size: 18px; + color: #ffffff; + border:0; + line-height: 30px; + height: 1em; + padding-top: -4px; +} + + +#formErrorLabel { + color: #ec3030; + font-size: 14px; + margin-left: 50px; +} + +#formTitleLabel { + font-size:21px; + color:#ffffff; + margin: 24px 0 10px 50px; +} + +/************** General (Modal windows) **************/ + +#header { + background-color:#111111; + min-height:80px; + max-height:80px; +} + +#header QPushButton { + /* settings min/max lets us use a fixed size */ + min-width: 24px; + max-width: 24px; + min-height: 24px; + max-height: 24px; + margin: 20px 10px 0px 10px; + background:transparent url(:/ArrowBack.svg) no-repeat center; + background-origin:content; + qproperty-flat: true; + qproperty-iconSize: 50px; +} + +#header QPushButton:focus { + border:none; +} +#header QPushButton:hover { + background:#333333 url(:/ArrowBack.svg) no-repeat center; +} +#header QPushButton:pressed { + background:#222222 url(:/ArrowBack.svg) no-repeat center; +} + +#headerTitle { + font-size:14px; + text-align:left; + margin:0; + padding-top:10px; + padding-bottom:-5px; + min-height:15px; + max-height:15px; +} +#headerSubTitle { + font-size:24px; + text-align:left; + margin:0; + min-height:42px; + max-height:42px; +} + +#body { + background-color:#333333; +} +#footer { + /* settings min/max lets us use a fixed size */ + min-width: 50px; + min-height:54px; + max-height:54px; +} + +#footer > QPushButton { + qproperty-flat: true; + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #0095f2, stop: 1.0 #1e70eb); + border-radius: 3px; + min-height: 28px; + max-height: 28px; + min-width: 150px; + margin-right:30px; +} +#footer > QPushButton:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #10A5f2, stop: 1.0 #2e80eb); +} +#footer > QPushButton:pressed { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #0085e2, stop: 1.0 #0e60db); +} + +#footer > QPushButton[secondary="true"] { + margin-right: 10px; + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #888888, stop: 1.0 #555555); +} +#footer > QPushButton[secondary="true"]:hover { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #999999, stop: 1.0 #666666); +} +#footer > QPushButton[secondary="true"]:pressed { + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #555555, stop: 1.0 #777777); +} + +/************** Project Settings **************/ +#projectSettings { + margin-top:42px; +} + +#projectTemplate { + margin: 55px 0 0 50px; + max-width: 780px; + min-height:200px; + max-height:200px; +} +#projectTemplateLabel { + font-size:16px; + font-weight:100; +} + +#projectTemplateDetailsLabel { + font-size:14px; + min-height:40px; + margin-bottom:20px; +} + +#projectTemplateDetails { + background-color:#444444; + max-width:240px; + min-width:240px; + margin-left:30px; +} + +/************** Projects **************/ +#firstTimeContent > #titleLabel { + font-size:60px; + margin:73px 0px 0px 0px; + qproperty-indent: 0; +} + +#firstTimeContent > #introLabel { + font-size:14px; + margin:10px 0 60px 0; + qproperty-indent: 0; +} + +#firstTimeContent > QPushButton { + min-width: 210px; + max-width: 210px; + min-height: 276px; + max-height: 276px; + qproperty-flat: true; + background-origin:content; + font-size:14px; + border: 1px solid #ffffff; +} + +#firstTimeContent > QPushButton:hover { + border: 1px solid #1e70eb; + color: #1e70eb; +} + +#firstTimeContent > QPushButton:pressed { + border: 1px solid #0e60eb; + color: #0e60eb; +} + +#createProjectButton { + background:rgba(0,0,0,180) url(:/AddOffset.svg) no-repeat center center; +} +#createProjectButton:hover, +#createProjectButton:pressed { + background:rgba(0,0,0,180) url(:/AddOffset_Hover.svg) no-repeat center center; +} + +#addProjectButton { + background:rgba(0,0,0,180) url(:/FolderOffset.svg) no-repeat center center; +} +#addProjectButton:hover, +#addProjectButton:pressed { + background:rgba(0,0,0,180) url(:/FolderOffset_Hover.svg) no-repeat center center; +} + +#projectsContent > QFrame { + margin-top:60px; +} + +#projectsContent > QFrame > #titleLabel { + font-size:24px; + qproperty-indent: 0; +} + +#projectsContent > QScrollArea { + margin-top:40px; + margin-bottom:5px; +} + +#projectButton > #labelButton { + border:1px solid white; +} +#projectButton > #labelButton:hover, +#projectButton > #labelButton:pressed { + border:1px solid #1e70eb; +} + +#projectButton > QFrame { + margin-top:6px; +} + +#projectButton > QFrame > QLabel { + font-weight:bold; + font-size:14px; + qproperty-indent: 0; +} + +#projectMenuButton { + qproperty-flat: true; + background:transparent url(:/menu.svg) no-repeat center center; + max-width:30px; + min-width:30px; + max-height:14px; + min-height:14px; +} + +#projectsContent > QFrame > #newProjectButton { + min-width:150px; + max-width:150px; + min-height:26px; + max-height:26px; +} + +#labelButtonOverlay { + background-color: rgba(50,50,50,200); + min-width:210px; + max-width:210px;; + min-height:278px; + max-height:278px; +} + +/************** Gem Catalog **************/ + +#GemCatalogTitle { + font-size: 18px; +} + +/************** Gem Catalog (Inspector) **************/ + +#GemCatalogInspector { + background-color: #444444; +} + +/************** Gem Catalog (Filter/left pane) **************/ + +#GemCatalogFilterWidget { + background-color: #444444; +} + +#GemCatalogHeaderWidget { + background-color: #1E252F; +} + +#GemCatalogFilterCategoryTitle { + font-size: 12px; + font-weight: 600; +} diff --git a/Code/Tools/ProjectManager/Resources/Select_Folder.svg b/Code/Tools/ProjectManager/Resources/Select_Folder.svg index 72dcd3385e..df20a06e76 100644 --- a/Code/Tools/ProjectManager/Resources/Select_Folder.svg +++ b/Code/Tools/ProjectManager/Resources/Select_Folder.svg @@ -1,4 +1,3 @@ - diff --git a/Code/Tools/ProjectManager/Resources/build.svg b/Code/Tools/ProjectManager/Resources/build.svg new file mode 100644 index 0000000000..b6c3546443 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/build.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Code/Tools/ProjectManager/Resources/menu.svg b/Code/Tools/ProjectManager/Resources/menu.svg new file mode 100644 index 0000000000..a639c74ab4 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/menu.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/menu_hover.svg b/Code/Tools/ProjectManager/Resources/menu_hover.svg new file mode 100644 index 0000000000..4eea63faca --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/menu_hover.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/Code/Tools/ProjectManager/Resources/o3de.svg b/Code/Tools/ProjectManager/Resources/o3de.svg new file mode 100644 index 0000000000..bb6e596a00 --- /dev/null +++ b/Code/Tools/ProjectManager/Resources/o3de.svg @@ -0,0 +1,3 @@ + + + diff --git a/Code/Tools/ProjectManager/Resources/o3de_editor.ico b/Code/Tools/ProjectManager/Resources/o3de_editor.ico index 0680ceea19..e7b77c35bf 100644 --- a/Code/Tools/ProjectManager/Resources/o3de_editor.ico +++ b/Code/Tools/ProjectManager/Resources/o3de_editor.ico @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a -size 107016 +oid sha256:d717f77fe01f45df934a61bbc215e5322447d21e16f3cebcf2a02f148178f266 +size 106449 diff --git a/Code/Tools/ProjectManager/Source/CreateProjectCtrl.cpp b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.cpp new file mode 100644 index 0000000000..69f0a3983d --- /dev/null +++ b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.cpp @@ -0,0 +1,140 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + CreateProjectCtrl::CreateProjectCtrl(QWidget* parent) + : ScreenWidget(parent) + { + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->setContentsMargins(0,0,0,0); + + m_header = new ScreenHeader(this); + m_header->setTitle(tr("Create a New Project")); + m_header->setSubTitle(tr("Enter Project Details")); + connect(m_header->backButton(), &QPushButton::clicked, this, &CreateProjectCtrl::HandleBackButton); + vLayout->addWidget(m_header); + + m_stack = new QStackedWidget(this); + m_stack->setObjectName("body"); + m_stack->setSizePolicy(QSizePolicy(QSizePolicy::Preferred,QSizePolicy::Expanding)); + m_stack->addWidget(new NewProjectSettingsScreen()); + m_stack->addWidget(new GemCatalogScreen()); + vLayout->addWidget(m_stack); + + QDialogButtonBox* backNextButtons = new QDialogButtonBox(); + backNextButtons->setObjectName("footer"); + vLayout->addWidget(backNextButtons); + + m_backButton = backNextButtons->addButton(tr("Back"), QDialogButtonBox::RejectRole); + m_backButton->setProperty("secondary", true); + m_nextButton = backNextButtons->addButton(tr("Next"), QDialogButtonBox::ApplyRole); + + connect(m_backButton, &QPushButton::clicked, this, &CreateProjectCtrl::HandleBackButton); + connect(m_nextButton, &QPushButton::clicked, this, &CreateProjectCtrl::HandleNextButton); + + Update(); + setLayout(vLayout); + } + + ProjectManagerScreen CreateProjectCtrl::GetScreenEnum() + { + return ProjectManagerScreen::CreateProject; + } + + void CreateProjectCtrl::HandleBackButton() + { + if (m_stack->currentIndex() > 0) + { + m_stack->setCurrentIndex(m_stack->currentIndex() - 1); + Update(); + } + else + { + emit GotoPreviousScreenRequest(); + } + } + void CreateProjectCtrl::HandleNextButton() + { + ScreenWidget* currentScreen = reinterpret_cast(m_stack->currentWidget()); + ProjectManagerScreen screenEnum = currentScreen->GetScreenEnum(); + + if (screenEnum == ProjectManagerScreen::NewProjectSettings) + { + auto newProjectScreen = reinterpret_cast(currentScreen); + if (newProjectScreen) + { + if (!newProjectScreen->Validate()) + { + QMessageBox::critical(this, tr("Invalid project settings"), tr("Invalid project settings")); + return; + } + + m_projectInfo = newProjectScreen->GetProjectInfo(); + m_projectTemplatePath = newProjectScreen->GetProjectTemplatePath(); + } + } + + if (m_stack->currentIndex() != m_stack->count() - 1) + { + m_stack->setCurrentIndex(m_stack->currentIndex() + 1); + Update(); + } + else + { + auto result = PythonBindingsInterface::Get()->CreateProject(m_projectTemplatePath, m_projectInfo); + if (result.IsSuccess()) + { + // adding gems is not implemented yet because we don't know what targets to add or how to add them + emit ChangeScreenRequest(ProjectManagerScreen::Projects); + } + else + { + QMessageBox::critical(this, tr("Project creation failed"), tr("Failed to create project.")); + } + } + } + + void CreateProjectCtrl::Update() + { + ScreenWidget* currentScreen = reinterpret_cast(m_stack->currentWidget()); + if (currentScreen && currentScreen->GetScreenEnum() == ProjectManagerScreen::GemCatalog) + { + m_header->setTitle(tr("Create Project")); + m_header->setSubTitle(tr("Configure project with Gems")); + m_nextButton->setText(tr("Create Project")); + } + else + { + m_header->setTitle(tr("Create Project")); + m_header->setSubTitle(tr("Enter Project Details")); + m_nextButton->setText(tr("Next")); + } + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.h b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h similarity index 57% rename from Code/Tools/ProjectManager/Source/ProjectsHomeScreen.h rename to Code/Tools/ProjectManager/Source/CreateProjectCtrl.h index 9fd5919d2d..01e3349b21 100644 --- a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.h +++ b/Code/Tools/ProjectManager/Source/CreateProjectCtrl.h @@ -13,31 +13,40 @@ #if !defined(Q_MOC_RUN) #include +#include #endif -namespace Ui -{ - class ProjectsHomeClass; -} +QT_FORWARD_DECLARE_CLASS(QStackedWidget) +QT_FORWARD_DECLARE_CLASS(QPushButton) +QT_FORWARD_DECLARE_CLASS(QLabel) namespace O3DE::ProjectManager { - class ProjectsHomeScreen + QT_FORWARD_DECLARE_CLASS(ScreenHeader) + + class CreateProjectCtrl : public ScreenWidget { - public: - explicit ProjectsHomeScreen(QWidget* parent = nullptr); - ~ProjectsHomeScreen() = default; + explicit CreateProjectCtrl(QWidget* parent = nullptr); + ~CreateProjectCtrl() = default; ProjectManagerScreen GetScreenEnum() override; protected slots: - void HandleNewProjectButton(); - void HandleAddProjectButton(); - void HandleEditProjectButton(); + void HandleBackButton(); + void HandleNextButton(); private: - QScopedPointer m_ui; + void Update(); + + QStackedWidget* m_stack; + ScreenHeader* m_header; + + QPushButton* m_backButton; + QPushButton* m_nextButton; + + QString m_projectTemplatePath; + ProjectInfo m_projectInfo; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineInfo.cpp b/Code/Tools/ProjectManager/Source/EngineInfo.cpp index 8043a498ff..934d3af9d8 100644 --- a/Code/Tools/ProjectManager/Source/EngineInfo.cpp +++ b/Code/Tools/ProjectManager/Source/EngineInfo.cpp @@ -14,8 +14,16 @@ namespace O3DE::ProjectManager { - EngineInfo::EngineInfo(const QString& path) + EngineInfo::EngineInfo(const QString& path, const QString& name, const QString& version, const QString& thirdPartyPath) : m_path(path) + , m_name(name) + , m_version(version) + , m_thirdPartyPath(thirdPartyPath) { } + + bool EngineInfo::IsValid() const + { + return !m_path.isEmpty(); + } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineInfo.h b/Code/Tools/ProjectManager/Source/EngineInfo.h index ada6e73a15..262c42e56b 100644 --- a/Code/Tools/ProjectManager/Source/EngineInfo.h +++ b/Code/Tools/ProjectManager/Source/EngineInfo.h @@ -22,8 +22,20 @@ namespace O3DE::ProjectManager { public: EngineInfo() = default; - EngineInfo(const QString& path); + EngineInfo(const QString& path, const QString& name, const QString& version, const QString& thirdPartyPath); + // from engine.json + QString m_version; + QString m_name; + QString m_thirdPartyPath; + + // from o3de_manifest.json QString m_path; + QString m_defaultProjectsFolder; + QString m_defaultGemsFolder; + QString m_defaultTemplatesFolder; + QString m_defaultRestrictedFolder; + + bool IsValid() const; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp index 1adab41c0e..6342041da4 100644 --- a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.cpp @@ -11,20 +11,109 @@ */ #include - -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace O3DE::ProjectManager { EngineSettingsScreen::EngineSettingsScreen(QWidget* parent) : ScreenWidget(parent) - , m_ui(new Ui::EngineSettingsClass()) { - m_ui->setupUi(this); + auto* layout = new QVBoxLayout(this); + layout->setAlignment(Qt::AlignTop); + + setObjectName("engineSettingsScreen"); + + EngineInfo engineInfo; + + AZ::Outcome engineInfoResult = PythonBindingsInterface::Get()->GetEngineInfo(); + if (engineInfoResult.IsSuccess()) + { + engineInfo = engineInfoResult.GetValue(); + } + + QLabel* formTitleLabel = new QLabel(tr("O3DE Settings"), this); + formTitleLabel->setObjectName("formTitleLabel"); + layout->addWidget(formTitleLabel); + + m_engineVersion = new FormLineEditWidget(tr("Engine Version"), engineInfo.m_version, this); + m_engineVersion->lineEdit()->setReadOnly(true); + layout->addWidget(m_engineVersion); + + m_thirdParty = new FormBrowseEditWidget(tr("3rd Party Software Folder"), engineInfo.m_thirdPartyPath, this); + m_thirdParty->lineEdit()->setValidator(new PathValidator(PathValidator::PathMode::ExistingFolder, this)); + m_thirdParty->lineEdit()->setReadOnly(true); + m_thirdParty->setErrorLabelText(tr("Please provide a valid path to a folder that exists")); + connect(m_thirdParty->lineEdit(), &QLineEdit::textChanged, this, &EngineSettingsScreen::OnTextChanged); + layout->addWidget(m_thirdParty); + + m_defaultProjects = new FormBrowseEditWidget(tr("Default Projects Folder"), engineInfo.m_defaultProjectsFolder, this); + m_defaultProjects->lineEdit()->setValidator(new PathValidator(PathValidator::PathMode::ExistingFolder, this)); + m_defaultProjects->lineEdit()->setReadOnly(true); + m_defaultProjects->setErrorLabelText(tr("Please provide a valid path to a folder that exists")); + connect(m_defaultProjects->lineEdit(), &QLineEdit::textChanged, this, &EngineSettingsScreen::OnTextChanged); + layout->addWidget(m_defaultProjects); + + m_defaultGems = new FormBrowseEditWidget(tr("Default Gems Folder"), engineInfo.m_defaultGemsFolder, this); + m_defaultGems->lineEdit()->setValidator(new PathValidator(PathValidator::PathMode::ExistingFolder, this)); + m_defaultGems->lineEdit()->setReadOnly(true); + m_defaultGems->setErrorLabelText(tr("Please provide a valid path to a folder that exists")); + connect(m_defaultGems->lineEdit(), &QLineEdit::textChanged, this, &EngineSettingsScreen::OnTextChanged); + layout->addWidget(m_defaultGems); + + m_defaultProjectTemplates = new FormBrowseEditWidget(tr("Default Project Templates Folder"), engineInfo.m_defaultTemplatesFolder, this); + m_defaultProjectTemplates->lineEdit()->setValidator(new PathValidator(PathValidator::PathMode::ExistingFolder, this)); + m_defaultProjectTemplates->lineEdit()->setReadOnly(true); + m_defaultProjectTemplates->setErrorLabelText(tr("Please provide a valid path to a folder that exists")); + connect(m_defaultProjectTemplates->lineEdit(), &QLineEdit::textChanged, this, &EngineSettingsScreen::OnTextChanged); + layout->addWidget(m_defaultProjectTemplates); + + setLayout(layout); } ProjectManagerScreen EngineSettingsScreen::GetScreenEnum() { return ProjectManagerScreen::EngineSettings; } + + QString EngineSettingsScreen::GetTabText() + { + return tr("Engine"); + } + + bool EngineSettingsScreen::IsTab() + { + return true; + } + + void EngineSettingsScreen::OnTextChanged() + { + // save engine settings + auto engineInfoResult = PythonBindingsInterface::Get()->GetEngineInfo(); + if (engineInfoResult.IsSuccess()) + { + EngineInfo engineInfo; + engineInfo = engineInfoResult.GetValue(); + engineInfo.m_thirdPartyPath = m_thirdParty->lineEdit()->text(); + engineInfo.m_defaultProjectsFolder = m_defaultProjects->lineEdit()->text(); + engineInfo.m_defaultGemsFolder = m_defaultGems->lineEdit()->text(); + engineInfo.m_defaultTemplatesFolder = m_defaultProjectTemplates->lineEdit()->text(); + + bool result = PythonBindingsInterface::Get()->SetEngineInfo(engineInfo); + if (!result) + { + QMessageBox::critical(this, tr("Engine Settings"), tr("Failed to save engine settings.")); + } + } + else + { + QMessageBox::critical(this, tr("Engine Settings"), tr("Failed to get engine settings.")); + } + } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.h b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.h index 4baa3fb28c..36e329cdf6 100644 --- a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.h +++ b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.h @@ -15,23 +15,31 @@ #include #endif -namespace Ui -{ - class EngineSettingsClass; -} - namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(FormLineEditWidget) + QT_FORWARD_DECLARE_CLASS(FormBrowseEditWidget) + class EngineSettingsScreen : public ScreenWidget { public: explicit EngineSettingsScreen(QWidget* parent = nullptr); ~EngineSettingsScreen() = default; + ProjectManagerScreen GetScreenEnum() override; + QString GetTabText() override; + bool IsTab() override; + + protected slots: + void OnTextChanged(); private: - QScopedPointer m_ui; + FormLineEditWidget* m_engineVersion; + FormBrowseEditWidget* m_thirdParty; + FormBrowseEditWidget* m_defaultProjects; + FormBrowseEditWidget* m_defaultGems; + FormBrowseEditWidget* m_defaultProjectTemplates; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.ui b/Code/Tools/ProjectManager/Source/EngineSettingsScreen.ui deleted file mode 100644 index c8fda8bfd7..0000000000 --- a/Code/Tools/ProjectManager/Source/EngineSettingsScreen.ui +++ /dev/null @@ -1,82 +0,0 @@ - - - EngineSettingsClass - - - - 0 - 0 - 839 - 597 - - - - Form - - - - - - O3DE Settings - - - - - - - Engine Version - - - - - - - v1.01 - - - - - - - 3rd Party Software Folder - - - - - - - - - - Restricted Folder - - - - - - - - - - Default Gems Folder - - - - - - - - - - Default Project Templates Folder - - - - - - - - - - - diff --git a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.cpp b/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.cpp deleted file mode 100644 index aa4dee1aa6..0000000000 --- a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. - * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - */ - -#include - -#include - -namespace O3DE::ProjectManager -{ - FirstTimeUseScreen::FirstTimeUseScreen(QWidget* parent) - : ScreenWidget(parent) - , m_ui(new Ui::FirstTimeUseClass()) - { - m_ui->setupUi(this); - - connect(m_ui->createProjectButton, &QPushButton::pressed, this, &FirstTimeUseScreen::HandleNewProjectButton); - connect(m_ui->openProjectButton, &QPushButton::pressed, this, &FirstTimeUseScreen::HandleOpenProjectButton); - } - - ProjectManagerScreen FirstTimeUseScreen::GetScreenEnum() - { - return ProjectManagerScreen::FirstTimeUse; - } - - void FirstTimeUseScreen::HandleNewProjectButton() - { - emit ResetScreenRequest(ProjectManagerScreen::NewProjectSettingsCore); - emit ChangeScreenRequest(ProjectManagerScreen::NewProjectSettingsCore); - } - void FirstTimeUseScreen::HandleOpenProjectButton() - { - emit ChangeScreenRequest(ProjectManagerScreen::ProjectsHome); - } - -} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.ui b/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.ui deleted file mode 100644 index fdc195731f..0000000000 --- a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.ui +++ /dev/null @@ -1,93 +0,0 @@ - - - FirstTimeUseClass - - - - 0 - 0 - 881 - 555 - - - - Form - - - - - - - - - 30 - - - - READY. SET. CREATE! - - - - - - - <html><head/><body><p>Welcome to O3DE! Start something new by creating a project. Not sure what to create? </p><p>Explore what’s available by downloading our sample project.</p></body></html> - - - Qt::AutoText - - - - - - - - - - - - 0 - 0 - - - - Create Project - - - - :/Resources/Add.svg:/Resources/Add.svg - - - - 16 - 16 - - - - - - - - - 0 - 0 - - - - Open a Project - - - - :/Resources/Select_Folder.svg:/Resources/Select_Folder.svg - - - - - - - - - - - - diff --git a/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.cpp b/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.cpp new file mode 100644 index 0000000000..c30d6a7b30 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.cpp @@ -0,0 +1,49 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + FormBrowseEditWidget::FormBrowseEditWidget(const QString& labelText, const QString& valueText, QWidget* parent) + : FormLineEditWidget(labelText, valueText, parent) + { + setObjectName("formBrowseEditWidget"); + + QPushButton* browseButton = new QPushButton(this); + connect(browseButton, &QPushButton::pressed, this, &FormBrowseEditWidget::HandleBrowseButton); + m_frameLayout->addWidget(browseButton); + } + + void FormBrowseEditWidget::HandleBrowseButton() + { + QString defaultPath = m_lineEdit->text(); + if (defaultPath.isEmpty()) + { + defaultPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + } + + QString directory = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(this, tr("Browse"), defaultPath)); + if (!directory.isEmpty()) + { + m_lineEdit->setText(directory); + } + + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.h b/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.h new file mode 100644 index 0000000000..887fc29dd9 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/FormBrowseEditWidget.h @@ -0,0 +1,33 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +namespace O3DE::ProjectManager +{ + class FormBrowseEditWidget + : public FormLineEditWidget + { + Q_OBJECT + + public: + explicit FormBrowseEditWidget(const QString& labelText, const QString& valueText = "", QWidget* parent = nullptr); + ~FormBrowseEditWidget() = default; + + private slots: + void HandleBrowseButton(); + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/FormLineEditWidget.cpp b/Code/Tools/ProjectManager/Source/FormLineEditWidget.cpp new file mode 100644 index 0000000000..7ef7e3c7d8 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/FormLineEditWidget.cpp @@ -0,0 +1,123 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + FormLineEditWidget::FormLineEditWidget(const QString& labelText, const QString& valueText, QWidget* parent) + : QWidget(parent) + { + setObjectName("formLineEditWidget"); + + QVBoxLayout* mainLayout = new QVBoxLayout(); + mainLayout->setAlignment(Qt::AlignTop); + { + m_frame = new QFrame(this); + m_frame->setObjectName("formFrame"); + + // use a horizontal box layout so buttons can be added to the right of the field + m_frameLayout = new QHBoxLayout(); + { + QVBoxLayout* fieldLayout = new QVBoxLayout(); + + QLabel* label = new QLabel(labelText, this); + fieldLayout->addWidget(label); + + m_lineEdit = new AzQtComponents::StyledLineEdit(this); + m_lineEdit->setFlavor(AzQtComponents::StyledLineEdit::Question); + AzQtComponents::LineEdit::setErrorIconEnabled(m_lineEdit, false); + m_lineEdit->setText(valueText); + + connect(m_lineEdit, &AzQtComponents::StyledLineEdit::flavorChanged, this, &FormLineEditWidget::flavorChanged); + connect(m_lineEdit, &AzQtComponents::StyledLineEdit::onFocus, this, &FormLineEditWidget::onFocus); + connect(m_lineEdit, &AzQtComponents::StyledLineEdit::onFocusOut, this, &FormLineEditWidget::onFocusOut); + + m_lineEdit->setFrame(false); + fieldLayout->addWidget(m_lineEdit); + + m_frameLayout->addLayout(fieldLayout); + + QWidget* emptyWidget = new QWidget(this); + m_frameLayout->addWidget(emptyWidget); + } + + m_frame->setLayout(m_frameLayout); + + mainLayout->addWidget(m_frame); + + m_errorLabel = new QLabel(this); + m_errorLabel->setObjectName("formErrorLabel"); + m_errorLabel->setVisible(false); + mainLayout->addWidget(m_errorLabel); + } + + setLayout(mainLayout); + } + + void FormLineEditWidget::setErrorLabelText(const QString& labelText) + { + m_errorLabel->setText(labelText); + } + + QLineEdit* FormLineEditWidget::lineEdit() const + { + return m_lineEdit; + } + + void FormLineEditWidget::flavorChanged() + { + if (m_lineEdit->flavor() == AzQtComponents::StyledLineEdit::Flavor::Invalid) + { + m_frame->setProperty("Valid", false); + m_errorLabel->setVisible(true); + } + else + { + m_frame->setProperty("Valid", true); + m_errorLabel->setVisible(false); + } + refreshStyle(); + } + + void FormLineEditWidget::onFocus() + { + m_frame->setProperty("Focus", true); + refreshStyle(); + } + + void FormLineEditWidget::onFocusOut() + { + m_frame->setProperty("Focus", false); + refreshStyle(); + } + + void FormLineEditWidget::refreshStyle() + { + // we must unpolish/polish every child after changing a property + // or else they won't use the correct stylesheet selector + for (auto child : findChildren()) + { + child->style()->unpolish(child); + child->style()->polish(child); + } + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/FormLineEditWidget.h b/Code/Tools/ProjectManager/Source/FormLineEditWidget.h new file mode 100644 index 0000000000..3094442cbd --- /dev/null +++ b/Code/Tools/ProjectManager/Source/FormLineEditWidget.h @@ -0,0 +1,60 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QLineEdit) +QT_FORWARD_DECLARE_CLASS(QLabel) +QT_FORWARD_DECLARE_CLASS(QFrame) +QT_FORWARD_DECLARE_CLASS(QHBoxLayout) + +namespace AzQtComponents +{ + class StyledLineEdit; +} + +namespace O3DE::ProjectManager +{ + class FormLineEditWidget + : public QWidget + { + Q_OBJECT + + public: + explicit FormLineEditWidget(const QString& labelText, const QString& valueText = "", QWidget* parent = nullptr); + ~FormLineEditWidget() = default; + + //! Set the error message for to display when invalid. + void setErrorLabelText(const QString& labelText); + + //! Returns a pointer to the underlying LineEdit. + QLineEdit* lineEdit() const; + + protected: + QLabel* m_errorLabel = nullptr; + QFrame* m_frame = nullptr; + QHBoxLayout* m_frameLayout = nullptr; + AzQtComponents::StyledLineEdit* m_lineEdit = nullptr; + + private slots: + void flavorChanged(); + void onFocus(); + void onFocusOut(); + + private: + void refreshStyle(); + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp new file mode 100644 index 0000000000..6402121e4a --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.cpp @@ -0,0 +1,51 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + GemCatalogHeaderWidget::GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent) + : QFrame(parent) + { + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->setAlignment(Qt::AlignLeft); + hLayout->setMargin(0); + setLayout(hLayout); + + setObjectName("GemCatalogHeaderWidget"); + + hLayout->addSpacing(7); + + QLabel* titleLabel = new QLabel(tr("Gem Catalog")); + titleLabel->setObjectName("GemCatalogTitle"); + hLayout->addWidget(titleLabel); + + hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); + + AzQtComponents::SearchLineEdit* filterLineEdit = new AzQtComponents::SearchLineEdit(); + filterLineEdit->setStyleSheet("background-color: #DDDDDD;"); + connect(filterLineEdit, &QLineEdit::textChanged, this, [=](const QString& text) + { + filterProxyModel->SetSearchString(text); + }); + hLayout->addWidget(filterLineEdit); + + hLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); + hLayout->addSpacerItem(new QSpacerItem(140, 0, QSizePolicy::Fixed)); + + setFixedHeight(60); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h new file mode 100644 index 0000000000..3e065edd8f --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogHeaderWidget.h @@ -0,0 +1,31 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#endif + +namespace O3DE::ProjectManager +{ + class GemCatalogHeaderWidget + : public QFrame + { + Q_OBJECT // AUTOMOC + + public: + explicit GemCatalogHeaderWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent = nullptr); + ~GemCatalogHeaderWidget() = default; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp index 5737a188de..2d243e7f8b 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.cpp @@ -12,6 +12,10 @@ #include #include +#include +#include +#include +#include #include #include #include @@ -25,15 +29,21 @@ namespace O3DE::ProjectManager : ScreenWidget(parent) { m_gemModel = new GemModel(this); + GemSortFilterProxyModel* proxyModel = new GemSortFilterProxyModel(m_gemModel, this); QVBoxLayout* vLayout = new QVBoxLayout(); vLayout->setMargin(0); + vLayout->setSpacing(0); setLayout(vLayout); + GemCatalogHeaderWidget* headerWidget = new GemCatalogHeaderWidget(proxyModel); + vLayout->addWidget(headerWidget); + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->setMargin(0); vLayout->addLayout(hLayout); - m_gemListView = new GemListView(m_gemModel, this); + m_gemListView = new GemListView(proxyModel, proxyModel->GetSelectionModel(), this); m_gemInspector = new GemInspector(m_gemModel, this); m_gemInspector->setFixedWidth(320); @@ -56,15 +66,22 @@ namespace O3DE::ProjectManager } #endif - hLayout->addWidget(m_gemListView); + GemFilterWidget* filterWidget = new GemFilterWidget(proxyModel); + filterWidget->setFixedWidth(250); + + GemListHeaderWidget* listHeaderWidget = new GemListHeaderWidget(proxyModel); + + QVBoxLayout* middleVLayout = new QVBoxLayout(); + middleVLayout->setMargin(0); + middleVLayout->setSpacing(0); + middleVLayout->addWidget(listHeaderWidget); + middleVLayout->addWidget(m_gemListView); + + hLayout->addWidget(filterWidget); + hLayout->addLayout(middleVLayout); hLayout->addWidget(m_gemInspector); - - // Select the first entry after everything got correctly sized - QTimer::singleShot(100, [=]{ - QModelIndex firstModelIndex = m_gemListView->model()->index(0,0); - m_gemListView->selectionModel()->select(firstModelIndex, QItemSelectionModel::ClearAndSelect); - }); + proxyModel->InvalidateFilter(); } QVector GemCatalogScreen::GenerateTestData() @@ -80,10 +97,12 @@ namespace O3DE::ProjectManager gem.m_documentationLink = "http://www.amazon.com"; gem.m_dependingGemUuids = QStringList({"EMotionFX", "Atom"}); gem.m_conflictingGemUuids = QStringList({"Vegetation", "Camera", "ScriptCanvas", "CloudCanvas", "Networking"}); + gem.m_types = (GemInfo::Code | GemInfo::Asset); gem.m_version = "v1.01"; gem.m_lastUpdatedDate = "24th April 2021"; gem.m_binarySizeInKB = 40; gem.m_features = QStringList({"Animation", "Assets", "Physics"}); + gem.m_gemOrigin = GemInfo::O3DEFoundation; result.push_back(gem); gem.m_name = "Atom"; @@ -159,9 +178,4 @@ namespace O3DE::ProjectManager { return ProjectManagerScreen::GemCatalog; } - - QString GemCatalogScreen::GetNextButtonText() - { - return "Create Project"; - } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.h index 6a9c88d0f5..44e0727c7e 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemCatalogScreen.h @@ -9,6 +9,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ + #pragma once #if !defined(Q_MOC_RUN) @@ -27,7 +28,6 @@ namespace O3DE::ProjectManager explicit GemCatalogScreen(QWidget* parent = nullptr); ~GemCatalogScreen() = default; ProjectManagerScreen GetScreenEnum() override; - QString GetNextButtonText() override; private: QVector GenerateTestData(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp new file mode 100644 index 0000000000..a6a4e95ff9 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.cpp @@ -0,0 +1,415 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + FilterCategoryWidget::FilterCategoryWidget(const QString& header, + const QVector& elementNames, + const QVector& elementCounts, + bool showAllLessButton, + int defaultShowCount, + QWidget* parent) + : QWidget(parent) + , m_defaultShowCount(defaultShowCount) + { + AZ_Assert(elementNames.size() == elementCounts.size(), "Number of element names needs to match the counts."); + + QVBoxLayout* vLayout = new QVBoxLayout(); + setLayout(vLayout); + + // Collapse button + QHBoxLayout* collapseLayout = new QHBoxLayout(); + m_collapseButton = new QPushButton(); + m_collapseButton->setCheckable(true); + m_collapseButton->setFlat(true); + m_collapseButton->setFocusPolicy(Qt::NoFocus); + m_collapseButton->setFixedWidth(s_collapseButtonSize); + connect(m_collapseButton, &QPushButton::clicked, this, [=]() + { + UpdateCollapseState(); + }); + collapseLayout->addWidget(m_collapseButton); + + // Category title + QLabel* headerLabel = new QLabel(header); + headerLabel->setObjectName("GemCatalogFilterCategoryTitle"); + collapseLayout->addWidget(headerLabel); + vLayout->addLayout(collapseLayout); + + vLayout->addSpacing(5); + + // Everything in the main widget will be collapsed/uncollapsed + { + m_mainWidget = new QWidget(); + vLayout->addWidget(m_mainWidget); + + QVBoxLayout* mainLayout = new QVBoxLayout(); + mainLayout->setMargin(0); + mainLayout->setAlignment(Qt::AlignTop); + m_mainWidget->setLayout(mainLayout); + + // Elements + m_buttonGroup = new QButtonGroup(); + m_buttonGroup->setExclusive(false); + for (int i = 0; i < elementNames.size(); ++i) + { + QWidget* elementWidget = new QWidget(); + QHBoxLayout* elementLayout = new QHBoxLayout(); + elementLayout->setMargin(0); + elementWidget->setLayout(elementLayout); + + QCheckBox* checkbox = new QCheckBox(elementNames[i]); + checkbox->setStyleSheet("font-size: 12px;"); + m_buttonGroup->addButton(checkbox); + elementLayout->addWidget(checkbox); + + elementLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); + + QLabel* countLabel = new QLabel(QString::number(elementCounts[i])); + countLabel->setStyleSheet("font-size: 12px; background-color: #333333; border-radius: 3px; color: #94D2FF;"); + elementLayout->addWidget(countLabel); + + m_elementWidgets.push_back(elementWidget); + mainLayout->addWidget(elementWidget); + } + + // See more / less + if (showAllLessButton) + { + m_seeAllLessLabel = new LinkLabel(); + connect(m_seeAllLessLabel, &LinkLabel::clicked, this, [=]() + { + m_seeAll = !m_seeAll; + UpdateSeeMoreLess(); + }); + mainLayout->addWidget(m_seeAllLessLabel); + } + else + { + mainLayout->addSpacing(5); + } + } + + vLayout->addSpacing(5); + + // Separating line + QFrame* hLine = new QFrame(); + hLine->setFrameShape(QFrame::HLine); + hLine->setStyleSheet("color: #666666;"); + vLayout->addWidget(hLine); + + UpdateCollapseState(); + UpdateSeeMoreLess(); + } + + void FilterCategoryWidget::UpdateCollapseState() + { + if (m_collapseButton->isChecked()) + { + m_collapseButton->setIcon(QIcon(":/ArrowDownLine.svg")); + m_mainWidget->hide(); + } + else + { + m_collapseButton->setIcon(QIcon(":/ArrowUpLine.svg")); + m_mainWidget->show(); + } + } + + void FilterCategoryWidget::UpdateSeeMoreLess() + { + if (!m_seeAllLessLabel) + { + return; + } + + if (m_elementWidgets.isEmpty()) + { + m_seeAllLessLabel->hide(); + return; + } + else + { + m_seeAllLessLabel->show(); + } + + if (!m_seeAll) + { + m_seeAllLessLabel->setText("See all"); + } + else + { + m_seeAllLessLabel->setText("See less"); + } + + int showCount = m_seeAll ? m_elementWidgets.size() : m_defaultShowCount; + showCount = AZ::GetMin(showCount, m_elementWidgets.size()); + for (int i = 0; i < showCount; ++i) + { + m_elementWidgets[i]->show(); + } + for (int i = showCount; i < m_elementWidgets.size(); ++i) + { + m_elementWidgets[i]->hide(); + } + } + + QButtonGroup* FilterCategoryWidget::GetButtonGroup() + { + return m_buttonGroup; + } + + GemFilterWidget::GemFilterWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent) + : QScrollArea(parent) + , m_filterProxyModel(filterProxyModel) + { + setObjectName("GemCatalogFilterWidget"); + + m_gemModel = m_filterProxyModel->GetSourceModel(); + + setWidgetResizable(true); + setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); + + QWidget* mainWidget = new QWidget(); + setWidget(mainWidget); + + m_mainLayout = new QVBoxLayout(); + m_mainLayout->setAlignment(Qt::AlignTop); + mainWidget->setLayout(m_mainLayout); + + QLabel* filterByLabel = new QLabel("Filter by"); + filterByLabel->setStyleSheet("font-size: 16px;"); + m_mainLayout->addWidget(filterByLabel); + + AddGemOriginFilter(); + AddTypeFilter(); + AddPlatformFilter(); + AddFeatureFilter(); + } + + void GemFilterWidget::AddGemOriginFilter() + { + QVector elementNames; + QVector elementCounts; + const int numGems = m_gemModel->rowCount(); + for (int originIndex = 0; originIndex < GemInfo::NumGemOrigins; ++originIndex) + { + const GemInfo::GemOrigin gemOriginToBeCounted = static_cast(1 << originIndex); + + int gemOriginCount = 0; + for (int gemIndex = 0; gemIndex < numGems; ++gemIndex) + { + const GemInfo::GemOrigin gemOrigin = m_gemModel->GetGemOrigin(m_gemModel->index(gemIndex, 0)); + + // Is the gem of the given origin? + if (gemOriginToBeCounted == gemOrigin) + { + gemOriginCount++; + } + } + + elementNames.push_back(GemInfo::GetGemOriginString(gemOriginToBeCounted)); + elementCounts.push_back(gemOriginCount); + } + + FilterCategoryWidget* filterWidget = new FilterCategoryWidget("Provider", elementNames, elementCounts, /*showAllLessButton=*/false); + m_mainLayout->addWidget(filterWidget); + + const QList buttons = filterWidget->GetButtonGroup()->buttons(); + for (int i = 0; i < buttons.size(); ++i) + { + const GemInfo::GemOrigin gemOrigin = static_cast(1 << i); + QAbstractButton* button = buttons[i]; + + connect(button, &QAbstractButton::toggled, this, [=](bool checked) + { + GemInfo::GemOrigins gemOrigins = m_filterProxyModel->GetGemOrigins(); + if (checked) + { + gemOrigins |= gemOrigin; + } + else + { + gemOrigins &= ~gemOrigin; + } + m_filterProxyModel->SetGemOrigins(gemOrigins); + }); + } + } + + void GemFilterWidget::AddTypeFilter() + { + QVector elementNames; + QVector elementCounts; + const int numGems = m_gemModel->rowCount(); + for (int typeIndex = 0; typeIndex < GemInfo::NumTypes; ++typeIndex) + { + const GemInfo::Type type = static_cast(1 << typeIndex); + + int typeGemCount = 0; + for (int gemIndex = 0; gemIndex < numGems; ++gemIndex) + { + const GemInfo::Types types = m_gemModel->GetTypes(m_gemModel->index(gemIndex, 0)); + + // Is type (Asset, Code, Tool) part of the gem? + if (types & type) + { + typeGemCount++; + } + } + + elementNames.push_back(GemInfo::GetTypeString(type)); + elementCounts.push_back(typeGemCount); + } + + FilterCategoryWidget* filterWidget = new FilterCategoryWidget("Type", elementNames, elementCounts, /*showAllLessButton=*/false); + m_mainLayout->addWidget(filterWidget); + + const QList buttons = filterWidget->GetButtonGroup()->buttons(); + for (int i = 0; i < buttons.size(); ++i) + { + const GemInfo::Type type = static_cast(1 << i); + QAbstractButton* button = buttons[i]; + + connect(button, &QAbstractButton::toggled, this, [=](bool checked) + { + GemInfo::Types types = m_filterProxyModel->GetTypes(); + if (checked) + { + types |= type; + } + else + { + types &= ~type; + } + m_filterProxyModel->SetTypes(types); + }); + } + } + + void GemFilterWidget::AddPlatformFilter() + { + QVector elementNames; + QVector elementCounts; + const int numGems = m_gemModel->rowCount(); + for (int platformIndex = 0; platformIndex < GemInfo::NumPlatforms; ++platformIndex) + { + const GemInfo::Platform platform = static_cast(1 << platformIndex); + + int platformGemCount = 0; + for (int gemIndex = 0; gemIndex < numGems; ++gemIndex) + { + const GemInfo::Platforms platforms = m_gemModel->GetPlatforms(m_gemModel->index(gemIndex, 0)); + + // Is platform supported? + if (platforms & platform) + { + platformGemCount++; + } + } + + elementNames.push_back(GemInfo::GetPlatformString(platform)); + elementCounts.push_back(platformGemCount); + } + + FilterCategoryWidget* filterWidget = new FilterCategoryWidget("Supported Platforms", elementNames, elementCounts, /*showAllLessButton=*/false); + m_mainLayout->addWidget(filterWidget); + + const QList buttons = filterWidget->GetButtonGroup()->buttons(); + for (int i = 0; i < buttons.size(); ++i) + { + const GemInfo::Platform platform = static_cast(1 << i); + QAbstractButton* button = buttons[i]; + + connect(button, &QAbstractButton::toggled, this, [=](bool checked) + { + GemInfo::Platforms platforms = m_filterProxyModel->GetPlatforms(); + if (checked) + { + platforms |= platform; + } + else + { + platforms &= ~platform; + } + m_filterProxyModel->SetPlatforms(platforms); + }); + } + } + + void GemFilterWidget::AddFeatureFilter() + { + // Alphabetically sorted, unique features and their number of occurrences in the gem database. + QMap uniqueFeatureCounts; + const int numGems = m_gemModel->rowCount(); + for (int gemIndex = 0; gemIndex < numGems; ++gemIndex) + { + const QStringList features = m_gemModel->GetFeatures(m_gemModel->index(gemIndex, 0)); + for (const QString& feature : features) + { + if (!uniqueFeatureCounts.contains(feature)) + { + uniqueFeatureCounts.insert(feature, 1); + } + else + { + int& featureeCount = uniqueFeatureCounts[feature]; + featureeCount++; + } + } + } + + QVector elementNames; + QVector elementCounts; + for (auto iterator = uniqueFeatureCounts.begin(); iterator != uniqueFeatureCounts.end(); iterator++) + { + elementNames.push_back(iterator.key()); + elementCounts.push_back(iterator.value()); + } + + FilterCategoryWidget* filterWidget = new FilterCategoryWidget("Features", elementNames, elementCounts, + /*showAllLessButton=*/true, /*defaultShowCount=*/5); + m_mainLayout->addWidget(filterWidget); + + const QList buttons = filterWidget->GetButtonGroup()->buttons(); + for (int i = 0; i < buttons.size(); ++i) + { + const QString& feature = elementNames[i]; + QAbstractButton* button = buttons[i]; + + connect(button, &QAbstractButton::toggled, this, [=](bool checked) + { + QSet features = m_filterProxyModel->GetFeatures(); + if (checked) + { + features.insert(feature); + } + else + { + features.remove(feature); + } + m_filterProxyModel->SetFeatures(features); + }); + } + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h new file mode 100644 index 0000000000..017eadc020 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemFilterWidget.h @@ -0,0 +1,79 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QButtonGroup) + +namespace O3DE::ProjectManager +{ + class FilterCategoryWidget + : public QWidget + { + Q_OBJECT // AUTOMOC + + public: + explicit FilterCategoryWidget(const QString& header, + const QVector& elementNames, + const QVector& elementCounts, + bool showAllLessButton = true, + int defaultShowCount = 4, + QWidget* parent = nullptr); + + QButtonGroup* GetButtonGroup(); + + private: + void UpdateCollapseState(); + void UpdateSeeMoreLess(); + + inline constexpr static int s_collapseButtonSize = 16; + QPushButton* m_collapseButton = nullptr; + + QWidget* m_mainWidget = nullptr; + QButtonGroup* m_buttonGroup = nullptr; + QVector m_elementWidgets; //! Includes checkbox and the count labl. + LinkLabel* m_seeAllLessLabel = nullptr; + int m_defaultShowCount = 0; + bool m_seeAll = false; + }; + + class GemFilterWidget + : public QScrollArea + { + Q_OBJECT // AUTOMOC + + public: + explicit GemFilterWidget(GemSortFilterProxyModel* filterProxyModel, QWidget* parent = nullptr); + ~GemFilterWidget() = default; + + private: + void AddGemOriginFilter(); + void AddTypeFilter(); + void AddPlatformFilter(); + void AddFeatureFilter(); + + QVBoxLayout* m_mainLayout = nullptr; + GemModel* m_gemModel = nullptr; + GemSortFilterProxyModel* m_filterProxyModel = nullptr; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp index 729935fc8e..bc44928868 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.cpp @@ -25,28 +25,56 @@ namespace O3DE::ProjectManager bool GemInfo::IsValid() const { - return !m_path.isEmpty() && !m_uuid.IsNull(); + return !m_name.isEmpty() && !m_path.isEmpty(); } QString GemInfo::GetPlatformString(Platform platform) { switch (platform) { - case O3DE::ProjectManager::GemInfo::Android: + case Android: return "Android"; - case O3DE::ProjectManager::GemInfo::iOS: + case iOS: return "iOS"; - case O3DE::ProjectManager::GemInfo::Linux: + case Linux: return "Linux"; - case O3DE::ProjectManager::GemInfo::macOS: + case macOS: return "macOS"; - case O3DE::ProjectManager::GemInfo::Windows: + case Windows: return "Windows"; default: return ""; } } + QString GemInfo::GetTypeString(Type type) + { + switch (type) + { + case Asset: + return "Asset"; + case Code: + return "Code"; + case Tool: + return "Tool"; + default: + return ""; + } + } + + QString GemInfo::GetGemOriginString(GemOrigin origin) + { + switch (origin) + { + case O3DEFoundation: + return "Open 3D Foundation"; + case Local: + return "Local"; + default: + return ""; + } + } + bool GemInfo::IsPlatformSupported(Platform platform) const { return (m_platforms & platform); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h index 7ee619702f..1032ca5eaf 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInfo.h @@ -36,6 +36,25 @@ namespace O3DE::ProjectManager Q_DECLARE_FLAGS(Platforms, Platform) static QString GetPlatformString(Platform platform); + enum Type + { + Asset = 1 << 0, + Code = 1 << 1, + Tool = 1 << 2, + NumTypes = 3 + }; + Q_DECLARE_FLAGS(Types, Type) + static QString GetTypeString(Type type); + + enum GemOrigin + { + O3DEFoundation = 1 << 0, + Local = 1 << 1, + NumGemOrigins = 2 + }; + Q_DECLARE_FLAGS(GemOrigins, GemOrigin) + static QString GetGemOriginString(GemOrigin origin); + GemInfo() = default; GemInfo(const QString& name, const QString& creator, const QString& summary, Platforms platforms, bool isAdded); bool IsPlatformSupported(Platform platform) const; @@ -43,18 +62,19 @@ namespace O3DE::ProjectManager bool IsValid() const; QString m_path; - QString m_name; - QString m_displayName; - AZ::Uuid m_uuid; - QString m_creator; + QString m_name = "Unknown Gem Name"; + QString m_displayName = "Unknown Gem Name"; + QString m_creator = "Unknown Creator"; + GemOrigin m_gemOrigin = Local; bool m_isAdded = false; //! Is the gem currently added and enabled in the project? - QString m_summary; + QString m_summary = "No summary provided."; Platforms m_platforms; + Types m_types; //! Asset and/or Code and/or Tool QStringList m_features; QString m_directoryLink; QString m_documentationLink; - QString m_version; - QString m_lastUpdatedDate; + QString m_version = "Unknown Version"; + QString m_lastUpdatedDate = "Unknown Date"; int m_binarySizeInKB = 0; QStringList m_dependingGemUuids; QStringList m_conflictingGemUuids; @@ -62,3 +82,5 @@ namespace O3DE::ProjectManager } // namespace O3DE::ProjectManager Q_DECLARE_OPERATORS_FOR_FLAGS(O3DE::ProjectManager::GemInfo::Platforms) +Q_DECLARE_OPERATORS_FOR_FLAGS(O3DE::ProjectManager::GemInfo::Types) +Q_DECLARE_OPERATORS_FOR_FLAGS(O3DE::ProjectManager::GemInfo::GemOrigins) diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp index e7c682afd1..3ecc18231e 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemInspector.cpp @@ -23,6 +23,7 @@ namespace O3DE::ProjectManager : QScrollArea(parent) , m_model(model) { + setObjectName("GemCatalogInspector"); setWidgetResizable(true); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); @@ -70,8 +71,8 @@ namespace O3DE::ProjectManager m_documentationLinkLabel->SetUrl(m_model->GetDocLink(modelIndex)); // Depending and conflicting gems - m_dependingGems->Update("Depending Gems", "The following Gems will be automatically enabled with this Gem.", m_model->GetDependingGems(modelIndex)); - m_conflictingGems->Update("Conflicting Gems", "The following Gems will be automatically disabled with this Gem.", m_model->GetConflictingGems(modelIndex)); + m_dependingGems->Update("Depending Gems", "The following Gems will be automatically enabled with this Gem.", m_model->GetDependingGemNames(modelIndex)); + m_conflictingGems->Update("Conflicting Gems", "The following Gems will be automatically disabled with this Gem.", m_model->GetConflictingGemNames(modelIndex)); // Additional information m_versionLabel->setText(QString("Gem Version: %1").arg(m_model->GetVersion(modelIndex))); @@ -85,7 +86,7 @@ namespace O3DE::ProjectManager QLabel* GemInspector::CreateStyledLabel(QLayout* layout, int fontSize, const QString& colorCodeString) { QLabel* result = new QLabel(); - result->setStyleSheet(QString("font-size: %1pt; color: %2;").arg(QString::number(fontSize), colorCodeString)); + result->setStyleSheet(QString("font-size: %1px; color: %2;").arg(QString::number(fontSize), colorCodeString)); layout->addWidget(result); return result; } @@ -93,13 +94,13 @@ namespace O3DE::ProjectManager void GemInspector::InitMainWidget() { // Gem name, creator and summary - m_nameLabel = CreateStyledLabel(m_mainLayout, 17, s_headerColor); + m_nameLabel = CreateStyledLabel(m_mainLayout, 18, s_headerColor); m_creatorLabel = CreateStyledLabel(m_mainLayout, 12, s_creatorColor); m_mainLayout->addSpacing(5); // TODO: QLabel seems to have issues determining the right sizeHint() for our font with the given font size. // This results into squeezed elements in the layout in case the text is a little longer than a sentence. - m_summaryLabel = new QLabel();//CreateLabel(m_mainLayout, 12, s_textColor); + m_summaryLabel = CreateStyledLabel(m_mainLayout, 12, s_textColor); m_mainLayout->addWidget(m_summaryLabel); m_summaryLabel->setWordWrap(true); m_mainLayout->addSpacing(5); @@ -146,9 +147,9 @@ namespace O3DE::ProjectManager QLabel* additionalInfoLabel = CreateStyledLabel(m_mainLayout, 14, s_headerColor); additionalInfoLabel->setText("Additional Information"); - m_versionLabel = CreateStyledLabel(m_mainLayout, 11, s_textColor); - m_lastUpdatedLabel = CreateStyledLabel(m_mainLayout, 11, s_textColor); - m_binarySizeLabel = CreateStyledLabel(m_mainLayout, 11, s_textColor); + m_versionLabel = CreateStyledLabel(m_mainLayout, 12, s_textColor); + m_lastUpdatedLabel = CreateStyledLabel(m_mainLayout, 12, s_textColor); + m_binarySizeLabel = CreateStyledLabel(m_mainLayout, 12, s_textColor); } GemInspector::GemsSubWidget::GemsSubWidget(QWidget* parent) @@ -159,8 +160,8 @@ namespace O3DE::ProjectManager m_layout->setMargin(0); setLayout(m_layout); - m_titleLabel = GemInspector::CreateStyledLabel(m_layout, 15, s_headerColor); - m_textLabel = GemInspector::CreateStyledLabel(m_layout, 9, s_textColor); + m_titleLabel = GemInspector::CreateStyledLabel(m_layout, 16, s_headerColor); + m_textLabel = GemInspector::CreateStyledLabel(m_layout, 10, s_textColor); m_textLabel->setWordWrap(true); m_tagWidget = new TagContainerWidget(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp index 434a4aeef2..57200e3b36 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.cpp @@ -10,7 +10,7 @@ * */ -#include "GemItemDelegate.h" +#include #include "GemModel.h" #include #include @@ -18,15 +18,15 @@ namespace O3DE::ProjectManager { - GemItemDelegate::GemItemDelegate(GemModel* gemModel, QObject* parent) + GemItemDelegate::GemItemDelegate(QAbstractItemModel* model, QObject* parent) : QStyledItemDelegate(parent) - , m_gemModel(gemModel) + , m_model(model) { - AddPlatformIcon(GemInfo::Android, ":/Resources/Android.svg"); - AddPlatformIcon(GemInfo::iOS, ":/Resources/iOS.svg"); - AddPlatformIcon(GemInfo::Linux, ":/Resources/Linux.svg"); - AddPlatformIcon(GemInfo::macOS, ":/Resources/macOS.svg"); - AddPlatformIcon(GemInfo::Windows, ":/Resources/Windows.svg"); + AddPlatformIcon(GemInfo::Android, ":/Android.svg"); + AddPlatformIcon(GemInfo::iOS, ":/iOS.svg"); + AddPlatformIcon(GemInfo::Linux, ":/Linux.svg"); + AddPlatformIcon(GemInfo::macOS, ":/macOS.svg"); + AddPlatformIcon(GemInfo::Windows, ":/Windows.svg"); } void GemItemDelegate::AddPlatformIcon(GemInfo::Platform platform, const QString& iconPath) @@ -49,7 +49,7 @@ namespace O3DE::ProjectManager painter->setRenderHint(QPainter::Antialiasing); QRect fullRect, itemRect, contentRect; - CalcRects(options, modelIndex, fullRect, itemRect, contentRect); + CalcRects(options, fullRect, itemRect, contentRect); QFont standardFont(options.font); standardFont.setPixelSize(s_fontSize); @@ -78,7 +78,7 @@ namespace O3DE::ProjectManager } // Gem name - const QString gemName = m_gemModel->GetName(modelIndex); + const QString gemName = GemModel::GetName(modelIndex); QFont gemNameFont(options.font); gemNameFont.setPixelSize(s_gemNameFontSize); gemNameFont.setBold(true); @@ -90,7 +90,7 @@ namespace O3DE::ProjectManager painter->drawText(gemNameRect, Qt::TextSingleLine, gemName); // Gem creator - const QString gemCreator = m_gemModel->GetCreator(modelIndex); + const QString gemCreator = GemModel::GetCreator(modelIndex); QRect gemCreatorRect = GetTextRect(standardFont, gemCreator, s_fontSize); gemCreatorRect.moveTo(contentRect.left(), contentRect.top() + gemNameRect.height()); @@ -99,13 +99,13 @@ namespace O3DE::ProjectManager painter->drawText(gemCreatorRect, Qt::TextSingleLine, gemCreator); // Gem summary - const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 4, contentRect.height()); + const QSize summarySize = QSize(contentRect.width() - s_summaryStartX - s_buttonWidth - s_itemMargins.right() * 3, contentRect.height()); const QRect summaryRect = QRect(/*topLeft=*/QPoint(contentRect.left() + s_summaryStartX, contentRect.top()), summarySize); painter->setFont(standardFont); painter->setPen(m_textColor); - const QString summary = m_gemModel->GetSummary(modelIndex); + const QString summary = GemModel::GetSummary(modelIndex); painter->drawText(summaryRect, Qt::AlignLeft | Qt::TextWordWrap, summary); @@ -134,12 +134,10 @@ namespace O3DE::ProjectManager return QStyledItemDelegate::editorEvent(event, model, option, modelIndex); } - void GemItemDelegate::CalcRects(const QStyleOptionViewItem& option, const QModelIndex& modelIndex, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const + void GemItemDelegate::CalcRects(const QStyleOptionViewItem& option, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const { - const bool isFirst = modelIndex.row() == 0; - outFullRect = QRect(option.rect); - outItemRect = QRect(outFullRect.adjusted(s_itemMargins.left(), isFirst ? s_itemMargins.top() * 2 : s_itemMargins.top(), -s_itemMargins.right(), -s_itemMargins.bottom())); + outItemRect = QRect(outFullRect.adjusted(s_itemMargins.left(), s_itemMargins.top(), -s_itemMargins.right(), -s_itemMargins.bottom())); outContentRect = QRect(outItemRect.adjusted(s_contentMargins.left(), s_contentMargins.top(), -s_contentMargins.right(), -s_contentMargins.bottom())); } @@ -158,7 +156,7 @@ namespace O3DE::ProjectManager void GemItemDelegate::DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const { - const GemInfo::Platforms platforms = m_gemModel->GetPlatforms(modelIndex); + const GemInfo::Platforms platforms = GemModel::GetPlatforms(modelIndex); int startX = 0; // Iterate and draw the platforms in the order they are defined in the enum. @@ -188,18 +186,18 @@ namespace O3DE::ProjectManager QPoint circleCenter; QString buttonText; - const bool isAdded = m_gemModel->IsAdded(modelIndex); + const bool isAdded = GemModel::IsAdded(modelIndex); if (isAdded) { painter->setBrush(m_buttonEnabledColor); painter->setPen(m_buttonEnabledColor); - circleCenter = buttonRect.center() + QPoint(buttonRect.width() / 2 - s_buttonBorderRadius, 1); + circleCenter = buttonRect.center() + QPoint(buttonRect.width() / 2 - s_buttonBorderRadius + 1, 1); buttonText = "Added"; } else { - circleCenter = buttonRect.center() + QPoint(-buttonRect.width() / 2 + s_buttonBorderRadius + 1, 1); + circleCenter = buttonRect.center() + QPoint(-buttonRect.width() / 2 + s_buttonBorderRadius, 1); buttonText = "Get"; } diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h index ee0392e188..48f173ec3f 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemItemDelegate.h @@ -15,7 +15,7 @@ #if !defined(Q_MOC_RUN) #include #include "GemInfo.h" -#include "GemModel.h" +#include #include #endif @@ -29,22 +29,13 @@ namespace O3DE::ProjectManager Q_OBJECT // AUTOMOC public: - explicit GemItemDelegate(GemModel* gemModel, QObject* parent = nullptr); + explicit GemItemDelegate(QAbstractItemModel* model, QObject* parent = nullptr); ~GemItemDelegate() = default; void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override; bool editorEvent(QEvent* event, QAbstractItemModel* model, const QStyleOptionViewItem& option, const QModelIndex& modelIndex) override; QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& modelIndex) const override; - private: - void CalcRects(const QStyleOptionViewItem& option, const QModelIndex& modelIndex, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const; - QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const; - QRect CalcButtonRect(const QRect& contentRect) const; - void DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; - void DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; - - GemModel* m_gemModel = nullptr; - // Colors const QColor m_textColor = QColor("#FFFFFF"); const QColor m_linkColor = QColor("#94D2FF"); @@ -54,26 +45,35 @@ namespace O3DE::ProjectManager const QColor m_buttonEnabledColor = QColor("#00B931"); // Item - inline constexpr static int s_height = 135; // Gem item total height - inline constexpr static qreal s_gemNameFontSize = 16.0; - inline constexpr static qreal s_fontSize = 15.0; - inline constexpr static int s_summaryStartX = 200; + inline constexpr static int s_height = 105; // Gem item total height + inline constexpr static qreal s_gemNameFontSize = 13.0; + inline constexpr static qreal s_fontSize = 12.0; + inline constexpr static int s_summaryStartX = 150; // Margin and borders - inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/20, /*top=*/10, /*right=*/20, /*bottom=*/10); // Item border distances - inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/15, /*top=*/12, /*right=*/12, /*bottom=*/12); // Distances of the elements within an item to the item borders + inline constexpr static QMargins s_itemMargins = QMargins(/*left=*/16, /*top=*/8, /*right=*/16, /*bottom=*/8); // Item border distances + inline constexpr static QMargins s_contentMargins = QMargins(/*left=*/20, /*top=*/12, /*right=*/15, /*bottom=*/12); // Distances of the elements within an item to the item borders inline constexpr static int s_borderWidth = 4; // Button - inline constexpr static int s_buttonWidth = 70; - inline constexpr static int s_buttonHeight = 24; - inline constexpr static int s_buttonBorderRadius = 12; - inline constexpr static int s_buttonCircleRadius = s_buttonBorderRadius - 3; - inline constexpr static qreal s_buttonFontSize = 12.0; + inline constexpr static int s_buttonWidth = 55; + inline constexpr static int s_buttonHeight = 18; + inline constexpr static int s_buttonBorderRadius = 9; + inline constexpr static int s_buttonCircleRadius = s_buttonBorderRadius - 2; + inline constexpr static qreal s_buttonFontSize = 10.0; + + private: + void CalcRects(const QStyleOptionViewItem& option, QRect& outFullRect, QRect& outItemRect, QRect& outContentRect) const; + QRect GetTextRect(QFont& font, const QString& text, qreal fontSize) const; + QRect CalcButtonRect(const QRect& contentRect) const; + void DrawPlatformIcons(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; + void DrawButton(QPainter* painter, const QRect& contentRect, const QModelIndex& modelIndex) const; + + QAbstractItemModel* m_model = nullptr; // Platform icons void AddPlatformIcon(GemInfo::Platform platform, const QString& iconPath); - inline constexpr static int s_platformIconSize = 16; + inline constexpr static int s_platformIconSize = 12; QHash m_platformIcons; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp new file mode 100644 index 0000000000..bc287e3c61 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.cpp @@ -0,0 +1,79 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + GemListHeaderWidget::GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent) + : QFrame(parent) + { + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->setMargin(0); + setLayout(vLayout); + + setStyleSheet("background-color: #333333;"); + + vLayout->addSpacing(20); + + // Top section + QHBoxLayout* topLayout = new QHBoxLayout(); + topLayout->setMargin(0); + topLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding)); + + QLabel* showCountLabel = new QLabel(); + showCountLabel->setStyleSheet("font-size: 12px; font: italic;"); + topLayout->addWidget(showCountLabel); + connect(proxyModel, &GemSortFilterProxyModel::OnInvalidated, this, [=] + { + const int numGemsShown = proxyModel->rowCount(); + showCountLabel->setText(QString(tr("showing %1 Gems")).arg(numGemsShown)); + }); + + topLayout->addSpacing(GemItemDelegate::s_contentMargins.right() + GemItemDelegate::s_borderWidth); + + vLayout->addLayout(topLayout); + + vLayout->addSpacing(20); + + // Separating line + QFrame* hLine = new QFrame(); + hLine->setFrameShape(QFrame::HLine); + hLine->setStyleSheet("color: #666666;"); + vLayout->addWidget(hLine); + + vLayout->addSpacing(GemItemDelegate::s_contentMargins.top()); + + // Bottom section + QHBoxLayout* columnHeaderLayout = new QHBoxLayout(); + columnHeaderLayout->setAlignment(Qt::AlignLeft); + + const int gemNameStartX = GemItemDelegate::s_itemMargins.left() + GemItemDelegate::s_contentMargins.left() - 3; + columnHeaderLayout->addSpacing(gemNameStartX); + + QLabel* gemNameLabel = new QLabel(tr("Gem Name")); + gemNameLabel->setStyleSheet("font-size: 12px;"); + columnHeaderLayout->addWidget(gemNameLabel); + + columnHeaderLayout->addSpacing(77); + + QLabel* gemSummaryLabel = new QLabel(tr("Gem Summary")); + gemSummaryLabel->setStyleSheet("font-size: 12px;"); + columnHeaderLayout->addWidget(gemSummaryLabel); + + vLayout->addLayout(columnHeaderLayout); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h new file mode 100644 index 0000000000..b16a654ad0 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListHeaderWidget.h @@ -0,0 +1,33 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#include +#include +#endif + +namespace O3DE::ProjectManager +{ + class GemListHeaderWidget + : public QFrame + { + Q_OBJECT // AUTOMOC + + public: + explicit GemListHeaderWidget(GemSortFilterProxyModel* proxyModel, QWidget* parent = nullptr); + ~GemListHeaderWidget() = default; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp index ad75272c8f..2838277696 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.cpp @@ -18,17 +18,15 @@ namespace O3DE::ProjectManager { - GemListView::GemListView(GemModel* model, QWidget *parent) : - QListView(parent) + GemListView::GemListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent) + : QListView(parent) { setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); - QPalette palette; - palette.setColor(QPalette::Window, QColor("#333333")); - setPalette(palette); + setStyleSheet("background-color: #333333;"); setModel(model); - setSelectionModel(model->GetSelectionModel()); + setSelectionModel(selectionModel); setItemDelegate(new GemItemDelegate(model, this)); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h index 79e16bd211..178de2395f 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemListView.h @@ -14,7 +14,8 @@ #if !defined(Q_MOC_RUN) #include "GemInfo.h" -#include "GemModel.h" +#include +#include #include #endif @@ -24,8 +25,9 @@ namespace O3DE::ProjectManager : public QListView { Q_OBJECT // AUTOMOC + public: - explicit GemListView(GemModel* model, QWidget *parent = nullptr); + explicit GemListView(QAbstractItemModel* model, QItemSelectionModel* selectionModel, QWidget* parent = nullptr); ~GemListView() = default; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp index 1112c656f3..df11c4c7a6 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.cpp @@ -10,7 +10,8 @@ * */ -#include "GemModel.h" +#include +#include namespace O3DE::ProjectManager { @@ -33,10 +34,11 @@ namespace O3DE::ProjectManager item->setData(gemInfo.m_name, RoleName); item->setData(gemInfo.m_creator, RoleCreator); - item->setData(static_cast(gemInfo.m_platforms), RolePlatforms); + item->setData(gemInfo.m_gemOrigin, RoleGemOrigin); + item->setData(aznumeric_cast(gemInfo.m_platforms), RolePlatforms); + item->setData(aznumeric_cast(gemInfo.m_types), RoleTypes); item->setData(gemInfo.m_summary, RoleSummary); item->setData(gemInfo.m_isAdded, RoleIsAdded); - item->setData(gemInfo.m_directoryLink, RoleDirectoryLink); item->setData(gemInfo.m_documentationLink, RoleDocLink); item->setData(gemInfo.m_dependingGemUuids, RoleDependingGems); @@ -44,10 +46,12 @@ namespace O3DE::ProjectManager item->setData(gemInfo.m_version, RoleVersion); item->setData(gemInfo.m_lastUpdatedDate, RoleLastUpdated); item->setData(gemInfo.m_binarySizeInKB, RoleBinarySize); - item->setData(gemInfo.m_features, RoleFeatures); appendRow(item); + + const QModelIndex modelIndex = index(rowCount()-1, 0); + m_nameToIndexMap[gemInfo.m_name] = modelIndex; } void GemModel::Clear() @@ -65,11 +69,21 @@ namespace O3DE::ProjectManager return modelIndex.data(RoleCreator).toString(); } + GemInfo::GemOrigin GemModel::GetGemOrigin(const QModelIndex& modelIndex) + { + return static_cast(modelIndex.data(RoleGemOrigin).toInt()); + } + GemInfo::Platforms GemModel::GetPlatforms(const QModelIndex& modelIndex) { return static_cast(modelIndex.data(RolePlatforms).toInt()); } + GemInfo::Types GemModel::GetTypes(const QModelIndex& modelIndex) + { + return static_cast(modelIndex.data(RoleTypes).toInt()); + } + QString GemModel::GetSummary(const QModelIndex& modelIndex) { return modelIndex.data(RoleSummary).toString(); @@ -90,16 +104,63 @@ namespace O3DE::ProjectManager return modelIndex.data(RoleDocLink).toString(); } - QStringList GemModel::GetDependingGems(const QModelIndex& modelIndex) + QModelIndex GemModel::FindIndexByNameString(const QString& nameString) const + { + const auto iterator = m_nameToIndexMap.find(nameString); + if (iterator != m_nameToIndexMap.end()) + { + return iterator.value(); + } + + return {}; + } + + void GemModel::FindGemNamesByNameStrings(QStringList& inOutGemNames) + { + for (QString& dependingGemString : inOutGemNames) + { + QModelIndex modelIndex = FindIndexByNameString(dependingGemString); + if (modelIndex.isValid()) + { + dependingGemString = GetName(modelIndex); + } + } + } + + QStringList GemModel::GetDependingGemUuids(const QModelIndex& modelIndex) { return modelIndex.data(RoleDependingGems).toStringList(); } - QStringList GemModel::GetConflictingGems(const QModelIndex& modelIndex) + QStringList GemModel::GetDependingGemNames(const QModelIndex& modelIndex) + { + QStringList result = GetDependingGemUuids(modelIndex); + if (result.isEmpty()) + { + return {}; + } + + FindGemNamesByNameStrings(result); + return result; + } + + QStringList GemModel::GetConflictingGemUuids(const QModelIndex& modelIndex) { return modelIndex.data(RoleConflictingGems).toStringList(); } + QStringList GemModel::GetConflictingGemNames(const QModelIndex& modelIndex) + { + QStringList result = GetConflictingGemUuids(modelIndex); + if (result.isEmpty()) + { + return {}; + } + + FindGemNamesByNameStrings(result); + return result; + } + QString GemModel::GetVersion(const QModelIndex& modelIndex) { return modelIndex.data(RoleVersion).toString(); diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h index fba65e7009..0caa399b58 100644 --- a/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemModel.h @@ -13,7 +13,7 @@ #pragma once #if !defined(Q_MOC_RUN) -#include "GemInfo.h" +#include #include #include #include @@ -33,15 +33,22 @@ namespace O3DE::ProjectManager void AddGem(const GemInfo& gemInfo); void Clear(); + QModelIndex FindIndexByNameString(const QString& nameString) const; + void FindGemNamesByNameStrings(QStringList& inOutGemNames); + QStringList GetDependingGemUuids(const QModelIndex& modelIndex); + QStringList GetDependingGemNames(const QModelIndex& modelIndex); + QStringList GetConflictingGemUuids(const QModelIndex& modelIndex); + QStringList GetConflictingGemNames(const QModelIndex& modelIndex); + static QString GetName(const QModelIndex& modelIndex); static QString GetCreator(const QModelIndex& modelIndex); + static GemInfo::GemOrigin GetGemOrigin(const QModelIndex& modelIndex); static GemInfo::Platforms GetPlatforms(const QModelIndex& modelIndex); + static GemInfo::Types GetTypes(const QModelIndex& modelIndex); static QString GetSummary(const QModelIndex& modelIndex); static bool IsAdded(const QModelIndex& modelIndex); static QString GetDirectoryLink(const QModelIndex& modelIndex); static QString GetDocLink(const QModelIndex& modelIndex); - static QStringList GetDependingGems(const QModelIndex& modelIndex); - static QStringList GetConflictingGems(const QModelIndex& modelIndex); static QString GetVersion(const QModelIndex& modelIndex); static QString GetLastUpdated(const QModelIndex& modelIndex); static int GetBinarySizeInKB(const QModelIndex& modelIndex); @@ -52,6 +59,7 @@ namespace O3DE::ProjectManager { RoleName = Qt::UserRole, RoleCreator, + RoleGemOrigin, RolePlatforms, RoleSummary, RoleIsAdded, @@ -63,8 +71,10 @@ namespace O3DE::ProjectManager RoleLastUpdated, RoleBinarySize, RoleFeatures, + RoleTypes }; + QHash m_nameToIndexMap; QItemSelectionModel* m_selectionModel = nullptr; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp new file mode 100644 index 0000000000..33936f417e --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.cpp @@ -0,0 +1,133 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace O3DE::ProjectManager +{ + GemSortFilterProxyModel::GemSortFilterProxyModel(GemModel* sourceModel, QObject* parent) + : QSortFilterProxyModel(parent) + , m_sourceModel(sourceModel) + { + setSourceModel(sourceModel); + m_selectionProxyModel = new AzQtComponents::SelectionProxyModel(sourceModel->GetSelectionModel(), this, parent); + } + + bool GemSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const + { + // Do not use sourceParent->child because an invalid parent does not produce valid children (which our index function does) + QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent); + if (!sourceIndex.isValid()) + { + return false; + } + + if (!m_sourceModel->GetName(sourceIndex).contains(m_searchString, Qt::CaseInsensitive)) + { + return false; + } + + // Gem origins + if (m_gemOriginFilter) + { + bool supportsAnyFilteredGemOrigin = false; + for (int i = 0; i < GemInfo::NumGemOrigins; ++i) + { + const GemInfo::GemOrigin filteredGemOrigin = static_cast(1 << i); + if (m_gemOriginFilter & filteredGemOrigin) + { + if ((GemModel::GetGemOrigin(sourceIndex) == filteredGemOrigin)) + { + supportsAnyFilteredGemOrigin = true; + break; + } + } + } + if (!supportsAnyFilteredGemOrigin) + { + return false; + } + } + + // Platform + if (m_platformFilter) + { + bool supportsAnyFilteredPlatform = false; + for (int i = 0; i < GemInfo::NumPlatforms; ++i) + { + const GemInfo::Platform filteredPlatform = static_cast(1 << i); + if (m_platformFilter & filteredPlatform) + { + if ((GemModel::GetPlatforms(sourceIndex) & filteredPlatform)) + { + supportsAnyFilteredPlatform = true; + break; + } + } + } + if (!supportsAnyFilteredPlatform) + { + return false; + } + } + + // Types (Asset, Code, Tool) + if (m_typeFilter) + { + bool supportsAnyFilteredType = false; + for (int i = 0; i < GemInfo::NumTypes; ++i) + { + const GemInfo::Type filteredType = static_cast(1 << i); + if (m_typeFilter & filteredType) + { + if ((GemModel::GetTypes(sourceIndex) & filteredType)) + { + supportsAnyFilteredType = true; + break; + } + } + } + if (!supportsAnyFilteredType) + { + return false; + } + } + + // Features + if (!m_featureFilter.isEmpty()) + { + bool containsFilterFeature = false; + const QStringList features = m_sourceModel->GetFeatures(sourceIndex); + for (const QString& feature : features) + { + if (m_featureFilter.contains(feature)) + { + containsFilterFeature = true; + break; + } + } + if (!containsFilterFeature) + { + return false; + } + } + + return true; + } + + void GemSortFilterProxyModel::InvalidateFilter() + { + invalidate(); + emit OnInvalidated(); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h new file mode 100644 index 0000000000..e5554c020c --- /dev/null +++ b/Code/Tools/ProjectManager/Source/GemCatalog/GemSortFilterProxyModel.h @@ -0,0 +1,68 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#include +#include +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QItemSelectionModel) + +namespace O3DE::ProjectManager +{ + class GemSortFilterProxyModel + : public QSortFilterProxyModel + { + Q_OBJECT // AUTOMOC + + public: + GemSortFilterProxyModel(GemModel* sourceModel, QObject* parent = nullptr); + + bool filterAcceptsRow(int sourceRow, const QModelIndex& sourceParent) const override; + + GemModel* GetSourceModel() const { return m_sourceModel; } + AzQtComponents::SelectionProxyModel* GetSelectionModel() const { return m_selectionProxyModel; } + + void SetSearchString(const QString& searchString) { m_searchString = searchString; InvalidateFilter(); } + + GemInfo::GemOrigins GetGemOrigins() const { return m_gemOriginFilter; } + void SetGemOrigins(const GemInfo::GemOrigins& gemOrigins) { m_gemOriginFilter = gemOrigins; InvalidateFilter(); } + + GemInfo::Platforms GetPlatforms() const { return m_platformFilter; } + void SetPlatforms(const GemInfo::Platforms& platforms) { m_platformFilter = platforms; InvalidateFilter(); } + + GemInfo::Types GetTypes() const { return m_typeFilter; } + void SetTypes(const GemInfo::Types& types) { m_typeFilter = types; InvalidateFilter(); } + + const QSet& GetFeatures() const { return m_featureFilter; } + void SetFeatures(const QSet& features) { m_featureFilter = features; InvalidateFilter(); } + + void InvalidateFilter(); + + signals: + void OnInvalidated(); + + private: + GemModel* m_sourceModel = nullptr; + AzQtComponents::SelectionProxyModel* m_selectionProxyModel = nullptr; + + QString m_searchString; + GemInfo::GemOrigins m_gemOriginFilter = {}; + GemInfo::Platforms m_platformFilter = {}; + GemInfo::Types m_typeFilter = {}; + QSet m_featureFilter; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/LinkWidget.cpp b/Code/Tools/ProjectManager/Source/LinkWidget.cpp index fddc4cd8c9..160d9cf7c7 100644 --- a/Code/Tools/ProjectManager/Source/LinkWidget.cpp +++ b/Code/Tools/ProjectManager/Source/LinkWidget.cpp @@ -27,12 +27,17 @@ namespace O3DE::ProjectManager void LinkLabel::mousePressEvent([[maybe_unused]] QMouseEvent* event) { - QDesktopServices::openUrl(m_url); + if (m_url.isValid()) + { + QDesktopServices::openUrl(m_url); + } + + emit clicked(); } void LinkLabel::enterEvent([[maybe_unused]] QEvent* event) { - setStyleSheet("font-size: 9pt; color: #94D2FF; text-decoration: underline;"); + setStyleSheet("font-size: 10px; color: #94D2FF; text-decoration: underline;"); } void LinkLabel::leaveEvent([[maybe_unused]] QEvent* event) @@ -47,6 +52,6 @@ namespace O3DE::ProjectManager void LinkLabel::SetDefaultStyle() { - setStyleSheet("font-size: 9pt; color: #94D2FF;"); + setStyleSheet("font-size: 10px; color: #94D2FF;"); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/LinkWidget.h b/Code/Tools/ProjectManager/Source/LinkWidget.h index 7055dce2af..b3a34cd63a 100644 --- a/Code/Tools/ProjectManager/Source/LinkWidget.h +++ b/Code/Tools/ProjectManager/Source/LinkWidget.h @@ -26,10 +26,16 @@ namespace O3DE::ProjectManager class LinkLabel : public QLabel { + Q_OBJECT // AUTOMOC + public: - LinkLabel(const QString& text, const QUrl& url = {}, QWidget* parent = nullptr); + LinkLabel(const QString& text = {}, const QUrl& url = {}, QWidget* parent = nullptr); void SetUrl(const QUrl& url); + + signals: + void clicked(); + private: void mousePressEvent(QMouseEvent* event) override; void enterEvent(QEvent* event) override; diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp index 153c0964c7..b57a2b35b2 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.cpp @@ -12,6 +12,9 @@ #include #include +#include +#include +#include #include #include @@ -23,6 +26,7 @@ #include #include #include +#include namespace O3DE::ProjectManager { @@ -31,64 +35,81 @@ namespace O3DE::ProjectManager NewProjectSettingsScreen::NewProjectSettingsScreen(QWidget* parent) : ScreenWidget(parent) { - QHBoxLayout* hLayout = new QHBoxLayout(); - this->setLayout(hLayout); + QHBoxLayout* hLayout = new QHBoxLayout(this); + hLayout->setAlignment(Qt::AlignLeft); + hLayout->setContentsMargins(0,0,0,0); + // if we don't provide a parent for this box layout the stylesheet doesn't take + // if we don't set this in a frame (just use a sub-layout) all the content will align incorrectly horizontally + QFrame* projectSettingsFrame = new QFrame(this); + projectSettingsFrame->setObjectName("projectSettings"); QVBoxLayout* vLayout = new QVBoxLayout(this); - QLabel* projectNameLabel = new QLabel(tr("Project Name"), this); - vLayout->addWidget(projectNameLabel); - - m_projectNameLineEdit = new QLineEdit(tr("New Project"), this); - vLayout->addWidget(m_projectNameLineEdit); - - QLabel* projectPathLabel = new QLabel(tr("Project Location"), this); - vLayout->addWidget(projectPathLabel); - + // you cannot remove content margins in qss + vLayout->setContentsMargins(0,0,0,0); + vLayout->setAlignment(Qt::AlignTop); { - QHBoxLayout* projectPathLayout = new QHBoxLayout(this); + m_projectName = new FormLineEditWidget(tr("Project name"), tr("New Project"), this); + m_projectName->setErrorLabelText( + tr("A project with this name already exists at this location. Please choose a new name or location.")); + vLayout->addWidget(m_projectName); - m_projectPathLineEdit = new QLineEdit(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), this); - projectPathLayout->addWidget(m_projectPathLineEdit); + m_projectPath = + new FormBrowseEditWidget(tr("Project Location"), QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), this); + m_projectPath->lineEdit()->setReadOnly(true); + m_projectPath->setErrorLabelText(tr("Please provide a valid path to a folder that exists")); + m_projectPath->lineEdit()->setValidator(new PathValidator(PathValidator::PathMode::ExistingFolder, this)); + vLayout->addWidget(m_projectPath); - QPushButton* browseButton = new QPushButton(tr("Browse"), this); - connect(browseButton, &QPushButton::pressed, this, &NewProjectSettingsScreen::HandleBrowseButton); - projectPathLayout->addWidget(browseButton); - - vLayout->addLayout(projectPathLayout); - } - - QLabel* projectTemplateLabel = new QLabel(this); - projectTemplateLabel->setText("Project Template"); - vLayout->addWidget(projectTemplateLabel); - - QHBoxLayout* templateLayout = new QHBoxLayout(this); - vLayout->addItem(templateLayout); - - m_projectTemplateButtonGroup = new QButtonGroup(this); - auto templatesResult = PythonBindingsInterface::Get()->GetProjectTemplates(); - if (templatesResult.IsSuccess() && !templatesResult.GetValue().isEmpty()) - { - for (auto projectTemplate : templatesResult.GetValue()) + // if we don't use a QFrame we cannot "contain" the widgets inside and move them around + // as a group + QFrame* projectTemplateWidget = new QFrame(this); + projectTemplateWidget->setObjectName("projectTemplate"); + QVBoxLayout* containerLayout = new QVBoxLayout(); + containerLayout->setAlignment(Qt::AlignTop); { - QRadioButton* radioButton = new QRadioButton(projectTemplate.m_name, this); - radioButton->setProperty(k_pathProperty, projectTemplate.m_path); - m_projectTemplateButtonGroup->addButton(radioButton); + QLabel* projectTemplateLabel = new QLabel(tr("Select a Project Template")); + projectTemplateLabel->setObjectName("projectTemplateLabel"); + containerLayout->addWidget(projectTemplateLabel); - templateLayout->addWidget(radioButton); + QLabel* projectTemplateDetailsLabel = new QLabel(tr("Project templates are pre-configured with relevant Gems that provide " + "additional functionality and content to the project.")); + projectTemplateDetailsLabel->setWordWrap(true); + projectTemplateDetailsLabel->setObjectName("projectTemplateDetailsLabel"); + containerLayout->addWidget(projectTemplateDetailsLabel); + + QHBoxLayout* templateLayout = new QHBoxLayout(this); + containerLayout->addItem(templateLayout); + + m_projectTemplateButtonGroup = new QButtonGroup(this); + m_projectTemplateButtonGroup->setObjectName("templateButtonGroup"); + auto templatesResult = PythonBindingsInterface::Get()->GetProjectTemplates(); + if (templatesResult.IsSuccess() && !templatesResult.GetValue().isEmpty()) + { + for (auto projectTemplate : templatesResult.GetValue()) + { + QRadioButton* radioButton = new QRadioButton(projectTemplate.m_name, this); + radioButton->setProperty(k_pathProperty, projectTemplate.m_path); + m_projectTemplateButtonGroup->addButton(radioButton); + + containerLayout->addWidget(radioButton); + } + + m_projectTemplateButtonGroup->buttons().first()->setChecked(true); + } } - - m_projectTemplateButtonGroup->buttons().first()->setChecked(true); + projectTemplateWidget->setLayout(containerLayout); + vLayout->addWidget(projectTemplateWidget); } + projectSettingsFrame->setLayout(vLayout); - QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); - vLayout->addItem(verticalSpacer); + hLayout->addWidget(projectSettingsFrame); - hLayout->addItem(vLayout); + QWidget* projectTemplateDetails = new QWidget(this); + projectTemplateDetails->setObjectName("projectTemplateDetails"); + hLayout->addWidget(projectTemplateDetails); - QWidget* gemsListPlaceholder = new QWidget(this); - gemsListPlaceholder->setFixedWidth(250); - hLayout->addWidget(gemsListPlaceholder); + this->setLayout(hLayout); } ProjectManagerScreen NewProjectSettingsScreen::GetScreenEnum() @@ -96,31 +117,12 @@ namespace O3DE::ProjectManager return ProjectManagerScreen::NewProjectSettings; } - QString NewProjectSettingsScreen::GetNextButtonText() - { - return tr("Next"); - } - - void NewProjectSettingsScreen::HandleBrowseButton() - { - QString defaultPath = m_projectPathLineEdit->text(); - if (defaultPath.isEmpty()) - { - defaultPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); - } - - QString directory = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(this, tr("New project path"), defaultPath)); - if (!directory.isEmpty()) - { - m_projectPathLineEdit->setText(directory); - } - } ProjectInfo NewProjectSettingsScreen::GetProjectInfo() { ProjectInfo projectInfo; - projectInfo.m_projectName = m_projectNameLineEdit->text(); - projectInfo.m_path = QDir::toNativeSeparators(m_projectPathLineEdit->text() + "/" + projectInfo.m_projectName); + projectInfo.m_projectName = m_projectName->lineEdit()->text(); + projectInfo.m_path = QDir::toNativeSeparators(m_projectPath->lineEdit()->text() + "/" + projectInfo.m_projectName); return projectInfo; } @@ -132,18 +134,18 @@ namespace O3DE::ProjectManager bool NewProjectSettingsScreen::Validate() { bool projectNameIsValid = true; - if (m_projectNameLineEdit->text().isEmpty()) + if (m_projectName->lineEdit()->text().isEmpty()) { projectNameIsValid = false; } bool projectPathIsValid = true; - if (m_projectPathLineEdit->text().isEmpty()) + if (m_projectPath->lineEdit()->text().isEmpty()) { projectPathIsValid = false; } - QDir path(QDir::toNativeSeparators(m_projectPathLineEdit->text() + "/" + m_projectNameLineEdit->text())); + QDir path(QDir::toNativeSeparators(m_projectPath->lineEdit()->text() + "/" + m_projectName->lineEdit()->text())); if (path.exists() && !path.isEmpty()) { projectPathIsValid = false; diff --git a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h index dbd4388668..f0e9609fdc 100644 --- a/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h +++ b/Code/Tools/ProjectManager/Source/NewProjectSettingsScreen.h @@ -17,10 +17,12 @@ #endif QT_FORWARD_DECLARE_CLASS(QButtonGroup) -QT_FORWARD_DECLARE_CLASS(QLineEdit) namespace O3DE::ProjectManager { + QT_FORWARD_DECLARE_CLASS(FormLineEditWidget) + QT_FORWARD_DECLARE_CLASS(FormBrowseEditWidget) + class NewProjectSettingsScreen : public ScreenWidget { @@ -28,7 +30,6 @@ namespace O3DE::ProjectManager explicit NewProjectSettingsScreen(QWidget* parent = nullptr); ~NewProjectSettingsScreen() = default; ProjectManagerScreen GetScreenEnum() override; - QString GetNextButtonText() override; ProjectInfo GetProjectInfo(); QString GetProjectTemplatePath(); @@ -39,8 +40,8 @@ namespace O3DE::ProjectManager void HandleBrowseButton(); private: - QLineEdit* m_projectNameLineEdit; - QLineEdit* m_projectPathLineEdit; + FormLineEditWidget* m_projectName; + FormBrowseEditWidget* m_projectPath; QButtonGroup* m_projectTemplateButtonGroup; }; diff --git a/Code/Tools/ProjectManager/Source/PathValidator.cpp b/Code/Tools/ProjectManager/Source/PathValidator.cpp new file mode 100644 index 0000000000..8b74284b6c --- /dev/null +++ b/Code/Tools/ProjectManager/Source/PathValidator.cpp @@ -0,0 +1,65 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include "PathValidator.h" + +#include +#include +#include + +namespace O3DE::ProjectManager +{ + PathValidator::PathValidator(PathMode pathMode, QWidget* parent) + : QValidator(parent) + , m_pathMode(pathMode) + { + } + + void PathValidator::setAllowEmpty(bool allowEmpty) + { + m_allowEmpty = allowEmpty; + } + + void PathValidator::setPathMode(PathMode pathMode) + { + m_pathMode = pathMode; + } + + QValidator::State PathValidator::validate(QString &text, int &) const + { + if(text.isEmpty()) + { + return m_allowEmpty ? QValidator::Acceptable : QValidator::Intermediate; + } + + QFileInfo pathInfo(text); + if(!pathInfo.dir().exists()) + { + return QValidator::Intermediate; + } + + switch(m_pathMode) + { + case PathMode::AnyFile://acceptable, as long as it's not an directoy + return pathInfo.isDir() ? QValidator::Intermediate : QValidator::Acceptable; + case PathMode::ExistingFile://must be an existing file + return pathInfo.exists() && pathInfo.isFile() ? QValidator::Acceptable : QValidator::Intermediate; + case PathMode::ExistingFolder://must be an existing folder + return pathInfo.exists() && pathInfo.isDir() ? QValidator::Acceptable : QValidator::Intermediate; + default: + Q_UNREACHABLE(); + } + + return QValidator::Invalid; + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/PathValidator.h b/Code/Tools/ProjectManager/Source/PathValidator.h new file mode 100644 index 0000000000..aeb35571b9 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/PathValidator.h @@ -0,0 +1,45 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QWidget) + +namespace O3DE::ProjectManager +{ + class PathValidator + : public QValidator + { + public: + enum class PathMode { + ExistingFile, //!< A single, existings file. Useful for "Open file" + ExistingFolder, //!< A single, existing directory. Useful for "Open Folder" + AnyFile //!< A single, valid file, doesn't have to exist but the directory must. Useful for "Save File" + }; + + explicit PathValidator(PathMode pathMode, QWidget* parent = nullptr); + ~PathValidator() = default; + + void setAllowEmpty(bool allowEmpty); + void setPathMode(PathMode pathMode); + + QValidator::State validate(QString &text, int &) const override; + + private: + PathMode m_pathMode = PathMode::AnyFile; + bool m_allowEmpty = false; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp new file mode 100644 index 0000000000..72ffa686c1 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.cpp @@ -0,0 +1,139 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + + +#include +#include +#include +#include +#include +#include +#include +#include + +//#define SHOW_ALL_PROJECT_ACTIONS + +namespace O3DE::ProjectManager +{ + inline constexpr static int s_projectImageWidth = 210; + inline constexpr static int s_projectImageHeight = 280; + + LabelButton::LabelButton(QWidget* parent) + : QLabel(parent) + { + setObjectName("labelButton"); + m_overlayLabel = new QLabel("", this); + m_overlayLabel->setObjectName("labelButtonOverlay"); + m_overlayLabel->setWordWrap(true); + m_overlayLabel->setAlignment(Qt::AlignCenter); + m_overlayLabel->setVisible(false); + } + + void LabelButton::mousePressEvent([[maybe_unused]] QMouseEvent* event) + { + if(m_enabled) + { + emit triggered(); + } + } + + void LabelButton::SetEnabled(bool enabled) + { + m_enabled = enabled; + m_overlayLabel->setVisible(!enabled); + } + + void LabelButton::SetOverlayText(const QString& text) + { + m_overlayLabel->setText(text); + } + + ProjectButton::ProjectButton(const ProjectInfo& projectInfo, QWidget* parent) + : QFrame(parent) + , m_projectInfo(projectInfo) + { + if (m_projectInfo.m_imagePath.isEmpty()) + { + m_projectInfo.m_imagePath = ":/DefaultProjectImage.png"; + } + + Setup(); + } + + void ProjectButton::Setup() + { + setObjectName("projectButton"); + + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->setSpacing(0); + vLayout->setContentsMargins(0, 0, 0, 0); + setLayout(vLayout); + + m_projectImageLabel = new LabelButton(this); + m_projectImageLabel->setFixedSize(s_projectImageWidth, s_projectImageHeight); + m_projectImageLabel->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + vLayout->addWidget(m_projectImageLabel); + + m_projectImageLabel->setPixmap( + QPixmap(m_projectInfo.m_imagePath).scaled(m_projectImageLabel->size(), Qt::KeepAspectRatioByExpanding)); + + QMenu* newProjectMenu = new QMenu(this); + m_editProjectAction = newProjectMenu->addAction(tr("Edit Project Settings...")); + newProjectMenu->addSeparator(); + m_copyProjectAction = newProjectMenu->addAction(tr("Duplicate")); + newProjectMenu->addSeparator(); + m_removeProjectAction = newProjectMenu->addAction(tr("Remove from O3DE")); + m_deleteProjectAction = newProjectMenu->addAction(tr("Delete this Project")); + +#ifdef SHOW_ALL_PROJECT_ACTIONS + m_editProjectGemsAction = newProjectMenu->addAction(tr("Cutomize Gems...")); +#endif + + QFrame* footer = new QFrame(this); + QHBoxLayout* hLayout = new QHBoxLayout(); + hLayout->setContentsMargins(0, 0, 0, 0); + footer->setLayout(hLayout); + { + QLabel* projectNameLabel = new QLabel(m_projectInfo.m_displayName, this); + hLayout->addWidget(projectNameLabel); + + QPushButton* projectMenuButton = new QPushButton(this); + projectMenuButton->setObjectName("projectMenuButton"); + projectMenuButton->setMenu(newProjectMenu); + hLayout->addWidget(projectMenuButton); + } + + vLayout->addWidget(footer); + + connect(m_projectImageLabel, &LabelButton::triggered, [this]() { emit OpenProject(m_projectInfo.m_path); }); + connect(m_editProjectAction, &QAction::triggered, [this]() { emit EditProject(m_projectInfo.m_path); }); + connect(m_copyProjectAction, &QAction::triggered, [this]() { emit CopyProject(m_projectInfo.m_path); }); + connect(m_removeProjectAction, &QAction::triggered, [this]() { emit RemoveProject(m_projectInfo.m_path); }); + connect(m_deleteProjectAction, &QAction::triggered, [this]() { emit DeleteProject(m_projectInfo.m_path); }); + +#ifdef SHOW_ALL_PROJECT_ACTIONS + connect(m_editProjectGemsAction, &QAction::triggered, [this]() { emit EditProjectGems(m_projectInfo.m_path); }); +#endif + } + + void ProjectButton::SetButtonEnabled(bool enabled) + { + m_projectImageLabel->SetEnabled(enabled); + } + + void ProjectButton::SetButtonOverlayText(const QString& text) + { + m_projectImageLabel->SetOverlayText(text); + } +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h new file mode 100644 index 0000000000..e82b56b3fa --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectButtonWidget.h @@ -0,0 +1,81 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#if !defined(Q_MOC_RUN) +#include + +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QPixmap) +QT_FORWARD_DECLARE_CLASS(QPushButton) +QT_FORWARD_DECLARE_CLASS(QAction) + +namespace O3DE::ProjectManager +{ + class LabelButton + : public QLabel + { + Q_OBJECT // AUTOMOC + + public: + explicit LabelButton(QWidget* parent = nullptr); + ~LabelButton() = default; + + void SetEnabled(bool enabled); + void SetOverlayText(const QString& text); + + signals: + void triggered(); + + public slots: + void mousePressEvent(QMouseEvent* event) override; + + private: + QLabel* m_overlayLabel; + bool m_enabled = true; + }; + + class ProjectButton + : public QFrame + { + Q_OBJECT // AUTOMOC + + public: + explicit ProjectButton(const ProjectInfo& m_projectInfo, QWidget* parent = nullptr); + ~ProjectButton() = default; + + void SetButtonEnabled(bool enabled); + void SetButtonOverlayText(const QString& text); + + signals: + void OpenProject(const QString& projectName); + void EditProject(const QString& projectName); + void EditProjectGems(const QString& projectName); + void CopyProject(const QString& projectName); + void RemoveProject(const QString& projectName); + void DeleteProject(const QString& projectName); + + private: + void Setup(); + + ProjectInfo m_projectInfo; + LabelButton* m_projectImageLabel; + QAction* m_editProjectAction; + QAction* m_editProjectGemsAction; + QAction* m_copyProjectAction; + QAction* m_removeProjectAction; + QAction* m_deleteProjectAction; + }; +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.cpp b/Code/Tools/ProjectManager/Source/ProjectManagerWindow.cpp index 977667071f..76bcc2eb99 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectManagerWindow.cpp @@ -11,48 +11,46 @@ */ #include -#include +#include #include #include #include -#include - namespace O3DE::ProjectManager { ProjectManagerWindow::ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath) : QMainWindow(parent) - , m_ui(new Ui::ProjectManagerWindowClass()) { - m_ui->setupUi(this); - m_pythonBindings = AZStd::make_unique(engineRootPath); - m_screensCtrl = new ScreensCtrl(); - m_ui->verticalLayout->addWidget(m_screensCtrl); + setWindowTitle(tr("O3DE Project Manager")); - connect(m_ui->projectsMenu, &QMenu::aboutToShow, this, &ProjectManagerWindow::HandleProjectsMenu); - connect(m_ui->engineMenu, &QMenu::aboutToShow, this, &ProjectManagerWindow::HandleEngineMenu); - - QDir rootDir = QString::fromUtf8(engineRootPath.Native().data(), aznumeric_cast(engineRootPath.Native().size())); - const auto pathOnDisk = rootDir.absoluteFilePath("Code/Tools/ProjectManager/Resources"); - const auto qrcPath = QStringLiteral(":/ProjectManagerWindow"); - AzQtComponents::StyleManager::addSearchPaths("projectmanagerwindow", pathOnDisk, qrcPath, engineRootPath); - - AzQtComponents::StyleManager::setStyleSheet(this, QStringLiteral("projectlauncherwindow:ProjectManagerWindow.qss")); + ScreensCtrl* screensCtrl = new ScreensCtrl(); + // currently the tab order on the home page is based on the order of this list QVector screenEnums = { - ProjectManagerScreen::FirstTimeUse, - ProjectManagerScreen::NewProjectSettingsCore, - ProjectManagerScreen::ProjectsHome, - ProjectManagerScreen::ProjectSettings, - ProjectManagerScreen::EngineSettings + ProjectManagerScreen::Projects, + ProjectManagerScreen::EngineSettings, + ProjectManagerScreen::CreateProject, + ProjectManagerScreen::UpdateProject }; - m_screensCtrl->BuildScreens(screenEnums); - m_screensCtrl->ForceChangeToScreen(ProjectManagerScreen::FirstTimeUse, false); + screensCtrl->BuildScreens(screenEnums); + + setCentralWidget(screensCtrl); + + // setup stylesheets and hot reloading + QDir rootDir = QString::fromUtf8(engineRootPath.Native().data(), aznumeric_cast(engineRootPath.Native().size())); + const auto pathOnDisk = rootDir.absoluteFilePath("Code/Tools/ProjectManager/Resources"); + const auto qrcPath = QStringLiteral(":/ProjectManager/style"); + AzQtComponents::StyleManager::addSearchPaths("style", pathOnDisk, qrcPath, engineRootPath); + + // set stylesheet after creating the screens or their styles won't get updated + AzQtComponents::StyleManager::setStyleSheet(this, QStringLiteral("style:ProjectManager.qss")); + + screensCtrl->ForceChangeToScreen(ProjectManagerScreen::Projects, false); } ProjectManagerWindow::~ProjectManagerWindow() @@ -60,13 +58,4 @@ namespace O3DE::ProjectManager m_pythonBindings.reset(); } - void ProjectManagerWindow::HandleProjectsMenu() - { - m_screensCtrl->ChangeToScreen(ProjectManagerScreen::ProjectsHome); - } - void ProjectManagerWindow::HandleEngineMenu() - { - m_screensCtrl->ChangeToScreen(ProjectManagerScreen::EngineSettings); - } - } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.h b/Code/Tools/ProjectManager/Source/ProjectManagerWindow.h index d5c586e59b..74db3467c5 100644 --- a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.h +++ b/Code/Tools/ProjectManager/Source/ProjectManagerWindow.h @@ -13,17 +13,9 @@ #if !defined(Q_MOC_RUN) #include - -#include - #include #endif -namespace Ui -{ - class ProjectManagerWindowClass; -} - namespace O3DE::ProjectManager { class ProjectManagerWindow @@ -35,13 +27,7 @@ namespace O3DE::ProjectManager explicit ProjectManagerWindow(QWidget* parent, const AZ::IO::PathView& engineRootPath); ~ProjectManagerWindow(); - protected slots: - void HandleProjectsMenu(); - void HandleEngineMenu(); - private: - QScopedPointer m_ui; - ScreensCtrl* m_screensCtrl; AZStd::unique_ptr m_pythonBindings; }; diff --git a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.ui b/Code/Tools/ProjectManager/Source/ProjectManagerWindow.ui deleted file mode 100644 index 789dd1b656..0000000000 --- a/Code/Tools/ProjectManager/Source/ProjectManagerWindow.ui +++ /dev/null @@ -1,61 +0,0 @@ - - - ProjectManagerWindowClass - - - - 0 - 0 - 800 - 600 - - - - O3DE Project Manager - - - - - - - - 0 - 0 - 800 - 36 - - - - - 16 - - - - - Icon - - - - :/Resources/o3de_editor.ico:/Resources/o3de_editor.ico - - - - - Projects - - - - - Engine - - - - - - - - - - - - diff --git a/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.cpp index 52fca439b4..76aa1d2897 100644 --- a/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.cpp +++ b/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.cpp @@ -30,6 +30,23 @@ namespace O3DE::ProjectManager return ProjectManagerScreen::ProjectSettings; } + ProjectInfo ProjectSettingsScreen::GetProjectInfo() + { + // Impl pending next PR + return ProjectInfo(); + } + + void ProjectSettingsScreen::SetProjectInfo() + { + // Impl pending next PR + } + + bool ProjectSettingsScreen::Validate() + { + // Impl pending next PR + return true; + } + void ProjectSettingsScreen::HandleGemsButton() { emit ChangeScreenRequest(ProjectManagerScreen::GemCatalog); diff --git a/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.h b/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.h index 1ec1b46f44..a4cafcd93a 100644 --- a/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectSettingsScreen.h @@ -13,6 +13,7 @@ #if !defined(Q_MOC_RUN) #include +#include #endif namespace Ui @@ -30,6 +31,11 @@ namespace O3DE::ProjectManager ~ProjectSettingsScreen() = default; ProjectManagerScreen GetScreenEnum() override; + ProjectInfo GetProjectInfo(); + void SetProjectInfo(); + + bool Validate(); + protected slots: void HandleGemsButton(); diff --git a/Code/Tools/ProjectManager/Source/ProjectUtils.cpp b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp new file mode 100644 index 0000000000..526e745d82 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.cpp @@ -0,0 +1,196 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include + +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + namespace ProjectUtils + { + static bool WarnDirectoryOverwrite(const QString& path, QWidget* parent) + { + if (!QDir(path).isEmpty()) + { + QMessageBox::StandardButton warningResult = QMessageBox::warning( + parent, + QObject::tr("Overwrite Directory"), + QObject::tr("Directory is not empty! Are you sure you want to overwrite it?"), + QMessageBox::No | QMessageBox::Yes + ); + + if (warningResult != QMessageBox::Yes) + { + return false; + } + } + + return true; + } + + static bool IsDirectoryDescedent(const QString& possibleAncestorPath, const QString& possibleDecedentPath) + { + QDir ancestor(possibleAncestorPath); + QDir descendent(possibleDecedentPath); + + do + { + if (ancestor == descendent) + { + return false; + } + + descendent.cdUp(); + } + while (!descendent.isRoot()); + + return true; + } + + static bool CopyDirectory(const QString& origPath, const QString& newPath) + { + QDir original(origPath); + if (!original.exists()) + { + return false; + } + + for (QString directory : original.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) + { + QString newDirectoryPath = newPath + QDir::separator() + directory; + original.mkpath(newDirectoryPath); + + if (!CopyDirectory(origPath + QDir::separator() + directory, newDirectoryPath)) + { + return false; + } + } + + for (QString file : original.entryList(QDir::Files)) + { + if (!QFile::copy(origPath + QDir::separator() + file, newPath + QDir::separator() + file)) + return false; + } + + return true; + } + + bool AddProjectDialog(QWidget* parent) + { + QString path = QDir::toNativeSeparators(QFileDialog::getExistingDirectory(parent, QObject::tr("Select Project Directory"))); + if (!path.isEmpty()) + { + return RegisterProject(path); + } + + return false; + } + + bool RegisterProject(const QString& path) + { + return PythonBindingsInterface::Get()->AddProject(path); + } + + bool UnregisterProject(const QString& path) + { + return PythonBindingsInterface::Get()->RemoveProject(path); + } + + bool CopyProjectDialog(const QString& origPath, QWidget* parent) + { + bool copyResult = false; + + QDir parentOrigDir(origPath); + parentOrigDir.cdUp(); + QString newPath = QDir::toNativeSeparators( + QFileDialog::getExistingDirectory(parent, QObject::tr("Select New Project Directory"), parentOrigDir.path())); + if (!newPath.isEmpty()) + { + if (!WarnDirectoryOverwrite(newPath, parent)) + { + return false; + } + + // TODO: Block UX and Notify User they need to wait + + copyResult = CopyProject(origPath, newPath); + } + + return copyResult; + } + + bool CopyProject(const QString& origPath, const QString& newPath) + { + // Disallow copying from or into subdirectory + if (!IsDirectoryDescedent(origPath, newPath) || !IsDirectoryDescedent(newPath, origPath)) + { + return false; + } + + if (!CopyDirectory(origPath, newPath)) + { + // Cleanup whatever mess was made + DeleteProjectFiles(newPath, true); + return false; + } + + if (!RegisterProject(newPath)) + { + DeleteProjectFiles(newPath, true); + } + + return true; + } + + bool DeleteProjectFiles(const QString& path, bool force) + { + QDir projectDirectory(path); + if (projectDirectory.exists()) + { + // Check if there is an actual project hereor just force it + if (force || PythonBindingsInterface::Get()->GetProject(path).IsSuccess()) + { + return projectDirectory.removeRecursively(); + } + } + + return false; + } + + bool MoveProject(const QString& origPath, const QString& newPath, QWidget* parent) + { + if (!WarnDirectoryOverwrite(newPath, parent) || !UnregisterProject(origPath)) + { + return false; + } + + QDir directory; + if (directory.rename(origPath, newPath)) + { + return directory.rename(origPath, newPath); + } + + if (!RegisterProject(newPath)) + { + return false; + } + + return true; + } + + } // namespace ProjectUtils +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.h b/Code/Tools/ProjectManager/Source/ProjectUtils.h similarity index 52% rename from Code/Tools/ProjectManager/Source/FirstTimeUseScreen.h rename to Code/Tools/ProjectManager/Source/ProjectUtils.h index 4b4a99f16a..5982bff634 100644 --- a/Code/Tools/ProjectManager/Source/FirstTimeUseScreen.h +++ b/Code/Tools/ProjectManager/Source/ProjectUtils.h @@ -11,31 +11,18 @@ */ #pragma once -#if !defined(Q_MOC_RUN) -#include -#endif - -namespace Ui -{ - class FirstTimeUseClass; -} +#include namespace O3DE::ProjectManager { - class FirstTimeUseScreen - : public ScreenWidget + namespace ProjectUtils { - public: - explicit FirstTimeUseScreen(QWidget* parent = nullptr); - ~FirstTimeUseScreen() = default; - ProjectManagerScreen GetScreenEnum() override; - - protected slots: - void HandleNewProjectButton(); - void HandleOpenProjectButton(); - - private: - QScopedPointer m_ui; - }; - + bool AddProjectDialog(QWidget* parent = nullptr); + bool RegisterProject(const QString& path); + bool UnregisterProject(const QString& path); + bool CopyProjectDialog(const QString& origPath, QWidget* parent = nullptr); + bool CopyProject(const QString& origPath, const QString& newPath); + bool DeleteProjectFiles(const QString& path, bool force = false); + bool MoveProject(const QString& origPath, const QString& newPath, QWidget* parent = nullptr); + } // namespace ProjectUtils } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.cpp deleted file mode 100644 index 539f79b017..0000000000 --- a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. - * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - */ - -#include - -#include - -#include - -namespace O3DE::ProjectManager -{ - ProjectsHomeScreen::ProjectsHomeScreen(QWidget* parent) - : ScreenWidget(parent) - , m_ui(new Ui::ProjectsHomeClass()) - { - m_ui->setupUi(this); - - connect(m_ui->newProjectButton, &QPushButton::pressed, this, &ProjectsHomeScreen::HandleNewProjectButton); - connect(m_ui->addProjectButton, &QPushButton::pressed, this, &ProjectsHomeScreen::HandleAddProjectButton); - connect(m_ui->editProjectButton, &QPushButton::pressed, this, &ProjectsHomeScreen::HandleEditProjectButton); - } - - ProjectManagerScreen ProjectsHomeScreen::GetScreenEnum() - { - return ProjectManagerScreen::ProjectsHome; - } - - void ProjectsHomeScreen::HandleNewProjectButton() - { - emit ResetScreenRequest(ProjectManagerScreen::NewProjectSettingsCore); - emit ChangeScreenRequest(ProjectManagerScreen::NewProjectSettingsCore); - } - void ProjectsHomeScreen::HandleAddProjectButton() - { - // Do nothing for now - } - void ProjectsHomeScreen::HandleEditProjectButton() - { - emit ChangeScreenRequest(ProjectManagerScreen::ProjectSettings); - } - -} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.ui b/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.ui deleted file mode 100644 index ea3e34d84b..0000000000 --- a/Code/Tools/ProjectManager/Source/ProjectsHomeScreen.ui +++ /dev/null @@ -1,137 +0,0 @@ - - - ProjectsHomeClass - - - - 0 - 0 - 826 - 585 - - - - Form - - - - - - My Projects - - - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - - - - :/Resources/Add.svg:/Resources/Add.svg - - - - - - - - 0 - 0 - - - - - - - - :/Resources/Select_Folder.svg:/Resources/Select_Folder.svg - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 20 - - - - - - - - - - Edit Project - - - - - - - Open a Project - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp new file mode 100644 index 0000000000..dd2e411ec5 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.cpp @@ -0,0 +1,366 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#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 + +//#define DISPLAY_PROJECT_DEV_DATA true + +namespace O3DE::ProjectManager +{ + ProjectsScreen::ProjectsScreen(QWidget* parent) + : ScreenWidget(parent) + { + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->setAlignment(Qt::AlignTop); + vLayout->setContentsMargins(s_contentMargins, 0, s_contentMargins, 0); + setLayout(vLayout); + + m_background.load(":/Backgrounds/FirstTimeBackgroundImage.jpg"); + + m_stack = new QStackedWidget(this); + + m_firstTimeContent = CreateFirstTimeContent(); + m_stack->addWidget(m_firstTimeContent); + + m_projectsContent = CreateProjectsContent(); + m_stack->addWidget(m_projectsContent); + + vLayout->addWidget(m_stack); + } + + QFrame* ProjectsScreen::CreateFirstTimeContent() + { + QFrame* frame = new QFrame(this); + frame->setObjectName("firstTimeContent"); + { + QVBoxLayout* layout = new QVBoxLayout(this); + layout->setContentsMargins(0, 0, 0, 0); + layout->setAlignment(Qt::AlignTop); + frame->setLayout(layout); + + QLabel* titleLabel = new QLabel(tr("Ready. Set. Create."), this); + titleLabel->setObjectName("titleLabel"); + layout->addWidget(titleLabel); + + QLabel* introLabel = new QLabel(this); + introLabel->setObjectName("introLabel"); + introLabel->setText(tr("Welcome to O3DE! Start something new by creating a project. Not sure what to create? \nExplore what's " + "available by downloading our sample project.")); + layout->addWidget(introLabel); + + QHBoxLayout* buttonLayout = new QHBoxLayout(this); + buttonLayout->setAlignment(Qt::AlignLeft); + buttonLayout->setSpacing(s_spacerSize); + + // use a newline to force the text up + QPushButton* createProjectButton = new QPushButton(tr("Create a Project\n"), this); + createProjectButton->setObjectName("createProjectButton"); + buttonLayout->addWidget(createProjectButton); + + QPushButton* addProjectButton = new QPushButton(tr("Add a Project\n"), this); + addProjectButton->setObjectName("addProjectButton"); + buttonLayout->addWidget(addProjectButton); + + connect(createProjectButton, &QPushButton::clicked, this, &ProjectsScreen::HandleNewProjectButton); + connect(addProjectButton, &QPushButton::clicked, this, &ProjectsScreen::HandleAddProjectButton); + + layout->addLayout(buttonLayout); + } + + return frame; + } + + QFrame* ProjectsScreen::CreateProjectsContent() + { + QFrame* frame = new QFrame(this); + frame->setObjectName("projectsContent"); + { + QVBoxLayout* layout = new QVBoxLayout(); + layout->setAlignment(Qt::AlignTop); + layout->setContentsMargins(0, 0, 0, 0); + frame->setLayout(layout); + + QFrame* header = new QFrame(this); + QHBoxLayout* headerLayout = new QHBoxLayout(); + { + QLabel* titleLabel = new QLabel(tr("My Projects"), this); + titleLabel->setObjectName("titleLabel"); + headerLayout->addWidget(titleLabel); + + QMenu* newProjectMenu = new QMenu(this); + m_createNewProjectAction = newProjectMenu->addAction("Create New Project"); + m_addExistingProjectAction = newProjectMenu->addAction("Add Existing Project"); + + connect(m_createNewProjectAction, &QAction::triggered, this, &ProjectsScreen::HandleNewProjectButton); + connect(m_addExistingProjectAction, &QAction::triggered, this, &ProjectsScreen::HandleAddProjectButton); + + QPushButton* newProjectMenuButton = new QPushButton(tr("New Project..."), this); + newProjectMenuButton->setObjectName("newProjectButton"); + newProjectMenuButton->setMenu(newProjectMenu); + newProjectMenuButton->setDefault(true); + headerLayout->addWidget(newProjectMenuButton); + } + header->setLayout(headerLayout); + + layout->addWidget(header); + + // Get all projects and create a horizontal scrolling list of them + auto projectsResult = PythonBindingsInterface::Get()->GetProjects(); + if (projectsResult.IsSuccess() && !projectsResult.GetValue().isEmpty()) + { + QScrollArea* projectsScrollArea = new QScrollArea(this); + QWidget* scrollWidget = new QWidget(); + + FlowLayout* flowLayout = new FlowLayout(0, s_spacerSize, s_spacerSize); + scrollWidget->setLayout(flowLayout); + + projectsScrollArea->setWidget(scrollWidget); + projectsScrollArea->setWidgetResizable(true); + +#ifndef DISPLAY_PROJECT_DEV_DATA + for (auto project : projectsResult.GetValue()) +#else + ProjectInfo project = projectsResult.GetValue().at(0); + for (int i = 0; i < 15; i++) +#endif + { + ProjectButton* projectButton; + + QString projectPreviewPath = project.m_path + m_projectPreviewImagePath; + QFileInfo doesPreviewExist(projectPreviewPath); + if (doesPreviewExist.exists() && doesPreviewExist.isFile()) + { + project.m_imagePath = projectPreviewPath; + } + + projectButton = new ProjectButton(project, this); + + flowLayout->addWidget(projectButton); + + connect(projectButton, &ProjectButton::OpenProject, this, &ProjectsScreen::HandleOpenProject); + connect(projectButton, &ProjectButton::EditProject, this, &ProjectsScreen::HandleEditProject); + connect(projectButton, &ProjectButton::CopyProject, this, &ProjectsScreen::HandleCopyProject); + connect(projectButton, &ProjectButton::RemoveProject, this, &ProjectsScreen::HandleRemoveProject); + connect(projectButton, &ProjectButton::DeleteProject, this, &ProjectsScreen::HandleDeleteProject); + +#ifdef SHOW_ALL_PROJECT_ACTIONS + connect(projectButton, &ProjectButton::EditProjectGems, this, &ProjectsScreen::HandleEditProjectGems); +#endif + } + + layout->addWidget(projectsScrollArea); + } + } + + return frame; + } + + ProjectManagerScreen ProjectsScreen::GetScreenEnum() + { + return ProjectManagerScreen::Projects; + } + + bool ProjectsScreen::IsTab() + { + return true; + } + + QString ProjectsScreen::GetTabText() + { + return tr("Projects"); + } + + void ProjectsScreen::paintEvent([[maybe_unused]] QPaintEvent* event) + { + // we paint the background here because qss does not support background cover scaling + QPainter painter(this); + + auto winSize = size(); + auto pixmapRatio = (float)m_background.width() / m_background.height(); + auto windowRatio = (float)winSize.width() / winSize.height(); + + if (pixmapRatio > windowRatio) + { + auto newWidth = (int)(winSize.height() * pixmapRatio); + auto offset = (newWidth - winSize.width()) / -2; + painter.drawPixmap(offset, 0, newWidth, winSize.height(), m_background); + } + else + { + auto newHeight = (int)(winSize.width() / pixmapRatio); + painter.drawPixmap(0, 0, winSize.width(), newHeight, m_background); + } + } + + void ProjectsScreen::HandleNewProjectButton() + { + emit ResetScreenRequest(ProjectManagerScreen::CreateProject); + emit ChangeScreenRequest(ProjectManagerScreen::CreateProject); + } + void ProjectsScreen::HandleAddProjectButton() + { + if (ProjectUtils::AddProjectDialog(this)) + { + emit ResetScreenRequest(ProjectManagerScreen::Projects); + emit ChangeScreenRequest(ProjectManagerScreen::Projects); + } + } + void ProjectsScreen::HandleOpenProject(const QString& projectPath) + { + if (!projectPath.isEmpty()) + { + AZ::IO::FixedMaxPath executableDirectory = AZ::Utils::GetExecutableDirectory(); + AZStd::string executableFilename = "Editor"; + AZ::IO::FixedMaxPath editorExecutablePath = executableDirectory / (executableFilename + AZ_TRAIT_OS_EXECUTABLE_EXTENSION); + auto cmdPath = AZ::IO::FixedMaxPathString::format("%s -regset=\"/Amazon/AzCore/Bootstrap/project_path=%s\"", editorExecutablePath.c_str(), projectPath.toStdString().c_str()); + + AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; + processLaunchInfo.m_commandlineParameters = cmdPath; + bool launchSucceeded = AzFramework::ProcessLauncher::LaunchUnwatchedProcess(processLaunchInfo); + if (!launchSucceeded) + { + AZ_Error("ProjectManager", false, "Failed to launch editor"); + QMessageBox::critical( this, tr("Error"), tr("Failed to launch the Editor, please verify the project settings are valid.")); + } + else + { + // prevent the user from accidentally pressing the button while the editor is launching + // and let them know what's happening + ProjectButton* button = qobject_cast(sender()); + if (button) + { + button->SetButtonEnabled(false); + button->SetButtonOverlayText(tr("Opening Editor...")); + } + + // enable the button after 3 seconds + constexpr int waitTimeInMs = 3000; + QTimer::singleShot(waitTimeInMs, this, [this, button] { + if (button) + { + button->SetButtonEnabled(true); + } + }); + } + } + else + { + AZ_Error("ProjectManager", false, "Cannot open editor because an empty project path was provided"); + QMessageBox::critical( this, tr("Error"), tr("Failed to launch the Editor because the project path is invalid.")); + } + + } + void ProjectsScreen::HandleEditProject(const QString& projectPath) + { + emit NotifyCurrentProject(projectPath); + emit ResetScreenRequest(ProjectManagerScreen::UpdateProject); + emit ChangeScreenRequest(ProjectManagerScreen::UpdateProject); + } + void ProjectsScreen::HandleEditProjectGems(const QString& projectPath) + { + emit NotifyCurrentProject(projectPath); + emit ChangeScreenRequest(ProjectManagerScreen::GemCatalog); + } + void ProjectsScreen::HandleCopyProject(const QString& projectPath) + { + // Open file dialog and choose location for copied project then register copy with O3DE + if (ProjectUtils::CopyProjectDialog(projectPath, this)) + { + emit ResetScreenRequest(ProjectManagerScreen::Projects); + emit ChangeScreenRequest(ProjectManagerScreen::Projects); + } + } + void ProjectsScreen::HandleRemoveProject(const QString& projectPath) + { + // Unregister Project from O3DE and reload projects + if (ProjectUtils::UnregisterProject(projectPath)) + { + emit ResetScreenRequest(ProjectManagerScreen::Projects); + emit ChangeScreenRequest(ProjectManagerScreen::Projects); + } + } + void ProjectsScreen::HandleDeleteProject(const QString& projectPath) + { + QMessageBox::StandardButton warningResult = QMessageBox::warning( + this, tr("Delete Project"), tr("Are you sure?\nProject will be removed from O3DE and directory will be deleted!"), + QMessageBox::No | QMessageBox::Yes); + + if (warningResult == QMessageBox::Yes) + { + // Remove project from O3DE and delete from disk + HandleRemoveProject(projectPath); + ProjectUtils::DeleteProjectFiles(projectPath); + } + } + + void ProjectsScreen::NotifyCurrentScreen() + { + if (ShouldDisplayFirstTimeContent()) + { + m_stack->setCurrentWidget(m_firstTimeContent); + } + else + { + m_stack->setCurrentWidget(m_projectsContent); + } + } + + bool ProjectsScreen::ShouldDisplayFirstTimeContent() + { + auto projectsResult = PythonBindingsInterface::Get()->GetProjects(); + if (!projectsResult.IsSuccess() || projectsResult.GetValue().isEmpty()) + { + return true; + } + + QSettings settings; + bool displayFirstTimeContent = settings.value("displayFirstTimeContent", true).toBool(); + if (displayFirstTimeContent) + { + settings.setValue("displayFirstTimeContent", false); + } + + return displayFirstTimeContent; + } + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectsScreen.h b/Code/Tools/ProjectManager/Source/ProjectsScreen.h new file mode 100644 index 0000000000..d88ba8398d --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ProjectsScreen.h @@ -0,0 +1,69 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#if !defined(Q_MOC_RUN) +#include +#endif + +QT_FORWARD_DECLARE_CLASS(QPaintEvent) +QT_FORWARD_DECLARE_CLASS(QFrame) +QT_FORWARD_DECLARE_CLASS(QStackedWidget) + +namespace O3DE::ProjectManager +{ + class ProjectsScreen + : public ScreenWidget + { + + public: + explicit ProjectsScreen(QWidget* parent = nullptr); + ~ProjectsScreen() = default; + + ProjectManagerScreen GetScreenEnum() override; + QString GetTabText() override; + bool IsTab() override; + + protected: + void NotifyCurrentScreen() override; + + protected slots: + void HandleNewProjectButton(); + void HandleAddProjectButton(); + void HandleOpenProject(const QString& projectPath); + void HandleEditProject(const QString& projectPath); + void HandleEditProjectGems(const QString& projectPath); + void HandleCopyProject(const QString& projectPath); + void HandleRemoveProject(const QString& projectPath); + void HandleDeleteProject(const QString& projectPath); + + void paintEvent(QPaintEvent* event) override; + + private: + QFrame* CreateFirstTimeContent(); + QFrame* CreateProjectsContent(); + bool ShouldDisplayFirstTimeContent(); + + QAction* m_createNewProjectAction; + QAction* m_addExistingProjectAction; + QPixmap m_background; + QFrame* m_firstTimeContent; + QFrame* m_projectsContent; + QStackedWidget* m_stack; + + const QString m_projectPreviewImagePath = "/preview.png"; + + inline constexpr static int s_contentMargins = 80; + inline constexpr static int s_spacerSize = 20; + }; + +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.cpp b/Code/Tools/ProjectManager/Source/PythonBindings.cpp index a25db506f4..8db8492cae 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.cpp +++ b/Code/Tools/ProjectManager/Source/PythonBindings.cpp @@ -200,11 +200,11 @@ namespace RedirectOutput { s_RedirectModule = module; - SetRedirection("stdout", g_redirect_stdout_saved, g_redirect_stdout, [](const char* msg) { + SetRedirection("stdout", g_redirect_stdout_saved, g_redirect_stdout, []([[maybe_unused]] const char* msg) { AZ_TracePrintf("Python", msg); }); - SetRedirection("stderr", g_redirect_stderr_saved, g_redirect_stderr, [](const char* msg) { + SetRedirection("stderr", g_redirect_stderr_saved, g_redirect_stderr, []([[maybe_unused]] const char* msg) { AZ_TracePrintf("Python", msg); }); @@ -220,7 +220,7 @@ namespace RedirectOutput } } // namespace RedirectOutput -namespace O3DE::ProjectManager +namespace O3DE::ProjectManager { PythonBindings::PythonBindings(const AZ::IO::PathView& enginePath) : m_enginePath(enginePath) @@ -283,8 +283,11 @@ namespace O3DE::ProjectManager AZ_Warning("ProjectManagerWindow", result != -1, "Append to sys path failed"); // import required modules - m_registration = pybind11::module::import("cmake.Tools.registration"); - m_engineTemplate = pybind11::module::import("cmake.Tools.engine_template"); + m_register = pybind11::module::import("o3de.register"); + m_manifest = pybind11::module::import("o3de.manifest"); + m_engineTemplate = pybind11::module::import("o3de.engine_template"); + m_enableGemProject = pybind11::module::import("o3de.enable_gem"); + m_disableGemProject = pybind11::module::import("o3de.disable_gem"); return result == 0 && !PyErr_Occurred(); } catch ([[maybe_unused]] const std::exception& e) @@ -326,22 +329,102 @@ namespace O3DE::ProjectManager } } - AZ::Outcome PythonBindings::GetEngineInfo() + AZ::Outcome PythonBindings::GetEngineInfo() { + EngineInfo engineInfo; + bool result = ExecuteWithLock([&] { + pybind11::str enginePath = m_manifest.attr("get_this_engine_path")(); + + auto o3deData = m_manifest.attr("load_o3de_manifest")(); + if (pybind11::isinstance(o3deData)) + { + engineInfo.m_path = Py_To_String(enginePath); + engineInfo.m_defaultGemsFolder = Py_To_String(o3deData["default_gems_folder"]); + engineInfo.m_defaultProjectsFolder = Py_To_String(o3deData["default_projects_folder"]); + engineInfo.m_defaultRestrictedFolder = Py_To_String(o3deData["default_restricted_folder"]); + engineInfo.m_defaultTemplatesFolder = Py_To_String(o3deData["default_templates_folder"]); + engineInfo.m_thirdPartyPath = Py_To_String_Optional(o3deData,"third_party_path",""); + } + + auto engineData = m_manifest.attr("get_engine_json_data")(pybind11::none(), enginePath); + if (pybind11::isinstance(engineData)) + { + try + { + engineInfo.m_version = Py_To_String_Optional(engineData,"O3DEVersion","0.0.0.0"); + engineInfo.m_name = Py_To_String_Optional(engineData,"engine_name","O3DE"); + } + catch ([[maybe_unused]] const std::exception& e) + { + AZ_Warning("PythonBindings", false, "Failed to get EngineInfo from %s", Py_To_String(enginePath)); + } + } + }); + + if (!result || !engineInfo.IsValid()) + { + return AZ::Failure(); + } + else + { + return AZ::Success(AZStd::move(engineInfo)); + } + return AZ::Failure(); } - bool PythonBindings::SetEngineInfo([[maybe_unused]] const EngineInfo& engineInfo) + bool PythonBindings::SetEngineInfo(const EngineInfo& engineInfo) { - return false; + bool result = ExecuteWithLock([&] { + pybind11::str enginePath = engineInfo.m_path.toStdString(); + pybind11::str defaultProjectsFolder = engineInfo.m_defaultProjectsFolder.toStdString(); + pybind11::str defaultGemsFolder = engineInfo.m_defaultGemsFolder.toStdString(); + pybind11::str defaultTemplatesFolder = engineInfo.m_defaultTemplatesFolder.toStdString(); + + auto registrationResult = m_register.attr("register")( + enginePath, // engine_path + pybind11::none(), // project_path + pybind11::none(), // gem_path + pybind11::none(), // external_subdir_path + pybind11::none(), // template_path + pybind11::none(), // restricted_path + pybind11::none(), // repo_uri + pybind11::none(), // default_engines_folder + defaultProjectsFolder, + defaultGemsFolder, + defaultTemplatesFolder + ); + + if (registrationResult.cast() != 0) + { + result = false; + } + + auto manifest = m_manifest.attr("load_o3de_manifest")(); + if (pybind11::isinstance(manifest)) + { + try + { + manifest["third_party_path"] = engineInfo.m_thirdPartyPath.toStdString(); + m_manifest.attr("save_o3de_manifest")(manifest); + } + catch ([[maybe_unused]] const std::exception& e) + { + AZ_Warning("PythonBindings", false, "Failed to set third party path."); + } + } + + }); + + return result; } - AZ::Outcome PythonBindings::GetGem(const QString& path) + AZ::Outcome PythonBindings::GetGem(const QString& path) { GemInfo gemInfo = GemInfoFromPath(pybind11::str(path.toStdString())); if (gemInfo.IsValid()) { - return AZ::Success(AZStd::move(gemInfo)); + return AZ::Success(AZStd::move(gemInfo)); } else { @@ -349,19 +432,19 @@ namespace O3DE::ProjectManager } } - AZ::Outcome> PythonBindings::GetGems() + AZ::Outcome> PythonBindings::GetGems() { QVector gems; bool result = ExecuteWithLock([&] { - // external gems - for (auto path : m_registration.attr("get_gems")()) + // external gems + for (auto path : m_manifest.attr("get_gems")()) { gems.push_back(GemInfoFromPath(path)); } - // gems from the engine - for (auto path : m_registration.attr("get_engine_gems")()) + // gems from the engine + for (auto path : m_manifest.attr("get_engine_gems")()) { gems.push_back(GemInfoFromPath(path)); } @@ -373,11 +456,60 @@ namespace O3DE::ProjectManager } else { - return AZ::Success(AZStd::move(gems)); + return AZ::Success(AZStd::move(gems)); } } - AZ::Outcome PythonBindings::CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo) + bool PythonBindings::AddProject(const QString& path) + { + bool registrationResult = false; + bool result = ExecuteWithLock( + [&] + { + pybind11::str projectPath = path.toStdString(); + auto pythonRegistrationResult = m_register.attr("register")(pybind11::none(), projectPath); + + // Returns an exit code so boolify it then invert result + registrationResult = !pythonRegistrationResult.cast(); + }); + + return result && registrationResult; + } + + bool PythonBindings::RemoveProject(const QString& path) + { + bool registrationResult = false; + bool result = ExecuteWithLock( + [&] + { + pybind11::str projectPath = path.toStdString(); + auto pythonRegistrationResult = m_register.attr("register")( + pybind11::none(), // engine_path + projectPath, // project_path + pybind11::none(), // gem_path + pybind11::none(), // external_subdir_path + pybind11::none(), // template_path + pybind11::none(), // restricted_path + pybind11::none(), // repo_uri + pybind11::none(), // default_engines_folder + pybind11::none(), // default_projects_folder + pybind11::none(), // default_gems_folder + pybind11::none(), // default_templates_folder + pybind11::none(), // default_restricted_folder + pybind11::none(), // external_subdir_engine_path + pybind11::none(), // external_subdir_project_path + true, // remove + false // force + ); + + // Returns an exit code so boolify it then invert result + registrationResult = !pythonRegistrationResult.cast(); + }); + + return result && registrationResult; + } + + AZ::Outcome PythonBindings::CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo) { ProjectInfo createdProjectInfo; bool result = ExecuteWithLock([&] { @@ -397,16 +529,16 @@ namespace O3DE::ProjectManager } else { - return AZ::Success(AZStd::move(createdProjectInfo)); + return AZ::Success(AZStd::move(createdProjectInfo)); } } - AZ::Outcome PythonBindings::GetProject(const QString& path) + AZ::Outcome PythonBindings::GetProject(const QString& path) { ProjectInfo projectInfo = ProjectInfoFromPath(pybind11::str(path.toStdString())); if (projectInfo.IsValid()) { - return AZ::Success(AZStd::move(projectInfo)); + return AZ::Success(AZStd::move(projectInfo)); } else { @@ -417,29 +549,21 @@ namespace O3DE::ProjectManager GemInfo PythonBindings::GemInfoFromPath(pybind11::handle path) { GemInfo gemInfo; - gemInfo.m_path = Py_To_String(path); + gemInfo.m_path = Py_To_String(path); - auto data = m_registration.attr("get_gem_data")(pybind11::none(), path); + auto data = m_manifest.attr("get_gem_json_data")(pybind11::none(), path); if (pybind11::isinstance(data)) { try { // required - gemInfo.m_name = Py_To_String(data["Name"]); - gemInfo.m_uuid = AZ::Uuid(Py_To_String(data["Uuid"])); + gemInfo.m_name = Py_To_String(data["gem_name"]); // optional - gemInfo.m_displayName = Py_To_String_Optional(data, "DisplayName", gemInfo.m_name); - gemInfo.m_summary = Py_To_String_Optional(data, "Summary", ""); - gemInfo.m_version = Py_To_String_Optional(data, "Version", ""); + gemInfo.m_displayName = Py_To_String_Optional(data, "DisplayName", gemInfo.m_name); + gemInfo.m_summary = Py_To_String_Optional(data, "Summary", ""); + gemInfo.m_version = Py_To_String_Optional(data, "Version", ""); - if (data.contains("Dependencies")) - { - for (auto dependency : data["Dependencies"]) - { - gemInfo.m_dependingGemUuids.push_back(Py_To_String(dependency["Uuid"])); - } - } if (data.contains("Tags")) { for (auto tag : data["Tags"]) @@ -460,15 +584,16 @@ namespace O3DE::ProjectManager ProjectInfo PythonBindings::ProjectInfoFromPath(pybind11::handle path) { ProjectInfo projectInfo; - projectInfo.m_path = Py_To_String(path); + projectInfo.m_path = Py_To_String(path); + projectInfo.m_isNew = false; - auto projectData = m_registration.attr("get_project_data")(pybind11::none(), path); + auto projectData = m_manifest.attr("get_project_json_data")(pybind11::none(), path); if (pybind11::isinstance(projectData)) { try { - projectInfo.m_projectName = Py_To_String(projectData["project_name"]); - projectInfo.m_displayName = Py_To_String_Optional(projectData,"display_name", projectInfo.m_projectName); + projectInfo.m_projectName = Py_To_String(projectData["project_name"]); + projectInfo.m_displayName = Py_To_String_Optional(projectData,"display_name", projectInfo.m_projectName); } catch ([[maybe_unused]] const std::exception& e) { @@ -479,19 +604,19 @@ namespace O3DE::ProjectManager return projectInfo; } - AZ::Outcome> PythonBindings::GetProjects() + AZ::Outcome> PythonBindings::GetProjects() { QVector projects; bool result = ExecuteWithLock([&] { - // external projects - for (auto path : m_registration.attr("get_projects")()) + // external projects + for (auto path : m_manifest.attr("get_projects")()) { projects.push_back(ProjectInfoFromPath(path)); } - // projects from the engine - for (auto path : m_registration.attr("get_engine_projects")()) + // projects from the engine + for (auto path : m_manifest.attr("get_engine_projects")()) { projects.push_back(ProjectInfoFromPath(path)); } @@ -503,11 +628,45 @@ namespace O3DE::ProjectManager } else { - return AZ::Success(AZStd::move(projects)); + return AZ::Success(AZStd::move(projects)); } } - bool PythonBindings::UpdateProject([[maybe_unused]] const ProjectInfo& projectInfo) + bool PythonBindings::AddGemToProject(const QString& gemPath, const QString& projectPath) + { + bool result = ExecuteWithLock([&] { + pybind11::str pyGemPath = gemPath.toStdString(); + pybind11::str pyProjectPath = projectPath.toStdString(); + + m_enableGemProject.attr("enable_gem_in_project")( + pybind11::none(), // gem_name + pyGemPath, + pybind11::none(), // project_name + pyProjectPath + ); + }); + + return result; + } + + bool PythonBindings::RemoveGemFromProject(const QString& gemPath, const QString& projectPath) + { + bool result = ExecuteWithLock([&] { + pybind11::str pyGemPath = gemPath.toStdString(); + pybind11::str pyProjectPath = projectPath.toStdString(); + + m_disableGemProject.attr("disable_gem_in_project")( + pybind11::none(), // gem_name + pyGemPath, + pybind11::none(), // project_name + pyProjectPath + ); + }); + + return result; + } + + bool PythonBindings::UpdateProject([[maybe_unused]] const ProjectInfo& projectInfo) { return false; } @@ -515,18 +674,18 @@ namespace O3DE::ProjectManager ProjectTemplateInfo PythonBindings::ProjectTemplateInfoFromPath(pybind11::handle path) { ProjectTemplateInfo templateInfo; - templateInfo.m_path = Py_To_String(path); + templateInfo.m_path = Py_To_String(path); - auto data = m_registration.attr("get_template_data")(pybind11::none(), path); + auto data = m_manifest.attr("get_template_json_data")(pybind11::none(), path); if (pybind11::isinstance(data)) { try { // required - templateInfo.m_displayName = Py_To_String(data["display_name"]); - templateInfo.m_name = Py_To_String(data["template_name"]); - templateInfo.m_summary = Py_To_String(data["summary"]); - + templateInfo.m_displayName = Py_To_String(data["display_name"]); + templateInfo.m_name = Py_To_String(data["template_name"]); + templateInfo.m_summary = Py_To_String(data["summary"]); + // optional if (data.contains("canonical_tags")) { @@ -552,12 +711,12 @@ namespace O3DE::ProjectManager return templateInfo; } - AZ::Outcome> PythonBindings::GetProjectTemplates() + AZ::Outcome> PythonBindings::GetProjectTemplates() { QVector templates; bool result = ExecuteWithLock([&] { - for (auto path : m_registration.attr("get_project_templates")()) + for (auto path : m_manifest.attr("get_project_templates")()) { templates.push_back(ProjectTemplateInfoFromPath(path)); } @@ -569,7 +728,7 @@ namespace O3DE::ProjectManager } else { - return AZ::Success(AZStd::move(templates)); + return AZ::Success(AZStd::move(templates)); } } } diff --git a/Code/Tools/ProjectManager/Source/PythonBindings.h b/Code/Tools/ProjectManager/Source/PythonBindings.h index ffabf99b49..18122f484b 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindings.h +++ b/Code/Tools/ProjectManager/Source/PythonBindings.h @@ -12,7 +12,7 @@ #pragma once #include -#include +#include #include // Qt defines slots, which interferes with the use here. @@ -25,7 +25,7 @@ namespace O3DE::ProjectManager { - class PythonBindings + class PythonBindings : public PythonBindingsInterface::Registrar { public: @@ -46,7 +46,11 @@ namespace O3DE::ProjectManager AZ::Outcome CreateProject(const QString& projectTemplatePath, const ProjectInfo& projectInfo) override; AZ::Outcome GetProject(const QString& path) override; AZ::Outcome> GetProjects() override; + bool AddProject(const QString& path) override; + bool RemoveProject(const QString& path) override; bool UpdateProject(const ProjectInfo& projectInfo) override; + bool AddGemToProject(const QString& gemPath, const QString& projectPath) override; + bool RemoveGemFromProject(const QString& gemPath, const QString& projectPath) override; // ProjectTemplate AZ::Outcome> GetProjectTemplates() override; @@ -64,6 +68,9 @@ namespace O3DE::ProjectManager AZ::IO::FixedMaxPath m_enginePath; pybind11::handle m_engineTemplate; AZStd::recursive_mutex m_lock; - pybind11::handle m_registration; + pybind11::handle m_register; + pybind11::handle m_manifest; + pybind11::handle m_enableGemProject; + pybind11::handle m_disableGemProject; }; } diff --git a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h index 2377da1461..a58eea0fe6 100644 --- a/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h +++ b/Code/Tools/ProjectManager/Source/PythonBindingsInterface.h @@ -88,6 +88,20 @@ namespace O3DE::ProjectManager * @return an outcome with ProjectInfos on success */ virtual AZ::Outcome> GetProjects() = 0; + + /** + * Adds existing project on disk + * @param path the absolute path to the project + * @return true on success, false on failure + */ + virtual bool AddProject(const QString& path) = 0; + + /** + * Adds existing project on disk + * @param path the absolute path to the project + * @return true on success, false on failure + */ + virtual bool RemoveProject(const QString& path) = 0; /** * Update a project @@ -96,6 +110,22 @@ namespace O3DE::ProjectManager */ virtual bool UpdateProject(const ProjectInfo& projectInfo) = 0; + /** + * Add a gem to a project + * @param gemPath the absolute path to the gem + * @param projectPath the absolute path to the project + * @return true on success, false on failure + */ + virtual bool AddGemToProject(const QString& gemPath, const QString& projectPath) = 0; + + /** + * Remove gem to a project + * @param gemPath the absolute path to the gem + * @param projectPath the absolute path to the project + * @return true on success, false on failure + */ + virtual bool RemoveGemFromProject(const QString& gemPath, const QString& projectPath) = 0; + // Project Templates diff --git a/Code/Tools/ProjectManager/Source/ScreenDefs.h b/Code/Tools/ProjectManager/Source/ScreenDefs.h index 658b8d88fd..46d243f677 100644 --- a/Code/Tools/ProjectManager/Source/ScreenDefs.h +++ b/Code/Tools/ProjectManager/Source/ScreenDefs.h @@ -17,11 +17,11 @@ namespace O3DE::ProjectManager { Invalid = -1, Empty, - FirstTimeUse, - NewProjectSettingsCore, + CreateProject, NewProjectSettings, GemCatalog, - ProjectsHome, + Projects, + UpdateProject, ProjectSettings, EngineSettings }; diff --git a/Code/Tools/ProjectManager/Source/ScreenFactory.cpp b/Code/Tools/ProjectManager/Source/ScreenFactory.cpp index 1089f8ee94..b2b4376e14 100644 --- a/Code/Tools/ProjectManager/Source/ScreenFactory.cpp +++ b/Code/Tools/ProjectManager/Source/ScreenFactory.cpp @@ -11,11 +11,11 @@ */ #include -#include -#include +#include +#include #include #include -#include +#include #include #include @@ -27,11 +27,8 @@ namespace O3DE::ProjectManager switch(screen) { - case (ProjectManagerScreen::FirstTimeUse): - newScreen = new FirstTimeUseScreen(parent); - break; - case (ProjectManagerScreen::NewProjectSettingsCore): - newScreen = new ProjectSettingsCtrl(parent); + case (ProjectManagerScreen::CreateProject): + newScreen = new CreateProjectCtrl(parent); break; case (ProjectManagerScreen::NewProjectSettings): newScreen = new NewProjectSettingsScreen(parent); @@ -39,8 +36,11 @@ namespace O3DE::ProjectManager case (ProjectManagerScreen::GemCatalog): newScreen = new GemCatalogScreen(parent); break; - case (ProjectManagerScreen::ProjectsHome): - newScreen = new ProjectsHomeScreen(parent); + case (ProjectManagerScreen::Projects): + newScreen = new ProjectsScreen(parent); + break; + case (ProjectManagerScreen::UpdateProject): + newScreen = new UpdateProjectCtrl(parent); break; case (ProjectManagerScreen::ProjectSettings): newScreen = new ProjectSettingsScreen(parent); diff --git a/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.cpp b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.cpp new file mode 100644 index 0000000000..29b1eb6ff6 --- /dev/null +++ b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.cpp @@ -0,0 +1,62 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include + +namespace O3DE::ProjectManager +{ + ScreenHeader::ScreenHeader(QWidget* parent) + : QFrame(parent) + { + setObjectName("header"); + + QHBoxLayout* layout = new QHBoxLayout(); + layout->setAlignment(Qt::AlignLeft); + layout->setContentsMargins(0,0,0,0); + + m_backButton = new QPushButton(); + m_backButton->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + layout->addWidget(m_backButton); + + QVBoxLayout* titleLayout = new QVBoxLayout(); + m_title = new QLabel(); + m_title->setObjectName("headerTitle"); + titleLayout->addWidget(m_title); + + m_subTitle = new QLabel(); + m_subTitle->setObjectName("headerSubTitle"); + titleLayout->addWidget(m_subTitle); + + layout->addLayout(titleLayout); + + setLayout(layout); + } + + void ScreenHeader::setTitle(const QString& text) + { + m_title->setText(text); + } + + void ScreenHeader::setSubTitle(const QString& text) + { + m_subTitle->setText(text); + } + + QPushButton* ScreenHeader::backButton() + { + return m_backButton; + } + +} // namespace O3DE::ProjectManager diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.h b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h similarity index 52% rename from Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.h rename to Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h index c1058dc8a0..c5fdb56195 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.h +++ b/Code/Tools/ProjectManager/Source/ScreenHeaderWidget.h @@ -12,25 +12,31 @@ #pragma once -#include +#if !defined(Q_MOC_RUN) +#include +#endif -#include -#include -#include -#include +QT_FORWARD_DECLARE_CLASS(QLabel) +QT_FORWARD_DECLARE_CLASS(QPushButton) -#include - - -namespace Multiplayer +namespace O3DE::ProjectManager { - //! MultiplayerEditorDispatcher is responsible for dispatching delta from the Editor to an Editor launched local server - class MultiplayerEditorDispatcher final + class ScreenHeader + : public QFrame { + Q_OBJECT // AUTOMOC + public: - MultiplayerEditorDispatcher(); - ~MultiplayerEditorDispatcher() = default; + ScreenHeader(QWidget* parent = nullptr); + + void setTitle(const QString& text); + void setSubTitle(const QString& text); + + QPushButton* backButton(); private: + QLabel* m_title; + QLabel* m_subTitle; + QPushButton* m_backButton; }; -} +} // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ScreenWidget.h b/Code/Tools/ProjectManager/Source/ScreenWidget.h index ae235daf2b..2ad6d30201 100644 --- a/Code/Tools/ProjectManager/Source/ScreenWidget.h +++ b/Code/Tools/ProjectManager/Source/ScreenWidget.h @@ -15,18 +15,20 @@ #include #include +#include +#include #endif namespace O3DE::ProjectManager { class ScreenWidget - : public QWidget + : public QFrame { Q_OBJECT public: explicit ScreenWidget(QWidget* parent = nullptr) - : QWidget(parent) + : QFrame(parent) { } ~ScreenWidget() = default; @@ -39,15 +41,27 @@ namespace O3DE::ProjectManager { return true; } - virtual QString GetNextButtonText() + virtual bool IsTab() { - return "Next"; + return false; + } + virtual QString GetTabText() + { + return tr("Missing"); + } + + //! Notify this screen it is the current screen + virtual void NotifyCurrentScreen() + { + } signals: void ChangeScreenRequest(ProjectManagerScreen screen); void GotoPreviousScreenRequest(); void ResetScreenRequest(ProjectManagerScreen screen); + void NotifyCurrentProject(const QString& projectPath); + }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ScreensCtrl.cpp b/Code/Tools/ProjectManager/Source/ScreensCtrl.cpp index 69af09f496..7d31d02f6c 100644 --- a/Code/Tools/ProjectManager/Source/ScreensCtrl.cpp +++ b/Code/Tools/ProjectManager/Source/ScreensCtrl.cpp @@ -14,6 +14,7 @@ #include #include +#include #include namespace O3DE::ProjectManager @@ -21,14 +22,19 @@ namespace O3DE::ProjectManager ScreensCtrl::ScreensCtrl(QWidget* parent) : QWidget(parent) { + setObjectName("ScreensCtrl"); + QVBoxLayout* vLayout = new QVBoxLayout(); + vLayout->setContentsMargins(0, 0, 0, 0); setLayout(vLayout); m_screenStack = new QStackedWidget(); vLayout->addWidget(m_screenStack); - //Track the bottom of the stack - m_screenVisitOrder.push(ProjectManagerScreen::Invalid); + // add a tab widget at the bottom of the stack + m_tabWidget = new QTabWidget(); + m_screenStack->addWidget(m_tabWidget); + connect(m_tabWidget, &QTabWidget::currentChanged, this, &ScreensCtrl::TabChanged); } void ScreensCtrl::BuildScreens(QVector screens) @@ -54,7 +60,14 @@ namespace O3DE::ProjectManager ScreenWidget* ScreensCtrl::GetCurrentScreen() { - return reinterpret_cast(m_screenStack->currentWidget()); + if (m_screenStack->currentWidget() == m_tabWidget) + { + return reinterpret_cast(m_tabWidget->currentWidget()); + } + else + { + return reinterpret_cast(m_screenStack->currentWidget()); + } } bool ScreensCtrl::ChangeToScreen(ProjectManagerScreen screen) @@ -76,13 +89,28 @@ namespace O3DE::ProjectManager if (iterator != m_screenMap.end()) { ScreenWidget* currentScreen = GetCurrentScreen(); - if (currentScreen != iterator.value()) + ScreenWidget* newScreen = iterator.value(); + + if (currentScreen != newScreen) { if (addVisit) { - m_screenVisitOrder.push(currentScreen->GetScreenEnum()); + ProjectManagerScreen oldScreen = currentScreen->GetScreenEnum(); + m_screenVisitOrder.push(oldScreen); } - m_screenStack->setCurrentWidget(iterator.value()); + + if (newScreen->IsTab()) + { + m_tabWidget->setCurrentWidget(newScreen); + m_screenStack->setCurrentWidget(m_tabWidget); + } + else + { + m_screenStack->setCurrentWidget(newScreen); + } + + newScreen->NotifyCurrentScreen(); + return true; } } @@ -92,28 +120,52 @@ namespace O3DE::ProjectManager bool ScreensCtrl::GotoPreviousScreen() { - // Don't go back if we are on the first set screen - if (m_screenVisitOrder.top() != ProjectManagerScreen::Invalid) + if (!m_screenVisitOrder.isEmpty()) { // We do not check with screen if we can go back, we should always be able to go back - return ForceChangeToScreen(m_screenVisitOrder.pop(), false); + ProjectManagerScreen previousScreen = m_screenVisitOrder.pop(); + return ForceChangeToScreen(previousScreen, false); } return false; } void ScreensCtrl::ResetScreen(ProjectManagerScreen screen) { + bool shouldRestoreCurrentScreen = false; + if (GetCurrentScreen() && GetCurrentScreen()->GetScreenEnum() == screen) + { + shouldRestoreCurrentScreen = true; + } + // Delete old screen if it exists to start fresh DeleteScreen(screen); // Add new screen ScreenWidget* newScreen = BuildScreen(this, screen); - m_screenStack->addWidget(newScreen); + if (newScreen->IsTab()) + { + m_tabWidget->addTab(newScreen, newScreen->GetTabText()); + if (shouldRestoreCurrentScreen) + { + m_tabWidget->setCurrentWidget(newScreen); + m_screenStack->setCurrentWidget(m_tabWidget); + } + } + else + { + m_screenStack->addWidget(newScreen); + if (shouldRestoreCurrentScreen) + { + m_screenStack->setCurrentWidget(newScreen); + } + } + m_screenMap.insert(screen, newScreen); connect(newScreen, &ScreenWidget::ChangeScreenRequest, this, &ScreensCtrl::ChangeToScreen); connect(newScreen, &ScreenWidget::GotoPreviousScreenRequest, this, &ScreensCtrl::GotoPreviousScreen); connect(newScreen, &ScreenWidget::ResetScreenRequest, this, &ScreensCtrl::ResetScreen); + connect(newScreen, &ScreenWidget::NotifyCurrentProject, this, &ScreensCtrl::NotifyCurrentProject); } void ScreensCtrl::ResetAllScreens() @@ -130,8 +182,21 @@ namespace O3DE::ProjectManager const auto iter = m_screenMap.find(screen); if (iter != m_screenMap.end()) { - m_screenStack->removeWidget(iter.value()); - iter.value()->deleteLater(); + ScreenWidget* screenToDelete = iter.value(); + if (screenToDelete->IsTab()) + { + int tabIndex = m_tabWidget->indexOf(screenToDelete); + if (tabIndex > -1) + { + m_tabWidget->removeTab(tabIndex); + } + } + else + { + // if the screen we delete is the current widget, a new one will + // be selected automatically (randomly?) + m_screenStack->removeWidget(screenToDelete); + } // Erase does not cause a rehash so interators remain valid m_screenMap.erase(iter); @@ -146,4 +211,12 @@ namespace O3DE::ProjectManager } } + void ScreensCtrl::TabChanged([[maybe_unused]] int index) + { + ScreenWidget* screen = reinterpret_cast(m_tabWidget->currentWidget()); + if (screen) + { + screen->NotifyCurrentScreen(); + } + } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ScreensCtrl.h b/Code/Tools/ProjectManager/Source/ScreensCtrl.h index 7912a314e3..935fc78e25 100644 --- a/Code/Tools/ProjectManager/Source/ScreensCtrl.h +++ b/Code/Tools/ProjectManager/Source/ScreensCtrl.h @@ -18,6 +18,8 @@ #include #endif +QT_FORWARD_DECLARE_CLASS(QTabWidget) + namespace O3DE::ProjectManager { class ScreenWidget; @@ -35,6 +37,9 @@ namespace O3DE::ProjectManager ScreenWidget* FindScreen(ProjectManagerScreen screen); ScreenWidget* GetCurrentScreen(); + signals: + void NotifyCurrentProject(const QString& projectPath); + public slots: bool ChangeToScreen(ProjectManagerScreen screen); bool ForceChangeToScreen(ProjectManagerScreen screen, bool addVisit = true); @@ -43,11 +48,13 @@ namespace O3DE::ProjectManager void ResetAllScreens(); void DeleteScreen(ProjectManagerScreen screen); void DeleteAllScreens(); + void TabChanged(int index); private: QStackedWidget* m_screenStack; QHash m_screenMap; QStack m_screenVisitOrder; + QTabWidget* m_tabWidget; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/TagWidget.cpp b/Code/Tools/ProjectManager/Source/TagWidget.cpp index 3e80944204..628b682b95 100644 --- a/Code/Tools/ProjectManager/Source/TagWidget.cpp +++ b/Code/Tools/ProjectManager/Source/TagWidget.cpp @@ -18,9 +18,9 @@ namespace O3DE::ProjectManager TagWidget::TagWidget(const QString& text, QWidget* parent) : QLabel(text, parent) { - setFixedHeight(35); + setFixedHeight(24); setMargin(5); - setStyleSheet("font-size: 12pt; background-color: #333333; border-radius: 4px;"); + setStyleSheet("font-size: 12px; background-color: #333333; border-radius: 3px;"); } TagContainerWidget::TagContainerWidget(QWidget* parent) @@ -35,7 +35,7 @@ namespace O3DE::ProjectManager void TagContainerWidget::Update(const QStringList& tags) { QWidget* parentWidget = qobject_cast(parent()); - int width = 250; + int width = 200; if (parentWidget) { width = parentWidget->width(); diff --git a/Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.cpp b/Code/Tools/ProjectManager/Source/UpdateProjectCtrl.cpp similarity index 55% rename from Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.cpp rename to Code/Tools/ProjectManager/Source/UpdateProjectCtrl.cpp index fd1013c871..b3180966ce 100644 --- a/Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.cpp +++ b/Code/Tools/ProjectManager/Source/UpdateProjectCtrl.cpp @@ -10,10 +10,10 @@ * */ -#include +#include #include #include -#include +#include #include #include @@ -22,7 +22,7 @@ namespace O3DE::ProjectManager { - ProjectSettingsCtrl::ProjectSettingsCtrl(QWidget* parent) + UpdateProjectCtrl::UpdateProjectCtrl(QWidget* parent) : ScreenWidget(parent) { QVBoxLayout* vLayout = new QVBoxLayout(); @@ -34,28 +34,31 @@ namespace O3DE::ProjectManager QDialogButtonBox* backNextButtons = new QDialogButtonBox(); vLayout->addWidget(backNextButtons); - m_backButton = backNextButtons->addButton("Back", QDialogButtonBox::RejectRole); - m_nextButton = backNextButtons->addButton("Next", QDialogButtonBox::ApplyRole); + m_backButton = backNextButtons->addButton(tr("Back"), QDialogButtonBox::RejectRole); + m_nextButton = backNextButtons->addButton(tr("Next"), QDialogButtonBox::ApplyRole); - connect(m_backButton, &QPushButton::pressed, this, &ProjectSettingsCtrl::HandleBackButton); - connect(m_nextButton, &QPushButton::pressed, this, &ProjectSettingsCtrl::HandleNextButton); + connect(m_backButton, &QPushButton::pressed, this, &UpdateProjectCtrl::HandleBackButton); + connect(m_nextButton, &QPushButton::pressed, this, &UpdateProjectCtrl::HandleNextButton); + connect(reinterpret_cast(parent), &ScreensCtrl::NotifyCurrentProject, this, &UpdateProjectCtrl::UpdateCurrentProject); m_screensOrder = { - ProjectManagerScreen::NewProjectSettings, + ProjectManagerScreen::ProjectSettings, ProjectManagerScreen::GemCatalog }; m_screensCtrl->BuildScreens(m_screensOrder); - m_screensCtrl->ForceChangeToScreen(ProjectManagerScreen::NewProjectSettings, false); + m_screensCtrl->ForceChangeToScreen(ProjectManagerScreen::ProjectSettings, false); + UpdateNextButtonText(); + } - ProjectManagerScreen ProjectSettingsCtrl::GetScreenEnum() + ProjectManagerScreen UpdateProjectCtrl::GetScreenEnum() { - return ProjectManagerScreen::NewProjectSettingsCore; + return ProjectManagerScreen::UpdateProject; } - void ProjectSettingsCtrl::HandleBackButton() + void UpdateProjectCtrl::HandleBackButton() { if (!m_screensCtrl->GotoPreviousScreen()) { @@ -66,7 +69,7 @@ namespace O3DE::ProjectManager UpdateNextButtonText(); } } - void ProjectSettingsCtrl::HandleNextButton() + void UpdateProjectCtrl::HandleNextButton() { ScreenWidget* currentScreen = m_screensCtrl->GetCurrentScreen(); ProjectManagerScreen screenEnum = currentScreen->GetScreenEnum(); @@ -80,19 +83,18 @@ namespace O3DE::ProjectManager } } - if (screenEnum == ProjectManagerScreen::NewProjectSettings) + if (screenEnum == ProjectManagerScreen::ProjectSettings) { - auto newProjectScreen = reinterpret_cast(currentScreen); - if (newProjectScreen) + auto projectScreen = reinterpret_cast(currentScreen); + if (projectScreen) { - if (!newProjectScreen->Validate()) + if (!projectScreen->Validate()) { QMessageBox::critical(this, tr("Invalid project settings"), tr("Invalid project settings")); return; } - m_projectInfo = newProjectScreen->GetProjectInfo(); - m_projectTemplatePath = newProjectScreen->GetProjectTemplatePath(); + m_projectInfo = projectScreen->GetProjectInfo(); } } @@ -103,21 +105,35 @@ namespace O3DE::ProjectManager } else { - auto result = PythonBindingsInterface::Get()->CreateProject(m_projectTemplatePath, m_projectInfo); - if (result.IsSuccess()) + auto result = PythonBindingsInterface::Get()->UpdateProject(m_projectInfo); + if (result) { - emit ChangeScreenRequest(ProjectManagerScreen::ProjectsHome); + emit ChangeScreenRequest(ProjectManagerScreen::Projects); } else { - QMessageBox::critical(this, tr("Project creation failed"), tr("Failed to create project.")); + QMessageBox::critical(this, tr("Project update failed"), tr("Failed to update project.")); } } } - void ProjectSettingsCtrl::UpdateNextButtonText() + void UpdateProjectCtrl::UpdateCurrentProject(const QString& projectPath) { - m_nextButton->setText(m_screensCtrl->GetCurrentScreen()->GetNextButtonText()); + auto projectResult = PythonBindingsInterface::Get()->GetProject(projectPath); + if (projectResult.IsSuccess()) + { + m_projectInfo = projectResult.GetValue(); + } + } + + void UpdateProjectCtrl::UpdateNextButtonText() + { + QString nextButtonText = tr("Continue"); + if (m_screensCtrl->GetCurrentScreen()->GetScreenEnum() == ProjectManagerScreen::GemCatalog) + { + nextButtonText = tr("Update Project"); + } + m_nextButton->setText(nextButtonText); } } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.h b/Code/Tools/ProjectManager/Source/UpdateProjectCtrl.h similarity index 83% rename from Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.h rename to Code/Tools/ProjectManager/Source/UpdateProjectCtrl.h index 42f1ce1978..ee871e7bb2 100644 --- a/Code/Tools/ProjectManager/Source/ProjectSettingsCtrl.h +++ b/Code/Tools/ProjectManager/Source/UpdateProjectCtrl.h @@ -21,17 +21,19 @@ namespace O3DE::ProjectManager { - class ProjectSettingsCtrl + class UpdateProjectCtrl : public ScreenWidget { public: - explicit ProjectSettingsCtrl(QWidget* parent = nullptr); - ~ProjectSettingsCtrl() = default; + explicit UpdateProjectCtrl(QWidget* parent = nullptr); + ~UpdateProjectCtrl() = default; ProjectManagerScreen GetScreenEnum() override; + protected slots: void HandleBackButton(); void HandleNextButton(); + void UpdateCurrentProject(const QString& projectPath); private: void UpdateNextButtonText(); @@ -41,8 +43,9 @@ namespace O3DE::ProjectManager QPushButton* m_nextButton; QVector m_screensOrder; - QString m_projectTemplatePath; ProjectInfo m_projectInfo; + + ProjectManagerScreen m_screenEnum; }; } // namespace O3DE::ProjectManager diff --git a/Code/Tools/ProjectManager/Source/main.cpp b/Code/Tools/ProjectManager/Source/main.cpp index 3d8bb71a0c..cbeacbaf65 100644 --- a/Code/Tools/ProjectManager/Source/main.cpp +++ b/Code/Tools/ProjectManager/Source/main.cpp @@ -35,7 +35,6 @@ int main(int argc, char* argv[]) QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); AzQtComponents::Utilities::HandleDpiAwareness(AzQtComponents::Utilities::SystemDpiAware); - AZ::AllocatorInstance::Create(); int runSuccess = 0; { @@ -55,6 +54,12 @@ int main(int argc, char* argv[]) O3DE::ProjectManager::ProjectManagerWindow window(nullptr, engineRootPath); window.show(); + // somethings is preventing us from moving the window to the center of the + // primary screen - likely an Az style or component helper + constexpr int width = 1200; + constexpr int height = 800; + window.resize(width, height); + runSuccess = app.exec(); } AZ::AllocatorInstance::Destroy(); diff --git a/Code/Tools/ProjectManager/project_manager.qrc b/Code/Tools/ProjectManager/project_manager.qrc deleted file mode 100644 index 6509a9f940..0000000000 --- a/Code/Tools/ProjectManager/project_manager.qrc +++ /dev/null @@ -1,13 +0,0 @@ - - - Resources/ProjectManager.qss - Resources/Add.svg - Resources/Select_Folder.svg - Resources/o3de_editor.ico - Resources/Windows.svg - Resources/Android.svg - Resources/iOS.svg - Resources/Linux.svg - Resources/macOS.svg - - diff --git a/Code/Tools/ProjectManager/project_manager_files.cmake b/Code/Tools/ProjectManager/project_manager_files.cmake index 9ffdb6029d..feaea4c172 100644 --- a/Code/Tools/ProjectManager/project_manager_files.cmake +++ b/Code/Tools/ProjectManager/project_manager_files.cmake @@ -10,7 +10,8 @@ # set(FILES - project_manager.qrc + Resources/ProjectManager.qrc + Resources/ProjectManager.qss Source/main.cpp Source/ScreenDefs.h Source/ScreenFactory.h @@ -20,38 +21,50 @@ set(FILES Source/ScreenWidget.h Source/EngineInfo.h Source/EngineInfo.cpp - Source/FirstTimeUseScreen.h - Source/FirstTimeUseScreen.cpp - Source/FirstTimeUseScreen.ui + Source/FormLineEditWidget.h + Source/FormLineEditWidget.cpp + Source/FormBrowseEditWidget.h + Source/FormBrowseEditWidget.cpp + Source/PathValidator.h + Source/PathValidator.cpp Source/ProjectManagerWindow.h Source/ProjectManagerWindow.cpp Source/ProjectTemplateInfo.h Source/ProjectTemplateInfo.cpp - Source/ProjectManagerWindow.ui Source/PythonBindings.h Source/PythonBindings.cpp Source/PythonBindingsInterface.h Source/ProjectInfo.h Source/ProjectInfo.cpp + Source/ProjectUtils.h + Source/ProjectUtils.cpp Source/NewProjectSettingsScreen.h Source/NewProjectSettingsScreen.cpp - Source/ProjectSettingsCtrl.h - Source/ProjectSettingsCtrl.cpp - Source/ProjectsHomeScreen.h - Source/ProjectsHomeScreen.cpp - Source/ProjectsHomeScreen.ui + Source/CreateProjectCtrl.h + Source/CreateProjectCtrl.cpp + Source/UpdateProjectCtrl.h + Source/UpdateProjectCtrl.cpp + Source/ProjectsScreen.h + Source/ProjectsScreen.cpp Source/ProjectSettingsScreen.h Source/ProjectSettingsScreen.cpp Source/ProjectSettingsScreen.ui Source/EngineSettingsScreen.h Source/EngineSettingsScreen.cpp - Source/EngineSettingsScreen.ui + Source/ProjectButtonWidget.h + Source/ProjectButtonWidget.cpp + Source/ScreenHeaderWidget.h + Source/ScreenHeaderWidget.cpp Source/LinkWidget.h Source/LinkWidget.cpp Source/TagWidget.h Source/TagWidget.cpp + Source/GemCatalog/GemCatalogHeaderWidget.h + Source/GemCatalog/GemCatalogHeaderWidget.cpp Source/GemCatalog/GemCatalogScreen.h Source/GemCatalog/GemCatalogScreen.cpp + Source/GemCatalog/GemFilterWidget.h + Source/GemCatalog/GemFilterWidget.cpp Source/GemCatalog/GemInfo.h Source/GemCatalog/GemInfo.cpp Source/GemCatalog/GemInspector.h @@ -60,6 +73,10 @@ set(FILES Source/GemCatalog/GemItemDelegate.cpp Source/GemCatalog/GemListView.h Source/GemCatalog/GemListView.cpp + Source/GemCatalog/GemListHeaderWidget.h + Source/GemCatalog/GemListHeaderWidget.cpp Source/GemCatalog/GemModel.h Source/GemCatalog/GemModel.cpp + Source/GemCatalog/GemSortFilterProxyModel.h + Source/GemCatalog/GemSortFilterProxyModel.cpp ) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp index 3dc14814de..4ab41423fa 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/DllMain.cpp @@ -38,21 +38,8 @@ namespace AZ { namespace FbxSceneBuilder { - static AZ::SceneAPI::FbxSceneImporter::FbxImportRequestHandler* g_fbxImporter = nullptr; static AZStd::vector g_componentDescriptors; - void Initialize() - { - // Currently it's still needed to explicitly create an instance of this instead of letting - // it be a normal component. This is because ResourceCompilerScene needs to return - // the list of available extensions before it can start the application. - if (!g_fbxImporter) - { - g_fbxImporter = aznew AZ::SceneAPI::FbxSceneImporter::FbxImportRequestHandler(); - g_fbxImporter->Activate(); - } - } - void Reflect(AZ::SerializeContext* /*context*/) { // Descriptor registration is done in Reflect instead of Initialize because the ResourceCompilerScene initializes the libraries before @@ -64,6 +51,7 @@ namespace AZ { // Global importer and behavior g_componentDescriptors.push_back(FbxSceneBuilder::FbxImporter::CreateDescriptor()); + g_componentDescriptors.push_back(FbxSceneImporter::FbxImportRequestHandler::CreateDescriptor()); // Node and attribute importers g_componentDescriptors.push_back(AssImpBitangentStreamImporter::CreateDescriptor()); @@ -110,13 +98,6 @@ namespace AZ g_componentDescriptors.clear(); g_componentDescriptors.shrink_to_fit(); } - - if (g_fbxImporter) - { - g_fbxImporter->Deactivate(); - delete g_fbxImporter; - g_fbxImporter = nullptr; - } } } // namespace FbxSceneBuilder } // namespace SceneAPI @@ -125,7 +106,6 @@ namespace AZ extern "C" AZ_DLL_EXPORT void InitializeDynamicModule(void* env) { AZ::Environment::Attach(static_cast(env)); - AZ::SceneAPI::FbxSceneBuilder::Initialize(); } extern "C" AZ_DLL_EXPORT void Reflect(AZ::SerializeContext* context) { diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp index 155209f1b5..a8b059304d 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.cpp @@ -10,12 +10,16 @@ * */ +#include +#include #include -#include +#include +#include +#include +#include #include #include #include -#include namespace AZ { @@ -23,10 +27,23 @@ namespace AZ { namespace FbxSceneImporter { - const char* FbxImportRequestHandler::s_extension = ".fbx"; + void SceneImporterSettings::Reflect(AZ::ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context); serializeContext) + { + serializeContext->Class() + ->Version(2) + ->Field("SupportedFileTypeExtensions", &SceneImporterSettings::m_supportedFileTypeExtensions); + } + } void FbxImportRequestHandler::Activate() { + if (auto* settingsRegistry = AZ::SettingsRegistry::Get()) + { + settingsRegistry->GetObject(m_settings, "/O3DE/SceneAPI/AssetImporter"); + } + BusConnect(); } @@ -37,21 +54,31 @@ namespace AZ void FbxImportRequestHandler::Reflect(ReflectContext* context) { + SceneImporterSettings::Reflect(context); + SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1); + serializeContext->Class()->Version(1)->Attribute( + AZ::Edit::Attributes::SystemComponentTags, + AZStd::vector( + {AssetBuilderSDK::ComponentTags::AssetBuilder, + AssetImportRequest::GetAssetImportRequestComponentTag()})); + } } void FbxImportRequestHandler::GetSupportedFileExtensions(AZStd::unordered_set& extensions) { - extensions.insert(s_extension); + extensions.insert(m_settings.m_supportedFileTypeExtensions.begin(), m_settings.m_supportedFileTypeExtensions.end()); } Events::LoadingResult FbxImportRequestHandler::LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, [[maybe_unused]] RequestingApplication requester) { - if (!AzFramework::StringFunc::Path::IsExtension(path.c_str(), s_extension)) + AZStd::string extension; + StringFunc::Path::GetExtension(path.c_str(), extension); + + if (!m_settings.m_supportedFileTypeExtensions.contains(extension)) { return Events::LoadingResult::Ignored; } @@ -73,6 +100,11 @@ namespace AZ return Events::LoadingResult::AssetFailure; } } + + void FbxImportRequestHandler::GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided) + { + provided.emplace_back(AZ_CRC_CE("AssetImportRequestHandler")); + } } // namespace Import } // namespace SceneAPI } // namespace AZ diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h index 8b33051f1e..12c7c6f877 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/FbxImportRequestHandler.h @@ -21,12 +21,21 @@ namespace AZ { namespace FbxSceneImporter { + struct SceneImporterSettings + { + AZ_TYPE_INFO(SceneImporterSettings, "{8BB6C7AD-BF99-44DC-9DA1-E7AD3F03DC10}"); + + static void Reflect(AZ::ReflectContext* context); + + AZStd::unordered_set m_supportedFileTypeExtensions; + }; + class FbxImportRequestHandler - : public SceneCore::BehaviorComponent + : public AZ::Component , public Events::AssetImportRequestBus::Handler { public: - AZ_COMPONENT(FbxImportRequestHandler, "{9F4B189C-0A96-4F44-A5F0-E087FF1561F8}", SceneCore::BehaviorComponent); + AZ_COMPONENT(FbxImportRequestHandler, "{9F4B189C-0A96-4F44-A5F0-E087FF1561F8}"); ~FbxImportRequestHandler() override = default; @@ -38,8 +47,13 @@ namespace AZ Events::LoadingResult LoadAsset(Containers::Scene& scene, const AZStd::string& path, const Uuid& guid, RequestingApplication requester) override; + static void GetProvidedServices(ComponentDescriptor::DependencyArrayType& provided); + private: - static const char* s_extension; + + SceneImporterSettings m_settings; + + static constexpr const char* SettingsFilename = "AssetImporterSettings.json"; }; } // namespace FbxSceneImporter } // namespace SceneAPI diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp index 0ee25195bc..d72cdde8e7 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpAnimationImporter.cpp @@ -151,7 +151,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(3); // [LYN-3349] Rolling back rotation change + serializeContext->Class()->Version(4); // [LYN-3971] Bone pruning crash fix in AssImp SDK } } @@ -260,7 +260,7 @@ namespace AZ { AZ_TraceContext("Importer", "Animation"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); // Add check for animation layers at the scene level. @@ -387,11 +387,10 @@ namespace AZ } Events::ProcessingResultCombiner combinedAnimationResult; - for (AZ::u32 meshIndex = 0; meshIndex < currentNode->mNumMeshes; ++meshIndex) + if (context.m_sourceNode.ContainsMesh()) { - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[meshIndex]]; - - if (NodeToChannelToMorphAnim::iterator channelsForMeshName = meshMorphAnimations.find(mesh->mName.C_Str()); + const aiMesh* firstMesh = scene->mMeshes[currentNode->mMeshes[0]]; + if (NodeToChannelToMorphAnim::iterator channelsForMeshName = meshMorphAnimations.find(firstMesh->mName.C_Str()); channelsForMeshName != meshMorphAnimations.end()) { const auto [nodeIterName, channels] = *channelsForMeshName; @@ -399,7 +398,7 @@ namespace AZ { const auto& [animation, morphAnimation] = animAndMorphAnim; combinedAnimationResult += ImportBlendShapeAnimation( - context, animation, morphAnimation, mesh); + context, animation, morphAnimation, firstMesh); } } } @@ -413,32 +412,39 @@ namespace AZ if (boneAnimations.empty() && !meshMorphAnimations.empty()) { const aiAnimation* animation = scene->mAnimations[0]; - - // Morph animations need a regular animation on the node, as well. - // If there is no bone animation on the current node, then generate one here. - AZStd::shared_ptr createdAnimationData = - AZStd::make_shared(); - - const size_t numKeyframes = animation->mDuration + 1; // +1 because we start at 0 and the last keyframe is at mDuration instead of mDuration-1 - createdAnimationData->ReserveKeyFrames(numKeyframes); - - const double timeStepBetweenFrames = 1.0 / animation->mTicksPerSecond; - createdAnimationData->SetTimeStepBetweenFrames(timeStepBetweenFrames); - - // Set every frame of the animation to the start location of the node. - aiMatrix4x4 combinedTransform = GetConcatenatedLocalTransform(currentNode); - DataTypes::MatrixType localTransform = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(combinedTransform); - context.m_sourceSceneSystem.SwapTransformForUpAxis(localTransform); - context.m_sourceSceneSystem.ConvertUnit(localTransform); - for (AZ::u32 time = 0; time <= animation->mDuration; ++time) + for (AZ::u32 channelIndex = 0; channelIndex < animation->mNumMorphMeshChannels; ++channelIndex) { - createdAnimationData->AddKeyFrame(localTransform); + const aiMeshMorphAnim* nodeAnim = animation->mMorphMeshChannels[channelIndex]; + // Morph animations need a regular animation on the node, as well. + // If there is no bone animation on the current node, then generate one here. + AZStd::shared_ptr createdAnimationData = + AZStd::make_shared(); + + const size_t numKeyframes = GetNumKeyFrames( + nodeAnim->mNumKeys, + animation->mDuration, + animation->mTicksPerSecond); + createdAnimationData->ReserveKeyFrames(numKeyframes); + + const double timeStepBetweenFrames = 1.0 / animation->mTicksPerSecond; + createdAnimationData->SetTimeStepBetweenFrames(timeStepBetweenFrames); + + // Set every frame of the animation to the start location of the node. + aiMatrix4x4 combinedTransform = GetConcatenatedLocalTransform(currentNode); + DataTypes::MatrixType localTransform = AssImpSDKWrapper::AssImpTypeConverter::ToTransform(combinedTransform); + context.m_sourceSceneSystem.SwapTransformForUpAxis(localTransform); + context.m_sourceSceneSystem.ConvertUnit(localTransform); + for (AZ::u32 time = 0; time <= numKeyframes; ++time) + { + createdAnimationData->AddKeyFrame(localTransform); + } + + const AZStd::string stubBoneAnimForMorphName(AZStd::string::format("%s%s", nodeName.c_str(), nodeAnim->mName.C_Str())); + Containers::SceneGraph::NodeIndex addNode = context.m_scene.GetGraph().AddChild( + context.m_currentGraphPosition, stubBoneAnimForMorphName.c_str(), AZStd::move(createdAnimationData)); + context.m_scene.GetGraph().MakeEndPoint(addNode); } - - Containers::SceneGraph::NodeIndex addNode = context.m_scene.GetGraph().AddChild( - context.m_currentGraphPosition, nodeName.c_str(), AZStd::move(createdAnimationData)); - context.m_scene.GetGraph().MakeEndPoint(addNode); - + return combinedAnimationResult.GetResult(); } decltype(boneAnimations) parentFillerAnimations; @@ -446,8 +452,8 @@ namespace AZ // Go through all the animations and make sure we create animations for bones who's parents don't have an animation for (auto&& anim : boneAnimations) { - aiNode* node = scene->mRootNode->FindNode(anim.first.c_str()); - aiNode* parent = node->mParent; + const aiNode* node = scene->mRootNode->FindNode(anim.first.c_str()); + const aiNode* parent = node->mParent; while (parent && parent != scene->mRootNode) { @@ -598,7 +604,8 @@ namespace AZ // Keyframes generated for every single frame of the animation. typedef AZStd::map> ValueToKeyDataMap; ValueToKeyDataMap valueToKeyDataMap; - + // Key time can be less than zero, normalize to have zero be the lowest time. + double keyOffset = 0; for (int keyIdx = 0; keyIdx < meshMorphAnim->mNumKeys; keyIdx++) { aiMeshMorphKey& key = meshMorphAnim->mKeys[keyIdx]; @@ -609,6 +616,10 @@ namespace AZ valueToKeyDataMap[currentValue].insert( AZStd::upper_bound(valueToKeyDataMap[currentValue].begin(), valueToKeyDataMap[currentValue].end(),thisKey), thisKey); + if (key.mTime < keyOffset) + { + keyOffset = key.mTime; + } } } @@ -631,7 +642,7 @@ namespace AZ const double time = GetTimeForFrame(frame, animation->mTicksPerSecond); float weight = 0; - if (!SampleKeyFrame(weight, keys, keys.size(), time, keyIdx)) + if (!SampleKeyFrame(weight, keys, keys.size(), time + keyOffset, keyIdx)) { return Events::ProcessingResult::Failure; } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp index c2b1f20035..0b366d96ea 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBitangentStreamImporter.cpp @@ -25,7 +25,6 @@ #include #include - namespace AZ { namespace SceneAPI @@ -44,7 +43,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(2); // LYN-2576 + serializeContext->Class()->Version(3); // LYN-3250 } } @@ -55,62 +54,79 @@ namespace AZ { return Events::ProcessingResult::Ignored; } - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); - GetMeshDataFromParentResult meshDataResult(GetMeshDataFromParent(context)); - if (!meshDataResult.IsSuccess()) + const auto meshHasTangentsAndBitangents = [&scene](const unsigned int meshIndex) { - return meshDataResult.GetError(); - } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); + return scene->mMeshes[meshIndex]->HasTangentsAndBitangents(); + }; - size_t vertexCount = parentMeshData->GetVertexCount(); - - int sdkMeshIndex = parentMeshData->GetSdkMeshIndex(); - if (sdkMeshIndex < 0 || sdkMeshIndex >= currentNode->mNumMeshes) - { - AZ_Error(Utilities::ErrorWindow, false, - "Tried to construct bitangent stream attribute for invalid or non-mesh parent data, mesh index is invalid"); - return Events::ProcessingResult::Failure; - } - - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; - - if (!mesh->HasTangentsAndBitangents()) + // If there are no bitangents on any meshes, there's nothing to import in this function. + const bool anyMeshHasTangentsAndBitangents = AZStd::any_of(currentNode->mMeshes, currentNode->mMeshes + currentNode->mNumMeshes, meshHasTangentsAndBitangents); + if (!anyMeshHasTangentsAndBitangents) { return Events::ProcessingResult::Ignored; } + // AssImp nodes with multiple meshes on them occur when AssImp split a mesh on material. + // This logic recombines those meshes to minimize the changes needed to replace FBX SDK with AssImp, FBX SDK did not separate meshes, + // and the engine has code to do this later. + const bool allMeshesHaveTangentsAndBitangents = AZStd::all_of(currentNode->mMeshes, currentNode->mMeshes + currentNode->mNumMeshes, meshHasTangentsAndBitangents); + if (!allMeshesHaveTangentsAndBitangents) + { + AZ_Error( + Utilities::ErrorWindow, false, + "Node with name %s has meshes with and without bitangents. " + "Placeholder incorrect bitangents will be generated to allow the data to process, " + "but the source art needs to be fixed to correct this. Either apply bitangents to all meshes on this node, " + "or remove all bitangents from all meshes on this node.", + currentNode->mName.C_Str()); + } + + const uint64_t vertexCount = GetVertexCountForAllMeshesOnNode(*currentNode, *scene); + AZStd::shared_ptr bitangentStream = AZStd::make_shared(); - // AssImp only has one bitangentStream per mesh. bitangentStream->SetBitangentSetIndex(0); bitangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); bitangentStream->ReserveContainerSpace(vertexCount); - - for (int v = 0; v < mesh->mNumVertices; ++v) + for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { - const Vector3 bitangent( - AssImpSDKWrapper::AssImpTypeConverter::ToVector3(mesh->mBitangents[v])); - bitangentStream->AppendBitangent(bitangent); + const aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + + for (int v = 0; v < mesh->mNumVertices; ++v) + { + if (!mesh->HasTangentsAndBitangents()) + { + // This node has mixed meshes with and without bitangents. + // An error was already thrown above. Output stub bitangents so + // the mesh can still be output in some form, even if the data isn't correct. + // The bitangent count needs to match the vertex count on the associated mesh node. + bitangentStream->AppendBitangent(Vector3::CreateAxisY()); + } + else + { + const Vector3 bitangent( + AssImpSDKWrapper::AssImpTypeConverter::ToVector3(mesh->mBitangents[v])); + bitangentStream->AppendBitangent(bitangent); + } + } } - AZStd::string nodeName(AZStd::string::format("%s",m_defaultNodeName)); Containers::SceneGraph::NodeIndex newIndex = - context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, nodeName.c_str()); + context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, m_defaultNodeName); Events::ProcessingResult bitangentResults; - AssImpSceneAttributeDataPopulatedContext dataPopulated(context, bitangentStream, newIndex, nodeName.c_str()); + AssImpSceneAttributeDataPopulatedContext dataPopulated(context, bitangentStream, newIndex, m_defaultNodeName); bitangentResults = Events::Process(dataPopulated); if (bitangentResults != Events::ProcessingResult::Failure) { bitangentResults = AddAttributeDataNodeWithContexts(dataPopulated); } - return bitangentResults; } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp index c0399329d3..34266a3e29 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBlendShapeImporter.cpp @@ -74,37 +74,51 @@ namespace AZ { return meshDataResult.GetError(); } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); - int parentMeshIndex = parentMeshData->GetSdkMeshIndex(); Events::ProcessingResultCombiner combinedBlendShapeResult; + // 1. Loop through meshes & anims + // Create storage: Anim to meshes + // 2. Loop through anims & meshes + // Create an anim mesh for each anim, with meshes re-combined. + // AssImp separates meshes that have multiple materials. + // This code re-combines them to match previous FBX SDK behavior, + // so they can be separated by engine code instead. + AZStd::map>> animToMeshToAnimMeshIndices; for (int nodeMeshIdx = 0; nodeMeshIdx < numMesh; nodeMeshIdx++) { int sceneMeshIdx = context.m_sourceNode.GetAssImpNode()->mMeshes[nodeMeshIdx]; const aiMesh* aiMesh = context.m_sourceScene.GetAssImpScene()->mMeshes[sceneMeshIdx]; - - // Each mesh gets its own node in the scene graph, so only generate - // morph targets for the current mesh. - if (parentMeshIndex != nodeMeshIdx || !aiMesh->mNumAnimMeshes) - { - continue; - } - for (int animIdx = 0; animIdx < aiMesh->mNumAnimMeshes; animIdx++) { - AZStd::shared_ptr blendShapeData = - AZStd::make_shared(); - aiAnimMesh* aiAnimMesh = aiMesh->mAnimMeshes[animIdx]; - AZStd::string nodeName(aiAnimMesh->mName.C_Str()); - size_t dotIndex = nodeName.rfind('.'); - if (dotIndex != AZStd::string::npos) - { - nodeName.erase(0, dotIndex + 1); - } - RenamedNodesMap::SanitizeNodeName(nodeName, context.m_scene.GetGraph(), context.m_currentGraphPosition, "BlendShape"); - AZ_TraceContext("Blend shape name", nodeName); + animToMeshToAnimMeshIndices[aiAnimMesh->mName.C_Str()].emplace_back(nodeMeshIdx, animIdx); + } + } + + for (const auto& animToMeshIndex : animToMeshToAnimMeshIndices) + { + AZStd::shared_ptr blendShapeData = + AZStd::make_shared(); + + // Some DCC tools, like Maya, include a full path separated by '.' in the node names. + // For example, "cone_skin_blendShapeNode.cone_squash" + // Downstream processing doesn't want anything but the last part of that node name, + // so find the last '.' and remove anything before it. + AZStd::string nodeName(animToMeshIndex.first); + size_t dotIndex = nodeName.rfind('.'); + if (dotIndex != AZStd::string::npos) + { + nodeName.erase(0, dotIndex + 1); + } + int vertexOffset = 0; + RenamedNodesMap::SanitizeNodeName(nodeName, context.m_scene.GetGraph(), context.m_currentGraphPosition, "BlendShape"); + AZ_TraceContext("Blend shape name", nodeName); + for (const auto& meshIndex : animToMeshIndex.second) + { + int sceneMeshIdx = context.m_sourceNode.GetAssImpNode()->mMeshes[meshIndex.first]; + const aiMesh* aiMesh = context.m_sourceScene.GetAssImpScene()->mMeshes[sceneMeshIdx]; + const aiAnimMesh* aiAnimMesh = aiMesh->mAnimMeshes[meshIndex.second]; AZStd::bitset uvSetUsedFlags; for (AZ::u8 uvSetIndex = 0; uvSetIndex < SceneData::GraphData::BlendShapeData::MaxNumUVSets; ++uvSetIndex) @@ -128,7 +142,7 @@ namespace AZ context.m_sourceSceneSystem.ConvertUnit(vertex); blendShapeData->AddPosition(vertex); - blendShapeData->SetVertexIndexToControlPointIndexMap(vertIdx, vertIdx); + blendShapeData->SetVertexIndexToControlPointIndexMap(vertIdx + vertexOffset, vertIdx + vertexOffset); // Add normals if (aiAnimMesh->HasNormals()) @@ -191,33 +205,36 @@ namespace AZ } for (int idx = 0; idx < face.mNumIndices; ++idx) { - blendFace.vertexIndex[idx] = face.mIndices[idx]; + blendFace.vertexIndex[idx] = face.mIndices[idx] + vertexOffset; } blendShapeData->AddFace(blendFace); } + vertexOffset += aiMesh->mNumVertices; - // Report problem if no vertex or face converted to MeshData - if (blendShapeData->GetVertexCount() <= 0 || blendShapeData->GetFaceCount() <= 0) - { - AZ_Error(Utilities::ErrorWindow, false, "Missing geometry data in blendshape node %s.", nodeName.c_str()); - return Events::ProcessingResult::Failure; - } - Containers::SceneGraph::NodeIndex newIndex = - context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, nodeName.c_str()); - - Events::ProcessingResult blendShapeResult; - AssImpSceneAttributeDataPopulatedContext dataPopulated(context, blendShapeData, newIndex, nodeName); - blendShapeResult = Events::Process(dataPopulated); - - if (blendShapeResult != Events::ProcessingResult::Failure) - { - blendShapeResult = AddAttributeDataNodeWithContexts(dataPopulated); - } - combinedBlendShapeResult += blendShapeResult; } + + // Report problem if no vertex or face converted to MeshData + if (blendShapeData->GetVertexCount() <= 0 || blendShapeData->GetFaceCount() <= 0) + { + AZ_Error(Utilities::ErrorWindow, false, "Missing geometry data in blendshape node %s.", nodeName.c_str()); + return Events::ProcessingResult::Failure; + } + + Containers::SceneGraph::NodeIndex newIndex = + context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, nodeName.c_str()); + + Events::ProcessingResult blendShapeResult; + AssImpSceneAttributeDataPopulatedContext dataPopulated(context, blendShapeData, newIndex, nodeName); + blendShapeResult = Events::Process(dataPopulated); + + if (blendShapeResult != Events::ProcessingResult::Failure) + { + blendShapeResult = AddAttributeDataNodeWithContexts(dataPopulated); + } + combinedBlendShapeResult += blendShapeResult; } return combinedBlendShapeResult.GetResult(); diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp index 4467d6933b..5b43941715 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpBoneImporter.cpp @@ -46,8 +46,8 @@ namespace AZ } void EnumBonesInNode( - const aiScene* scene, const aiNode* node, AZStd::unordered_map& mainBoneList, - AZStd::unordered_map& boneLookup) + const aiScene* scene, const aiNode* node, AZStd::unordered_map& mainBoneList, + AZStd::unordered_map& boneLookup) { /* From AssImp Documentation a) Create a map or a similar container to store which nodes are necessary for the skeleton. Pre-initialise it for all nodes with a "no". @@ -62,14 +62,14 @@ namespace AZ for (unsigned meshIndex = 0; meshIndex < node->mNumMeshes; ++meshIndex) { - aiMesh* mesh = scene->mMeshes[node->mMeshes[meshIndex]]; + const aiMesh* mesh = scene->mMeshes[node->mMeshes[meshIndex]]; for (unsigned boneIndex = 0; boneIndex < mesh->mNumBones; ++boneIndex) { - aiBone* bone = mesh->mBones[boneIndex]; + const aiBone* bone = mesh->mBones[boneIndex]; - aiNode* boneNode = scene->mRootNode->FindNode(bone->mName); - aiNode* boneParent = boneNode->mParent; + const aiNode* boneNode = scene->mRootNode->FindNode(bone->mName); + const aiNode* boneParent = boneNode->mParent; mainBoneList[bone->mName.C_Str()] = boneNode; boneLookup[bone->mName.C_Str()] = bone; @@ -85,8 +85,8 @@ namespace AZ } void EnumChildren( - const aiScene* scene, const aiNode* node, AZStd::unordered_map& mainBoneList, - AZStd::unordered_map& boneLookup) + const aiScene* scene, const aiNode* node, AZStd::unordered_map& mainBoneList, + AZStd::unordered_map& boneLookup) { EnumBonesInNode(scene, node, mainBoneList, boneLookup); @@ -102,7 +102,7 @@ namespace AZ { AZ_TraceContext("Importer", "Bone"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); if (IsPivotNode(currentNode->mName)) @@ -118,8 +118,8 @@ namespace AZ } else { - AZStd::unordered_map mainBoneList; - AZStd::unordered_map boneLookup; + AZStd::unordered_map mainBoneList; + AZStd::unordered_map boneLookup; EnumChildren(scene, scene->mRootNode, mainBoneList, boneLookup); if (mainBoneList.find(currentNode->mName.C_Str()) != mainBoneList.end()) @@ -172,7 +172,7 @@ namespace AZ } aiMatrix4x4 transform = currentNode->mTransformation; - aiNode* parent = currentNode->mParent; + const aiNode* parent = currentNode->mParent; while (parent) { diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp index 7ebdb55363..75fa39105f 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpColorStreamImporter.cpp @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -44,7 +45,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(2); // LYN-2576 + serializeContext->Class()->Version(3); // LYN-3250 } } @@ -55,43 +56,64 @@ namespace AZ { return Events::ProcessingResult::Ignored; } - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); - GetMeshDataFromParentResult meshDataResult(GetMeshDataFromParent(context)); - if (!meshDataResult.IsSuccess()) - { - return meshDataResult.GetError(); - } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); + // This node has at least one mesh, verify that the color channel counts are the same for all meshes. + const int expectedColorChannels = scene->mMeshes[currentNode->mMeshes[0]]->GetNumColorChannels(); + const bool allMeshesHaveSameNumberOfColorChannels = + AZStd::all_of(currentNode->mMeshes + 1, currentNode->mMeshes + currentNode->mNumMeshes, [scene, expectedColorChannels](const unsigned int meshIndex) + { + return scene->mMeshes[meshIndex]->GetNumColorChannels() == expectedColorChannels; + }); - size_t vertexCount = parentMeshData->GetVertexCount(); + AZ_Error( + Utilities::ErrorWindow, + allMeshesHaveSameNumberOfColorChannels, + "Color channel counts for node %s has meshes with different color channel counts. " + "The color channel count for the first mesh will be used, and placeholder incorrect color values " + "will be generated to allow the data to process, but the source art needs to be fixed to correct this. " + "All meshes on this node should have the same number of color channels.", + currentNode->mName.C_Str()); - int sdkMeshIndex = parentMeshData->GetSdkMeshIndex(); - if (sdkMeshIndex < 0) + if (expectedColorChannels == 0) { - AZ_Error(Utilities::ErrorWindow, false, - "Tried to construct color stream attribute for invalid or non-mesh parent data, mesh index is missing"); - return Events::ProcessingResult::Failure; + return Events::ProcessingResult::Ignored; } - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + const uint64_t vertexCount = GetVertexCountForAllMeshesOnNode(*currentNode, *scene); Events::ProcessingResultCombiner combinedVertexColorResults; - for (int colorSetIndex = 0; colorSetIndex < mesh->GetNumColorChannels(); ++colorSetIndex) + for (int colorSetIndex = 0; colorSetIndex < expectedColorChannels; ++colorSetIndex) { + AZStd::shared_ptr vertexColors = AZStd::make_shared(); vertexColors->ReserveContainerSpace(vertexCount); - for (int v = 0; v < mesh->mNumVertices; ++v) + for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { - AZ::SceneAPI::DataTypes::Color vertexColor( - AssImpSDKWrapper::AssImpTypeConverter::ToColor(mesh->mColors[colorSetIndex][v])); - vertexColors->AppendColor(vertexColor); + const aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + for (int v = 0; v < mesh->mNumVertices; ++v) + { + if (colorSetIndex < mesh->GetNumColorChannels()) + { + AZ::SceneAPI::DataTypes::Color vertexColor( + AssImpSDKWrapper::AssImpTypeConverter::ToColor(mesh->mColors[colorSetIndex][v])); + vertexColors->AppendColor(vertexColor); + } + else + { + // An error was already emitted if this mesh has less color channels + // than other meshes on the parent node. Append an arbitrary color value, fully opaque black, + // so the mesh can still be processed. + // It's better to let the engine load a partially valid mesh than to completely fail. + vertexColors->AppendColor(AZ::SceneAPI::DataTypes::Color(0.0f,0.0f,0.0f,1.0f)); + } + } } - AZStd::string nodeName(AZStd::string::format("%s%d",m_defaultNodeName,colorSetIndex)); + AZStd::string nodeName(AZStd::string::format("%s%d", m_defaultNodeName, colorSetIndex)); Containers::SceneGraph::NodeIndex newIndex = context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, nodeName.c_str()); @@ -106,9 +128,7 @@ namespace AZ combinedVertexColorResults += colorMapResults; } - return combinedVertexColorResults.GetResult(); - } } // namespace FbxSceneBuilder diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp index 80ac01ebdf..e79eaa09aa 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpImporterUtilities.cpp @@ -69,7 +69,7 @@ namespace AZ aiMatrix4x4 GetConcatenatedLocalTransform(const aiNode* currentNode) { - aiNode* parent = currentNode->mParent; + const aiNode* parent = currentNode->mParent; aiMatrix4x4 combinedTransform = currentNode->mTransformation; while (parent) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp index e314804ea1..a912b90e34 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMaterialImporter.cpp @@ -62,7 +62,7 @@ namespace AZ for (int idx = 0; idx < context.m_sourceNode.m_assImpNode->mNumMeshes; ++idx) { int meshIndex = context.m_sourceNode.m_assImpNode->mMeshes[idx]; - aiMesh* assImpMesh = context.m_sourceScene.GetAssImpScene()->mMeshes[meshIndex]; + const aiMesh* assImpMesh = context.m_sourceScene.GetAssImpScene()->mMeshes[meshIndex]; AZ_Assert(assImpMesh, "Asset Importer Mesh should not be null."); int materialIndex = assImpMesh->mMaterialIndex; AZ_TraceContext("Material Index", materialIndex); diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp index cafb96934d..c0d1fc3bd0 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpMeshImporter.cpp @@ -37,7 +37,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(1); + serializeContext->Class()->Version(2); } } @@ -45,7 +45,7 @@ namespace AZ { AZ_TraceContext("Importer", "Mesh"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); if (!context.m_sourceNode.ContainsMesh() || IsSkinnedMesh(*currentNode, *scene)) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp index 145dc9a457..f4a5fd0f93 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinImporter.cpp @@ -45,7 +45,7 @@ namespace AZ { AZ_TraceContext("Importer", "Skin"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); if (!context.m_sourceNode.ContainsMesh() || !IsSkinnedMesh(*currentNode, *scene)) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp index abcbf10b4a..d8503857cc 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.cpp @@ -51,7 +51,7 @@ namespace AZ { AZ_TraceContext("Importer", "Skin Weights"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); if(currentNode->mNumMeshes <= 0) @@ -59,35 +59,21 @@ namespace AZ return Events::ProcessingResult::Ignored; } - GetMeshDataFromParentResult meshDataResult(GetMeshDataFromParent(context)); - if (!meshDataResult.IsSuccess()) - { - return meshDataResult.GetError(); - } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); - - int parentMeshIndex = parentMeshData->GetSdkMeshIndex(); - Events::ProcessingResultCombiner combinedSkinWeightsResult; + // Don't create this until a bone with weights is encountered + Containers::SceneGraph::NodeIndex weightsIndexForMesh; + AZStd::string skinWeightName; + AZStd::shared_ptr skinWeightData; + + const uint64_t totalVertices = GetVertexCountForAllMeshesOnNode(*currentNode, *scene); + + int vertexCount = 0; for(unsigned nodeMeshIndex = 0; nodeMeshIndex < currentNode->mNumMeshes; ++nodeMeshIndex) { - if (nodeMeshIndex != parentMeshIndex) - { - // Only generate skinning data for the parent mesh. - // Each AssImp mesh is assigned to a unique node, - // so the skinning data should be generated as a child node - // for the associated parent mesh. - continue; - } int sceneMeshIndex = currentNode->mMeshes[nodeMeshIndex]; const aiMesh* mesh = scene->mMeshes[sceneMeshIndex]; - // Don't create this until a bone with weights is encountered - Containers::SceneGraph::NodeIndex weightsIndexForMesh; - AZStd::string skinWeightName; - AZStd::shared_ptr skinWeightData; - for(unsigned b = 0; b < mesh->mNumBones; ++b) { const aiBone* bone = mesh->mBones[b]; @@ -100,7 +86,6 @@ namespace AZ if (!weightsIndexForMesh.IsValid()) { skinWeightName = s_skinWeightName; - skinWeightName += AZStd::to_string(nodeMeshIndex); RenamedNodesMap::SanitizeNodeName(skinWeightName, context.m_scene.GetGraph(), context.m_currentGraphPosition); weightsIndexForMesh = @@ -116,23 +101,25 @@ namespace AZ } Pending pending; pending.m_bone = bone; - pending.m_numVertices = mesh->mNumVertices; + pending.m_numVertices = totalVertices; pending.m_skinWeightData = skinWeightData; + pending.m_vertOffset = vertexCount; m_pendingSkinWeights.push_back(pending); } - - Events::ProcessingResult skinWeightsResult; - AssImpSceneAttributeDataPopulatedContext dataPopulated(context, skinWeightData, weightsIndexForMesh, skinWeightName); - skinWeightsResult = Events::Process(dataPopulated); - - if (skinWeightsResult != Events::ProcessingResult::Failure) - { - skinWeightsResult = AddAttributeDataNodeWithContexts(dataPopulated); - } - - combinedSkinWeightsResult += skinWeightsResult; + vertexCount += mesh->mNumVertices; } + Events::ProcessingResult skinWeightsResult; + AssImpSceneAttributeDataPopulatedContext dataPopulated(context, skinWeightData, weightsIndexForMesh, skinWeightName); + skinWeightsResult = Events::Process(dataPopulated); + + if (skinWeightsResult != Events::ProcessingResult::Failure) + { + skinWeightsResult = AddAttributeDataNodeWithContexts(dataPopulated); + } + + combinedSkinWeightsResult += skinWeightsResult; + return combinedSkinWeightsResult.GetResult(); } @@ -153,7 +140,7 @@ namespace AZ link.boneId = boneId; link.weight = it.m_bone->mWeights[weight].mWeight; - it.m_skinWeightData->AddAndSortLink(it.m_bone->mWeights[weight].mVertexId, link); + it.m_skinWeightData->AddAndSortLink(it.m_bone->mWeights[weight].mVertexId + it.m_vertOffset, link); } } const auto result = m_pendingSkinWeights.empty() ? Events::ProcessingResult::Ignored : Events::ProcessingResult::Success; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h index f048fe0af2..655c838701 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpSkinWeightsImporter.h @@ -61,6 +61,7 @@ namespace AZ { const aiBone* m_bone = nullptr; unsigned m_numVertices = 0; + unsigned m_vertOffset = 0; AZStd::shared_ptr m_skinWeightData; }; diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp index 992a6a6ab1..b61baa9ff6 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTangentStreamImporter.cpp @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -44,7 +45,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(2); // LYN-2576 + serializeContext->Class()->Version(3); // LYN-3250 } } @@ -55,62 +56,79 @@ namespace AZ { return Events::ProcessingResult::Ignored; } - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); - - GetMeshDataFromParentResult meshDataResult(GetMeshDataFromParent(context)); - if (!meshDataResult.IsSuccess()) + + const auto meshHasTangentsAndBitangents = [&scene](const unsigned int meshIndex) { - return meshDataResult.GetError(); - } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); + return scene->mMeshes[meshIndex]->HasTangentsAndBitangents(); + }; - size_t vertexCount = parentMeshData->GetVertexCount(); - - int sdkMeshIndex = parentMeshData->GetSdkMeshIndex(); - if (sdkMeshIndex < 0 || sdkMeshIndex >= currentNode->mNumMeshes) - { - AZ_Error(Utilities::ErrorWindow, false, - "Tried to construct tangent stream attribute for invalid or non-mesh parent data, mesh index is invalid"); - return Events::ProcessingResult::Failure; - } - - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; - - if (!mesh->HasTangentsAndBitangents()) + // If there are no tangents on any meshes, there's nothing to import in this function. + const bool anyMeshHasTangentsAndBitangents = AZStd::any_of(currentNode->mMeshes, currentNode->mMeshes + currentNode->mNumMeshes, meshHasTangentsAndBitangents); + if (!anyMeshHasTangentsAndBitangents) { return Events::ProcessingResult::Ignored; } + // AssImp nodes with multiple meshes on them occur when AssImp split a mesh on material. + // This logic recombines those meshes to minimize the changes needed to replace FBX SDK with AssImp, FBX SDK did not separate meshes, + // and the engine has code to do this later. + const bool allMeshesHaveTangentsAndBitangents = AZStd::all_of(currentNode->mMeshes, currentNode->mMeshes + currentNode->mNumMeshes, meshHasTangentsAndBitangents); + if (!allMeshesHaveTangentsAndBitangents) + { + AZ_Error( + Utilities::ErrorWindow, false, + "Node with name %s has meshes with and without tangents. " + "Placeholder incorrect tangents will be generated to allow the data to process, " + "but the source art needs to be fixed to correct this. Either apply tangents to all meshes on this node, " + "or remove all tangents from all meshes on this node.", + currentNode->mName.C_Str()); + } + + const uint64_t vertexCount = GetVertexCountForAllMeshesOnNode(*currentNode, *scene); + AZStd::shared_ptr tangentStream = AZStd::make_shared(); - // AssImp only has one tangentStream per mesh. tangentStream->SetTangentSetIndex(0); tangentStream->SetTangentSpace(AZ::SceneAPI::DataTypes::TangentSpace::FromFbx); tangentStream->ReserveContainerSpace(vertexCount); - - for (int v = 0; v < mesh->mNumVertices; ++v) + for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { - // Vector4's constructor that takes in a vector3 sets w to 1.0f automatically. - const Vector4 tangent(AssImpSDKWrapper::AssImpTypeConverter::ToVector3(mesh->mTangents[v])); - tangentStream->AppendTangent(tangent); + const aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + + for (int v = 0; v < mesh->mNumVertices; ++v) + { + if (!mesh->HasTangentsAndBitangents()) + { + // This node has mixed meshes with and without tangents. + // An error was already thrown above. Output stub tangents so + // the mesh can still be output in some form, even if the data isn't correct. + // The tangent count needs to match the vertex count on the associated mesh node. + tangentStream->AppendTangent(Vector4(0.f, 1.f, 0.f, 1.f)); + } + else + { + const Vector4 tangent( + AssImpSDKWrapper::AssImpTypeConverter::ToVector3(mesh->mTangents[v])); + tangentStream->AppendTangent(tangent); + } + } } - AZStd::string nodeName(AZStd::string::format("%s", m_defaultNodeName)); Containers::SceneGraph::NodeIndex newIndex = - context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, nodeName.c_str()); + context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, m_defaultNodeName); Events::ProcessingResult tangentResults; - AssImpSceneAttributeDataPopulatedContext dataPopulated(context, tangentStream, newIndex, nodeName.c_str()); + AssImpSceneAttributeDataPopulatedContext dataPopulated(context, tangentStream, newIndex, m_defaultNodeName); tangentResults = Events::Process(dataPopulated); if (tangentResults != Events::ProcessingResult::Failure) { tangentResults = AddAttributeDataNodeWithContexts(dataPopulated); } - return tangentResults; } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp index 84c0e3e18c..5357c32fa9 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpTransformImporter.cpp @@ -50,7 +50,7 @@ namespace AZ Events::ProcessingResult AssImpTransformImporter::ImportTransform(AssImpSceneNodeAppendedContext& context) { AZ_TraceContext("Importer", "transform"); - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); if (currentNode == scene->mRootNode || IsPivotNode(currentNode->mName)) diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp index f5f47b233d..8c1e0e7caa 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/AssImpUvMapImporter.cpp @@ -12,17 +12,19 @@ #include #include +#include +#include #include #include #include #include #include #include -#include -#include +#include #include #include -#include +#include +#include #include #include @@ -45,7 +47,7 @@ namespace AZ SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(3); // LYN-2506 + serializeContext->Class()->Version(4); // LYN-3250 } } @@ -56,28 +58,53 @@ namespace AZ { return Events::ProcessingResult::Ignored; } - aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); + const aiNode* currentNode = context.m_sourceNode.GetAssImpNode(); const aiScene* scene = context.m_sourceScene.GetAssImpScene(); - GetMeshDataFromParentResult meshDataResult(GetMeshDataFromParent(context)); - if (!meshDataResult.IsSuccess()) + // AssImp separates meshes that have multiple materials. + // This code re-combines them to match previous FBX SDK behavior, + // so they can be separated by engine code instead. + bool foundTextureCoordinates = false; + AZStd::array meshesPerTextureCoordinateIndex = {}; + for (int localMeshIndex = 0; localMeshIndex < currentNode->mNumMeshes; ++localMeshIndex) { - return meshDataResult.GetError(); + aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[localMeshIndex]]; + for (int texCoordIndex = 0; texCoordIndex < meshesPerTextureCoordinateIndex.size(); ++texCoordIndex) + { + if (!mesh->mTextureCoords[texCoordIndex]) + { + continue; + } + ++meshesPerTextureCoordinateIndex[texCoordIndex]; + foundTextureCoordinates = true; + } } - const SceneData::GraphData::MeshData* const parentMeshData(meshDataResult.GetValue()); - size_t vertexCount = parentMeshData->GetVertexCount(); + if (!foundTextureCoordinates) + { + return Events::ProcessingResult::Ignored; + } - int sdkMeshIndex = parentMeshData->GetSdkMeshIndex(); - AZ_Assert(sdkMeshIndex >= 0, - "Tried to construct uv stream attribute for invalid or non-mesh parent data, mesh index is missing"); + const uint64_t vertexCount = GetVertexCountForAllMeshesOnNode(*currentNode, *scene); - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + for (int texCoordIndex = 0; texCoordIndex < meshesPerTextureCoordinateIndex.size(); ++texCoordIndex) + { + AZ_Error( + Utilities::ErrorWindow, + meshesPerTextureCoordinateIndex[texCoordIndex] == 0 || + meshesPerTextureCoordinateIndex[texCoordIndex] == currentNode->mNumMeshes, + "Texture coordinate index %d for node %s is not on all meshes on this node. " + "Placeholder arbitrary texture values will be generated to allow the data to process, but the source art " + "needs to be fixed to correct this. All meshes on this node should have the same number of texture coordinate channels.", + texCoordIndex, + currentNode->mName.C_Str()); + } Events::ProcessingResultCombiner combinedUvMapResults; - for (int texCoordIndex = 0; texCoordIndex < AI_MAX_NUMBER_OF_TEXTURECOORDS; ++texCoordIndex) + for (int texCoordIndex = 0; texCoordIndex < meshesPerTextureCoordinateIndex.size(); ++texCoordIndex) { - if (!mesh->mTextureCoords[texCoordIndex]) + // No meshes have this texture coordinate index, skip it. + if (meshesPerTextureCoordinateIndex[texCoordIndex] == 0) { continue; } @@ -85,24 +112,55 @@ namespace AZ AZStd::shared_ptr uvMap = AZStd::make_shared(); uvMap->ReserveContainerSpace(vertexCount); - + bool customNameFound = false; AZStd::string name(AZStd::string::format("%s%d", m_defaultNodeName, texCoordIndex)); - if (mesh->mTextureCoordsNames[texCoordIndex].length) + for (int sdkMeshIndex = 0; sdkMeshIndex < currentNode->mNumMeshes; ++sdkMeshIndex) { - name = mesh->mTextureCoordsNames[texCoordIndex].C_Str(); + const aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[sdkMeshIndex]]; + if(mesh->mTextureCoords[texCoordIndex]) + { + if (mesh->mTextureCoordsNames[texCoordIndex].length > 0) + { + if (!customNameFound) + { + name = mesh->mTextureCoordsNames[texCoordIndex].C_Str(); + customNameFound = true; + } + else + { + AZ_Warning(Utilities::WarningWindow, + strcmp(name.c_str(), mesh->mTextureCoordsNames[texCoordIndex].C_Str()) == 0, + "Node %s has conflicting mesh coordinate names at index %d, %s and %s. Using %s.", + currentNode->mName.C_Str(), + texCoordIndex, + name.c_str(), + mesh->mTextureCoordsNames[texCoordIndex].C_Str(), + name.c_str()); + } + } + } + + for (int v = 0; v < mesh->mNumVertices; ++v) + { + if (mesh->mTextureCoords[texCoordIndex]) + { + AZ::Vector2 vertexUV( + mesh->mTextureCoords[texCoordIndex][v].x, + // The engine's V coordinate is reverse of how it's stored in the FBX file. + 1.0f - mesh->mTextureCoords[texCoordIndex][v].y); + uvMap->AppendUV(vertexUV); + } + else + { + // An error was already emitted if the UV channels for all meshes on this node do not match. + // Append an arbitrary UV value so that the mesh can still be processed. + // It's better to let the engine load a partially valid mesh than to completely fail. + uvMap->AppendUV(AZ::Vector2::CreateZero()); + } + } } uvMap->SetCustomName(name.c_str()); - - for (int v = 0; v < mesh->mNumVertices; ++v) - { - AZ::Vector2 vertexUV( - mesh->mTextureCoords[texCoordIndex][v].x, - // The engine's V coordinate is reverse of how it's stored in the FBX file. - 1.0f - mesh->mTextureCoords[texCoordIndex][v].y); - uvMap->AppendUV(vertexUV); - } - Containers::SceneGraph::NodeIndex newIndex = context.m_scene.GetGraph().AddChild(context.m_currentGraphPosition, name.c_str()); @@ -116,6 +174,7 @@ namespace AZ } combinedUvMapResults += uvMapResults; + } return combinedUvMapResults.GetResult(); diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp index 59821336e0..c90fe7d1f3 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -24,7 +25,7 @@ namespace AZ::SceneAPI::FbxSceneBuilder { - bool BuildSceneMeshFromAssImpMesh(aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, + bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, const AZStd::function()>& makeMeshFunc) { AZStd::unordered_map assImpMatIndexToLYIndex; @@ -34,17 +35,18 @@ namespace AZ::SceneAPI::FbxSceneBuilder { return false; } + auto newMesh = makeMeshFunc(); + newMesh->SetUnitSizeInMeters(sceneSystem.GetUnitSizeInMeters()); + newMesh->SetOriginalUnitSizeInMeters(sceneSystem.GetOriginalUnitSizeInMeters()); + + // AssImp separates meshes that have multiple materials. + // This code re-combines them to match previous FBX SDK behavior, + // so they can be separated by engine code instead. + int vertOffset = 0; for (int m = 0; m < currentNode->mNumMeshes; ++m) { - auto newMesh = makeMeshFunc(); - - newMesh->SetUnitSizeInMeters(sceneSystem.GetUnitSizeInMeters()); - newMesh->SetOriginalUnitSizeInMeters(sceneSystem.GetOriginalUnitSizeInMeters()); - - newMesh->SetSdkMeshIndex(m); - - aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[m]]; + const aiMesh* mesh = scene->mMeshes[currentNode->mMeshes[m]]; // Lumberyard materials are created in order based on mesh references in the scene if (assImpMatIndexToLYIndex.find(mesh->mMaterialIndex) == assImpMatIndexToLYIndex.end()) @@ -59,7 +61,7 @@ namespace AZ::SceneAPI::FbxSceneBuilder sceneSystem.SwapVec3ForUpAxis(vertex); sceneSystem.ConvertUnit(vertex); newMesh->AddPosition(vertex); - newMesh->SetVertexIndexToControlPointIndexMap(vertIdx, vertIdx); + newMesh->SetVertexIndexToControlPointIndexMap(vertIdx + vertOffset, vertIdx + vertOffset); if (mesh->HasNormals()) { @@ -86,14 +88,15 @@ namespace AZ::SceneAPI::FbxSceneBuilder } for (int idx = 0; idx < face.mNumIndices; ++idx) { - meshFace.vertexIndex[idx] = face.mIndices[idx]; + meshFace.vertexIndex[idx] = face.mIndices[idx] + vertOffset; } newMesh->AddFace(meshFace, assImpMatIndexToLYIndex[mesh->mMaterialIndex]); } + vertOffset += mesh->mNumVertices; - meshes.push_back(newMesh); } + meshes.push_back(newMesh); return true; } @@ -127,4 +130,13 @@ namespace AZ::SceneAPI::FbxSceneBuilder azrtti_cast(parentData); return AZ::Success(parentMeshData); } + + uint64_t GetVertexCountForAllMeshesOnNode(const aiNode& node, const aiScene& scene) + { + return AZStd::accumulate(node.mMeshes, node.mMeshes + node.mNumMeshes, uint64_t{ 0u }, + [&scene](auto runningTotal, unsigned int meshIndex) + { + return runningTotal + scene.mMeshes[meshIndex]->mNumVertices; + }); + } } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h index c0b5c044cb..3c7d3d2102 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/AssImpMeshImporterUtilities.h @@ -44,11 +44,16 @@ namespace AZ namespace FbxSceneBuilder { - bool BuildSceneMeshFromAssImpMesh(aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, + bool BuildSceneMeshFromAssImpMesh(const aiNode* currentNode, const aiScene* scene, const FbxSceneSystem& sceneSystem, AZStd::vector>& meshes, const AZStd::function()>& makeMeshFunc); typedef AZ::Outcome GetMeshDataFromParentResult; GetMeshDataFromParentResult GetMeshDataFromParent(AssImpSceneNodeAppendedContext& context); + + // If a node in the original scene file has a mesh with multiple materials on it, the associated AssImp + // node will have multiple meshes on it, broken apart per material. This returns the total number + // of vertices on all meshes on the given node. + uint64_t GetVertexCountForAllMeshesOnNode(const aiNode& node, const aiScene& scene); } } } diff --git a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp index abc095d583..b67696e3cc 100644 --- a/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp +++ b/Code/Tools/SceneAPI/FbxSceneBuilder/Importers/Utilities/RenamedNodesMap.cpp @@ -27,6 +27,7 @@ namespace AZ Containers::SceneGraph::NodeIndex parentNode, const char* defaultName) { AZ_TraceContext("Node name", name); + const AZStd::string originalNodeName(name); bool isNameUpdated = false; // Nodes can't have an empty name, except of the root, otherwise nodes can't be referenced. @@ -56,7 +57,7 @@ namespace AZ // can't reference the same parent in that case. This is to make sure the node can be quickly found as // the full path will be unique. To fix any issues, an index is appended. size_t index = 1; - size_t offset = name.length(); + const size_t offset = name.length(); while (graph.Find(parentNode, name).IsValid()) { // Remove the previously tried extension. @@ -71,7 +72,8 @@ namespace AZ if (isNameUpdated) { AZ_TraceContext("New node name", name); - AZ_TracePrintf(Utilities::WarningWindow, "The name of the node was invalid or conflicting and was updated."); + AZ_TracePrintf(Utilities::WarningWindow, "The name of the node '%s' was invalid or conflicting and was updated to '%s'.", + originalNodeName.c_str(), name.c_str()); } return isNameUpdated; diff --git a/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp b/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp index eccbe729c6..791af4bf68 100644 --- a/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp +++ b/Code/Tools/SceneAPI/SDKWrapper/AssImpSceneWrapper.cpp @@ -17,6 +17,13 @@ #include #include +#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL +#include +#include +#include +#include +#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + namespace AZ { namespace AssImpSDKWrapper @@ -34,19 +41,51 @@ namespace AZ { } +#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + void signal_handler(int signal) + { + AZ_TracePrintf( + SceneAPI::Utilities::ErrorWindow, + "Failed to import scene with Asset Importer library. An %s has occured in the library, this scene file cannot be parsed by the library.", + signal == SIGABRT ? "assert" : "unknown error"); + } +#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + bool AssImpSceneWrapper::LoadSceneFromFile(const char* fileName) { AZ_TracePrintf(SceneAPI::Utilities::LogWindow, "AssImpSceneWrapper::LoadSceneFromFile %s", fileName); AZ_TraceContext("Filename", fileName); + +#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + // Turn off the abort popup because it can disrupt automation. + // AssImp calls abort when asserts are enabled, and an assert is encountered. +#ifdef _WRITE_ABORT_MSG + _set_abort_behavior(0, _WRITE_ABORT_MSG); +#endif // #ifdef _WRITE_ABORT_MSG + // Instead, capture any calls to abort with a signal handler, and report them. + auto previous_handler = std::signal(SIGABRT, signal_handler); +#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + + // aiProcess_JoinIdenticalVertices is not enabled because O3DE has a mesh optimizer that also does this, + // this flag is disabled to keep AssImp output similar to FBX SDK to reduce downstream bugs for the initial AssImp release. + // There's currently a minimum of properties and flags set to maximize compatibility with the existing node graph. m_importer.SetPropertyBool(AI_CONFIG_IMPORT_FBX_PRESERVE_PIVOTS, false); m_importer.SetPropertyBool(AI_CONFIG_IMPORT_FBX_OPTIMIZE_EMPTY_ANIMATION_CURVES, false); m_sceneFileName = fileName; m_assImpScene = m_importer.ReadFile(fileName, aiProcess_Triangulate //Triangulates all faces of all meshes - | aiProcess_JoinIdenticalVertices //Identifies and joins identical vertex data sets for the imported meshes | aiProcess_LimitBoneWeights //Limits the number of bones that can affect a vertex to a maximum value //dropping the least important and re-normalizing | aiProcess_GenNormals); //Generate normals for meshes + +#if AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + // Reset abort behavior for anything else that may call abort. + std::signal(SIGABRT, previous_handler); +#ifdef _WRITE_ABORT_MSG + _set_abort_behavior(1, _WRITE_ABORT_MSG); +#endif // #ifdef _WRITE_ABORT_MSG +#endif // AZ_TRAIT_COMPILER_SUPPORT_CSIGNAL + if (!m_assImpScene) { AZ_TracePrintf(SceneAPI::Utilities::ErrorWindow, "Failed to import Asset Importer Scene. Error returned: %s", m_importer.GetErrorString()); diff --git a/Code/Tools/SceneAPI/SceneCore/Containers/Utilities/SceneUtilities.cpp b/Code/Tools/SceneAPI/SceneCore/Containers/Utilities/SceneUtilities.cpp index f5bb9d28a6..ac27ed54eb 100644 --- a/Code/Tools/SceneAPI/SceneCore/Containers/Utilities/SceneUtilities.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Containers/Utilities/SceneUtilities.cpp @@ -79,7 +79,7 @@ namespace AZ if (coordinateSystemRule->GetScale() != 1.0f) { float scale = coordinateSystemRule->GetScale(); - matrix.MultiplyByScale(Vector3(scale, scale, scale)); + matrix.MultiplyByScale(Vector3(scale)); } if (!coordinateSystemRule->GetOriginNodeName().empty()) { diff --git a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.h b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.h index a2f9450bce..2deed280db 100644 --- a/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.h +++ b/Code/Tools/SceneAPI/SceneCore/Events/AssetImportRequest.h @@ -71,6 +71,11 @@ namespace AZ static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple; using MutexType = AZStd::recursive_mutex; + static AZ::Crc32 GetAssetImportRequestComponentTag() + { + return AZ_CRC_CE("AssetImportRequest"); + } + virtual ~AssetImportRequest() = 0; //! Fills the given list with all available file extensions, excluding the extension for the manifest. diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp index e99788d570..f3c01df2e3 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.cpp @@ -19,6 +19,16 @@ namespace AZ::SceneAPI::Utilities m_output += AZStd::string::format("\t%s: %s\n", name, data); } + void DebugOutput::WriteArray(const char* name, const unsigned int* data, int size) + { + m_output += AZStd::string::format("\t%s: ", name); + for (int index = 0; index < size; ++index) + { + m_output += AZStd::string::format("%d, ", data[index]); + } + m_output += AZStd::string::format("\n"); + } + void DebugOutput::Write(const char* name, const AZStd::string& data) { Write(name, data.c_str()); diff --git a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h index a598c996c9..83dc9dd6ab 100644 --- a/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h +++ b/Code/Tools/SceneAPI/SceneCore/Utilities/DebugOutput.h @@ -29,6 +29,7 @@ namespace AZ::SceneAPI::Utilities void Write(const char* name, const AZStd::vector>& data); SCENE_CORE_API void Write(const char* name, const char* data); + SCENE_CORE_API void WriteArray(const char* name, const unsigned int* data, int size); SCENE_CORE_API void Write(const char* name, const AZStd::string& data); SCENE_CORE_API void Write(const char* name, double data); SCENE_CORE_API void Write(const char* name, uint64_t data); diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/BlendShapeData.cpp b/Code/Tools/SceneAPI/SceneData/GraphData/BlendShapeData.cpp index 902928d404..7d81166829 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/BlendShapeData.cpp +++ b/Code/Tools/SceneAPI/SceneData/GraphData/BlendShapeData.cpp @@ -285,8 +285,26 @@ namespace AZ void BlendShapeData::GetDebugOutput(SceneAPI::Utilities::DebugOutput& output) const { output.Write("Positions", m_positions); + int index = 0; + for (const auto& position : m_positions) + { + output.Write(AZStd::string::format("\t%d", index).c_str(), position); + ++index; + } + index = 0; output.Write("Normals", m_normals); + for (const auto& normal : m_normals) + { + output.Write(AZStd::string::format("\t%d", index).c_str(), normal); + ++index; + } + index = 0; output.Write("Faces", m_faces); + for (const auto& face : m_faces) + { + output.WriteArray(AZStd::string::format("\t%d", index).c_str(), face.vertexIndex, 3); + ++index; + } } } // GraphData } // SceneData diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.cpp b/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.cpp index 8bf49b2898..8f464240c9 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.cpp +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.cpp @@ -45,7 +45,6 @@ namespace AZ behaviorContext->Class() ->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common) ->Attribute(AZ::Script::Attributes::Module, "scene") - ->Method("GetSdkMeshIndex", &MeshData::GetSdkMeshIndex) ->Method("GetControlPointIndex", &MeshData::GetControlPointIndex) ->Method("GetUsedControlPointCount", &MeshData::GetUsedControlPointCount) ->Method("GetUsedPointIndexForControlPoint", &MeshData::GetUsedPointIndexForControlPoint) @@ -77,10 +76,6 @@ namespace AZ void MeshData::CloneAttributesFrom(const IGraphObject* sourceObject) { IMeshData::CloneAttributesFrom(sourceObject); - if (const auto* typedSource = azrtti_cast(sourceObject)) - { - SetSdkMeshIndex(typedSource->GetSdkMeshIndex()); - } } void MeshData::AddPosition(const AZ::Vector3& position) @@ -111,15 +106,6 @@ namespace AZ m_faceMaterialIds.push_back(faceMaterialId); } - void MeshData::SetSdkMeshIndex(int sdkMeshIndex) - { - m_sdkMeshIndex = sdkMeshIndex; - } - int MeshData::GetSdkMeshIndex() const - { - return m_sdkMeshIndex; - } - void MeshData::SetVertexIndexToControlPointIndexMap(int vertexIndex, int controlPointIndex) { m_vertexIndexToControlPointIndexMap[vertexIndex] = controlPointIndex; @@ -206,8 +192,26 @@ namespace AZ void MeshData::GetDebugOutput(SceneAPI::Utilities::DebugOutput& output) const { output.Write("Positions", m_positions); + int index = 0; + for (const auto& position : m_positions) + { + output.Write(AZStd::string::format("\t%d", index).c_str(), position); + ++index; + } + index = 0; output.Write("Normals", m_normals); + for (const auto& normal : m_normals) + { + output.Write(AZStd::string::format("\t%d", index).c_str(), normal); + ++index; + } + index = 0; output.Write("FaceList", m_faceList); + for (const auto& face : m_faceList) + { + output.WriteArray(AZStd::string::format("\t%d", index).c_str(), face.vertexIndex, 3); + ++index; + } output.Write("FaceMaterialIds", m_faceMaterialIds); } } diff --git a/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.h b/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.h index c5197d6cb4..4321096857 100644 --- a/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.h +++ b/Code/Tools/SceneAPI/SceneData/GraphData/MeshData.h @@ -49,9 +49,6 @@ namespace AZ SCENE_DATA_API void AddFace(const AZ::SceneAPI::DataTypes::IMeshData::Face& face, unsigned int faceMaterialId = AZ::SceneAPI::DataTypes::IMeshData::s_invalidMaterialId); - SCENE_DATA_API void SetSdkMeshIndex(int sdkMeshIndex); - SCENE_DATA_API int GetSdkMeshIndex() const; - SCENE_DATA_API void SetVertexIndexToControlPointIndexMap(int vertexIndex, int controlPointIndex); SCENE_DATA_API size_t GetUsedControlPointCount() const override; SCENE_DATA_API int GetControlPointIndex(int vertexIndex) const override; @@ -80,8 +77,6 @@ namespace AZ AZStd::unordered_map m_vertexIndexToControlPointIndexMap; AZStd::unordered_map m_controlPointToUsedVertexIndexMap; - - int m_sdkMeshIndex = -1; }; } } diff --git a/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp b/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp index 79c6cfea7e..84018bbc9a 100644 --- a/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp +++ b/Code/Tools/SceneAPI/SceneData/Tests/GraphData/GraphDataBehaviorTests.cpp @@ -57,7 +57,6 @@ namespace AZ meshData->AddNormal(Vector3{0.1f, 0.2f, 0.3f}); meshData->AddNormal(Vector3{0.4f, 0.5f, 0.6f}); meshData->SetOriginalUnitSizeInMeters(10.0f); - meshData->SetSdkMeshIndex(1337); meshData->SetUnitSizeInMeters(0.5f); meshData->SetVertexIndexToControlPointIndexMap(0, 10); meshData->SetVertexIndexToControlPointIndexMap(1, 11); @@ -252,7 +251,6 @@ namespace AZ ExpectExecute("TestExpectFloatEquals(meshData:GetNormal(1).z, 0.6)"); ExpectExecute("TestExpectFloatEquals(meshData:GetOriginalUnitSizeInMeters(), 10.0)"); ExpectExecute("TestExpectFloatEquals(meshData:GetUnitSizeInMeters(), 0.5)"); - ExpectExecute("TestExpectIntegerEquals(meshData:GetSdkMeshIndex(), 1337)"); ExpectExecute("TestExpectIntegerEquals(meshData:GetUsedControlPointCount(), 4)"); ExpectExecute("TestExpectIntegerEquals(meshData:GetControlPointIndex(0), 10)"); ExpectExecute("TestExpectIntegerEquals(meshData:GetControlPointIndex(1), 11)"); diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp index 322aa9ac51..640c092070 100644 --- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp +++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowHandler.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace AZ @@ -58,10 +59,11 @@ namespace AZ } else { - AzToolsFramework::Vector3PropertyHandler handler; - handler.ConsumeAttribute(widget->GetTranslationWidget(), attrib, attrValue, debugName); - handler.ConsumeAttribute(widget->GetRotationWidget(), attrib, attrValue, debugName); - handler.ConsumeAttribute(widget->GetScaleWidget(), attrib, attrValue, debugName); + AzToolsFramework::Vector3PropertyHandler vector3Handler; + vector3Handler.ConsumeAttribute(widget->GetTranslationWidget(), attrib, attrValue, debugName); + vector3Handler.ConsumeAttribute(widget->GetRotationWidget(), attrib, attrValue, debugName); + AzToolsFramework::doublePropertySpinboxHandler spinboxHandler; + spinboxHandler.ConsumeAttribute(widget->GetScaleWidget(), attrib, attrValue, debugName); } } diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp index 10e0fd2a68..e8ecaa0c27 100644 --- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp +++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ namespace AZ ExpandedTransform::ExpandedTransform() : m_translation(0, 0, 0) , m_rotation(0, 0, 0) - , m_scale(1, 1, 1) + , m_scale(1) { } @@ -60,14 +61,14 @@ namespace AZ { m_translation = transform.GetTranslation(); m_rotation = transform.GetEulerDegrees(); - m_scale = transform.GetScale(); + m_scale = transform.GetUniformScale(); } void ExpandedTransform::GetTransform(AZ::Transform& transform) const { transform = Transform::CreateTranslation(m_translation); transform *= AZ::ConvertEulerDegreesToTransform(m_rotation); - transform.MultiplyByScale(m_scale); + transform.MultiplyByUniformScale(m_scale); } const AZ::Vector3& ExpandedTransform::GetTranslation() const @@ -90,12 +91,12 @@ namespace AZ m_rotation = rotation; } - const AZ::Vector3& ExpandedTransform::GetScale() const + const float ExpandedTransform::GetScale() const { return m_scale; } - void ExpandedTransform::SetScale(const AZ::Vector3& scale) + void ExpandedTransform::SetScale(const float scale) { m_scale = scale; } @@ -131,7 +132,7 @@ namespace AZ m_rotationWidget->setMaximum(360); m_rotationWidget->setSuffix(" degrees"); - m_scaleWidget = new AzQtComponents::VectorInput(this, 3); + m_scaleWidget = new AzToolsFramework::PropertyDoubleSpinCtrl(this); m_scaleWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); m_scaleWidget->setMinimum(0); m_scaleWidget->setMaximum(10000); @@ -191,13 +192,10 @@ namespace AZ AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, this); }); - QObject::connect(m_scaleWidget, &AzQtComponents::VectorInput::valueChanged, this, [this] + QObject::connect(m_scaleWidget, &AzToolsFramework::PropertyDoubleSpinCtrl::valueChanged, this, [this] { - AzQtComponents::VectorInput* widget = this->GetScaleWidget(); - AZ::Vector3 scale; - - PopulateVector3(widget, scale); - + AzToolsFramework::PropertyDoubleSpinCtrl* widget = this->GetScaleWidget(); + float scale = aznumeric_cast(widget->value()); m_transform.SetScale(scale); AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestWrite, this); }); @@ -224,9 +222,7 @@ namespace AZ m_rotationWidget->setValuebyIndex(m_transform.GetRotation().GetY(), 1); m_rotationWidget->setValuebyIndex(m_transform.GetRotation().GetZ(), 2); - m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetX(), 0); - m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetY(), 1); - m_scaleWidget->setValuebyIndex(m_transform.GetScale().GetZ(), 2); + m_scaleWidget->setValue(m_transform.GetScale()); blockSignals(false); } @@ -251,7 +247,7 @@ namespace AZ return m_rotationWidget; } - AzQtComponents::VectorInput* TransformRowWidget::GetScaleWidget() + AzToolsFramework::PropertyDoubleSpinCtrl* TransformRowWidget::GetScaleWidget() { return m_scaleWidget; } diff --git a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h index dc3286f80e..3977d26c7c 100644 --- a/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h +++ b/Code/Tools/SceneAPI/SceneUI/RowWidgets/TransformRowWidget.h @@ -21,6 +21,7 @@ #include #include #include + #endif namespace AzQtComponents @@ -28,6 +29,11 @@ namespace AzQtComponents class VectorInput; } +namespace AzToolsFramework +{ + class PropertyDoubleSpinCtrl; +} + namespace AZ { namespace SceneAPI @@ -51,14 +57,14 @@ namespace AZ const AZ::Vector3& GetRotation() const; void SetRotation(const AZ::Vector3& translation); - const AZ::Vector3& GetScale() const; - void SetScale(const AZ::Vector3& scale); + const float GetScale() const; + void SetScale(const float scale); private: AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ::Vector3 m_translation; AZ::Vector3 m_rotation; - AZ::Vector3 m_scale; + float m_scale; AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING }; @@ -78,7 +84,7 @@ namespace AZ AzQtComponents::VectorInput* GetTranslationWidget(); AzQtComponents::VectorInput* GetRotationWidget(); - AzQtComponents::VectorInput* GetScaleWidget(); + AzToolsFramework::PropertyDoubleSpinCtrl* GetScaleWidget(); protected: ExpandedTransform m_transform; @@ -87,7 +93,7 @@ namespace AZ AzQtComponents::VectorInput* m_translationWidget; AzQtComponents::VectorInput* m_rotationWidget; - AzQtComponents::VectorInput* m_scaleWidget; + AzToolsFramework::PropertyDoubleSpinCtrl* m_scaleWidget; }; } // namespace SceneUI } // namespace SceneAPI diff --git a/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp b/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp index 05082f29fb..cda6582e63 100644 --- a/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp +++ b/Code/Tools/SceneAPI/SceneUI/Tests/RowWidgets/TransformRowWidgetTests.cpp @@ -30,7 +30,7 @@ namespace AZ Vector3 m_translation = Vector3(10.0f, 20.0f, 30.0f); Vector3 m_rotation = Vector3(30.0f, 45.0f, 60.0f); - Vector3 m_scale = Vector3(2.0f, 3.0f, 4.0f); + float m_scale = 3.0f; }; TEST_F(TransformRowWidgetTest, GetTranslation_TranslationInMatrix_TranslationCanBeRetrievedDirectly) @@ -83,26 +83,22 @@ namespace AZ TEST_F(TransformRowWidgetTest, GetScale_ScaleInMatrix_ScaleCanBeRetrievedDirectly) { - m_transform = Transform::CreateScale(m_scale); + m_transform = Transform::CreateUniformScale(m_scale); m_expanded.SetTransform(m_transform); - const Vector3& returned = m_expanded.GetScale(); - EXPECT_NEAR(m_scale.GetX(), returned.GetX(), 0.1f); - EXPECT_NEAR(m_scale.GetY(), returned.GetY(), 0.1f); - EXPECT_NEAR(m_scale.GetZ(), returned.GetZ(), 0.1f); + const float returned = m_expanded.GetScale(); + EXPECT_NEAR(m_scale, returned, 0.1f); } TEST_F(TransformRowWidgetTest, GetScale_ScaleInMatrix_ScaleCanBeRetrievedFromTransform) { - m_transform = Transform::CreateScale(m_scale); + m_transform = Transform::CreateUniformScale(m_scale); m_expanded.SetTransform(m_transform); Transform rebuild; m_expanded.GetTransform(rebuild); - Vector3 returned = rebuild.GetScale(); - EXPECT_NEAR(m_scale.GetX(), returned.GetX(), 0.1f); - EXPECT_NEAR(m_scale.GetY(), returned.GetY(), 0.1f); - EXPECT_NEAR(m_scale.GetZ(), returned.GetZ(), 0.1f); + float returned = rebuild.GetUniformScale(); + EXPECT_NEAR(m_scale, returned, 0.1f); } TEST_F(TransformRowWidgetTest, GetTransform_RotateAndTranslateInMatrix_ReconstructedTransformMatchesOriginal) @@ -121,7 +117,7 @@ namespace AZ { Quaternion quaternion = AZ::ConvertEulerDegreesToQuaternion(m_rotation); m_transform = Transform::CreateFromQuaternionAndTranslation(quaternion, m_translation); - m_transform.MultiplyByScale(m_scale); + m_transform.MultiplyByUniformScale(m_scale); m_expanded.SetTransform(m_transform); Transform rebuild; diff --git a/Code/Tools/SerializeContextTools/Application.cpp b/Code/Tools/SerializeContextTools/Application.cpp index da0cca5ca6..81cc314deb 100644 --- a/Code/Tools/SerializeContextTools/Application.cpp +++ b/Code/Tools/SerializeContextTools/Application.cpp @@ -97,6 +97,11 @@ namespace AZ return m_configFilePath.c_str(); } + void Application::QueryApplicationType(AZ::ApplicationTypeQuery& appType) const + { + appType.m_maskValue = AZ::ApplicationTypeQuery::Masks::Tool; + } + void Application::SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) { AZ::ComponentApplication::SetSettingsRegistrySpecializations(specializations); diff --git a/Code/Tools/SerializeContextTools/Application.h b/Code/Tools/SerializeContextTools/Application.h index b1b818e27d..b4c02b87c2 100644 --- a/Code/Tools/SerializeContextTools/Application.h +++ b/Code/Tools/SerializeContextTools/Application.h @@ -28,6 +28,7 @@ namespace AZ const char* GetConfigFilePath() const; AZ::ComponentTypeList GetRequiredSystemComponents() const override; + void QueryApplicationType(AZ::ApplicationTypeQuery& appType) const override; protected: void SetSettingsRegistrySpecializations(AZ::SettingsRegistryInterface::Specializations& specializations) override; diff --git a/Code/Tools/SerializeContextTools/SliceConverter.cpp b/Code/Tools/SerializeContextTools/SliceConverter.cpp index 7631eabf22..d06534e303 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.cpp +++ b/Code/Tools/SerializeContextTools/SliceConverter.cpp @@ -25,8 +25,11 @@ #include #include #include +#include +#include #include #include +#include #include #include #include @@ -36,7 +39,6 @@ // SliceConverter reads in a slice file (saved in an ObjectStream format), instantiates it, creates a prefab out of the data, // and saves the prefab in a JSON format. This can be used for one-time migrations of slices or slice-based levels to prefabs. -// This converter is still in an early state. It can convert trivial slices, but it cannot handle nested slices yet. // // If the slice contains legacy data, it will print out warnings / errors about the data that couldn't be serialized. // The prefab will be generated without that data. @@ -70,6 +72,20 @@ namespace AZ AZ_Error("Convert-Slice", false, "No json registration context found."); return false; } + + // Connect to the Asset Processor so that we can get the correct source path to any nested slice references. + if (!ConnectToAssetProcessor()) + { + AZ_Error("Convert-Slice", false, " Failed to connect to the Asset Processor.\n"); + 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. + AZ::Data::AssetCatalogRequestBus::Broadcast( + &AZ::Data::AssetCatalogRequestBus::Events::LoadCatalog, "@assets@/assetcatalog.xml"); + application.Tick(); + AZStd::string logggingScratchBuffer; SetupLogging(logggingScratchBuffer, convertSettings.m_reporting, *commandLine); @@ -80,83 +96,90 @@ namespace AZ verifySettings.m_serializeContext = application.GetSerializeContext(); SetupLogging(logggingScratchBuffer, verifySettings.m_reporting, *commandLine); - auto archiveInterface = AZ::Interface::Get(); - - // Find the Prefab System Component for use in creating and saving the prefab - AZ::Entity* systemEntity = application.FindEntity(AZ::SystemEntityId); - AZ_Assert(systemEntity != nullptr, "System entity doesn't exist."); - auto prefabSystemComponent = systemEntity->FindComponent(); - AZ_Assert(prefabSystemComponent != nullptr, "Prefab System component doesn't exist"); - bool result = true; rapidjson::StringBuffer scratchBuffer; + // Loop through the list of requested files and convert them. AZStd::vector fileList = Utilities::ReadFileListFromCommandLine(application, "files"); for (AZStd::string& filePath : fileList) { - bool packOpened = false; - - AZ::IO::Path outputPath = filePath; - outputPath.ReplaceExtension("prefab"); - - AZ_Printf("Convert-Slice", "------------------------------------------------------------------------------------------\n"); - AZ_Printf("Convert-Slice", "Converting '%s' to '%s'\n", filePath.c_str(), outputPath.c_str()); - - AZ::IO::Path inputPath = filePath; - auto fileExtension = inputPath.Extension(); - if (fileExtension == ".ly") - { - // Special case: for level files, we need to open the .ly zip file and convert the levelentities.editor_xml file - // inside of it. All the other files can be ignored as they are deprecated legacy system files that are no longer - // loaded with prefab-based levels. - packOpened = archiveInterface->OpenPack(filePath); - inputPath.ReplaceFilename("levelentities.editor_xml"); - AZ_Warning("Convert-Slice", packOpened, " '%s' could not be opened as a pack file.\n", filePath.c_str()); - } - else - { - AZ_Warning( - "Convert-Slice", (fileExtension == ".slice"), - " Warning: Only .ly and .slice files are supported, conversion of '%.*s' may not work.\n", - AZ_STRING_ARG(fileExtension.Native())); - } - - auto callback = [prefabSystemComponent, &outputPath, isDryRun] - (void* classPtr, const Uuid& classId, [[maybe_unused]] SerializeContext* context) - { - if (classId != azrtti_typeid()) - { - AZ_Printf("Convert-Slice", " File not converted: Slice root is not an entity.\n"); - return false; - } - - AZ::Entity* rootEntity = reinterpret_cast(classPtr); - return ConvertSliceFile(prefabSystemComponent, outputPath, isDryRun, rootEntity); - }; - - if (!Utilities::InspectSerializedFile(inputPath.c_str(), convertSettings.m_serializeContext, callback)) - { - AZ_Warning("Convert-Slice", false, "Failed to load '%s'. File may not contain an object stream.", inputPath.c_str()); - result = false; - } - - if (packOpened) - { - [[maybe_unused]] bool closeResult = archiveInterface->ClosePack(filePath); - AZ_Warning("Convert-Slice", closeResult, "Failed to close '%s'.", filePath.c_str()); - } - - AZ_Printf("Convert-Slice", "Finished converting '%s' to '%s'\n", filePath.c_str(), outputPath.c_str()); - AZ_Printf("Convert-Slice", "------------------------------------------------------------------------------------------\n"); + bool convertResult = ConvertSliceFile(convertSettings.m_serializeContext, filePath, isDryRun); + result = result && convertResult; } + DisconnectFromAssetProcessor(); return result; } bool SliceConverter::ConvertSliceFile( - AzToolsFramework::Prefab::PrefabSystemComponent* prefabSystemComponent, AZ::IO::PathView outputPath, bool isDryRun, - AZ::Entity* rootEntity) + AZ::SerializeContext* serializeContext, const AZStd::string& slicePath, bool isDryRun) { + bool result = true; + bool packOpened = false; + + auto archiveInterface = AZ::Interface::Get(); + + AZ::IO::Path outputPath = slicePath; + outputPath.ReplaceExtension("prefab"); + + AZ_Printf("Convert-Slice", "------------------------------------------------------------------------------------------\n"); + AZ_Printf("Convert-Slice", "Converting '%s' to '%s'\n", slicePath.c_str(), outputPath.c_str()); + + AZ::IO::Path inputPath = slicePath; + auto fileExtension = inputPath.Extension(); + if (fileExtension == ".ly") + { + // Special case: for level files, we need to open the .ly zip file and convert the levelentities.editor_xml file + // inside of it. All the other files can be ignored as they are deprecated legacy system files that are no longer + // loaded with prefab-based levels. + packOpened = archiveInterface->OpenPack(slicePath); + inputPath.ReplaceFilename("levelentities.editor_xml"); + AZ_Warning("Convert-Slice", packOpened, " '%s' could not be opened as a pack file.\n", slicePath.c_str()); + } + else + { + AZ_Warning( + "Convert-Slice", (fileExtension == ".slice"), + " Warning: Only .ly and .slice files are supported, conversion of '%.*s' may not work.\n", + AZ_STRING_ARG(fileExtension.Native())); + } + + auto callback = [&outputPath, isDryRun](void* classPtr, const Uuid& classId, SerializeContext* context) + { + if (classId != azrtti_typeid()) + { + AZ_Printf("Convert-Slice", " File not converted: Slice root is not an entity.\n"); + return false; + } + + AZ::Entity* rootEntity = reinterpret_cast(classPtr); + return ConvertSliceToPrefab(context, outputPath, isDryRun, rootEntity); + }; + + // Read in the slice file and call the callback on completion to convert the read-in slice to a prefab. + if (!Utilities::InspectSerializedFile(inputPath.c_str(), serializeContext, callback)) + { + AZ_Warning("Convert-Slice", false, "Failed to load '%s'. File may not contain an object stream.", inputPath.c_str()); + result = false; + } + + if (packOpened) + { + [[maybe_unused]] bool closeResult = archiveInterface->ClosePack(slicePath); + AZ_Warning("Convert-Slice", closeResult, "Failed to close '%s'.", slicePath.c_str()); + } + + AZ_Printf("Convert-Slice", "Finished converting '%s' to '%s'\n", slicePath.c_str(), outputPath.c_str()); + AZ_Printf("Convert-Slice", "------------------------------------------------------------------------------------------\n"); + + return result; + } + + bool SliceConverter::ConvertSliceToPrefab( + AZ::SerializeContext* serializeContext, AZ::IO::PathView outputPath, bool isDryRun, AZ::Entity* rootEntity) + { + auto prefabSystemComponentInterface = AZ::Interface::Get(); + // Find the slice from the root entity. SliceComponent* sliceComponent = AZ::EntityUtils::FindFirstDerivedComponent(rootEntity); if (sliceComponent == nullptr) @@ -167,45 +190,21 @@ namespace AZ // Get all of the entities from the slice. SliceComponent::EntityList sliceEntities = sliceComponent->GetNewEntities(); - if (sliceEntities.empty()) - { - AZ_Printf("Convert-Slice", " File not converted: Slice entities could not be retrieved.\n"); - return false; - } - - const SliceComponent::SliceList& sliceList = sliceComponent->GetSlices(); - AZ_Warning("Convert-Slice", sliceList.empty(), " Slice depends on other slices, this conversion will lose data.\n"); + AZ_Printf("Convert-Slice", " Slice contains %zu entities.\n", sliceEntities.size()); // Create the Prefab with the entities from the slice AZStd::unique_ptr sourceInstance( - prefabSystemComponent->CreatePrefab(sliceEntities, {}, outputPath)); + prefabSystemComponentInterface->CreatePrefab(sliceEntities, {}, outputPath)); // Dispatch events here, because prefab creation might trigger asset loads in rare circumstances. AZ::Data::AssetManager::Instance().DispatchEvents(); - // Set up the Prefab container entity to be a proper Editor entity. (This logic is normally triggered - // via an EditorRequests EBus in CreatePrefab, but the subsystem that listens for it isn't present in this tool.) + // Fix up the container entity to have the proper components and fix up the slice entities to have the proper hierarchy + // with the container as the top-most parent. AzToolsFramework::Prefab::EntityOptionalReference container = sourceInstance->GetContainerEntity(); - AzToolsFramework::EditorEntityContextRequestBus::Broadcast( - &AzToolsFramework::EditorEntityContextRequestBus::Events::AddRequiredComponents, container->get()); - container->get().AddComponent(aznew AzToolsFramework::Prefab::EditorPrefabComponent()); - - // Reparent any root-level slice entities to the container entity. - for (auto entity : sliceEntities) - { - AzToolsFramework::Components::TransformComponent* transformComponent = - entity->FindComponent(); - if (transformComponent) - { - if (!transformComponent->GetParentId().IsValid()) - { - transformComponent->SetParent(container->get().GetId()); - } - } - } + FixPrefabEntities(container->get(), sliceEntities); auto templateId = sourceInstance->GetTemplateId(); - if (templateId == AzToolsFramework::Prefab::InvalidTemplateId) { AZ_Printf("Convert-Slice", " Path error. Path could be invalid, or the prefab may not be loaded in this level.\n"); @@ -220,24 +219,216 @@ namespace AZ AZ_Printf("Convert-Slice", " Failed to convert prefab instance data to a PrefabDom.\n"); return false; } - prefabSystemComponent->UpdatePrefabTemplate(templateId, prefabDom); + prefabSystemComponentInterface->UpdatePrefabTemplate(templateId, prefabDom); // Dispatch events here, because prefab serialization might trigger asset loads in rare circumstances. AZ::Data::AssetManager::Instance().DispatchEvents(); + // If this slice has nested slices, we need to loop through those, convert them to prefabs as well, and + // set up the new nesting relationships correctly. + const SliceComponent::SliceList& sliceList = sliceComponent->GetSlices(); + AZ_Printf("Convert-Slice", " Slice contains %zu nested slices.\n", sliceList.size()); + if (!sliceList.empty()) + { + bool nestedSliceResult = ConvertNestedSlices(sliceComponent, sourceInstance.get(), serializeContext, isDryRun); + if (!nestedSliceResult) + { + return false; + } + } + if (isDryRun) { - PrintPrefab(prefabDom, sourceInstance->GetTemplateSourcePath()); + PrintPrefab(templateId); return true; } else { - return SavePrefab(templateId); + return SavePrefab(outputPath, templateId); } } - void SliceConverter::PrintPrefab(const AzToolsFramework::Prefab::PrefabDom& prefabDom, const AZ::IO::Path& templatePath) + void SliceConverter::FixPrefabEntities(AZ::Entity& containerEntity, SliceComponent::EntityList& sliceEntities) { + // Set up the Prefab container entity to be a proper Editor entity. (This logic is normally triggered + // via an EditorRequests EBus in CreatePrefab, but the subsystem that listens for it isn't present in this tool.) + AzToolsFramework::EditorEntityContextRequestBus::Broadcast( + &AzToolsFramework::EditorEntityContextRequestBus::Events::AddRequiredComponents, containerEntity); + containerEntity.AddComponent(aznew AzToolsFramework::Prefab::EditorPrefabComponent()); + + // Reparent any root-level slice entities to the container entity. + for (auto entity : sliceEntities) + { + AzToolsFramework::Components::TransformComponent* transformComponent = + entity->FindComponent(); + if (transformComponent) + { + if (!transformComponent->GetParentId().IsValid()) + { + transformComponent->SetParent(containerEntity.GetId()); + transformComponent->UpdateCachedWorldTransform(); + } + } + } + } + + bool SliceConverter::ConvertNestedSlices( + SliceComponent* sliceComponent, AzToolsFramework::Prefab::Instance* sourceInstance, + AZ::SerializeContext* serializeContext, bool isDryRun) + { + const SliceComponent::SliceList& sliceList = sliceComponent->GetSlices(); + auto prefabSystemComponentInterface = AZ::Interface::Get(); + + for (auto& slice : sliceList) + { + // Get the nested slice asset + auto sliceAsset = slice.GetSliceAsset(); + sliceAsset.QueueLoad(); + sliceAsset.BlockUntilLoadComplete(); + + // The slice list gives us asset IDs, and we need to get to the source path. So first we get the asset path from the ID, + // then we get the source path from the asset path. + + AZStd::string processedAssetPath; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + processedAssetPath, &AZ::Data::AssetCatalogRequests::GetAssetPathById, sliceAsset.GetId()); + + AZStd::string assetPath; + AzToolsFramework::AssetSystemRequestBus::Broadcast( + &AzToolsFramework::AssetSystemRequestBus::Events::GetFullSourcePathFromRelativeProductPath, + processedAssetPath, assetPath); + if (assetPath.empty()) + { + AZ_Warning("Convert-Slice", false, + " Source path for nested slice '%s' could not be found, slice not converted.", processedAssetPath.c_str()); + return false; + } + + // Now, convert the nested slice to a prefab. + bool nestedSliceResult = ConvertSliceFile(serializeContext, assetPath, isDryRun); + if (!nestedSliceResult) + { + AZ_Warning("Convert-Slice", nestedSliceResult, " Nested slice '%s' could not be converted.", assetPath.c_str()); + return false; + } + + // Load the prefab template for the newly-created nested prefab. + // To get the template, we need to take our absolute slice path and turn it into a project-relative prefab path. + AZ::IO::Path nestedPrefabPath = assetPath; + nestedPrefabPath.ReplaceExtension("prefab"); + + auto prefabLoaderInterface = AZ::Interface::Get(); + nestedPrefabPath = prefabLoaderInterface->GenerateRelativePath(nestedPrefabPath); + + AzToolsFramework::Prefab::TemplateId nestedTemplateId = + prefabSystemComponentInterface->GetTemplateIdFromFilePath(nestedPrefabPath); + AzToolsFramework::Prefab::TemplateReference nestedTemplate = + prefabSystemComponentInterface->FindTemplate(nestedTemplateId); + + // For each slice instance of the nested slice, convert it to a nested prefab instance instead. + + auto instances = slice.GetInstances(); + AZ_Printf( + "Convert-Slice", " Attaching %zu instances of nested slice '%s'.\n", instances.size(), + nestedPrefabPath.Native().c_str()); + + for (auto& instance : instances) + { + bool instanceConvertResult = ConvertSliceInstance(instance, sliceAsset, nestedTemplate, sourceInstance); + if (!instanceConvertResult) + { + return false; + } + } + } + + return true; + } + + bool SliceConverter::ConvertSliceInstance( + [[maybe_unused]] AZ::SliceComponent::SliceInstance& instance, + [[maybe_unused]] AZ::Data::Asset& sliceAsset, + AzToolsFramework::Prefab::TemplateReference nestedTemplate, + AzToolsFramework::Prefab::Instance* topLevelInstance) + { + auto instanceToTemplateInterface = AZ::Interface::Get(); + auto prefabSystemComponentInterface = AZ::Interface::Get(); + + // Create a new unmodified prefab Instance for the nested slice instance. + auto nestedInstance = AZStd::make_unique(); + AzToolsFramework::Prefab::Instance::EntityList newEntities; + if (!AzToolsFramework::Prefab::PrefabDomUtils::LoadInstanceFromPrefabDom( + *nestedInstance, newEntities, nestedTemplate->get().GetPrefabDom())) + { + AZ_Error( + "Convert-Slice", false, " Failed to load and instantiate nested Prefab Template '%s'.", + nestedTemplate->get().GetFilePath().c_str()); + return false; + } + + // Get the DOM for the unmodified nested instance. This will be used later below for generating the correct patch + // to the top-level template DOM. + AzToolsFramework::Prefab::PrefabDom unmodifiedNestedInstanceDom; + instanceToTemplateInterface->GenerateDomForInstance(unmodifiedNestedInstanceDom, *(nestedInstance.get())); + + // Currently, DataPatch conversions for nested slices aren't implemented, so all nested slice overrides will + // be lost. + AZ_Warning( + "Convert-Slice", false, " Nested slice instances will lose all of their override data during conversion.", + nestedTemplate->get().GetFilePath().c_str()); + + // Set the container entity of the nested prefab to have the top-level prefab as the parent. + // Once DataPatch conversions are supported, this will need to change to nest the prefab under the appropriate entity + // within the level. + auto containerEntity = nestedInstance->GetContainerEntity(); + AzToolsFramework::Components::TransformComponent* transformComponent = + containerEntity->get().FindComponent(); + if (transformComponent) + { + transformComponent->SetParent(topLevelInstance->GetContainerEntityId()); + transformComponent->UpdateCachedWorldTransform(); + } + + // Add the nested instance itself to the top-level prefab. To do this, we need to add it to our top-level instance, + // create a patch out of it, and patch the top-level prefab template. + + AzToolsFramework::Prefab::PrefabDom topLevelInstanceDomBefore; + instanceToTemplateInterface->GenerateDomForInstance(topLevelInstanceDomBefore, *topLevelInstance); + + AzToolsFramework::Prefab::Instance& addedInstance = topLevelInstance->AddInstance(AZStd::move(nestedInstance)); + + AzToolsFramework::Prefab::PrefabDom topLevelInstanceDomAfter; + instanceToTemplateInterface->GenerateDomForInstance(topLevelInstanceDomAfter, *topLevelInstance); + + AzToolsFramework::Prefab::PrefabDom addedInstancePatch; + instanceToTemplateInterface->GeneratePatch(addedInstancePatch, topLevelInstanceDomBefore, topLevelInstanceDomAfter); + instanceToTemplateInterface->PatchTemplate(addedInstancePatch, topLevelInstance->GetTemplateId()); + + // Get the DOM for the modified nested instance. Now that the data has been fixed up, and the instance has been added + // to the top-level instance, we've got all the changes we need to generate the correct patch. + + AzToolsFramework::Prefab::PrefabDom modifiedNestedInstanceDom; + instanceToTemplateInterface->GenerateDomForInstance(modifiedNestedInstanceDom, addedInstance); + + AzToolsFramework::Prefab::PrefabDom linkPatch; + instanceToTemplateInterface->GeneratePatch(linkPatch, unmodifiedNestedInstanceDom, modifiedNestedInstanceDom); + + prefabSystemComponentInterface->CreateLink( + topLevelInstance->GetTemplateId(), addedInstance.GetTemplateId(), addedInstance.GetInstanceAlias(), linkPatch, + AzToolsFramework::Prefab::InvalidLinkId); + prefabSystemComponentInterface->PropagateTemplateChanges(topLevelInstance->GetTemplateId()); + + return true; + } + + void SliceConverter::PrintPrefab(AzToolsFramework::Prefab::TemplateId templateId) + { + auto prefabSystemComponentInterface = AZ::Interface::Get(); + + auto prefabTemplate = prefabSystemComponentInterface->FindTemplate(templateId); + auto& prefabDom = prefabTemplate->get().GetPrefabDom(); + const AZ::IO::Path& templatePath = prefabTemplate->get().GetFilePath(); + rapidjson::StringBuffer prefabBuffer; rapidjson::PrettyWriter writer(prefabBuffer); prefabDom.Accept(writer); @@ -248,17 +439,67 @@ namespace AZ AZ::Debug::Trace::Instance().Output("", "\n"); } - bool SliceConverter::SavePrefab(AzToolsFramework::Prefab::TemplateId templateId) + bool SliceConverter::SavePrefab(AZ::IO::PathView outputPath, AzToolsFramework::Prefab::TemplateId templateId) { auto prefabLoaderInterface = AZ::Interface::Get(); - if (!prefabLoaderInterface->SaveTemplate(templateId)) + AZStd::string out; + if (prefabLoaderInterface->SaveTemplateToString(templateId, out)) { - AZ_Printf("Convert-Slice", " Could not save prefab - internal error (Json write operation failure).\n"); - return false; + IO::SystemFile outputFile; + if (!outputFile.Open( + AZStd::string(outputPath.Native()).c_str(), + IO::SystemFile::OpenMode::SF_OPEN_CREATE | + IO::SystemFile::OpenMode::SF_OPEN_CREATE_PATH | + IO::SystemFile::OpenMode::SF_OPEN_WRITE_ONLY)) + { + AZ_Error("Convert-Slice", false, " Unable to create output file '%.*s'.", AZ_STRING_ARG(outputPath.Native())); + return false; + } + + outputFile.Write(out.data(), out.size()); + outputFile.Close(); + return true; } - return true; + AZ_Printf("Convert-Slice", " Could not save prefab - internal error (Json write operation failure).\n"); + return false; + } + + bool SliceConverter::ConnectToAssetProcessor() + { + AzFramework::AssetSystem::ConnectionSettings connectionSettings; + AzFramework::AssetSystem::ReadConnectionSettingsFromSettingsRegistry(connectionSettings); + + connectionSettings.m_launchAssetProcessorOnFailedConnection = true; + connectionSettings.m_connectionDirection = + AzFramework::AssetSystem::ConnectionSettings::ConnectionDirection::ConnectToAssetProcessor; + connectionSettings.m_connectionIdentifier = AzFramework::AssetSystem::ConnectionIdentifiers::Editor; + connectionSettings.m_loggingCallback = [](AZStd::string_view logData) + { + AZ_Printf("Convert-Slice", "%.*s\n", AZ_STRING_ARG(logData)); + }; + + bool connectedToAssetProcessor = false; + + AzFramework::AssetSystemRequestBus::BroadcastResult( + connectedToAssetProcessor, &AzFramework::AssetSystemRequestBus::Events::EstablishAssetProcessorConnection, + connectionSettings); + + return connectedToAssetProcessor; + } + + void SliceConverter::DisconnectFromAssetProcessor() + { + AzFramework::AssetSystemRequestBus::Broadcast( + &AzFramework::AssetSystem::AssetSystemRequests::StartDisconnectingAssetProcessor); + + // Wait for the disconnect to finish. + bool disconnected = false; + AzFramework::AssetSystemRequestBus::BroadcastResult(disconnected, + &AzFramework::AssetSystem::AssetSystemRequests::WaitUntilAssetProcessorDisconnected, AZStd::chrono::seconds(30)); + + AZ_Error("Convert-Slice", disconnected, "Asset Processor failed to disconnect successfully."); } } // namespace SerializeContextTools diff --git a/Code/Tools/SerializeContextTools/SliceConverter.h b/Code/Tools/SerializeContextTools/SliceConverter.h index 90dfa0d50a..bec893ff56 100644 --- a/Code/Tools/SerializeContextTools/SliceConverter.h +++ b/Code/Tools/SerializeContextTools/SliceConverter.h @@ -42,12 +42,21 @@ namespace AZ static bool ConvertSliceFiles(Application& application); private: + static bool ConnectToAssetProcessor(); + static void DisconnectFromAssetProcessor(); - static bool ConvertSliceFile(AzToolsFramework::Prefab::PrefabSystemComponent* prefabSystemComponent, - AZ::IO::PathView outputPath, bool isDryRun, AZ::Entity* rootEntity); - - static void PrintPrefab(const AzToolsFramework::Prefab::PrefabDom& prefabDom, const AZ::IO::Path& templatePath); - static bool SavePrefab(AzToolsFramework::Prefab::TemplateId templateId); + static bool ConvertSliceFile(AZ::SerializeContext* serializeContext, const AZStd::string& slicePath, bool isDryRun); + static bool ConvertSliceToPrefab( + AZ::SerializeContext* serializeContext, AZ::IO::PathView outputPath, bool isDryRun, AZ::Entity* rootEntity); + static void FixPrefabEntities(AZ::Entity& containerEntity, SliceComponent::EntityList& sliceEntities); + static bool ConvertNestedSlices( + SliceComponent* sliceComponent, AzToolsFramework::Prefab::Instance* sourceInstance, + AZ::SerializeContext* serializeContext, bool isDryRun); + static bool ConvertSliceInstance( + AZ::SliceComponent::SliceInstance& instance, AZ::Data::Asset& sliceAsset, + AzToolsFramework::Prefab::TemplateReference nestedTemplate, AzToolsFramework::Prefab::Instance* topLevelInstance); + static void PrintPrefab(AzToolsFramework::Prefab::TemplateId templateId); + static bool SavePrefab(AZ::IO::PathView outputPath, AzToolsFramework::Prefab::TemplateId templateId); }; } // namespace SerializeContextTools } // namespace AZ diff --git a/Code/Tools/Standalone/Source/Driller/Workspaces/Workspace.h b/Code/Tools/Standalone/Source/Driller/Workspaces/Workspace.h index 05b52430b7..d5e872b95a 100644 --- a/Code/Tools/Standalone/Source/Driller/Workspaces/Workspace.h +++ b/Code/Tools/Standalone/Source/Driller/Workspaces/Workspace.h @@ -10,8 +10,7 @@ * */ -#ifndef DRILLER_WORKSPACE_SETTINGS_MASTER_H -#define DRILLER_WORKSPACE_SETTINGS_MASTER_H +#pragma once #include #include @@ -77,7 +76,3 @@ namespace Driller SavedWorkspaceMap m_WorkspaceSaveData; }; } - -#pragma once - -#endif // DRILLER_WORKSPACE_SETTINGS_MASTER_H diff --git a/Gems/AWSClientAuth/Code/CMakeLists.txt b/Gems/AWSClientAuth/Code/CMakeLists.txt index e9f2a4ed84..40f6e0fe36 100644 --- a/Gems/AWSClientAuth/Code/CMakeLists.txt +++ b/Gems/AWSClientAuth/Code/CMakeLists.txt @@ -29,6 +29,9 @@ ly_add_target( Gem::HttpRequestor 3rdParty::AWSNativeSDK::AWSClientAuth 3rdParty::AWSNativeSDK::Core + RUNTIME_DEPENDENCIES + Gem::AWSCore + Gem::HttpRequestor ) ly_add_target( @@ -44,13 +47,19 @@ ly_add_target( AZ::AzCore AZ::AzFramework Gem::AWSCore - Gem::HttpRequestor 3rdParty::AWSNativeSDK::AWSClientAuth 3rdParty::AWSNativeSDK::Core PUBLIC Gem::AWSClientAuth.Static + RUNTIME_DEPENDENCIES + Gem::AWSCore + Gem::HttpRequestor ) +# servers and clients use the above module. +ly_create_alias(NAME AWSClientAuth.Servers NAMESPACE Gem TARGETS Gem::AWSClientAuth) +ly_create_alias(NAME AWSClientAuth.Clients NAMESPACE Gem TARGETS Gem::AWSClientAuth) + ################################################################################ # Tests ################################################################################ @@ -71,10 +80,14 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) 3rdParty::AWSNativeSDK::AWSClientAuth AZ::AzCore AZ::AzFramework - Gem::AWSCore - Gem::AWSClientAuth.Static AZ::AWSNativeSDKInit + Gem::AWSClientAuth.Static + Gem::AWSCore Gem::HttpRequestor + RUNTIME_DEPENDENCIES + Gem::AWSCore + AZ::AWSNativeSDKInit + Gem::HttpRequestor ) ly_add_googletest( NAME Gem::AWSClientAuth.Tests diff --git a/Gems/AWSClientAuth/Code/Source/AWSClientAuthModule.cpp b/Gems/AWSClientAuth/Code/Source/AWSClientAuthModule.cpp index 9f027613b6..ccf71cb89e 100644 --- a/Gems/AWSClientAuth/Code/Source/AWSClientAuthModule.cpp +++ b/Gems/AWSClientAuth/Code/Source/AWSClientAuthModule.cpp @@ -39,4 +39,4 @@ namespace AWSClientAuth // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM // The first parameter should be GemName_GemIdLower // The second should be the fully qualified name of the class above -AZ_DECLARE_MODULE_CLASS(AWSClientAuth_c74f2756f5874c0d8d29646dfc9cb0ad, AWSClientAuth::AWSClientAuthModule) +AZ_DECLARE_MODULE_CLASS(Gem_AWSClientAuth, AWSClientAuth::AWSClientAuthModule) diff --git a/Gems/AWSClientAuth/cdk/cognito/cognito_user_pool.py b/Gems/AWSClientAuth/cdk/cognito/cognito_user_pool.py index a903217f40..f0a2acf208 100755 --- a/Gems/AWSClientAuth/cdk/cognito/cognito_user_pool.py +++ b/Gems/AWSClientAuth/cdk/cognito/cognito_user_pool.py @@ -76,7 +76,7 @@ class CognitoUserPool: scope, 'CognitoUserPoolId', description="Cognito User pool id", - value=self._user_pool.attr_provider_name) + value=self._user_pool.ref) core.CfnOutput( scope, diff --git a/Gems/AWSCore/Code/CMakeLists.txt b/Gems/AWSCore/Code/CMakeLists.txt index a58b02d1d4..46046c0791 100644 --- a/Gems/AWSCore/Code/CMakeLists.txt +++ b/Gems/AWSCore/Code/CMakeLists.txt @@ -45,6 +45,10 @@ ly_add_target( Gem::AWSCore.Static ) +# clients and servers will use the above Gem::AWSCore module. +ly_create_alias(NAME AWSCore.Servers NAMESPACE Gem TARGETS Gem::AWSCore) +ly_create_alias(NAME AWSCore.Clients NAMESPACE Gem TARGETS Gem::AWSCore) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME AWSCore.Editor.Static STATIC @@ -99,6 +103,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AWSCore.Editor.Static ) ly_add_dependencies(AWSCore.Editor AWSCore.ResourceMappingTool) + + # Builders and Tools (such as the Editor use AWSCore.Editor) use the .Editor module above. + ly_create_alias(NAME AWSCore.Tools NAMESPACE Gem TARGETS Gem::AWSCore.Editor) + ly_create_alias(NAME AWSCore.Builders NAMESPACE Gem TARGETS Gem::AWSCore.Editor) + endif() ################################################################################ diff --git a/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h b/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h index 738d41c796..27487ed481 100644 --- a/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h +++ b/Gems/AWSCore/Code/Include/Private/AWSCoreInternalBus.h @@ -38,6 +38,11 @@ namespace AWSCore //! @return The path of AWS resource mapping config file virtual AZStd::string GetResourceMappingConfigFilePath() const = 0; + //! GetResourceMappingConfigFolderPath + //! Get the path of AWS resource mapping config folder + //! @return The path of AWS resource mapping config folder + virtual AZStd::string GetResourceMappingConfigFolderPath() const = 0; + //! ReloadConfiguration //! Reload AWSCore configuration without restarting application virtual void ReloadConfiguration() = 0; diff --git a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h index bd30af3ce7..92082617b7 100644 --- a/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h +++ b/Gems/AWSCore/Code/Include/Private/Configuration/AWSCoreConfiguration.h @@ -53,6 +53,7 @@ namespace AWSCore // AWSCoreInternalRequestBus interface implementation AZStd::string GetResourceMappingConfigFilePath() const override; + AZStd::string GetResourceMappingConfigFolderPath() const override; AZStd::string GetProfileName() const override; void ReloadConfiguration() override; diff --git a/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h b/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h index 721cd6dd6a..98467727ea 100644 --- a/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h +++ b/Gems/AWSCore/Code/Include/Private/Editor/AWSCoreEditorManager.h @@ -18,7 +18,7 @@ namespace AWSCore class AWSCoreEditorManager { public: - static constexpr const char CLOUD_SERVICES_MENU_TEXT[] = "&Cloud services"; + static constexpr const char AWS_MENU_TEXT[] = "&AWS"; AWSCoreEditorManager(); virtual ~AWSCoreEditorManager(); diff --git a/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h new file mode 100644 index 0000000000..46acfbd4a3 --- /dev/null +++ b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h @@ -0,0 +1,53 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +namespace AWSCore +{ + static constexpr const char NewToAWSUrl[] = "https://docs.o3de.org/docs/user-guide/gems/reference/aws/"; + + static constexpr const char AWSAndScriptCanvasUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/"; + static constexpr const char AWSAndComponentsUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/"; + static constexpr const char CallAWSResourcesUrl[] = "https://docs.o3de.org/docs/user-guide/components/reference/aws/"; + + static constexpr const char AWSCredentialConfigurationUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-core/configuring-credentials/"; + + static constexpr const char AWSClientAuthGemOverviewUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuthCDKAndResourcesUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuthScriptCanvasAndLuaUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuth3rdPartyAuthProviderUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuthCustomAuthProviderUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuthPlatformSpecificUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + static constexpr const char AWSClientAuthAPIReferenceUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-client-auth/"; + + static constexpr const char AWSMetricsGemOverviewUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; + static constexpr const char AWSMetricsSetupGemUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; + static constexpr const char AWSMetricsScriptingUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; + static constexpr const char AWSMetricsAPIReferenceUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; + static constexpr const char AWSMetricsAdvancedTopicsUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; + static constexpr const char AWSMetricsSettingsUrl[] = + "https://docs.o3de.org/docs/user-guide/gems/reference/aws/aws-metrics/"; +} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h new file mode 100644 index 0000000000..a9a8198e52 --- /dev/null +++ b/Gems/AWSCore/Code/Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h @@ -0,0 +1,44 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +namespace AWSCore +{ + static constexpr const char NewToAWSActionText[] = "Getting started with AWS?"; + + static constexpr const char AWSAndO3DEGlobalDocsText[] = "AWS & O3DE global docs"; + static constexpr const char AWSAndScriptCanvasActionText[] = "AWS && ScriptCanvas"; + static constexpr const char AWSAndComponentsActionText[] = "AWS & Components"; + static constexpr const char CallAWSResourcesActionText[] = "Call AWS resources"; + + static constexpr const char AWSCredentialConfigurationActionText[] = "AWS credential configuration"; + + static constexpr const char AWSResourceMappingToolActionText[] = "AWS Resource Mapping Tool..."; + + static constexpr const char AWSClientAuthActionText[] = "Client Auth"; + static constexpr const char AWSClientAuthGemOverviewActionText[] = "Gem Overview"; + static constexpr const char AWSClientAuthCDKAndResourcesActionText[] = "CDK Application and Resource Mappings"; + static constexpr const char AWSClientAuthScriptCanvasAndLuaActionText[] = "Script Canvas and Lua"; + static constexpr const char AWSClientAuth3rdPartyAuthProviderActionText[] = "3rd Party developer Authentication Provider support"; + static constexpr const char AWSClientAuthCustomAuthProviderActionText[] = "Custom developer Authentication Provider support"; + static constexpr const char AWSClientAuthPlatformSpecificActionText[] = "Platform specific Callouts"; + static constexpr const char AWSClientAuthAPIReferenceActionText[] = "API Reference"; + + static constexpr const char AWSMetricsActionText[] = "Metrics"; + static constexpr const char AWSMetricsGemOverviewActionText[] = "Metrics Overview"; + static constexpr const char AWSMetricsSetupGemActionText[] = "Setup Metrics Gem"; + static constexpr const char AWSMetricsScriptingActionText[] = "Scripting with AWS Metrics"; + static constexpr const char AWSMetricsAPIReferenceActionText[] = "C++ API with AWS Metrics Gem"; + static constexpr const char AWSMetricsAdvancedTopicsActionText[] = "Advanced topics"; + static constexpr const char AWSMetricsSettingsActionText[] = "Metrics Settings"; +} // namespace AWSCore diff --git a/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h b/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h index 19f241e368..c892f86b66 100644 --- a/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h +++ b/Gems/AWSCore/Code/Include/Private/Editor/UI/AWSCoreEditorMenu.h @@ -35,29 +35,23 @@ namespace AWSCore static constexpr const char AWSResourceMappingToolIsRunningText[] = "Resource Mapping Tool is running..."; static constexpr const char AWSResourceMappingToolLogWarningText[] = "Failed to launch Resource Mapping Tool, please check logs for details."; - static constexpr const char AWSResourceMappingToolActionText[] = "AWS Resource Mapping Tool..."; - static constexpr const char CredentialConfigurationActionText[] = "Credential Configuration"; - static constexpr const char CredentialConfigurationUrl[] = "https://docs.aws.amazon.com/sdk-for-cpp/v1/developer-guide/credentials.html"; - static constexpr const char NewToAWSActionText[] = "New to AWS?"; - static constexpr const char NewToAWSUrl[] = "https://o3deorg.netlify.app/docs/user-guide/gems/reference/aws"; - static constexpr const char AWSAndScriptCanvasActionText[] = "AWS && ScriptCanvas"; - static constexpr const char AWSAndScriptCanvasUrl[] = "https://o3deorg.netlify.app/docs/user-guide/gems/reference/aws"; - static constexpr const char AWSClientAuthActionText[] = "Client Auth"; - static constexpr const char AWSMetricsActionText[] = "Metrics"; AWSCoreEditorMenu(const QString& text); ~AWSCoreEditorMenu(); private: + QAction* AddExternalLinkAction(const AZStd::string& name, const AZStd::string& url, const AZStd::string& icon = ""); + void InitializeResourceMappingToolAction(); void InitializeAWSDocActions(); + void InitializeAWSGlobalDocsSubMenu(); void InitializeAWSFeatureGemActions(); // AWSCoreEditorRequestBus interface implementation void SetAWSClientAuthEnabled() override; void SetAWSMetricsEnabled() override; - void SetAWSFeatureActionsEnabled(const AZStd::string actionText); + QMenu* SetAWSFeatureSubMenu(const AZStd::string& menuText); // To improve experience, use process watcher to keep track of ongoing tool process AZStd::unique_ptr m_resourceMappingToolWatcher; diff --git a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp index 3c0f48c058..b22749dbaa 100644 --- a/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp +++ b/Gems/AWSCore/Code/Source/Configuration/AWSCoreConfiguration.cpp @@ -58,6 +58,19 @@ namespace AWSCore return configFilePath; } + AZStd::string AWSCoreConfiguration::GetResourceMappingConfigFolderPath() const + { + if (m_sourceProjectFolder.empty()) + { + AZ_Warning(AWSCoreConfigurationName, false, ProjectSourceFolderNotFoundErrorMessage); + return ""; + } + AZStd::string configFolderPath = AZStd::string::format( + "%s/%s", m_sourceProjectFolder.c_str(), AWSCoreResourceMappingConfigFolderName); + AzFramework::StringFunc::Path::Normalize(configFolderPath); + return configFolderPath; + } + void AWSCoreConfiguration::InitConfig() { InitSourceProjectFolderPath(); @@ -123,7 +136,7 @@ namespace AWSCore auto profileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreProfileNameKey); m_settingsRegistry.Remove(profileNamePath); - m_profileName.clear(); + m_profileName = AWSCoreDefaultProfileName; auto resourceMappingConfigFileNamePath = AZStd::string::format("%s%s", AZ::SettingsRegistryMergeUtils::OrganizationRootKey, AWSCoreResourceMappingConfigFileNameKey); diff --git a/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp b/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp index 1e3e44255a..89956d61b8 100644 --- a/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp +++ b/Gems/AWSCore/Code/Source/Editor/AWSCoreEditorManager.cpp @@ -16,7 +16,7 @@ namespace AWSCore { AWSCoreEditorManager::AWSCoreEditorManager() - : m_awsCoreEditorMenu(new AWSCoreEditorMenu(CLOUD_SERVICES_MENU_TEXT)) + : m_awsCoreEditorMenu(new AWSCoreEditorMenu(AWS_MENU_TEXT)) { } diff --git a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp index 754cc32751..c319788547 100644 --- a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp +++ b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreEditorMenu.cpp @@ -13,10 +13,13 @@ #include #include #include +#include #include #include #include +#include +#include #include #include @@ -36,8 +39,8 @@ namespace AWSCore : QMenu(text) , m_resourceMappingToolWatcher(nullptr) { - InitializeResourceMappingToolAction(); InitializeAWSDocActions(); + InitializeResourceMappingToolAction(); this->addSeparator(); InitializeAWSFeatureGemActions(); @@ -58,6 +61,21 @@ namespace AWSCore this->clear(); } + QAction* AWSCoreEditorMenu::AddExternalLinkAction( + const AZStd::string& name, const AZStd::string& url, const AZStd::string& icon) + { + QAction* linkAction = new QAction(QObject::tr(name.c_str())); + QObject::connect(linkAction, &QAction::triggered, this, + [url]() { + QDesktopServices::openUrl(QUrl(url.c_str())); + }); + if (!icon.empty()) + { + linkAction->setIcon(QIcon(icon.c_str())); + } + return linkAction; + } + void AWSCoreEditorMenu::InitializeResourceMappingToolAction() { #ifdef AWSCORE_EDITOR_RESOURCE_MAPPING_TOOL_ENABLED @@ -103,21 +121,21 @@ namespace AWSCore void AWSCoreEditorMenu::InitializeAWSDocActions() { - QAction* credentialConfiguration = new QAction(QObject::tr(CredentialConfigurationActionText)); - QObject::connect(credentialConfiguration, &QAction::triggered, this, []() { - QDesktopServices::openUrl(QUrl(CredentialConfigurationUrl)); - }); - this->addAction(credentialConfiguration); + this->addAction(AddExternalLinkAction(NewToAWSActionText, NewToAWSUrl, ":/Notifications/link.svg")); - QAction* newToAWS = new QAction(QObject::tr(NewToAWSActionText)); - QObject::connect(newToAWS, &QAction::triggered, this, []() { - QDesktopServices::openUrl(QUrl(NewToAWSUrl)); }); - this->addAction(newToAWS); + InitializeAWSGlobalDocsSubMenu(); - QAction* awsAndScriptCanvas = new QAction(QObject::tr(AWSAndScriptCanvasActionText)); - QObject::connect(awsAndScriptCanvas, &QAction::triggered, this, []() { - QDesktopServices::openUrl(QUrl(AWSAndScriptCanvasUrl)); }); - this->addAction(awsAndScriptCanvas); + this->addAction(AddExternalLinkAction( + AWSCredentialConfigurationActionText, AWSCredentialConfigurationUrl, ":/Notifications/link.svg")); + } + + void AWSCoreEditorMenu::InitializeAWSGlobalDocsSubMenu() + { + QMenu* globalDocsMenu = this->addMenu(QObject::tr(AWSAndO3DEGlobalDocsText)); + + globalDocsMenu->addAction(AddExternalLinkAction(AWSAndScriptCanvasActionText, AWSAndScriptCanvasUrl, ":/Notifications/link.svg")); + globalDocsMenu->addAction(AddExternalLinkAction(AWSAndComponentsActionText, AWSAndComponentsUrl, ":/Notifications/link.svg")); + globalDocsMenu->addAction(AddExternalLinkAction(CallAWSResourcesActionText, CallAWSResourcesUrl, ":/Notifications/link.svg")); } void AWSCoreEditorMenu::InitializeAWSFeatureGemActions() @@ -135,25 +153,67 @@ namespace AWSCore void AWSCoreEditorMenu::SetAWSClientAuthEnabled() { - SetAWSFeatureActionsEnabled(AWSClientAuthActionText); + // TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly + QMenu* subMenu = SetAWSFeatureSubMenu(AWSClientAuthActionText); + + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthGemOverviewActionText, AWSClientAuthGemOverviewUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthCDKAndResourcesActionText, AWSClientAuthCDKAndResourcesUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthScriptCanvasAndLuaActionText, AWSClientAuthScriptCanvasAndLuaUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuth3rdPartyAuthProviderActionText, AWSClientAuth3rdPartyAuthProviderUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthCustomAuthProviderActionText, AWSClientAuthCustomAuthProviderUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthPlatformSpecificActionText, AWSClientAuthPlatformSpecificUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSClientAuthAPIReferenceActionText, AWSClientAuthAPIReferenceUrl, ":/Notifications/link.svg")); } void AWSCoreEditorMenu::SetAWSMetricsEnabled() { - SetAWSFeatureActionsEnabled(AWSMetricsActionText); + // TODO: instead of creating submenu in core editor, aws feature gem should return submenu component directly + QMenu* subMenu = SetAWSFeatureSubMenu(AWSMetricsActionText); + + subMenu->addAction(AddExternalLinkAction( + AWSMetricsGemOverviewActionText, AWSMetricsGemOverviewUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSMetricsSetupGemActionText, AWSMetricsSetupGemUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSMetricsScriptingActionText, AWSMetricsScriptingUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSMetricsAPIReferenceActionText, AWSMetricsAPIReferenceUrl, ":/Notifications/link.svg")); + subMenu->addAction(AddExternalLinkAction( + AWSMetricsAdvancedTopicsActionText, AWSMetricsAdvancedTopicsUrl, ":/Notifications/link.svg")); + + AZStd::string priorAlias = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devroot@"); + AZStd::string configFilePath = priorAlias + "\\Gems\\AWSMetrics\\Code\\" + AZ::SettingsRegistryInterface::RegistryFolder; + AzFramework::StringFunc::Path::Normalize(configFilePath); + + QAction* settingsAction = new QAction(QObject::tr(AWSMetricsSettingsActionText)); + QObject::connect(settingsAction, &QAction::triggered, this, + [configFilePath](){ + QDesktopServices::openUrl(QUrl::fromLocalFile(configFilePath.c_str())); + }); + subMenu->addAction(settingsAction); } - void AWSCoreEditorMenu::SetAWSFeatureActionsEnabled(const AZStd::string actionText) + QMenu* AWSCoreEditorMenu::SetAWSFeatureSubMenu(const AZStd::string& menuText) { auto actionList = this->actions(); for (QList::iterator itr = actionList.begin(); itr != actionList.end(); itr++) { - if (QString::compare((*itr)->text(), actionText.c_str()) == 0) + if (QString::compare((*itr)->text(), menuText.c_str()) == 0) { - (*itr)->setIcon(QIcon(QString(":/Notifications/checkmark.svg"))); - (*itr)->setEnabled(true); - break; + QMenu* subMenu = new QMenu(QObject::tr(menuText.c_str())); + subMenu->setIcon(QIcon(QString(":/Notifications/checkmark.svg"))); + this->insertMenu(*itr, subMenu); + this->removeAction(*itr); + return subMenu; } } + return nullptr; } } // namespace AWSCore diff --git a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp index fb46a8a700..18d437a66c 100644 --- a/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp +++ b/Gems/AWSCore/Code/Source/Editor/UI/AWSCoreResourceMappingToolAction.cpp @@ -14,6 +14,7 @@ #include #include +#include #include namespace AWSCore @@ -108,17 +109,24 @@ namespace AWSCore { return ""; } + + AZStd::string profileName = "default"; + AWSCoreInternalRequestBus::BroadcastResult(profileName, &AWSCoreInternalRequests::GetProfileName); + + AZStd::string configPath = ""; + AWSCoreInternalRequestBus::BroadcastResult(configPath, &AWSCoreInternalRequests::GetResourceMappingConfigFolderPath); + if (m_isDebug) { return AZStd::string::format( - "%s debug %s --binaries_path %s --debug", - m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str()); + "%s debug %s --binaries_path %s --debug --profile %s --config_path %s", m_enginePythonEntryPath.c_str(), + m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str()); } else { return AZStd::string::format( - "%s %s --binaries_path %s", - m_enginePythonEntryPath.c_str(), m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str()); + "%s %s --binaries_path %s --profile %s --config_path %s", m_enginePythonEntryPath.c_str(), + m_toolScriptPath.c_str(), m_toolQtBinDirectoryPath.c_str(), profileName.c_str(), configPath.c_str()); } } diff --git a/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp b/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp index e9c249f1c8..ff78d8e252 100644 --- a/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp +++ b/Gems/AWSCore/Code/Tests/AWSCoreEditorSystemComponentTest.cpp @@ -85,7 +85,7 @@ TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveDummyMe testMenuBar->addMenu("dummy menu"); AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, &testMainWindow); EXPECT_TRUE(testMenuBar->actions().size() == 2); - EXPECT_TRUE(QString::compare(testMenuBar->actions()[1]->text(), AWSCoreEditorManager::CLOUD_SERVICES_MENU_TEXT) == 0); + EXPECT_TRUE(QString::compare(testMenuBar->actions()[1]->text(), AWSCoreEditorManager::AWS_MENU_TEXT) == 0); } TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveHelpMenuInMenuBar_ExpectedMenuGetsAddedAtFront) @@ -95,5 +95,5 @@ TEST_F(AWSCoreEditorSystemComponentTest, NotifyMainWindowInitialized_HaveHelpMen testMenuBar->addMenu(AWSCoreEditorSystemComponent::EDITOR_HELP_MENU_TEXT); AzToolsFramework::EditorEvents::Bus::Broadcast(&AzToolsFramework::EditorEvents::NotifyMainWindowInitialized, &testMainWindow); EXPECT_TRUE(testMenuBar->actions().size() == 2); - EXPECT_TRUE(QString::compare(testMenuBar->actions()[0]->text(), AWSCoreEditorManager::CLOUD_SERVICES_MENU_TEXT) == 0); + EXPECT_TRUE(QString::compare(testMenuBar->actions()[0]->text(), AWSCoreEditorManager::AWS_MENU_TEXT) == 0); } diff --git a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp index 297e56fc33..7f00adaae7 100644 --- a/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp +++ b/Gems/AWSCore/Code/Tests/Credential/AWSDefaultCredentialHandlerTest.cpp @@ -34,7 +34,8 @@ public: MOCK_METHOD0(GetAWSCredentials, Aws::Auth::AWSCredentials()); }; -class AWSDefaultCredentialHandlerMock : public AWSDefaultCredentialHandler +class AWSDefaultCredentialHandlerMock + : public AWSDefaultCredentialHandler { public: void SetupMocks( @@ -76,6 +77,7 @@ public: // AWSCoreInternalRequestBus interface implementation AZStd::string GetProfileName() const override { return m_profileName; } AZStd::string GetResourceMappingConfigFilePath() const override { return ""; } + AZStd::string GetResourceMappingConfigFolderPath() const override { return ""; } void ReloadConfiguration() override {} std::shared_ptr m_environmentCredentialsProviderMock; diff --git a/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp b/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp index 7a578d2bbe..bde2a43993 100644 --- a/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp +++ b/Gems/AWSCore/Code/Tests/Editor/UI/AWSCoreEditorMenuTest.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -35,6 +36,7 @@ class AWSCoreEditorMenuTest { AWSCoreEditorUIFixture::SetUp(); AWSCoreFixture::SetUp(); + m_localFileIO->SetAlias("@devroot@", "dummy engine root"); } void TearDown() override @@ -77,12 +79,12 @@ TEST_F(AWSCoreEditorMenuTest, AWSCoreEditorMenu_BroadcastFeatureGemsAreEnabled_C QList actualActions = testMenu.actions(); for (QList::iterator itr = actualActions.begin(); itr != actualActions.end(); itr++) { - if (QString::compare((*itr)->text(), AWSCoreEditorMenu::AWSClientAuthActionText) == 0) + if (QString::compare((*itr)->text(), AWSClientAuthActionText) == 0) { EXPECT_TRUE((*itr)->isEnabled()); } - if (QString::compare((*itr)->text(), AWSCoreEditorMenu::AWSMetricsActionText) == 0) + if (QString::compare((*itr)->text(), AWSMetricsActionText) == 0) { EXPECT_TRUE((*itr)->isEnabled()); } diff --git a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp index 3adebc9a24..b46a840d40 100644 --- a/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp +++ b/Gems/AWSCore/Code/Tests/ResourceMapping/AWSResourceMappingManagerTest.cpp @@ -119,6 +119,7 @@ public: // AWSCoreInternalRequestBus interface implementation AZStd::string GetProfileName() const override { return ""; } AZStd::string GetResourceMappingConfigFilePath() const override { return m_normalizedConfigFilePath; } + AZStd::string GetResourceMappingConfigFolderPath() const override { return m_normalizedConfigFolderPath; } void ReloadConfiguration() override { m_reloadConfigurationCounter++; } AZStd::unique_ptr m_resourceMappingManager; diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py index ee305c750a..b679921196 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/configuration_manager.py @@ -48,11 +48,14 @@ class ConfigurationManager(object): def configuration(self, new_configuration: ConfigurationManager) -> None: self._configuration = new_configuration - def setup(self) -> None: + def setup(self, config_path: str) -> None: logger.info("Setting up default configuration ...") - # TODO: remove config directory and files default setup once integrating with user input try: - self._configuration.config_directory = file_utils.get_current_directory_path() + normalized_config_path: str = file_utils.normalize_file_path(config_path); + if normalized_config_path: + self._configuration.config_directory = normalized_config_path + else: + self._configuration.config_directory = file_utils.get_current_directory_path() self._configuration.config_files = \ file_utils.find_files_with_suffix_under_directory(self._configuration.config_directory, constants.RESOURCE_MAPPING_CONFIG_FILE_NAME_SUFFIX) diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/view_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/view_manager.py index 7b55c118cd..fff5c4b59a 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/view_manager.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/manager/view_manager.py @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. from __future__ import annotations import logging -from PySide2.QtGui import QPixmap +from PySide2.QtGui import QIcon from PySide2.QtWidgets import (QMainWindow, QStackedWidget, QWidget) from model import (error_messages, view_size_constants) @@ -43,7 +43,7 @@ class ViewManager(object): def __init__(self) -> None: if ViewManager.__instance is None: self._main_window: QMainWindow = QMainWindow() - self._main_window.setWindowIcon(QPixmap(":/stylesheet/img/ly_application_icon.png")) + self._main_window.setWindowIcon(QIcon(":/Application/res/o3de_editor.ico")) self._main_window.setWindowTitle("Resource Mapping") self._main_window.setGeometry(0, 0, view_size_constants.TOOL_APPLICATION_MAIN_WINDOW_WIDTH, diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py index 90e702b997..e99bf5d441 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/resource_mapping_tool.py @@ -13,13 +13,16 @@ from argparse import (ArgumentParser, Namespace) import logging import sys +from utils import aws_utils from utils import environment_utils from utils import file_utils # arguments setup argument_parser: ArgumentParser = ArgumentParser() argument_parser.add_argument('--binaries_path', help='Path to QT Binaries necessary for PySide.') +argument_parser.add_argument('--config_path', help='Path to resource mapping config directory.') argument_parser.add_argument('--debug', action='store_true', help='Execute on debug mode to enable DEBUG logging level') +argument_parser.add_argument('--profile', default='default', help='Named AWS profile to use for querying AWS resources') arguments: Namespace = argument_parser.parse_args() # logging setup @@ -50,6 +53,7 @@ if __name__ == "__main__": from manager.thread_manager import ThreadManager from manager.view_manager import ViewManager from style import azqtcomponents_resources + from style import editormainwindow_resources except ImportError as e: logger.error(f"Failed to import module [{e.name}] {e}") environment_utils.cleanup_qt_environment() @@ -69,9 +73,12 @@ if __name__ == "__main__": except FileNotFoundError: logger.warning("Failed to load style sheet for resource mapping tool") + logger.info("Initializing boto3 default session ...") + aws_utils.setup_default_session(arguments.profile) + logger.info("Initializing configuration manager ...") configuration_manager: ConfigurationManager = ConfigurationManager() - configuration_manager.setup() + configuration_manager.setup(arguments.config_path) logger.info("Initializing thread manager ...") thread_manager: ThreadManager = ThreadManager() diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/style/editormainwindow_resources.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/style/editormainwindow_resources.py new file mode 100644 index 0000000000..fb819cac34 --- /dev/null +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/style/editormainwindow_resources.py @@ -0,0 +1,27147 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" + +from PySide2 import QtCore + +qt_resource_data = b"\ +\x00\x00\x01\x84\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01KIDATx\xdac`\x18\x05\xa3`\ +\x14\x0c&\x10\x91\x90\xe3\x18\x99\x98{\x08\x88\xf7\x810\ +\x90\xbf\x1f\xca\xd6\xa6\x8b\x03\x80\x165\x01-\xfd\x0f\xc3\ +@>\x8c\x1dK\xaf\x10h\x00Y\x0a\xc3@\xfe_(\ +{5\x10\x9b\x01\xf9V@\x1a\x8e\x89\xe4[\x03\xb1>\ +\xa5\x0e\x80\x87\x06\x05|\xf5\x81v\x80\x1e1i\xa0\x01\ +\x1a\xe7\x7f\xa1\x96\xff\x83\xf2o\x00\xf1\x19 \xff\x0c\x88\ +\x86a\x12\xf8\x97\x81X\x85\x9c\x10\x00\xd1\x13\xe8\x99\x0d\ +\xd1\x1d\xf0\x05Hs\x00\xb1\x1b\x10_\x07\xf2o\x02\xe9\ +\x1b0\x0c\x0a\x192\xf8\xb7\x80\xf80\x10\xb3\x12\xe3\x80\ +\x1ah\xd4<\xa4B\x1a@\xe6\xcf%\x94\x06@q\xff\ +\x1d\xea\xa8tX\xba\x80\xa6\x89\xbfhi\x84T>\xc8\ +,)b\xa2\xa0\x0c\xea\xa8gxr\x05\xa9|\xdc\xbe\ +Gs\xc0+ f\x06\xf23)\xb4\x10\x1b_\x94\x18\ +\x07\xe4A\xf9\xaf\xa9\xec\x80i\x84\xca\x81F\xa0\xa2W\ +@\xcc\x04\xc4i0C(\x8c\xf3\xbf\xd04\xf5\x03\xc8\ +\x97!\x94\x0d\xdb\x81\x8ar\xa0\x8ey\x8a%\x15S\x12\ +\x02\xd3\x88)\x07R\xa0\x96gQ1\xceA\xec_@\ +,A\x8c\x03\x98\x81\x0a9\xa1\x89\x90\x9a\xf9~\x1a)\ +\xa5\xa1\x0a\x10o\x07\xe2\xcd@\x8d\x9b\x81\xf4&\x18&\ +\x93\xbf\x14\x88yF\x9b{\xa3`\x14\x0cZ\x00\x00\xef\ +\xad\x00\xe1,\x84\xf5\xf4\x00\x00\x00\x00IEND\xae\ +B`\x82\ +\x00\x00\x02h\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x02/IDATx\xda\xed\x96\xcb+\xc4Q\ +\x14\xc7\xe7\xe11\xcd\x90\xc9L\x1a\x22e\xe4\x91YL\ +\x13\x8a\xa2lllX\xa1\x94WQ\xc6\xb3\xd8x\xd4\ +\x10\x0bE\x8d\x14\xfe\x03\x0b\x89\xb2\x96\xc4\xc2B\xf2(\ +\x22\x0by,lH\x16\x1e5\x8d\xef\xad\xab\x8e\x99{\ +~\xbfYZ\xfcn};\xbf\xee\xe7\x9e\xf3;\xfd\xee\ +\xb9\xe7wM\xa6\xff0Z;\x07J\xa0\xf5\x96\x8e\xfe\ +a\x8d5\xed\xe0\x1b\xb0\x95\x0c\xb7\x83\x87aW\xc4\xb3\ +j\x0dx\x00l\x13\xea\x8au>\x82\xa2X\x10\x85\xf5\ ++\x82g\x13~\xcf$0.\xb9P\x88I\xe0Jr\ +!/u\xde!/(P\x04\xcf\x80\x22\x92\x9f0\x09\ +t\x93\x04\x82L\x02\x07\x92G \x0f\x056\xa8\x07\x93\ +\x15\xdc\x16\x80\x8bm\x0a\xc2:5\xb6\xa9\x09\xbcY\x83\ +\xa7\x83\x8b\x18>\x931\x8c\xa1(\x90L\x14\x87Uk\ +\x0d\xb8[\x87\xdb\x11'M\xe7=.\xc8\x1c;9)\ +\x8f\xe1\x13\xacC\xe1d\x85\xce\xe51[e\x02W\x83\ +G\xe41\xaba\x12\x5c\x94\xfc\x02\xb2Q\xe7k\xd2\x07\ +j\x15\xc1\xbd\x84\xbf0\x09\xcc\x93>\x10Vp3\xf8\ +\x03iDe43\xd1f_1y\xc8m\x03\xe6\xb7\ +\xc0\xdf`\xc7\x18^\x0c~'^\x02\x952I\x0e\x81\ +\xbdC\xdb\x90%\x16Z\xf4\xeaD\xafF\x12\xac5\xab\ +q\xe2\x8c\xa1*\x8c\x5ch\x19E\xd6\xa6\xb1\xa6\x01\x5c\ +\x5c6\xb8\x0aO\x02\x17\xfdd\x1aJf\x8aX\x1c\xe7\ +5\xa81\xd6y\x9f\x9cs\x9f\x22x\x16\xe1\xb7L\x02\ +#\xa4\x0fL0\x09\x9c\x91>\x90O\xc1\xee\xaf3l\ +\x91\xc2\xd1E\xf8%\x13|\xf07Ih\x94I\xf2X\ +r\xa1\xbc?\xff\x01\xd1\x8e1Y\xaf\xb1\x05U\xe0!\ +\xd8\x1c\x8d>\xd1\xcb\xdd\x86$\xf7\x80\xcfp\xad\xda\x18\ +F/p\xc6\xfd\xa1\xe2\x8b(3\x81\x0b\x89C\xef\xe2\ +\xa3\x9a\xec\x83>\x10\xe0\x146\x85q\x14G\xf5\x0bv\ +\x96\xe1~\xf0gq_\x80\x02L\x82S`\x22\xc6\xde\ +\x9ff\x05pC\xcey\x9d\xc2\xb1\x90\xf0W&\xf8\x02\ +\xe9\x03K\x0an\x01\x7f$}\xa0\x8cf\x1f\x84>e\ +\xa7J\xd5\xf9\x02s\x09|\x81r&I\xd1\xaa\xbf\xe3\ +\xbe\x00\xb9\x94\xea\xd5\x80\xde\xa5\xd4\x91@\x0d\xb8\xffU\ +\xf1\xff\x00\xf0W\x81\xb2\xb1-\xb20\x00\x00\x00\x00I\ +END\xaeB`\x82\ +\x00\x00\xa1\xcb\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x80\x00\x00\x00\x80\x08\x06\x00\x00\x00\xc3>a\xcb\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0b\x22\x00\x00\x0b\x22\x01\x09\xe1\ +O\xa2\x00\x00\xa1`IDATx^]\xfdg{\ +cI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7\xff\xf3\xf8\xbe\x5c\xae\x17\x01\x84\xa1\x09\x06\x94\xdf\x05\ +\xb0\xec\x00V\x1e`\xc0\xfdX\xa1\xc8\xa0\xbfk\x07\x81\ +\xf5c\x91\x22\x81\x22^\x11\xbcO\x0e\xe4+\x02\x10\xb3\ +\x01\x81<\x81\xbf\x1be8\x10\xcc\xa3\x10\xb2\x8a\xa6i\ +^\x91\x16\x14\xd36\x8f\xa5.;\x00\x04\xfb\xb9\xbf!\ +\x5c\xff(\xd6?\x8er\xc6\xb1\xf81<\x8d\xae\xad\xeb\ +b\x9d.,\xc1I\x1c\x08\xb8v\x90{\x91\xe2B\xc3\ +x\x80\xa1\x1b\x84\xa7#>\xb7\xcd\xf5V\xb9\xc6\x9c%\ +\x13V\x92\x1a&-\xb9i\xd2R[QL\x07\xdc\xa7\ +{\x01O\xb6\x0a@7p\xfbx\x9ba\x80\x06\x00\xc2\ +|G\x18/\x12\x22\x94\xb8\xf0\xd2\xb5A&\xb5l~\ +B\xa4\xafe\xc2e0\xe9MCp$\xa4i\xd8\xd2\ +\x9bG\x10~\xd7\x0c\x81n!\x93j\x01\xd4N\xf43\ +\xc4\xba\x15\x92\x0d\xf1\xcdh\x9b\xe6\xbeg\xe0Cs\x5c\ +{\x1e\xa3\xc0\xdb\xe1\x192\x07\x00\xe3\xe0\xba\x85F\xb6\ +\x00\xc5>`8f\xdc\xd1#\x844\xa6d\xe99\xee\ +\x82\xb4E\xc4N`\x90\x92\xb1\x8c\x5c,$g\x00\xa5\ +\x22a$$w\x89\x84%X\xb0'\xfc\x9e\x18\x1c\x92\ +E\xe1\xf6\xb2Qz\x16J\xce\x82\x99\x07Qz\x10\xab\ +\xcf&\x04\xc8\x0b8\x00\xf0\xf7<\xbe+\x0f\xb7\x9b;\ +\xc25\x88{\xd1\x09b-7\x94=\x86\x8b\x1f\xc1\xda\ +\xf9[\x00\x92\x17 \xfe\x06 _\x01\xdc\xaf\xdc\xac\x06\ +\xdb\x01\x00R&\xab\x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p\ +_J\x19\x03\xa4\x8e\x01\xcd\x1fh\x1e\x01\x00\x07\x01P\ +\x96\x14\x22\x1e\x00\x07\x099\xc1\xeae\xf9(_\xe1G\ + \xd0=\xf8\xbb\x15r\xf8^R\xc9\xd4&\xd2X@\ + I\xd5|\x88\x14\xa1\xb0\x83b\x94\x02\xfb\xb0\xec\x00\ +\xdcG|\x22\xc2wDG\xb0\xbe\xd1[\x18\x01c\x0d\ +\xe8\xb2\x19\x97L\xc6\xcd\x87\xe7HG\xa1\x9aGI\x11\ +w\xa9A\xe1\xff/IrBv\x03H\xc4q\xc4u\ +R\x95Z7\xa0tB\x9f\xe6\x5c\x04\xc0T\xae\x9b\x06\ +!\xf6\xc2\x11\xe0#\xc2\ +\x00\xd6\xef\xc3\x12\x15\x16\x02()\xa0\xf9\x00\x88[\x90\ +0\x14$\x15\xd5\xe7\xfd|\xb7O\x84\x10o\x91\xc1\xfd\ +g\x10_3p\xe1\xe9m\xb2T\x00\xd0\xbc\x88\xcc\xe1\ +J\x19\x18\xc8\xa2\x14\xe3\xee\xb5\x83g\x121D\xa9\xd9\ +(7\x8c\x92#\x837 dX\xaa2\x02\x5c\xb6,\ +W$Qia\xa6\x00I\xec\xcf\xc0\xfd+\x95\x14\x08\ +\xd2\x9a\x17x%\xad\x15\x0f\x10\x08\xce'\xbf\xd2\x01\x83\ +\xafu\xce\x19N\x08\x8f\x19\xc5S\xe5\xc1w\xf2\xe0>\ +\xb9\x84\xd2\x1c\xee?\x84Qduc`\x18\x8dOJ\ +#e\xd6\xff\xa5\xa3P\x89\xfb\xae\xfaq\x801\x0a(\ +.&\xd1\x06\x01\xc2\x10\xdeA\x80\xe1\xef\x0d\x80\xa7i\ +\x96\xffE\xe0A\x19\x0ay\x18_\x00\xce\x95%oN\ +\x88-\x9c\xbf\x87\xb1C\xee\xb7\xde\x93\x0e~c\x9d\xc7\ +?ZL7\xf9b\xe3\xee\x97V\xbe\xf2\x12rp\x8f\ +\xd8\x08\x19S\xec\x85\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\ +\x96\x1f\xd2D\x0a\x96\x93%\x12E\xa8\xf1D\xef5\xe5\ +\xec)\xd9O\x88\xc9\xe8\x22m\xec\xc4%\x03\xc8t\xee\ ++\x0d7\xac\x05\x1d\xa5\x92Z\xdc\xd14\xafV\x1c\xb5\ +l\x1b\x1a\x85\xe5;\x81\x1b \x11\x18uD\xa1\x82\xeb\ +\xcaC\xe6\x8d\x1dY\xc5\xecukX\xbae\x8d\xcb7\ +\xad~Q\xe3rh\xb9C\xcaL4/\xb1\xe0V\x0a\ +E\xda4\x81#\x00x\x82\x07p\xb3w3\x00`\xd1\ +\xc2\xe7\x0bf\x11 \xc9\xc7{\xe52\xce9\x18\ +\x80\xc0\x1dR\xba(\x10\x88\xb4\xa2\xfcl\x80S\x80\xe1\ +\x96\x93eT\xa2\x97*\xc2^\x05\xa1\xae\x80p\x18\x19\ +\xbd\x83\xdc\x05\xd8\xe8y\xf2!\xfa~l1e\x8b\xcf\ +A\x16\x04f\xe9\x19\xaf\xc4I\xad\x12\xc1de\xcd\x02\ +\x80bH\x94\x0bE\xa5\x14Y\x1fR\x88{*\x87\xc9\ +Vc\x015\x0bw\xac\x1a)S\x09\x94\x06\x08Tf\ +\x8b\x95\xe3\x9e4\xf8YZ~e\xd03yH\x89V\ +\x09E|<\x10\x10\x0a\x00@\x11.\xb3x\x92\x98\xa7\ +%hX\xb3\xbcM\x81f\xcf\xb0\xe0\x5c\xacY\xd7u\ +\xd7\xe6\x1er\x01\xa0\xabA@\x14\x0arP~\x18\xcb\ +\x97\xf2\xc5\xa63\xf9~\x91\xaa\x80\xe6\xf7Q\xb2[g\ +g@\x03\x9aM\xe35\x83\x90\xa4T\xc9\xd5\x0d(n\ +6\xcd\x91?\x93\x81(\xcf\xef\x12q\xd2b\x13 \xe6\ +\xb9%\x99<{&\xd7U\xcdA\x90{q\xec\x19\x0f\ +\xa2\x9c]YL\xfe\xe0\xa6\x95\x8en[\xf9\xd8\xb6\x95\ +\x8emZ\xe1\x90\xc2\x15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\x1b\xde\xb0\ +\xfc>\xe2b7\xe4\xa8\x1bv\xdc\xb3Hl\x5c\xc1S\ +\x00\x94I>7\xb5\xe5^K\xc6\xae\xc2G\xb4\xd4:\ +\x8f\x85\xcc\x03\x809\x0f\x5c\xca\xab5\xa9\xa4\x01&l\ +\xb9B\xd2\xa1\x1b\x907\x88-\xa9k\x81X1n\xb1\ +d\x11\xb7Hl,_~i\x15+\xef\x90\xf7ns\ +H\xf9\xd2+x\x10\xa4xF\xeb#\xca\x904\x01\x04\ +\xb9\x85uk\xa2IdK\xdf-\xf7\xad\x18\x9e\xeeV\ +I=\x00\xfcC\xbc8\x9f\x0e\xbf\xf0a,n\xb9\x99\ +\xf1\xd3\xac\xa6j d\xa9Y2\x0c\xdc~\x96S>\ +\x0aGa\x9a;\xd0\xfb \x0a\xd4\x8a\xa0@\xac\x19\xd2\ +\xf4s\x22\xa9p\x92\x5c\xaf\xbd\x14\xe3\xc8\x98\x93\x94\xfa\ +1\x806\x0e\x18 \x95*<\x01\xfcA\xc69\x1b2\ +\xac\x22S\xd5g\x16\xe1=K\xa7\x0e\x9d\x94\xe0=\x0b\ +\xc75\x8f\xa2*\xafm\x8b\x09\xc2\xca\xe5B\xe5JU\ +\xcf\xa78\xa4\x14-\x97\xf8\xaa\xca\x9d\xdf\x03@)\x9d\ +_h#\x7f\xf55N c\xc88`\x98\xc43L\ +;\xab\x0e\x8a\xed\xa3\x00\x91?y\x82\xb0\x5c\x92\x9bP\ +\x22D\xf0]\x02F6\xee,\x9b\xef\x8b0 \x05<\ +l)\x00\xac\x18\xdd\xb5\xca\xd1\x1d\x00\xb0i\x05}+\ +\x96#\xe5w\xc9K\xccA\x92\x16\x085\xcbV<\xba\ +\x86\xe2\x91\xd1U\x88\xe82\x1e\x02\x0f\xd45\xcb\xf5f\ +\x19`\x00\x80G\xf2\x0aR\x96\x08\x05\xb24\xa5F\x9a\ +\x0d;B\x81\xd7\x01\x806p\xdcE\xf9\x0f\xacl\xe5\ +\xb1U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\xd16\x8a\x82\xa7\ +\xf1 \xcb\x90\xaem\xc8\x17\x00\x02\x00e\x0b\xa4Q\xa4\ +o:\xc2E\x93\x1d\x02\x9b_[\xce\xe5\x165Pd\ +\x1f\x89B3)\xa86bh>B\xed\x5c\xd4\xcc)\ +\x83A\xd0n\xd7 \x9e(8\x827\x80Sh>=\ +\x80'Sv\xa0r\xb74H\x90\x0aJRA{*\ +\x03\x9e\xc2\xa0$\x97\x01\x80\x92FK.i\xb0\x94\xd2\ +&\xa4\x05i\x06\x14XsA\xad\xc5\xe7U\xe2\x05P\ +4^!\x16\xafp%\x0a\x08\x04\x86h\xc1'\x89u\ +\xaf\x85\xee\xef\xb1\xb9\xe5x\x8cZK(l\xc1\xab\xf4\ +\xe0]\x08\x09\x18\x94\xbf\x11\x0e\xc3sd4\xe2\xb5\xea\ +\x15\x93\xb1tU\xe5hM^\x16\xe9J\xc3\xb4\x0dL\ +[\xc1\xcf\x97\xc4U\xc3W\xa6\x9e\xc2C\xeeh95\ +\xad\x8e`\x88\x1a\xff\x0a\xc6\xa9z\xe9\xaeU\xcci\x16\ +\x900;L(\xeb\xd6fU\xc6\xb7E}\x8d\xf0\x96\ +\xcd\x00\x88\xb1O\x82K\xa9c\xba\xf6\x18\xa8\xf8\xf5\x0a\ +\xdf\x7f\xa9\xb4\xd3.\x93\xc5].iCZ\xed\x0a\x02\ +\x00T\xb9\xea\xed\x91SM]:V\xa2\x93?t~\ +]\x1e\xa9\x95:h\x97J\xe9\xb3w\xacR\x87K\xe9\ +\x00\xa2\x19\x08\xde\xd45w\x14\x89\x94\x9f\xab=\xfc}\ +\x9a\xf5\xf3\x8a=\xdc\x9a\x7f\x83J\xadT\xac\xd0\x8b\xd2\ +\xbcx\x99\x0e\x18\x02\xedS\xee\xb3\xf9c{\x84\x80\x9b\ +\x84\x83\x07V\xbd\xf6\x14rH\x96@\x9e+\x82\xa3\xb3\ +\xfeu0\xb5\x80\x90\xa1\xa6\x14\xae\xc7\xae\xca\xb5T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bd\xe8<\xc7\ +\xfb2\xf7\x0f\xe6\x1c\xe5c!G\x1c\xdd\x88\x0e\xe8\x1a\ +\x85\x8f\xea.\xef\x842G\xf0z\x99e\x88\xdb\xbc\x96\ +\xabn\xecx\xf1_\xa0JA\x0d\x0a\x0d\x0a Icons / Noti\ +fication / Error\ + - black\ +\x0d\x0a \x0d\x0a \x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\x0d\ +\x0a\ +\x00\x00\x01u\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01\xd0\xa2K@\xfc\x1f\ +\x84\x81\xfc\xff06\x10\xbf\x02\xf2\xe7\x00i9Z\xf8\ +\xd8\x02\x88\x9f\xa3Y\x08r\xc0_4>\x8c\xddHM\ +_G\x00\xf1?\xa8\xe1 \xfa/\x0c\xe3\xe0\x83\xd5\x02\ +\xf1\x1a \x9f\x91R\xcbA>\xff\x87\xc7\xc7\x84\xf83\ +(u\xc03\x12-\xc4\x16%n\xe4\xc6{>\x11q\ +N\x8c\x03\xae\x93\xeb\xfb\x8b0C\x09\xc49!>\xc8\ +\x0c}r\xf29H\xe3?\x0aC\x00\xc6\xaf!\xd5\x01\ +\x0e\x14Z\x88\xce_C\xaa\x03B\xa8\xec\x80\x03\xa4\xc6\ +\xbf\x0f\x09\xf9\x9e\x984\xb0\x95\xd4\x10P\xa7r\x08L\ +\x22\xd5\x01l\xd0\xb2\xfd?\x95\x1c\x10@N90\x9b\ +\x0a\x0e\x00\xe5\xa2\x9f@\xccDN9 \x0d3\x84\x82\ +4\x00\xd2\xdfBIQ\x5cOa\x08\xdc\x01\xd2\xcc\x94\ +V\xc5k\xc8t\xc0\x1b _\x99\x1am\x01F \x9e\ +\x81\xa5\x01\x82+\xceAl\x90\xcf\x95\xa9\xdd\x1ar\x07\ +\x1az\x13\x9a\xaf\xe1\x8eA\xe3\xff\x04\xc59\x10\xb3\xd0\ +\xb2=\xa8\x0f\xc4\xb5@\xbc\x16h\xd1! \xbd\x1d\x88\ +\xa7\x00q \x90\xcf\xcc0\x0aF\xc1( \x11\x00\x00\ +\x90\xbf\xd0E\xdf\x04S\xa8\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x02\xaa\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x02qIDATx\xda\xedWMHTQ\ +\x14\xd6q,\x0c\x1db\xd0d\xa86\x814!\x11A\ +\x90\x92H\x14\xc4@\xaef\x11\xb5\x10l'\xe4l\xc4\ +\x85\xcb\x1aA\x88@\xc2E0\xad\x1c1h!\xd3\xa6\ +\x7f\x9a\x84\x90hg$$\xb6\xa84]\x88\x039\x8b\ +\x18)g\xf2;\xf0=8\x5c\xdfLo\x86\xb9\xd2b\ +\x1e||s\xcf\xb9\xef\xdes\xbew\xce}o\xea\xea\ +jW\xed*\xe3\xba>0\x14\xbbq3\xf6\x07w\ +\xe9q\x8d\x8fN\x00\x15+\x80\x88E\xbe\x0f\xe0\x97\xe0\ +\xa8\x11\x80\x1f\xf6\xcfF\x9f;\x9c\x01\xb7x\xad\x01\xd8\ +\xafJ{\x82g\xc0>\xbd\xc9)#\xab\x84\x11D\x08\ +\xf8i\xcc\xd9\x06\xcex\xad\x01U?\x82M\xa0IG\ +\x16fF\x1b|\xdb\xc9\xa4Qc\x81n\xd8w\xd4I\ +\x17\xf5\xda\x05\xac\x15\xb9oM6\xe7>M\xfa\xe60\ +#{\x0c\xf4\x02\x05\x8e{\x8cM\xae\xd1>\xec\x92\xa1\ +S\x039\xad\x00~\x1f\x06\xb6\xe8\x93\xb5\xbf\x01\x1b\xc5\ +\x14Hq<\xa0\x14\x09\x19\x1b\x9d.QK\x17E)\ +c\xfe\x0b*s\x8f\xe3\x1f\xa5\x14H)\xdb]\xda\xa4\ +\x00\x0fU\xd8A\x0f\xb8\xc6;\x8e}\x12\xc0?\x15P\ +\xf6I\xda\xbfK\xa1\x96\xd1UG0\xff53\x9f\x07\ +\xfbio\xf0\xac\x80\xf2\xddR5\x91\x04\xce;\xad\xa7\ +\xe6\xc8\xc2\xb2\xe9%9%\xd5\xf7\xc1}\xa0\xde\x98\xe7\ +]\x01\xe5\xef\x90\xd7\xadz\xcfK\xab}\x05/\x81\x97\ +\xc1\xeb\xf2\x1aV\xfeW\xe0\xb3.\xeb\x94\xaf\x80\x91\xe9\ +1`\x10\x90#y\x1e\xf8\x04,\x00r4'\xe4[\ +\x10h/q\xbf\xd4\xc0\xaa\x9b\x02'\x9d\xc8-\x7fU\ +\x1f\xe49\xb1G\x01\xe9\xe1\x1d\xf6\xf0\x09Ko\xd2\x03\ +\xc0C*\xbd\xe06a\x92\xcf\xf0\x17x\x0e\x9c\x06\xa7\ +\xab\xc4o\xc1\x19U#}\xc5\xa2\x1c\x01\x16Y\xa9\xab\ +U\xc6\x0a\xf0\x1e\x88xyV\x8d\x98\xd8Xe\xf6\xff\ +\x97\x7f\xf7v\x01&\xc7\xb3\xa0\x90\xee\xe83\x00\x00\x00\ +\x00IEND\xaeB`\x82\ +\x00\x00\x02\xae\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a Icons / Noti\ +fication / Warni\ +ng\x0d\x0a \ +\x0d\x0a \ +\x0d\x0a <\ +polygon id=\x22Tria\ +ngle\x22 points=\x2212\ + 2 22 22 2 22\x22><\ +/polygon>\x0d\x0a \ + \x0d\x0a <\ +/g>\x0d\x0a\x0d\x0a\ +\x00\x00\x06\x8c\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a Icons / Icon\ + Grid\x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\x0a \ + \ +\x0d\x0a \x0d\x0a \ + <\ +use xlink:href=\x22\ +#path-1\x22>\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x01\x12\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\xd9IDATx\xdac`\x18\x05\xa3`\ +\x14\x8c\x82\xa1\x06\x22\x13s\xd9\x818\x15\x887G$\ +\xe4\x5c\x00\xd2\x87\x80\xb8\x1b\x88Uhn9\xd0BG\ +\xa0Eo\x80\xf8?\x08\x03\xf9\xffal(\xbf\x87\x96\ +>w\xc2b\xe1_4>\x88^F\x0b\x9f\xb3\x03\xf1\ +k\x98\xa50\x0c\xe4\xff\xc3\xc2\x07\xa9\x09\xa2\xb6\xefS\ +q\xf8\x18\x17\xff4\xb5\x1d\xb0\x91D\x07\x800\x0f5\ +\x1dp\x9e\x0c\x07(R3\x0d\x1c\x84&\xb0\x7fD\xa4\ +\x81\xbf\xd0t N\xcd\x10\xe8\x221\x04^\x011#\ +5\x1d\xa0\x04\xb5\xe0\x1f\x91\x0e\xe8\xa0E9\xd0Cd\ +9\xf0\x0c\x889hU\x18-\x83\xc6/,4\x90\xe3\ +\x1cl9\x90V\xa1u]\x10\x04\xca\xe7hE1(\ +\xce;\x81|\x0e\x06z\x01P>\x07Z\xa8\x08\xa4\xc5\ +\xa9\x9a\xe0F\xc1(\x18\x05\xa3\x80\xde\x00\x00*\x106\ +\x97\x13c\xdc\xaf\x00\x00\x00\x00IEND\xaeB`\ +\x82\ +\x00\x00\x01\xf5\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01\xbcIDATx\xdac`\x18\x05\xa3\x80\ +D\x10\x91\x90#\x06\xc4\xd7\x80\xf8jdb\xeeU\x10\ +\x0d\xc47\x81\xb8\x84.\x0e\x00Z\xaa\x02\xc4\xffA\x18\ +h\xe9\x7f\x18\x1b\x88\x17\xd1\xcb\x01\xcaH\x0e\xf8\x8b\xe4\ +\x80\x05#\xc3\x01@KU@A\x0f\xb5\xfc\x1f\x88\x86\ +\xf2\x17\x8c\x98(P\xc4\xe1\x80\xf9\xb4\xb4T\x0e\x88u\ +\x81\x16j\x01\xe9(\x1c\x0e\xd8\x0b\xe4k\x00i\x1d(\ +f\xa1V\x9c3\x02\xf1mX\x96\x83\xc5?Z\x1a\xf8\ +\x8b&\x0f\xc2\xce\xd4\x0c\x01\x17\xa8\xe1\xff\x90|\x8c\x1e\ +\x02\xc8\xf2\x1bi\x11\x0d\xe9h\x05\x0f6\x07\x80\xe8\xab\ +\xe4Z\xc0NDtL'\xe0\x80W@Z\x92\x80=\ +L\xd8\x0cV\x06\xe27@\xc9\x07@\xba\x06\x14\xefx\ +\x1c\xb1\x17K9\x00\xa2\xff\x00\xf9\x16\xf8\xea\x10\xa0\xfc\ +J \xfd\x1c\x88\xeb\xd1]\xa5\x87V\xb6o\xc7\xe3\x03\ +\x1e \xbe\x8f%\x04\xa2\xf0\xe8\x11\x02\xe2gH\xe6\xcf\ +CW\xa0\x8b\xc5\xc0\xe9x\x0c\x94\x05\xe2\x1fH\x06\xb6\ +\x11\x08\xf6#h\xe6\xcf%\xc6\x01 ~\x00\x1eC\x9d\ +\xa1q\xbe\x94\x80\xe5yX\xd2\xcc\x5c\xf4\xf8\xd1\x85\xfa\ +\x069_\x83\xb2\xd47 \xadFA\xce1FJ#\ +\xb04\x03r\x08\xd1!\x00\xa2_\x03\xb1\x12\x99\x96\x7f\ +\xc0\x91k\x88v\x00\x8c\xff\x05\x88#\x88\xb4\x98\x0b\x88\ +\xab\x81\xf8/\x9er\x83d\x07\xc0\xf8\x17\x81t\x19\x10\ +\x9b\x03\xb1(\x90\xcf\x0b\xa2\xa1\xb9(\x06T%\x03\xe9\ +7x\xf4\x93\x94\x06\xfebI\x13\xc8e\xfd\x7f<|\ +l\xfa\xc9J\x03\xb4\xe2c8@\x9b\xce\x0e\x98\x8e\xad\ +t{KDeC-~\x18\xb6\xb2:\x84\x848\xa6\ +\x84\xbf\x1e_m\xa7\x04TT\x07\xc4\x13\x81x\x02\x90\ +?\x01D\xc30\x85\xfc. \xdfo\xb4k\x87\x0e\x00\ +\x0bqL\xd4T\x13W`\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x00\xd5\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00jIDAT8Oc\xfc\xff\xff\ +?\x03%\x80\x09Jc\x80\xc522\xffA\x18\xca\xc5\ +\x09\xb0\x1a@\x8cF\x18\x00{\x01\x9f\x86\xd8'O\x18\ +\xa1L\xac\x00\xa7\x17`\x80\x90k\xc0\x06\x10\xb2\x05\x9f\ +!\x04]\x00\x03 C\xb0\x19D0\x0c`\x00\x97+\ +\x09\xba\x00\xa4\x11\x9f\x17Q\x0c \xa4\x18\x1b\xc0\x99\x12\ +a\xde\x22d \xed\x922\xb1`\xc8\x1b\xc0\xc0\x00\x00\ +\x1d[2\xc1\xc0t\xc2\x0d\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x00\xeb\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\xb2IDATx\xdac`\x18\x05\xa3`\ +\x14\x8c\x82Q0\x14Adb\xae:\x10O\x8eH\xc8\ +\xd9\x0f\xa4\xd7\x00q8\xdd,\x07Z\x1a\x0f\xc4\x7f\x81\ +\xf8?\xd0\xe2\xff \x1a\x8a\xb7\x00\xf9\xcc\xb4\xb6\x1c\xe4\ +\xf3\xbf \x8b\xa1\x96\xc3\xd9P~\x1b\xad\x1d0\x19\xcd\ +Bt\x07\xbc\x05\xd2l\xb4t\xc0~\x02\x0e\xf8\x0d\xa4\ +\x15i\x99\xf8VA\xe3\xfb/\xd4\xf2\x7f06\x10\xff\ +\x03\xf2\xbf\x02i\x11Z\x86@\x18\x81\x108H\x8f,\ +\xb8\x19\xc9\xc2\x7fH\x0e\x00\xf9^\x95\x1e\x0e`\x06\xe2\ +6 ~\x0b\xb4\xf0\x0f\xc8b >\x04\xc4\xaat-\ +\x8c\x80\x96\xb3\x81\x12\x1c\x90\x16\x1d-\x9aG\xc1(\x18\ +\x05\xa3`H\x03\x00\xac\xe7\x98*\x92\x10\x95\xa4\x00\x00\ +\x00\x00IEND\xaeB`\x82\ +\x00\x00\x03\x0b\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x02\xd2IDATx\xda\xed\x97MH\x94Q\ +\x18\x85\xd5i\x0a-\x17\xba0\xcc1!\x88\xc2(\x0b\ +\x92\x5cLFn*\x88Z\x05J(\xd3&*4B\ +\xfbq\xd5\xa2\xc2 \xa4\xb2_Z\xb4\x88\x8aP\x82)\ +\x22\xab\x85\x14Q\x8b\x16\x81\xf4\xb7h!\x16\x95\x05-\ +\x8a\x8a\xd2t\xea\x1c8\x1f\xbc\xdc\xee7)\xe9H\xe0\ +\xc0\xe1r\xee\xf3\xcd\xbd\xef\xf7\xce\xfdy'+k\xea\ +\x83O\xdd\x96\xa6\x1d\xd0\xc1\x10\xb6\x11\xba\x09\x1d\x0e\xe1\ +\xab\xa0\x1b\xd0\xb1\xdaDc\xae\x87/\x86\x92\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fa\xe2\ +a\xee\x14\xdf-\x98\x89\x0c\xc40\xf1\xb020)\x01\ +\x14+\x00\x1e\xc5\xd1L\xa5\xbd\x0c\x93q\xfbm\x85Z\ +\xb5\x06\x86\xa0&\xf6\xc1oC[0\x91o]\xe5\xdc\ +\xef)\xd6\x01\xc6\x0frmLt\xea\x1b\x9c\xa3\xd8\x9e\ +\x9c\xf1L\xfd\xfe\x87<\x01$2\xbd\x08\xaf\x99\xdb\xb3\ +}<\x16X\xceX\x9f\xc7\xc4/\xd0v\xff\xf3\x5c\x18\ +\xe8\xac\xb9>\xbfB\xcfY\xbb\xc17\xa2]\x92f\xa0\ +\xec4\x19\xca\x03\xafA{\x00\xba\x0d\xf5k\xdb\x06Y\ +\x8b\x87\x05\xe0\xde\xe7\xd4\x80J6\x06\xc4A\xe7Cs\ +T\xe5P%\xac\xffY\x09\xa1\xdd\x0f\xdd\x83\xbe\xa4\x19\ +\xef\x8f\x00\xaa\xa0]\xbc\xffY\xfbA\xd7\xa1\xb7\x7f\x19\ +`\xb4\x9e\xe5\xfaS\xd5\x98mh[tn\x14\x8df\ +\xa1\xf1-\x1b\xa0+P\xbf\xa9\xf9l\x9d\xefz\x9e\x0b\ +\xbd,V\xe0\xd7\xa0\x9d1\x9e'\xe1L\x0cZ\x01\xad\ +\xe3\xff\x07\xf8z\xd6\x8c\xacx\xa1\xd5,F\xd0N\x9b\ +\xfa\xb3;\x96\xcfo\xe5\xb5\xdc\x8eP\x05\x84\xb2\x00\x00\ +\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xe0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00uIDAT8O\xd5R\xed\x0e\ +\x80 \x08\xd4\xd6{\x83ON\x9d\x03\xe7,\xd0\xd5\xfa\ +\xd1m|(p\x0a\x9aE$\xbd\xc1\xa6\xf6\x82R\x8a\ +@t\xe9\xe2\x96\x00\x85D\x94u\x19b\x87\x1aOZ\ +-\xae\xc0\x0c\x98\xf94R\xfdQ\xa2\x18\xa49OI\ +\xdc!\xf6@K\xeeP\xc12;=\x8aWe\x09c\ +rTh\xd2Z\xb0\xa7\xb3\xeb\xea\xf6\x14\xeeO4\x92\ +\xd9\x93~\xf7\x95W\xf1{\x82\x94\x0e\xd4\x89\xe2k\x0c\ +\xdb\xee*\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xa6\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00mIDATx\xdac`\x18\x05\xa3`\ +\x14\x8c\x82Q0\x0a\x86*\x88L\xcc\xad\x89H\xc89\ +\x07\xa4\xd7\x00\xb1\x14\xbd-\xaf\x05\xe2\xff@\x07\xfc\x07\ +\xd1@\xfc\x98\xde\x0e8\x03u\xc0_\xa8\x03@X\x85\ +n\x0e\x00Z\xbc\x1a\xea\xfb\x7f@\x1a\x84A\x8e\xe1\xa2\ +g\x08H\x82\x82\x1d)\x0aR\x07$!\x02\x1d\xa0\x02\ +\xb4\x9ck4K\x8e\x82Q0\x0aF\xc1(\x18\xd2\x00\ +\x00e^3\xba\x9ez\xe49\x00\x00\x00\x00IEN\ +D\xaeB`\x82\ +\x00\x00\x00\xef\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\xb6IDATx\xdac`\x18\x05H \ +21\x97\x11\x88C\x81\xb8\x18\x88\x0b\xa9\x88\x8b\xa0\xd8\ +\x05\x9f\xe5\xdc@|\x19\x88\xff\xd3\x18o\xc0\xe5\x80i\ +d\x18\xf6\x1b)\xe4\xf0a\x16 \xf6\x01\xe27P}\ +)\xd8\x1cp\x85\x0c\x07\xfc!1\x8aM\xa1\xfaVb\ +\x93\xbcFk\x07@\xed\xf9\x00\xc4\x9b\x06\xd2\x01\xcf\x06\ +\xda\x01\xcfG\x1d0\xea\x80Q\x07\x8c:`\xd4\x01\xa3\ +\x0e\x18u\xc0\xa8\x03\x06\xad\x03\xae\xd3\xa1Q\xca\x8e\xb3\ +i\x0e\x14\xdcK\x07\x07\xac\x83\xea\xeb\xc6&iEf\ +Gc\x11\x10/#\x80W\x01\xf1{\xa8\xfa\xaf@,\ +\x8e\xcb\x85\xd6@|\x08\x88\xef\x92\x80\x1f\x10\x89\xef\x01\ +\xf1\x16 V\x1c\xed\x04#\x03\x00u\xbb\x07\x04\xef\x85\ +8\x87\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xfe\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00\x93IDAT8O\xa5\x93[\x12\ +\xc0\x10\x0cE\xb1\x0d\xb6fs\xb55]G;!\x94\ +4\x8f\x0fg\xa6\xa3&rs\xe3\xe1\xaf\x18\x1fw@\ +\xc8w\xf5\xf8\xbf\x91k\xf5\xf0\xe1T$\x94\x98~\x0e\ +\xb4D*\xdcZ\xd0\x12J\xfa\x0a\x80[Z0\xe0(\ +\xb2\x8asn\x9b\xc0Z\x85Csh:\x18\xd0\xde\x07\ +\xe6\x1e\x0c$\x97\xa6\x03H\xd4Z\xdc\x04\xac\xc5\x1c\xe2\ +M\x1cmi\x82p\xacS\x80;\xe3\x15)\xdeZ\xe0\ +\x82tc!\x0e\xebp:\xe9\xf7@\xa9\xbc\xc2\xad;\ +\x7f\x8d8\xaap\xd6;\xce\xbd\xfa\x8fW\xbc\x9c\xc2\xae\ +\xed\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\x8b\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00RIDATx\xdac`\x18\x05\xa3`\ +\x14\x8c\x82Q0\x0aF\x01\x99 21\xd77\x22!\ +\xe7.\x90\x9e7P\x0e\xb8\x0bt\xc0\x7f \x0d\xc2\xa6\ +tw\x00\xd0\xf29 \xcb\x81\xf4+ \x16\x1c\x90P\ +\x00Zl\x0at\x84\xe0h\x82\x1c\x05\xa3`\x14\x8c\x82\ +Q0\x0a(\x01\x00\x9bf\x16\x9e7\xad\x98\xae\x00\x00\ +\x00\x00IEND\xaeB`\x82\ +\x00\x00\x02\x02\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01\xc9IDATx\xda\xedW\xbbJ\x03A\ +\x14MLc)XJTD\x91\xd8\xf9\x016V\x82\ +A4I\x13AH\xc4\x80\x8d\x96\x96NZ\xbf\xc4\xca\ +GH\x14T,\xf4\x17\xfc\x89<\xf0E\xea\xac\x9e\x0b\ +we\x18fwgv\xb2\x09B\x16\x0e7\xb3\x99\xdd\ +{\xee\x9c3\x8fM\xa5&\x97\xe3\xb5_=M\x8f+\ +\xf1N\xb9z\xd2F\xec\x03g#M\x8e\xc4\x05\xe0G\ +\x81\x18U\xe5%\xc0\x03(\xe9\x80\xa2\x8f\xc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d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00eIDAT8O\xd5\x91Q\x0e\ +\xc0 \x08Cq\xd9\xbd\x99'g\xe9\x06\x06q&\xea\ +\xcf\xb6\xf7SBLmC\x12\x11\x029\xe7{\xe8\xc0\ +\xcc\x09o\xa0\xba\xba\xd8T\x87\x89\x1fM\x1b\x00o2\ +UA\xc7\x8aa\x83\x88\x19.U\xf0\xec\xaa\x85^T\ +#&}\xbfBc\x00gs\xe7\xa3\xd6'~p\x05\ +$\xf3\xbb\xef]\xa1$X\x83\xe8\x04\x88\xd4H\x07\xd8\ +\xd9\x12\x13\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01/\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00\xc4IDAT8O\xa5\x92\xd1\x0d\ +\xc3 \x0cD\x01E\xcd\x10\xcd\x0e\xedB\x99.\x0b\xa5\ +;\xa4CD\x8d\x94\xf6\x5c\x83\x8ck\xc3G\x9fD\x04\ +\x0e\x1cg\x9b\xf8Z/g\xf8\x834\xdc\xf7\xc8\xf3\x8a\ +\xe1\xb6G\x0c^\xba\xa4c\x1d\x7f\x1c@t\x99&\xd3\ +\x99\x16N\xf8\xe4`\x1e\xcb\xd59\xfc\x11>\x1e\xe3\x89\ +\xc1\xa1@5\xa0C\xce\x8d\xf3s\x8b\x96\xcb\x0c9\x80\ +\xe2\xbcmf\xbep\xe3\xd5\x09\x90@\x0f\x12\xe1\xf48\ +T\xe8\xa7\xc0\xced\xde\x92\xca\x016\xcbT0\xd7E\ +\xd3\x14\x01\xb9\x19\x85\xe3p\x17\xf7%\xe6|[\xb7\xa3\ +\xb8\xc5\x81\xae\xb4\xb6nu\x02\xed%\x01z \xaa\xd7\ +\xba\xe2\xf8o\x89\x90@\xeb\xa1H\xac}U\x17$\xad\ +\xdc%\xae\x80\xc4\xb2\xfe%\x847o\x1ay\x8cB\x12\ +\xd5\x15\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\xe6\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01\xadIDATx\xda\xedW\xcdJ\xc3@\ +\x10\xeeK\x88 ^D\x11\x11\xd1\xda\x1f\x22^l\xd2\ +J\x9e\xa1\xde\x0az\xb3\x82\x17\x05\x1f@(\xf8\xb0\x05\ +\x1blS\xd38\x1f\xec\xc2\x12v6\xbb\x9b\x04`\xb8]\x8e\xe6\xb0\xd8\xa2\x0cO\xb8\xcf\x02\x12\ +\xde\x97\xf4\xab\xc9y\xcaq;\xc8\x0a\x8c\xc9\xd4\x04\x1c\ +9\xb1u\xe0\xd4\xc0\xfd\xa1E\xcdp\xb3\xe3\xc6%\xff\ +\xcfJNe\xce#\xdb\x01&\xe6\xbf\xaa\xbf\xf0\xa9\x83\ +'\x91\xd3\xad\xeb<'\xf9+DB\xe8/\xaat\xc2\ +\x19]p\xe0\xc9\x1f\xf8eu\xd1\xfe\xb7h\xd7\xbf_\ +\x7f\xb3\xb1^\xeamg8\x00\x00\x00\x00\x00IEN\ +D\xaeB`\x82\ +\x00\x00\x00\xd0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00eIDAT8O\xd5\x91Q\x0e\ +\xc0 \x08Cq\xd9\xbd\x99'g\xe9\x06\x06q&\xea\ +\xcf\xb6\xf7SBLmC\x12\x11\x029\xe7{\xe8\xc0\ +\xcc\x09o\xa0\xba\xba\xd8T\x87\x89\x1fM\x1b\x00o2\ +UA\xc7\x8aa\x83\x88\x19.U\xf0\xec\xaa\x85^T\ +#&}\xbfBc\x00gs\xe7\xa3\xd6'~p\x05\ +$\xf3\xbb\xef]\xa1$X\x83\xe8\x04\x88\xd4H\x07\xd8\ +\xd9\x12\x13\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\x05\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00\x9aIDAT8O\xa5Sm\x0a\ +\x80 \x0c\x9d\x12\x05]\xa6\xdf\x9d\xa6\xb3u\x9a\xfe\xd6\ +e\x82(\xb0&j*\xfb\x08z0\xd6\xb4\xbd\xf7&\ +j\x9cs\xf0\x07\xf6\xda:\x92a\x99z\x87\x11J\x16\ +\xb6\x19\x0e\x13\xbe\x13\xa4F\x14\xccE\xfd\x08R\xc38\ +\xefI\x00\x1bkA\x1b2\x8b\x9c\x9cr\xeb\x09r\x15\ +\x0a\x92C\xd5A\x04\x92PD\xea\x19Dp.U\x07\ +\xd8(\x8dX\x10h?S`ob\x1cK\x22\xf4\xf7\ +\x01\x090\xce\xb5}\xd2[\xd7\xc1\xed\xb3\x9b_\xd7\x8a\ +\x22\x0f\xcdQ\x8c\xff\xaf1d\x11\xdc\x8b\x05\x00\xb8\x01\ +\xef\x94\xd6@\xd4\x8c1\xa7\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x01\x88\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01OIDATx\xdac`\x18\x05t\x00\ +\xd1I\xb9<\x03iy\x03\x10\x7f\x04b\xc9\x81\xb0<\ +\x0c\x88\xffC\xf1m f\xa7\xa7\xe5\xe6@\xfc\x17\xc9\ +\x01 \xbc\x9b^\x96K\x03\xf1k4\xcba\xb8\x9f\xd6\ +\x963\x02\xf1\x1d\x1c\x96\xc3p<\xad\x1d\xe1\x01\xc4\xbe\ +@\xec\x0e\xc4\xb7\xa0\x966\x01\xb1\x17\x10\xfb\x03\xb1\x12\ +=\xd3\xc2\x09\xa8\x03<\x07*\x1b\x9e\x84:\xc0\x87X\ +\x0d\xea@\xcc\x0f\xc5\x1aP>>,\x0f\xc4,@,\ +F\xb1\x03\x80\x8av@\x15\x17B\xf1\x7f\x22\xf0U \ +V\x80\xb2\xb7\x90\xed\x00\xa0\x02\x0e \xfe\x0aU\x9c\x0b\ +\xc5\xc48\xe0\x1c4\x14`|\xb5\x81v\x80\xfa\xa8\x03\ +\xd0\xcc=\x0b\x15\xf7\x1d(\x07\x14\x03\xf1Jtq\xba\ +9\x80\x94\x02c\xd09\xa0\x80H\x07\x5c\xa6\x85\x03\xf2\ +\x80X\x18\x88\x83\x818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_\ +\x9c*>0\xcf\xbb\x14\x9e\x01\xa1\xbb\xb5H\xe5G<\ +(\x14*\xfb\xc7#a\x9c\x19\x8a\x90=7?\xa3;\ +\xfd\xfe\x02\x18\xfc\x86\x85\xa5`T\xfb\x00\x00\x00\x00I\ +END\xaeB`\x82\ +\x00\x00\x00\xfc\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00\x91IDAT8O\xa5S\x81\x0d\ +\x80 \x0c\x03b\xf4\x1c\xff\xffB\xcf1\x9a\xa0%T\ +q\xbaa\xa4I\x1dts\x14P\x1fct-\x08\xdb\ +<\xbcv\x80\xae\xe5n\x80\x03\xc9u\xea\x8fp\xc5\x92\ +\xd0J=mA\xae\xd4\x8d\x8bG\x84\xce1 \xe7\x09\ +\xec\xca\x8e\x92V\x0e<\x07\x7f\x9b\x84l\xc4\x04l\xab\ +\x87\x8a.\xb5\xd5\xad|z\xb0@\x16[/\x92\xe7\x16\ +x\xc2\xb4\x9b\xe5*\xd4/\x91M\x1e\xd7V \xd5\xd0\ +J\xcd\xae\x96W\x93_\xb5\xdb\xa4d\xcd\x11\xd9\xfe7\ +\xe6hB\xbf\x15\xe7v\xf1\xcd\xb3\xd1w\xeb$X\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x02\x14\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x01\xdbIDATx\xda\xed\x97\xbfKBQ\ +\x14\xc7E\xa1!\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f7\xd8@\xd0\ +1I\x97u\xcf@\xdaB\xfe-\xf2\xef\x11'A^\ +\xf7\x0cd,\xe4\xd7[\x10\x06y\x1d-\x08\x0b\x06\xd2\ +\x16\xf2\x0f\x91\x7fL\xefy\xf0 \xbc\x8c\xda6\x10\x14\ +\x0c|\x81\x1b*3b\x03I\xd3A\x95C\xbc\xa67\ +\x1f\x1bxC\xec\xfb\xcbo\xb8m,r\xc6$\xa1\x93\ +F\xacc\xae)?\x01\x1d\xb0\xff\x0b\xfe\xbb\xeb\x1b\xc9\ +\xfb\xd7\x13\xad&L\xa9\x00\x00\x00\x00IEND\xae\ +B`\x82\ +\x00\x00\x00\xd0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00eIDAT8O\xdd\x93\xd1\x0a\ +\x800\x08E]?.~\xb9atc\xc55\xad\x97\ +\xa0\xf32\x86\xf3p\x057\xdc]\x18f\xc6\x0b;\xaa\ +:\xe2<\x04s\x03\x8aA&\xc2\x9be\xbb]\x88&\ +4\xce2\x06\x15\x80\x8e\xe4V\x10d#\x80RP\xf1\ +Z\x80d\xdf%\x00\x7f\x12T\x1b\x97qJ\x10\x92\xa7\ +\x22:BG\x84z\xfa\x9d{\x88\xac\x1d\xf5-\x8f\xc3\ +r\xe1\x95\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x04M\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x04\x14IDATx\xda\xcdW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HDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00eIDAT8O\xdd\x93\xd1\x0a\ +\x800\x08E]?.~\xb9atc\xc55\xad\x97\ +\xa0\xf32\x86\xf3p\x057\xdc]\x18f\xc6\x0b;\xaa\ +:\xe2<\x04s\x03\x8aA&\xc2\x9be\xbb]\x88&\ +4\xce2\x06\x15\x80\x8e\xe4V\x10d#\x80RP\xf1\ +Z\x80d\xdf%\x00\x7f\x12T\x1b\x97qJ\x10\x92\xa7\ +\x22:BG\x84z\xfa\x9d{\x88\xac\x1d\xf5-\x8f\xc3\ +r\xe1\x95\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00;\xfb\ +\x00\ +\x01\xa2\x08x\x9c\xed]\x09\x5cL\xdf\x17\x7f-\xb4 \ +\xc9\xde\xa2\xc5RD%\x7f\x89HB\x96(;E\x14\ +\xd1\x0fQ\xb4\x92(B\xd6V*d/E*[Q\ +hAE\x08\xadZ\x94\x92\xd4\xb4\xafS\xcd\xf4\xfe\xf7\ +\xbey\xed\x13M\xcd\xd4\xc4\xdc\xcf\xe7+\xaff\xde;\ +\xf7\x9e\xfb\xce=\xf7l\x17A\xd8\x90\xfe\x08ll\x88\ +\x18rI\x18Av\x80\xff\xdb\xd8P\xae\xa5\xb8\xd9\x10\ +D\x04ATT\xf0kU\x04\x91\x1a\xcf\x86\xc8\xc9Q\ +\xae}\xc6#\xc8\x0a\x03\xf0?1\xfc\x9a\x1fA\x88g\ +\xd9\x10~~\xca\xf5\x7f\x9c\x08r\xdd\x93\x0d9\xb5B\ +c\xd1 ^A^p\xebAK\x16/X\x05\xff\x0a\ +\xc1\x0d\x1f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xeb\x1e<\xaf\x07>\ +\xa7\xd4U\x0b\xd3\xb9\xe0zU\x1d\xe1\xf9\xbb\xf1kh\ +\xf4\xe1\xc28\x22\xe2\xbb\xfb\xd8\x99$\xf0\xfb\xb5\x89/\ +(\xfe\xd4\xdf\xf3\xaf\x00\x8b\xedv\xd3\xc1\xc6\x16\xae\xb5\ +X\x1c4\xb4\x05\x00]\x03\xc6v\xfca\xfeP\xe6/\ +\xd4\xd9\xb0\xfd[\x8b\xf5to\xa7\xe6ow\xdf\x9fn\ +\xbd\xbf\xddm\xff\x07:J\xaf{\ +\x00\x00_\x84\ +I\ +I*\x00\x08\x00\x00\x00\x17\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x03\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00\x22\x01\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00@T\x00\x00\x12\x01\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\ +\x00\x04\x00\x00\x00\x16\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x17\x01\x04\x00\x01\x00\x00\x00\x17\x0b\x00\x00\x1a\x01\x05\ +\x00\x01\x00\x00\x00*\x01\x00\x00\x1b\x01\x05\x00\x01\x00\x00\ +\x002\x01\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\ +\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\ +\x00$\x00\x00\x00:\x01\x00\x002\x01\x02\x00\x14\x00\x00\ +\x00^\x01\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00R\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\xbc\x02\x01\ +\x00\xfa8\x00\x00r\x01\x00\x00I\x86\x01\x00\x8c\x0d\x00\ +\x00l:\x00\x00i\x87\x04\x00\x01\x00\x00\x00X_\x00\ +\x00s\x87\x07\x00H\x0c\x00\x00\xf8G\x00\x00\x00\x00\x00\ +\x00\x08\x00\x08\x00\x08\x00\x08\x00\x00\xf9\x15\x00\x10'\x00\ +\x00\x00\xf9\x15\x00\x10'\x00\x00Adobe P\ +hotoshop CC 2015\ +.5 (Windows)\x00201\ +7:03:08 11:38:26\ +\x00\x0a\x0a \x0a \ +\x0a pain\ +t.net 4.0.9\x0a \ + 2017-03-0\ +7T11:32:29-08:00\ +\x0a 2017-\ +03-08T11:38:26-0\ +8:00\x0a <\ +xmp:MetadataDate\ +>2017-03-08T11:3\ +8:26-08:00\x0a \ + image/tiff\x0a \ + 3\x0a \ + sR\ +GB IEC61966-2.1<\ +/photoshop:ICCPr\ +ofile>\x0a \ +\x0a \ + \x0a \ + adobe\ +:docid:photoshop\ +:94a27cdb-0433-1\ +1e7-b02d-9f84d9f\ +5a326\x0a \ + \x0a <\ +/photoshop:Docum\ +entAncestors>\x0a \ + xmp.iid\ +:d3f831c7-1693-8\ +248-a9a0-2c4f91d\ +81b49\x0a \ + adobe:docid:\ +photoshop:c7bad1\ +dd-0436-11e7-b02\ +d-9f84d9f5a326\x0a xmp.did:a36\ +4ea4e-2280-ea40-\ +ae73-10beb7a78ae\ +8\x0a \ + \x0a \ + \x0a \ + \x0a \ + <\ +stEvt:action>cre\ +ated\x0a \ + xmp.iid:\ +a364ea4e-2280-ea\ +40-ae73-10beb7a7\ +8ae8\x0a \ + 2017-03-07\ +T11:32:29-08:00<\ +/stEvt:when>\x0a \ + <\ +stEvt:softwareAg\ +ent>Adobe Photos\ +hop CC 2015.5 (W\ +indows)\x0a \ + \x0a \ + \x0a \ + saved\x0a \ + <\ +stEvt:instanceID\ +>xmp.iid:d3f831c\ +7-1693-8248-a9a0\ +-2c4f91d81b49\ +\x0a \ + 2\ +017-03-08T11:38:\ +26-08:00\x0a \ + Ado\ +be Photoshop CC \ +2015.5 (Windows)\ +\x0a \ + /\x0a \ + \x0a <\ +/rdf:Seq>\x0a \ + \x0a \x0a \ +\x0a\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \x0a8BIM\x04\ +%\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x008BIM\x04:\x00\x00\x00\ +\x00\x00\xe5\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x0bprintOutput\x00\x00\x00\x05\ +\x00\x00\x00\x00PstSbool\x01\x00\x00\x00\ +\x00Inteenum\x00\x00\x00\x00Int\ +e\x00\x00\x00\x00Clrm\x00\x00\x00\x0fpri\ +ntSixteenBitbool\ +\x00\x00\x00\x00\x0bprinterName\ +TEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0fpr\ +intProofSetupObj\ +c\x00\x00\x00\x0c\x00P\x00r\x00o\x00o\x00f\x00\ + \x00S\x00e\x00t\x00u\x00p\x00\x00\x00\x00\x00\ +\x0aproofSetup\x00\x00\x00\x01\x00\ +\x00\x00\x00Bltnenum\x00\x00\x00\x0cb\ +uiltinProof\x00\x00\x00\x09p\ +roofCMYK\x008BIM\x04;\x00\ +\x00\x00\x00\x02-\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x12printOutputOp\ +tions\x00\x00\x00\x17\x00\x00\x00\x00Cpt\ +nbool\x00\x00\x00\x00\x00Clbrbo\ +ol\x00\x00\x00\x00\x00RgsMbool\x00\ +\x00\x00\x00\x00CrnCbool\x00\x00\x00\x00\ +\x00CntCbool\x00\x00\x00\x00\x00Lb\ +lsbool\x00\x00\x00\x00\x00Ngtvb\ +ool\x00\x00\x00\x00\x00EmlDbool\ +\x00\x00\x00\x00\x00Intrbool\x00\x00\x00\ +\x00\x00BckgObjc\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x00RGBC\x00\x00\x00\x03\x00\x00\x00\x00\ +Rd doub@o\xe0\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Grn doub@o\xe0\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00Bl doub\ +@o\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00BrdT\ +UntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Bld UntF#Rlt\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Rslt\ +UntF#Pxl@b\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x0avectorDatabo\ +ol\x01\x00\x00\x00\x00PgPsenum\x00\ +\x00\x00\x00PgPs\x00\x00\x00\x00PgPC\x00\ +\x00\x00\x00LeftUntF#Rlt\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Top U\ +ntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00Scl UntF#Prc@\ +Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10cropW\ +henPrintingbool\x00\ +\x00\x00\x00\x0ecropRectBott\ +omlong\x00\x00\x00\x00\x00\x00\x00\x0ccr\ +opRectLeftlong\x00\x00\ +\x00\x00\x00\x00\x00\x0dcropRectRi\ +ghtlong\x00\x00\x00\x00\x00\x00\x00\x0bc\ +ropRectToplong\x00\x00\ +\x00\x00\x008BIM\x03\xed\x00\x00\x00\x00\x00\x10\x00\ +\x90\x00\x00\x00\x01\x00\x01\x00\x90\x00\x00\x00\x01\x00\x018\ +BIM\x04&\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00?\x80\x00\x008BIM\x03\xee\x00\ +\x00\x00\x00\x00\x0d\x0cTransparen\ +cy\x008BIM\x04\x15\x00\x00\x00\x00\x00\x1e\x00\ +\x00\x00\x0d\x00T\x00r\x00a\x00n\x00s\x00p\x00\ +a\x00r\x00e\x00n\x00c\x00y\x00\x008BI\ +M\x045\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\xff\ +\xff\x00\x00\x00\x00\x00\x00\x00d\x01\x008BIM\x04\ +\x1d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008BIM\x04\ +\x0d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x04\ +\x19\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x03\ +\xf3\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x01\ +\x008BIM'\x10\x00\x00\x00\x00\x00\x0a\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x018BIM\x03\xf5\x00\x00\x00\ +\x00\x00H\x00/ff\x00\x01\x00lff\x00\x06\x00\ +\x00\x00\x00\x00\x01\x00/ff\x00\x01\x00\xa1\x99\x9a\x00\ +\x06\x00\x00\x00\x00\x00\x01\x002\x00\x00\x00\x01\x00Z\x00\ +\x00\x00\x06\x00\x00\x00\x00\x00\x01\x005\x00\x00\x00\x01\x00\ +-\x00\x00\x00\x06\x00\x00\x00\x00\x00\x018BIM\x03\ +\xf8\x00\x00\x00\x00\x00p\x00\x00\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\ +\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\ +\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\x03\xe8\x00\x008BIM\x04\x00\x00\x00\x00\ +\x00\x00\x02\x00\x008BIM\x04\x02\x00\x00\x00\x00\x00\ +\x02\x00\x008BIM\x040\x00\x00\x00\x00\x00\x01\x01\ +\x008BIM\x04-\x00\x00\x00\x00\x00\x06\x00\x01\x00\ +\x00\x00\x0a8BIM\x04\x08\x00\x00\x00\x00\x00\x10\x00\ +\x00\x00\x01\x00\x00\x02@\x00\x00\x02@\x00\x00\x00\x008\ +BIM\x04\x1e\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008\ +BIM\x04\x1a\x00\x00\x00\x00\x035\x00\x00\x00\x06\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\ +\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00null\x00\x00\ +\x00\x02\x00\x00\x00\x06boundsObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rct1\x00\x00\ +\x00\x04\x00\x00\x00\x00Top long\x00\x00\ +\x00\x00\x00\x00\x00\x00Leftlong\x00\x00\ +\x00\x00\x00\x00\x00\x00Btomlong\x00\x00\ +\x00`\x00\x00\x00\x00Rghtlong\x00\x00\ +\x00`\x00\x00\x00\x06slicesVlLs\ +\x00\x00\x00\x01Objc\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x05slice\x00\x00\x00\x12\x00\x00\x00\x07s\ +liceIDlong\x00\x00\x00\x00\x00\x00\ +\x00\x07groupIDlong\x00\x00\x00\ +\x00\x00\x00\x00\x06originenum\x00\ +\x00\x00\x0cESliceOrigin\x00\ +\x00\x00\x0dautoGenerated\ +\x00\x00\x00\x00Typeenum\x00\x00\x00\x0a\ +ESliceType\x00\x00\x00\x00Im\ +g \x00\x00\x00\x06boundsObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rct1\x00\x00\ +\x00\x04\x00\x00\x00\x00Top long\x00\x00\ +\x00\x00\x00\x00\x00\x00Leftlong\x00\x00\ +\x00\x00\x00\x00\x00\x00Btomlong\x00\x00\ +\x00`\x00\x00\x00\x00Rghtlong\x00\x00\ +\x00`\x00\x00\x00\x03urlTEXT\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x00nullTEXT\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00MsgeTEX\ +T\x00\x00\x00\x01\x00\x00\x00\x00\x00\x06altTa\ +gTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0ec\ +ellTextIsHTMLboo\ +l\x01\x00\x00\x00\x08cellTextTE\ +XT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x09horz\ +Alignenum\x00\x00\x00\x0fESl\ +iceHorzAlign\x00\x00\x00\x07\ +default\x00\x00\x00\x09vertA\ +lignenum\x00\x00\x00\x0fESli\ +ceVertAlign\x00\x00\x00\x07d\ +efault\x00\x00\x00\x0bbgColo\ +rTypeenum\x00\x00\x00\x11ESl\ +iceBGColorType\x00\x00\ +\x00\x00None\x00\x00\x00\x09topOut\ +setlong\x00\x00\x00\x00\x00\x00\x00\x0al\ +eftOutsetlong\x00\x00\x00\ +\x00\x00\x00\x00\x0cbottomOutse\ +tlong\x00\x00\x00\x00\x00\x00\x00\x0brig\ +htOutsetlong\x00\x00\x00\x00\ +\x008BIM\x04(\x00\x00\x00\x00\x00\x0c\x00\x00\x00\ +\x02?\xf0\x00\x00\x00\x00\x00\x008BIM\x04\x14\x00\ +\x00\x00\x00\x00\x04\x00\x00\x00\x0d8BIM\x04\x0c\x00\ +\x00\x00\x00\x043\x00\x00\x00\x01\x00\x00\x000\x00\x00\x00\ +0\x00\x00\x00\x90\x00\x00\x1b\x00\x00\x00\x04\x17\x00\x18\x00\ +\x01\xff\xd8\xff\xed\x00\x0cAdobe_CM\x00\ +\x01\xff\xee\x00\x0eAdobe\x00d\x80\x00\x00\x00\ +\x01\xff\xdb\x00\x84\x00\x0c\x08\x08\x08\x09\x08\x0c\x09\x09\x0c\ +\x11\x0b\x0a\x0b\x11\x15\x0f\x0c\x0c\x0f\x15\x18\x13\x13\x15\x13\ +\x13\x18\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x01\x0d\x0b\x0b\x0d\x0e\x0d\x10\x0e\x0e\ +\x10\x14\x0e\x0e\x0e\x14\x14\x0e\x0e\x0e\x0e\x14\x11\x0c\x0c\x0c\ +\x0c\x0c\x11\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\xc0\x00\x11\x08\x000\x000\ +\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xdd\x00\x04\x00\x03\ +\xff\xc4\x01?\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\ +\x00\x00\x00\x00\x00\x03\x00\x01\x02\x04\x05\x06\x07\x08\x09\x0a\ +\x0b\x01\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x10\x00\ +\x01\x04\x01\x03\x02\x04\x02\x05\x07\x06\x08\x05\x03\x0c3\x01\ +\x00\x02\x11\x03\x04!\x121\x05AQa\x13\x22q\x81\ +2\x06\x14\x91\xa1\xb1B#$\x15R\xc1b34r\ +\x82\xd1C\x07%\x92S\xf0\xe1\xf1cs5\x16\xa2\xb2\ +\x83&D\x93TdE\xc2\xa3t6\x17\xd2U\xe2e\ +\xf2\xb3\x84\xc3\xd3u\xe3\xf3F'\x94\xa4\x85\xb4\x95\xc4\ +\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\ +\xc6\xd6\xe6\xf67GWgw\x87\x97\xa7\xb7\xc7\xd7\xe7\ +\xf7\x11\x00\x02\x02\x01\x02\x04\x04\x03\x04\x05\x06\x07\x07\x06\ +\x055\x01\x00\x02\x11\x03!1\x12\x04AQaq\x22\ +\x13\x052\x81\x91\x14\xa1\xb1B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\ +\x00o\x00t\x00o\x00s\x00h\x00o\x00p\x00 \ +\x00C\x00C\x00 \x002\x000\x001\x005\x00.\ +\x005\x00\x00\x00\x01\x00\x00\x00\x0cHLino\x02\ +\x10\x00\x00mntrRGB XYZ \x07\ +\xce\x00\x02\x00\x09\x00\x06\x001\x00\x00acspM\ +SFT\x00\x00\x00\x00IEC sRGB\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\ +\x01\x00\x00\x00\x00\xd3-HP \x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11cprt\x00\ +\x00\x01P\x00\x00\x003desc\x00\x00\x01\x84\x00\ +\x00\x00lwtpt\x00\x00\x01\xf0\x00\x00\x00\x14b\ +kpt\x00\x00\x02\x04\x00\x00\x00\x14rXYZ\x00\ +\x00\x02\x18\x00\x00\x00\x14gXYZ\x00\x00\x02,\x00\ +\x00\x00\x14bXYZ\x00\x00\x02@\x00\x00\x00\x14d\ +mnd\x00\x00\x02T\x00\x00\x00pdmdd\x00\ +\x00\x02\xc4\x00\x00\x00\x88vued\x00\x00\x03L\x00\ +\x00\x00\x86view\x00\x00\x03\xd4\x00\x00\x00$l\ +umi\x00\x00\x03\xf8\x00\x00\x00\x14meas\x00\ +\x00\x04\x0c\x00\x00\x00$tech\x00\x00\x040\x00\ +\x00\x00\x0crTRC\x00\x00\x04<\x00\x00\x08\x0cg\ +TRC\x00\x00\x04<\x00\x00\x08\x0cbTRC\x00\ +\x00\x04<\x00\x00\x08\x0ctext\x00\x00\x00\x00C\ +opyright (c) 199\ +8 Hewlett-Packar\ +d Company\x00\x00desc\x00\ +\x00\x00\x00\x00\x00\x00\x12sRGB IEC6\ +1966-2.1\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x12sRGB IEC6196\ +6-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\ +\x00\xf3Q\x00\x01\x00\x00\x00\x01\x16\xccXYZ \x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00X\ +YZ \x00\x00\x00\x00\x00\x00o\xa2\x00\x008\xf5\x00\ +\x00\x03\x90XYZ \x00\x00\x00\x00\x00\x00b\x99\x00\ +\x00\xb7\x85\x00\x00\x18\xdaXYZ \x00\x00\x00\x00\x00\ +\x00$\xa0\x00\x00\x0f\x84\x00\x00\xb6\xcfdesc\x00\ +\x00\x00\x00\x00\x00\x00\x16IEC http:\ +//www.iec.ch\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x16IEC http\ +://www.iec.ch\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00desc\x00\ +\x00\x00\x00\x00\x00\x00.IEC 61966\ +-2.1 Default RGB\ + colour space - \ +sRGB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00.\ +IEC 61966-2.1 De\ +fault RGB colour\ + space - sRGB\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00desc\x00\x00\x00\x00\x00\x00\x00,R\ +eference Viewing\ + Condition in IE\ +C61966-2.1\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00,Reference \ +Viewing Conditio\ +n in IEC61966-2.\ +1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00view\x00\ +\x00\x00\x00\x00\x13\xa4\xfe\x00\x14_.\x00\x10\xcf\x14\x00\ +\x03\xed\xcc\x00\x04\x13\x0b\x00\x03\x5c\x9e\x00\x00\x00\x01X\ +YZ \x00\x00\x00\x00\x00L\x09V\x00P\x00\x00\x00\ +W\x1f\xe7meas\x00\x00\x00\x00\x00\x00\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x02\x8f\x00\x00\x00\x02sig \x00\x00\x00\x00C\ +RT curv\x00\x00\x00\x00\x00\x00\x04\x00\x00\ +\x00\x00\x05\x00\x0a\x00\x0f\x00\x14\x00\x19\x00\x1e\x00#\x00\ +(\x00-\x002\x007\x00;\x00@\x00E\x00J\x00\ +O\x00T\x00Y\x00^\x00c\x00h\x00m\x00r\x00\ +w\x00|\x00\x81\x00\x86\x00\x8b\x00\x90\x00\x95\x00\x9a\x00\ +\x9f\x00\xa4\x00\xa9\x00\xae\x00\xb2\x00\xb7\x00\xbc\x00\xc1\x00\ +\xc6\x00\xcb\x00\xd0\x00\xd5\x00\xdb\x00\xe0\x00\xe5\x00\xeb\x00\ +\xf0\x00\xf6\x00\xfb\x01\x01\x01\x07\x01\x0d\x01\x13\x01\x19\x01\ +\x1f\x01%\x01+\x012\x018\x01>\x01E\x01L\x01\ +R\x01Y\x01`\x01g\x01n\x01u\x01|\x01\x83\x01\ +\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\ +\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\ +\x0c\x02\x14\x02\x1d\x02&\x02/\x028\x02A\x02K\x02\ +T\x02]\x02g\x02q\x02z\x02\x84\x02\x8e\x02\x98\x02\ +\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\ +\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03-\x038\x03C\x03\ +O\x03Z\x03f\x03r\x03~\x03\x8a\x03\x96\x03\xa2\x03\ +\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\ +\x13\x04 \x04-\x04;\x04H\x04U\x04c\x04q\x04\ +~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\ +\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05:\x05I\x05X\x05\ +g\x05w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\ +\xe5\x05\xf6\x06\x06\x06\x16\x06'\x067\x06H\x06Y\x06\ +j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\ +\xf5\x07\x07\x07\x19\x07+\x07=\x07O\x07a\x07t\x07\ +\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\ +\x1f\x082\x08F\x08Z\x08n\x08\x82\x08\x96\x08\xaa\x08\ +\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09:\x09O\x09\ +d\x09y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\ +\x11\x0a'\x0a=\x0aT\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\ +\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\ +\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0c\ +C\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\ +\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\ +\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\ +\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f^\x0fz\x0f\ +\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10C\x10a\x10\ +~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x111\x11O\x11\ +m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12&\x12E\x12\ +d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13#\x13C\x13\ +c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14'\x14I\x14\ +j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x154\x15V\x15\ +x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16I\x16l\x16\ +\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17e\x17\x89\x17\ +\xae\x17\xd2\x17\xf7\x18\x1b\x18@\x18e\x18\x8a\x18\xaf\x18\ +\xd5\x18\xfa\x19 \x19E\x19k\x19\x91\x19\xb7\x19\xdd\x1a\ +\x04\x1a*\x1aQ\x1aw\x1a\x9e\x1a\xc5\x1a\xec\x1b\x14\x1b\ +;\x1bc\x1b\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c*\x1cR\x1c\ +{\x1c\xa3\x1c\xcc\x1c\xf5\x1d\x1e\x1dG\x1dp\x1d\x99\x1d\ +\xc3\x1d\xec\x1e\x16\x1e@\x1ej\x1e\x94\x1e\xbe\x1e\xe9\x1f\ +\x13\x1f>\x1fi\x1f\x94\x1f\xbf\x1f\xea \x15 A \ +l \x98 \xc4 \xf0!\x1c!H!u!\xa1!\ +\xce!\xfb\x22'\x22U\x22\x82\x22\xaf\x22\xdd#\x0a#\ +8#f#\x94#\xc2#\xf0$\x1f$M$|$\ +\xab$\xda%\x09%8%h%\x97%\xc7%\xf7&\ +'&W&\x87&\xb7&\xe8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xafm\x08m`m\xb9n\x12n\ +kn\xc4o\x1eoxo\xd1p+p\x86p\xe0q\ +:q\x95q\xf0rKr\xa6s\x01s]s\xb8t\ +\x14tpt\xccu(u\x85u\xe1v>v\x9bv\ +\xf8wVw\xb3x\x11xnx\xccy*y\x89y\ +\xe7zFz\xa5{\x04{c{\xc2|!|\x81|\ +\xe1}A}\xa1~\x01~b~\xc2\x7f#\x7f\x84\x7f\ +\xe5\x80G\x80\xa8\x81\x0a\x81k\x81\xcd\x820\x82\x92\x82\ +\xf4\x83W\x83\xba\x84\x1d\x84\x80\x84\xe3\x85G\x85\xab\x86\ +\x0e\x86r\x86\xd7\x87;\x87\x9f\x88\x04\x88i\x88\xce\x89\ +3\x89\x99\x89\xfe\x8ad\x8a\xca\x8b0\x8b\x96\x8b\xfc\x8c\ +c\x8c\xca\x8d1\x8d\x98\x8d\xff\x8ef\x8e\xce\x8f6\x8f\ +\x9e\x90\x06\x90n\x90\xd6\x91?\x91\xa8\x92\x11\x92z\x92\ +\xe3\x93M\x93\xb6\x94 \x94\x8a\x94\xf4\x95_\x95\xc9\x96\ +4\x96\x9f\x97\x0a\x97u\x97\xe0\x98L\x98\xb8\x99$\x99\ +\x90\x99\xfc\x9ah\x9a\xd5\x9bB\x9b\xaf\x9c\x1c\x9c\x89\x9c\ +\xf7\x9dd\x9d\xd2\x9e@\x9e\xae\x9f\x1d\x9f\x8b\x9f\xfa\xa0\ +i\xa0\xd8\xa1G\xa1\xb6\xa2&\xa2\x96\xa3\x06\xa3v\xa3\ +\xe6\xa4V\xa4\xc7\xa58\xa5\xa9\xa6\x1a\xa6\x8b\xa6\xfd\xa7\ +n\xa7\xe0\xa8R\xa8\xc4\xa97\xa9\xa9\xaa\x1c\xaa\x8f\xab\ +\x02\xabu\xab\xe9\xac\x5c\xac\xd0\xadD\xad\xb8\xae-\xae\ +\xa1\xaf\x16\xaf\x8b\xb0\x00\xb0u\xb0\xea\xb1`\xb1\xd6\xb2\ +K\xb2\xc2\xb38\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18s\x88\xcc\xcc\ +\x1f\x87\xbaP\xbb\x00MhZ8\x86\xf3\xe9\x12\xbb\x00\ +h\x82\xf0|\x9d\xe5U\x0c\x14=\x87\xb9\xd51Q\x88\ +\xa8\x93G\x96\xc0\xed$$\xa2\x0d\x09\xbaT\x97\xf4\xc8\ +\xbd\x1a\x9fI\xa07O\x88b\x0dDR1\x00P0\ +\x88\x1bUIB`U\x83\x05\x1bW\xa1\xa0]d\x0d\ +\x8a\xf5\xa9\xb359\xc8\x5c0r\x15\xb5\xe8`\xdb\x9f\ +\x07jx\x0b\xd8\x81\xd0\x9bc\x98\x12p\x04\x02\xa1\x94\ +\xe1Wg\x85\x8c\x0b\x07XZ\x88 ik\x90A\x95\ +\xb4>\xa2\x13\x89\x864\x1a\xf7\x092\xa2\x077)\x1f\ +=\x0e\x08\x84\xb6h\x11\x12\xf1\x94<\xda\xb5\x83\xb8\x03\ +\x82U\xa8\xael6`Cj\x85\xd1'QQ\x7f\x84\ +\x87\xde\x04y\xa8\x80\x1e\x0c\x04\x0axI\xa1\x14\x82\x01\ +:\x18y\xe2\x07\x05\x9eU\x85s\xa1\xedx\xcc/\x10\ +X7\x07X\xe9\x22\x887F\xf9\x5c]\xe4\x82\x9a\x99\ +\x8d\x0d\xf8\xe8tH!\x92Q\xfcWf\x01\x99\xdb\x99\ +\x9a\x18\xc3\xe0\xf9\x01\xe2\xb6tkT\xa0\xd2\x1e\x7f\x96\ +Z\x08zth\x86*\x98\x04\xe9\x00\xbet+\x1a\xf7\ +\x98\x22\x86\x17\x9a\x88\xaaoj\x85fl\xf7\xe1\x81D\ +\xce(\x18\xef\x90 \x86h\x87A\x86Y\xec\x82\x06\x5c\ +\xa8\x0a;I\x96\x0a\xed\x81\xa2\x18an\x03#\xcc\xec\ +j\xef\x80\x03Y\x01`\xd6\xd8\x0a\x86\xb7D\xa2\x0c\x87\ +\xe8#\xfe[\x89G\x1f\x0c[\xaa\x827\x14X\x04\x1c\ +h\x9e\x86FF0\xdcjr\x84\x9e\xebx\xd3\xe0\xd8\ +\x87\xcc\x88\x86o<@:\x07\xe9\xf2\xaaQ\xe2M#\ +I\xf2\x11\x97'\xca\xf2\xfdj\xb35\x018H\xa6h\ +\x81\xfd\xa8J\x86\x18=\xc8\xc6\xde\x9b$\xf7]\xdf\xaa\ +\xaf\xc0,\x1ckf4X\x86\x17^H\xa4\xcf\x1c\x05\ +\x7f\x81\xe7\xaa!\xf7\xa4M\x85\x1e\xa8\xc9\x96\xc0G\xe9\ +_\xed\x86\xcc\xd9\xd8gz\x1f\x0a\x92\xc8\x85B\x97\xcc\ +g`\xc0\x18\x0e\x86\x1d\xffi\xad^\x95\xa1\x8d9\xf1\ +~\x8a-\xca\x1c\x91\xd3\xd0\xe2\x88s\xc6i\x02\xffD\ +\x03\xf5\x80E\x05\xf4\x80v\x966\x11\x00 !\x83\xda\ +\x06\x0ef`+\x81\xa4\x0c\x1e\xc3\x9e\x01\xc1Rz\x95\ +\xc2\x10L\x83B\xf1\xe3\x90\xb1\xf5\x07\xc7\x84!\x1e\x03\ +e<\x0fHL8\xc7\x0c)\x16*\xa4m\x0a(-\ +\x0b\xc8\xaa\x1e\x01\x8d \x04\x81d@\x08KH\x0e\x04\ +\x802\x1e\x01\xd8h\x06\x1b\xf8>v\xa0=\xdb\x923\ +\xf89\x05\xd3\x91\x0d\xf0\x88lC\x07\x5c\x87\x80kx\ +\x03p&!\x82f\x18\x0ab\x18$\x87 \x8e\x1a\x01\ +epO\x10x\xee\x1aB\xc22\x03\x96-\x13\x8a\xe2\ +x\x86L\xe1\xbcC\xe6\x90\x05\xa2\xec?\x87\x800\x0e\ +\xb0\xc0O\x1bU(\x19\x80\xa5a\xe4\x8b\xa7\x96g\x9e\ +th(\xcb(\x02\xb7\xb0i\x0eA!\x91\x05q\xda\ +\x1c\x82%\xe6\x04\x95\xc3NQ\x90\xb0P*\xc1\x80\x18\ +d\x11>k\xc0\xaeN\x06\xb0E'\xc2\xa9\xaa\x02`\ +\xbd\x1c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xea+0\xa4\ +\xae\xc1D\xa6\xe7\x1e#jv7\x11\x22\x9d\x81\xbc\x8c\ +!\xaa\x9ef \x1b\xec\xd4\xa92\x12Z\xa4\xf0\xeam\ +\xbe\x09\xa9\x1e\x97\x91\x1c\xa2\xe2\xfc\x1b\x8a\x85\x1e& \ +\x1b\xd1\xfe\xf2\xf2;%\xf2a&2e&ri&\ +\xb2m&\xf2q'2u'ry'\xb2}'\xf2\ +\x81(2\x85(r\x89(\xb2\x8d(\xf2\x91)2\x95\ +)r\x98(\x22\x02\x00\x03\x00\x01\xa0\x03\x00\x01\x00\x00\ +\x00\x01\x00\x00\x00\x02\xa0\x04\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x03\xa0\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\ +\x00\x00\x02\x9e\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a <\ +/g>\x0d\x0a\x0d\x0a\ +\x00\x00\x02\xa4\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Icons / \ +System / Carat /\ + White / Default\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a <\ +polygon id=\x22Tria\ +ngle\x22 fill=\x22#FFF\ +FFF\x22 transform=\x22\ +translate(8.0000\ +00, 8.000000) sc\ +ale(1, -1) trans\ +late(-8.000000, \ +-8.000000) \x22 poi\ +nts=\x228 6 12 10 4\ + 10\x22>\x0d\ +\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x05!\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ standard copy \ +2\x0d\x0a <\ +desc>Created wit\ +h Sketch.\ +\x0d\x0a \x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\ +\x0a \x0d\x0a\ + \x0d\x0a \ + \x0d\x0a\x0d\x0a\ +\ +\x00\x00\x035\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / layer \ +/ default\x0d\x0a Cre\ +ated with Sketch\ +.\x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \ +\x0d\x0a \ + \x0d\x0a \ +\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x04\xa0\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Not active - \ +Default\x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a <\ +g id=\x22icon-/-out\ +liner-/-entity-/\ +-Not-active---De\ +fault\x22 stroke=\x22n\ +one\x22 stroke-widt\ +h=\x221\x22 fill=\x22none\ +\x22 fill-rule=\x22eve\ +nodd\x22>\x0d\x0a \ +\x0d\x0a \ + \x0d\x0a\x0d\x0a\ +\x00\x00\x09\x94\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a <\ +g id=\x22Sky-Icon-/\ +-System-/-View\x22 \ +transform=\x22trans\ +late(-1.000000, \ +-1.000000)\x22>\x0d\x0a \ + \x0d\x0a \ + \x0d\ +\x0a \x0d\x0a <\ +path d=\x22M7.06342\ +091,12.9074237 L\ +7.88176629,12.08\ +90784 C8.2054235\ +6,12.1935613 8.5\ +5066739,12.25000\ +46 8.90909425,12\ +.2500046 C10.754\ +2281,12.2500046 \ +12.2500046,10.75\ +42281 12.2500046\ +,8.90909425 C12.\ +2500046,8.550667\ +39 12.1935613,8.\ +20542356 12.0890\ +784,7.88176629 L\ +13.4371592,6.533\ +68547 C14.319022\ +1,7.17645386 15.\ +2844155,7.968256\ +79 16.3333395,8.\ +90909425 C13.022\ +4727,11.8787923 \ +10.5438307,13.36\ +36414 8.89741345\ +,13.3636414 C8.3\ +7051833,13.36364\ +14 7.75918749,13\ +.2115688 7.06342\ +091,12.9074237 Z\ + M5.69216773,12.\ +1787833 C4.48306\ +461,11.4370945 3\ +.08062505,10.347\ +1982 1.48484904,\ +8.90909425 C4.78\ +014139,5.9393961\ +7 7.25099619,4.4\ +5454713 8.897413\ +45,4.45454713 C9\ +.76312087,4.4545\ +4713 10.8589211,\ +4.865077 12.1848\ +142,5.68613676 L\ +11.2977095,6.573\ +24152 C10.691167\ +6,5.95308542 9.8\ +450802,5.5681839\ +1 8.90909425,5.5\ +6818391 C7.06396\ +042,5.56818391 5\ +.56818391,7.0639\ +6042 5.56818391,\ +8.90909425 C5.56\ +818391,9.8450802\ + 5.95308542,10.6\ +911676 6.5732415\ +2,11.2977095 L5.\ +69216773,12.1787\ +833 Z M8.8358430\ +8,11.1350016 L11\ +.1461965,8.82464\ +811 C11.1472437,\ +8.85266758 11.14\ +77719,8.88081938\ + 11.1477719,8.90\ +909425 C11.14777\ +19,10.1391835 10\ +.1480347,11.1363\ +678 8.91479629,1\ +1.1363678 C8.888\ +36881,11.1363678\ + 8.86204856,11.1\ +359099 8.8358430\ +8,11.1350016 Z M\ +7.3616286,10.509\ +3224 C6.94241377\ +,10.1044297 6.68\ +182069,9.5371166\ +3 6.68182069,8.9\ +0909425 C6.68182\ +069,7.67900503 7\ +.68155792,6.6818\ +2069 8.91479629,\ +6.68182069 C9.54\ +237304,6.6818206\ +9 10.1094814,6.9\ +4005568 10.51514\ +44,7.35580661 L7\ +.3616286,10.5093\ +224 Z\x22 id=\x22Combi\ +ned-Shape\x22 fill=\ +\x22#E9E9E9\x22>\x0d\x0a <\ +polygon id=\x22Rect\ +angle-25\x22 fill=\x22\ +#E9E9E9\x22 transfo\ +rm=\x22translate(8.\ +582044, 8.280986\ +) rotate(45.0000\ +00) translate(-8\ +.582044, -8.2809\ +86) \x22 points=\x227.\ +7813425 0.916636\ +365 9.38274632 0\ +.913653421 9.358\ +23763 15.6483178\ + 7.7813425 15.61\ +58919\x22>\x0d\x0a \x0d\ +\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x05\x1f\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ Editor only -\ + Saved\x0d\x0a\ + Create\ +d with Sketch.\x0d\x0a \x0d\x0a \x0d\x0a \x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x00\x02\x9e\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a <\ +/g>\x0d\x0a\x0d\x0a\ +\x00\x00\x05#\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ Editor only -\ + Updated\ +\x0d\x0a Crea\ +ted with Sketch.\ +\x0d\x0a \x0d\x0a \ +\x0d\x0a \ + \x0d\x0a\ + \x0d\x0a\ +\x0d\x0a\ +\x00\x00\x06\x09\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / lock /\ + on\x0d\x0a \ + Created w\ +ith Sketch.\x0d\x0a \x0d\x0a \ + \x0d\x0a\ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\ + \ +\x0d\x0a \ + \x0d\x0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i'\x19\x9f*<8\x96F\xe9\x5c\ +@\x9f\x0c\xd1\xe8\x8c\x82\x92h(L\xd1\x1bh(\xdd\ +\x0c\x13E\xc2\x87\x1c\xa5RbS\x1d\xa6q\x10\xfe\x01\ +D\xa7A\x06\x90\x0fM:\x1eD\x032\xe8\xf6@\xcc\ +\x07\xf2s'%\x13\x22O(%\x83|\xd4\x08\x1e\xf3\ +iL\x82\x892\xd2&\xe1\x97\x00D\xec,\x923\xcb\ +\x80\x99L\xcb\x83\xda\x9f\xcd\x09;\xaa3\x85I\x01`\ +\x82\x84\xb3\x92:n9\x00 \xa0KR\x06\xac:\xa5\ +O\xa9-\x02\x91G\xa30\x86\xf2 \xa0m\x14\x93\x9e\ +\x8f\xf8\xa3\x01\x17\x89M*\x92T\xe9\x1d.\x8dPb\ +*@X\xa0\xa0M>\x98\x1f\x0e\x18\x9cL\xd7\x05\xda\ +KT\xa4U\xe2=U\xa2\xb4\xcc~\x82V\x08 \x10\ +\xa99\xa8!X\x82\x96\xef\xf9\xc2\x06Z\x07!\xebi\ +\x9f\xee\x1b`\xd8\x97\xa8(8\xae\x1f\x08(\x9f$\x17\ +H\xf5|\x8e\xdch\xe5\x80\x88>c@\x8e\x7f]\x94\ +=\x8c\xa6\x1c\x00\x15\xe4:\x02\xf7\xa9_0\x103\x15\ +\x83\x1e\x9b\x88(F\xb1\x1f\x17\x90\x04(\x13\x18)r\ +\xcfO\xe9\xf5\xca\x8d\xdc\xe8\x5c\x184\x86\xb0y\xfa`\ +\xd6*a\x18\x05\xe3\x03\xf1\x1f\x8d\x9e\xe8\xf53~\xa0\ +\x97\xfa\xcf\x16\xa0\x81\xfc\x90f\x22\xd8^\x11\x0f(\xb8\ +j\x0dL\x83\xc8)\x92\x82\x83\x0a5\xf4\x00\x0d\x92A\ +.\x94\xe3\xf7\xf2\xdcs\xbf\xe1\xbc\x04\xf5\xa29R3\ +\xa3#\x18h\xdb\xa5\x81\xc7\xce\x9cb\xa0\xa1b\x8e\xe1\ +\x8c\x95\xc12N\xa5\xf9\xeeB\xba\x1a@~\xbc\x1e\x11\ +{\x09\xe6\x87i\x08\xbe\xca\x8bR\xe9\x00\x03A\x96h\ +(\x96\xa6\x14\x12@\xc2\x99\xeb@\x06D\xbc\x16Z\xb0\ +\xa0\xe1\xe5\x886\xce\x8a\xef\xe8\xa5/L\x8f\x88)\x07\ +xc\x00XU\x8d\x91\xf8\xeae\xba\xee\xeb\xc3\x86;\ +\xea\xc4R\x15\xc0\xa2|\xc2%\x1d\xdd!\xed\xd8\x7f\x17\ +\xe8(\x06\xa6\x0c\xb2A8\x9c\xf2\x0c\x13\xfa\x82\x07\x92\ +Ff\xa8o\xb2^\x12\x9e\xbazX\xdb\xa6\xe9\xc6\x92\ +\x0a\x0f\xa9\x87\x0d\x11$\x1f}E\xf9\x9f0\xf2*\x08\ +\x18I\x07\xb75\xa2\xf6i\xe3\xa7A\x91\xa9\x00\xe4\xa6\ +\xb8dN\xac<'\xbdK\x10\xe1\x90:\xb1\x01\xe5\xb4\ +}\x8a\x848|\x93d\xdb\xa2\x00\x00b\x9a\xff\x88\x10\ +\x16(\x9e{La\xdfF\x83\xceY*zF\xdej\ +wt\x8e\xc9\x01\x12T\x9cp\x00\x01\xef\x01\xec\xbc6\ +\xb6c\x8e\x18r`\xa2`G\xbf\x97\xc4O\xd4\x18\xb5\ + \xa1(\xa9\x0d\xd4\x90\x09\x0a\x1b\x0f\x04D\x80\x02\x92\ +\x97>\xdbH\x22\x89)\x87\x0cY\xc0\xb0\x9d\x03\x8aR\ +\x83\x1b)\x08\xa9\x0cT\x90\x0f\x0c\x1a\x99t$\x10 \ +\x15!\xb0\xd5\x81L((\xea\x0d\x92\x00\x05dS\xc5\ +\xa2H\x09\xb0\xc5\x1e\x8a\xf3\xb4T\x87\xb3VEe\x19\ +\xf0\x10\xf5\x067\xc8( *C\x19$\x1b3\x04\xa6\ +F\x11\x05\x07\xa5Ho5g\x22\xec\xa0y>Pj\ +\xe8\x82\x04H\xb8\x92\x22\xf9zS#iD\x15!r\ +\xd5\x82D:(\xcb\xa4D\x12\x00\xeeT\x87\xc2]\x03\ + =|\x0f\xa2\xea\xa6`\xe9\x04O`\x00\x05=C\ +V! X}\x8eE\x14\xd7\x06\xb0>?$\x80\xdd\ +tE5\x81\x048\x16/\x8b\xaa\x83\x08\x04\x82\x19\x94\ +\xe1\xf4\x01e\x00!\x12\x92\x8dd\x94X\x9aC\x8e\x9a\ +\x99\x15$\x14+\x15\x22\x00\x8cM@\xce\xa0\x084\x1e\ +\x11\x09\x85B\xe1\x90\xd8t>!\x11\x00\x19\xa2\x88\x98\ +9\xda%\x19\x8dF\xe1)\xe8\x1ah\xc6\xff\x91G$\ +\x92XD\x89\xff&\x95G\x002\xd0\x01\xa6`\x22~\ +\xcc\xda\x10pl\xaeq\x1aq\x86g\x82D\x0c\xfd\xf5\ +9\xa1P\xe1G\xfa0\x19\xcfInA\xc3\xb4Jt\ +)\xdf-\x00\x8bS5W,\xa2\x9fY\xacVi\xd5\ +(I\x9e\xc0^\x94(k\x96X1\xa6>\x98\xb3Z\ +\xe31C1\xa2\x0e\x97\xb6Q*Ez\xaaeU'\ +\x91\xdc\xe5u\xbb\xe4\x9a\xbd\x0c\xb7'\xe0\xe6\x0b\xfc\xe1\ +\xc4\x0d\xc5\x0a\x91\xb8\xd7\xae\x1e\xd8j\xc9\x03\x1f\x99V\ +\xb53!$\xa9&\xae\xe6xe\xfb3\x1a\xd0hb\ +X\x18]\x18\xfe\x08\xa4\xb9\xd8\xd0q\x8e\x92H\xa5\x8f\ +\x976\x15\x9br\x9a\x0eY\xda\xe9e\xac\xc06\xfcx\ +\x93\xe1>s\xf7\xbd\xdcCG\xc7\x86i\xa1\xc6\xdep\ +q\xf3\xd1d\xc1\xc3\x5c\xa8}H\xd7wKu\xa3\x96\ +\xe3l\x1d%\xdc\x889*C\x8b\xbb\x97\x91\xc6\xf1B\ +\xb9>\xb872#\x925\x0c2\xaf\xc6\x1c\x1c\x19\xee\ +\x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\xf7R\xc0\xdaPE \xe2\xd6B\x93\x15\x19\ +0\xebrOU\x9e]\x5c\xe2\xb0\xaa]\x9c\x22h\xa0\ +d\x83\x8d\xc88\xb0\x83\x80\xf6\xf6T\x00\x15PX\x06\ +H\xc1\xc4\xb9\x9b\xa2\xe8\x0b6\xb4\xb2\xe6\x16LT\x0a\ +\xc5\xa7\xd0\xafA\xa5\x01\xfc\xda\xda\x9f\x889\x858\xce\ +\xa5M\x18uh\xae+\xf9\x95\xe8O^\xbd\xb9 \xe3\ +~\xf6\x08\x1e\xfb\xf0p\xa9\x06)C^\x83)\xa85\ +\x0c\x83\x02(\x5c\xe0\x83\x1d\xe89\xc6\x83\x9a\x13\xa9\x9e\ +\xa9\x19\x1a\xb7\x1d\xbc\xa3z\xe5K\xbbs<\xf7?\xd0\ +:\xdc\xdfC\xd2t\xbd2#\xd1\xf4\xfdWW\xd3u\ +=g_\xd8k<\xefc\xdav\xbd_]\xdbw=\ +\xd4'\xd9\xf7}\xf7\x7fn\xf7\x1e\x07\x87\xe2/\x9e\x17\ +\x8b\xe4y4\x7f{\xe5y\xbes3\xe3\xf9\xfe\x97\xa6\ +\x86\xfa>\xa7\xaf\xeb\xfa\xde\xc7\xb7\xe7{^\xe7\xbf\xe2\ +\xfb\xdf\x07\xc7\xdf|_'\xcf\xda\xfc\xdfG\xd7\xd6}\ +_g\xdf\xd2\xfd\xdf\x87\xe7\xcf~_\xa7\xef\x9c~\xdf\ +\xc7\xf7\xe0\xf9\x9f\xe3\xffwo\xea\x00@4\xb4@@\ +\x00\x13\x00\xfe\x00\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\ +\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x01\x01\x04\x00\x01\ +\x00\x00\x00`\x00\x00\x00\x02\x01\x03\x00\x04\x00\x00\x00,\ +\x09\x00\x00\x03\x01\x03\x00\x01\x00\x00\x00\x05\x00\x00\x00\x06\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00\x11\x01\x04\x00\x01\ +\x00\x00\x00\x08\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\x00\x04\ +\x00\x00\x00\x16\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x17\ +\x01\x04\x00\x01\x00\x00\x009\x08\x00\x00\x1a\x01\x05\x00\x01\ +\x00\x00\x004\x09\x00\x00\x1b\x01\x05\x00\x01\x00\x00\x00<\ +\x09\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00(\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\x00\x10\ +\x00\x00\x00D\x09\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00R\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00S\ +\x01\x03\x00\x04\x00\x00\x00T\x09\x00\x00s\x87\x07\x00H\ +\x0c\x00\x00\x5c\x09\x00\x00\x00\x00\x00\x00\x08\x00\x08\x00\x08\ +\x00\x08\x00\x802\x02\x00\xe8\x03\x00\x00\x802\x02\x00\xe8\ +\x03\x00\x00paint.net 4.0\ +.9\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x0cHL\ +ino\x02\x10\x00\x00mntrRGB X\ +YZ \x07\xce\x00\x02\x00\x09\x00\x06\x001\x00\x00a\ +cspMSFT\x00\x00\x00\x00IEC s\ +RGB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-HP \x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11c\ +prt\x00\x00\x01P\x00\x00\x003desc\x00\ +\x00\x01\x84\x00\x00\x00lwtpt\x00\x00\x01\xf0\x00\ +\x00\x00\x14bkpt\x00\x00\x02\x04\x00\x00\x00\x14r\ +XYZ\x00\x00\x02\x18\x00\x00\x00\x14gXYZ\x00\ +\x00\x02,\x00\x00\x00\x14bXYZ\x00\x00\x02@\x00\ +\x00\x00\x14dmnd\x00\x00\x02T\x00\x00\x00pd\ +mdd\x00\x00\x02\xc4\x00\x00\x00\x88vued\x00\ +\x00\x03L\x00\x00\x00\x86view\x00\x00\x03\xd4\x00\ +\x00\x00$lumi\x00\x00\x03\xf8\x00\x00\x00\x14m\ +eas\x00\x00\x04\x0c\x00\x00\x00$tech\x00\ +\x00\x040\x00\x00\x00\x0crTRC\x00\x00\x04<\x00\ +\x00\x08\x0cgTRC\x00\x00\x04<\x00\x00\x08\x0cb\ +TRC\x00\x00\x04<\x00\x00\x08\x0ctext\x00\ +\x00\x00\x00Copyright (c)\ + 1998 Hewlett-Pa\ +ckard Company\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00\x12sRGB \ +IEC61966-2.1\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x12sRGB IEC\ +61966-2.1\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\ +\x00\x00\x00\x00\x00\xf3Q\x00\x01\x00\x00\x00\x01\x16\xccX\ +YZ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00o\xa2\x00\ +\x008\xf5\x00\x00\x03\x90XYZ \x00\x00\x00\x00\x00\ +\x00b\x99\x00\x00\xb7\x85\x00\x00\x18\xdaXYZ \x00\ +\x00\x00\x00\x00\x00$\xa0\x00\x00\x0f\x84\x00\x00\xb6\xcfd\ +esc\x00\x00\x00\x00\x00\x00\x00\x16IEC h\ +ttp://www.iec.ch\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16IEC \ +http://www.iec.c\ +h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00.IEC 6\ +1966-2.1 Default\ + RGB colour spac\ +e - sRGB\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00.IEC 61966-2.\ +1 Default RGB co\ +lour space - sRG\ +B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00,Reference Vie\ +wing Condition i\ +n IEC61966-2.1\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00,Refere\ +nce Viewing Cond\ +ition in IEC6196\ +6-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00v\ +iew\x00\x00\x00\x00\x00\x13\xa4\xfe\x00\x14_.\x00\ +\x10\xcf\x14\x00\x03\xed\xcc\x00\x04\x13\x0b\x00\x03\x5c\x9e\x00\ +\x00\x00\x01XYZ \x00\x00\x00\x00\x00L\x09V\x00\ +P\x00\x00\x00W\x1f\xe7meas\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x8f\x00\x00\x00\x02sig \x00\ +\x00\x00\x00CRT curv\x00\x00\x00\x00\x00\ +\x00\x04\x00\x00\x00\x00\x05\x00\x0a\x00\x0f\x00\x14\x00\x19\x00\ +\x1e\x00#\x00(\x00-\x002\x007\x00;\x00@\x00\ +E\x00J\x00O\x00T\x00Y\x00^\x00c\x00h\x00\ +m\x00r\x00w\x00|\x00\x81\x00\x86\x00\x8b\x00\x90\x00\ +\x95\x00\x9a\x00\x9f\x00\xa4\x00\xa9\x00\xae\x00\xb2\x00\xb7\x00\ +\xbc\x00\xc1\x00\xc6\x00\xcb\x00\xd0\x00\xd5\x00\xdb\x00\xe0\x00\ +\xe5\x00\xeb\x00\xf0\x00\xf6\x00\xfb\x01\x01\x01\x07\x01\x0d\x01\ +\x13\x01\x19\x01\x1f\x01%\x01+\x012\x018\x01>\x01\ +E\x01L\x01R\x01Y\x01`\x01g\x01n\x01u\x01\ +|\x01\x83\x01\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\ +\xb9\x01\xc1\x01\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\ +\xfa\x02\x03\x02\x0c\x02\x14\x02\x1d\x02&\x02/\x028\x02\ +A\x02K\x02T\x02]\x02g\x02q\x02z\x02\x84\x02\ +\x8e\x02\x98\x02\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\ +\xe0\x02\xeb\x02\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03-\x03\ +8\x03C\x03O\x03Z\x03f\x03r\x03~\x03\x8a\x03\ +\x96\x03\xa2\x03\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\ +\xf9\x04\x06\x04\x13\x04 \x04-\x04;\x04H\x04U\x04\ +c\x04q\x04~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\ +\xd3\x04\xe1\x04\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05:\x05\ +I\x05X\x05g\x05w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\ +\xc5\x05\xd5\x05\xe5\x05\xf6\x06\x06\x06\x16\x06'\x067\x06\ +H\x06Y\x06j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\ +\xd1\x06\xe3\x06\xf5\x07\x07\x07\x19\x07+\x07=\x07O\x07\ +a\x07t\x07\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\ +\xf8\x08\x0b\x08\x1f\x082\x08F\x08Z\x08n\x08\x82\x08\ +\x96\x08\xaa\x08\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09\ +:\x09O\x09d\x09y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\ +\xe5\x09\xfb\x0a\x11\x0a'\x0a=\x0aT\x0aj\x0a\x81\x0a\ +\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0b\ +Q\x0bi\x0b\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\ +\x12\x0c*\x0cC\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\ +\xd9\x0c\xf3\x0d\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\ +\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\ +\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f\ +^\x0fz\x0f\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10\ +C\x10a\x10~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x11\ +1\x11O\x11m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12\ +&\x12E\x12d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13\ +#\x13C\x13c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14\ +'\x14I\x14j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x15\ +4\x15V\x15x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16\ +I\x16l\x16\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17\ +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d1\xd6U\xd6\xd8\xd7\x5c\xd7\xe0\xd8\ +d\xd8\xe8\xd9l\xd9\xf1\xdav\xda\xfb\xdb\x80\xdc\x05\xdc\ +\x8a\xdd\x10\xdd\x96\xde\x1c\xde\xa2\xdf)\xdf\xaf\xe06\xe0\ +\xbd\xe1D\xe1\xcc\xe2S\xe2\xdb\xe3c\xe3\xeb\xe4s\xe4\ +\xfc\xe5\x84\xe6\x0d\xe6\x96\xe7\x1f\xe7\xa9\xe82\xe8\xbc\xe9\ +F\xe9\xd0\xea[\xea\xe5\xebp\xeb\xfb\xec\x86\xed\x11\xed\ +\x9c\xee(\xee\xb4\xef@\xef\xcc\xf0X\xf0\xe5\xf1r\xf1\ +\xff\xf2\x8c\xf3\x19\xf3\xa7\xf44\xf4\xc2\xf5P\xf5\xde\xf6\ +m\xf6\xfb\xf7\x8a\xf8\x19\xf8\xa8\xf98\xf9\xc7\xfaW\xfa\ +\xe7\xfbw\xfc\x07\xfc\x98\xfd)\xfd\xba\xfeK\xfe\xdc\xff\ +m\xff\xff\ +\x00\x00\x89\xf8\ +I\ +I*\x00\x08\x00\x00\x00\x18\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x03\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00.\x01\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00\xfcS\x00\x00\x12\x01\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\ +\x00\x04\x00\x00\x00\x16\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x17\x01\x04\x00\x01\x00\x00\x00\xf9\x12\x00\x00\x1a\x01\x05\ +\x00\x01\x00\x00\x006\x01\x00\x00\x1b\x01\x05\x00\x01\x00\x00\ +\x00>\x01\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\ +\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\ +\x00\x22\x00\x00\x00F\x01\x00\x002\x01\x02\x00\x14\x00\x00\ +\x00h\x01\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00R\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\xbc\x02\x01\ +\x00\xf68\x00\x00|\x01\x00\x00I\x86\x01\x00B\x0d\x00\ +\x00r:\x00\x00i\x87\x04\x00\x01\x00\x00\x00\xf8f\x00\ +\x00s\x87\x07\x00H\x0c\x00\x00\xb4G\x00\x00\x5c\x93\x07\ +\x00\xd0\x22\x00\x00$g\x00\x00\x00\x00\x00\x00\x08\x00\x08\ +\x00\x08\x00\x08\x00\x00\xf9\x15\x00\x10'\x00\x00\x00\xf9\x15\ +\x00\x10'\x00\x00Adobe Photo\ +shop CC 2017 (Wi\ +ndows)\x002017:04:0\ +4 11:01:55\x00\ +\x0a\x0a \ + \x0a \x0a \ + paint.net \ +4.0.9\x0a \ + 2017-03-01T11:2\ +0:20-08:00\x0a \ + 2017-04-04T\ +11:01:55-07:00\x0a\ + 2017-\ +04-04T11:01:55-0\ +7:00\x0a \ + imag\ +e/tiff\x0a 3\x0a \ + sRGB IEC\ +61966-2.1\ +\x0a \x0a \ + \x0a \ + adobe:docid\ +:photoshop:6e5b1\ +c59-1960-11e7-ba\ +e7-e6e7a5cd2814<\ +/rdf:li>\x0a \ + \x0a\ + \x0a \ + xmp.iid:db7b2\ +8e8-30e9-e04f-9f\ +78-916e5c5110e6<\ +/xmpMM:InstanceI\ +D>\x0a ad\ +obe:docid:photos\ +hop:bf3203a1-196\ +0-11e7-bae7-e6e7\ +a5cd2814\x0a \ + x\ +mp.did:8f625742-\ +0048-e64f-ab3c-d\ +4b1a5a27a24\x0a \ +\x0a\ + \x0a \ + \x0a \ + created\x0a \ + \ +xmp.iid:8f6257\ +42-0048-e64f-ab3\ +c-d4b1a5a27a24\x0a \ + \ +2017-03-01T11:20\ +:20-08:00\x0a \ + Ad\ +obe Photoshop CC\ + 2017 (Windows)<\ +/stEvt:softwareA\ +gent>\x0a \ + \x0a \ + \x0a\ + \ + \ +saved\x0a \ + xmp.iid\ +:db7b28e8-30e9-e\ +04f-9f78-916e5c5\ +110e6\x0a \ + 2017-04-0\ +4T11:01:55-07:00\ +\x0a \ + \ +Adobe Photo\ +shop CC 2017 (Wi\ +ndows)\x0a \ + <\ +stEvt:changed>/<\ +/stEvt:changed>\x0a\ + <\ +/rdf:li>\x0a \ + \x0a\ + \x0a \ +\x0a \ +\x0a\x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \x0a8BIM\x04%\x00\x00\x00\x00\x00\x10\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008BI\ +M\x04:\x00\x00\x00\x00\x00\xe5\x00\x00\x00\x10\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x0bprintOutp\ +ut\x00\x00\x00\x05\x00\x00\x00\x00PstSbo\ +ol\x01\x00\x00\x00\x00Inteenum\x00\ +\x00\x00\x00Inte\x00\x00\x00\x00Clrm\x00\ +\x00\x00\x0fprintSixteenB\ +itbool\x00\x00\x00\x00\x0bprint\ +erNameTEXT\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x0fprintProofSe\ +tupObjc\x00\x00\x00\x0c\x00P\x00r\x00\ +o\x00o\x00f\x00 \x00S\x00e\x00t\x00u\x00\ +p\x00\x00\x00\x00\x00\x0aproofSetu\ +p\x00\x00\x00\x01\x00\x00\x00\x00Bltnenu\ +m\x00\x00\x00\x0cbuiltinProo\ +f\x00\x00\x00\x09proofCMYK\x008\ +BIM\x04;\x00\x00\x00\x00\x02-\x00\x00\x00\x10\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x12printOu\ +tputOptions\x00\x00\x00\x17\x00\ +\x00\x00\x00Cptnbool\x00\x00\x00\x00\x00\ +Clbrbool\x00\x00\x00\x00\x00Rgs\ +Mbool\x00\x00\x00\x00\x00CrnCbo\ +ol\x00\x00\x00\x00\x00CntCbool\x00\ +\x00\x00\x00\x00Lblsbool\x00\x00\x00\x00\ +\x00Ngtvbool\x00\x00\x00\x00\x00Em\ +lDbool\x00\x00\x00\x00\x00Intrb\ +ool\x00\x00\x00\x00\x00BckgObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00RGBC\x00\x00\ +\x00\x03\x00\x00\x00\x00Rd doub@o\ +\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00Grn do\ +ub@o\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00Bl\ + doub@o\xe0\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00BrdTUntF#Rlt\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Bld Un\ +tF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00RsltUntF#Pxl@b\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0avector\ +Databool\x01\x00\x00\x00\x00PgP\ +senum\x00\x00\x00\x00PgPs\x00\x00\x00\ +\x00PgPC\x00\x00\x00\x00LeftUnt\ +F#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00Top UntF#Rlt\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00Scl Unt\ +F#Prc@Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x10cropWhenPrintin\ +gbool\x00\x00\x00\x00\x0ecropRe\ +ctBottomlong\x00\x00\x00\x00\ +\x00\x00\x00\x0ccropRectLeft\ +long\x00\x00\x00\x00\x00\x00\x00\x0dcrop\ +RectRightlong\x00\x00\x00\ +\x00\x00\x00\x00\x0bcropRectTop\ +long\x00\x00\x00\x00\x008BIM\x03\xed\x00\ +\x00\x00\x00\x00\x10\x00\x90\x00\x00\x00\x01\x00\x01\x00\x90\x00\ +\x00\x00\x01\x00\x018BIM\x04&\x00\x00\x00\x00\x00\ +\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\x80\x00\x008\ +BIM\x03\xee\x00\x00\x00\x00\x00\x0d\x0cTran\ +sparency\x008BIM\x04\x15\x00\ +\x00\x00\x00\x00\x1e\x00\x00\x00\x0d\x00T\x00r\x00a\x00\ +n\x00s\x00p\x00a\x00r\x00e\x00n\x00c\x00\ +y\x00\x008BIM\x045\x00\x00\x00\x00\x00\x11\x00\ +\x00\x00\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00d\x01\ +\x008BIM\x04\x1d\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x008BIM\x04\x0d\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x1e8BIM\x04\x19\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x1e8BIM\x03\xf3\x00\x00\x00\x00\x00\x09\x00\x00\x00\ +\x00\x00\x00\x00\x00\x01\x008BIM'\x10\x00\x00\x00\ +\x00\x00\x0a\x00\x01\x00\x00\x00\x00\x00\x00\x00\x018BI\ +M\x03\xf5\x00\x00\x00\x00\x00H\x00/ff\x00\x01\x00\ +lff\x00\x06\x00\x00\x00\x00\x00\x01\x00/ff\x00\ +\x01\x00\xa1\x99\x9a\x00\x06\x00\x00\x00\x00\x00\x01\x002\x00\ +\x00\x00\x01\x00Z\x00\x00\x00\x06\x00\x00\x00\x00\x00\x01\x00\ +5\x00\x00\x00\x01\x00-\x00\x00\x00\x06\x00\x00\x00\x00\x00\ +\x018BIM\x03\xf8\x00\x00\x00\x00\x00p\x00\x00\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\ +\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x008BI\ +M\x04\x00\x00\x00\x00\x00\x00\x02\x00\x018BIM\x04\ +\x02\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008BIM\x04\ +0\x00\x00\x00\x00\x00\x02\x01\x018BIM\x04-\x00\ +\x00\x00\x00\x00\x06\x00\x01\x00\x00\x00\x048BIM\x04\ +\x08\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x02@\x00\ +\x00\x02@\x00\x00\x00\x008BIM\x04\x1e\x00\x00\x00\ +\x00\x00\x04\x00\x00\x00\x008BIM\x04\x1a\x00\x00\x00\ +\x00\x035\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\ +\x00\x00`\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00null\x00\x00\x00\x02\x00\x00\x00\x06bo\ +undsObjc\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00Rct1\x00\x00\x00\x04\x00\x00\x00\x00To\ +p long\x00\x00\x00\x00\x00\x00\x00\x00Le\ +ftlong\x00\x00\x00\x00\x00\x00\x00\x00Bt\ +omlong\x00\x00\x00`\x00\x00\x00\x00Rg\ +htlong\x00\x00\x00`\x00\x00\x00\x06sl\ +icesVlLs\x00\x00\x00\x01Objc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x05slice\x00\ +\x00\x00\x12\x00\x00\x00\x07sliceIDlo\ +ng\x00\x00\x00\x00\x00\x00\x00\x07groupI\ +Dlong\x00\x00\x00\x00\x00\x00\x00\x06ori\ +ginenum\x00\x00\x00\x0cESlic\ +eOrigin\x00\x00\x00\x0dautoG\ +enerated\x00\x00\x00\x00Type\ +enum\x00\x00\x00\x0aESliceTy\ +pe\x00\x00\x00\x00Img \x00\x00\x00\x06bo\ +undsObjc\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00Rct1\x00\x00\x00\x04\x00\x00\x00\x00To\ +p long\x00\x00\x00\x00\x00\x00\x00\x00Le\ +ftlong\x00\x00\x00\x00\x00\x00\x00\x00Bt\ +omlong\x00\x00\x00`\x00\x00\x00\x00Rg\ +htlong\x00\x00\x00`\x00\x00\x00\x03ur\ +lTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00n\ +ullTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00MsgeTEXT\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x06altTagTEXT\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x0ecellTextI\ +sHTMLbool\x01\x00\x00\x00\x08ce\ +llTextTEXT\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x09horzAlignenu\ +m\x00\x00\x00\x0fESliceHorzA\ +lign\x00\x00\x00\x07default\x00\ +\x00\x00\x09vertAlignenum\ +\x00\x00\x00\x0fESliceVertAl\ +ign\x00\x00\x00\x07default\x00\x00\ +\x00\x0bbgColorTypeenu\ +m\x00\x00\x00\x11ESliceBGCol\ +orType\x00\x00\x00\x00None\x00\x00\ +\x00\x09topOutsetlong\x00\ +\x00\x00\x00\x00\x00\x00\x0aleftOutse\ +tlong\x00\x00\x00\x00\x00\x00\x00\x0cbot\ +tomOutsetlong\x00\x00\x00\ +\x00\x00\x00\x00\x0brightOutset\ +long\x00\x00\x00\x00\x008BIM\x04(\x00\ +\x00\x00\x00\x00\x0c\x00\x00\x00\x02?\xf0\x00\x00\x00\x00\x00\ +\x008BIM\x04\x14\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x048BIM\x04\x0c\x00\x00\x00\x00\x03\xeb\x00\x00\x00\ +\x01\x00\x00\x000\x00\x00\x000\x00\x00\x00\x90\x00\x00\x1b\ +\x00\x00\x00\x03\xcf\x00\x18\x00\x01\xff\xd8\xff\xed\x00\x0cA\ +dobe_CM\x00\x01\xff\xee\x00\x0eAdo\ +be\x00d\x80\x00\x00\x00\x01\xff\xdb\x00\x84\x00\x0c\x08\ +\x08\x08\x09\x08\x0c\x09\x09\x0c\x11\x0b\x0a\x0b\x11\x15\x0f\x0c\ +\x0c\x0f\x15\x18\x13\x13\x15\x13\x13\x18\x11\x0c\x0c\x0c\x0c\x0c\ +\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x01\x0d\ +\x0b\x0b\x0d\x0e\x0d\x10\x0e\x0e\x10\x14\x0e\x0e\x0e\x14\x14\x0e\ +\x0e\x0e\x0e\x14\x11\x0c\x0c\x0c\x0c\x0c\x11\x11\x0c\x0c\x0c\x0c\ +\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\ +\xc0\x00\x11\x08\x000\x000\x03\x01\x22\x00\x02\x11\x01\x03\ +\x11\x01\xff\xdd\x00\x04\x00\x03\xff\xc4\x01?\x00\x00\x01\x05\ +\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x01\ +\x02\x04\x05\x06\x07\x08\x09\x0a\x0b\x01\x00\x01\x05\x01\x01\x01\ +\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x02\x03\x04\x05\ +\x06\x07\x08\x09\x0a\x0b\x10\x00\x01\x04\x01\x03\x02\x04\x02\x05\ +\x07\x06\x08\x05\x03\x0c3\x01\x00\x02\x11\x03\x04!\x121\ +\x05AQa\x13\x22q\x812\x06\x14\x91\xa1\xb1B#\ +$\x15R\xc1b34r\x82\xd1C\x07%\x92S\xf0\ +\xe1\xf1cs5\x16\xa2\xb2\x83&D\x93TdE\xc2\ +\xa3t6\x17\xd2U\xe2e\xf2\xb3\x84\xc3\xd3u\xe3\xf3\ +F'\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\ +\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf67GWg\ +w\x87\x97\xa7\xb7\xc7\xd7\xe7\xf7\x11\x00\x02\x02\x01\x02\x04\ +\x04\x03\x04\x05\x06\x07\x07\x06\x055\x01\x00\x02\x11\x03!\ +1\x12\x04AQaq\x22\x13\x052\x81\x91\x14\xa1\xb1\ +B#\xc1R\xd1\xf03$b\xe1r\x82\x92CS\x15\ +cs4\xf1%\x06\x16\xa2\xb2\x83\x07&5\xc2\xd2D\ +\x93T\xa3\x17dEU6te\xe2\xf2\xb3\x84\xc3\xd3\ +u\xe3\xf3F\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\ +\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf6'7\ +GWgw\x87\x97\xa7\xb7\xc7\xff\xda\x00\x0c\x03\x01\x00\ +\x02\x11\x03\x11\x00?\x00\xf4<\xdc\xcc\x96d\x9a\xa9;\ +@\x80\x00\x00\x92O\xc6P\xfd~\xab\xe0\xff\x00\xfbl\ +\x7f\xe4R\xc9\xff\x00\x95\x1b\xfdz\xff\x00\xef\xabU\xce\ +\x0dis\xb4\x00I>A%9^\xbfU\xf0\x7f\xfd\ +\xb6?\xf2)z\xfdW\xc1\xff\x00\xf6\xd8\xff\x00\xc8\xa2\ +UU\xf9\xe0\xdde\x8e\xaa\x92}\x95\xb7\xc0x\xa7{\ +o\xe9\xeem\x82\xc3n9 =\xae\xd4\x89\xee\x12R\ +/_\xaa\xf8?\xfc\xc1\xff\x00\x91D\xc0\xcc\xc8\xb3#\ +\xd2\xb4\xee\x04\x1e@\x04\x11\xfdU\xa4\xb20\x7f\xe5\x03\ +\xff\x00\x5c\xfc\xa9)\xff\xd0\xef\xf2\x7f\xe5F\xff\x00^\ +\xb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+\x00t\x00o\x00s\x00h\x00o\x00p\x00\x00\x00\x17\ +\x00A\x00d\x00o\x00b\x00e\x00 \x00P\x00h\ +\x00o\x00t\x00o\x00s\x00h\x00o\x00p\x00 \ +\x00C\x00C\x00 \x002\x000\x001\x007\x00\x00\ +\x00\x01\x00\x00\x00\x0cHLino\x02\x10\x00\x00m\ +ntrRGB XYZ \x07\xce\x00\x02\x00\ +\x09\x00\x06\x001\x00\x00acspMSFT\x00\ +\x00\x00\x00IEC sRGB\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\ +\x00\xd3-HP \x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x11cprt\x00\x00\x01P\x00\ +\x00\x003desc\x00\x00\x01\x84\x00\x00\x00lw\ +tpt\x00\x00\x01\xf0\x00\x00\x00\x14bkpt\x00\ +\x00\x02\x04\x00\x00\x00\x14rXYZ\x00\x00\x02\x18\x00\ +\x00\x00\x14gXYZ\x00\x00\x02,\x00\x00\x00\x14b\ +XYZ\x00\x00\x02@\x00\x00\x00\x14dmnd\x00\ +\x00\x02T\x00\x00\x00pdmdd\x00\x00\x02\xc4\x00\ +\x00\x00\x88vued\x00\x00\x03L\x00\x00\x00\x86v\ +iew\x00\x00\x03\xd4\x00\x00\x00$lumi\x00\ +\x00\x03\xf8\x00\x00\x00\x14meas\x00\x00\x04\x0c\x00\ +\x00\x00$tech\x00\x00\x040\x00\x00\x00\x0cr\ +TRC\x00\x00\x04<\x00\x00\x08\x0cgTRC\x00\ +\x00\x04<\x00\x00\x08\x0cbTRC\x00\x00\x04<\x00\ +\x00\x08\x0ctext\x00\x00\x00\x00Copyr\ +ight (c) 1998 He\ +wlett-Packard Co\ +mpany\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00\x12sRGB IEC61966\ +-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\ +sRGB IEC61966-2.\ +1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00\xf3Q\x00\ +\x01\x00\x00\x00\x01\x16\xccXYZ \x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\ +\x00\x00\x00\x00\x00o\xa2\x00\x008\xf5\x00\x00\x03\x90X\ +YZ \x00\x00\x00\x00\x00\x00b\x99\x00\x00\xb7\x85\x00\ +\x00\x18\xdaXYZ \x00\x00\x00\x00\x00\x00$\xa0\x00\ +\x00\x0f\x84\x00\x00\xb6\xcfdesc\x00\x00\x00\x00\x00\ +\x00\x00\x16IEC http://ww\ +w.iec.ch\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x16IEC http://w\ +ww.iec.ch\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00.IEC 61966-2.1\ + Default RGB col\ +our space - sRGB\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00.IEC \ +61966-2.1 Defaul\ +t RGB colour spa\ +ce - sRGB\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00,Refer\ +ence Viewing Con\ +dition in IEC619\ +66-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00,Reference View\ +ing Condition in\ + IEC61966-2.1\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00view\x00\x00\x00\x00\x00\ +\x13\xa4\xfe\x00\x14_.\x00\x10\xcf\x14\x00\x03\xed\xcc\x00\ +\x04\x13\x0b\x00\x03\x5c\x9e\x00\x00\x00\x01XYZ \x00\ +\x00\x00\x00\x00L\x09V\x00P\x00\x00\x00W\x1f\xe7m\ +eas\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x8f\x00\ +\x00\x00\x02sig \x00\x00\x00\x00CRT c\ +urv\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x05\x00\ +\x0a\x00\x0f\x00\x14\x00\x19\x00\x1e\x00#\x00(\x00-\x00\ +2\x007\x00;\x00@\x00E\x00J\x00O\x00T\x00\ +Y\x00^\x00c\x00h\x00m\x00r\x00w\x00|\x00\ +\x81\x00\x86\x00\x8b\x00\x90\x00\x95\x00\x9a\x00\x9f\x00\xa4\x00\ +\xa9\x00\xae\x00\xb2\x00\xb7\x00\xbc\x00\xc1\x00\xc6\x00\xcb\x00\ +\xd0\x00\xd5\x00\xdb\x00\xe0\x00\xe5\x00\xeb\x00\xf0\x00\xf6\x00\ +\xfb\x01\x01\x01\x07\x01\x0d\x01\x13\x01\x19\x01\x1f\x01%\x01\ ++\x012\x018\x01>\x01E\x01L\x01R\x01Y\x01\ +`\x01g\x01n\x01u\x01|\x01\x83\x01\x8b\x01\x92\x01\ +\x9a\x01\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\xc9\x01\xd1\x01\ +\xd9\x01\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\x0c\x02\x14\x02\ +\x1d\x02&\x02/\x028\x02A\x02K\x02T\x02]\x02\ +g\x02q\x02z\x02\x84\x02\x8e\x02\x98\x02\xa2\x02\xac\x02\ +\xb6\x02\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\xf5\x03\x00\x03\ +\x0b\x03\x16\x03!\x03-\x038\x03C\x03O\x03Z\x03\ +f\x03r\x03~\x03\x8a\x03\x96\x03\xa2\x03\xae\x03\xba\x03\ +\xc7\x03\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\x13\x04 \x04\ +-\x04;\x04H\x04U\x04c\x04q\x04~\x04\x8c\x04\ +\x9a\x04\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\xf0\x04\xfe\x05\ +\x0d\x05\x1c\x05+\x05:\x05I\x05X\x05g\x05w\x05\ +\x86\x05\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\xe5\x05\xf6\x06\ +\x06\x06\x16\x06'\x067\x06H\x06Y\x06j\x06{\x06\ +\x8c\x06\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\xf5\x07\x07\x07\ +\x19\x07+\x07=\x07O\x07a\x07t\x07\x86\x07\x99\x07\ +\xac\x07\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\x1f\x082\x08\ +F\x08Z\x08n\x08\x82\x08\x96\x08\xaa\x08\xbe\x08\xd2\x08\ +\xe7\x08\xfb\x09\x10\x09%\x09:\x09O\x09d\x09y\x09\ +\x8f\x09\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\x11\x0a'\x0a\ +=\x0aT\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\ +\xf3\x0b\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\x80\x0b\x98\x0b\ +\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0cC\x0c\x5c\x0c\ +u\x0c\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\x0d\x0d&\x0d\ +@\x0dZ\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\ +\x13\x0e.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\ +\xee\x0f\x09\x0f%\x0fA\x0f^\x0fz\x0f\x96\x0f\xb3\x0f\ +\xcf\x0f\xec\x10\x09\x10&\x10C\x10a\x10~\x10\x9b\x10\ +\xb9\x10\xd7\x10\xf5\x11\x13\x111\x11O\x11m\x11\x8c\x11\ +\xaa\x11\xc9\x11\xe8\x12\x07\x12&\x12E\x12d\x12\x84\x12\ +\xa3\x12\xc3\x12\xe3\x13\x03\x13#\x13C\x13c\x13\x83\x13\ +\xa4\x13\xc5\x13\xe5\x14\x06\x14'\x14I\x14j\x14\x8b\x14\ +\xad\x14\xce\x14\xf0\x15\x12\x154\x15V\x15x\x15\x9b\x15\ +\xbd\x15\xe0\x16\x03\x16&\x16I\x16l\x16\x8f\x16\xb2\x16\ +\xd6\x16\xfa\x17\x1d\x17A\x17e\x17\x89\x17\xae\x17\xd2\x17\ +\xf7\x18\x1b\x18@\x18e\x18\x8a\x18\xaf\x18\xd5\x18\xfa\x19\ + \x19E\x19k\x19\x91\x19\xb7\x19\xdd\x1a\x04\x1a*\x1a\ +Q\x1aw\x1a\x9e\x1a\xc5\x1a\xec\x1b\x14\x1b;\x1bc\x1b\ +\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c*\x1cR\x1c{\x1c\xa3\x1c\ +\xcc\x1c\xf5\x1d\x1e\x1dG\x1dp\x1d\x99\x1d\xc3\x1d\xec\x1e\ +\x16\x1e@\x1ej\x1e\x94\x1e\xbe\x1e\xe9\x1f\x13\x1f>\x1f\ +i\x1f\x94\x1f\xbf\x1f\xea \x15 A l \x98 \ +\xc4 \xf0!\x1c!H!u!\xa1!\xce!\xfb\x22\ +'\x22U\x22\x82\x22\xaf\x22\xdd#\x0a#8#f#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f=f\x92f\ +\xe8g=g\x93g\xe9h?h\x96h\xeciCi\ +\x9ai\xf1jHj\x9fj\xf7kOk\xa7k\xffl\ +Wl\xafm\x08m`m\xb9n\x12nkn\xc4o\ +\x1eoxo\xd1p+p\x86p\xe0q:q\x95q\ +\xf0rKr\xa6s\x01s]s\xb8t\x14tpt\ +\xccu(u\x85u\xe1v>v\x9bv\xf8wVw\ +\xb3x\x11xnx\xccy*y\x89y\xe7zFz\ +\xa5{\x04{c{\xc2|!|\x81|\xe1}A}\ +\xa1~\x01~b~\xc2\x7f#\x7f\x84\x7f\xe5\x80G\x80\ +\xa8\x81\x0a\x81k\x81\xcd\x820\x82\x92\x82\xf4\x83W\x83\ +\xba\x84\x1d\x84\x80\x84\xe3\x85G\x85\xab\x86\x0e\x86r\x86\ +\xd7\x87;\x87\x9f\x88\x04\x88i\x88\xce\x893\x89\x99\x89\ +\xfe\x8ad\x8a\xca\x8b0\x8b\x96\x8b\xfc\x8cc\x8c\xca\x8d\ +1\x8d\x98\x8d\xff\x8ef\x8e\xce\x8f6\x8f\x9e\x90\x06\x90\ +n\x90\xd6\x91?\x91\xa8\x92\x11\x92z\x92\xe3\x93M\x93\ +\xb6\x94 \x94\x8a\x94\xf4\x95_\x95\xc9\x964\x96\x9f\x97\ +\x0a\x97u\x97\xe0\x98L\x98\xb8\x99$\x99\x90\x99\xfc\x9a\ +h\x9a\xd5\x9bB\x9b\xaf\x9c\x1c\x9c\x89\x9c\xf7\x9dd\x9d\ +\xd2\x9e@\x9e\xae\x9f\x1d\x9f\x8b\x9f\xfa\xa0i\xa0\xd8\xa1\ +G\xa1\xb6\xa2&\xa2\x96\xa3\x06\xa3v\xa3\xe6\xa4V\xa4\ +\xc7\xa58\xa5\xa9\xa6\x1a\xa6\x8b\xa6\xfd\xa7n\xa7\xe0\xa8\ +R\xa8\xc4\xa97\xa9\xa9\xaa\x1c\xaa\x8f\xab\x02\xabu\xab\ +\xe9\xac\x5c\xac\xd0\xadD\xad\xb8\xae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xa6\xfcdk\xb9\x08\xb0;\ +\x1b\x84\x84LtV5A0_\x14\xc8\x12\x0c\x85!\ +\xa2\xe7\xd4\x8c|\x93RI\x00SI\x84|\x8c}\x1f\ +(\xc4\x0a\x01\x07\xb2\xa8\x9aCK\x058\x0f-\x812\ +$\xbd/\xcc\x13\x0a\x04gL\x86\x08\xed3\x8a\x87\x84\ +\xd4v#\x09\x98\x08\x02\x8a\xf3\x88\xda7\xce\x84\x5c\xa7\ +1O\x13\xcc\xf5\x03\x9d\x13\xe9\xc44P\x02\x11\xc9A\ +\x9b\xa8\xc42\x03\x01\x03-\x14?\x0c\x14h\xf0\xe3O\ +t\x8d%I\xa3\xe7\x95,w\x0c\x94\xc8|oS\x86\ +\xad\x0d\x0d\x0d\x95\x09\x0e\xfe\x8b#}!JU\x15M\ +T\x873\x07\x99\xe1E\x0c\xa1\xf1\xb9Y\x9ah\xc4\xb6\ +\x03\x810\xf8\xdaDN\x22\xb8\xdbS\xc4\xae\x13\x9bU\ +\xc8q\xab\xae\xe1\xa1V\x15UV\x9e\x14\xc8\xc8\x1e\x9b\ +\xb6\x89\xa9O\xd1\x03u\xacD\xd7\xb5\xfb\xa4\x89\xaaF\ +\xdd\xbch\x9e\xb7\x09\xe6\xea\xcav\x13\xa8\xe0\x1f\xb7I\ +\xfb;\xb8\x8e\xdb\xb2\xf29Wr\xd4\x82<\xc8E\x80\ +\xe3\xbb\xab+\xa3d9\xd7\xdd\xe3}-\xd0-\xec\xe0\ +X\xc8\xa3\xc6\xe4\xbc\xce\xc5\xde\xbf\xb9`\x04\xdc\x02\x84\ +X\x88T\x05\xe2\x80r8\xca\x9e\x87\x8d\x9c\x1e\xd6f\ +\xe5j\x8b\xd6\xe0MB6\x10\xe2\xc6L7^\xe8\x89\ +\xf9\x95\x9fc\xa6\x5c(\x9a\xf9\x89\x9be!\xf72\x87\ +\x02\x80xN\x15\x80:\xb6\x15 \xed.\x92\x9d\xea\x81\ +\xe8O\x06R\xe9\xad\x97r\xb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\xf1\xd5\x81!\x19\x17\xc5\ +t3p\xe4mf9\x86:\xc7\xc8\xb3!rKf\ +\x01\x90\xc6\xe8\xdd\x9e\xd3\xdcR)L5GQ\x0a\xa3\ +C\x00xRk\xa8~\x08\xe8\xfc\x1cEL\x81\x12\x8a\ +\xaa\x17@\x00c!\xc1\xe9\x1c\x5c#\xd4y6p\xc6\ +\x0f#;\xcddP\xfd\x93\xc6\xd2\x16\xca\xc7\xe0\xfbs\ +\x11\xc5=\x00Y<\x01\x9c\x10\xab\x07\xd2\x8c'=\xd1\ +Y)\xc4\xb0\x88\x95A\xadI\xb7\xf7\x02\x8e\xe1\x9c5\ +\x8c\x86f3<\xc8z\x02V\xb0n[\x09\xc9\xb9\x99\ +70\xe6\x86\xa3\x9cO!\xf6b\x09\xc0\x9f1\xc3\x19\ + \x1dS,r\x8d\x89\x9c3\x9dp\xef\x1dO \xd0\ +\x80\xf8\x9f\x14\x01T\xd9\x06\xb0\xb8\x90\x09y\xbc\x1f\x04\ +\xec\xe1\x10\xa9\xeaWC\x01\x14+d81\x912\xcd\ +W1\xb6\xd4\xdb#K\x91D\x11\xb1\xe9\x91\x18\xde\xe2\ +\xe4\xe2`\x81\xf109\x89\x020\xa5\x87\x90\xee\x15T\ +\x0cJ\x8b\x8a\x0c)\x8f\xa0\xe0\x1b\x0c\x18\xa4\x82z\x1c\ +\x0c\x02e\x11\x0c\x13\x1c'\x867>\x89\x16\xe1K\x0e\ +\xb4l)?A\x80,\x13\x0c\x85E\xe2\xbat\xce\xb2\ +4\xf2!\xc4:\x87\x93\xc6\x1f2H\x1eG$\xc0\xfb\ +cs\x02a$ IM\xc1jL\x14\xc3=\x9c\x11\ +\x02\xa4)j\x00\x8e\x135\x0c?\x8fz\x8c=IC\ +\xdf\x02a\xca\xa6\x09\x00\x95S\xc2\xe1\x14\x7fC\xcd\x0e\ +\x05\x00H;\xaa\xc0\xeaH\x93\x96\x18\xd2W\x11-\x22\ +,\x91\x96\xeeJ \x11\xc7\xab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\ +\x0f\xb3\xf0^\x8d\xda\x88OK\x0a\xfd5\x05\xee\xc9\xcf\ +\xd4H\xc6\xa2V8\x84\x8a>\xb6\xdf\x8fB\xd0p\x97\ +\xba\xab\x9e\xa0\xed\x04\x81\xef\xf8\xbe\xf4C\xb8\x04zP\ +\x14C5\xa0\xe2\x1br8\x1d\xbd\xd1m\xeb\xc7$\x9e\ +\x00\xa0\x18\x86#!\xbe5\xd5 /\xa6(&WJ\ +\xa1\x10*\xa3\x17s \x94\x00w\xc1>\xef\x88\x92\xe7\ +6\xc4\xff\x08\x81\xbdU\x00\x1a\x02\x0f>$\xc5?\x9b\ +\x86\xben\x1b\x00\xff\xd9\x04\xef\xf5\x04-\xd5\xbe(\x7f\ +\x00\x89\x17?\x8cT\x12\xcd\x8fI9\x84\xec\x1e\x10\xe3\ +\xe3\x91H\xd4\x885A\x1a\xeb\xefl\x92MP%\x00\ +#\x17\xdcO\x1e\x88_\x0a\xdc\xac\x0f`\xb4\x85\x82B\ +\xf1\xc8dp\xa9d\xe2G\x92Y\xef(\x22fB\xcf\ +g\xa2\xf9\x82\x04\xfeh\xe4$(\xac\x10\xa1L\x89 \ +\x8e\x0b/\xf4R\x8c\xdc\x14\x01\x0e\xcda(\x0fBI\ +\x00\x8f \x22\xe5\x98\x9d\xc5\xa4\x92P\x1c\x88%\x86\x22\ +h\x88V+\x94#\xc0q\x06`\x8b\x04\x01u\x03e\ +T<\x01\xfa\xe1\x8fl\x1a\xe2@\xc8\xec\xe8#)\x16\ +\x1eNf\xcf\x0e,\xfe\x223\x02B@\x0fP\x98\x13\ +\x0dn\x0a@\xcf\x07\x06\xf6\x12\xb0\xa8\x0fA?\x0a\xe1\ +\x0e$\x0b\xce\x8b\xeb\xd4x\x8ec\x08\x87\x94\xfd\xb0\x18\ +\xf9%\xae\xfa\xf0 \x00\x0e6\x82\x8f<$\x10@\x17\ +0f\x07\x00\x8c\x22\x08\xb2\x19Ay\x07P\xa4$G\ +>\x01\x8d:\xf5\xa2\x1e\x16\x10\xfc\x13a\x09\x10,\xb6\ +#\xe9\xaa\x02k\xd0\x15\xf0\x82#\x07\x90\xe2\x8c\xf2\xf9\ +\x05p\xef%\xb4\xefk\x8e\xd5MX\x98\x22@I!\ +4\x18\x0f\xf2!\xed\x1a\x01\x8d\x17\x0e\xe2B\xa6\xe0H\ +\x05\x8cl\x15\x08\xd0!\xa1k\x15!D\x0f\xf1X\x0b\ +\xf0~\xceHb\xd90\xcf\x11m\xe3\x08\xca\xc6\xda1\ +#\x05\xac\xfc\xef\xab2\xfe\x82?\x13\x114p\xc2!\ +\x13\xb1?\x14\x02?\x14QH\xc6\xd1N!\x91R\x16\ +\xb1W\x15\xb0\xb4\xe1\xed\xdb\x00\xca\xbeU\xcf\xd9\x16\xce\ +\xf1\x17\x10\xce\xc5g\xb0\xda\xc27\x18\x116!\xd1\x88\ +\xa8\xf1\x8d\x18\xeao\x191L\x22\x11\x9b\x19\xe0\xff\x15\ +\xc2>\xe9\xe9a\x1a\x8f\xd4\x96\xa6<\xe2\xcd\xeb\x17M\ +\xef\x12\x8b\x92\xd5\xa2;\x1c\x11\x85\x13\x84\xab\x13\xd1\xc9\ +\x1c\xa2;\x19\x11K\x19b\x17\x1dqY\x1d\xb1\xa2\xe5\ +\xcaG\x16Nt!p\x87\x08\xae+\x16\xed\xe8\xbe\x91\ +\xf0\xef\x8dT\xcan\xfe#\x91\xfc\x06H\xc7\x1cR\x03\ +\x18\xb2\x08#r\x0d\x19Q\xd5\x15R\x17\x1d\xc2<\xc8\ +\xf2!\x12EX31\xaf\x22\xac\xf4\x92\x90\x1f\x22\x22\ +\x15\x09Q~I1\x83$\x11\x87$r\x06@\xe07\ +(`B\x06r\x8c\x08\x08\x5c\xcc\x01\xcf\x0eax\xcc\ +\x01\xd0A2O\x1d\x22\x1f!Q\xa0#\xf0I\x1eB\ +4\xee\xa7\x17\x0cB$\xc4p\xca\xf9rp!0^\ +\x88\xd1-'q3\x1c\x22\x1b\x1cj\xe6%\x8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 +\x14b Y\xc0yUA\xa1U\x96\xcddt\xc14\ +\x91\x084T\xcbV\x91\x14\xde\x16\x0bC\xa2&}h\ +\x1cn6b\xef\xd6gST\xe9]\x93\xb6%\x8f\xec\ +\xb0\x81V\x1a\xc8\x9e\x8a\x22\x0ev\xe1\xaa\xc0`\xb6\x06\ +P\x05Z\xf1GK\xf5\x11L6N\x80\x12_W\xad\ +\x99>\xd7+?\x14\x855\xc1\x11n\xa2-:\xb6i\ +s\xf6\xf9t\x22^\x04\x17\x90\x05\x07$t@B\x05\ +!\xady\xe1\x96\xd0\x81$\x0e\xe9\x96\x1dA\xcb*\x17\ +\x19vw\x1c#\xd4\xc9\x0b\x96\x04\x22\xb6\x9fj\x22\x1c\ +\xd4\xc5\xaf\x1e\xf4\xdf\x1fT\x91,\xb3\xadf\xb7A@\ +\x92J#\x16\xce \xf6\xd3%\xb6\x94pi\xd2\x07\xd0\ +\xcfG\xf4\xd5nu\xcb|\xd6\xacJ\x0f\x9e\xfa4\xe5\ +}w\x89@V\xfb}\xe25~\x22\x0d~b:\xfc\ +\xf7\xbe\x22\x97\xf5nV\x0em\xc5D\xca\x0f\xe42f\ +7a\xf6#\x80\x96'f\xf6+\x81\x023\x81B\x0b\ +\x81\x8299x:\x22\xb0\x87Y@\xc4\x07i\xdf\x05\ +X+sMR\xd5q\xf7}W\x87\x84\xe2\x11g\x18\ +@\x22\xf8D \x98H#r\xafeO\xd4\x82n\xab\ +&\xa6H\x88\x15\xcf#veS4\x95\x80\xb5;x\ +\xd8r\x22Xv xz#Tw9\x98\x81\x01\x15\ +o\x1e\xb2-\x5c\xd6\x9a \xb7\x84#\x8b>\x13\x01|\ +\xb3\x80h\x08\x22 \xbb@\xee\x0a\x81\xf3\x8da\xf1\x89\ +\xe2.\x03X\xe0\x04\x04\xce\x0e\xc9\x06!\xf5\xa8\x16\x81\ +@\x10\x18\xf4\x0c7j\xa4x\x1e\x22sU|B\x1b\ +jx\xb9ab\x17\x8b\xe26\x94,^\x0a\x98\xdcO\ +\x0b\xac\x14\x81\x1a\xba`\xe9d\xee!C4\xcf\x5c0\ +\x15\x82V\xa5n\x94C\x82\xf7\xd1,\x8aj#\xa9\xf6\ +\x89\xb9\x1aLM\x86\x0a-\x83\x92\x96S\x00\xf3S&\ +N\xedr\xd5\xc8\x92x\x8a\xcf\x97qH\xcf9N(\ +,$\x0c\x12\x01\xb2\x0e\x039|\x03\xf9JH\x17\x9e\ +\x1a\xc1\x97\x85@u/5b\xc3V\x99\x90\xc2\x15M\ +\x193\x8bMJCMO\x93\xa23n\xe5co\x22\ +8\x06\xb9\xb4\x08A'\x9b\xa1qC\x88)\xc2\x0aS\x82\x81\ +*\xcf\xcf\x18\x0b\xfcH\x06P\x09\x8c\xae\xbd\xc9\xbb\x9e\ +\xa1>\x0a\x91\xa3\x05\x83\x87\xdc\x1cG \xa2\xaa\xf4V\ +\xa0\xa3\x90i\x0b\x9cJ\x9c\x0a\xab\xbc\x0a4\x12\xa2\x9a\ +\x91\x08\x0c|D\x83\x92\x0a> \xa0[\x10{ \xa4\ +(\x1d\x17\x91\xa14d|\xa8\xf0\xdaY\x1b%p\xfa\ +|\xf9\x19\x822\x0aI\xa0\xa13Dn6\xa3k\x92\ +\x19\x97\x0a\x1cp\x95IiLt\xe7\x1f\xe0\x11\x9d)\ +\x90i\x00\xf4\xd3\xa1\xe4L\x8e=6\xa7\xf2s&\xa5\ +\x13\x02O'\xa5\x8e\x99\x9e\x08\x1f\xb3IJ\x82\x89R\ +\xc2,\x5c\x00s\x88\xb2\x18\xce\x8e\x03\xdb\x03\xb1\xf3\xc2\ +}2$\xf2\x99\x9c\x15:\xc7\xf1`\x82\x84\xb3r:\ +nN \x18\xa1:\x06&\xac8\xa5LI4\xf8\x91\ +5\xc6h\x86\x90\x15\xe8(\x1bC$\xe7\xa3\xfc\x01\x0a\ +P\x08d]\xa54\x8aKS$\x94\x9a5?\x08\x94\ +\x09d\x82\x814\xe2`|S\xe2uER$\x95B\ +\x81='\xb5R+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87\xad4M9\xf0\x18\xa6\xd1\x22\x0d\x19\xcb\xa7\ +~c\x12w\x81\x1f(<\x15\xfd\x07\xa4k\xd3\xa7S\ +\xf0\xec\x90q\xaa~,\x82\x01\xfd\xa7\x97\xdb\xe3,s\ +j9TD\x7f\xd6\xe9J\x12\x95\x16\xa9\xb0\xa9\x0d\xd5\ +\xc0\xdc\x09\xe8\xd2\x81@\x88\x90\x00RR\x83\x87\xda\xaf\ + \x89\x08\xa7\x8b4\x8e\x13\x9f\xf9JR\xa3e \x95\ +!\x8a\xb8\x1c\xa9\x82G\x82\xf8\x82\x84\x12\xa46\x128\ +)\x83%\x1dJ\xb8`\x00\xacJa\xb5\x16\x89\x1c&\ +\x984x\xa6W\xf1R\x1e\xe9\x1d\x87\x14g\xa8C\xd4\ +\xa8\xdf \xa0\x80\xa9\x0cu\xc0\x0e\x8c\x1a\x95\x18D\x80\ +\x1e\x95!\xbe\x91\xc1\x14+(\xcaU\x5c\x00\x00\x88T\ +\x86\xf2\xe0\x04p\xd8\xf9A\xc8&T\x85\xd2G]p\ +\xf9\xf6\x13\x95*\x22\x08+\xca)\xe3\xe1\xf2\x80\x80\x1e\ +\x0b#\x80\xfa.\xa8\xf2\x07\x10D\xec\x00!\xe9N\x10\ +\xa9\x1d\x14FH\x00O\xd3\xf0\x1f$\x03t\x82\xb9\x92\ +\x9e\x10\xd7\x04$.\x89\xf8\x1f\xb0\xb2\xa4>\x8d\xa8!\ +TK\x1d\xa0\xc6RltT\xa8\xa9$\x01X\xa6\x90\ +\x00\x0c\x09\x183\x82\x9d@\x10\x88L*\x17\x0c\x86\xc3\ +\xa1\xf1\x08\x8cJ&\x00fE\x910\x93\xb4R7\x1c\ +\x8e\xc2\xd3\xe3I\x09\x89\xff$\x8fI\xa4\xf0\xa9#\xfe\ +Q,\x8f@\x80 \x06\x94\xc8D\xfa\x9a\xb4! \xd9\ +l\xea8\xe3\x04O\x84\x82\xca\x0b\xeawD\xa2\xc3\x1a\ +\x94\x803\xe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1\x1f}\xe3\x9d\xe8\xba>\x93w\xe7\ +\xfa^\xa3\xa9\xea\xb1\x1e\x9f\xab\xeb\xba\xfe\xc1(\xe8{\ +\x1e\xd3\xb5\xde\xfb>\xdb\xb9\xee\xb4\x1e\xb7\xbb\xef\xbb\xfe\ +\x8b\xb8\xf0\x01E\x01L\x01R\x01Y\x01`\x01g\x01n\x01\ +u\x01|\x01\x83\x01\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\ +\xb1\x01\xb9\x01\xc1\x01\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\ +\xf2\x01\xfa\x02\x03\x02\x0c\x02\x14\x02\x1d\x02&\x02/\x02\ +8\x02A\x02K\x02T\x02]\x02g\x02q\x02z\x02\ +\x84\x02\x8e\x02\x98\x02\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\ +\xd5\x02\xe0\x02\xeb\x02\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03\ +-\x038\x03C\x03O\x03Z\x03f\x03r\x03~\x03\ +\x8a\x03\x96\x03\xa2\x03\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\ +\xec\x03\xf9\x04\x06\x04\x13\x04 \x04-\x04;\x04H\x04\ +U\x04c\x04q\x04~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\ +\xc4\x04\xd3\x04\xe1\x04\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05\ +:\x05I\x05X\x05g\x05w\x05\x86\x05\x96\x05\xa6\x05\ +\xb5\x05\xc5\x05\xd5\x05\xe5\x05\xf6\x06\x06\x06\x16\x06'\x06\ +7\x06H\x06Y\x06j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\ +\xc0\x06\xd1\x06\xe3\x06\xf5\x07\x07\x07\x19\x07+\x07=\x07\ +O\x07a\x07t\x07\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\ +\xe5\x07\xf8\x08\x0b\x08\x1f\x082\x08F\x08Z\x08n\x08\ +\x82\x08\x96\x08\xaa\x08\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09\ +%\x09:\x09O\x09d\x09y\x09\x8f\x09\xa4\x09\xba\x09\ +\xcf\x09\xe5\x09\xfb\x0a\x11\x0a'\x0a=\x0aT\x0aj\x0a\ +\x81\x0a\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b\ +9\x0bQ\x0bi\x0b\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\ +\xf9\x0c\x12\x0c*\x0cC\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\ +\xc0\x0c\xd9\x0c\xf3\x0d\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\ +\x8e\x0d\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0e\ +d\x0e\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0f\ +A\x0f^\x0fz\x0f\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10\ +&\x10C\x10a\x10~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\ +\x13\x111\x11O\x11m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\ +\x07\x12&\x12E\x12d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\ +\x03\x13#\x13C\x13c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\ +\x06\x14'\x14I\x14j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\ +\x12\x154\x15V\x15x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16\ +&\x16I\x16l\x16\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17\ +A\x17e\x17\x89\x17\xae\x17\xd2\x17\xf7\x18\x1b\x18@\x18\ +e\x18\x8a\x18\xaf\x18\xd5\x18\xfa\x19 \x19E\x19k\x19\ +\x91\x19\xb7\x19\xdd\x1a\x04\x1a*\x1aQ\x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df\xaf\xe0\ +6\xe0\xbd\xe1D\xe1\xcc\xe2S\xe2\xdb\xe3c\xe3\xeb\xe4\ +s\xe4\xfc\xe5\x84\xe6\x0d\xe6\x96\xe7\x1f\xe7\xa9\xe82\xe8\ +\xbc\xe9F\xe9\xd0\xea[\xea\xe5\xebp\xeb\xfb\xec\x86\xed\ +\x11\xed\x9c\xee(\xee\xb4\xef@\xef\xcc\xf0X\xf0\xe5\xf1\ +r\xf1\xff\xf2\x8c\xf3\x19\xf3\xa7\xf44\xf4\xc2\xf5P\xf5\ +\xde\xf6m\xf6\xfb\xf7\x8a\xf8\x19\xf8\xa8\xf98\xf9\xc7\xfa\ +W\xfa\xe7\xfbw\xfc\x07\xfc\x98\xfd)\xfd\xba\xfeK\xfe\ +\xdc\xffm\xff\xff\ +\x00\x00\x03\xaa\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Default - Sav\ +ed\x0d\x0a \ +Created wi\ +th Sketch.\x0d\x0a \x0d\x0a \x0d\x0a \ + \x0d\x0a \x0d\ +\x0a\x0d\x0a\ +\x00\x00\x04q\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Editor only -\ + Default\ +\x0d\x0a Crea\ +ted with Sketch.\ +\x0d\x0a \x0d\x0a \ +\x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\x0d\x0a\ +\ +\x00\x00\x02\x9b\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + <\ +/circle>\x0d\x0a \ + \x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x00#k\ +\x00\ +\x00\xf0\x80x\x9c\xed\x5c\x07\x5c\x93\xc7\xdf\xbf'\x09\x09\ +[\xb62\xc4\x88\x03\x17#\xcc\x10\x01\xd9CE\x11\x10\ +\xd4\xbaB\xf2\x00\x91,\x930\xc4=\xaaV\xad\x03\xad\ +\x0b\xb7\xd6=\xea^\xad\xd6\x89V\xabu\xb7\xd5\xb6\x8e\ +?\xae*\xe2`\xa3y\xef\x9e$\x10\x14\x15$\x8a\xf6\ +}\xbe\xf9\xdc\x93\xbb\xdf\xdd\xfd\xd6\xddsw\xcf\xb8'\ +&\x06t\x02\x00\xe8\x83\x16\xe0\x15\xa0\xc1\x18\x06T\x07\ +*\xf17\x14\x1e0\xad8\x85\x88\xc3r\x98+FU\ +\xd3aa\x8c\xae\x8eS\xe0\xc1\x5c\xc3'q!f\xa1\ +U\xc6Z\x1dG\xb5m\xb4x6\xd7\x94\x9f\x0d0;\ +\xa0\xa7\x8ac>\x98}u<\x10s\xd0\xe2\xd3AK\ +\x16\x0b\x1d\x81\x13\x8cE`\x1eD\xdc\x0a\xc6\xd3\xb0\xb8\ +\x9a\xf2\x94\x1f\xd1\x91\xb3\x16&GM<\x08\x18\x90\xde\ +\x0c\x00\x7f\xa7\xc9\xd1\x88n\xea\x08\xe3\x1eS\x04\x1a\x1d\ +\xee.\x9c\x22Ge\x8c\xa3\x00\xe8\x1e;w \x8a\x1b\ +\xec\x83\xf4\xe3\xc8/\xd0O\xaa\x9fa\xd58\x00\x9c\xcd\ +4\xff\xc1|I2\xce\x8cM\x93($\xf24\x89\x94\ +\x19\x1a\xca\xf4pg\xf92;$\x09\xc4|I\x96\xbc\ +#@I\x8e\xbb\x07\xc7\xdd\x93\xc9\xf2\xe1x\xf8p\xbc\ +X\xc0\xbf[\xb6\x94\xcbK\xc7\x15\xccda\xb8\x9c'\x13H\x15\x02\x89\x98\x89\ +\xd2\xdcdI\x86\x22\xc0\xc9\xc9\x90\xa9\x05\xb5]\x22i\ +\xb5 \xb1\xdc\x95\xb0\xd1\x95'\x11\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5\xac\x9bz\x11\x0b\xd7\xcf\ +n\xd5\x0b\xe8\xba\x14\xd6=H!\xa4\x10R\x08)\x84\ +\x14B\x0a!\x85\x90BH!\xa4\x10R\x08)\x84\x14\ +B\x0a!\x85\x90BH!\xa4\x10R\x08)\x84\x14B\ +\x0a!\x85\x90BH!\xa4\x10R\x08)\x84\x14B\x0a\ +!\x85\x90BH!\xa4\x10R\x08)\x84\x14B\x0a!\ +\x85\x90BH!\xa4\x10R\x08)\x84\x14B\x0a\xd1\xb1\ +\x10\xc3\x9a-\xa9\xb8\x98\x1f\xe0\x94\xe5\xd4-\xd0\x01\x1b\ +\x00\xa8\xf6\xed\x22\x1d(\x80\xd8`\xcb\x0e\x89\x8e\xa1\xb5\ +#v\xc3\x9a\xfdz\xbeb\xf4\xfa\xfcC\x06z\xd2\xcc\ +\xad\xdb\xf4\x8e\xf5\x22\xf28D^\x01\xca\xd7\xec'\x06\ +FR\x99@\xac\xe8\x9d\xa1\x90f(`\x12m\xec\x05\ +\xb1rE|\xb2D\x22$JD\x8b\x158.\xce\x10\ +i\xe2\xe8?T(C\xe9fD\xddxA6*\x11\ +\x22P\xa0:5\x8f\xf0\x85\ +\xca6\x8a:E\xa9\x95rW\xe9\xa8\xf6\xb5\x0b\x91\xa2\ +\x13\xfe\xb0%(\xfa\xea^A\xb4\x0d%H\x15\xd4u\ +\x1dk\xb7\x0c\xcd\x0e\xc5\xa8\xde\xd5\x96\xab0T\x1dT\ +\xdey\x13\xda4\xed\xb2u\x16\xd0\xa0fp\x03\xe2\x0c\ +\xa1Pe\x10\xa0'K2\xc4|\xf9kc\x0bO\xc1\ +\xd2\xa8\x89NH\xad\x93\x01\xbcv\xd6\x80\x90\x9a\xb3\x8b\ +P#\xae\xe6\xe4Ai\xba\x5c(\xe0\xe1\xf2DaO\ +t\xfac\xb5\xe4\xe8\x11y0b\x01\x03\x83HD\x87\ +i\xf1f\xa4\xca$\x19\xd2Z$\xba\x84\xd8\x97\xab\x19\ +\xd9\xc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\x06\xe3h\x05h,\ +K\x88\x83W24\x7f8\x07\x1b\xa7j\xc5\x93\xb5\xe2\ +\x0a81#\xa3B%\xd2\x11\xc4\x0c\xc6\xec\xc0\xeb\xc8\ +d\xf9\xf9\xb1\x99Qx\x96\x10W(\x5cb\xe1\x05;\ +W\xc6g\x86JDR\xae\x18\xae\xefU6\x13\xb0x\ +\xe3#4Z\x8ezgf=\x81\xdaV\x15{\xde\x87\ +h3\xcc\xe6l\x0d\xad\xaer\x92Up~\x85\xab}\ +\xea\xec\x1aZ\xf2\x22\x00\xf6~\x0d@\x8b?khm\ +W\xc0>\x0a\xdbm\xcfy-{lP\x7f\xd1\xfa\xf8\ +\x94\x00\xe7\xb9\x22\x87V\xe3\xbd\x05\xea\x01-y\xae\x88\ +]\xb5{\x98a\xaa\x15\x0c\x13\xf9\x8d\x07\xd7)\x192\ +&\xbc\xfe\xe2\xe1L\x97\xd7;\xf1\x07W\xac[\x8f.\ +qx\x0a\x8e\xae\xf3pf\x22\xece\xf02\x156\xb7\ +\x98/ \xbe\xa3%\x10\xbf\xad\x11?\xb0\xdakP\xf5\ +k\x08\xcb5\xaf\x80\xd5\x10W`v\xde\x0aP\x1f\x9f\ +\x054K#@\x1d\xb8\x0c\xe6`\xd5\xed\xd6\xd3 \x11\ +\xa03/\xa9\xd5=U\xbf'P\xc7\xe5\x04e\x16:\ +\xc8\x05\xc4\x22\x1a\x84\xc6%0y\x19\xb2LU\x1e\xb1\ +n\xd6\x83\xd7\x88\xcd\x80\x15\xb0\x85\xd7\xb3m@\x07x\ +u\xe7\x01\x07\x99\xae \x08\x84\x83\xee\xa07\xbc\xbe\xed\ +\x0f\x06\xc3+\xda4 \x82W\xb7Y`\x14\x18\x0f&\ +\x83\xe9`6\xf8\x0e,\x06\xcb\xc1\x1a\xb0\x01l\x05;\ +\xc0^\xf0#8\x02N\x823\xe07p\x05\x5c\x077\ +A\x01\xf8\x17\x14\x81\x12P\x09\x172\x0c\xcc\x04\xb3\xc4\ +l\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\x90 A\x82\x04\x09\x12$H\x90 A\x82\x04\ +\x09\x12$H\x90 A\x82\x04\x09\x12$H\x90\xa8\x06\ +u\x05\x06\xa8\xf0\x1f\x83?\xb0\x82\x02hD\x1c\x80\xa1\ ++\xa85qU\xd1`\xbe$\x19g\xc6\xa6I\x14\x12\ +y\x9aD\xca\x0c\x93\xf02D\xb8X\xc1\x0c\xe3*\xb8\ +\xcc\x10\xa1\x84\x97\x0e\xd8!\xd111\x092\xe2=$\ +\x14\xef\xc9\x1d!\x03\xc0\xc0\x8f\xe0c\x01\x03\xdaI\x17\ +\x03C\x02\xa0)\x95\x00\xd0J\x09\xd6\x85D~!@\ +\xdf7/D\xf5\xc4\x12\x99H\x09\xf4\x91\x02\x9a\xf7\xed\ +;\x00\x80j\xbc?0\xe2\xd3\xb8R\x9c\xc9B|\x84\ +\x19b\xf4\xed\x19+\x18\x18 \x1e\xa4\x01.\x90\x02\x1c\ +0\x01K\xa5\x9fP,G{,irX\x85H\x8f\ +\x10\xa0g\xba\xc8r[\x94\xe6\x09\x93\x85(\x8d\xa9\xed\ +\x11\x88S\xb2\xd5\xf9D:]\x9c.\xd1N\x0b\xe5\xd2\ +\x94Zi\x9e\x10\xf1\xd7\xd7\xb8\x1b\xd1\xe4i\x22$\x03\ +\xed\xe9\xc3\x08\x19\x19r\x85:\x1b\xbd\x9fg\xa6\xf6:\ +\xac%\xc2\x15\x5c>t\xae\x9ab \xe4\x8e\xc0e\x09\ +\x02\x11\xce\x97d$\x07_m\x17Y\x94\xc4\xdaK\xf0\ +L\xc9\x96I\xd5uk\x03\x83\xb2\x0d\x8110\x02\xf6\ +\xa09\xb0\x86\xbf\xe6\xc0\x12\x963V\xffl\xe0\xcfZ\ +\xfd\xb3\x84\xa1\x05Q\xc2\x068T\xff\xec\x81\x1dA\xb1\ +\x84^D\xa5P\x8d\x16\xc0\xb6\x9a\x839\xa4\xb7Ps\ +\xb6\x87r\x8c\xa1<\xfd\x97\x80\xc2_H?\x02^\x01\ +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\xac\xd5O0^1\xac\ +\x12<\x05\x18u:<\x13\xd6\x17\x94\xa0J/\xc1\x13\ +\xa8\xc7\xf5;J\xda\x8d\x1e\xc0\xee\x04\xa4\x9dvx\x85\ +\x06k\xd59\xf5\x22\x87\x01\xbd\xcaX\x04\xfd|?\x00\ +\x80G\xd0\xfc\xb5\xb0/\xaew\x80\x86\xa6\x94\x95*)\ +\x15\xe9\xe0!\xa0x\xae,\x83'k\xf9*\xd8\xd91\ +\x0ed\x0c\x16\xdf\x07Tk\xd1O\x95\xf0\xc4\xae<$\ +\xb6\x81\x8a\xd9\x9d(U\x02q\x0101\x8f\xce\xd9\x98\ +\xff\xfb\xfd\x07\xbf\x9f\xda\x94\xd3\xdd\xbc\x08`\xf4\x85p\ +\x90X\x06\xe0p\x81\x97U))\xa7\x18\xe0\x18\xc0\xfc\ +\x0a^)\xa9\xf7\x1c`\x97\x004\xdb\x13\xcar\xce+\ +p\x04*\xb5\x90\xff\x12\x0d{\x94\xa6\xf8\x1d8\xdb\x14\ +?\xd2\xda\xff\xb0\xb5\xeauT\x8c\x1c\xedo0U\xad\ +q\x08x\x8cS\xe7\xc5r\x15\x0a\xcd\xda\x22BU\xce\ +X\xbb\x1c:\xfc\x1f\x02\xea)+\ +\x00\x00\x80\x08\ +I\ +I*\x00\x08\x00\x00\x00\x18\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x03\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00.\x01\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00NS\x00\x00\x12\x01\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\ +\x00\x04\x00\x00\x00\x16\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x17\x01\x04\x00\x01\x00\x00\x000\x12\x00\x00\x1a\x01\x05\ +\x00\x01\x00\x00\x006\x01\x00\x00\x1b\x01\x05\x00\x01\x00\x00\ +\x00>\x01\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\ +\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\ +\x00\x22\x00\x00\x00F\x01\x00\x002\x01\x02\x00\x14\x00\x00\ +\x00h\x01\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00R\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\xbc\x02\x01\ +\x00\x1f8\x00\x00|\x01\x00\x00I\x86\x01\x00j\x0d\x00\ +\x00\x9c9\x00\x00i\x87\x04\x00\x01\x00\x00\x00\x80e\x00\ +\x00s\x87\x07\x00H\x0c\x00\x00\x06G\x00\x00\x5c\x93\x07\ +\x00X\x1a\x00\x00\xace\x00\x00\x00\x00\x00\x00\x08\x00\x08\ +\x00\x08\x00\x08\x00\x00\xf9\x15\x00\x10'\x00\x00\x00\xf9\x15\ +\x00\x10'\x00\x00Adobe Photo\ +shop CC 2017 (Wi\ +ndows)\x002017:04:0\ +4 11:01:25\x00\ +\x0a\x0a \ + \x0a \x0a \ + paint.net \ +4.0.9\x0a \ + 2017-03-01T11:2\ +0:20-08:00\x0a \ + 2017-04-04T\ +11:01:25-07:00\x0a\ + 2017-\ +04-04T11:01:25-0\ +7:00\x0a \ + imag\ +e/tiff\x0a 3\x0a \ + sRGB IEC\ +61966-2.1\ +\x0a xmp.\ +iid:7284f562-66e\ +c-6d4b-bfaf-a292\ +c87d086e\x0a \ + adobe:doc\ +id:photoshop:aca\ +ee4ff-1960-11e7-\ +bae7-e6e7a5cd281\ +4\x0a xmp.did:\ +15df0628-f397-b6\ +41-8e6b-37248a21\ +c43f\x0a\ + \x0a \ + \x0a \ + \x0a\ + \ + \ +created\x0a \ + xmp.i\ +id:15df0628-f397\ +-b641-8e6b-37248\ +a21c43f\x0a \ + 2017-03\ +-01T11:20:20-08:\ +00\x0a\ + \ + Adobe Pho\ +toshop CC 2017 (\ +Windows)\x0a \ + \x0a \ + \x0a \ + saved\x0a \ + \ +xmp.iid:7284f5\ +62-66ec-6d4b-bfa\ +f-a292c87d086e\x0a \ + \ +2017-04-04T11:01\ +:25-07:00\x0a \ + Ad\ +obe Photoshop CC\ + 2017 (Windows)<\ +/stEvt:softwareA\ +gent>\x0a \ + /\x0a \ + \x0a \x0a \ + \x0a \x0a <\ +/rdf:RDF>\x0a\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \x0a\x008BIM\x04\ +%\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x008BIM\x04:\x00\x00\x00\ +\x00\x00\xe5\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x0bprintOutput\x00\x00\x00\x05\ +\x00\x00\x00\x00PstSbool\x01\x00\x00\x00\ +\x00Inteenum\x00\x00\x00\x00Int\ +e\x00\x00\x00\x00Clrm\x00\x00\x00\x0fpri\ +ntSixteenBitbool\ +\x00\x00\x00\x00\x0bprinterName\ +TEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0fpr\ +intProofSetupObj\ +c\x00\x00\x00\x0c\x00P\x00r\x00o\x00o\x00f\x00\ + \x00S\x00e\x00t\x00u\x00p\x00\x00\x00\x00\x00\ +\x0aproofSetup\x00\x00\x00\x01\x00\ +\x00\x00\x00Bltnenum\x00\x00\x00\x0cb\ +uiltinProof\x00\x00\x00\x09p\ +roofCMYK\x008BIM\x04;\x00\ +\x00\x00\x00\x02-\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x12printOutputOp\ +tions\x00\x00\x00\x17\x00\x00\x00\x00Cpt\ +nbool\x00\x00\x00\x00\x00Clbrbo\ +ol\x00\x00\x00\x00\x00RgsMbool\x00\ +\x00\x00\x00\x00CrnCbool\x00\x00\x00\x00\ +\x00CntCbool\x00\x00\x00\x00\x00Lb\ +lsbool\x00\x00\x00\x00\x00Ngtvb\ +ool\x00\x00\x00\x00\x00EmlDbool\ +\x00\x00\x00\x00\x00Intrbool\x00\x00\x00\ +\x00\x00BckgObjc\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x00RGBC\x00\x00\x00\x03\x00\x00\x00\x00\ +Rd doub@o\xe0\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Grn doub@o\xe0\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00Bl doub\ +@o\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00BrdT\ +UntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Bld UntF#Rlt\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Rslt\ +UntF#Pxl@b\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x0avectorDatabo\ +ol\x01\x00\x00\x00\x00PgPsenum\x00\ +\x00\x00\x00PgPs\x00\x00\x00\x00PgPC\x00\ +\x00\x00\x00LeftUntF#Rlt\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Top U\ +ntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00Scl UntF#Prc@\ +Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10cropW\ +henPrintingbool\x00\ +\x00\x00\x00\x0ecropRectBott\ +omlong\x00\x00\x00\x00\x00\x00\x00\x0ccr\ +opRectLeftlong\x00\x00\ +\x00\x00\x00\x00\x00\x0dcropRectRi\ +ghtlong\x00\x00\x00\x00\x00\x00\x00\x0bc\ +ropRectToplong\x00\x00\ +\x00\x00\x008BIM\x03\xed\x00\x00\x00\x00\x00\x10\x00\ +\x90\x00\x00\x00\x01\x00\x01\x00\x90\x00\x00\x00\x01\x00\x018\ +BIM\x04&\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00?\x80\x00\x008BIM\x03\xee\x00\ +\x00\x00\x00\x00\x0d\x0cTransparen\ +cy\x008BIM\x04\x15\x00\x00\x00\x00\x00\x1e\x00\ +\x00\x00\x0d\x00T\x00r\x00a\x00n\x00s\x00p\x00\ +a\x00r\x00e\x00n\x00c\x00y\x00\x008BI\ +M\x045\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\xff\ +\xff\x00\x00\x00\x00\x00\x00\x00d\x01\x008BIM\x04\ +\x1d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008BIM\x04\ +\x0d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x04\ +\x19\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x03\ +\xf3\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x01\ +\x008BIM'\x10\x00\x00\x00\x00\x00\x0a\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x018BIM\x03\xf5\x00\x00\x00\ +\x00\x00H\x00/ff\x00\x01\x00lff\x00\x06\x00\ +\x00\x00\x00\x00\x01\x00/ff\x00\x01\x00\xa1\x99\x9a\x00\ +\x06\x00\x00\x00\x00\x00\x01\x002\x00\x00\x00\x01\x00Z\x00\ +\x00\x00\x06\x00\x00\x00\x00\x00\x01\x005\x00\x00\x00\x01\x00\ +-\x00\x00\x00\x06\x00\x00\x00\x00\x00\x018BIM\x03\ +\xf8\x00\x00\x00\x00\x00p\x00\x00\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\ +\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\ +\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\x03\xe8\x00\x008BIM\x04\x00\x00\x00\x00\ +\x00\x00\x02\x00\x008BIM\x04\x02\x00\x00\x00\x00\x00\ +\x02\x00\x008BIM\x040\x00\x00\x00\x00\x00\x01\x01\ +\x008BIM\x04-\x00\x00\x00\x00\x00\x06\x00\x01\x00\ +\x00\x00\x038BIM\x04\x08\x00\x00\x00\x00\x00$\x00\ +\x00\x00\x01\x00\x00\x02@\x00\x00\x02@\x00\x00\x00\x04\x00\ +\x00\x01+\x00\x00\x00\x0a\xc5\x00\x00\x00\x01\x1b\x01\x00\x00\ +\x0a\xd5\x018BIM\x04\x1e\x00\x00\x00\x00\x00\x04\x00\ +\x00\x00\x008BIM\x04\x1a\x00\x00\x00\x00\x035\x00\ +\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\ +\x00\x00`\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00nu\ +ll\x00\x00\x00\x02\x00\x00\x00\x06bounds\ +Objc\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rc\ +t1\x00\x00\x00\x04\x00\x00\x00\x00Top lo\ +ng\x00\x00\x00\x00\x00\x00\x00\x00Leftlo\ +ng\x00\x00\x00\x00\x00\x00\x00\x00Btomlo\ +ng\x00\x00\x00`\x00\x00\x00\x00Rghtlo\ +ng\x00\x00\x00`\x00\x00\x00\x06slices\ +VlLs\x00\x00\x00\x01Objc\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x05slice\x00\x00\x00\x12\x00\ +\x00\x00\x07sliceIDlong\x00\x00\ +\x00\x00\x00\x00\x00\x07groupIDlon\ +g\x00\x00\x00\x00\x00\x00\x00\x06origine\ +num\x00\x00\x00\x0cESliceOri\ +gin\x00\x00\x00\x0dautoGener\ +ated\x00\x00\x00\x00Typeenum\ +\x00\x00\x00\x0aESliceType\x00\x00\ +\x00\x00Img \x00\x00\x00\x06bounds\ +Objc\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rc\ +t1\x00\x00\x00\x04\x00\x00\x00\x00Top lo\ +ng\x00\x00\x00\x00\x00\x00\x00\x00Leftlo\ +ng\x00\x00\x00\x00\x00\x00\x00\x00Btomlo\ +ng\x00\x00\x00`\x00\x00\x00\x00Rghtlo\ +ng\x00\x00\x00`\x00\x00\x00\x03urlTEX\ +T\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00nullT\ +EXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Msg\ +eTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x06a\ +ltTagTEXT\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x0ecellTextIsHTM\ +Lbool\x01\x00\x00\x00\x08cellTe\ +xtTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x09\ +horzAlignenum\x00\x00\x00\ +\x0fESliceHorzAlign\ +\x00\x00\x00\x07default\x00\x00\x00\x09v\ +ertAlignenum\x00\x00\x00\x0f\ +ESliceVertAlign\x00\ +\x00\x00\x07default\x00\x00\x00\x0bbg\ +ColorTypeenum\x00\x00\x00\ +\x11ESliceBGColorTy\ +pe\x00\x00\x00\x00None\x00\x00\x00\x09to\ +pOutsetlong\x00\x00\x00\x00\x00\ +\x00\x00\x0aleftOutsetlon\ +g\x00\x00\x00\x00\x00\x00\x00\x0cbottomO\ +utsetlong\x00\x00\x00\x00\x00\x00\x00\ +\x0brightOutsetlong\ +\x00\x00\x00\x00\x008BIM\x04(\x00\x00\x00\x00\x00\ +\x0c\x00\x00\x00\x02?\xf0\x00\x00\x00\x00\x00\x008BI\ +M\x04\x14\x00\x00\x00\x00\x00\x04\x00\x00\x00\x048BI\ +M\x04\x0c\x00\x00\x00\x00\x04\x02\x00\x00\x00\x01\x00\x00\x00\ +0\x00\x00\x000\x00\x00\x00\x90\x00\x00\x1b\x00\x00\x00\x03\ +\xe6\x00\x18\x00\x01\xff\xd8\xff\xed\x00\x0cAdobe\ +_CM\x00\x01\xff\xee\x00\x0eAdobe\x00d\ +\x80\x00\x00\x00\x01\xff\xdb\x00\x84\x00\x0c\x08\x08\x08\x09\x08\ +\x0c\x09\x09\x0c\x11\x0b\x0a\x0b\x11\x15\x0f\x0c\x0c\x0f\x15\x18\ +\x13\x13\x15\x13\x13\x18\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x01\x0d\x0b\x0b\x0d\x0e\ +\x0d\x10\x0e\x0e\x10\x14\x0e\x0e\x0e\x14\x14\x0e\x0e\x0e\x0e\x14\ +\x11\x0c\x0c\x0c\x0c\x0c\x11\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\xc0\x00\x11\x08\ +\x000\x000\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xdd\ +\x00\x04\x00\x03\xff\xc4\x01?\x00\x00\x01\x05\x01\x01\x01\x01\ +\x01\x01\x00\x00\x00\x00\x00\x00\x00\x03\x00\x01\x02\x04\x05\x06\ +\x07\x08\x09\x0a\x0b\x01\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\ +\x00\x00\x00\x00\x00\x00\x01\x00\x02\x03\x04\x05\x06\x07\x08\x09\ +\x0a\x0b\x10\x00\x01\x04\x01\x03\x02\x04\x02\x05\x07\x06\x08\x05\ +\x03\x0c3\x01\x00\x02\x11\x03\x04!\x121\x05AQa\ +\x13\x22q\x812\x06\x14\x91\xa1\xb1B#$\x15R\xc1\ +b34r\x82\xd1C\x07%\x92S\xf0\xe1\xf1cs\ +5\x16\xa2\xb2\x83&D\x93TdE\xc2\xa3t6\x17\ +\xd2U\xe2e\xf2\xb3\x84\xc3\xd3u\xe3\xf3F'\x94\xa4\ +\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\ +\x86\x96\xa6\xb6\xc6\xd6\xe6\xf67GWgw\x87\x97\xa7\ +\xb7\xc7\xd7\xe7\xf7\x11\x00\x02\x02\x01\x02\x04\x04\x03\x04\x05\ +\x06\x07\x07\x06\x055\x01\x00\x02\x11\x03!1\x12\x04A\ +Qaq\x22\x13\x052\x81\x91\x14\xa1\xb1B#\xc1R\ +\xd1\xf03$b\xe1r\x82\x92CS\x15cs4\xf1\ +%\x06\x16\xa2\xb2\x83\x07&5\xc2\xd2D\x93T\xa3\x17\ +dEU6te\xe2\xf2\xb3\x84\xc3\xd3u\xe3\xf3F\ +\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5V\ +fv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf6'7GWgw\ +\x87\x97\xa7\xb7\xc7\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\ +\x00?\x00\xf4<\xdc\xcc\x96d\x9a\xa9;@\x80\x00\x00\ +\x92O\xc6P\xfd~\xab\xe0\xff\x00\xfbl\x7f\xe4R\xc9\ +\xff\x00\x95\x1b\xfdz\xff\x00\xef\xabR\xcb\x19[\x0b\xec\ +!\xad\x1c\x92\x92\x9c\xbf_\xaa\xf8?\xfe\xdb\x1f\xf9\x14\ +\xbd~\xab\xe0\xff\x00\xfbl\x7f\xe4T\xed\xea\xee\x9f\xd0\ +\xb0\x06\xfe\xf3\xff\x00\xf2#\xff\x00$\x95]]\xd3\xfa\ +f\x02\xd3\xf9\xcc\xff\x00\xc8\x9f\xfc\x92Ja\xeb\xf5_\ +\x07\xff\x00\x98?\xf2(\x98\x19\x99\x16dzV\x9d\xc0\ +\x83\xc8\x00\x82?\xaa\xb4+\xb1\x960>\xb2\x1c\xd3\xc1\ +\x0b+\x07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x9f\xff\xd98BIM\x04\ +!\x00\x00\x00\x00\x00]\x00\x00\x00\x01\x01\x00\x00\x00\x0f\ +\x00A\x00d\x00o\x00b\x00e\x00 \x00P\x00h\ +\x00o\x00t\x00o\x00s\x00h\x00o\x00p\x00\x00\ +\x00\x17\x00A\x00d\x00o\x00b\x00e\x00 \x00P\ +\x00h\x00o\x00t\x00o\x00s\x00h\x00o\x00p\ +\x00 \x00C\x00C\x00 \x002\x000\x001\x007\ +\x00\x00\x00\x01\x00\x00\x00\x0cHLino\x02\x10\x00\ +\x00mntrRGB XYZ \x07\xce\x00\ +\x02\x00\x09\x00\x06\x001\x00\x00acspMSF\ +T\x00\x00\x00\x00IEC sRGB\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\ +\x00\x00\x00\xd3-HP \x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x11cprt\x00\x00\x01\ +P\x00\x00\x003desc\x00\x00\x01\x84\x00\x00\x00\ +lwtpt\x00\x00\x01\xf0\x00\x00\x00\x14bkp\ +t\x00\x00\x02\x04\x00\x00\x00\x14rXYZ\x00\x00\x02\ +\x18\x00\x00\x00\x14gXYZ\x00\x00\x02,\x00\x00\x00\ +\x14bXYZ\x00\x00\x02@\x00\x00\x00\x14dmn\ +d\x00\x00\x02T\x00\x00\x00pdmdd\x00\x00\x02\ +\xc4\x00\x00\x00\x88vued\x00\x00\x03L\x00\x00\x00\ +\x86view\x00\x00\x03\xd4\x00\x00\x00$lum\ +i\x00\x00\x03\xf8\x00\x00\x00\x14meas\x00\x00\x04\ +\x0c\x00\x00\x00$tech\x00\x00\x040\x00\x00\x00\ +\x0crTRC\x00\x00\x04<\x00\x00\x08\x0cgTR\ +C\x00\x00\x04<\x00\x00\x08\x0cbTRC\x00\x00\x04\ +<\x00\x00\x08\x0ctext\x00\x00\x00\x00Cop\ +yright (c) 1998 \ +Hewlett-Packard \ +Company\x00\x00desc\x00\x00\x00\ +\x00\x00\x00\x00\x12sRGB IEC619\ +66-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x12sRGB IEC61966-\ +2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00\xf3\ +Q\x00\x01\x00\x00\x00\x01\x16\xccXYZ \x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ\ + \x00\x00\x00\x00\x00\x00o\xa2\x00\x008\xf5\x00\x00\x03\ +\x90XYZ \x00\x00\x00\x00\x00\x00b\x99\x00\x00\xb7\ +\x85\x00\x00\x18\xdaXYZ \x00\x00\x00\x00\x00\x00$\ +\xa0\x00\x00\x0f\x84\x00\x00\xb6\xcfdesc\x00\x00\x00\ +\x00\x00\x00\x00\x16IEC http://\ +www.iec.ch\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x16IEC http:/\ +/www.iec.ch\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\ +\x00\x00\x00\x00.IEC 61966-2\ +.1 Default RGB c\ +olour space - sR\ +GB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00.IE\ +C 61966-2.1 Defa\ +ult RGB colour s\ +pace - sRGB\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00desc\x00\x00\x00\x00\x00\x00\x00,Ref\ +erence Viewing C\ +ondition in IEC6\ +1966-2.1\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00,Reference Vi\ +ewing Condition \ +in IEC61966-2.1\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00view\x00\x00\x00\ +\x00\x00\x13\xa4\xfe\x00\x14_.\x00\x10\xcf\x14\x00\x03\xed\ +\xcc\x00\x04\x13\x0b\x00\x03\x5c\x9e\x00\x00\x00\x01XYZ\ + \x00\x00\x00\x00\x00L\x09V\x00P\x00\x00\x00W\x1f\ +\xe7meas\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\ +\x8f\x00\x00\x00\x02sig \x00\x00\x00\x00CRT\ + curv\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\ +\x05\x00\x0a\x00\x0f\x00\x14\x00\x19\x00\x1e\x00#\x00(\x00\ +-\x002\x007\x00;\x00@\x00E\x00J\x00O\x00\ +T\x00Y\x00^\x00c\x00h\x00m\x00r\x00w\x00\ +|\x00\x81\x00\x86\x00\x8b\x00\x90\x00\x95\x00\x9a\x00\x9f\x00\ +\xa4\x00\xa9\x00\xae\x00\xb2\x00\xb7\x00\xbc\x00\xc1\x00\xc6\x00\ +\xcb\x00\xd0\x00\xd5\x00\xdb\x00\xe0\x00\xe5\x00\xeb\x00\xf0\x00\ +\xf6\x00\xfb\x01\x01\x01\x07\x01\x0d\x01\x13\x01\x19\x01\x1f\x01\ +%\x01+\x012\x018\x01>\x01E\x01L\x01R\x01\ +Y\x01`\x01g\x01n\x01u\x01|\x01\x83\x01\x8b\x01\ +\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\xc9\x01\ +\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\x0c\x02\ +\x14\x02\x1d\x02&\x02/\x028\x02A\x02K\x02T\x02\ +]\x02g\x02q\x02z\x02\x84\x02\x8e\x02\x98\x02\xa2\x02\ +\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\xf5\x03\ +\x00\x03\x0b\x03\x16\x03!\x03-\x038\x03C\x03O\x03\ +Z\x03f\x03r\x03~\x03\x8a\x03\x96\x03\xa2\x03\xae\x03\ +\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\x13\x04\ + \x04-\x04;\x04H\x04U\x04c\x04q\x04~\x04\ +\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\xf0\x04\ +\xfe\x05\x0d\x05\x1c\x05+\x05:\x05I\x05X\x05g\x05\ +w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\xe5\x05\ +\xf6\x06\x06\x06\x16\x06'\x067\x06H\x06Y\x06j\x06\ +{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\xf5\x07\ +\x07\x07\x19\x07+\x07=\x07O\x07a\x07t\x07\x86\x07\ +\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\x1f\x08\ +2\x08F\x08Z\x08n\x08\x82\x08\x96\x08\xaa\x08\xbe\x08\ +\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09:\x09O\x09d\x09\ +y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\x11\x0a\ +'\x0a=\x0aT\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\xc5\x0a\ +\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\x80\x0b\ +\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0cC\x0c\ +\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\x0d\x0d\ +&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\xde\x0d\ +\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\xb6\x0e\ +\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f^\x0fz\x0f\x96\x0f\ +\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10C\x10a\x10~\x10\ +\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x111\x11O\x11m\x11\ +\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12&\x12E\x12d\x12\ +\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13#\x13C\x13c\x13\ +\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14'\x14I\x14j\x14\ +\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x154\x15V\x15x\x15\ +\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16I\x16l\x16\x8f\x16\ +\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17e\x17\x89\x17\xae\x17\ +\xd2\x17\xf7\x18\x1b\x18@\x18e\x18\x8a\x18\xaf\x18\xd5\x18\ +\xfa\x19 \x19E\x19k\x19\x91\x19\xb7\x19\xdd\x1a\x04\x1a\ +*\x1aQ\x1aw\x1a\x9e\x1a\xc5\x1a\xec\x1b\x14\x1b;\x1b\ +c\x1b\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c*\x1cR\x1c{\x1c\ +\xa3\x1c\xcc\x1c\xf5\x1d\x1e\x1dG\x1dp\x1d\x99\x1d\xc3\x1d\ +\xec\x1e\x16\x1e@\x1ej\x1e\x94\x1e\xbe\x1e\xe9\x1f\x13\x1f\ +>\x1fi\x1f\x94\x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\xf2a\ +\xc3u\x94\x16\x98p\x88\x1eR\xa2\x05\xa3\xad\x89\x19\xde\ +N/\xa5\x11H\x18\x88/\x09\x1a\xd9\xee\xf8\x82m)\ +\x90)\xc6\x90\x19\xef@} da\xce8B\x8f\x81\ +\x04\xb2\xcb\xaf\xf3n\x1d\x12G\x17\x89\x1b|\x80-\x03\ +\x0d\x0f\xc5\xf3\x09\x19\xa3\xee\xb6\xb6\xf6\xe6\xdd\x0a\x1d\xa7\ +O\x00\x1d\xce\x0a\x00\x09\xc2\x1cDm\x06\x0ba\xc9\x22\ +\x0a/L\x22\x84\x97\xa9\x0e\xe8'\xb0nK\x08'=\ +\x80\x82\xcf\x82`?\xf9\x0e3\x1eVk\xad\x8f\x90\x9a\ +\xdcy\x9d4B\xdf\xba\xb1\x96\xb5\xec\x06\x81\x01k\xf1\ +\xc7\x19<\x01\x89\x13\xa9\x22\xc1\x980=g\x86\xec6\ +\x13\xa3\x84\xcf\xac\x07\x99\x0c\xf2\xed$b\x0f\x8f-'\ +ms7q#>s[\x85\xf0\xec\xae\xb9\xf2C\x1f\ +?\xac{\x83\xff\xdc\x03\xfc\x22\x08\xf5\xb7\xbc\x81\xef\xf1\ +\x1e\x1c\xbe8\xb5\x14w\x12\xfd\xe9\x1f\xbcu\xae\xda\x22\ +j\xdeZ\xed.\xd3-\xf0\xa4\xeeH\xb7\xaeL\x120\ +\x18\x16\xab\x02\x07k\x06He\x06\x1c\x81\xbaC\x80\xa0\ +\xf5\xc4\x14\x03\x904\x04F\x1e$\x8b\xd6\x16KD\xa6\ +\x84\x86\xe2\x01f\x100L\x0c+\x88\xfbb.ul\ +\xc8\xb6\xce\x96W\x0d\xec[P\x0e!\xcf\x82\x7f(\x8e\ +\x15\xd0p\x1b0BH\x89\x96\x18\xae\xc8\xa6\xaff\x17\ +\xc0i\x08`\x82H\x83\xe8\x1c\x01\xb0s\x09\xe4\xbfo\ +5\x05\x8cf\xfc\x09\xac\xc0pdXb&\xf3\x81\x8b\ +\x0a\xe1\xec\xbd\xc4\x86\x18\x90\xb8\x16\x8d\x8e\x0e\x00\x9a\xa6\ +\xab\x88\x91\xc0\x80\x0a\x04\x88\xfda\xf2\x1e\xe0\x97\x0d`\ +<\x9eO\x22#\x0e\xd6q\x90\xa0\xde\xb0\xa4\xf3J\xee\ +wh&\x16P\xf4\x1b\xe05\x0f\xa0@H\x8b|\x0c\ +Q\x04\x07Jj\xf6\x018\x18J\x88\x94\xe4\x82\xe5\xe1\ +\xcc\x1b\xef\xca\x06\xea\xcd\x0d\xe2.\xbbEb\xf2\xb0\x04\ +\x8f\xecl\xa9\xb0\xa8\xb7jP\xf8G6\x12\xd1@\x17\ +k\x82\x08\x84\x88=a\xca\x1b\xc0\x9f\x15 F\xa6\xb0\ +p\x15\xd0t\xa6d\x88\xc5f\xbe\x0f\x80\xb6\x830\x98\ +\xf7\xe2\x14\xfb\xaf\xbe\xcc\xb0\xa3\x13-\xef\x13lr\xbc\ +k4o'$\xfc\xafVHk\xe2\xfd\xc0~\x01\xe4\ +.{\xe6\x1e\x18\x11\xa0\x1e\x0c\xea\x01\x0c\xeeHj&\ +\x13\xc1\x0a\xee\xe1#\x09g\x91\x17\x09\xec3'\xd7\x00\ +\x22$d/z~\x91\x80\xdf1\x84\xc7g|\xef@\ +2\x03\xe1c\x1d\xe1\xba\xebD\x86\xaa\xa0\xd2\x08a\x97\ +\x1e\xe1|\x7f`g\x1f`~\xceA2\xfa\x04\x86>\ +\xe0\x9d `B>\xf0\xdc\xf6\xe25\x0e1\xc4\x220\ +\x06\x88\x10\x0a\xf3Pj\xec\xc0\x00\xe8!\x10\x15)\xc8\ +\x08\x80\xacH\x8c\xf2\x11\x8c\x92\x12\x00\xea\x7fj\xe0\x0b\ +\xd2D\x0e\xc4\x89\x0fAd\x13\xe1\x05% \xc4\xb6\x0d\ + \xc6,\xc7\x09\xf1y\x0e\x85v\xfcB0\xf3\x82\x09\ +\x03@8\x04D\x98\x14\xc1\xa0\xb8\xc4\x80\xc3A\xc7\x02\ +\xc0I\x19\xa5\x88\xa0`\x0a\x00\xcd`\xd4\x000\x03\xc4\ +\x80Y\x85z\x05\x81\xd5*!\xca\xdd\x8a\xcf!\x0e\xd5\ +\x1c\x0d\xe7\x0ep^\xa4rfd\xeeF\xbc\x8aR\xbc\ +\xc2\x0a\xfa\xc0\x98\x0b\xce\x12\x10\x01BH\x92(\x0d!\ +Y-\xa10o\x84\x00\x0a`\xce\x0f2\xe9-\xe4\x86\ +\x0fR\xf0\x0b\x01u/aR \x8c\xbf*\xa0d\x80\ +\xb2\x12\x9aq*\xbb\x92\xb7\x062 \xdfJ\x00\xee\x82\ +\x17,\xe1?,\x80\xc0H\x09\xdc\xd9@\xaa\x05A\xef\ +2\xe1\xeaRj\x16\x01r\xda\x15\x81\xae\x9b\xc0.\x03\ +\xa4\x80\xdb\xc1`\x13m\xb6\x0c\xc2\x104 \x1e\x02g\ +F\xe3\x13\x02\xb22a\x05\xcf-\x06\x10\xeb\x1b\xc2\x11\ +\x222\xc4!\x11\xa6\x01-\xa8\x13\xa1\x8a\x04\xf3\x80\x06\ +$\x80\x93\xa1p\x14\xb1f\x0b\x85&\xdbaJ\x09\x13\ +\x98\x0bD\x80\x8d\x01\xb0\x19\xb1\x04\x0c@v\xa3\x22\x0e\ +\xf6\xc7\xce\xff\xd1w6Q/6\x92\xbav\x89be\ +\x88^\xdf\x82\x19)@:\x13\xf3\xd0\x19\x0c<\x03D\ +\x80p@\xd6\xd5\x81V\xd5\xc4\xc0W\xa0\xd8\x0e\xb3\xec\ +\x12d\x81*!\xd4\x1c\xa5\x1a\x0c\x00o?A\xca\xdd\ +f\xbb\x122\xad\x0e\x13\x08VS\x0d6r\xb8\xcc\xf0\ +\xa7&\xb1;\x06\xc9l\x223\x80\x04\xe0`B!6\ +\x18o\x94D\xc2\xa5\x01\x81\x22\x0e\x8c\xf2\x11\xc4\x81$\ +@\xbc\x0e\xaf\xd0\xf3B@\xb9A\xec\x1ef6\xd8\x82\ +\x1d5@'\x052Z\xd8*AA3\xbbAlo\ +\x1c\xf0\x10\x1fNJ{\x821\x01\xe0\x92\xfe\xc1g\x1e\ +DQ3\xa1,\x12t\x8c\x0f\x0d\xd2%\x8d\xa4\x87\xe1\ +\x14\x0aT\x9c\x0c\xe4\x80<\x01\xfb\x0b\xe0\x98\xb0\xca|\ +\x22k\x1d\x16\xf0f!\xb1u\x00\x12\xb5AJ\xe0[\ +2\xbf\x18s\x18#I\x16\x09@\xb9,\xe1AHD\ +N\x1d\x94\xdc\x1c\xeer\x12\x80\xf38\x81L\xfe\x225\ +(\xc0\x0d9\x80\x90\x0bG$?@$\x02\xf4\xa22\ +\x01\xfb,\xe0\xc0\x16\xd5\x0c\x14\x821%\x8b!%\xc7\ +XY\xf1-\x1cq1A\x90\xecH\xe70\x1a\xb5,\ +\x19BAO@\xb3%!\x04\x14t\xd8H\x0e\x8f\x1a\ +\x01\x80\x16\x0c\xb6\x18\xe1p\x9d\xd3\xf4\x1c\x82\x08\xc4\x92\ +\x94\x03\xd4}\x19@\xa0\xf8\x80 H\x94\xa4\x0f\xd5l\ +\x0b\xb3\x88\x14\xecZt/\xb4\x9e\x93l \xef'Q\ +\xd4iR\x13\xbdRU~\xc0\xd3\x14\xc1\x02?\x22\xe0\ +\xa8\x10\xb5\x9c\x14\xe9\x80\xfe\x84P\x98k\x12\x0f`\xb4\ +\x17\x95\xb0\x15b@\xed\x14b\xf2LdV2\x16\x22\ +\x12\x1a\xae.\x9dX\xe2\x0aw\x15+R\xe2Q\x0c\x80\ +\xa0K\x01\x0c\x14\xec\x89ZB^w\x15\xaa\x0b,\x98\ +$\x93\xb0\xd8\x15\xbc}M\x86\xa9Qz\x11\x12h\x22\ +\xf2l%`S`\xa0f\x835[^BQ(\x13\ +\xec\x0e\xa0\xa4\xd1M\x18\xb5\xf4\x06Gm\xdf\x5c\xc2\x09\ +\x09\xd5\xc1K\xf4k1\x16, p\xeey\xb5\x94%\ +G\xc3\x22\x81S\x08`h\x08V\x14#\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01\xa0\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\xa0\x04\ +\x00\x01\x00\x00\x00`\x00\x00\x00\x03\xa0\x04\x00\x01\x00\x00\ +\x00`\x00\x00\x00\x00\x00\x00\x00\x00\x00Adobe\ + Photoshop Docum\ +ent Data Block\x00M\ +IB8nrTM\x00\x00\x00\x00MIB8r\ +yaL\xdc\x19\x00\x00\x01\x00\x03\x00\x00\x00\x03\x00\x00\ +\x00]\x00\x00\x00\x5c\x00\x00\x00\x04\x00\xff\xff\x9b\x0b\x00\ +\x00\x00\x00C\x04\x00\x00\x01\x00C\x04\x00\x00\x02\x00C\ +\x04\x00\x00MIB8mron\xff\x00\x08\x00<\ +\x01\x00\x00\x00\x00\x00\x00(\x00\x00\x00\x00\x00\xff\xff\x00\ +\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\ +\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\ +\x00\xff\xff\x07Layer 0MIB8i\ +nul\x14\x00\x00\x00\x07\x00\x00\x00L\x00a\x00y\ +\x00e\x00r\x00 \x000\x00\x00\x00MIB8r\ +snl\x04\x00\x00\x00ryalMIB8d\ +iyl\x04\x00\x00\x00\x03\x00\x00\x00MIB8l\ +blc\x04\x00\x00\x00\x01\x00\x00\x00MIB8x\ +fni\x04\x00\x00\x00\x00\x00\x00\x00MIB8o\ +knk\x04\x00\x00\x00\x00\x00\x00\x00MIB8f\ +psl\x04\x00\x00\x00\x00\x00\x00\x00MIB8r\ +lcl\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00M\ +IB8dmhsH\x00\x00\x00\x01\x00\x00\x00M\ +IB8tsuc\x00\x00\x00\x004\x00\x00\x00\x10\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x08\x00\x00\x00met\ +adata\x01\x00\x00\x00\x09\x00\x00\x00lay\ +erTimebuod\xc2\x93A\xe0\xf78\ +\xd6A\x00MIB8prxf\x10\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\ +\x00S\x00O\x00\x0f\x00\x0c\x00\x0a\x00\x09\x00\x09\x00\x09\ +\x00\x09\x00\x15\x00I\x00K\x00\x12\x00\x14\x00\x14\x00\x12\ +\x00\x13\x00\x13\x00\x13\x00#\x00!\x00\x1e\x00\x1d\x00\x1f\ +\x00\x1d\x00\x1d\x00\x1d\x00\x1c\x00\x1e\x00\x1d\x00(\x00'\ +\x00&\x00&\x00&\x00%\x00$\x00$\x00\x22\x00 \ +\x00 \x00\x1e\x00\x22\x00\x1f\x00\x1e\x00\x1e\x00\x1f\x00!\ +\x00 \x00 \x00#\x00!\x00%\x00%\x00$\x00'\ +\x00(\x00(\x00+\x00\x1d\x00\x1d\x00\x1d\x00\x1d\x00\x1c\ +\x00\x1d\x00\x1e\x00\x1e\x00\x1f\x00 \x00#\x00\x13\x00\x13\ +\x00\x13\x00\x12\x00\x14\x00\x12\x00\x13\x00\x13\x00M\x00L\ +\x00\x09\x00\x09\x00\x08\x00\x09\x00\x0a\x00\x0a\x00\x0c\x00L\ +\x00W\x00 \x00\xfd\x00\x04\x05\x11!-1\xfe/\xfc\ +0\x181//0110010/1/0\ +010/0110/01\xfe0\x0a/2\ +1100/00//\xfe1\x000\xfe1\x05\ +010/01\xfe0\xfe1\xff0\x081/0\ +/-'\x18\x08\x01\xfe\x00\xff\x00\x07\x01\x14X\xab\xdb\ +\xec\xf0\xf0\xfd\xf1\x00\xf0\xfe\xf1\x00\xf2\xfd\xf1\xff\xf0\x01\ +\xf1\xf0\xf8\xf1\x03\xf0\xf1\xf1\xf0\xfe\xf1\xfe\xf0\x07\xf1\xf0\ +\xf0\xf1\xf1\xf0\xf1\xf0\xfc\xf1\xff\xf0\x1b\xf1\xf0\xf0\xf1\xf2\ +\xf1\xf0\xf1\xf0\xf1\xf1\xf2\xf0\xf1\xf0\xf1\xf0\xf0\xf1\xf0\xee\ +\xe4\xc2|.\x06\x00\x00\xff\x00\x03\x16\x86\xed\xfd\xb3\xff\ +\x04\xf9\xbfA\x06\x00\x03\x00\x08l\xf4\xb0\xff\x03\xfe\xbd\ +*\x01\x02\x00$\xd0\xae\xff\x02\xf8x\x07\x02\x02O\xf6\ +\xad\xff\x01\xc0\x14\x02\x05r\xfd\xad\xff\x01\xe1#\x02\x08\ +\x86\xfe\xad\xff\x01\xed+\x02\x08\x8f\xfe\xad\xff\x01\xef-\ +\x02\x09\x91\xfe\xf1\xff\x00\xfe\xdb\xff\xfe\xfe\xfd\xff\x00\xfe\ +\xec\xff\x01\xef,\x02\x08\x91\xfe\xfa\xff\x17\xfe\xcf\xc2\xc3\ +\xc2\xc4\xc3\xc4\xc3\xc3\xc4\xc4\xc1\xc3\xc3\xc2\xc3\xc2\xc2\xc3\ +\xc2\xc3\xc4\xc4\xfe\xc2\xfd\xc3\x0a\xc2\xc3\xc3\xc2\xc3\xc3\xc2\ +\xc3\xc2\xc2\xc1\xfe\xc3\xff\xc4\xf9\xc3\x06\xc4\xc3\xc3\xc4\xc2\ +\xc3\xc4\xfe\xc3\xff\xc2\x01\xc7\xf1\xf9\xff\x01\xf0-\x02\x09\ +\x90\xfe\xfa\xff\x03\xfaK\x18\x17\xfc\x18\x16\x17\x18\x16\x19\ +\x17\x18\x19\x19\x18\x19\x18\x17\x18\x19\x19\x18\x17\x17\x19\x17\ +\x17\x19\x17\xfb\x18\x11\x17\x16\x18\x16\x19\x19\x17\x18\x18\x19\ +\x18\x18\x19\x17\x19\x18\x19\x18\xfd\x19\x08\x18\x19\x19\x18\x19\ +\x19\x17,\xc7\xf9\xff\x01\xf0,\x01\x09\x90\xf9\xff\x01\xf9\ +8\xc0\x00\x01\x15\xc0\xf9\xff\x01\xef.\x02\x09\x91\xfe\xfa\ +\xff\x01\xf97\xc0\x00\x02\x14\xc2\xfe\xfa\xff\x01\xf0-\x02\ +\x09\x90\xfe\xfa\xff\x01\xf88\xc0\x00\x02\x14\xc2\xfe\xfa\xff\ +\x01\xef/\x01\x08\x90\xf9\xff\x01\xf99\xc0\x00\x01\x14\xc1\ +\xf9\xff\x01\xf0/\x02\x09\x90\xfe\xfa\xff\x01\xf97\xc0\x00\ +\x01\x12\xc0\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x01\xf9\ +8\xc0\x00\x01\x14\xc2\xf9\xff\x01\xf1-\x02\x09\x90\xfe\xfa\ +\xff\x01\xfa8\xc0\x00\x01\x15\xc1\xf9\xff\x01\xef-\x01\x09\ +\x92\xf9\xff\x01\xf97\xe7\x00\x0d\x1aU\x87\xb8\xd5\xe6\xf7\ +\xf7\xe6\xd6\xb9\x88V\x1a\xe8\x00\x01\x15\xc2\xf9\xff\x01\xef\ +,\x02\x09\x91\xfe\xfa\xff\x01\xf98\xea\x00\x03\x1bw\xc7\ +\xfe\xf5\xff\x03\xfe\xc9x\x1d\xeb\x00\x01\x14\xc2\xf9\xff\x01\ +\xf0/\x01\x09\x90\xf9\xff\x01\xfa7\xec\x00\x028\xa8\xfb\ +\xef\xff\x02\xfb\xaa:\xed\x00\x01\x15\xc2\xf9\xff\x01\xef-\ +\x01\x09\x91\xf9\xff\x01\xf87\xee\x00\x01\x1c\xaa\xe9\xff\x01\ +\xac\x1e\xef\x00\x02\x14\xc1\xfe\xfa\xff\x01\xef/\x02\x08\x90\ +\xfe\xfa\xff\x01\xf98\xf0\x00\x02\x06x\xf4\xe7\xff\x02\xf5\ +z\x07\xf1\x00\x01\x15\xc2\xf9\xff\x01\xf0-\x02\x09\x91\xfe\ +\xfa\xff\x01\xf97\xf1\x00\x01F\xd9\xe3\xff\x01\xdbH\xf2\ +\x00\x01\x14\xc3\xf9\xff\x01\xf0/\x02\x09\x91\xfe\xfa\xff\x01\ +\xfa7\xf3\x00\x01\x02\x85\xdf\xff\x01\x88\x02\xf4\x00\x01\x15\ +\xc1\xf9\xff\x01\xf1-\x02\x09\x92\xfe\xfa\xff\x01\xf88\xf4\ +\x00\x01\x10\xb5\xdd\xff\x01\xb7\x10\xf5\x00\x01\x15\xc2\xf9\xff\ +\x01\xf0.\x01\x09\x90\xf9\xff\x01\xf98\xf5\x00\x01*\xda\ +\xdb\xff\x01\xdb+\xf6\x00\x01\x15\xc2\xf9\xff\x01\xf0.\x02\ +\x09\x90\xfe\xfa\xff\x01\xf99\xf6\x00\x01C\xf2\xd9\xff\x01\ +\xf3E\xf7\x00\x02\x15\xc3\xfe\xfa\xff\x01\xef-\x01\x08\x91\ +\xf9\xff\x01\xf97\xf7\x00\x01D\xf6\xd7\xff\x01\xf7E\xf8\ +\x00\x02\x14\xc2\xfe\xfa\xff\x01\xf0/\x02\x09\x91\xfe\xfa\xff\ +\x01\xf98\xf8\x00\x01F\xf7\xf0\xff\x07\xe5\x91H*\x0d\ +\x0c&\xe3\xee\xff\x01\xf7F\xf9\x00\x01\x14\xc1\xf9\xff\x01\ +\xf0.\x02\x09\x91\xfe\xfa\xff\x01\xf98\xf9\x00\x01G\xf7\ +\xf1\xff\x02\xe0S\x02\xfb\x00\x00\xdb\xed\xff\x01\xf7G\xfa\ +\x00\x01\x14\xc1\xf9\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\x01\ +\xf99\xfa\x00\x015\xf5\xf1\xff\x01\x8c\x09\xf9\x00\x00\xdb\ +\xec\xff\x01\xf54\xfb\x00\x01\x14\xc2\xf9\xff\x01\xf1.\x02\ +\x09\x92\xfe\xfa\xff\x01\xf99\xfb\x00\x01\x1e\xe7\xf2\xff\x01\ +\xfdj\xf7\x00\x00\xdb\xeb\xff\x01\xe7\x1d\xfc\x00\x01\x15\xc1\ +\xf9\xff\x01\xf0/\x02\x08\x93\xfe\xfa\xff\x01\xf98\xfc\x00\ +\x01\x0e\xd3\xf1\xff\x00d\xf6\x00\x00\xdb\xea\xff\x01\xd1\x0d\ +\xfd\x00\x02\x15\xc1\xfe\xfa\xff\x01\xef.\x02\x09\x91\xfe\xfa\ +\xff\x01\xf98\xfd\x00\x01\x01\xb4\xf1\xff\x00\x9f\xf5\x00\x00\ +\xdb\xe9\xff\x01\xb1\x01\xfe\x00\x01\x14\xc1\xf9\xff\x01\xef-\ +\x01\x08\x8f\xf9\xff\x01\xf99\xfd\x00\x00|\xf1\xff\x01\xdf\ +\x0a\xf5\x00\x00\xdb\xe8\xff\x00w\xfe\x00\x02\x15\xbf\xfe\xfa\ +\xff\x01\xee.\x02\x09\x92\xfe\xfa\xff\x01\xf89\xfe\x00\x01\ +<\xfc\xf1\xff\x00d\xf4\x00\x00\xdb\xe8\xff\x05\xfb7\x00\ +\x00\x14\xc2\xf9\xff\x01\xef.\x01\x09\x91\xf9\xff\x05\xf98\ +\x00\x00\x0e\xe0\xf1\xff\x01\xe0\x05\xf4\x00\x00\xdb\xe7\xff\x04\ +\xda\x0a\x00\x14\xc1\xf9\xff\x01\xf0-\x02\x09\x90\xfe\xfa\xff\ +\x04\xf98\x00\x00\x8d\xf0\xff\x00\x89\xf3\x00\x00\xdb\xe6\xff\ +\x03\x81\x00\x14\xc1\xf9\xff\x01\xef,\x02\x09\x90\xfe\xfa\xff\ +\x04\xf97\x00\x10\xf3\xf0\xff\x00@\xf3\x00\x00\xdb\xe6\xff\ +\x03\xee\x0c\x15\xc2\xf9\xff\x01\xf1.\x01\x09\x91\xf9\xff\x03\ +\xf98\x00v\xf0\xff\x01\xf6\x05\xf3\x00\x00\xdb\xe5\xff\x02\ +q\x14\xc3\xf9\xff\x01\xf1.\x02\x09\x92\xfe\xfa\xff\x03\xf9\ +9\x00\xb5\xf0\xff\x00\xdc\xf2\x00\x00\x22\xf7'\x00\xd9\xf0\ +\xff\x02\xb2\x13\xc2\xf9\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\ +\x03\xf97\x00\xd9\xf0\xff\x00\xc4\xe7\x00\x00\xbe\xf0\xff\x03\ +\xd7\x15\xc2\xfe\xfa\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\x03\ +\xf98\x00\xf6\xf0\xff\x00\xb3\xe7\x00\x00\xaf\xf0\xff\x02\xf6\ +\x14\xc1\xf9\xff\x01\xef.\x02\x09\x91\xfe\xfa\xff\x03\xf88\ +\x00\xdf\xf0\xff\x00\xc6\xe7\x00\x00\xc2\xf0\xff\x02\xde\x15\xc1\ +\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x03\xf97\x00\xbb\ +\xf0\xff\x00\xdd\xe7\x00\x00\xd9\xf0\xff\x03\xb9\x14\xc2\xfe\xfa\ +\xff\x01\xf1.\x02\x09\x91\xfe\xfa\xff\x03\xf98\x00\x88\xf0\ +\xff\x01\xf7\x06\xe9\x00\x01\x05\xf5\xf0\xff\x03\x84\x15\xc2\xfe\ +\xfa\xff\x01\xef.\x02\x09\x90\xfe\xfa\xff\x04\xf98\x00\x1f\ +\xfc\xf0\xff\x00B\xe9\x00\x00?\xf0\xff\x03\xf9\x1a\x14\xc1\ +\xf9\xff\x01\xef.\x02\x09\x92\xfe\xfa\xff\x04\xf97\x00\x00\ +\xa9\xf0\xff\x00\x8b\xe9\x00\x00\x89\xf0\xff\x03\x9e\x00\x15\xc2\ +\xf9\xff\x01\xf0.\x01\x09\x91\xf9\xff\x05\xf98\x00\x00\x22\ +\xf2\xf1\xff\x01\xe2\x06\xeb\x00\x01\x06\xe1\xf1\xff\x04\xef\x1b\ +\x00\x15\xc1\xf9\xff\x01\xef.\x01\x09\x91\xf9\xff\x01\xf97\ +\xfe\x00\x00^\xf0\xff\x00h\xeb\x00\x00g\xf0\xff\x04W\ +\x00\x00\x14\xc0\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x01\ +\xf98\xfd\x00\x00\x9f\xf1\xff\x01\xe1\x0b\xed\x00\x01\x0b\xe2\ +\xf1\xff\x00\x9a\xfe\x00\x01\x13\xc0\xf9\xff\x01\xf0.\x02\x09\ +\x91\xfe\xfa\xff\x01\xf97\xfd\x00\x01\x09\xce\xf1\xff\x00\xa4\ +\xed\x00\x00\xa5\xf1\xff\x01\xcc\x07\xfe\x00\x01\x14\xc1\xf9\xff\ +\x01\xf1.\x01\x09\x91\xf9\xff\x01\xfa8\xfc\x00\x01\x1d\xe5\ +\xf1\xff\x00j\xef\x00\x00l\xf1\xff\x01\xe4\x1b\xfd\x00\x01\ +\x15\xc1\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x01\xf97\ +\xfb\x00\x010\xf3\xf2\xff\x01\xfer\xf1\x00\x01u\xfe\xf2\ +\xff\x01\xf2/\xfc\x00\x01\x13\xc2\xf9\xff\x01\xf0-\x02\x09\ +\x91\xfe\xfa\xff\x01\xf99\xfa\x00\x01I\xfc\xf1\xff\x01\x95\ +\x0d\xf5\x00\x01\x0e\x98\xf1\xff\x01\xfcH\xfb\x00\x02\x15\xc2\ +\xfe\xfa\xff\x01\xf1.\x01\x09\x92\xf9\xff\x01\xf98\xf9\x00\ +\x01\x5c\xfc\xf1\xff\x02\xe6_\x05\xf9\x00\x02\x06`\xe8\xf1\ +\xff\x01\xfc\x5c\xfa\x00\x01\x15\xc2\xf9\xff\x01\xf0-\x02\x09\ +\x91\xfe\xfa\xff\x01\xf86\xf8\x00\x01Y\xfc\xf0\xff\x09\xee\ +\x9eV8\x1c\x1c8V\x9f\xef\xf0\xff\x01\xfcY\xf9\x00\ +\x02\x14\xc1\xfe\xfa\xff\x01\xf0-\x02\x09\x91\xfe\xfa\xff\x01\ +\xf98\xf7\x00\x01T\xfb\xd7\xff\x01\xfbU\xf8\x00\x01\x14\ +\xc2\xf9\xff\x01\xf0.\x02\x09\x92\xfe\xfa\xff\x01\xf86\xf6\ +\x00\x01P\xf7\xd9\xff\x01\xf8Q\xf7\x00\x01\x14\xc1\xf9\xff\ +\x01\xf0/\x01\x09\x91\xf9\xff\x01\xf98\xf5\x00\x013\xe1\ +\xdb\xff\x01\xe24\xf6\x00\x02\x15\xc1\xfe\xfa\xff\x01\xf0.\ +\x02\x09\x91\xfe\xfa\xff\x01\xf88\xf4\x00\x01\x14\xbd\xdd\xff\ +\x01\xbf\x15\xf5\x00\x01\x15\xc2\xf9\xff\x01\xf1-\x01\x09\x91\ +\xf9\xff\x01\xfa8\xf3\x00\x01\x03\x8b\xdf\xff\x01\x8e\x04\xf4\ +\x00\x01\x13\xc2\xf9\xff\x01\xf0.\x01\x08\x90\xf9\xff\x01\xf9\ +8\xf1\x00\x01I\xdb\xe3\xff\x01\xdcK\xf2\x00\x02\x14\xc2\ +\xfe\xfa\xff\x01\xf0.\x01\x09\x91\xf9\xff\x01\xf98\xf0\x00\ +\x02\x06x\xf4\xe7\xff\x02\xf4z\x07\xf1\x00\x01\x13\xc2\xf9\ +\xff\x01\xf0.\x02\x08\x91\xfe\xfa\xff\x01\xf97\xee\x00\x01\ +\x1b\xa6\xe9\xff\x01\xa8\x1c\xef\x00\x02\x15\xc0\xfe\xfa\xff\x01\ +\xef-\x02\x09\x91\xfe\xfa\xff\x01\xf89\xec\x00\x023\xa1\ +\xf8\xef\xff\x02\xf9\xa24\xed\x00\x01\x14\xc2\xf9\xff\x01\xef\ +-\x01\x09\x90\xf9\xff\x01\xf96\xea\x00\x03\x15m\xbd\xfb\ +\xf5\xff\x03\xfb\xben\x16\xeb\x00\x01\x14\xc0\xf9\xff\x01\xf1\ +,\x01\x09\x90\xf9\xff\x01\xf97\xe7\x00\x0d\x11Iz\xaa\ +\xc7\xd8\xe8\xe9\xd8\xc8\xabzJ\x11\xe8\x00\x01\x14\xc1\xf9\ +\xff\x01\xef/\x02\x09\x90\xfe\xfa\xff\x01\xf98\xc0\x00\x01\ +\x15\xc1\xf9\xff\x01\xf0-\x02\x09\x91\xfe\xfa\xff\x01\xf98\ +\xc0\x00\x01\x14\xc2\xf9\xff\x01\xef.\x02\x09\x91\xfe\xfa\xff\ +\x01\xf98\xc0\x00\x01\x14\xc1\xf9\xff\x01\xf0-\x01\x09\x91\ +\xf9\xff\x01\xf97\xc0\x00\x01\x14\xc1\xf9\xff\x01\xef.\x02\ +\x09\x90\xfe\xfa\xff\x01\xf99\xc0\x00\x02\x15\xc1\xfe\xfa\xff\ +\x01\xf0-\x01\x08\x91\xf9\xff\x01\xfa8\xc0\x00\x01\x15\xc1\ +\xf9\xff\x01\xf0.\x02\x09\x92\xfe\xfa\xff\x01\xf97\xc0\x00\ +\x01\x14\xc1\xf9\xff\x01\xf0-\x02\x09\x90\xfe\xfa\xff\x01\xf9\ +7\xc0\x00\x01\x14\xc3\xf9\xff\x01\xf1-\x02\x09\x91\xfe\xfa\ +\xff\x02\xfad;\xfe:\xfe9\x1589;;9:\ +:8;9:7:9:;99;:98\ +\xfd:\xff8\x017;\xfc9\x09;:9;;8\ +:979\xfe:\xff9\x09:89::8;\ +9J\xcf\xf9\xff\x01\xf0-\x01\x09\x91\xf8\xff\x00\xfa\xfd\ +\xf9\x08\xf8\xf9\xf9\xf8\xf9\xf8\xf8\xf9\xf8\xfd\xf9\x06\xfa\xf9\ +\xf9\xf8\xf9\xf8\xf8\xfe\xf9\x00\xf8\xfe\xf9\x0e\xf8\xf9\xf9\xf8\ +\xf9\xf8\xf9\xf8\xf8\xf9\xf8\xf9\xf9\xf8\xf8\xfd\xf9\x00\xf8\xfe\ +\xf9\x05\xf8\xf9\xf9\xf8\xfa\xfa\xfe\xf9\xff\xf8\x01\xf9\xfe\xf9\ +\xff\x01\xf0.\x02\x09\x91\xfe\xad\xff\x01\xf0.\x02\x08\x91\ +\xfe\xad\xff\x01\xee-\x01\x09\x8d\xac\xff\x01\xe9+\x02\x07\ +{\xfe\xad\xff\x01\xd5\x1f\x02\x04U\xf6\xae\xff\x02\xfd\xa3\ +\x0f\x02\x01'\xc9\xae\xff\x02\xe7Q\x03\x03\x00\x09]\xe9\ +\xb0\xff\x03\xf0\x80\x13\x00\xff\x00\x03\x12`\xcc\xf7\xfb\xfe\ +\x00\xff\xfc\xfe\x00\xff\xfe\xfe\x02\xff\xfe\xff\xfe\xfe\x05\xff\ +\xfe\xfe\xff\xfe\xff\xfd\xfe\x0a\xff\xfe\xff\xfe\xfe\xff\xfe\xff\ +\xff\xfe\xfe\xfc\xff\xff\xfe\xfe\xff\x04\xfe\xff\xfe\xff\xff\xfb\ +\xfe\xff\xff\xff\xfe\x02\xff\xfe\xff\xfc\xfe\x06\xfd\xf5\xcel\ +\x17\x00\x00\xff\x00\x08\x01\x0a.`\x86\x96\x97\x92\x92\xfe\ +\x91\xff\x92\x13\x93\x92\x92\x91\x92\x92\x90\x91\x92\x91\x90\x91\ +\x92\x91\x91\x93\x91\x91\x94\x91\xfc\x92\x05\x91\x92\x91\x91\x90\ +\x92\xfe\x91\x0f\x90\x92\x92\x93\x91\x90\x92\x92\x90\x92\x91\x90\ +\x91\x92\x92\x90\xfd\x91\x03\x93\x91\x90\x90\xfe\x91\x0b\x93\x90\ +\x90\x92\x8ayU+\x0c\x01\x00\x00\xfd\x00\x04\x01\x05\x0a\ +\x0c\x0b\xfb\x0a\x00\x09\xf2\x0a\xff\x09\xf0\x0a\x00\x09\xf6\x0a\ +\x00\x09\xee\x0a\x02\x08\x04\x01\xfd\x00\x01\x00\x02\x00\x02\x00\ +\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\ +\x02\x00\x02\x00\x02\x00\x02\x00\x06\x00\x06\x00\x06\x00\x06\x00\ +\x06\x00\x11\x00\x10\x00\x0c\x00\x0c\x00\x0e\x00\x0c\x00\x0f\x00\ +\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x12\x00\x11\x00\x14\x00\x10\x00\ +\x12\x00\x14\x00\x12\x00\x0e\x00\x0f\x00\x0f\x00\x10\x00\x0e\x00\ +\x0a\x00\x06\x00\x08\x00\x08\x00\x06\x00\x08\x00\x10\x00\x11\x00\ +\x14\x00\x16\x00\x16\x00\x15\x00\x14\x00\x14\x00\x17\x00\x14\x00\ +\x16\x00\x0c\x00\x0a\x00\x0e\x00\x0f\x00\x0f\x00\x0c\x00\x0e\x00\ +\x0e\x00\x0e\x00\x10\x00\x13\x00\x06\x00\x06\x00\x06\x00\x06\x00\ +\x06\x00\x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c\x01\xcf\x00\xf5\xcc\ +\xf4\xcc\xff\x00\x00\xce\xf0\xcc\x00\xcd\xeb\x00\x00\xcd\xf0\xcc\ +\x02\xcd\x00\x00\xf5\xcc\xf4\xcc\xfe\x00\x00\xcd\xf0\xcc\x00\xd0\ +\xed\x00\x00\xd0\xf0\xcc\x00\xcd\xfe\x00\xf5\xcc\xf4\xcc\xfe\x00\ +\x00\xe2\xf0\xcc\x00\xcd\xed\x00\xf0\xcc\x01\xcd\xda\xfe\x00\xf5\ +\xcc\xf4\xcc\xfd\x00\x00\xd3\xef\xcc\xef\x00\x00\xcd\xf0\xcc\x00\ +\xcf\xfd\x00\xf5\xcc\xf4\xcc\xfc\x00\x00\xcf\xf0\xcc\x00\xcd\xf1\ +\x00\xef\xcc\x00\xce\xfc\x00\xf5\xcc\xf4\xcc\xfb\x00\x00\xce\xf0\ +\xcc\x01\xcd\xd7\xf5\x00\x00\xda\xef\xcc\x00\xcd\xfb\x00\xf5\xcc\ +\xf4\xcc\xfa\x00\x00\xcd\xed\xcc\xf9\x00\x00\xd4\xee\xcc\x00\xcd\ +\xfa\x00\xf5\xcc\xf4\xcc\xf9\x00\x00\xce\xeb\xcc\xff\xd1\xff\xcc\ +\x00\xcd\xee\xcc\x00\xce\xf9\x00\xf5\xcc\xf4\xcc\xf8\x00\x00\xce\ +\xd4\xcc\xf8\x00\xf5\xcc\xf4\xcc\xf7\x00\xd5\xcc\xf7\x00\xf5\xcc\ +\xf4\xcc\xf6\x00\x00\xcd\xd9\xcc\x00\xcd\xf6\x00\xf5\xcc\xf4\xcc\ +\xf5\x00\x01\xcc\xcd\xdc\xcc\x00\xce\xf5\x00\xf5\xcc\xf4\xcc\xf4\ +\x00\x01\xff\xcd\xde\xcc\x00\xff\xf4\x00\xf5\xcc\xf4\xcc\xf2\x00\ +\x00\xce\xe0\xcc\xf2\x00\xf5\xcc\xf4\xcc\xf1\x00\x00\xd4\xe3\xcc\ +\x00\xda\xf1\x00\xf5\xcc\xf4\xcc\xef\x00\x00\xcf\xe7\xcc\x00\xd1\ +\xef\x00\xf5\xcc\xf4\xcc\xed\x00\x00\xcd\xeb\xcc\x00\xcd\xed\x00\ +\xf5\xcc\xf4\xcc\xeb\x00\x02\xce\xcd\xcd\xf1\xcc\x00\xd0\xeb\x00\ +\xf5\xcc\xf4\xcc\xe8\x00\x04\xd2\xce\xcc\xcc\xcd\xfa\xcc\x01\xce\ +\xd2\xe8\x00\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\ +\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\ +\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\ +\xcc\xc1\xff\xf5\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\ +\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\x01\x00\x02\ +\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\ +\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x06\x00\x06\x00\x06\ +\x00\x06\x00\x06\x00\x11\x00\x10\x00\x0c\x00\x0c\x00\x0e\x00\x0c\ +\x00\x0f\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x12\x00\x11\x00\x14\ +\x00\x10\x00\x12\x00\x14\x00\x12\x00\x0e\x00\x0f\x00\x0f\x00\x10\ +\x00\x0e\x00\x0a\x00\x06\x00\x08\x00\x08\x00\x06\x00\x08\x00\x10\ +\x00\x11\x00\x14\x00\x16\x00\x16\x00\x15\x00\x14\x00\x14\x00\x17\ +\x00\x14\x00\x16\x00\x0c\x00\x0a\x00\x0e\x00\x0f\x00\x0f\x00\x0c\ +\x00\x0e\x00\x0e\x00\x0e\x00\x10\x00\x13\x00\x06\x00\x06\x00\x06\ +\x00\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\x00\xd4\xef\xcc\x01\xcf\ +\x00\xf5\xcc\xf4\xcc\xff\x00\x00\xce\xf0\xcc\x00\xcd\xeb\x00\x00\ +\xcd\xf0\xcc\x02\xcd\x00\x00\xf5\xcc\xf4\xcc\xfe\x00\x00\xcd\xf0\ +\xcc\x00\xd0\xed\x00\x00\xd0\xf0\xcc\x00\xcd\xfe\x00\xf5\xcc\xf4\ +\xcc\xfe\x00\x00\xe2\xf0\xcc\x00\xcd\xed\x00\xf0\xcc\x01\xcd\xda\ +\xfe\x00\xf5\xcc\xf4\xcc\xfd\x00\x00\xd3\xef\xcc\xef\x00\x00\xcd\ +\xf0\xcc\x00\xcf\xfd\x00\xf5\xcc\xf4\xcc\xfc\x00\x00\xcf\xf0\xcc\ +\x00\xcd\xf1\x00\xef\xcc\x00\xce\xfc\x00\xf5\xcc\xf4\xcc\xfb\x00\ +\x00\xce\xf0\xcc\x01\xcd\xd7\xf5\x00\x00\xda\xef\xcc\x00\xcd\xfb\ +\x00\xf5\xcc\xf4\xcc\xfa\x00\x00\xcd\xed\xcc\xf9\x00\x00\xd4\xee\ +\xcc\x00\xcd\xfa\x00\xf5\xcc\xf4\xcc\xf9\x00\x00\xce\xeb\xcc\xff\ +\xd1\xff\xcc\x00\xcd\xee\xcc\x00\xce\xf9\x00\xf5\xcc\xf4\xcc\xf8\ +\x00\x00\xce\xd4\xcc\xf8\x00\xf5\xcc\xf4\xcc\xf7\x00\xd5\xcc\xf7\ +\x00\xf5\xcc\xf4\xcc\xf6\x00\x00\xcd\xd9\xcc\x00\xcd\xf6\x00\xf5\ +\xcc\xf4\xcc\xf5\x00\x01\xcc\xcd\xdc\xcc\x00\xce\xf5\x00\xf5\xcc\ +\xf4\xcc\xf4\x00\x01\xff\xcd\xde\xcc\x00\xff\xf4\x00\xf5\xcc\xf4\ +\xcc\xf2\x00\x00\xce\xe0\xcc\xf2\x00\xf5\xcc\xf4\xcc\xf1\x00\x00\ +\xd4\xe3\xcc\x00\xda\xf1\x00\xf5\xcc\xf4\xcc\xef\x00\x00\xcf\xe7\ +\xcc\x00\xd1\xef\x00\xf5\xcc\xf4\xcc\xed\x00\x00\xcd\xeb\xcc\x00\ +\xcd\xed\x00\xf5\xcc\xf4\xcc\xeb\x00\x02\xce\xcd\xcd\xf1\xcc\x00\ +\xd0\xeb\x00\xf5\xcc\xf4\xcc\xe8\x00\x04\xd2\xce\xcc\xcc\xcd\xfa\ +\xcc\x01\xce\xd2\xe8\x00\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\ +\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\ +\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\ +\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\ +\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\ +\x01\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\ +\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x06\x00\ +\x06\x00\x06\x00\x06\x00\x06\x00\x11\x00\x10\x00\x0c\x00\x0c\x00\ +\x0e\x00\x0c\x00\x0f\x00\x0e\x00\x0e\x00\x0e\x00\x0e\x00\x12\x00\ +\x11\x00\x14\x00\x10\x00\x12\x00\x14\x00\x12\x00\x0e\x00\x0f\x00\ +\x0f\x00\x10\x00\x0e\x00\x0a\x00\x06\x00\x08\x00\x08\x00\x06\x00\ +\x08\x00\x10\x00\x11\x00\x14\x00\x16\x00\x16\x00\x15\x00\x14\x00\ +\x14\x00\x17\x00\x14\x00\x16\x00\x0c\x00\x0a\x00\x0e\x00\x0f\x00\ +\x0f\x00\x0c\x00\x0e\x00\x0e\x00\x0e\x00\x10\x00\x13\x00\x06\x00\ +\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x06\x00\x02\x00\ +\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\x02\x00\ +\x02\x00\x02\x00\x02\x00\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\ +\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\ +\xa8\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\ +\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\ +\xf4\xcc\xe8\x00\x03\xcd\xcc\xcc\xcd\xf8\xcc\x00\xcd\xe8\x00\xf5\ +\xcc\xf4\xcc\xeb\x00\x02\xcf\xcd\xcd\xf1\xcc\x00\xd3\xeb\x00\xf5\ +\xcc\xf4\xcc\xed\x00\xea\xcc\x00\xce\xed\x00\xf5\xcc\xf4\xcc\xef\ +\x00\x00\xd1\xe6\xcc\xef\x00\xf5\xcc\xf4\xcc\xf1\x00\x00\xd4\xe3\ +\xcc\x00\xda\xf1\x00\xf5\xcc\xf4\xcc\xf2\x00\xe0\xcc\x00\xcd\xf2\ +\x00\xf5\xcc\xf4\xcc\xf4\x00\x01\xff\xcd\xde\xcc\x00\xff\xf4\x00\ +\xf5\xcc\xf4\xcc\xf5\x00\x00\xcf\xdb\xcc\x00\xcf\xf5\x00\xf5\xcc\ +\xf4\xcc\xf6\x00\x00\xce\xd9\xcc\x00\xcf\xf6\x00\xf5\xcc\xf4\xcc\ +\xf7\x00\x00\xcd\xd7\xcc\x00\xce\xf7\x00\xf5\xcc\xf4\xcc\xf8\x00\ +\x00\xce\xd5\xcc\x00\xce\xf8\x00\xf5\xcc\xf4\xcc\xf9\x00\xec\xcc\ +\x04\xcd\xce\xd7\xd4\xd0\xeb\xcc\xf9\x00\xf5\xcc\xf4\xc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x00\xd4\xeb\x00\x00\xd4\xef\ +\xcc\x01\xcf\x00\xf5\xcc\xf4\xcc\xff\x00\x00\xce\xf0\xcc\x00\xcd\ +\xeb\x00\x00\xcd\xf0\xcc\x02\xcd\x00\x00\xf5\xcc\xf4\xcc\xfe\x00\ +\x00\xcd\xf0\xcc\x00\xd0\xed\x00\x00\xd0\xf0\xcc\x00\xcd\xfe\x00\ +\xf5\xcc\xf4\xcc\xfe\x00\x00\xe2\xf0\xcc\x00\xcd\xed\x00\xf0\xcc\ +\x01\xcd\xda\xfe\x00\xf5\xcc\xf4\xcc\xfd\x00\x00\xd3\xef\xcc\xef\ +\x00\x00\xcd\xf0\xcc\x00\xcf\xfd\x00\xf5\xcc\xf4\xcc\xfc\x00\x00\ +\xcf\xf0\xcc\x00\xcd\xf1\x00\xef\xcc\x00\xce\xfc\x00\xf5\xcc\xf4\ +\xcc\xfb\x00\x00\xce\xf0\xcc\x01\xcd\xd7\xf5\x00\x00\xda\xef\xcc\ +\x00\xcd\xfb\x00\xf5\xcc\xf4\xcc\xfa\x00\x00\xcd\xed\xcc\xf9\x00\ +\x00\xd4\xee\xcc\x00\xcd\xfa\x00\xf5\xcc\xf4\xcc\xf9\x00\x00\xce\ +\xeb\xcc\xff\xd1\xff\xcc\x00\xcd\xee\xcc\x00\xce\xf9\x00\xf5\xcc\ +\xf4\xcc\xf8\x00\x00\xce\xd4\xcc\xf8\x00\xf5\xcc\xf4\xcc\xf7\x00\ +\xd5\xcc\xf7\x00\xf5\xcc\xf4\xcc\xf6\x00\x00\xcd\xd9\xcc\x00\xcd\ +\xf6\x00\xf5\xcc\xf4\xcc\xf5\x00\x01\xcc\xcd\xdc\xcc\x00\xce\xf5\ +\x00\xf5\xcc\xf4\xcc\xf4\x00\x01\xff\xcd\xde\xcc\x00\xff\xf4\x00\ +\xf5\xcc\xf4\xcc\xf2\x00\x00\xce\xe0\xcc\xf2\x00\xf5\xcc\xf4\xcc\ +\xf1\x00\x00\xd4\xe3\xcc\x00\xda\xf1\x00\xf5\xcc\xf4\xcc\xef\x00\ +\x00\xcf\xe7\xcc\x00\xd1\xef\x00\xf5\xcc\xf4\xcc\xed\x00\x00\xcd\ +\xeb\xcc\x00\xcd\xed\x00\xf5\xcc\xf4\xcc\xeb\x00\x02\xce\xcd\xcd\ +\xf1\xcc\x00\xd0\xeb\x00\xf5\xcc\xf4\xcc\xe8\x00\x04\xd2\xce\xcc\ +\xcc\xcd\xfa\xcc\x01\xce\xd2\xe8\x00\xf5\xcc\xf4\xcc\xc1\xff\xf5\ +\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\ +\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xf4\ +\xcc\xc1\xff\xf5\xcc\xf4\xcc\xc1\xff\xf5\xcc\xa8\xcc\xa8\xcc\xa8\ +\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\xcc\xa8\ +\xcc\xa8\xccMIB8ksML\x0e\x00\x00\x00\x00\ +\x00\xff\xff\x00\x00\x00\x00\x00\x002\x00\x80\x00\x00\x00M\ +IB8ttaP\x00\x00\x00\x00MIB8k\ +sMF\x0c\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\ +\x002\x00\x00\x00\x00\x00\ +\x00\x00\x05}\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22 standalone=\x22\ +no\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + eye on<\ +/title>\x0d\x0a Created with \ +Sketch.\x0d\x0a\ + \x0d\x0a \x0d\x0a <\ +path d=\x22M62.3998\ +86,20.262032 C61\ +.0656979,18.1619\ +773 49.0033003,3\ +.55271368e-15 32\ +.0083577,3.55271\ +368e-15 C15.0134\ +15,3.55271368e-1\ +5 2.9510174,18.1\ +619773 1.5499679\ +5,20.262032 C-0.\ +516655982,23.447\ +0641 -0.51665598\ +2,27.7140347 1.5\ +4996795,30.97200\ +66 C2.9510174,32\ +.9991215 15.0134\ +15,50.9422798 32\ +.0083577,50.9422\ +798 C49.0033003,\ +50.9422798 61.06\ +56979,32.9991215\ + 62.399886,30.97\ +20066 C64.533371\ +3,27.7140347 64.\ +5333713,23.44706\ +41 62.399886,20.\ +262032 L62.39988\ +6,20.262032 Z M3\ +2.0083577,39.943\ +5857 C24.6110597\ +,39.9435857 18.6\ +786333,33.503620\ +9 18.6786333,25.\ +4711399 C18.6786\ +333,17.5115986 2\ +4.6110597,10.998\ +6941 32.0083577,\ +10.9986941 C32.7\ +407935,10.998694\ +1 33.4732293,11.\ +0716338 34.14184\ +3,11.2175131 L34\ +.141843,23.15530\ +55 L45.1405371,2\ +3.1553055 C45.27\ +12206,23.8786238\ + 45.338082,24.67\ +48819 45.338082,\ +25.4711399 C45.3\ +38082,33.5036209\ + 39.3387943,39.9\ +435857 32.008357\ +7,39.9435857 L32\ +.0083577,39.9435\ +857 Z\x22 id=\x22Shape\ +\x22 fill=\x22#CCCCCC\x22\ +>\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x1f\xef\ +\x00\ +\x00\xe4\x14x\x9c\xed\x5c\x07\x5cS\xc7\x1f\xbf\x0c\x12\xf6\ +^2c\x98*\x10\xc2&\xc8\xde\x0a\x82l\x14\x85\x90\ +\x04\x88\x84$f\x80\xab\xe2\xaa\xd6U\x95\xba\xb5uo\ +\xc5\xd6]\xad\xdb\xd6Z\xf7\xb6u\xfc\xb1\xd6\xbaW\x15\ +\xb5\xa8\xf0\xbf{!\x10\x10-J\x00\xfb\xff\xbfo>\ +\xf7r\xef\xd6o\xdc\xbd\xbb\xdf\xdd\xbb{\x89\x89\xa0;\ +\x00@\x13\x98\x83Z@\x86>\x02P\x5cH\xd8_\x1e\ +\xbc\x10T\xfcD\xcc\x0f\xd3\x11\xcc\x09\xa4\xfap\x98\x98\ +@\xa9\xf7\x13\xe1\xc5HYN\xeam\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\xe4\x06\xd3\xcb\xe8\xa1! \x22>\x91\xec\x84\ +\x9d93\x04\xcd\x80\xc5\xb10\xef\xcd\xfax\xect\x1e\ +\xd0\x11K\xf8BY\x92\x5c&\x96\xcb\xe0-:&\x07\ +\x92\xa5\xb2\xd4|\x91H\x80\xa5\x88\x17\xcax<\xa1\xbc\ +D\xe9G\xff\x91\x02\x09\xba7\xc0\xf2\xa6\xf2\x87\xa0\x14\ +\x11|\x19\xca\xd3X&O\xd2\x87]\xc2K\x8b\xceJ\ +k \xa6\xc8\x90,\x11\x89\x0aRy2\xb98)\x7f\ +\x10\x07\x06\xeb\x82d \x01\x22\xf8+\x004\x90\x0ax\ +@\x06\xe4@\x8ce\xd1\x167\xa4V\x16\x13!\x90\x09\ +\xeb9\xd2\xcd\x97\xf3\x052\xbe\x10+\x12\xdeka\xa9\ +#\x13\xb3{+$\x0eB\xe9\x89\xeeM$6V\x91\ +8\x09;y \x85\xa1\x16\x98\x5cb\x99P)\x04\x14\ +2_\xd2p\x93R(Ml\x8c\x91\x08#\x1bo\x84\ +\xb2\xc6\x9b\x84|\x81\xb4\xe1\xa6O\xa1\xac\xb4\xe1&\xba\ +D\x10\xd5p\x03\xf5\xd8Xt\x04\xa7\xb8\xb0^\x11\x0a\ +\x06AJlD$P\x1c\x9b\x04)\x5c\x1a\x8d+\x92\ +\xe7\x87\x89\xaa\x1a*3V\x22|+,B\xf0v\xba\ +\x08\x097-](\x8bqH\x11\xc8T\x1bC\x84\x80\ +Kk)\ +\x8b\xae2\x06\xb1\xa0\x12\xae\xa7\x0cO\xe1\x17\x16\xa9F\ +\xe8(# o\x0d\xc1\xa8\xe5\x90\x1e(x\x00q@\ +q\xf6\xb3\xfe\x1fkU\xceX\x9c~\xa3\x04\xa1\xa3\xea\ +s=T\x90\xd3M\x93\xb0\x85R1[\xc2\x13r\x86\ +*Z\xa2\x19\x16c\x87bA\x1al\xedl \x04R\ +\xd8\xc6\xd9\xd0\xcf\x83~\x0e\x18Z\xff\x94\xfab)\x8d\ +0z\xa0\xae\xae\x9e\x04\x97\xa0\x88\xb5\xc5\xee\xc8J>\ +\xc9z\x0d\xf7v\xd8}\x97\xa6\xf7\xa4\xa7\xd8\xbd\x96\x92\ +SE).\x8a\xfeA[\xd9\xe0\x14r\x91\xaa1\x7f\ +\x1c`\x14\x14\xc0\x18\x01\xbcR\xea3)B\x96\xcc\x9b\ +\xdf\x10\xe2\x85]\xfb\xc1\xab2\xc4\x17\xbb\xba7\x86`\ +e\xbe\xc4\xfcb$IK \xddF\xd1\xea\x8f\xc3t\ +\xa1\x90\x8dX\x7fGlr\xe7\xa9\xe0\xb1^\xab\xee\xd8\ +\x1d\x05\xd3\x07\x09\x0b\xd1\xac\xaf\x7f\xac\x16\x88a\x0aW\ +\x9f\xd7\xaeY\x1dX!\x1f\xc9\xb7Ar\x05\xf2\xea\x9d\ +B;oC5L5m\x8b\x09\x94h\xec\xc6\x80P\ +.\x10(\x04\x02\x94|\x91\x5c\xc8\x956\xebE82\ +\xa6\x92M\xf4\xe8\xa94{\xd0\xec\xf9\x00\x11\x8d\xcf\x11\ +\xc6FJ\xe3c\x82\xee)R\x01\x9f\xc3\x93f\x08\x12\ +\xd0\x83NhBG\x03\x8b\x83\x1ec\xe8\xa8\xd8M|\ +\x94J\xd9\xd4B\x89H.n\x12D\x11a\xc7\xff\x94\ +}xt*\xca\xa48\x12\x08\xef\xf5\xd8r\x99(\x96\ +'\xe4I\xd0q<\x8c\xfb\xa1b\xe5\x10\xa4\xadH\x8c\ +BPL|I!\xad\x03\xe4'\xc9%\x82&\x03\x19\ +\xa6\xfc\xa6!\x89\xd2\xc2\xa6\x83\x1d\x85-\x90\xa5\xb1\x0b\ +\x9b\x84\xe9sx0\x1fo\x88,^\x1a\x97\x96\x98\xa0\ +\xecN5\x95\xc1M\x12k\x15\x89$\xc3\xc2\x05\xfcB\ +\xa5\xa6\x0c\x14\xc2\xc7)\x83\x91v\xb9\xbc\x02\xb6\x1c\xeb\ +O\xb5J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b9x\x89\xcetv\xb6\xde\xd4\x0d\ +4G\xe8\x8c}#J\x87\xf6\x5c@\x1ez\xb7\xc4\x1b\ +\xb2\xf9\x91\xbd\xa5\x9a\x1e\xceEf\xb7\xc6\x06\xfe7\xa1\ +\x93\xce\xbf?k\xcd\xf9w\xb4\xae\x8e\xf6\x9d\xab\xe6M\ +JJ\xfa\x11\x9d\xf5\xef(\xfdt\x14\xd0\xda\x0a\xfaf\ +D{\xeb\x1e}\xdb\x03\xcd\x19Z\xcb\x17\xda\xe7\xd9\x9c\ +/4\x1fD\xdf\xbchO}t\x16\x90\x8d\x14\x1e\x1e\ +\xbe\xa4\xd9\xf9\xf969\xf4\xae\x10\xed\x8dh\xcb9\x22\ +\xb4\x16\xd5l\x1fd\x8d:\xd7\x08?5 \xbb\x0f}\ +\xdb\x06\xd9J\x1f3wCy\xd0>+X\x86\x10\x96\ +e\xae\x0e\x9e\xac\xac\xac\xc2\xd17\x8eT\xe9\xa09\xf7\ +\xff\xfa\xb7\xbf\xa8T\xaa\x11\x1a\xabQ\x9f\x8d\xde\xe7\xa2\ +o2eff^Bk\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + <\ +/circle>\x0d\x0a \ + \x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x00\x04\x5c\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / error / Edit\ +or only\x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a \ +\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x15\xcc\ +I\ +I*\x00j\x08\x00\x00\x80?\xe0@\x08$\x16\x0d\x07\ +\x84BaP\xb8d6\x1d\x0f\x88DbQ8\xa4V\ +-\x17\x8cFcQ\xb8\xe4v\x0b\x02\x7f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xc8\ +\xc4N\x16\xa0\xa6z\x0a\x01\xa2\xb3\x11\x1c\x02O\x03\xf8\ +a=\x9e\xa9y\xad?\x82g\xb5\x05%\x80\x02\xe22\ +y\xcf\x00 I=\x86\x11\x8a;5\xaa\xd4\x82\x9f6\ +\xa2\xf19j\x82\x89H\xa9\xea\xcf\x00B\x88eO\x97\ +j\x19\x9dQ\x8b\xc7\xf5LONh\x93BJ\xc1#\ +b=I*\x95\x82\x9bJ\x22F}l 2g\xe9\ +~\x8a\x9f\x14\xc4\xcb]\xa9\x918\xb6\x82\x94H(\x04\ +\x88\x9fm\x08U\x04\x9b\x88\xd5d\xb2H\x90\xdb\x1c\x8d\ +D\xe5\xa2\x0a%\xa2\xa3\xa4\xcaF\xab0\x01(\x90C\ +\xe8\xa1)2\x8d\xb6u\xa2\xbaY\xea]h\x86\xc2n\ +\x8b\xa4\xed \x80:\x22i\xc1!\x8bB~\xab&\xbd\ +\xf4\x06\x9e\xb7\xed\x9a\x82\x02\xc8\x89\xc72\x83\xd74\xc4\ +\xbd\xdc\xebm\xd6\x86@\x02\x9a@VULh\xdd\x04\ +\x92k\x1cNG \xa3\x8a*\x19\xcc\xb1|\xeb\x84\xae\ +WJ\x95\x85\xa1p\x012\x90\x0c\xc8\xa852\x9c\xeb\ +\x1dFg\x07U1\xfcb\xe2 \x08\xf1\x04\x912\xae\ +@\xb7\xe4J>H\x85D\xe5\xb2\x0a$\xa2'\xac\xca\ +\xec-\x19x+\x99Q\xc8\x849\x0fgX:\xf1\x9e\ +\xa8\xd9\xfa\x13\x13\x9a\x08(^\x88\x9bs(L\xb7\xc4\ +\xe7\xda\x0a\x02\x22%\x84\xca(\xea+\xf6\xa8\xa2\xea\xc8\ +DO\xa6\x82\xa8\x89\xb12\xb2\xabtO^\xde(\x89\ +\x932\x87\x1bLE\x9d\xad\x1bj\x0f\x13\xb8\xe8$\xc0\ +\x88nr\x96\xea\xb6\xee\xe8-\xe4\x88\x1a\x93,\xe1\x8f\ +\xeaK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x09\x1cD#\xec\x92\x94$>Q\ +\xc891!\xe4\xd1t\x95\xb2\xbc\x87\xcb\x10a\x1a\xc9\ +\xdcn\x04*\xe4 \x12\x00(hG8\x07\x99B\xf0\ +\xe2\x8e\x82{-d\xbc\x85\x932&M\x90\x06k5\ +\x80\x00\x82\x8f\xe0\xb0\x88L*\x0a\x04\x86\x83\x06\x11\x07\ +\xac.'\x14\x8a\xc5\xa1,\xc8\xc8*\x10\x88\x84\x1b!\ +\x00\x18\xbb\xec\x03$A\x0c\xa4\xe8\x89 \x05\xf9\x17\x96\ +\xcb\xa2\x8d\x09\x88\xb1\xf94i\xcb\xe1J!\x9c\xe8\xbf\ +7\x9e\xcf\xa7\xf4\x08\xbb\xfe\x87A\xa2\xd1\xa8\xf18\x14\ +\x0e\x11\x07\x9b\xc3@\x90\xf8\x8d\x22z\xda\xaa\x81\xdeU\ +\x86D aS\x82\xad\x86\x96\x02]v\x7f1hL\ +\xe6\xb4\x09\xcc\xee\xc7l\xb6\xcbho\xfbu\xca\xe7J\ +\x82A\xa7\xb4\xfa\x88\xc2%s\x89\xc6Y\x88xA\xe2\ +\xe7*4N\x86i\x9b\xecN\xcbg~M\xa7\xf6\xa1\ +\x9c\xf3\x15\x94\xae\xdc2\xb9\x8a\x0d\xd6\x99x\x87D/\ +y[\xf8>\x10\xeb\x84\x01r\x8e\x9c8jT\xfe\xca\ +\xe3&\x98\xebN\x1f'\x99\xda\xcf\xb2\xfbm\xcc_7\ +w\xa7g\xaaYFw\x08\x8a\xfe\xe2\xae\xb6\xd4\xf1>\ +}\xb5\xae\x99l1\xf3\xec\x8e\xd3u\xd4\x8an:\xbd\ +\x88.\xf0\x01M\x97\xdes\xf7\xccU\xfc\xa3\x08Wu\ +\x06v\x01\xa3;\x9bf\xe7\xec\xad}\x9f\x8c\x17\xaf\xf2\ +\xddv\xfb\xb2\xee\xff\x03\x14\xcf\xfe\x8c\x0f\xd8\x00\xcfm\ +\x80\x88\x10\x13\x0b s\xb9\xecc]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8c?\x00\ +\xc4s5\x0b\x04\xce\x11\x5c\xc1\x09\xcc\xb3\xb8\xfa\xe5\xb2\ +\x12\xeb+@E\xb2\xec\x8dJ/\x90\x81\x05=J\x85\ +E\xc0\xf8\xd1\x9f\x10\x81\x08%4\xe4\x90\xa0I\xc3!\ +\x87S\xceW\x1dy\x0bR\xaa\xd0\x00T\xd8vt$\ +\x8da\xc7M\xa1\x13\xd22\x05(oB\x09\x0d\xb7h\ +\x14Xr\xc3uB\xb6\xfcl\xd8\xdf\x80\xd3\xd7\x81t\ +\x01\xfd\xeb,2\xd8p\xe9\x08K8W\xcf:\xda\x12\ +\xa0\x01\x7f\x88\x90R\xe1\xa6\xe3.\xc3\xd1*\x0d\x98s\ +_|\xca9\xecK\x90BVP\xc5\xb0\x95\xd0P\xb7\ +\x97\xa2\xcc \x1b\xad\x18B\xee\xc0\xdeBz\x0c\x83\xb4\ +\xea\xbb~\xe2\xe9\xed\xbb\x9e\xf3\xbd\x9d;\xbe\xfb\xc1\xf0\ +\x9f/\x03\xc3\xf1\xbcy\xd7\x8e\xf2<\xbf1\xf5\xf1|\ +\xdfC\xd1\xc8|\xafK\xd5\xf5\x96\xef?\xd7\xf6\xbd\xbf\ +g\xdb\xf7\xbd/w\xdf\xf8\xbc\xbf\x87\xe3\xf9\xbc/\x97\ +\xe7\xfa\xbb\x9f\xa7\xeb\xfb\xb8\xcf\xb7\xef\xfc\xb6\x8f\xc7\xf3\ +\xfd\xb4o\xd7\xf7\xfe\xb2\xc4\x04\x13\x00\xfe\x00\x04\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\x01\x04\x00\x01\x00\x00\x00`\ +\x00\x00\x00\x01\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x02\ +\x01\x03\x00\x04\x00\x00\x00T\x09\x00\x00\x03\x01\x03\x00\x01\ +\x00\x00\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00\x11\x01\x04\x00\x01\x00\x00\x00\x08\x00\x00\x00\x15\ +\x01\x03\x00\x01\x00\x00\x00\x04\x00\x00\x00\x16\x01\x04\x00\x01\ +\x00\x00\x00`\x00\x00\x00\x17\x01\x04\x00\x01\x00\x00\x00b\ +\x08\x00\x00\x1a\x01\x05\x00\x01\x00\x00\x00\x5c\x09\x00\x00\x1b\ +\x01\x05\x00\x01\x00\x00\x00d\x09\x00\x00\x1c\x01\x03\x00\x01\ +\x00\x00\x00\x01\x00\x00\x00(\x01\x03\x00\x01\x00\x00\x00\x02\ +\x00\x00\x001\x01\x02\x00\x10\x00\x00\x00l\x09\x00\x00=\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00R\x01\x03\x00\x01\ +\x00\x00\x00\x02\x00\x00\x00S\x01\x03\x00\x04\x00\x00\x00|\ +\x09\x00\x00s\x87\x07\x00H\x0c\x00\x00\x84\x09\x00\x00\x00\ +\x00\x00\x00\x08\x00\x08\x00\x08\x00\x08\x00\x802\x02\x00\xe8\ +\x03\x00\x00\x802\x02\x00\xe8\x03\x00\x00paint\ +.net 4.0.9\x00\x01\x00\x01\x00\x01\ +\x00\x01\x00\x00\x00\x0cHLino\x02\x10\x00\x00m\ +ntrRGB XYZ \x07\xce\x00\x02\x00\ +\x09\x00\x06\x001\x00\x00acspMSFT\x00\ +\x00\x00\x00IEC sRGB\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\ +\x00\xd3-HP \x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x11cprt\x00\x00\x01P\x00\ +\x00\x003desc\x00\x00\x01\x84\x00\x00\x00lw\ +tpt\x00\x00\x01\xf0\x00\x00\x00\x14bkpt\x00\ +\x00\x02\x04\x00\x00\x00\x14rXYZ\x00\x00\x02\x18\x00\ +\x00\x00\x14gXYZ\x00\x00\x02,\x00\x00\x00\x14b\ +XYZ\x00\x00\x02@\x00\x00\x00\x14dmnd\x00\ +\x00\x02T\x00\x00\x00pdmdd\x00\x00\x02\xc4\x00\ +\x00\x00\x88vued\x00\x00\x03L\x00\x00\x00\x86v\ +iew\x00\x00\x03\xd4\x00\x00\x00$lumi\x00\ +\x00\x03\xf8\x00\x00\x00\x14meas\x00\x00\x04\x0c\x00\ +\x00\x00$tech\x00\x00\x040\x00\x00\x00\x0cr\ +TRC\x00\x00\x04<\x00\x00\x08\x0cgTRC\x00\ +\x00\x04<\x00\x00\x08\x0cbTRC\x00\x00\x04<\x00\ +\x00\x08\x0ctext\x00\x00\x00\x00Copyr\ +ight (c) 1998 He\ +wlett-Packard Co\ +mpany\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00\x12sRGB IEC61966\ +-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\ +sRGB IEC61966-2.\ +1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00\xf3Q\x00\ +\x01\x00\x00\x00\x01\x16\xccXYZ \x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\ +\x00\x00\x00\x00\x00o\xa2\x00\x008\xf5\x00\x00\x03\x90X\ +YZ \x00\x00\x00\x00\x00\x00b\x99\x00\x00\xb7\x85\x00\ +\x00\x18\xdaXYZ \x00\x00\x00\x00\x00\x00$\xa0\x00\ +\x00\x0f\x84\x00\x00\xb6\xcfdesc\x00\x00\x00\x00\x00\ +\x00\x00\x16IEC http://ww\ +w.iec.ch\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x16IEC http://w\ +ww.iec.ch\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00.IEC 61966-2.1\ + Default RGB col\ +our space - sRGB\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00.IEC \ +61966-2.1 Defaul\ +t RGB colour spa\ +ce - sRGB\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00,Refer\ +ence Viewing Con\ +dition in IEC619\ +66-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00,Reference View\ +ing Condition in\ + IEC61966-2.1\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00view\x00\x00\x00\x00\x00\ +\x13\xa4\xfe\x00\x14_.\x00\x10\xcf\x14\x00\x03\xed\xcc\x00\ +\x04\x13\x0b\x00\x03\x5c\x9e\x00\x00\x00\x01XYZ \x00\ +\x00\x00\x00\x00L\x09V\x00P\x00\x00\x00W\x1f\xe7m\ +eas\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x8f\x00\ +\x00\x00\x02sig \x00\x00\x00\x00CRT c\ +urv\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x05\x00\ +\x0a\x00\x0f\x00\x14\x00\x19\x00\x1e\x00#\x00(\x00-\x00\ +2\x007\x00;\x00@\x00E\x00J\x00O\x00T\x00\ +Y\x00^\x00c\x00h\x00m\x00r\x00w\x00|\x00\ +\x81\x00\x86\x00\x8b\x00\x90\x00\x95\x00\x9a\x00\x9f\x00\xa4\x00\ +\xa9\x00\xae\x00\xb2\x00\xb7\x00\xbc\x00\xc1\x00\xc6\x00\xcb\x00\ +\xd0\x00\xd5\x00\xdb\x00\xe0\x00\xe5\x00\xeb\x00\xf0\x00\xf6\x00\ +\xfb\x01\x01\x01\x07\x01\x0d\x01\x13\x01\x19\x01\x1f\x01%\x01\ ++\x012\x018\x01>\x01E\x01L\x01R\x01Y\x01\ +`\x01g\x01n\x01u\x01|\x01\x83\x01\x8b\x01\x92\x01\ +\x9a\x01\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\xc9\x01\xd1\x01\ +\xd9\x01\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\x0c\x02\x14\x02\ +\x1d\x02&\x02/\x028\x02A\x02K\x02T\x02]\x02\ +g\x02q\x02z\x02\x84\x02\x8e\x02\x98\x02\xa2\x02\xac\x02\ +\xb6\x02\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\xf5\x03\x00\x03\ +\x0b\x03\x16\x03!\x03-\x038\x03C\x03O\x03Z\x03\ +f\x03r\x03~\x03\x8a\x03\x96\x03\xa2\x03\xae\x03\xba\x03\ +\xc7\x03\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\x13\x04 \x04\ +-\x04;\x04H\x04U\x04c\x04q\x04~\x04\x8c\x04\ +\x9a\x04\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\xf0\x04\xfe\x05\ +\x0d\x05\x1c\x05+\x05:\x05I\x05X\x05g\x05w\x05\ +\x86\x05\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\xe5\x05\xf6\x06\ +\x06\x06\x16\x06'\x067\x06H\x06Y\x06j\x06{\x06\ +\x8c\x06\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\xf5\x07\x07\x07\ +\x19\x07+\x07=\x07O\x07a\x07t\x07\x86\x07\x99\x07\ +\xac\x07\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\x1f\x082\x08\ +F\x08Z\x08n\x08\x82\x08\x96\x08\xaa\x08\xbe\x08\xd2\x08\ +\xe7\x08\xfb\x09\x10\x09%\x09:\x09O\x09d\x09y\x09\ +\x8f\x09\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\x11\x0a'\x0a\ +=\x0aT\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\ +\xf3\x0b\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\x80\x0b\x98\x0b\ +\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0cC\x0c\x5c\x0c\ +u\x0c\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\x0d\x0d&\x0d\ +@\x0dZ\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\ +\x13\x0e.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\ +\xee\x0f\x09\x0f%\x0fA\x0f^\x0fz\x0f\x96\x0f\xb3\x0f\ +\xcf\x0f\xec\x10\x09\x10&\x10C\x10a\x10~\x10\x9b\x10\ +\xb9\x10\xd7\x10\xf5\x11\x13\x111\x11O\x11m\x11\x8c\x11\ +\xaa\x11\xc9\x11\xe8\x12\x07\x12&\x12E\x12d\x12\x84\x12\ +\xa3\x12\xc3\x12\xe3\x13\x03\x13#\x13C\x13c\x13\x83\x13\ +\xa4\x13\xc5\x13\xe5\x14\x06\x14'\x14I\x14j\x14\x8b\x14\ +\xad\x14\xce\x14\xf0\x15\x12\x154\x15V\x15x\x15\x9b\x15\ +\xbd\x15\xe0\x16\x03\x16&\x16I\x16l\x16\x8f\x16\xb2\x16\ +\xd6\x16\xfa\x17\x1d\x17A\x17e\x17\x89\x17\xae\x17\xd2\x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c\xd7\xe0\xd8d\xd8\xe8\xd9l\xd9\xf1\xda\ +v\xda\xfb\xdb\x80\xdc\x05\xdc\x8a\xdd\x10\xdd\x96\xde\x1c\xde\ +\xa2\xdf)\xdf\xaf\xe06\xe0\xbd\xe1D\xe1\xcc\xe2S\xe2\ +\xdb\xe3c\xe3\xeb\xe4s\xe4\xfc\xe5\x84\xe6\x0d\xe6\x96\xe7\ +\x1f\xe7\xa9\xe82\xe8\xbc\xe9F\xe9\xd0\xea[\xea\xe5\xeb\ +p\xeb\xfb\xec\x86\xed\x11\xed\x9c\xee(\xee\xb4\xef@\xef\ +\xcc\xf0X\xf0\xe5\xf1r\xf1\xff\xf2\x8c\xf3\x19\xf3\xa7\xf4\ +4\xf4\xc2\xf5P\xf5\xde\xf6m\xf6\xfb\xf7\x8a\xf8\x19\xf8\ +\xa8\xf98\xf9\xc7\xfaW\xfa\xe7\xfbw\xfc\x07\xfc\x98\xfd\ +)\xfd\xba\xfeK\xfe\xdc\xffm\xff\xff\ +\x00\x00\x03\xae\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Default - Upd\ +ated\x0d\x0a \ + Created \ +with Sketch.\x0d\x0a <\ +/defs>\x0d\x0a \ +\x0d\x0a \x0d\x0a <\ +/g>\x0d\x0a\x0d\x0a\ +\x00\x00\x04\x8d\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / error / Not \ +active \x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x04s\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Editor only \ +- Updated\x0d\x0a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x9eJ\ +\x87\xa4\x18\x84G\x13s\xe9\x06\x19\x922\x85\xfe\x84Y\ +\xa7\x91\xfc\x86 V\xf2/_\xe0$\xa2\x04n\x92\xa2\ +\x19\x06\x1eSq\x95#'\x1d(\xad\xfa\x8bW\xd8\xc9\ +\x80\x7f\xe4U\x864I\xe3g\x9d\x15\x1d\x90b%7\ +\x15\x922\xae@J\xe1'>\x14\x92\x1a\x88\xc6[X\ +\xa4\xa4\x9aL\x8a\x8f\xf9=\x03\x94SiM\x0c\x95[\ +\xd7\xe5\xceK\xdd\x09z\x5c\x85\xe7\x19~\x1aiTI\ +\xb2N\x94%)RVs_\xb9\x12tXdz\x09\ +>\x98\x119\x89\xa1J\x85\xc4\x18\xa3M\xc3\xc8:~\ +\x96&\xf9j\x85ShJY;\xa1\xd1*&\x1eE\ +A$\x18\xd6A\x81tL\xd5A\x83$\x8e%\x9ee\ +x\xb2\x13\x8b\xa9\x9a^]\xac\x13\xdam\x11\xa7d\xd3\ +\xfc(F\x10`\xa5\x062\xd0a\xdd#9^\x99\xb6\ +\x80n+4\xf2\x98\xb2\x13J\xd5\x10\xad\xec\xbaJ\xad\ +\x96j\xfbA8\xb2\xadT\x9a\xcdC\xec\xfbbc\x9f\ +\xe4;\x1e\xddg\xeb+\x89(\xb6\x90\x9br\xe5\x85\xad\ +\xfa\xba\x81\xba\xae9\xce\xef\xb9\xa7g\x06x\xbc\xab\x8b\ +\xb2\xd3\xbb\xafu~\xf1\xbf\x13\xfb\xd1\xd7\xbd\xaf\xf6v\ +\xc5\xb80K\xf7\x08D\x8b\xe4\x18AM\xc5D\x18\xf8\ +\xc2\x9a \x81\x06%\x13r\x81\x06\x18q4\xa6\xe4\xc7\ +\x00\x09\xac\x00\xc41\xfcL\x8dA\x87L\x91x\xc7\xb1\ +\xc1\xbd\x06$2\x9c)\xc5@\xcb\x0c\xc1\x06\xb5\xf0@\ +6\x12\x07\xf3[\x8a\xbf@\xc3\xa4\x1a\x0b\xcds{\xc9\ +#\x00\x12\xa7\xdd\x03.\x19\x0c\xf2\x99=\x10`\xd9#\ +5\xf4K\xffT\xba\xb4f\xec\xff\x0cPh\xa5\x03\x0b\ +t\xd9\x14\xc2\xc6\x923{Y\xd85m\x83i\xda\xac\ +\xbd\xa3k\xdb\xb6\xf9{m\xdc7=\xd2\xc4\xca\xf7]\ +\xe3y\xdd\xaf\xed\xeb}\xdf\xaa\xbd\xff\x81\xe0\xa9\xed\xf3\ +\x83\xe1\xb8usr\xe28\xbe1m\xdd\xf8\xdeC\x91\ +\xe3\xb8^K\x95\xe5\xb8\xae[\x99\xde\xb9\x8ek\x9d\xdc\ +\xf9\xce{\xa1\xda\xba\x0e\x8b\xa5\xd0\xf8\xfe\x9b\xa9\xdb\xfa\ +N\xab\xad\xc1\x10\x10\x00\x13\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x04\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00\x92\x08\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00\x08\x00\x00\x00\x15\x01\x03\ +\x00\x01\x00\x00\x00\x04\x00\x00\x00\x16\x01\x04\x00\x01\x00\x00\ +\x00`\x00\x00\x00\x17\x01\x04\x00\x01\x00\x00\x00\x9f\x07\x00\ +\x00\x1a\x01\x05\x00\x01\x00\x00\x00\x9a\x08\x00\x00\x1b\x01\x05\ +\x00\x01\x00\x00\x00\xa2\x08\x00\x00\x1c\x01\x03\x00\x01\x00\x00\ +\x00\x01\x00\x00\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x001\x01\x02\x00\x10\x00\x00\x00\xaa\x08\x00\x00=\x01\x03\ +\x00\x01\x00\x00\x00\x02\x00\x00\x00R\x01\x03\x00\x01\x00\x00\ +\x00\x02\x00\x00\x00S\x01\x03\x00\x04\x00\x00\x00\xba\x08\x00\ +\x00s\x87\x07\x00H\x0c\x00\x00\xc2\x08\x00\x00\x00\x00\x00\ +\x00\x08\x00\x08\x00\x08\x00\x08\x00\x802\x02\x00\xe8\x03\x00\ +\x00\x802\x02\x00\xe8\x03\x00\x00paint.n\ +et 4.0.9\x00\x01\x00\x01\x00\x01\x00\x01\ +\x00\x00\x00\x0cHLino\x02\x10\x00\x00mnt\ +rRGB XYZ \x07\xce\x00\x02\x00\x09\x00\ +\x06\x001\x00\x00acspMSFT\x00\x00\x00\ +\x00IEC sRGB\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3\ +-HP \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x11cprt\x00\x00\x01P\x00\x00\x00\ +3desc\x00\x00\x01\x84\x00\x00\x00lwtp\ +t\x00\x00\x01\xf0\x00\x00\x00\x14bkpt\x00\x00\x02\ +\x04\x00\x00\x00\x14rXYZ\x00\x00\x02\x18\x00\x00\x00\ +\x14gXYZ\x00\x00\x02,\x00\x00\x00\x14bXY\ +Z\x00\x00\x02@\x00\x00\x00\x14dmnd\x00\x00\x02\ +T\x00\x00\x00pdmdd\x00\x00\x02\xc4\x00\x00\x00\ +\x88vued\x00\x00\x03L\x00\x00\x00\x86vie\ +w\x00\x00\x03\xd4\x00\x00\x00$lumi\x00\x00\x03\ +\xf8\x00\x00\x00\x14meas\x00\x00\x04\x0c\x00\x00\x00\ +$tech\x00\x00\x040\x00\x00\x00\x0crTR\ +C\x00\x00\x04<\x00\x00\x08\x0cgTRC\x00\x00\x04\ +<\x00\x00\x08\x0cbTRC\x00\x00\x04<\x00\x00\x08\ +\x0ctext\x00\x00\x00\x00Copyrig\ +ht (c) 1998 Hewl\ +ett-Packard Comp\ +any\x00\x00desc\x00\x00\x00\x00\x00\x00\x00\ +\x12sRGB IEC61966-2\ +.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12sR\ +GB IEC61966-2.1\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00XYZ \x00\x00\x00\x00\x00\x00\xf3Q\x00\x01\x00\ +\x00\x00\x01\x16\xccXYZ \x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\x00\x00\ +\x00\x00\x00o\xa2\x00\x008\xf5\x00\x00\x03\x90XYZ\ + \x00\x00\x00\x00\x00\x00b\x99\x00\x00\xb7\x85\x00\x00\x18\ +\xdaXYZ \x00\x00\x00\x00\x00\x00$\xa0\x00\x00\x0f\ +\x84\x00\x00\xb6\xcfdesc\x00\x00\x00\x00\x00\x00\x00\ +\x16IEC http://www.\ +iec.ch\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x16IEC http://www\ +.iec.ch\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\x00\x00\ +.IEC 61966-2.1 D\ +efault RGB colou\ +r space - sRGB\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00.IEC 61\ +966-2.1 Default \ +RGB colour space\ + - sRGB\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00des\ +c\x00\x00\x00\x00\x00\x00\x00,Referen\ +ce Viewing Condi\ +tion in IEC61966\ +-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00,\ +Reference Viewin\ +g Condition in I\ +EC61966-2.1\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00view\x00\x00\x00\x00\x00\x13\xa4\ +\xfe\x00\x14_.\x00\x10\xcf\x14\x00\x03\xed\xcc\x00\x04\x13\ +\x0b\x00\x03\x5c\x9e\x00\x00\x00\x01XYZ \x00\x00\x00\ +\x00\x00L\x09V\x00P\x00\x00\x00W\x1f\xe7mea\ +s\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x8f\x00\x00\x00\ +\x02sig \x00\x00\x00\x00CRT cur\ +v\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x05\x00\x0a\x00\ +\x0f\x00\x14\x00\x19\x00\x1e\x00#\x00(\x00-\x002\x00\ +7\x00;\x00@\x00E\x00J\x00O\x00T\x00Y\x00\ +^\x00c\x00h\x00m\x00r\x00w\x00|\x00\x81\x00\ +\x86\x00\x8b\x00\x90\x00\x95\x00\x9a\x00\x9f\x00\xa4\x00\xa9\x00\ +\xae\x00\xb2\x00\xb7\x00\xbc\x00\xc1\x00\xc6\x00\xcb\x00\xd0\x00\ +\xd5\x00\xdb\x00\xe0\x00\xe5\x00\xeb\x00\xf0\x00\xf6\x00\xfb\x01\ +\x01\x01\x07\x01\x0d\x01\x13\x01\x19\x01\x1f\x01%\x01+\x01\ +2\x018\x01>\x01E\x01L\x01R\x01Y\x01`\x01\ +g\x01n\x01u\x01|\x01\x83\x01\x8b\x01\x92\x01\x9a\x01\ +\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\xc9\x01\xd1\x01\xd9\x01\ +\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\x0c\x02\x14\x02\x1d\x02\ +&\x02/\x028\x02A\x02K\x02T\x02]\x02g\x02\ +q\x02z\x02\x84\x02\x8e\x02\x98\x02\xa2\x02\xac\x02\xb6\x02\ +\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\xf5\x03\x00\x03\x0b\x03\ +\x16\x03!\x03-\x038\x03C\x03O\x03Z\x03f\x03\ +r\x03~\x03\x8a\x03\x96\x03\xa2\x03\xae\x03\xba\x03\xc7\x03\ +\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\x13\x04 \x04-\x04\ +;\x04H\x04U\x04c\x04q\x04~\x04\x8c\x04\x9a\x04\ +\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\xf0\x04\xfe\x05\x0d\x05\ +\x1c\x05+\x05:\x05I\x05X\x05g\x05w\x05\x86\x05\ +\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\xe5\x05\xf6\x06\x06\x06\ +\x16\x06'\x067\x06H\x06Y\x06j\x06{\x06\x8c\x06\ +\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\xf5\x07\x07\x07\x19\x07\ ++\x07=\x07O\x07a\x07t\x07\x86\x07\x99\x07\xac\x07\ +\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\x1f\x082\x08F\x08\ +Z\x08n\x08\x82\x08\x96\x08\xaa\x08\xbe\x08\xd2\x08\xe7\x08\ +\xfb\x09\x10\x09%\x09:\x09O\x09d\x09y\x09\x8f\x09\ +\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\x11\x0a'\x0a=\x0a\ +T\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\xf3\x0b\ +\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\x80\x0b\x98\x0b\xb0\x0b\ +\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0cC\x0c\x5c\x0cu\x0c\ +\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\x0d\x0d&\x0d@\x0d\ +Z\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\x13\x0e\ +.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\xee\x0f\ +\x09\x0f%\x0fA\x0f^\x0fz\x0f\x96\x0f\xb3\x0f\xcf\x0f\ +\xec\x10\x09\x10&\x10C\x10a\x10~\x10\x9b\x10\xb9\x10\ +\xd7\x10\xf5\x11\x13\x111\x11O\x11m\x11\x8c\x11\xaa\x11\ +\xc9\x11\xe8\x12\x07\x12&\x12E\x12d\x12\x84\x12\xa3\x12\ +\xc3\x12\xe3\x13\x03\x13#\x13C\x13c\x13\x83\x13\xa4\x13\ +\xc5\x13\xe5\x14\x06\x14'\x14I\x14j\x14\x8b\x14\xad\x14\ +\xce\x14\xf0\x15\x12\x154\x15V\x15x\x15\x9b\x15\xbd\x15\ +\xe0\x16\x03\x16&\x16I\x16l\x16\x8f\x16\xb2\x16\xd6\x16\ +\xfa\x17\x1d\x17A\x17e\x17\x89\x17\xae\x17\xd2\x17\xf7\x18\ +\x1b\x18@\x18e\x18\x8a\x18\xaf\x18\xd5\x18\xfa\x19 \x19\ +E\x19k\x19\x91\x19\xb7\x19\xdd\x1a\x04\x1a*\x1aQ\x1a\ +w\x1a\x9e\x1a\xc5\x1a\xec\x1b\x14\x1b;\x1bc\x1b\x8a\x1b\ +\xb2\x1b\xda\x1c\x02\x1c*\x1cR\x1c{\x1c\xa3\x1c\xcc\x1c\ +\xf5\x1d\x1e\x1dG\x1dp\x1d\x99\x1d\xc3\x1d\xec\x1e\x16\x1e\ +@\x1ej\x1e\x94\x1e\xbe\x1e\xe9\x1f\x13\x1f>\x1fi\x1f\ +\x94\x1f\xbf\x1f\xea \x15 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19\xf3\xa7\xf44\xf4\ +\xc2\xf5P\xf5\xde\xf6m\xf6\xfb\xf7\x8a\xf8\x19\xf8\xa8\xf9\ +8\xf9\xc7\xfaW\xfa\xe7\xfbw\xfc\x07\xfc\x98\xfd)\xfd\ +\xba\xfeK\xfe\xdc\xffm\xff\xff\ +\x00\x00\x04o\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Editor only \ +- Saved\x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a <\ +g id=\x22icon-/-out\ +liner-/-entity-/\ +--Editor-only---\ +Saved\x22 stroke=\x22n\ +one\x22 stroke-widt\ +h=\x221\x22 fill=\x22none\ +\x22 fill-rule=\x22eve\ +nodd\x22>\x0d\x0a \ +\x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x00\x07\x1d\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22 standalone=\x22\ +no\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + lock on\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \x0d\x0a \ +\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x05\x1d\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ standard copy<\ +/title>\x0d\x0a Created with \ +Sketch.\x0d\x0a\ + \x0d\x0a \x0d\x0a \ +\x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x04\xa0\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Not active - \ +Updated\x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a <\ +g id=\x22icon-/-out\ +liner-/-entity-/\ +-Not-active---Up\ +dated\x22 stroke=\x22n\ +one\x22 stroke-widt\ +h=\x221\x22 fill=\x22none\ +\x22 fill-rule=\x22eve\ +nodd\x22>\x0d\x0a \ +\x0d\x0a \ + \x0d\x0a\x0d\x0a\ +\x00\x00\x04\x9c\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Not active - \ +Saved\x0d\x0a \ + Created\ + with Sketch.\x0d\x0a \ +\x0d\x0a \x0d\x0a \ +\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x06\xdc\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Group 13\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\ + \ +\x0d\x0a \ + \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x03\x87\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Loop v2\x0d\x0a Cr\ +eated with Sketc\ +h.\x0d\x0a <\ +g id=\x22icon-/-out\ +liner-/-entity-/\ +-Loop-v2\x22 stroke\ +=\x22none\x22 stroke-w\ +idth=\x221\x22 fill=\x22n\ +one\x22 fill-rule=\x22\ +evenodd\x22>\x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00_l\ +I\ +I*\x00\x08\x00\x00\x00\x17\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x03\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00\x22\x01\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00DS\x00\x00\x12\x01\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\ +\x00\x04\x00\x00\x00\x16\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x17\x01\x04\x00\x01\x00\x00\x00\xfa\x0b\x00\x00\x1a\x01\x05\ +\x00\x01\x00\x00\x00*\x01\x00\x00\x1b\x01\x05\x00\x01\x00\x00\ +\x002\x01\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\ +\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\ +\x00$\x00\x00\x00:\x01\x00\x002\x01\x02\x00\x14\x00\x00\ +\x00^\x01\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00R\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\xbc\x02\x01\ +\x00\xfa8\x00\x00r\x01\x00\x00I\x86\x01\x00\x90\x0c\x00\ +\x00l:\x00\x00i\x87\x04\x00\x01\x00\x00\x00@_\x00\ +\x00s\x87\x07\x00H\x0c\x00\x00\xfcF\x00\x00\x00\x00\x00\ +\x00\x08\x00\x08\x00\x08\x00\x08\x00\x00\xf9\x15\x00\x10'\x00\ +\x00\x00\xf9\x15\x00\x10'\x00\x00Adobe P\ +hotoshop CC 2015\ +.5 (Windows)\x00201\ +7:03:08 11:37:45\ +\x00\x0a\x0a \x0a \ +\x0a pain\ +t.net 4.0.9\x0a \ + 2017-03-0\ +7T11:32:29-08:00\ +\x0a 2017-\ +03-08T11:37:45-0\ +8:00\x0a <\ +xmp:MetadataDate\ +>2017-03-08T11:3\ +7:45-08:00\x0a \ + image/tiff\x0a \ + 3\x0a \ + sR\ +GB IEC61966-2.1<\ +/photoshop:ICCPr\ +ofile>\x0a \ +\x0a \ + \x0a \ + adobe\ +:docid:photoshop\ +:94a27cdb-0433-1\ +1e7-b02d-9f84d9f\ +5a326\x0a \ + \x0a <\ +/photoshop:Docum\ +entAncestors>\x0a \ + xmp.iid\ +:16fdf09c-857d-9\ +44e-9783-e127cb1\ +b9cf4\x0a \ + adobe:docid:\ +photoshop:9f9351\ +ac-0436-11e7-b02\ +d-9f84d9f5a326\x0a xmp.did:ca7\ +71a70-f965-e14f-\ +9103-360465543db\ +f\x0a \ + \x0a \ + \x0a \ + \x0a \ + <\ +stEvt:action>cre\ +ated\x0a \ + xmp.iid:\ +ca771a70-f965-e1\ +4f-9103-36046554\ +3dbf\x0a \ + 2017-03-07\ +T11:32:29-08:00<\ +/stEvt:when>\x0a \ + <\ +stEvt:softwareAg\ +ent>Adobe Photos\ +hop CC 2015.5 (W\ +indows)\x0a \ + \x0a \ + \x0a \ + saved\x0a \ + <\ +stEvt:instanceID\ +>xmp.iid:16fdf09\ +c-857d-944e-9783\ +-e127cb1b9cf4\ +\x0a \ + 2\ +017-03-08T11:37:\ +45-08:00\x0a \ + Ado\ +be Photoshop CC \ +2015.5 (Windows)\ +\x0a \ + /\x0a \ + \x0a <\ +/rdf:Seq>\x0a \ + \x0a \x0a \ +\x0a\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \x0a8BIM\x04\ +%\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x008BIM\x04:\x00\x00\x00\ +\x00\x00\xe5\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x0bprintOutput\x00\x00\x00\x05\ +\x00\x00\x00\x00PstSbool\x01\x00\x00\x00\ +\x00Inteenum\x00\x00\x00\x00Int\ +e\x00\x00\x00\x00Clrm\x00\x00\x00\x0fpri\ +ntSixteenBitbool\ +\x00\x00\x00\x00\x0bprinterName\ +TEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0fpr\ +intProofSetupObj\ +c\x00\x00\x00\x0c\x00P\x00r\x00o\x00o\x00f\x00\ + \x00S\x00e\x00t\x00u\x00p\x00\x00\x00\x00\x00\ +\x0aproofSetup\x00\x00\x00\x01\x00\ +\x00\x00\x00Bltnenum\x00\x00\x00\x0cb\ +uiltinProof\x00\x00\x00\x09p\ +roofCMYK\x008BIM\x04;\x00\ +\x00\x00\x00\x02-\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x12printOutputOp\ +tions\x00\x00\x00\x17\x00\x00\x00\x00Cpt\ +nbool\x00\x00\x00\x00\x00Clbrbo\ +ol\x00\x00\x00\x00\x00RgsMbool\x00\ +\x00\x00\x00\x00CrnCbool\x00\x00\x00\x00\ +\x00CntCbool\x00\x00\x00\x00\x00Lb\ +lsbool\x00\x00\x00\x00\x00Ngtvb\ +ool\x00\x00\x00\x00\x00EmlDbool\ +\x00\x00\x00\x00\x00Intrbool\x00\x00\x00\ +\x00\x00BckgObjc\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x00RGBC\x00\x00\x00\x03\x00\x00\x00\x00\ +Rd doub@o\xe0\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Grn doub@o\xe0\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00Bl doub\ +@o\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00BrdT\ +UntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00Bld UntF#Rlt\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Rslt\ +UntF#Pxl@b\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x0avectorDatabo\ +ol\x01\x00\x00\x00\x00PgPsenum\x00\ +\x00\x00\x00PgPs\x00\x00\x00\x00PgPC\x00\ +\x00\x00\x00LeftUntF#Rlt\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Top U\ +ntF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00Scl UntF#Prc@\ +Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10cropW\ +henPrintingbool\x00\ +\x00\x00\x00\x0ecropRectBott\ +omlong\x00\x00\x00\x00\x00\x00\x00\x0ccr\ +opRectLeftlong\x00\x00\ +\x00\x00\x00\x00\x00\x0dcropRectRi\ +ghtlong\x00\x00\x00\x00\x00\x00\x00\x0bc\ +ropRectToplong\x00\x00\ +\x00\x00\x008BIM\x03\xed\x00\x00\x00\x00\x00\x10\x00\ +\x90\x00\x00\x00\x01\x00\x01\x00\x90\x00\x00\x00\x01\x00\x018\ +BIM\x04&\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00?\x80\x00\x008BIM\x03\xee\x00\ +\x00\x00\x00\x00\x0d\x0cTransparen\ +cy\x008BIM\x04\x15\x00\x00\x00\x00\x00\x1e\x00\ +\x00\x00\x0d\x00T\x00r\x00a\x00n\x00s\x00p\x00\ +a\x00r\x00e\x00n\x00c\x00y\x00\x008BI\ +M\x045\x00\x00\x00\x00\x00\x11\x00\x00\x00\x01\x00\x00\xff\ +\xff\x00\x00\x00\x00\x00\x00\x00d\x01\x008BIM\x04\ +\x1d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008BIM\x04\ +\x0d\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x04\ +\x19\x00\x00\x00\x00\x00\x04\x00\x00\x00\x1e8BIM\x03\ +\xf3\x00\x00\x00\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x01\ +\x008BIM'\x10\x00\x00\x00\x00\x00\x0a\x00\x01\x00\ +\x00\x00\x00\x00\x00\x00\x018BIM\x03\xf5\x00\x00\x00\ +\x00\x00H\x00/ff\x00\x01\x00lff\x00\x06\x00\ +\x00\x00\x00\x00\x01\x00/ff\x00\x01\x00\xa1\x99\x9a\x00\ +\x06\x00\x00\x00\x00\x00\x01\x002\x00\x00\x00\x01\x00Z\x00\ +\x00\x00\x06\x00\x00\x00\x00\x00\x01\x005\x00\x00\x00\x01\x00\ +-\x00\x00\x00\x06\x00\x00\x00\x00\x00\x018BIM\x03\ +\xf8\x00\x00\x00\x00\x00p\x00\x00\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\ +\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\ +\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\x03\xe8\x00\x008BIM\x04\x00\x00\x00\x00\ +\x00\x00\x02\x00\x008BIM\x04\x02\x00\x00\x00\x00\x00\ +\x02\x00\x008BIM\x040\x00\x00\x00\x00\x00\x01\x01\ +\x008BIM\x04-\x00\x00\x00\x00\x00\x06\x00\x01\x00\ +\x00\x00\x0a8BIM\x04\x08\x00\x00\x00\x00\x00\x10\x00\ +\x00\x00\x01\x00\x00\x02@\x00\x00\x02@\x00\x00\x00\x008\ +BIM\x04\x1e\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008\ +BIM\x04\x1a\x00\x00\x00\x00\x035\x00\x00\x00\x06\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\ +\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00null\x00\x00\ +\x00\x02\x00\x00\x00\x06boundsObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rct1\x00\x00\ +\x00\x04\x00\x00\x00\x00Top long\x00\x00\ +\x00\x00\x00\x00\x00\x00Leftlong\x00\x00\ +\x00\x00\x00\x00\x00\x00Btomlong\x00\x00\ +\x00`\x00\x00\x00\x00Rghtlong\x00\x00\ +\x00`\x00\x00\x00\x06slicesVlLs\ +\x00\x00\x00\x01Objc\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x05slice\x00\x00\x00\x12\x00\x00\x00\x07s\ +liceIDlong\x00\x00\x00\x00\x00\x00\ +\x00\x07groupIDlong\x00\x00\x00\ +\x00\x00\x00\x00\x06originenum\x00\ +\x00\x00\x0cESliceOrigin\x00\ +\x00\x00\x0dautoGenerated\ +\x00\x00\x00\x00Typeenum\x00\x00\x00\x0a\ +ESliceType\x00\x00\x00\x00Im\ +g \x00\x00\x00\x06boundsObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00Rct1\x00\x00\ +\x00\x04\x00\x00\x00\x00Top long\x00\x00\ +\x00\x00\x00\x00\x00\x00Leftlong\x00\x00\ +\x00\x00\x00\x00\x00\x00Btomlong\x00\x00\ +\x00`\x00\x00\x00\x00Rghtlong\x00\x00\ +\x00`\x00\x00\x00\x03urlTEXT\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x00nullTEXT\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00MsgeTEX\ +T\x00\x00\x00\x01\x00\x00\x00\x00\x00\x06altTa\ +gTEXT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0ec\ +ellTextIsHTMLboo\ +l\x01\x00\x00\x00\x08cellTextTE\ +XT\x00\x00\x00\x01\x00\x00\x00\x00\x00\x09horz\ +Alignenum\x00\x00\x00\x0fESl\ +iceHorzAlign\x00\x00\x00\x07\ +default\x00\x00\x00\x09vertA\ +lignenum\x00\x00\x00\x0fESli\ +ceVertAlign\x00\x00\x00\x07d\ +efault\x00\x00\x00\x0bbgColo\ +rTypeenum\x00\x00\x00\x11ESl\ +iceBGColorType\x00\x00\ +\x00\x00None\x00\x00\x00\x09topOut\ +setlong\x00\x00\x00\x00\x00\x00\x00\x0al\ +eftOutsetlong\x00\x00\x00\ +\x00\x00\x00\x00\x0cbottomOutse\ +tlong\x00\x00\x00\x00\x00\x00\x00\x0brig\ +htOutsetlong\x00\x00\x00\x00\ +\x008BIM\x04(\x00\x00\x00\x00\x00\x0c\x00\x00\x00\ +\x02?\xf0\x00\x00\x00\x00\x00\x008BIM\x04\x14\x00\ +\x00\x00\x00\x00\x04\x00\x00\x00\x0c8BIM\x04\x0c\x00\ +\x00\x00\x00\x038\x00\x00\x00\x01\x00\x00\x000\x00\x00\x00\ +0\x00\x00\x00\x90\x00\x00\x1b\x00\x00\x00\x03\x1c\x00\x18\x00\ +\x01\xff\xd8\xff\xed\x00\x0cAdobe_CM\x00\ +\x01\xff\xee\x00\x0eAdobe\x00d\x80\x00\x00\x00\ +\x01\xff\xdb\x00\x84\x00\x0c\x08\x08\x08\x09\x08\x0c\x09\x09\x0c\ +\x11\x0b\x0a\x0b\x11\x15\x0f\x0c\x0c\x0f\x15\x18\x13\x13\x15\x13\ +\x13\x18\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x01\x0d\x0b\x0b\x0d\x0e\x0d\x10\x0e\x0e\ +\x10\x14\x0e\x0e\x0e\x14\x14\x0e\x0e\x0e\x0e\x14\x11\x0c\x0c\x0c\ +\x0c\x0c\x11\x11\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\xff\xc0\x00\x11\x08\x000\x000\ +\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xdd\x00\x04\x00\x03\ +\xff\xc4\x01?\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\ +\x00\x00\x00\x00\x00\x03\x00\x01\x02\x04\x05\x06\x07\x08\x09\x0a\ +\x0b\x01\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x10\x00\ +\x01\x04\x01\x03\x02\x04\x02\x05\x07\x06\x08\x05\x03\x0c3\x01\ +\x00\x02\x11\x03\x04!\x121\x05AQa\x13\x22q\x81\ +2\x06\x14\x91\xa1\xb1B#$\x15R\xc1b34r\ +\x82\xd1C\x07%\x92S\xf0\xe1\xf1cs5\x16\xa2\xb2\ +\x83&D\x93TdE\xc2\xa3t6\x17\xd2U\xe2e\ +\xf2\xb3\x84\xc3\xd3u\xe3\xf3F'\x94\xa4\x85\xb4\x95\xc4\ +\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\ +\xc6\xd6\xe6\xf67GWgw\x87\x97\xa7\xb7\xc7\xd7\xe7\ +\xf7\x11\x00\x02\x02\x01\x02\x04\x04\x03\x04\x05\x06\x07\x07\x06\ +\x055\x01\x00\x02\x11\x03!1\x12\x04AQaq\x22\ +\x13\x052\x81\x91\x14\xa1\xb1B#\xc1R\xd1\xf03$\ +b\xe1r\x82\x92CS\x15cs4\xf1%\x06\x16\xa2\ +\xb2\x83\x07&5\xc2\xd2D\x93T\xa3\x17dEU6\ +te\xe2\xf2\xb3\x84\xc3\xd3u\xe3\xf3F\x94\xa4\x85\xb4\ +\x95\xc4\xd4\xe4\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\ +\xa6\xb6\xc6\xd6\xe6\xf6'7GWgw\x87\x97\xa7\xb7\ +\xc7\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\xf5\ +T\x92P\xb5\xceensZ^\xe6\x82CG$\xa4\ +\xa5YuU\xff\x008\xf6\xb2x\xdc@N\xd7\xb1\xe3\ +s\x1c\x1c\xdf\x10d*X\xb8,\xb1\x9e\xbe[K\xee\ +\xb3S\xbb\xb0\xec6\xa6}#\x07&\xa7\xd2H\xaa\xe7\ +\x06=\x93\x22O\x05%:\x09$\x92J\x7f\xff\xd0\xf5\ +T\x1c\x9c\xaa\xf1\x9a\x0b\xe4\x97\x18kZ$\x94eK\ +\xaa{YM\xbd\xeb\xb0\x1f\x97\xfa\x84\x94\xb7\xdb\xefw\ +\xf3x\xaf>\x05\xda\x7f\x04+\x9b\xd4.s.}m\ +`\xa6\x5c\xd6\x93:\xf3:|\x15\xac\xf3x\xc6s\xa9\ +0F\xae#\x9d\xa3\xe9mK\x05\xd6Y\x88\xd7Zw\ +\x17L\x1e\xf1:nIL\xf1/7\xe3\xb2\xd2\x00.\ +\xe4\x0e$\x1d\xa8\xca\x97J\xd3\x1d\xf5\x9ekyj\xba\ +\x92\x9f\xff\xd1\xf5UW\xa8\xd6l\xc3\xb0\x01$A\x00\ +y\x1f\xfc\x8a\xb4\x92Jh7\xa95\xf5\x86\xb6\x8b-\ +1\x0e\x86\xe8t\xd7\xc5&_\x9b\xb42\x8cA[\x06\ +\x808\xc0\x1f/b\xbe\x92Jj`\xe3\xddQ\xb5\xf7\ +@u\xae\xdd\xb5\xbc\x05m$\x92S\xff\xd98BI\ +M\x04!\x00\x00\x00\x00\x00a\x00\x00\x00\x01\x01\x00\x00\ +\x00\x0f\x00A\x00d\x00o\x00b\x00e\x00 \x00P\ +\x00h\x00o\x00t\x00o\x00s\x00h\x00o\x00p\ +\x00\x00\x00\x19\x00A\x00d\x00o\x00b\x00e\x00 \ +\x00P\x00h\x00o\x00t\x00o\x00s\x00h\x00o\ +\x00p\x00 \x00C\x00C\x00 \x002\x000\x001\ +\x005\x00.\x005\x00\x00\x00\x01\x00\x00\x00\x0cHL\ +ino\x02\x10\x00\x00mntrRGB X\ +YZ \x07\xce\x00\x02\x00\x09\x00\x06\x001\x00\x00a\ +cspMSFT\x00\x00\x00\x00IEC s\ +RGB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-HP \x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11c\ +prt\x00\x00\x01P\x00\x00\x003desc\x00\ +\x00\x01\x84\x00\x00\x00lwtpt\x00\x00\x01\xf0\x00\ +\x00\x00\x14bkpt\x00\x00\x02\x04\x00\x00\x00\x14r\ +XYZ\x00\x00\x02\x18\x00\x00\x00\x14gXYZ\x00\ +\x00\x02,\x00\x00\x00\x14bXYZ\x00\x00\x02@\x00\ +\x00\x00\x14dmnd\x00\x00\x02T\x00\x00\x00pd\ +mdd\x00\x00\x02\xc4\x00\x00\x00\x88vued\x00\ +\x00\x03L\x00\x00\x00\x86view\x00\x00\x03\xd4\x00\ +\x00\x00$lumi\x00\x00\x03\xf8\x00\x00\x00\x14m\ +eas\x00\x00\x04\x0c\x00\x00\x00$tech\x00\ +\x00\x040\x00\x00\x00\x0crTRC\x00\x00\x04<\x00\ +\x00\x08\x0cgTRC\x00\x00\x04<\x00\x00\x08\x0cb\ +TRC\x00\x00\x04<\x00\x00\x08\x0ctext\x00\ +\x00\x00\x00Copyright (c)\ + 1998 Hewlett-Pa\ +ckard Company\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00\x12sRGB \ +IEC61966-2.1\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x12sRGB IEC\ +61966-2.1\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\ +\x00\x00\x00\x00\x00\xf3Q\x00\x01\x00\x00\x00\x01\x16\xccX\ +YZ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00o\xa2\x00\ +\x008\xf5\x00\x00\x03\x90XYZ \x00\x00\x00\x00\x00\ +\x00b\x99\x00\x00\xb7\x85\x00\x00\x18\xdaXYZ \x00\ +\x00\x00\x00\x00\x00$\xa0\x00\x00\x0f\x84\x00\x00\xb6\xcfd\ +esc\x00\x00\x00\x00\x00\x00\x00\x16IEC h\ +ttp://www.iec.ch\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16IEC \ +http://www.iec.c\ +h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00.IEC 6\ +1966-2.1 Default\ + RGB colour spac\ +e - sRGB\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00.IEC 61966-2.\ +1 Default RGB co\ +lour space - sRG\ +B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00,Reference Vie\ +wing Condition i\ +n IEC61966-2.1\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00,Refere\ +nce Viewing Cond\ +ition in IEC6196\ +6-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00v\ +iew\x00\x00\x00\x00\x00\x13\xa4\xfe\x00\x14_.\x00\ +\x10\xcf\x14\x00\x03\xed\xcc\x00\x04\x13\x0b\x00\x03\x5c\x9e\x00\ +\x00\x00\x01XYZ \x00\x00\x00\x00\x00L\x09V\x00\ +P\x00\x00\x00W\x1f\xe7meas\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x8f\x00\x00\x00\x02sig \x00\ +\x00\x00\x00CRT curv\x00\x00\x00\x00\x00\ +\x00\x04\x00\x00\x00\x00\x05\x00\x0a\x00\x0f\x00\x14\x00\x19\x00\ +\x1e\x00#\x00(\x00-\x002\x007\x00;\x00@\x00\ +E\x00J\x00O\x00T\x00Y\x00^\x00c\x00h\x00\ +m\x00r\x00w\x00|\x00\x81\x00\x86\x00\x8b\x00\x90\x00\ +\x95\x00\x9a\x00\x9f\x00\xa4\x00\xa9\x00\xae\x00\xb2\x00\xb7\x00\ +\xbc\x00\xc1\x00\xc6\x00\xcb\x00\xd0\x00\xd5\x00\xdb\x00\xe0\x00\ +\xe5\x00\xeb\x00\xf0\x00\xf6\x00\xfb\x01\x01\x01\x07\x01\x0d\x01\ +\x13\x01\x19\x01\x1f\x01%\x01+\x012\x018\x01>\x01\ +E\x01L\x01R\x01Y\x01`\x01g\x01n\x01u\x01\ +|\x01\x83\x01\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\ +\xb9\x01\xc1\x01\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\ +\xfa\x02\x03\x02\x0c\x02\x14\x02\x1d\x02&\x02/\x028\x02\ +A\x02K\x02T\x02]\x02g\x02q\x02z\x02\x84\x02\ +\x8e\x02\x98\x02\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\ +\xe0\x02\xeb\x02\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03-\x03\ +8\x03C\x03O\x03Z\x03f\x03r\x03~\x03\x8a\x03\ +\x96\x03\xa2\x03\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\ +\xf9\x04\x06\x04\x13\x04 \x04-\x04;\x04H\x04U\x04\ +c\x04q\x04~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\ +\xd3\x04\xe1\x04\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05:\x05\ +I\x05X\x05g\x05w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\ +\xc5\x05\xd5\x05\xe5\x05\xf6\x06\x06\x06\x16\x06'\x067\x06\ +H\x06Y\x06j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\ +\xd1\x06\xe3\x06\xf5\x07\x07\x07\x19\x07+\x07=\x07O\x07\ +a\x07t\x07\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\ +\xf8\x08\x0b\x08\x1f\x082\x08F\x08Z\x08n\x08\x82\x08\ +\x96\x08\xaa\x08\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09\ +:\x09O\x09d\x09y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\ +\xe5\x09\xfb\x0a\x11\x0a'\x0a=\x0aT\x0aj\x0a\x81\x0a\ +\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0b\ +Q\x0bi\x0b\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\ +\x12\x0c*\x0cC\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\ +\xd9\x0c\xf3\x0d\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\ +\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\ +\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f\ +^\x0fz\x0f\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10\ +C\x10a\x10~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x11\ +1\x11O\x11m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12\ +&\x12E\x12d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13\ +#\x13C\x13c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14\ +'\x14I\x14j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x15\ +4\x15V\x15x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16\ +I\x16l\x16\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17\ +e\x17\x89\x17\xae\x17\xd2\x17\xf7\x18\x1b\x18@\x18e\x18\ +\x8a\x18\xaf\x18\xd5\x18\xfa\x19 \x19E\x19k\x19\x91\x19\ +\xb7\x19\xdd\x1a\x04\x1a*\x1aQ\x1aw\x1a\x9e\x1a\xc5\x1a\ +\xec\x1b\x14\x1b;\x1bc\x1b\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c\ +*\x1cR\x1c{\x1c\xa3\x1c\xcc\x1c\xf5\x1d\x1e\x1dG\x1d\ +p\x1d\x99\x1d\xc3\x1d\xec\x1e\x16\x1e@\x1ej\x1e\x94\x1e\ +\xbe\x1e\xe9\x1f\x13\x1f>\x1fi\x1f\x94\x1f\xbf\x1f\xea \ +\x15 A l \x98 \xc4 \xf0!\x1c!H!\ +u!\xa1!\xce!\xfb\x22'\x22U\x22\x82\x22\xaf\x22\ +\xdd#\x0a#8#f#\x94#\xc2#\xf0$\x1f$\ +M$|$\xab$\xda%\x09%8%h%\x97%\ +\xc7%\xf7&'&W&\x87&\xb7&\xe8'\x18'\ +I'z'\xab'\xdc(\x0d(?(q(\xa2(\ +\xd4)\x06)8)k)\x9d)\xd0*\x02*5*\ +h*\x9b*\xcf+\x02+6+i+\x9d+\xd1,\ +\x05,9,n,\xa2,\xd7-\x0c-A-v-\ +\xab-\xe1.\x16.L.\x82.\xb7.\xee/$/\ +Z/\x91/\xc7/\xfe050l0\xa40\xdb1\ +\x121J1\x821\xba1\xf22*2c2\x9b2\ +\xd43\x0d3F3\x7f3\xb83\xf14+4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ZU\x85\x09\x01W\x8c\ +\x14}d\x86\x82\xd5\xa87\x18\x15\xa6\xcb\x9a\x04\xb9\xe8\ +[Ju\x1c\x8dp\xb2\x18\x1e6)\xda\x9e\x05\xd6H\ +tMY\x86\x04\x9e\x02\x00\xa8e<}\x9fB\xbd\xac\ +\x160L%gm\xa0\x83E\xbcA\x0c\x97\x08\xfa\x88\ +\x10\xd7(\xd0W]\x04\xca\x889]\x84|\xf8-\x0e\ +\x08\x84\xd0P\x11\x0f\xb1(<\xdb\x95\x9b\xba\x09W\x06\ +\xc3h\x08\xb6\xc8]\x16u\x0a\x18(H{a\x07\x9a\ +\x88\x03a\x80AO\x87\x9a\x00\xfe$\x13\xa1\x876,\ +p\x0a\xd8\xc8V|c\x87\xb5\xf31c\x81\xbbH \x86\x19\xfbi\x863\xee\ +\x02\x04\x98\xa8\x14[\xa9\x96\x15o\x01\xa2\x19R\x90c\ +#\xae\xec\xec.\xd2\xef\xa2\x03[\xc0T\x1a\xdd\xe3\x84\ +\xa4\x19\x07\xe8$\xfe7\x09F7$[\xaa\x84o,\ +X\x07\xfc\xc8\x9e\x86\x11|\xe8\xdcT\xf4\x04\x9f\x03|\ +\xd4A\xb0\x87\xd2\x88\x96a4@C\x87\xca\xa9H\x92\ +T\x9d+\xces\xdd\x01S\xd1t}\xca\xb0\x03\xf7\x80\ +N\x1eS\x9a \xf7\x84\x12\xa1\x84\x17\x8c1\x96^I\ +=\xddy\x8a\xab\xf2\x16\x87\x04\xf7\xa4cE\xc8X\xeb\ +\xeb\x8aE\xff\xb4W\xf9\xbe\xea\xa2>|\x04\xde\x0a(\ +\x0c\x99\xa4\x06~\xb8\xe2\xf0ll}\x86w\xbd\xf7\xa9\ ++pTR~\x86v\x18\x03\x00\xe8a\xbd\xfd\x9a\xd1\ +\xe0\xb6\x0cV\x9a\xa0~\x10\x0du\xae\xc1\x1c\xbb\xc3\x89\ +\x10uB\x05\xd5\x08\x08\x09\x03\xca\x0b\xf7\x00\xedTV\ +\x0d\x805\x05\xc1\x01\x0cC#\xacs\x05\xd8<\x0d\x07\ +d!\x1c\xf0B\x12\x13\xd0k\x09\xc2\x12F\x12\xc2\xf1\ +\xea\x90\xa2\xf2<\xc7\x80\xe1\x86Ce=\x00!\xd1\x0d\ +\xc7\x18\xc1\x87B\xc4Z\xc3\xd1E\x09b\x01\x152\xa0\ +(\x06/\xf0,\x88\x81\x08\x1c\x89@\x90\x0cD\xd0:\ +\xaa\x00\x98\x18\x061L\x1f< <\xf1\x09\x18\xc8\x8b\ +B\xe8FE\xd0\xde8#\x00\xd8\x88.\xea!\x80\xd5\ +k\x11\xe0\xb8\x1a\x04\x11X\x13\x19 B\x0a@\xecq\ +\x04\x91(\x0e\x028\x8c\xae\xd5\xe9:B\x03li\x06\ +\x18\xfc\x0eX\xe0\xf8c\xd1\x8c\xad\xc3Uv\xcf\x99\xf8\ +\x17\x91@u\xa9\x01 -#@\xb4P\x03\x12(\x0b\ +\x81\xd6$\x07\xc1<\x94\x03\xa0RN\x01\x98$V\x1e\ +\xb8u{/nB\x14u\x9e\x01\x5c04\x8e\x80\x91\ +\x14\x020W%\xc1:\x22\x04@>Z\x01$\xd6\x02\ +\x00[XQ\xc2\xce^\x0a\x01\x03/\xc3\x0c\xa5'\xcd\ +\xa4\x06\x81\x04\x18\x15CXD\x99AT\xd5\x82`^\ +\x8eG\xe4\xd1\x1fr\x04{\x1b\x81\xe0;\x1a\xc2\xfb!\ +\x83:n\x0c#\xc0\x19\x9cl\xc2'\x11\xc4\x0e\x82G\ +,#E\x81n\x05e\x81\x1b\x0f\xd1\xf8\xc0\xe1\xb8\xe8\ +\x1cQ\x80p\x0d\x83\x046\xa1\x90\xe1\x1b0ls\x0f\ +I\xfc\x1b\xf0\xb8\x1a\ +\xe2hK\x00\x80\x130\xc4\xe2\x02\x1e\xebn\xb3\x09\x02\ +2\x13\xb0\xd4\x18\x80_\x0d\xa0v!\x87\xd8\x1b\x01\x9c\ +\xe3\xa0h\xe0%\x1c\xb9\xcb\x98\xfe\x82\x16<\xe1^\x13\ +d\xe4\x10\xa0\xcd\x0d\x021\x01\xa0\xfa\x13\x80\x9f\x10\xed\ +v!l\x06\xd8\xcb<[e\xfa\x96\x02\x18\xc8\x81\x94\ +\x17\x8c\x82\x0dP\x01\x10B-\x06.A\x06\x8f\xd2i\ +/D\x06l\xc2\x1b,\xc6;h$\xe5@ \x02\xa8\ +\x90\x0f1T\x12\xe9\xd4!\x91B\x19\xeb\xc5\x13\x02,\ +\xe8\xce\x90\xb2.\x94!\xea\xc8\x0a\x86P\x15\xa2\xa0\x86\ +\xa9\x10\x02\x0c\x92\x9b\x22\xe8\x02Np\x8d\x8f\x10\xb9\xc7\ +\x08C\xe0\x1cHC\x84\xfdj=\x16B(\x8d\xc0R\ +\xfe!\xa4\x00q\xac\x00\x82\x18\x85@\xf6zA<\xbb\ +\xc2nPH\xa0\x92\x89*\xb5\xa9\xd4\xb5\xaf\x10\x93\x80\ +(\x03$>\x01\xa7x\x00\xe0\x12&\x01G\x1e!\x18\ +\x121\xe8\xa7\x91\xa0\x22oh\xe5\xa1\xb2\xc9\x82\x18v\ +\xc1&\xca\xe3\xca#e\x04\x96\xe0\x14\xc9\x22\xe2\x03 \ +>\x8d\x89.\x8d\xa3&\xb9\xc94\xc9\x22\x90\xa0\x8b\xc4\ +b\xc1\xcc\x1b\xf1\xee\x22b\xef\x1b\x81\x8cy\xe3\xf6!\ +aq#\xe1L|\x00\xf8\x0bb\x08\xc9\x91\xd1!\x06\ +$\x04\xcf\x10\xe7\x09e\x19F\xb1\x17\xed^+\x8a\xb8\ +\xcb\xec\xee\x1aa\x91\x22\xe24\x10\x92t\x14\xa0\x91'\ +\xa0\xb4!\x8d\x91&\xa1\x8e\x8d\x92\x0e\x03\xe9\x88\x02.\ +\x148\xb0\xae\x1e\xa1\xe4B\xc1\x9a\x18\x011* \xfe\ +g!\xb4grp#\x80\xc1+ \xf0\xf0\xa0\xd8\x10\ +\xe4r\xae\xe9\xe0\x86\xe3\x04\x1cC\x02/\xe1\xb6\xa9\x81\ +\xda\xb3\xcc\x06\xc7J\x9e\x1cr\xae$\x8f\x92\xf9o\x9a\ ++\x8aA-j\xfc\xa4\xe2\xf8\x1bj\x5c\xa5a\xac\xd9\ +\x0af\xd3r\xde'\xf1\xda\x01!\x1f0\xa1du\x02\ +p\xe0,\x07-\xa5~\x1c\xb2\xd0\xb3\xc86\x1c\xa9\xf2\ +\x1b*P\x1b\x8f\x8a\xab\xa6\x130\x22\xb5\x19Mr\x14\ +G2\x07\xe76#j\xee\xc0k\xd6\x1b\xed\xa6\xa5a\ +\xaa\xa5\xd3J\x9e!\xc2\xb1S4[\x88j\xf8\x00{\ +6`\x9a\x96\x80\x1e\x02N2\x1f\x8a&\x86(d\x1b\ +S+\x0b\x81\xbe\x1a\xcd\xa71\xb0\x095\xf3\x8d8\xf3\ +\x9193\x959s\x999\xb3\x9d9\xf3\xa1:3\xa5\ +:s\xa9:\xb3\xad:\xf3\xb1;3\xb5;s\xb9;\ +\xb3\xbd;\xf3\xc1<3\xc5\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Default\x0d\x0a Cr\ +eated with Sketc\ +h.\x0d\x0a <\ +defs>\x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\ +\x0a\x0d\x0a\ +\x00\x00\x03\x87\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / entity\ + / Loop v2\x0d\x0a Cr\ +eated with Sketc\ +h.\x0d\x0a <\ +g id=\x22icon-/-out\ +liner-/-entity-/\ +-Loop-v2\x22 stroke\ +=\x22none\x22 stroke-w\ +idth=\x221\x22 fill=\x22n\ +one\x22 fill-rule=\x22\ +evenodd\x22>\x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x19\xf8\ +\x00\ +\x00\xe0\x1cx\x9c\xed\x9c\x09\x5c\x14\x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f1\x9b\x17-i\x8f\xb6\x02\xc7H+\ +\x01\xf6\xfe\xf9\xe6\x82\xcf\x0a\xf1\xdd\x88\xe6\xec#\xc2\xb5\ +(\xf6<\x12\xc7J\x5c\xae\x11\xdeo\xe0\xb8\x0f\xbfm\ +\x83c\xa5{\x99\xbba\x1a|\xcfJ\x0bx\x01\x5c\xe8\ +\x94\x0c\xe07\x8e\xd8rp\xce\xfd\xff\xfe\xed/W\x00\ +\xfbjl\xb3\xf1y.~\x93\xe9$\x80k<\x17\x00\ +t\xe3{(\x1b\x01\x8c3\x10\xc04-\xa1\x0b\xae\xaf\ +\xe3\xb7\xbe\xd8\xd7\x80\xff\x06^\xeb\x82\xf5\x9d\xfd\xed\xbb\ +\xb6\xd6\xe7\xdf\x0a\xd6\xfb\xff\xf7\xb6\x87\x87\x87\x87\x87\x87\ +\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\x87\ +\x87\x87\x87\x87\x87\x87\x87\x87\xe7\x1f\x81\xf0%\x8a\x08\xe1\ +\x97\x82?\xf2\x92\x80\x88\x187!\xf9/\x09k\xdd\x96\ +\xa8\xff\x03;\xbc\xca\x99\ +\x00\x00\x087\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ not active - s\ +aved\x0d\x0a \ + Created \ +with Sketch.\x0d\x0a <\ +/defs>\x0d\x0a \ +\x0d\x0a \x0d\x0a <\ +path d=\x22M3.11645\ +814,1.98491547 C\ +1.81085731,3.256\ +48192 1,5.033548\ +03 1,7 C1,10.691\ +145 3.85693233,1\ +3.7150177 7.4801\ +6927,13.9809903 \ +C7.55923919,13.9\ +867947 7.5433296\ +9,11.4601372 7.4\ +3244079,6.401017\ +95 C4.76920501,3\ +.70741298 3.3305\ +4412,2.23537882 \ +3.11645814,1.984\ +91547 Z\x22 id=\x22Com\ +bined-Shape\x22>\x0d\x0a \ + \x0d\x0a <\ +path d=\x22M14.9826\ +165,6.50282053 C\ +14.7276121,2.868\ +84654 11.6988335\ +,0 8,0 C6.821531\ +33,0 5.71107957,\ +0.29121506 4.736\ +68211,0.80560781\ + C5.52211072,1.5\ +7704166 8.929157\ +37,4.97484587 10\ +.4514738,6.50452\ +22 C10.82345,6.5\ +0282053 14.72604\ +01,6.5045222 14.\ +9826165,6.502820\ +53 Z\x22 id=\x22Combin\ +ed-Shape\x22>\x0d\x0a <\ +path d=\x22M12.3449\ +55,7.6097276 C12\ +.344955,7.609727\ +6 13.3370708,7.7\ +3374209 14.60803\ +62,8.42756253 C1\ +4.2393452,8.7623\ +7994 12.344955,1\ +0.6534218 12.344\ +955,10.6534218 L\ +12.344955,7.6097\ +276 Z\x22 id=\x22Trian\ +gle-2\x22 transform\ +=\x22translate(13.4\ +76496, 9.131575)\ + rotate(90.00000\ +0) translate(-13\ +.476496, -9.1315\ +75) \x22>\x0d\x0a \ + \x0d\x0a \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x05(\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \x0d\ +\x0a \x0d\x0a <\ +/g>\x0d\x0a \x0d\x0a<\ +/svg>\x0d\x0a\ +\x00\x00\x05\x14\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a <\ +g id=\x22lock_on_No\ +tTransparent\x22 tr\ +ansform=\x22transla\ +te(3.000000, 1.0\ +00000)\x22 fill=\x22#E\ +9E9E9\x22 fill-rule\ +=\x22nonzero\x22>\x0d\x0a \ + \x0d\x0a \x0d\ +\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x07o\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / out\ +liner / visible \ +/ mixed state - \ +hover\x0d\x0a \ + Created\ + with Sketch.\x0d\x0a \x0d\x0a\ + \ +\x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \ + \x0d\x0a \ + \ +\x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x001/\ +\x00\ +\x01\x04 x\x9c\xed=\x07@SW\xd7\xf7%\xec\xa5\ +lpF\x147#\xcc$\xa8\x88\xb8P\xa9\x0a\x8a\xa3\ +\xfaIH\xc2\xd0\x90`\x12\xdc\xab\xcb~\xd5\xd6\x81\xd6\ +]m\xd5\xda\xaa\xd5\xd6Zg\x9d\xe0.8\xab\xb6\xda\ +\xe1\xde\x0a8\x90\x99\xfc\xe7\xbc\xe4a\x8c\x8c\xa0Q\xfb\ +\xf7\xcb\x0d\xe7\xbd;\xce=\xe7\xdcs\xef;\xf7\xdc\xfb\ +\x06\xb1\xb1\xa4-!\xc4\x86x\x115\xb1\x80\x18E\xb4\ +\x076}J\x84\x03\xa5\x17g\xd1q\xc0\xa3\xfc)\xb6\ +.\x1f\x90)+]\x9c\x05\x07g\x86\xce\x90\x06\x94\x8b\ +\x1e\x8e\xbb.\x8e\xb5=\xf4hz2\xf8s\x08\xd5\x80\ +Xj\xe3T\x18\xd5\xb02\xde\x89j\xa4G\xa7\xb5\x1e\ +/.\x1e\x89\x0f\xc4\xbaSAt\xdc\x0d\xe2\xa9T\xdc\ +3|\xd6.\xa7\xe7\x0d\xc3x\ +\x83_!\xbf'\xea\x05\xf4\xa4\xfd\xd9\x95O#\xa4U\ +}\xe6\x1c%\x96'I8\xfdR\xe5*\xb92U\x9e\ +\xc1\x89\x8e\xe6\x04\x05r\xc39\xad\x07\xa5\xc9\xc4\xf2\xb1\ +\xca6\x04\x93\x82\xc0\x10\xf8\xe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\xe8\x85\x86\x03}\xb4\xa1q\xb4\xcb\x0cw\xfa\ +\xecI\x83\x16\xc3\x11~\x0et\x0d\xfc\xb9\xeax=\xfb\ +U#\xd7\xb7\xb9\xd5\xff\x1e\xe7\xee\xd7<\x81#\xf4G\ +\xeeA\x88\xe5\xe7\x1e\x82\xe3\x83\xdc\xc3p\xbc\x9f{\x04\ +\x8ews\x0b\x09;/77\xaf8\x97\xe4\xdd\x22O\ +r\xef\xe4\x82\x17x\x04-\x92\xe3\x15:\x8d\x92\xe3\ +\x05t\xd7B\xcb\xf2\xca+5_\x00\x95N?\x01\xf5\ +\xe6W*\x1f\xe6\xcf\xbc\xfb\xa0~r\x12QKu\xfd\ +H\xf2\xee\xe6jNh\xe8\xc6Py\xba\xbe\x83\xe91\ +\xefd\xae\x96\xdaSr\x22W\xcb\xab\x88\xce\xd5J\x02\ +\xf3[n\xde)\x9d\xfaa&\xb8\x81\x03*\xef\x16$\ +\x1e\x02\xd6%h\xfeM\x88\x17\xea\x06\xa0\x9a`I>\ +\xc8\x0a=x\xa2\x14\x9a\xf48\xf7>\xcd\x1a\x07\xd8]\ +H\xdd%j\x1c\xd0\xa0\x82{\x90\xbaE,N\xe0\x90\ +/\x05\x91N\x14\x90\xfb\x90uX\x93\x0f\xc7C\x9a\x02\ +8\x1e\xd4\x14\xc2\xf1\x80\xe6a\xe5\xe5cx\xac\xeer\ +3\x1b\x10\xb3\x011\x1b\x10\xb3\x011\x1b\x10\xb3\x011\ +\x1b\x10\xb3\x01y\x0b\x06D{\x8f)V9\x8a\x10\xb8\ +\x84\xe9\xfb?t\x08\x9a\xa6\xbb\xd7\xd2O\xa8R1\xf7\ +]\xbak\xf1\x1c\xf4\xf1\xf0\xf0\x7f\xa8-\xb6Q\ +\x00\x00\x09t\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Sky Icon\ + / System / View\ +\x0d\x0a Created with\ + Sketch.\x0d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1e8\xe7\x9a\x1d{#\xb9B9;$\x0e\ +\xd2\x08Y\xa0\xa2Z\x98P8\xe3\x0c}\x8f\xafE\x94\ +\xde\xd5\xda\xf7\xce\x22\x9a\xe5H\xdeX\x81\x0f\x92\x0d\x8a\ +\x82\x85W6o\x840C\xbb\x8eE!Z\x0d\xac\xa5\ +EI\x00z\x82\x97\xe8(\x06\xa6\x0c\xae99\x88\x1f\ +\xf9\xc2\xfe\xfa\xa0\x99#W~\xaa\x19\xecq\x9f\xa6\x8e\ +~(\x82\xe4H >\xa6UH J\xe3\x9f{\x06\ +\xc4\xc2Fh `\xe3\x9e\xda\x923\xc1#\x1br\x05\ +\x02\xa0\x83\x92\xa4D\xb8\xe3\xc55\x83\xd9\xccq\x02\xe3\ +\x90\x1c\x22/\xcb#2\x9a\x08\xf2\x00\x00b\xa4 8\ +\xf7\x02yfi\x8ckx\x82_h$\xfe\xa3s\x08\ +\xc0\xec\x82\x91*\x95\xce\x82\x01\xfb\xc7\x1f\xb0\xf4\xac\x97\ +\x14\x82\x11\xf1.\xd8\x9b\x16\xa8(\x94\xa9\x1b\xae8I\ +\xb5\x9f\xe1\x12\x0a\x02\xa5\x99\x86\xec\xa9y\xc0\x00\x9d\xdf\ +mJ)\xb3\x18*F+\x8e\x1e0i\x06\xb2\x82\x08\ +\x0a\x91\xb0\x82\x85>\xa2\x9bw\x00\x14\x82\x9eZ8\xe2\ +o\xba\x81<\x08#\xac\xa7\xfd\x10\xe7Y\xdf\xa6\xa6\xfa\ +\x0a\x10*F3\x8elL\x11 \x18D\x15\xab\x94\xf1\ +\xbc\xeeJ#\xad\x22\xea\x5c\x82\x04B\xa47\x8e; \ +9D\x08m&\xa2\xa4\xb5H H|\xc51#\x90\ +@\xeeT\x96\x8b\xb55c\xe8\xba\x92\x07\x98A\x12\xf0\ +\x00\x01EHB\x10P\xfb\x06\xca[s \x83u\xad\ +\x15 \x86q\xc5\xf4% O\x84\x82=\xf2\x9d\x09\x08\ + ! \xaa\x91l=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A\x93t\x191A\x8c\ +\xf4\x1c\xc8G\xf4l\xd5\xf6\xcc,\x5c\xcbQ\xd5\xb5}\ +a\xbc\xc0u\x9ds]\xd7\xb5-\x7fa\xd8\xb64\xf7\ +[\xd96}\xa3.\xd9\xb6\x9d\xb3m\xa06\xbd\xbbq\ +\xdc\xb5MOs\xdd\xb7{Cp\xde7\xbd\xf2\xd9\xd5\ +w\xde\x03\x81\xd6\xb7\xfe\x0b\x85\xe1\x97\x9d\xeb\x87\xe2\xb8\ +\xb6\xd7\x84\xe38\xfeA&\xe2y\x1eS\x86\xe4\xf9^\ +c}\xe5\xf9\x9esv\xe6\xf9\xde\x83m\xe7\xfa\x1e\x93\ +d\xe8\xfa^\xa3^\xe9\xfa\x9e\xb3W\xea\xfa\xde\xc3\x16\ +\xeb\xfb\x1e\xd2\xa9\xec\xfb^\xe3\x00\xe3\xbb\x9e\xf3d@\ +@\x13\x00\xfe\x00\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\ +\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x01\x01\x04\x00\x01\ +\x00\x00\x00`\x00\x00\x00\x02\x01\x03\x00\x04\x00\x00\x00L\ +\x08\x00\x00\x03\x01\x03\x00\x01\x00\x00\x00\x05\x00\x00\x00\x06\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00\x11\x01\x04\x00\x01\ +\x00\x00\x00\x08\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\x00\x04\ +\x00\x00\x00\x16\x01\x04\x00\x01\x00\x00\x00`\x00\x00\x00\x17\ +\x01\x04\x00\x01\x00\x00\x00Z\x07\x00\x00\x1a\x01\x05\x00\x01\ +\x00\x00\x00T\x08\x00\x00\x1b\x01\x05\x00\x01\x00\x00\x00\x5c\ +\x08\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00(\ +\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\x00\x10\ +\x00\x00\x00d\x08\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00R\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x00S\ +\x01\x03\x00\x04\x00\x00\x00t\x08\x00\x00s\x87\x07\x00H\ +\x0c\x00\x00|\x08\x00\x00\x00\x00\x00\x00\x08\x00\x08\x00\x08\ +\x00\x08\x00\x802\x02\x00\xe8\x03\x00\x00\x802\x02\x00\xe8\ +\x03\x00\x00paint.net 4.0\ +.9\x00\x01\x00\x01\x00\x01\x00\x01\x00\x00\x00\x0cHL\ +ino\x02\x10\x00\x00mntrRGB X\ +YZ \x07\xce\x00\x02\x00\x09\x00\x06\x001\x00\x00a\ +cspMSFT\x00\x00\x00\x00IEC s\ +RGB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xf6\xd6\x00\x01\x00\x00\x00\x00\xd3-HP \x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11c\ +prt\x00\x00\x01P\x00\x00\x003desc\x00\ +\x00\x01\x84\x00\x00\x00lwtpt\x00\x00\x01\xf0\x00\ +\x00\x00\x14bkpt\x00\x00\x02\x04\x00\x00\x00\x14r\ +XYZ\x00\x00\x02\x18\x00\x00\x00\x14gXYZ\x00\ +\x00\x02,\x00\x00\x00\x14bXYZ\x00\x00\x02@\x00\ +\x00\x00\x14dmnd\x00\x00\x02T\x00\x00\x00pd\ +mdd\x00\x00\x02\xc4\x00\x00\x00\x88vued\x00\ +\x00\x03L\x00\x00\x00\x86view\x00\x00\x03\xd4\x00\ +\x00\x00$lumi\x00\x00\x03\xf8\x00\x00\x00\x14m\ +eas\x00\x00\x04\x0c\x00\x00\x00$tech\x00\ +\x00\x040\x00\x00\x00\x0crTRC\x00\x00\x04<\x00\ +\x00\x08\x0cgTRC\x00\x00\x04<\x00\x00\x08\x0cb\ +TRC\x00\x00\x04<\x00\x00\x08\x0ctext\x00\ +\x00\x00\x00Copyright (c)\ + 1998 Hewlett-Pa\ +ckard Company\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00\x12sRGB \ +IEC61966-2.1\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x12sRGB IEC\ +61966-2.1\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00XYZ \x00\ +\x00\x00\x00\x00\x00\xf3Q\x00\x01\x00\x00\x00\x01\x16\xccX\ +YZ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00XYZ \x00\x00\x00\x00\x00\x00o\xa2\x00\ +\x008\xf5\x00\x00\x03\x90XYZ \x00\x00\x00\x00\x00\ +\x00b\x99\x00\x00\xb7\x85\x00\x00\x18\xdaXYZ \x00\ +\x00\x00\x00\x00\x00$\xa0\x00\x00\x0f\x84\x00\x00\xb6\xcfd\ +esc\x00\x00\x00\x00\x00\x00\x00\x16IEC h\ +ttp://www.iec.ch\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16IEC \ +http://www.iec.c\ +h\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00d\ +esc\x00\x00\x00\x00\x00\x00\x00.IEC 6\ +1966-2.1 Default\ + RGB colour spac\ +e - sRGB\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00.IEC 61966-2.\ +1 Default RGB co\ +lour space - sRG\ +B\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00desc\x00\x00\x00\x00\x00\ +\x00\x00,Reference Vie\ +wing Condition i\ +n IEC61966-2.1\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00,Refere\ +nce Viewing Cond\ +ition in IEC6196\ +6-2.1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00v\ +iew\x00\x00\x00\x00\x00\x13\xa4\xfe\x00\x14_.\x00\ +\x10\xcf\x14\x00\x03\xed\xcc\x00\x04\x13\x0b\x00\x03\x5c\x9e\x00\ +\x00\x00\x01XYZ \x00\x00\x00\x00\x00L\x09V\x00\ +P\x00\x00\x00W\x1f\xe7meas\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x8f\x00\x00\x00\x02sig \x00\ +\x00\x00\x00CRT curv\x00\x00\x00\x00\x00\ +\x00\x04\x00\x00\x00\x00\x05\x00\x0a\x00\x0f\x00\x14\x00\x19\x00\ +\x1e\x00#\x00(\x00-\x002\x007\x00;\x00@\x00\ +E\x00J\x00O\x00T\x00Y\x00^\x00c\x00h\x00\ +m\x00r\x00w\x00|\x00\x81\x00\x86\x00\x8b\x00\x90\x00\ +\x95\x00\x9a\x00\x9f\x00\xa4\x00\xa9\x00\xae\x00\xb2\x00\xb7\x00\ +\xbc\x00\xc1\x00\xc6\x00\xcb\x00\xd0\x00\xd5\x00\xdb\x00\xe0\x00\ +\xe5\x00\xeb\x00\xf0\x00\xf6\x00\xfb\x01\x01\x01\x07\x01\x0d\x01\ +\x13\x01\x19\x01\x1f\x01%\x01+\x012\x018\x01>\x01\ +E\x01L\x01R\x01Y\x01`\x01g\x01n\x01u\x01\ +|\x01\x83\x01\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\ +\xb9\x01\xc1\x01\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\ +\xfa\x02\x03\x02\x0c\x02\x14\x02\x1d\x02&\x02/\x028\x02\ +A\x02K\x02T\x02]\x02g\x02q\x02z\x02\x84\x02\ +\x8e\x02\x98\x02\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\ +\xe0\x02\xeb\x02\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03-\x03\ +8\x03C\x03O\x03Z\x03f\x03r\x03~\x03\x8a\x03\ +\x96\x03\xa2\x03\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\ +\xf9\x04\x06\x04\x13\x04 \x04-\x04;\x04H\x04U\x04\ +c\x04q\x04~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\ +\xd3\x04\xe1\x04\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05:\x05\ +I\x05X\x05g\x05w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\ +\xc5\x05\xd5\x05\xe5\x05\xf6\x06\x06\x06\x16\x06'\x067\x06\ +H\x06Y\x06j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\ +\xd1\x06\xe3\x06\xf5\x07\x07\x07\x19\x07+\x07=\x07O\x07\ +a\x07t\x07\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\ +\xf8\x08\x0b\x08\x1f\x082\x08F\x08Z\x08n\x08\x82\x08\ +\x96\x08\xaa\x08\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09\ +:\x09O\x09d\x09y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\ +\xe5\x09\xfb\x0a\x11\x0a'\x0a=\x0aT\x0aj\x0a\x81\x0a\ +\x98\x0a\xae\x0a\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0b\ +Q\x0bi\x0b\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\ +\x12\x0c*\x0cC\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\ +\xd9\x0c\xf3\x0d\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\ +\xa9\x0d\xc3\x0d\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\ +\x7f\x0e\x9b\x0e\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f\ +^\x0fz\x0f\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10\ +C\x10a\x10~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x11\ +1\x11O\x11m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12\ +&\x12E\x12d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13\ +#\x13C\x13c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14\ +'\x14I\x14j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x15\ +4\x15V\x15x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16\ +I\x16l\x16\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17\ +e\x17\x89\x17\xae\x17\xd2\x17\xf7\x18\x1b\x18@\x18e\x18\ +\x8a\x18\xaf\x18\xd5\x18\xfa\x19 \x19E\x19k\x19\x91\x19\ +\xb7\x19\xdd\x1a\x04\x1a*\x1aQ\x1aw\x1a\x9e\x1a\xc5\x1a\ +\xec\x1b\x14\x1b;\x1bc\x1b\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c\ +*\x1cR\x1c{\x1c\xa3\x1c\xcc\x1c\xf5\x1d\x1e\x1dG\x1d\ +p\x1d\x99\x1d\xc3\x1d\xec\x1e\x16\x1e@\x1ej\x1e\x94\x1e\ +\xbe\x1e\x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xef@\xef\xcc\xf0X\xf0\xe5\xf1r\xf1\ +\xff\xf2\x8c\xf3\x19\xf3\xa7\xf44\xf4\xc2\xf5P\xf5\xde\xf6\ +m\xf6\xfb\xf7\x8a\xf8\x19\xf8\xa8\xf98\xf9\xc7\xfaW\xfa\ +\xe7\xfbw\xfc\x07\xfc\x98\xfd)\xfd\xba\xfeK\xfe\xdc\xff\ +m\xff\xff\ +\x00\x00\x08A\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + icon / o\ +utliner / slice \ +/ not active - s\ +aved copy\x0d\x0a Cre\ +ated with Sketch\ +.\x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\ + \x0d\x0a \ + \x0d\x0a \ + \ +\x0d\x0a \ + \x0d\x0a\ + \x0d\x0a \ + \x0d\x0a\x0d\x0a\ +\ +\x00\x00\x09\xa3\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Artboard\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a\ + \ +\x0d\x0a \ +\x0d\x0a \ +\x0d\x0a \x0d\x0a\ + \x0d\x0a\ +\x0d\x0a\ +\x00\x00\x02\xb6\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a \ + Icons / \ +System / Carat /\ + White / Default\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a <\ +polygon id=\x22Tria\ +ngle\x22 fill=\x22#FFF\ +FFF\x22 transform=\x22\ +translate(8.0000\ +00, 8.000000) sc\ +ale(1, -1) rotat\ +e(90.000000) tra\ +nslate(-8.000000\ +, -8.000000) \x22 p\ +oints=\x228 6 12 10\ + 4 10\x22>\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x8e\x0c\ +I\ +I*\x00\x08\x00\x00\x00\x19\x00\xfe\x00\x04\x00\x01\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x01\x01\x03\x00\x01\x00\x00\x00`\x00\x00\x00\x02\x01\x03\ +\x00\x04\x00\x00\x00:\x01\x00\x00\x03\x01\x03\x00\x01\x00\x00\ +\x00\x05\x00\x00\x00\x06\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00\x11\x01\x04\x00\x01\x00\x00\x00`V\x00\x00\x12\x01\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x15\x01\x03\x00\x01\x00\x00\ +\x00\x04\x00\x00\x00\x16\x01\x03\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x17\x01\x04\x00\x01\x00\x00\x00\xd9\x15\x00\x00\x1a\x01\x05\ +\x00\x01\x00\x00\x00B\x01\x00\x00\x1b\x01\x05\x00\x01\x00\x00\ +\x00J\x01\x00\x00\x1c\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\ +\x00(\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\x001\x01\x02\ +\x00\x22\x00\x00\x00R\x01\x00\x002\x01\x02\x00\x14\x00\x00\ +\x00t\x01\x00\x00=\x01\x03\x00\x01\x00\x00\x00\x02\x00\x00\ +\x00R\x01\x03\x00\x01\x00\x00\x00\x01\x00\x00\x00\xbc\x02\x01\ +\x00\x1a;\x00\x00\x88\x01\x00\x00\xbb\x83\x07\x00\x0f\x00\x00\ +\x00\xa2<\x00\x00I\x86\x01\x00f\x0d\x00\x00\xb2<\x00\ +\x00i\x87\x04\x00\x01\x00\x00\x00\x0a\x0a \x0a\ + \x0a \ + Adobe Photosho\ +p CC 2015.5 (Win\ +dows)\x0a \ + 2017-03-07T11:3\ +2:29-08:00\x0a \ + 2017-04-04T\ +11:28-07:00\x0a \ + 2017-04-\ +04T11:28-07:00\x0a image/tiff\ +\x0a \ + 3\x0a sRGB IEC61966-\ +2.1\x0a \ + \x0a \x0a \ + a\ +dobe:docid:photo\ +shop:94a27cdb-04\ +33-11e7-b02d-9f8\ +4d9f5a326\x0a \ + adobe:\ +docid:photoshop:\ +acaee4ff-1960-11\ +e7-bae7-e6e7a5cd\ +2814\x0a \ + \x0a \x0a \ + xmp.iid:\ +fa5f33a4-5729-d3\ +41-9ab8-5edce3a2\ +68a4\x0a \ + adobe:docid:p\ +hotoshop:696e80e\ +4-1964-11e7-8c4b\ +-d6fec7ab83c2\ +\x0a xmp.did:ca77\ +1a70-f965-e14f-9\ +103-360465543dbf\ +\x0a \ + \x0a \ + \x0a \ + \x0a \ + crea\ +ted\x0a \ + xmp.iid:c\ +a771a70-f965-e14\ +f-9103-360465543\ +dbf\x0a \ + 2017-03-07T\ +11:32:29-08:00\x0a \ + Adobe Photosh\ +op CC 2015.5 (Wi\ +ndows)\x0a \ + \x0a \ + \x0a \ + saved\x0a \ + \ +xmp.iid:16fdf09c\ +-857d-944e-9783-\ +e127cb1b9cf4\x0a\ + \ + 20\ +17-03-08T11:37:4\ +5-08:00\x0a \ + Adob\ +e Photoshop CC 2\ +015.5 (Windows)<\ +/stEvt:softwareA\ +gent>\x0a \ + /\x0a \ + \x0a \ + \x0a \ + saved\x0a \ + xmp.\ +iid:fa5f33a4-572\ +9-d341-9ab8-5edc\ +e3a268a4\x0a \ + 2017-0\ +4-04T11:28-07:00\ +\x0a \ + \ +Adobe Photo\ +shop CC 2017 (Wi\ +ndows)\x0a \ + <\ +stEvt:changed>/<\ +/stEvt:changed>\x0a\ + <\ +/rdf:li>\x0a \ + \x0a\ + \x0a \ +\x0a \ +\x0a\x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a\ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \x0a \ + \ + \ + \ + \ + \ + \ +\x0a \ + \x0a\x1c\x01Z\x00\x03\x1b%G\x1c\x02\x00\x00\x02\x00\x00\ +\x008BIM\x04%\x00\x00\x00\x00\x00\x10\xcd\xcf\xfa\ +}\xa8\xc7\xbe\x09\x05pv\xae\xaf\x05\xc3N8BI\ +M\x04:\x00\x00\x00\x00\x00\xe5\x00\x00\x00\x10\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x0bprintOutp\ +ut\x00\x00\x00\x05\x00\x00\x00\x00PstSbo\ +ol\x01\x00\x00\x00\x00Inteenum\x00\ +\x00\x00\x00Inte\x00\x00\x00\x00Clrm\x00\ +\x00\x00\x0fprintSixteenB\ +itbool\x00\x00\x00\x00\x0bprint\ +erNameTEXT\x00\x00\x00\x01\x00\x00\ +\x00\x00\x00\x0fprintProofSe\ +tupObjc\x00\x00\x00\x0c\x00P\x00r\x00\ +o\x00o\x00f\x00 \x00S\x00e\x00t\x00u\x00\ +p\x00\x00\x00\x00\x00\x0aproofSetu\ +p\x00\x00\x00\x01\x00\x00\x00\x00Bltnenu\ +m\x00\x00\x00\x0cbuiltinProo\ +f\x00\x00\x00\x09proofCMYK\x008\ +BIM\x04;\x00\x00\x00\x00\x02-\x00\x00\x00\x10\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x12printOu\ +tputOptions\x00\x00\x00\x17\x00\ +\x00\x00\x00Cptnbool\x00\x00\x00\x00\x00\ +Clbrbool\x00\x00\x00\x00\x00Rgs\ +Mbool\x00\x00\x00\x00\x00CrnCbo\ +ol\x00\x00\x00\x00\x00CntCbool\x00\ +\x00\x00\x00\x00Lblsbool\x00\x00\x00\x00\ +\x00Ngtvbool\x00\x00\x00\x00\x00Em\ +lDbool\x00\x00\x00\x00\x00Intrb\ +ool\x00\x00\x00\x00\x00BckgObjc\ +\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00RGBC\x00\x00\ +\x00\x03\x00\x00\x00\x00Rd doub@o\ +\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00Grn do\ +ub@o\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00Bl\ + doub@o\xe0\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00BrdTUntF#Rlt\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Bld Un\ +tF#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00RsltUntF#Pxl@b\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0avector\ +Databool\x01\x00\x00\x00\x00PgP\ +senum\x00\x00\x00\x00PgPs\x00\x00\x00\ +\x00PgPC\x00\x00\x00\x00LeftUnt\ +F#Rlt\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00Top UntF#Rlt\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00Scl Unt\ +F#Prc@Y\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x10cropWhenPrintin\ +gbool\x00\x00\x00\x00\x0ecropRe\ +ctBottomlong\x00\x00\x00\x00\ +\x00\x00\x00\x0ccropRectLeft\ +long\x00\x00\x00\x00\x00\x00\x00\x0dcrop\ +RectRightlong\x00\x00\x00\ +\x00\x00\x00\x00\x0bcropRectTop\ +long\x00\x00\x00\x00\x008BIM\x03\xed\x00\ +\x00\x00\x00\x00\x10\x00\x90\x00\x00\x00\x01\x00\x01\x00\x90\x00\ +\x00\x00\x01\x00\x018BIM\x04&\x00\x00\x00\x00\x00\ +\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\x80\x00\x008\ +BIM\x03\xee\x00\x00\x00\x00\x00\x0d\x0cTran\ +sparency\x008BIM\x04\x15\x00\ +\x00\x00\x00\x00\x1e\x00\x00\x00\x0d\x00T\x00r\x00a\x00\ +n\x00s\x00p\x00a\x00r\x00e\x00n\x00c\x00\ +y\x00\x008BIM\x045\x00\x00\x00\x00\x00\x11\x00\ +\x00\x00\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00d\x01\ +\x008BIM\x04\x1d\x00\x00\x00\x00\x00\x04\x00\x00\x00\ +\x008BIM\x03\xf2\x00\x00\x00\x00\x00\x0a\x00\x00\xff\ +\xff\xff\xff\xff\xff\x00\x008BIM\x04\x0d\x00\x00\x00\ +\x00\x00\x04\x00\x00\x00\x1e8BIM\x04\x19\x00\x00\x00\ +\x00\x00\x04\x00\x00\x00\x1e8BIM\x03\xf3\x00\x00\x00\ +\x00\x00\x09\x00\x00\x00\x00\x00\x00\x00\x00\x01\x008BI\ +M'\x10\x00\x00\x00\x00\x00\x0a\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x018BIM\x03\xf5\x00\x00\x00\x00\x00H\x00\ +/ff\x00\x01\x00lff\x00\x06\x00\x00\x00\x00\x00\ +\x01\x00/ff\x00\x01\x00\xa1\x99\x9a\x00\x06\x00\x00\x00\ +\x00\x00\x01\x002\x00\x00\x00\x01\x00Z\x00\x00\x00\x06\x00\ +\x00\x00\x00\x00\x01\x005\x00\x00\x00\x01\x00-\x00\x00\x00\ +\x06\x00\x00\x00\x00\x00\x018BIM\x03\xf8\x00\x00\x00\ +\x00\x00p\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\ +\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\x03\xe8\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\ +\xe8\x00\x008BIM\x04\x00\x00\x00\x00\x00\x00\x02\x00\ +\x008BIM\x04\x02\x00\x00\x00\x00\x00\x02\x00\x008\ +BIM\x040\x00\x00\x00\x00\x00\x01\x01\x008BI\ +M\x04-\x00\x00\x00\x00\x00\x06\x00\x01\x00\x00\x00\x038\ +BIM\x04\x08\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\x00\ +\x00\x02@\x00\x00\x02@\x00\x00\x00\x008BIM\x04\ +\x1e\x00\x00\x00\x00\x00\x04\x00\x00\x00\x008BIM\x04\ +\x1a\x00\x00\x00\x00\x035\x00\x00\x00\x06\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\ +\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00null\x00\x00\x00\x02\x00\x00\ +\x00\x06boundsObjc\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00Rct1\x00\x00\x00\x04\x00\x00\ +\x00\x00Top long\x00\x00\x00\x00\x00\x00\ +\x00\x00Leftlong\x00\x00\x00\x00\x00\x00\ +\x00\x00Btomlong\x00\x00\x00`\x00\x00\ +\x00\x00Rghtlong\x00\x00\x00`\x00\x00\ +\x00\x06slicesVlLs\x00\x00\x00\x01\ +Objc\x00\x00\x00\x01\x00\x00\x00\x00\x00\x05sl\ +ice\x00\x00\x00\x12\x00\x00\x00\x07slice\ +IDlong\x00\x00\x00\x00\x00\x00\x00\x07gr\ +oupIDlong\x00\x00\x00\x00\x00\x00\x00\ +\x06originenum\x00\x00\x00\x0cE\ +SliceOrigin\x00\x00\x00\x0da\ +utoGenerated\x00\x00\x00\x00\ +Typeenum\x00\x00\x00\x0aESli\ +ceType\x00\x00\x00\x00Img \x00\x00\ +\x00\x06boundsObjc\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00Rct1\x00\x00\x00\x04\x00\x00\ +\x00\x00Top long\x00\x00\x00\x00\x00\x00\ +\x00\x00Leftlong\x00\x00\x00\x00\x00\x00\ +\x00\x00Btomlong\x00\x00\x00`\x00\x00\ +\x00\x00Rghtlong\x00\x00\x00`\x00\x00\ +\x00\x03urlTEXT\x00\x00\x00\x01\x00\x00\x00\ +\x00\x00\x00nullTEXT\x00\x00\x00\x01\x00\ +\x00\x00\x00\x00\x00MsgeTEXT\x00\x00\x00\ +\x01\x00\x00\x00\x00\x00\x06altTagTEX\ +T\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0ecellT\ +extIsHTMLbool\x01\x00\x00\ +\x00\x08cellTextTEXT\x00\x00\ +\x00\x01\x00\x00\x00\x00\x00\x09horzAlig\ +nenum\x00\x00\x00\x0fESliceH\ +orzAlign\x00\x00\x00\x07defa\ +ult\x00\x00\x00\x09vertAlign\ +enum\x00\x00\x00\x0fESliceVe\ +rtAlign\x00\x00\x00\x07defau\ +lt\x00\x00\x00\x0bbgColorTyp\ +eenum\x00\x00\x00\x11ESliceB\ +GColorType\x00\x00\x00\x00No\ +ne\x00\x00\x00\x09topOutsetl\ +ong\x00\x00\x00\x00\x00\x00\x00\x0aleftO\ +utsetlong\x00\x00\x00\x00\x00\x00\x00\ +\x0cbottomOutsetlon\ +g\x00\x00\x00\x00\x00\x00\x00\x0brightOu\ +tsetlong\x00\x00\x00\x00\x008BI\ +M\x04(\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x02?\xf0\x00\ +\x00\x00\x00\x00\x008BIM\x04\x14\x00\x00\x00\x00\x00\ +\x04\x00\x00\x00\x0d8BIM\x04\x0c\x00\x00\x00\x00\x03\ +\xfb\x00\x00\x00\x01\x00\x00\x000\x00\x00\x000\x00\x00\x00\ +\x90\x00\x00\x1b\x00\x00\x00\x03\xdf\x00\x18\x00\x01\xff\xd8\xff\ +\xed\x00\x0cAdobe_CM\x00\x01\xff\xee\x00\ +\x0eAdobe\x00d\x80\x00\x00\x00\x01\xff\xdb\x00\ +\x84\x00\x0c\x08\x08\x08\x09\x08\x0c\x09\x09\x0c\x11\x0b\x0a\x0b\ +\x11\x15\x0f\x0c\x0c\x0f\x15\x18\x13\x13\x15\x13\x13\x18\x11\x0c\ +\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x01\x0d\x0b\x0b\x0d\x0e\x0d\x10\x0e\x0e\x10\x14\x0e\x0e\ +\x0e\x14\x14\x0e\x0e\x0e\x0e\x14\x11\x0c\x0c\x0c\x0c\x0c\x11\x11\ +\x0c\x0c\x0c\x0c\x0c\x0c\x11\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\ +\x0c\x0c\x0c\xff\xc0\x00\x11\x08\x000\x000\x03\x01\x22\x00\ +\x02\x11\x01\x03\x11\x01\xff\xdd\x00\x04\x00\x03\xff\xc4\x01?\ +\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\ +\x00\x03\x00\x01\x02\x04\x05\x06\x07\x08\x09\x0a\x0b\x01\x00\x01\ +\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\ +\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x10\x00\x01\x04\x01\x03\ +\x02\x04\x02\x05\x07\x06\x08\x05\x03\x0c3\x01\x00\x02\x11\x03\ +\x04!\x121\x05AQa\x13\x22q\x812\x06\x14\x91\ +\xa1\xb1B#$\x15R\xc1b34r\x82\xd1C\x07\ +%\x92S\xf0\xe1\xf1cs5\x16\xa2\xb2\x83&D\x93\ +TdE\xc2\xa3t6\x17\xd2U\xe2e\xf2\xb3\x84\xc3\ +\xd3u\xe3\xf3F'\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\xf4\xa5\ +\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\xe6\xf6\ +7GWgw\x87\x97\xa7\xb7\xc7\xd7\xe7\xf7\x11\x00\x02\ +\x02\x01\x02\x04\x04\x03\x04\x05\x06\x07\x07\x06\x055\x01\x00\ +\x02\x11\x03!1\x12\x04AQaq\x22\x13\x052\x81\ +\x91\x14\xa1\xb1B#\xc1R\xd1\xf03$b\xe1r\x82\ +\x92CS\x15cs4\xf1%\x06\x16\xa2\xb2\x83\x07&\ +5\xc2\xd2D\x93T\xa3\x17dEU6te\xe2\xf2\ +\xb3\x84\xc3\xd3u\xe3\xf3F\x94\xa4\x85\xb4\x95\xc4\xd4\xe4\ +\xf4\xa5\xb5\xc5\xd5\xe5\xf5Vfv\x86\x96\xa6\xb6\xc6\xd6\ +\xe6\xf6'7GWgw\x87\x97\xa7\xb7\xc7\xff\xda\x00\ +\x0c\x03\x01\x00\x02\x11\x03\x11\x00?\x00\xf4<\xdc\xcc\x96\ +d\x9a\xa9;@\x80\x00\x00\x92O\xc6P\xfd~\xab\xe0\ +\xff\x00\xfbl\x7f\xe4R\xc9\xff\x00\x95\x1b\xfdz\xff\x00\ +\xef\xabN\xd79\x95\xb9\xcdi{\x9a\x09\x0d\x1c\x92\x92\ +\x9c\xa7e\xf5\x16}79\xb3\xc6\xe6\xb4~V\xa7n\ +OSp\x96\x978\x1e\xe1\x80\x8f\xc1\xaa\xc6.\x0bl\ +g\xaf\x96\xd2\xfb\xac\xd4\xee\x9d\x07a\xb53\xea\x18Y\ +5>\x92EW81\xec\x99\x12x))\x0f\xaf\xd5\ +|\x1f\xfe`\xff\x00\xc8\xa2`fdY\x91\xe9Zw\ +\x02\x0f \x02\x08\xfe\xaa\xd2Y\x18?\xf2\x81\xff\x00\xae\ +~T\x94\xff\x00\xff\xd0\xef\xf2\x7f\xe5F\xff\x00^\xbf\ +\xfb\xea\xd0\xc9\xca\xaf\x19\xa0\xbeIq\x86\xb5\xa2IY\ +\xf9?\xf2\xa3\x7f\xaf_\xfd\xf5Y\xea\x9e\xd6Soz\ +\xec\x07\xe5\xfe\xa1%-\xf6\xfb\xdd\xfc\xde+\xcf\x81v\ +\x9f\xc1\x0a\xe6\xf5\x0b\x9c\xcb\x9f[X)\x975\xa4\xce\ +\xbc\xce\x9f\x05k<\xde1\x9c\xeaL\x11\xab\x88\xe7h\ +\xfa[R\xc1u\x96b5\xd6\x9d\xc5\xd3\x07\xbcN\x9b\ +\x92S\x01E\x01L\x01\ +R\x01Y\x01`\x01g\x01n\x01u\x01|\x01\x83\x01\ +\x8b\x01\x92\x01\x9a\x01\xa1\x01\xa9\x01\xb1\x01\xb9\x01\xc1\x01\ +\xc9\x01\xd1\x01\xd9\x01\xe1\x01\xe9\x01\xf2\x01\xfa\x02\x03\x02\ +\x0c\x02\x14\x02\x1d\x02&\x02/\x028\x02A\x02K\x02\ +T\x02]\x02g\x02q\x02z\x02\x84\x02\x8e\x02\x98\x02\ +\xa2\x02\xac\x02\xb6\x02\xc1\x02\xcb\x02\xd5\x02\xe0\x02\xeb\x02\ +\xf5\x03\x00\x03\x0b\x03\x16\x03!\x03-\x038\x03C\x03\ +O\x03Z\x03f\x03r\x03~\x03\x8a\x03\x96\x03\xa2\x03\ +\xae\x03\xba\x03\xc7\x03\xd3\x03\xe0\x03\xec\x03\xf9\x04\x06\x04\ +\x13\x04 \x04-\x04;\x04H\x04U\x04c\x04q\x04\ +~\x04\x8c\x04\x9a\x04\xa8\x04\xb6\x04\xc4\x04\xd3\x04\xe1\x04\ +\xf0\x04\xfe\x05\x0d\x05\x1c\x05+\x05:\x05I\x05X\x05\ +g\x05w\x05\x86\x05\x96\x05\xa6\x05\xb5\x05\xc5\x05\xd5\x05\ +\xe5\x05\xf6\x06\x06\x06\x16\x06'\x067\x06H\x06Y\x06\ +j\x06{\x06\x8c\x06\x9d\x06\xaf\x06\xc0\x06\xd1\x06\xe3\x06\ +\xf5\x07\x07\x07\x19\x07+\x07=\x07O\x07a\x07t\x07\ +\x86\x07\x99\x07\xac\x07\xbf\x07\xd2\x07\xe5\x07\xf8\x08\x0b\x08\ +\x1f\x082\x08F\x08Z\x08n\x08\x82\x08\x96\x08\xaa\x08\ +\xbe\x08\xd2\x08\xe7\x08\xfb\x09\x10\x09%\x09:\x09O\x09\ +d\x09y\x09\x8f\x09\xa4\x09\xba\x09\xcf\x09\xe5\x09\xfb\x0a\ +\x11\x0a'\x0a=\x0aT\x0aj\x0a\x81\x0a\x98\x0a\xae\x0a\ +\xc5\x0a\xdc\x0a\xf3\x0b\x0b\x0b\x22\x0b9\x0bQ\x0bi\x0b\ +\x80\x0b\x98\x0b\xb0\x0b\xc8\x0b\xe1\x0b\xf9\x0c\x12\x0c*\x0c\ +C\x0c\x5c\x0cu\x0c\x8e\x0c\xa7\x0c\xc0\x0c\xd9\x0c\xf3\x0d\ +\x0d\x0d&\x0d@\x0dZ\x0dt\x0d\x8e\x0d\xa9\x0d\xc3\x0d\ +\xde\x0d\xf8\x0e\x13\x0e.\x0eI\x0ed\x0e\x7f\x0e\x9b\x0e\ +\xb6\x0e\xd2\x0e\xee\x0f\x09\x0f%\x0fA\x0f^\x0fz\x0f\ +\x96\x0f\xb3\x0f\xcf\x0f\xec\x10\x09\x10&\x10C\x10a\x10\ +~\x10\x9b\x10\xb9\x10\xd7\x10\xf5\x11\x13\x111\x11O\x11\ +m\x11\x8c\x11\xaa\x11\xc9\x11\xe8\x12\x07\x12&\x12E\x12\ +d\x12\x84\x12\xa3\x12\xc3\x12\xe3\x13\x03\x13#\x13C\x13\ +c\x13\x83\x13\xa4\x13\xc5\x13\xe5\x14\x06\x14'\x14I\x14\ +j\x14\x8b\x14\xad\x14\xce\x14\xf0\x15\x12\x154\x15V\x15\ +x\x15\x9b\x15\xbd\x15\xe0\x16\x03\x16&\x16I\x16l\x16\ +\x8f\x16\xb2\x16\xd6\x16\xfa\x17\x1d\x17A\x17e\x17\x89\x17\ +\xae\x17\xd2\x17\xf7\x18\x1b\x18@\x18e\x18\x8a\x18\xaf\x18\ +\xd5\x18\xfa\x19 \x19E\x19k\x19\x91\x19\xb7\x19\xdd\x1a\ +\x04\x1a*\x1aQ\x1aw\x1a\x9e\x1a\xc5\x1a\xec\x1b\x14\x1b\ +;\x1bc\x1b\x8a\x1b\xb2\x1b\xda\x1c\x02\x1c*\x1cR\x1c\ +{\x1c\xa3\x1c\xcc\x1c\xf5\x1d\x1e\x1dG\x1dp\x1d\x99\x1d\ +\xc3\x1d\xec\x1e\x16\x1e@\x1ej\x1e\x94\x1e\xbe\x1e\xe9\x1f\ +\x13\x1f>\x1fi\x1f\x94\x1f\xbf\x1f\xea \x15 A \ +l \x98 \xc4 \xf0!\x1c!H!u!\xa1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\x05\xc1q,M\ +\x13\xc5\x09B\xa4fE\x85\xf9\x17\x17\x8d\xa6\xfcdk\ +\xb9\x08\xb0;\x1b\x84\x84LtV5A0_\x14\xc8\ +\x12\x0c\x85!\xa2\xe7\xd4\x8c|\x93RI\x00SI\x84\ +|\x8c}\x1f(\xc4\x0a\x01\x07\xb2\xa8\x9aCK\x058\ +\x0f-\x812$\xbd/\xcc\x13\x0a\x04gL\x86\x08\xed\ +3\x8a\x87\x84\xd4v#\x09\x98\x08\x02\x8a\xf3\x88\xda7\ +\xce\x84\x5c\xa71O\x13\xcc\xf5\x03\x9d\x13\xe9\xc44P\ +\x02\x11\xc9A\x9b\xa8\xc42\x03\x01\x03-\x14?\x0c\x14\ +h\xf0\xe3Ot\x8d%I\xa3\xe7\x95,w\x0c\x94\xc8\ +|oS\x86\xad\x0d\x0d\x0d\x95\x09\x0e\xfe\x8b#}!\ +JU\x15MT\x873\x07\x99\xe1E\x0c\xa1\xf1\xb9Y\ +\x9ah\xc4\xb6\x03\x810\xf8\xdaDN\x22\xb8\xdbS\xc4\ +\xae\x13\x9bU\xc8q\xab\xae\xe1\xa1V\x15UV\x9e\x14\ +\xc8\xc8\x1e\x9b\xb6\x89\xa9O\xd1\x03u\xacD\xd7\xb5\xfb\ +\xa4\x89\xaaF\xdd\xbch\x9e\xb7\x09\xe6\xea\xcav\x13\xa8\ +\xe0\x1f\xb7I\xfb;\xb8\x8e\xdb\xb2\xf29Wr\xd4\x82\ +<\xc8E!C\x81\x17\xc8\x10\x05P\xe0<\xdc\x02\xa0\ +\x97Q\xf8|\xe0\x87\xc6\x08|\x9e\xefA\xf0{C\ +<\x01\x08\x0eli\xb9\xd4\xf2k@p\x12xa\xfd\ +\xfd\x06\xe5&+\xe0\x80\x9b\x12\xf0L>\x8e\xe8,:\ +]\xbb\xe7\x02\x0f\xa5\x17\xbe\xc7\xdc\xfc\x08z\xcc\x80!\ +\x9c 6\x11\xb44V\xa0\x08yn\x89\xcb\x198F\ +\x10\x10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\xe2\ +F\xf2*\x095\xd0OA\xaf1A\xef56\x91l\ +fo\x9b7J\xf8$+\x08\x14\xe0\x8dV`\xb0\xaa\ +j\xab@\x00U\x1a\x91\xac$Jf\x10\x01@\x09\x95\ +\x80\x0b\xe2@\xecA\xd8\x1c\xf4T\x0a K?!\xef\ +?b>\xf4n\xaa\x1b\x0f\xac\x03b\x18\xd7\xc1d\x13\ +\xcdv\x10@\xc7H\x13\x02\x11UF\x06I!5\xea\ +\x0e\xf8\xeb?+\x12P\xe1\xf4\x997\x0a!PN\xf0\ +$il\x0f\x80\xd3]\xe1\x06!\x8b\x88\xee@U-\ +a\xc2$\x95\x0bP\xe0T\xc9\x22>k\xee\xe4\x05s\ +\x9e$\x91x\x13\x81\x86\xdc\xa2\x18\x18v\x10\x16\x89H\ +\x0e \x9a$\x92>}T\x85[\xee\xd2\xe5ec;\ +B\x1d;\x93m\x5c\xeb\xf974\x9f\x10\x82CV`\ +\x8c\x0a\xeb\x08\x15\x13\x878\xa9C8\xf5P$\x13\x97\ +9\xa2=\x22\x0c\xb8\x05q $\x95{W\xf5\x82!\ +\x88\xd0\x1a\xc1\x98\x0b\xf6t\x06\xc6$\x22\xf4\x83,b\ +-;\x00{b\xc2\x1b\x16\xb1n#\x0a\xf0\x9bU\x06\ +#\xc7@\xe3!H\x19\xb4Z \xf3S4\xc1~$\ +\x8a\xfc\xb0\x052\xb0B?(4\x00\x05*\xf0$\x8e\ +\xbe\x0b\xa0\xe9#\x01\x16\xb5\x88.\xcb\x80Y\x0d\x82A\ +TV\x80\x22\xb3`VO\x91U%p\xbf63;\ +\xd68\xbf\xd6<$\x08\x8c\xb0\xe1\x5c\x1bL,!\x91\ +\xf0\x0b\xef\x1a\x16\xaf\x1e$q\x0d.\xc1T\x1a\xa0\x0b\ +q`\x0c#\x8dh\x121\x10\xb2\x02O< |\x09\ +\xd3\xc8\x16\x22\x18`S\x8d6B5#\xf2CO.\ +\x10d\xab\xedn0\xadno9Bb\x10\xe9\xe8`\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x06*\x80#\ +\x95D\xf2\x97\xa0 \xd2\xabb\xb6S\x80\x8d\xdb\x80\xd8\ +\xcf1\x88\x04\xdeu,\xb7u1SBh!\x8e|\ +\xe8\x02_l6\xc6N\xa2\x10\xfe\xc8\xa1s\x82R\xee\ +@\xd4\xc3!*\x22\x18t\x09\x81\x89\x9b\xa1k\x96\xd7\ +\xfb$V\x83\x1d\x09\x9d\x9a\x82!h\xd5X\xae\xe6q\ +iW\xb4$\xa7\xb9400!\x97\x94\x15\x93\xd0A\ +-'\x83\x00\xa6\x99a\xe7\x84\xc1>FA\xbe\x1a\xe4\ +\x12\x97 \x80\x13:\x09j\xa2\x1fv\xd7h#\x97<\ +\x91\x81_\x9cB+\x97x\xc3\x97\xa2$\xba\x04@\xd1\ +qq+\xad\x1d\x9d\xa2P\x13\xba8\x18\x8d\x88\x05\xe0\ +v!\x8e\x02\x1b\x01\x9dl ig\xb3\x92!sG\ +48\xf6!h \x15\xe16\x9d!\x0a\x0c\xc29:\ +\x94\x15\x86\x8d\xd1\x8c\x18\xc4!Y\xd1P\x0d\xa1\xa3\x19\ +\x88$\xd9<\x0f\xa18\x09\xfa\x8d[\x22\x17\x0d\x95\xe9\ +,\xbaR#\x0bS\x07\x82\x19G\xa1\x94\x17\x94t\x0d\ +Y\x0e#z\x16\xc4Z\x1c\x22\x9a!\xa7b\x12\xd9\xb7\ +\xad;\xb9+n\xed\xa5U\xe2Q\x99\xd6\xc8\xc1\x22\x85\ +\x82`gL\xe1\xb3M:\x9a!E\xfa\x83@+>\ +\x00\xf3\xae\xe1/\x11b\x19\xad\xc1\x9f8\xd9\xc0u\x18\ +6\xf6p\xb5m\xf9\xcd;uU18\x10H\xf0\x03\ +\x00bSr\x97-)W0!\xeb\xc2\x0a\x8b\xbc\x15\ +\xa5TJd\x07JP\xdc5\xa0%\x10\xcf\xb7}S\ +F\xcc\xc04\x86\xa6D\x22x\x17\x8e1\x82#s\xa9\ +\xabb'\xb0\x98\x07\x16\x90\xaef\x1a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1d\xba_\x09\xf2.l<\xdc:\x17\ +\x01L\x90\xa0\xd9\xe0\x06&)/\xb7\xda\x00W\xf3\xe0\ +m\xf2_D\xda\x98\x85\xe4/\x14\x18!e3\x828\ +e\xb80\x0a\x98t\x11\x90\x1b\xf4\x7fdRG\xe5)\ +\xa1!\xbe\x1c\xe6$\x89\x14\xcf \x9dIPr\x05x\ +\xa0\x00\xff6c\x02\x1cnE\xe1\xe9%\xed\xe7\xe3\xac\ +<_\x95\xe8?\x94n_\x98\xc5\xde\xac\x22\x1f\xa6c\ +>\x94oE\xdb\xf8~y\xe8\x9f\x9f\xf9\xa6\x82)f\ +\xbf\xd6\xe7\xc4\x13\xc1y\xfc\xa1W!\xc2P)\xe6[\ +\x10\xd7`\x05\x00d\xfbt\xa4)\xf6\xbf\xfb\x22\x0en\ +?\xbc,\xff\xb0 F\x8c;\x06\x9a \x0f\xf7\xf8\x06\ +\x09\x05\x82@\xa0@\x08P\x00\x05\x0d\x01?\xa2\x0f\xe8\ +\x5c2\x1a\x03\x88\xbf`\xd18\xd4l\x01\x08\x81\xc1c\ +\xd18\xf48\x05!\x8eH\xe1\xd184E\xfd(\x86\ +\xc4\xe5\x92H\xf4z\x0d\x19\x85\xcb&\xd1\xc8\x5c\x92Y\ +&\x85NcRG\xed\x0d\xfb\x13\x92>i\x0f\x87\x9d\ +-\xde\xe3\xa77\x1b\xd5\x16\xb3\xa2\xa8\xe1{\xd5\xde\xb3\ +\xe9\xd5n\xb9]\x8eA\x80v\x10%\x8c\x08\x05\x99L\ +\xe15\xe9<\x22\x81j\xb7[\xeb\x95\xabm\xc2\xe9u\ +\x9dM \xb7k\xd4v\xd9y\xbd\xdf\xf0\x11\xa9e\x11\ +\xf9\x17\xad`q\x18\x9cV/\x19\x8d\xc7c\xf2\x19\x1c\ +\x96O)\x95\xcbe\xf3\x19\x9c\xd6o9\x9d\xcfg\xf4\ +\x1a\x1d\x16\x8fI{\x80\x80\x00\x00\x00\x03\x00\x01\xa0\x03\ +\x00\x01\x00\x00\x00\x01\x00\x00\x00\x02\xa0\x04\x00\x01\x00\x00\ +\x00`\x00\x00\x00\x03\xa0\x04\x00\x01\x00\x00\x00`\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00Adobe Pho\ +toshop Document \ +Data Block\x00MIB8n\ +rTM\x00\x00\x00\x00MIB8ryaL$\ +!\x00\x00\x01\x00\x03\x00\x00\x00\x03\x00\x00\x00]\x00\x00\ +\x00\x5c\x00\x00\x00\x04\x00\xff\xff\x88\x0d\x00\x00\x00\x00\x0c\ +\x06\x00\x00\x01\x00\x0c\x06\x00\x00\x02\x00\x0c\x06\x00\x00M\ +IB8mron\xff\x00\x08\x00<\x01\x00\x00\x00\ +\x00\x00\x00(\x00\x00\x00\x00\x00\xff\xff\x00\x00\xff\xff\x00\ +\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\ +\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x00\x00\xff\xff\x07\ +Layer 0MIB8inul\x14\ +\x00\x00\x00\x07\x00\x00\x00L\x00a\x00y\x00e\x00r\ +\x00 \x000\x00\x00\x00MIB8rsnl\x04\ +\x00\x00\x00ryalMIB8diyl\x04\ +\x00\x00\x00\x03\x00\x00\x00MIB8lblc\x04\ +\x00\x00\x00\x01\x00\x00\x00MIB8xfni\x04\ +\x00\x00\x00\x00\x00\x00\x00MIB8oknk\x04\ +\x00\x00\x00\x00\x00\x00\x00MIB8fpsl\x04\ +\x00\x00\x00\x04\x00\x00\x00MIB8rlcl\x08\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00MIB8d\ +mhsH\x00\x00\x00\x01\x00\x00\x00MIB8t\ +suc\x00\x00\x00\x004\x00\x00\x00\x10\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x08\x00\x00\x00metadat\ +a\x01\x00\x00\x00\x09\x00\x00\x00layerTi\ +mebuod\xc5\xa4\xf3l\xf98\xd6A\x00M\ +IB8prxf\x10\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00S\x00O\ +\x00\x0f\x00\x0c\x00\x0a\x00\x09\x00\x09\x00\x09\x00\x09\x00\x15\ +\x00K\x00K\x00\x1e\x00\x1e\x00\x1e\x00\x1c\x00)\x00'\ +\x00(\x00$\x00'\x00\x22\x00'\x00$\x00&\x00%\ +\x00%\x00 \x00\x1d\x00\x1c\x00\x1c\x00\x1d\x00\x1b\x00\x1d\ +\x00!\x00\x22\x00#\x00%\x00!\x00$\x00+\x00+\ +\x00,\x00+\x00(\x00%\x00&\x00.\x00/\x00.\ +\x00+\x00-\x00-\x00.\x00-\x00.\x00/\x00-\ +\x00.\x00-\x00.\x00-\x00-\x00*\x00%\x00#\ +\x00(\x00,\x00+\x00,\x00,\x00%\x00#\x00!\ +\x00&\x00\x22\x00!\x00\x13\x00\x14\x00L\x00\x09\x00\x09\ +\x00\x08\x00\x09\x00\x0a\x00\x0a\x00\x0c\x00L\x00W\x00 \ +\x00\xfd\x00\x04\x05\x11!-1\xfe/\xfc0\x181/\ +/0110010/1/0010/\ +0110/01\xfe0\x0a/21100\ +/00//\xfe1\x000\xfe1\x05010/\ +01\xfe0\xfe1\xff0\x081/0/-'\x18\ +\x08\x01\xfe\x00\xff\x00\x07\x01\x14X\xab\xdb\xec\xf0\xf0\xfd\ +\xf1\x00\xf0\xfe\xf1\x00\xf2\xfd\xf1\xff\xf0\x01\xf1\xf0\xf8\xf1\ +\x03\xf0\xf1\xf1\xf0\xfe\xf1\xfe\xf0\x07\xf1\xf0\xf0\xf1\xf1\xf0\ +\xf1\xf0\xfc\xf1\xff\xf0\x1b\xf1\xf0\xf0\xf1\xf2\xf1\xf0\xf1\xf0\ +\xf1\xf1\xf2\xf0\xf1\xf0\xf1\xf0\xf0\xf1\xf0\xee\xe4\xc2|.\ +\x06\x00\x00\xff\x00\x03\x16\x86\xed\xfd\xb3\xff\x04\xf9\xbfA\ +\x06\x00\x03\x00\x08l\xf4\xb0\xff\x03\xfe\xbd*\x01\x02\x00\ +$\xd0\xae\xff\x02\xf8x\x07\x02\x02O\xf6\xad\xff\x01\xc0\ +\x14\x02\x05r\xfd\xad\xff\x01\xe1#\x02\x08\x86\xfe\xad\xff\ +\x01\xed+\x02\x08\x8f\xfe\xad\xff\x01\xef-\x02\x09\x91\xfe\ +\xf1\xff\x00\xfe\xdb\xff\xfe\xfe\xfd\xff\x00\xfe\xec\xff\x01\xef\ +,\x02\x08\x91\xfe\xfa\xff\x17\xfe\xcf\xc2\xc3\xc2\xc4\xc3\xc4\ +\xc3\xc3\xc4\xc4\xc1\xc3\xc3\xc2\xc3\xc2\xc2\xc3\xc2\xc3\xc4\xc4\ +\xfe\xc2\xff\xc3\x0c\xcb\xd5\xdc\xe1\xe1\xdd\xd5\xcc\xc2\xc3\xc2\ +\xc2\xc1\xfe\xc3\xff\xc4\xf9\xc3\x06\xc4\xc3\xc3\xc4\xc2\xc3\xc4\ +\xfe\xc3\xff\xc2\x01\xc7\xf1\xf9\xff\x01\xf0-\x02\x09\x90\xfe\ +\xfa\xff\x03\xfaK\x18\x17\xfc\x18\x14\x17\x18\x16\x19\x17\x18\ +\x19\x19\x18\x19\x18\x17\x18\x19\x19\x18\x17/~\xce\xf4\xfb\ +\xff\x13\xf7\xc8\x810\x18\x16\x19\x19\x17\x18\x18\x19\x18\x18\ +\x19\x17\x19\x18\x19\x18\xfd\x19\x08\x18\x19\x19\x18\x19\x19\x17\ +,\xc7\xf9\xff\x01\xf0,\x01\x09\x90\xf9\xff\x01\xf98\xeb\ +\x00\x020\x9f\xea\xf5\xff\x02\xeb\x996\xe8\x00\x01\x15\xc0\ +\xf9\xff\x01\xef.\x02\x09\x91\xfe\xfa\xff\x01\xf97\xec\x00\ +\x01u\xf4\xf1\xff\x01\xf7c\xe9\x00\x02\x14\xc2\xfe\xfa\xff\ +\x01\xf0-\x02\x09\x90\xfe\xfa\xff\x01\xf88\xee\x00\x01\x12\ +\x91\xed\xff\x01\x9a\x17\xeb\x00\x02\x14\xc2\xfe\xfa\xff\x01\xef\ +/\x01\x08\x90\xf9\xff\x01\xf99\xef\x00\x01\x0e\xc7\xeb\xff\ +\x01\xba\x02\xec\x00\x01\x14\xc1\xf9\xff\x01\xf0/\x02\x09\x90\ +\xfe\xfa\xff\x01\xf97\xef\x00\x00\x95\xfa\xff\x09\xd1\x9c]\ +B;Hj\xaa\xd6\xfe\xfa\xff\x01\x97\x04\xed\x00\x01\x12\ +\xc0\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x01\xf98\xf0\ +\x00\x00r\xfb\xff\x02\xc9E\x02\xfa\x00\x02\x05C\xbf\xfa\ +\xff\x00\x86\xed\x00\x01\x14\xc2\xf9\xff\x01\xf1-\x02\x09\x90\ +\xfe\xfa\xff\x01\xfa8\xf1\x00\x01-\xf5\xfc\xff\x01\xa3\x09\ +\xf6\x00\x02\x02s\xfc\xfc\xff\x01\xee\x16\xee\x00\x01\x15\xc1\ +\xf9\xff\x01\xef-\x01\x09\x92\xf9\xff\x01\xf97\xf1\x00\x00\ +\xb6\xfc\xff\x01\xa8\x06\xf3\x00\x01C\xe7\xfc\xff\x00\xa0\xee\ +\x00\x01\x15\xc2\xf9\xff\x01\xef,\x02\x09\x91\xfe\xfa\xff\x01\ +\xf98\xf2\x00\x01\x1b\xf4\xfd\xff\x01\xe3\x13\xf1\x00\x01:\ +\xfa\xfd\xff\x01\xf9%\xef\x00\x01\x14\xc2\xf9\xff\x01\xf0/\ +\x01\x09\x90\xf9\xff\x01\xfa7\xf2\x00\x00\x82\xfc\xff\x00g\ +\xef\x00\x00\x8f\xfc\xff\x00\x87\xef\x00\x01\x15\xc2\xf9\xff\x01\ +\xef-\x01\x09\x91\xf9\xff\x01\xf87\xf3\x00\x01\x12\xea\xfd\ +\xff\x01\xe9\x0d\xef\x00\x01\x08\xd8\xfd\xff\x01\xdf\x0a\xf0\x00\ +\x02\x14\xc1\xfe\xfa\xff\x01\xef/\x02\x08\x90\xfe\xfa\xff\x01\ +\xf98\xf3\x00\x00n\xfc\xff\x00\xad\xed\x00\x00o\xfd\xff\ +\x01\xfd0\xf0\x00\x01\x15\xc2\xf9\xff\x01\xf0-\x02\x09\x91\ +\xfe\xfa\xff\x01\xf97\xf4\x00\x01\x0f\xe5\xfd\xff\x01\xfe;\ +\xed\x00\x01\x17\xee\xfd\xff\x00T\xf0\x00\x01\x14\xc3\xf9\xff\ +\x01\xf0/\x02\x09\x91\xfe\xfa\xff\x01\xfa7\xf4\x00\x01(\ +\xef\xfd\xff\x01\xc2\x02\xec\x00\x00\xcb\xfd\xff\x00c\xf0\x00\ +\x01\x15\xc1\xf9\xff\x01\xf1-\x02\x09\x92\xfe\xfa\xff\x01\xf8\ +8\xf4\x00\x06\x01\x1bP\xc0\xff\xffI\xeb\x00\x00\xb0\xfd\ +\xff\x00m\xf0\x00\x01\x15\xc2\xf9\xff\x01\xf0.\x01\x09\x90\ +\xf9\xff\x01\xf98\xf0\x00\x02C\x87\x07\xeb\x00\x00\xb6\xfd\ +\xff\x00m\xf0\x00\x01\x15\xc2\xf9\xff\x01\xf0.\x02\x09\x90\ +\xfe\xfa\xff\x01\xf99\xd8\x00\x01\x09\xda\xfd\xff\x00b\xf0\ +\x00\x02\x15\xc3\xfe\xfa\xff\x01\xef-\x01\x08\x91\xf9\xff\x01\ +\xf97\xd8\x00\x018\xfe\xfd\xff\x00Q\xf0\x00\x02\x14\xc2\ +\xfe\xfa\xff\x01\xf0/\x02\x09\x91\xfe\xfa\xff\x01\xf98\xd8\ +\x00\x00\x9b\xfd\xff\x01\xfc2\xf0\x00\x01\x14\xc1\xf9\xff\x01\ +\xf0.\x02\x09\x91\xfe\xfa\xff\x01\xf98\xd9\x00\x01*\xf8\ +\xfd\xff\x01\xd5\x06\xf0\x00\x01\x14\xc1\xf9\xff\x01\xf0.\x02\ +\x09\x91\xfe\xfa\xff\x01\xf99\xd9\x00\x00\x8e\xfc\xff\x00\x80\ +\xef\x00\x01\x14\xc2\xf9\xff\x01\xf1.\x02\x09\x92\xfe\xfa\xff\ +\x01\xf99\xda\x00\x01\x07\xdf\xfd\xff\x01\xe5\x19\xef\x00\x01\ +\x15\xc1\xf9\xff\x01\xf0/\x02\x08\x93\xfe\xfa\xff\x01\xf98\ +\xda\x00\x01B\xfe\xfd\xff\x04\xef\xc8\xca\xad^\xf2\x00\x02\ +\x15\xc1\xfe\xfa\xff\x01\xef.\x02\x09\x91\xfe\xfa\xff\x01\xf9\ +8\xe0\x00\x06\x0c\x22Cg\x84\x9c\xda\xf7\xff\x01\xb9(\ +\xf4\x00\x01\x14\xc1\xf9\xff\x01\xef-\x01\x08\x8f\xf9\xff\x01\ +\xf99\xe6\x00\x07\x0d(Hn\x97\xbb\xde\xf4\xf1\xff\x01\ +\xd1\x0a\xf5\x00\x02\x15\xbf\xfe\xfa\xff\x01\xee.\x02\x09\x92\ +\xfe\xfa\xff\x01\xf89\xef\x00\x0a\x02\x0e\x1d:Pf~\ +\x9b\xc2\xdf\xf8\xea\xff\x00Q\xf5\x00\x01\x14\xc2\xf9\xff\x01\ +\xef.\x01\x09\x91\xf9\xff\x01\xf98\xf4\x00\x07\x059]\ +\x88\xaf\xd1\xe3\xee\xe2\xff\x00\x9f\xf5\x00\x01\x14\xc1\xf9\xff\ +\x01\xf0-\x02\x09\x90\xfe\xfa\xff\x01\xf98\xf6\x00\x02\x10\ +{\xd0\xe3\xff\x03\xfa\xf0\xdc\xed\xfd\xff\x00\xc1\xf5\x00\x01\ +\x14\xc1\xf9\xff\x01\xef,\x02\x09\x90\xfe\xfa\xff\x01\xf97\ +\xf7\x00\x01$\xd4\xe8\xff\x0a\xfb\xe5\xc7\x9fyR8)\ +\x18\x08\x9d\xfd\xff\x01\xe2\x0f\xf6\x00\x01\x15\xc2\xf9\xff\x01\ +\xf1.\x01\x09\x91\xf9\xff\x01\xf98\xf8\x00\x01\x05\xc8\xed\ +\xff\x07\xf7\xe2\xc0\x9crJ+\x0d\xf9\x00\x00\x8a\xfd\xff\ +\x01\xf8&\xf6\x00\x01\x14\xc3\xf9\xff\x01\xf1.\x02\x09\x92\ +\xfe\xfa\xff\x01\xf99\xf8\x00\x00`\xf4\xff\x09\xfd\xea\xcd\ +\xa7\x82jXC#\x0c\xf3\x00\x00k\xfc\xff\x00J\xf6\ +\x00\x01\x13\xc2\xf9\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\x01\ +\xf97\xf8\x00\x00\xaf\xfa\xff\x07\xfb\xe6\xc6\xa3wR/\ +\x11\xeb\x00\x00D\xfc\xff\x00p\xf6\x00\x02\x15\xc2\xfe\xfa\ +\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\x01\xf98\xf8\x00\x00\ +\xc1\xfd\xff\x04\xeaxJ+\x0f\xe5\x00\x01#\xf8\xfd\xff\ +\x00\x97\xf6\x00\x01\x14\xc1\xf9\xff\x01\xef.\x02\x09\x91\xfe\ +\xfa\xff\x01\xf88\xf8\x00\x00\xa1\xfd\xff\x01\xe5\x03\xe2\x00\ +\x01\x08\xdf\xfd\xff\x00\xbe\xf6\x00\x01\x15\xc1\xf9\xff\x01\xef\ +-\x02\x09\x91\xfe\xfa\xff\x01\xf97\xf8\x00\x00y\xfd\xff\ +\x01\xfc.\xe1\x00\x00\xc0\xfd\xff\x01\xdd\x0a\xf7\x00\x02\x14\ +\xc2\xfe\xfa\xff\x01\xf1.\x02\x09\x91\xfe\xfa\xff\x01\xf98\ +\xf8\x00\x00M\xfc\xff\x00T\xf3\x00\x05?\x95\xb6\xa2f\ +\x0b\xf5\x00\x00\x96\xfd\xff\x01\xf7&\xf7\x00\x02\x15\xc2\xfe\ +\xfa\xff\x01\xef.\x02\x09\x90\xfe\xfa\xff\x01\xf98\xf8\x00\ +\x01.\xfd\xfd\xff\x00w\xf5\x00\x02\x08\x97\xfd\xfd\xff\x01\ +\xc5#\xf6\x00\x00r\xfc\xff\x00C\xf7\x00\x01\x14\xc1\xf9\ +\xff\x01\xef.\x02\x09\x92\xfe\xfa\xff\x01\xf97\xf8\x00\x01\ +\x10\xe8\xfd\xff\x00\xa2\xf6\x00\x01\x01\xaf\xfa\xff\x01\xe11\ +\xf7\x00\x00H\xfc\xff\x00i\xf7\x00\x01\x15\xc2\xf9\xff\x01\ +\xf0.\x01\x09\x91\xf9\xff\x01\xf98\xf7\x00\x00\xcb\xfd\xff\ +\x00\xc7\xf6\x00\x00?\xf8\xff\x00\xb7\xf7\x00\x01'\xfa\xfd\ +\xff\x00\x87\xf7\x00\x01\x15\xc1\xf9\xff\x01\xef.\x01\x09\x91\ +\xf9\xff\x01\xf97\xf7\x00\x00\xa7\xfd\xff\x01\xe3\x0d\xf7\x00\ +\x00\xa0\xf8\xff\x01\xe6\x0b\xf8\x00\x01\x0c\xe4\xfd\xff\x00\x9d\ +\xf7\x00\x01\x14\xc0\xf9\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\ +\x01\xf98\xf7\x00\x00|\xfd\xff\x01\xf5\x1f\xf7\x00\x00\xcb\ +\xf8\xff\x01\xf7\x22\xf7\x00\x00\xc3\xfd\xff\x00\xb3\xf7\x00\x01\ +\x13\xc0\xf9\xff\x01\xf0.\x02\x09\x91\xfe\xfa\xff\x01\xf97\ +\xf7\x00\x00W\xfd\xff\x01\xfc.\xf7\x00\x00\xc0\xf8\xff\x01\ +\xf3\x1e\xf7\x00\x00\xa0\xfd\xff\x01\xcb\x01\xf8\x00\x01\x14\xc1\ +\xf9\xff\x01\xf1.\x01\x09\x91\xf9\xff\x01\xfa8\xf7\x00\x01\ +0\xfd\xfd\xff\x00A\xf7\x00\x00\x82\xf8\xff\x01\xdc\x05\xf7\ +\x00\x00t\xfd\xff\x01\xe8\x14\xf8\x00\x01\x15\xc1\xf9\xff\x01\ +\xef-\x02\x09\x91\xfe\xfa\xff\x01\xf97\xf7\x00\x01\x14\xee\ +\xfd\xff\x00^\xf7\x00\x01$\xf9\xf9\xff\x00\x90\xf6\x00\x00\ +N\xfd\xff\x01\xfb-\xf8\x00\x01\x13\xc2\xf9\xff\x01\xf0-\ +\x02\x09\x91\xfe\xfa\xff\x01\xf99\xf7\x00\x01\x02\xcd\xfd\xff\ +\x00\x8a\xf6\x00\x00k\xfb\xff\x02\xfe\xa1\x0a\xf6\x00\x005\ +\xfc\xff\x00T\xf8\x00\x02\x15\xc2\xfe\xfa\xff\x01\xf1.\x01\ +\x09\x92\xf9\xff\x01\xf98\xf6\x00\x00\xb4\xfd\xff\x00\xae\xf5\ +\x00\x01P\xd7\xfd\xff\x01\xfa\x22\xf5\x00\x01(\xfa\xfd\xff\ +\x00x\xf8\x00\x01\x15\xc2\xf9\xff\x01\xf0-\x02\x09\x91\xfe\ +\xfa\xff\x01\xf86\xf6\x00\x00\xa1\xfd\xff\x01\xd1\x04\xf5\x00\ +\x00T\xfc\xff\x00H\xf5\x00\x01\x18\xf0\xfd\xff\x00\x9f\xf8\ +\x00\x02\x14\xc1\xfe\xfa\xff\x01\xf0-\x02\x09\x91\xfe\xfa\xff\ +\x01\xf98\xf6\x00\x00\x8c\xfd\xff\x01\xee\x18\xf5\x00\x00=\ +\xfc\xff\x00s\xf5\x00\x01\x06\xda\xfd\xff\x00\xc6\xf8\x00\x01\ +\x14\xc2\xf9\xff\x01\xf0.\x02\x09\x92\xfe\xfa\xff\x01\xf86\ +\xf6\x00\x00r\xfd\xff\x01\xfe4\xf5\x00\x01%\xf7\xfd\xff\ +\x00\x98\xf4\x00\x00\xba\xfd\xff\x01\xe3\x0f\xf9\x00\x01\x14\xc1\ +\xf9\xff\x01\xf0/\x01\x09\x91\xf9\xff\x01\xf98\xf6\x00\x00\ +F\xfc\xff\x00[\xf5\x00\x01\x08\xdc\xfd\xff\x00\x90\xf4\x00\ +\x00\x8f\xfd\xff\x01\xfb,\xf9\x00\x02\x15\xc1\xfe\xfa\xff\x01\ +\xf0.\x02\x09\x91\xfe\xfa\xff\x01\xf88\xf6\x00\x01'\xfa\ +\xfd\xff\x00\x80\xf4\x00\x00t\xfe\xff\x01\xee-\xf4\x00\x00\ +j\xfc\xff\x00K\xf9\x00\x01\x15\xc2\xf9\xff\x01\xf1-\x01\ +\x09\x91\xf9\xff\x01\xfa8\xf6\x00\x01\x0b\xe2\xfd\xff\x00\xab\ +\xf3\x00\x03D\x97\x8a)\xf3\x00\x00@\xfc\xff\x00u\xf9\ +\x00\x01\x13\xc2\xf9\xff\x01\xf0.\x01\x08\x90\xf9\xff\x01\xf9\ +8\xf5\x00\x00\xc4\xfd\xff\x01\xcd\x01\xe2\x00\x01 \xf7\xfd\ +\xff\x00\x9a\xf9\x00\x02\x14\xc2\xfe\xfa\xff\x01\xf0.\x01\x09\ +\x91\xf9\xff\x01\xf98\xf5\x00\x00\x9c\xfd\xff\x01\xeb\x15\xe1\ +\x00\x00\xd8\xfd\xff\x00\xbb\xf9\x00\x01\x13\xc2\xf9\xff\x01\xf0\ +.\x02\x08\x91\xfe\xfa\xff\x01\xf97\xf5\x00\x00t\xfd\xff\ +\x01\xfe1\xe4\x00\x03\x07\x1c=\xd4\xfd\xff\x00\xce\xf9\x00\ +\x02\x15\xc0\xfe\xfa\xff\x01\xef-\x02\x09\x91\xfe\xfa\xff\x01\ +\xf89\xf5\x00\x00N\xfc\xff\x00S\xec\x00\x09\x02\x12\x22\ +3Ei\x8f\xb7\xd7\xf1\xfb\xff\x00\xc9\xf9\x00\x01\x14\xc2\ +\xf9\xff\x01\xef-\x01\x09\x90\xf9\xff\x01\xf96\xf5\x00\x01\ +)\xfb\xfd\xff\x00z\xf2\x00\x08\x03\x1a7Z\x85\xa8\xd0\ +\xe9\xf6\xf4\xff\x00\x8b\xf9\x00\x01\x14\xc0\xf9\xff\x01\xf1,\ +\x01\x09\x90\xf9\xff\x01\xf97\xf5\x00\x01\x0f\xe8\xfd\xff\x00\ +\x92\xf9\x00\x08\x03\x0d\x1d\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Globa\ +l\x0d\x0a <\ +desc>Created wit\ +h Sketch.\ +\x0d\x0a \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x09\xba\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Camer\ +a\x0d\x0a <\ +desc>Created wit\ +h Sketch.\ +\x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \ +\x0d\x0a \ + \x0d\x0a \x0d\ +\x0a\x0d\x0a\ +\x00\x00\x00\xab\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x0d\x08\x06\x00\x00\x00\xa0\xbb\xee$\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +UIDAT8Oc\xfc\xff\xff?\x03%\x80\x09\ +J\x93\x0d\xf0\x1a\xd0\xd8\xd8H\xd0y\x04]@\xc8\x10\ +\x940\xc0\xa7\xb8\xbe\xbe\x9e\x11\xcaD\x01D\x87\x01.\ +\xc3I\x0aDl\x86\x90d\x006o\x10m\x00\xae0\ +\xc0\x9b\x90`N\xc6\xa5\x19\x04\x08\xba\x00\x9ff\x10\x18\ +\xe8\xa4\xcc\xc0\x00\x00\x9d\xda\x22\x8d\x12\xa2\xae,\x00\x00\ +\x00\x00IEND\xaeB`\x82\ +\x00\x00\x05{\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / viewp\ +ort\x0d\x0a \ + Created w\ +ith Sketch.\x0d\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \ +\x0d\x0a\x0d\x0a\ +\x00\x00\x00\xca\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x0d\x08\x06\x00\x00\x00\xa0\xbb\xee$\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x00_IDAT8O\xc5\x91\xc1\x0e\ +\xc0 \x08C\xc1\x1f\x07\xbe\x9c\x05'\x86\xc4\xb9\x89\x1e\ +\xf6.r\xa1\xd2\x16U\x15\x0c\x11\xb9\x87\x07\x88\x08\xdb\ +8\x80\xcc<]\x5c\xa1\xb4w\x9b\xff\x05z\x88\x19b\ +\xe0\xe9\x10\xbd\x11\x17I[\xf0E\x17*o\x1d\xcf\x88\ +\x16\x8eB\xb4\xcf\xab\xc0\xc9\x15\xfd\x82\x1d\x11c\xa81\ +\xfa\xfb\x06\xe0\x02\xfbk*\x0b\x22\xb70[\x00\x00\x00\ +\x00IEND\xaeB`\x82\ +\x00\x00\x06\x06\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a Icons / Edit\ +or / EMFX / Moti\ +on\x0d\x0a \ +\x0d\x0a \ +\x0d\x0a \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x00\xa0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x0d\x08\x06\x00\x00\x00\xa0\xbb\xee$\ +\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\ +\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\ +\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\x01\xc7o\ +\xa8d\x00\x00\x005IDAT8Oclhh\ +\xf8\xcf\x80\x06\xea\xeb\xeb\x19\xa1L\x82\x80\x09J\x93\x0d\ +\xb0\xba\x80\x18\x00s%\xd9.hll\x04[L\xb1\ +\x17F\x0d\x185\x80\x81\x81\x81\x01\x00\xc0\x1c\x0a\x95\xd5\ +0\x97g\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x11\xc7\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Debug\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \ + \x0d\x0a \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x12>\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Exper\ +imental\x0d\ +\x0a Creat\ +ed with Sketch.<\ +/desc>\x0d\x0a \x0d\x0a <\ +path d=\x22M15.1323\ +36,4.99076918 C1\ +5.5178274,4.9907\ +6918 15.8485779,\ +5.34903984 16.04\ +13236,5.67028261\ + C16.2340693,5.9\ +9152539 16.20194\ +5,6.90832486 16.\ +0413236,7.261691\ +92 C15.7410536,7\ +.67565898 15.559\ +016,8.029019 15.\ +4952109,8.321771\ +96 C15.4376576,8\ +.58583981 15.459\ +0738,9.15831061 \ +15.5594594,10.03\ +91844 C17.808158\ +9,11.0992855 19.\ +0519645,13.44435\ +78 18.9234674,15\ +.9500515 C18.797\ +9586,19.0877716 \ +16.2512974,21.89\ +56839 13.1394393\ +,22.1143917 L12.\ +9162275,22.12557\ +98 L12.1999856,2\ +2.1255798 C8.794\ +81215,22.1255798\ + 6,19.0982307 6,\ +15.660933 C6,13.\ +3376593 7.088222\ +19,11.2234803 9.\ +09581042,10.1537\ +076 L9.3226506,1\ +0.0391844 L9.162\ +02921,8.06479886\ + L8.71228932,7.2\ +6169192 C8.55166\ +793,6.90832486 8\ +.64804077,5.9915\ +2539 8.84078643,\ +5.67028261 C9.04\ +316938,5.3811641\ +2 9.51285982,5.0\ +6205304 9.885797\ +26,5.00112201 L1\ +0.0060269,4.9907\ +6918 L15.132336,\ +4.99076918 Z M14\ +.5477747,9.22030\ +884 L10.3382049,\ +9.22030884 L10.3\ +087674,10.505628\ +3 C10.3087674,10\ +.5645034 10.2793\ +298,10.6233785 1\ +0.2204547,10.652\ +8161 C8.30701393\ +,11.5065051 7.07\ +063679,13.419945\ +9 7.07063679,15.\ +5394495 C7.07063\ +679,18.5420797 9\ +.54339107,20.985\ +3965 12.5754588,\ +20.8970838 C15.3\ +720262,20.838208\ +7 17.6681551,18.\ +5715173 17.78590\ +53,15.8043875 C1\ +7.9036555,13.626\ +0087 16.6378408,\ +11.5359426 14.63\ +60874,10.6528161\ + C14.5919311,10.\ +6307379 14.56433\ +34,10.5921011 14\ +.5532943,10.5493\ +247 L14.5477747,\ +10.5056283 L14.5\ +477747,9.2203088\ +4 Z M16.248292,1\ +5.5813393 C16.43\ +33656,15.5813393\ + 16.5920002,15.6\ +606566 16.697756\ +5,15.792852 C16.\ +8035128,15.92504\ +74 16.856391,16.\ +1101211 16.82995\ +19,16.2951947 C1\ +6.6977565,17.009\ +05 16.4069265,18\ +.0137353 15.6930\ +712,18.806908 C1\ +4.4693191,20.158\ +1342 12.6801281,\ +20.2309765 12.48\ +27708,20.2344561\ + L12.4146244,20.\ +2346187 C12.0973\ +553,20.2346187 1\ +0.4581319,20.155\ +3014 9.29481208,\ +18.806908 C8.501\ +63946,17.8815399\ + 8.2108095,16.92\ +97328 8.10505315\ +,16.2951947 C8.0\ +7861407,16.11012\ +11 8.10505315,15\ +.9250474 8.23724\ +859,15.792852 C8\ +.32185367,15.687\ +0957 8.44030078,\ +15.6321024 8.579\ +05311,15.6007985\ + L8.68671307,15.\ +5813393 L16.2482\ +92,15.5813393 Z \ +M13.525066,16.42\ +73901 C12.996284\ +3,16.4273901 12.\ +5468198,16.87685\ +46 12.5468198,17\ +.4056363 C12.520\ +3807,17.9344181 \ +12.9698452,18.38\ +38826 13.525066,\ +18.3838826 C14.0\ +538478,18.383882\ +6 14.5033123,17.\ +9344181 14.50331\ +23,17.4056363 C1\ +4.5033123,16.876\ +8546 14.0538478,\ +16.4273901 13.52\ +5066,16.4273901 \ +Z M10.5110101,16\ +.5331465 C10.114\ +4238,16.5331465 \ +9.79715474,16.82\ +39764 9.82359382\ +,17.2205627 C9.8\ +2359382,17.59070\ +99 10.1408629,17\ +.907979 10.51101\ +01,17.907979 C10\ +.8811573,17.9079\ +79 11.1984264,17\ +.5907099 11.1984\ +264,17.2205627 C\ +11.1984264,16.85\ +04155 10.8811573\ +,16.5331465 10.5\ +110101,16.533146\ +5 Z M11.0960618,\ +12.7156002 C11.6\ +351612,12.715600\ +2 12.0891397,13.\ +1695787 12.08913\ +97,13.7086781 C1\ +2.0891397,14.247\ +7775 11.6351612,\ +14.701756 11.096\ +0618,14.701756 C\ +10.5569624,14.70\ +1756 10.1029839,\ +14.2477775 10.10\ +29839,13.7086781\ + C10.1029839,13.\ +1695787 10.55696\ +24,12.7156002 11\ +.0960618,12.7156\ +002 Z M12.429623\ +6,10.4173342 C12\ +.8268547,10.4173\ +342 13.1389649,1\ +0.7294444 13.138\ +9649,11.1266755 \ +C13.1389649,11.5\ +239067 12.826854\ +7,11.8360169 12.\ +4296236,11.83601\ +69 C12.0323924,1\ +1.8360169 11.720\ +2822,11.5239067 \ +11.7202822,11.12\ +66755 C11.720282\ +2,10.7294444 12.\ +0323924,10.41733\ +42 12.4296236,10\ +.4173342 Z M14.4\ +300245,6.2371834\ +4 L10.39708,6.23\ +718344 C10.16157\ +96,6.23718344 9.\ +95551678,6.35493\ +364 9.83776658,6\ +.5609965 C9.7396\ +4141,6.73271554 \ +9.72328721,6.924\ +87734 9.77166837\ +,7.10341063 L9.8\ +0832903,7.208622\ +62 L10.39708,8.0\ +9174915 L10.3970\ +8,8.60845497 L14\ +.5919794,8.60845\ +497 L14.5919794,\ +8.09174915 L15.0\ +187755,7.2086226\ +2 C15.1365257,7.\ +00255976 15.1070\ +882,6.76705935 1\ +4.989338,6.56099\ +65 C14.8715878,6\ +.35493364 14.665\ +5249,6.23718344 \ +14.4300245,6.237\ +18344 Z M12.3728\ +762,6.5763594 C1\ +2.7984811,6.5763\ +594 13.1389649,6\ +.91684325 13.138\ +9649,7.34244807 \ +C13.1389649,7.76\ +805289 12.798481\ +1,8.10853674 12.\ +3728762,8.108536\ +74 C11.9472714,8\ +.10853674 11.606\ +7876,7.76805289 \ +11.6067876,7.342\ +44807 C11.606787\ +6,6.91684325 11.\ +9472714,6.576359\ +4 12.3728762,6.5\ +763594 Z M14.933\ +6824,2 C15.64302\ +38,2 16.2388706,\ +2.53909944 16.23\ +88706,3.27681446\ + C16.2388706,4.0\ +1452947 15.64302\ +38,4.58200257 14\ +.9336824,4.58200\ +257 C14.2243411,\ +4.58200257 13.62\ +84943,4.04290313\ + 13.6284943,3.30\ +518811 C13.62849\ +43,2.56747309 14\ +.2243411,2 14.93\ +36824,2 Z\x22 id=\x22C\ +ombined-Shape\x22 f\ +ill=\x22#FFFFFF\x22 fi\ +ll-rule=\x22nonzero\ +\x22>\x0d\x0a <\ +/g>\x0d\x0a\x0d\x0a\ +\x00\x00\x04\x17\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Files\ +\x0d\x0a Created with\ + Sketch.\x0d\ +\x0a \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x03i\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a \x0d\x0a <\ +title>icon / Pre\ +ferences / Gizmo\ +s\x0d\x0a <\ +desc>Created wit\ +h Sketch.\ +\x0d\x0a \x0d\x0a \ + \x0d\x0a \x0d\x0a\ +\x0d\x0a\ +\x00\x00\x00[\ +\x00\ +\x00\x01Fx\x9c\x8d\x8c1\x0a\x800\x10\x04\xe7\xacD\ +P;\xeb\x94\x96>\xc1\xa7\xf9d\xad\x05\xcf\x8d\x88B\ +\xc0\x98Y\x86\x83cY\xa80B\x80V\x99\x0c\x06`\ +\x94z1KS\x22\x0b/\xd5m\xc4\xdd)\xa2\x93\xcd\ +\xb7\xfd~Pk5\xde\x5c\xef\xdaI\xf0\x12\xb6\xbc+\ +\xf6\xf8\xd7M9\x01\x0cb\x81\xee\ +\x00\x00\x00[\ +\x00\ +\x00\x01Fx\x9c\xc5\xc81\x0e@@\x18D\xe1\xf9W\ +!**\xad-\x95n\xc0\xcd\xec\xd1\x1c\xc5\x11\x94\x0a\ +\xf1\xec\xc6\x8a\x0bH|\x93\xd7\x8c\xe4d\xf2^jT\ +i0\xa9\x95\xd4\xc7\xe2\xa5)fqI\xd0\xcb\xe5\x12\ +@\x7f\xe3q\xcep\x8c\xb0w\xb0\xd5\xb0\x96\xb0\x14\x10\ +\xec\xfe\xbe.\xbb\x00\x9d\x16jC\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0c\x00\x04\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x07\xf8\x00\x00\x07\xf8\x00\x00\x0f\xfc\x00\x00\x0f\xfc\ +\x00\x00\x1f\xfc\x00\x00\x1f\xfe\x00\x00?\xfe\x00\x00/\xfe\ +\x00\x00o\xfe\x00\x00\xef\xfe\x00\x00\xcf\xf6\x00\x00\x0d\xb6\ +\x00\x00\x0d\xb4\x00\x00\x0d\xb0\x00\x00\x0d\x80\x00\x00\x0c\x00\ +\x00\x00\x0c\x00\x00\x00\x0c\x00\x00\x00\x0c\x00\x00\x00\x0c\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x03\ +\xff\xff\xf0\x03\xff\xff\xf0\x03\xff\xff\xe0\x01\xff\xff\xe0\x01\ +\xff\xff\xc0\x01\xff\xff\xc0\x00\xff\xff\x80\x00\xff\xff\x80\x00\ +\xff\xff\x00\x00\xff\xfe\x00\x00\xff\xfe\x00\x00\xff\xfe \x00\ +\xff\xff\xe0\x01\xff\xff\xe0\x03\xff\xff\xe0\x0f\xff\xff\xe0\x7f\ +\xff\xff\xe1\xff\xff\xff\xe1\xff\xff\xff\xe1\xff\xff\xff\xe1\xff\ +\xff\xff\xf3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00\xa7\ +\x00\ +\x00\x0c\xbex\x9c\xed\x921\x0a\xc20\x18\x85_t\xe8\ +Rp\x13\xc7\x8e=\x867\xf0J\x1e\xc1cx\x0c\xc1\ +\x8btsut(<_\x8bC1\x12K\x93\xdfA\ +\xfe\x0f\x1e\x09\x09\xf9^\x02\x01V\x08h\x1a\x8c\xe3\xb9\ +\x06\xb6\x00ZEK\xd8+\x01;\x8c\xd4p\x1c\xc7q\ +\x9c?\x85\x11\xa6\xf2\x82\xfe\x8f\xf2R\x15\x09\xf9\x0f\xfc\ +\x99\x15_\xe59\xfe\xa9\xc1\xce?\xe7!\x8b+\xe2\xb7\ +\xbci\x8b\xf8c\xdbt\x92}\xf7\x94\xbf\xa0\xdc\x08k\ +\xbf\x11\xe9\x0f9\x8f~C>*\xf2\xaetk\xf22\ +$\x90G\x05C\xd4rR\xba\xf0\xda?\x90W\x9d\xbb\ +)O\x85i\xaa%\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x06\x00\x06\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x000\x00\x00\x000\x00\x00\x000\x00\ +\x00\x01\xfe\x00\x00\x01\xfe\x00\x00\x000\x00\x00\x000\x00\ +\x00\x001\x80\x00\x00\x01\x80\x00\x00\x03\x00\x00\x00\x03\x00\ +\x00\x00\x06\x00\x00\x00F\x00\x00\x00l\x00\x00\x00|\x00\ +\x00\x00\x7f\x80\x00\x00\x7f\x00\x00\x00~\x00\x00\x00|\x00\ +\x00\x00x\x00\x00\x00p\x00\x00?\xe0\x00\x00 \x00\ +\x00 \x00\x00 \x00\x00 \x00\x00 \x00\ +\x00 \x00\x00 \x00\x00?\xe0\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xcf\xff\xff\xff\xcf\xff\xff\xff\xcf\xff\ +\xff\xfe\x01\xff\xff\xfe\x01\xff\xff\xff\xcf\xff\xff\xff\xce\x7f\ +\xff\xff\xcc?\xff\xff\xfc?\xff\xff\xf8\x7f\xff\xffx\x7f\ +\xff\xff0\xff\xff\xff\x10\xff\xff\xff\x01\xff\xff\xff\x00\x1f\ +\xff\xff\x00?\xff\xff\x00\x7f\xff\xff\x00\xff\xff\xff\x01\xff\ +\xff\xff\x03\xff\xff\x80\x07\xff\xff\x80\x0f\xff\xff\x9f\xcf\xff\ +\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x9f\xcf\xff\ +\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x80\x0f\xff\xff\x80\x0f\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00`\ +\x00\ +\x00\x01Fx\x9cc``b`dPP``\xe0\ +f\xe0e0`d`\x10c``\xd0\x00b\xa0\x10\ +\x83\x03\x103\x02!\x0840 \x00\x13\x14\x83\xc0\xff\ +\xff\xff\x19H\x025@\x1c\x82\x03\x0b\xe0\x91\xab\xc1m\ +\xe4\x7fR@3&\xfe\xdd\xbc\xff\xff\xe7\xe6\xf9\xff\x1f\ +0\xf0\x83i\x10\x1f\x9b:\x5c\x00\x00\x81\xb3~\xf0\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0f\x00\x0f\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x03\x80\x00\x00\x02\x80\x00\x00\x02\x80\ +\x00\x00\x02\x80\x00\x00\x02\x80\x00\x00\x04@\x00\x00\x0c`\ +\x00\x03\xf0\x1f\x80\x02\x01\x00\x80\x03\xf0\x1f\x80\x00\x0c`\ +\x00\x00\x04@\x00\x00\x02\x80\x00\x00\x02\x80\x00\x00\x02\x80\ +\x00\x00\x02\x80\x00\x00\x03\x80\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\ +\xff\xff\xfe\xff\xff\xff\xfc\x7f\xff\xff\xfc\x7f\xff\xff\xfc\x7f\ +\xff\xff\xfc\x7f\xff\xff\xfc\x7f\xff\xff\xf9?\xff\xff\xf1\x1f\ +\xff\xfc\x03\x80\x7f\xf0\x1e\xf0\x1f\xfc\x03\x80\x7f\xff\xf1\x1f\ +\xff\xff\xf9?\xff\xff\xfc\x7f\xff\xff\xfc\x7f\xff\xff\xfc\x7f\ +\xff\xff\xfc\x7f\xff\xff\xfc\x7f\xff\xff\xfe\xff\xff\xff\xfe\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x10\x00\x0d\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\ + \x01\x00\x00@\x00\xc0\x01\x80\x008\x0e\x00\x00\x07\xf0\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf9\xff\xff\xcf\xf8\xff\xff\ +\x8f\xfc?\xfe\x1f\xfe\x07\xe0?\xff\x00\x00\x7f\xff\xc0\x01\ +\xff\xff\xf8\x0f\xff\xff\xff\xff\xff\xff\xff\x7f\xff\xff\xfe?\ +\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xfe?\ +\xff\xff\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00X\ +\x00\ +\x00\x01Fx\x9c\xc5\xcd1\x0a\x800\x0cF\xe1\x97.\ +\xe2\xa4\x93k;:z\x83z\xb3\xf6\xc8\xbdA\xfc\x0b\ +\x05A\x9c\x5c|\xe1#\x90\xa1\x85\x80\x91\x12\xac\xcc\x1c\ +\x06\x1b\xb0\x8bN\x9cb\x9a^\xe5.\x0c=w\xe7\xef\ +\xfc\xa5V>+\x92\x1bDYd\x1a;\xea\xd9,\xe5\ +\xf9\xd7\x05'\x93i\xe6\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x03\x00\x03\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x1e\x00\x00\x00\x1e\x00\ +\x00\x00\x1e\x00\x00\x00\x1e\x00\x00\x18\x1e\x00\x00\x14\x0c\x00\ +\x00\x12\x00\x00\x00\x11\xe0\x00\x00\x10\x10\x00\x00\x10 \x00\ +\x00\x10@\x00\x00\x10\x80\x00\x00\x11\x00\x00\x00\x12\x00\x00\ +\x00\x14\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xf3\xff\xff\xff\xe1\xff\xff\xff\xc0\xff\xff\xff\xc0\xff\ +\xff\xff\xc0\xff\xff\xff\xc0\xff\xff\xe7\xc0\xff\xff\xe3\xe1\xbf\ +\xff\xe1\xf3\xbf\xff\xe0\x1e\x0f\xff\xe0\x0f\xbf\xff\xe0\x1f\xbf\ +\xff\xe0?\xff\xff\xe0\x7f\xff\xff\xe0\xff\xff\xff\xe1\xff\xff\ +\xff\xe3\xff\xff\xff\xe7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x00\x00\x18\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xf0\x00\x00\x00\x88\x00\x00\x00\x84\x00\x00\x00\x82\x00\x00\ +\x00A\x00\x00\x00 \x80\x00\x00\x10@\x00\x00\x0b\xa0\x00\ +\x00\x05\xd6\x00\x00\x02\xe9\x00\x00\x01a\x00\x00\x00\x81\x00\ +\x00\x00@\x80\x00\x00\x80@\x00\x00\x80 \x00\x00p \ +\x00\x00\x08 \x00\x00\x04@\x00\x00\x03\x80\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\x0f\xff\xff\xff\x07\xff\xff\xff\x03\xff\xff\xff\x01\xff\xff\ +\xff\x80\xfc\xff\x0f\xc0~|c\xe0?1\xf9\xf0\x1f\x87\ +\xff\xf8\x09\xfd\xff\xfc\x00\xf8\xff\xfe\x00\xf0\x7f\xff\x00\xfd\ +\xdb\xff\x80}\xdb\xff\x00=\xdb\xff\x00\x1d\xc3\xff\x80\x1d\ +\xdb\xff\xf0\x1d\xdb\xff\xf8=\xdb\xff\xfcp\x7f\xff\xff\xf8\ +\xff\xff\xff\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x01\x00\x01\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x18\x00\x00\x00\x18\x00\x00\x00\x18\x00\x00\x00\xff\x00\x00\ +\x00\xff\x00\x00\x00\x18\x00\x00\x00\x18\x00\x00\x00\x18\xc0\x00\ +\x00\x00\xc0\x00\x00\x01\x80\x00\x00\x01\x80\x00\x00\x03\x00\x00\ +\x00#\x00\x00\x006\x00\x00\x00>\x00\x00\x00?\xc0\x00\ +\x00?\x80\x00\x00?\x00\x00\x00>\x00\x00\x00<\x00\x00\ +\x008\x00\x00\x000\x00\x00\x00 \x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xe7\xff\xff\xff\xe7\xff\xff\xff\xe7\xff\xff\xff\x00\xff\xff\ +\xff\x00\xff\xff\xff\xe7\xff\xff\xff\xe7?\xff\xff\xe6\x1f\xff\ +\xff\xfe\x1f\xff\xff\xfc?\xff\xff\xbc?\xff\xff\x98\x7f\xff\ +\xff\x88\x7f\xff\xff\x80\xff\xff\xff\x80\x0f\xff\xff\x80\x1f\xff\ +\xff\x80?\xff\xff\x80\x7f\xff\xff\x80\xff\xff\xff\x81\xff\xff\ +\xff\x83\xff\xff\xff\x87\xff\xff\xff\x8f\xff\xff\xff\x9f\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0f\x00\x0f\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xe0\ +\x00\x00\x18\x18\x00\x00 \x04\x00\x00@\x02\x00\x00\x80\x01\ +\x00\x01\x00\x00\x80\x01\x00\x00\x80\x02\x00\x00@\x02\x00\x00\ +@\x02\x02\x00@\x02\x02\x00\x00\x02\x03\x00\x00\x02\x00\x00\ +\x00\x01\x00\x7f\x80\x01\x00 \x80\x00\x80\x10\x80\x00@\x08\ +\x80\x00 \x04\x80\x00\x18\x1a\x80\x00\x07\xe1\x80\x00\x00\x00\ +\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x1f\ +\xff\xff\xe0\x07\xff\xff\xc7\xe3\xff\xff\x9f\xf9\xff\xff?\xfc\ +\xff\xfe\x7f\xfe\x7f\xfe\x7f\xfe\x7f\xfc\xff\xff?\xfc\xff\xff\ +?\xfc\xfc\x7f?\xfc\xfc\x7f\xff\xfc\xfc\x7f\xff\xfc\xff\xff\ +\xff\xfe\x7f\x80\x7f\xfe\x7f\xc0\x7f\xff?\xe0\x7f\xff\x9f\xf0\ +\x7f\xff\xc7\xe0\x7f\xff\xe0\x04\x7f\xff\xf8\x1e\x7f\xff\xff\xff\ +\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0f\x00\x0f\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x80\x00\x00\x04@\ +\x00\x00\x08 \x00\x00\x02\x80\x00\x00\x22\x88\x00\x00B\x84\ +\x00\x00\x9e\xf2\x00\x01\x00\x01\x00\x00\x9e\xf2\x00\x00B\x84\ +\x00\x00\x22\x88\x00\x00\x02\x80\x00\x00\x08 \x00\x00\x04@\ +\x00\x00\x02\x80\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff\xfc\x7f\xff\xff\xf8?\ +\xff\xff\xf0\x1f\xff\xff\xfc\x7f\xff\xff\xdcw\xff\xff\x9cs\ +\xff\xff\x00\x01\xff\xfe\x00\x00\xff\xff\x00\x01\xff\xff\x9cs\ +\xff\xff\xdcw\xff\xff\xfc\x7f\xff\xff\xf0\x1f\xff\xff\xf8?\ +\xff\xff\xfc\x7f\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x04\x00\x06\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x03\xe0\x00\x00\x03\xe8\x00\x00\x03\xe0\x00\x00\x03\xe8\ +\x00\x00\x00\x08\x00\x00\x01\xf0\x00\x00\x0c\x00\x00\x00\x0c\x00\ +\x00\x00\x00\x00\x00\x00`\x00\x00\x00`\x00\x00\x00\x00\x00\ +\x00\x1f\x00\x00\x00\x13@\x00\x00\x13@\x00\x00\x1f@\x00\ +\x00\x00@\x00\x00\x0f\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x0f\ +\xff\xff\xf8\x07\xff\xff\xf8\x03\xff\xff\xf8\x03\xff\xff\xf8\x03\ +\xff\xff\xf8\x03\xff\xff\xf0\x03\xff\xff\xe0\x03\xff\xff\xe1\xff\ +\xff\xff\x93\xff\xff\xff\x0f\xff\xff\xff\x0f\xff\xff\xc0\x1f\xff\ +\xff\xc0?\xff\xff\xc0\x1f\xff\xff\xc0\x1f\xff\xff\xc0\x1f\xff\ +\xff\xc0\x1f\xff\xff\xe0\x1f\xff\xff\xf0\x1f\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x01\x00\x01\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\ +\x00\x0e\x00\x00\x00\x0e\x00\x00\x00\x00\x80\x00\x00\x01@\x00\ +\x00\x00\xa0\x00\x00\x00P\x00\x00\x00(\x00\x00\x00\x14\x00\ +\x00\x00\x0a\x00\x00\x00\x05\x00\x00\x00\x02\x80\x00\x00\xc1\x00\ +\x00\x00\xc0\xe0\x00\x01\x80\xe0\x00\x01\x80\xe0\x00\x03\x00\x00\ +\x00#\x00\x00\x006\x00\x00\x00>\x00\x00\x00?\xc0\x00\ +\x00?\x80\x00\x00?\x00\x00\x00>\x00\x00\x00<\x00\x00\ +\x008\x00\x00\x000\x00\x00\x00 \x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf1\xff\xff\xff\xe0\xff\xff\ +\xff\xe0\xff\xff\xff\xe0\xff\xff\xff\xf0\x7f\xff\xff\xfe?\xff\ +\xff\xff\x1f\xff\xff\xff\x8f\xff\xff\xff\xc7\xff\xff\xff\xe3\xff\ +\xff\xff\xf1\xff\xff\xff\xf8\xff\xff\xff<\x7f\xff\xfe\x1e\x1f\ +\xff\xfe\x1e\x0f\xff\xfc>\x0f\xff\xbc>\x0f\xff\x98\x7f\x1f\ +\xff\x88\x7f\xff\xff\x80\xff\xff\xff\x80\x0f\xff\xff\x80\x1f\xff\ +\xff\x80?\xff\xff\x80\x7f\xff\xff\x80\xff\xff\xff\x81\xff\xff\ +\xff\x83\xff\xff\xff\x87\xff\xff\xff\x8f\xff\xff\xff\x9f\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x01\x00\x01\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\ +\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x00\ +\x00\x00\xc0\x00\x00\x01\x80\x00\x00\x01\x80\x00\x00\x03\x00\x00\ +\x00#\x00\x00\x006\x00\x00\x00>\x00\x00\x00?\xc0\x00\ +\x00?\x80\x00\x00?\x00\x00\x00>\x00\x00\x00<\x00\x00\ +\x008\x00\x00\x000\x00\x00\x00 \x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\ +\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff?\xff\xff\xfe\x1f\xff\ +\xff\xfe\x1f\xff\xff\xfc?\xff\xff\xbc?\xff\xff\x98\x7f\xff\ +\xff\x88\x7f\xff\xff\x80\xff\xff\xff\x80\x0f\xff\xff\x80\x1f\xff\ +\xff\x80?\xff\xff\x80\x7f\xff\xff\x80\xff\xff\xff\x81\xff\xff\ +\xff\x83\xff\xff\xff\x87\xff\xff\xff\x8f\xff\xff\xff\x9f\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00\xc9\ +\x00\ +\x00\x0c\xbex\x9cc``b`dPP`\x00\x83\ +\x15<\x0c\x0cb@Z\x03\x88AB\x0e@\xcc\xc8 \ +\x01\x91\xe4a\x18@`<\x93\x04D\xba\xe13\xff\xff\ +g\x98I4\x22\xd5\x0a\x88\xf9g\x88C\xa3\xe6\x8f\x9a\ +?\x10\xe6\x13\x8f\xc8\xcbb4\xcc\xbf\xc3\x0e\xfc\x07\x83\ +!j\xfe\xa8\xe31\xcd\xa4\xb5\xf9\x103i\x142\xff\ +Q\x01\xad\xcd\xa7\xbaE45\x1c\xab\xf9T4\x1c\xd3\ +|\xea\x1a\x8ef>\xd5\x0dG6\x9f\x16\x863\xd0\xa5\ +\xc0\xa1\x9d\xe1C\x1a\x80\xc2\xfd\x01\x83\xfd\xff\x03\x0c\xf2\ +\x041H\x1d\x18\x00\xa9\x7f\xf2\x10\xfc\x07\xc8\xde\x03\xc4\ +3\xea\xff\xff\xef\x00\xe2\x06\xa0t\x03?\x10\x03\xe5\x1a\ +\x80\xe2\x0dP\xb1F n\x06\xe2v \xee\x07\xe2\xf9\ +\xd0\x04\x05\x00\x85\x1b/\xe1\ +\x00\x00\x00\x5c\ +\x00\ +\x00\x01Fx\x9cc``b`dPP``\x10\ +`\xe0d0`d`\x10c``\xd0\x00b\xa0\x10\ +\x83\x03\x103\x02!\x0840 \x00\x13\x14\x83\xc0\xff\ +\xff\xff\x19\x06\x1a\xfc\x87\x81\x1f\xf2\xd4\xc7\x0d\x8c\xff\xff\ +\x1f`\xfe\xff\xff\x01\xfb\xff\xff\x1f\xf8!b\x7f\xec\xff\ +\xff\xffW\x0f\xb7\x16\x00\xb3\x96jC\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x07\x00\x18\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x01\xe0\x00\x00\x01\x10\x00\x00\x01\x08\x00\x00\x01\x04\x00\ +\x00\x00\x82\x00\x00\x00A\x00\x00\x00 \x80\x00\x00\x17@\ +\x00\x00\x0b\xac\x00\x00\x05\xd2\x00\x00\x02\xc2\x00\x00\x01\x02\ +\x00\x00\x00\x81\x00\x00\x01\x00\x80\x00\x01\x00@\x00\x00\xe0\ +@\x00\x00\x10@\x00\x00\x08\x80\x00\x00\x07\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xfe\x1f\xff\xff\xfe\x0f\xff\xff\xfe\x07\xff\xff\xfe\x03\xff\ +\xff\xff\x01\xff\xff\xff\x80\xff\xff\xff\xc0\x7f\xff\xff\xe0?\ +\xff\xff\xf0\x13\xff\xff\xf8\x01\xff\xff\xfc\x01\xff\xff\xfe\x01\ +\xff\xff\xff\x00\xff\xff\xfe\x00\x7f\xff\xfe\x00?\xff\xff\x00\ +?\xff\xff\xe0?\xff\xff\xf0\x7f\xff\xff\xf8\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x11\x00\x0d\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff?\xff\xff\xff\x1f\xff\ +\xff\xff\x8f\xff\xff\xff\xc4\x0f\xff\xff\xe1\xe7\xff\xff\xf3\xf3\ +\xff\xff\xe3\xf9\xff\xff\xef\xfd\xff\xff\xef\xfd\xff\xff\xef\xfd\ +\xff\xff\xef\xfd\xff\xff\xe7\xf9\xff\xff\xf3\xf3\xff\xff\xf9\xe7\ +\xff\xff\xfc\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x07\x00\x0e\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07\xf8\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xf7\xff\xff\xff\xe7\xff\xff\xff\xe7\ +\xff\xff\xff\x0f\xff\xff\xfe\x7f\xff\xff\xfe\x7f\xff\xfe\xfe\xff\ +\xff\xff~\xff\xff\xfe \x01\xff\xff\x00\x01\xff\xfe0\x03\ +\xff\xff~\xff\xff\xfe\xfc\x7f\xff\xff\xfc\x7f\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x03\x00\x03\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x18\x00\x00\x00\x14\x00\x00\x00\x12\x00\x00\ +\x00\x11\xf8\x00\x00\x10\x08\x00\x00\x10\x10\x00\x00\x10 \x00\ +\x00\x10@\x00\x00\x10\x80\x00\x00\x11\x00\x00\x00\x12\x00\x00\ +\x00\x14\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xe7\xff\xff\xff\xe3\xff\xff\xff\xe1\xff\xff\ +\xff\xe0\x07\xff\xff\xe0\x07\xff\xff\xe0\x0f\xff\xff\xe0\x1f\xff\ +\xff\xe0?\xff\xff\xe0\x7f\xff\xff\xe0\xff\xff\xff\xe1\xff\xff\ +\xff\xe3\xff\xff\xff\xe7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x10\x00\x08\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xf0\x00\x00\x07\xf0\ +\x00\x00\x0f\xf8\x00\x00\x1f\xf8\x00\x00\x1f\xfc\x00\x00?\xfc\ +\x00\x00w\xfc\x00\x00g\xfe\x00\x00\x07\xf6\x00\x00\x0d\xb6\ +\x00\x00\x0d\xb2\x00\x00\x19\xb0\x00\x00\x19\xb0\x00\x00\x01\x80\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xfc\x0f\xff\xff\xf8\x07\xff\xff\xf0\x07\ +\xff\xff\xe0\x03\xff\xff\xc0\x03\xff\xff\xc0\x01\xff\xff\x80\x01\ +\xff\xff\x00\x01\xff\xff\x00\x00\xff\xff\x90\x00\xff\xff\xe0\x00\ +\xff\xff\xe0\x00\xff\xff\xc0\x05\xff\xff\xc0\x07\xff\xff\xe4\x0f\ +\xff\xff\xfe\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x03\x00\x03\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x0a\x00\ +\x00\x00\x11\x00\x00\x00*\x80\x00\x18[@\x00\x14\x80 \ +\x00\x12[@\x00\x11\xea\x80\x00\x10\x11\x00\x00\x10*\x00\ +\x00\x10D\x00\x00\x10\x80\x00\x00\x11\x00\x00\x00\x12\x00\x00\ +\x00\x14\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff\xff\xf1\xff\ +\xff\xff\xe0\xff\xff\xff\xd1\x7f\xff\xe7\x80?\xff\xe3\x00\x1f\ +\xff\xe1\x80?\xff\xe0\x11\x7f\xff\xe0\x00\xff\xff\xe0\x11\xff\ +\xff\xe0;\xff\xff\xe0\x7f\xff\xff\xe0\xff\xff\xff\xe1\xff\xff\ +\xff\xe3\xff\xff\xff\xe7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0f\x00\x0f\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00?\xff\x80\x00!\x00\x80\x00!*\x80\x00!T\ +\x80\x00!*\x80\x00!T\x80\x00!*\x80\x00!T\ +\x80\x00!\x00\x80\x00!\xfe\x80\x00 \x00\x80\x00 \x00\ +\x80\x00 \x00\x80\x00 \x00\x80\x00?\xff\x80\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xc0\x00\x7f\xff\xc0\x00\x7f\xff\xce\x00\x7f\xff\xce\x00\ +\x7f\xff\xce\x00\x7f\xff\xce\x00\x7f\xff\xce\x00\x7f\xff\xce\x00\ +\x7f\xff\xce\x00\x7f\xff\xce\x00\x7f\xff\xcf\xfe\x7f\xff\xcf\xfe\ +\x7f\xff\xcf\xfe\x7f\xff\xc0\x00\x7f\xff\xc0\x00\x7f\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x03\x00\x03\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x14\x00\x00\ +\x00\x12\x00\x00\x00\x15\xf0\x00\x00\x16\x10\x00\x00\x17\xa0\x00\ +\x00\x17@\x00\x00\x16\x80\x00\x00\x15\x00\x00\x00\x12\x00\x00\ +\x00\x14\x00\x00\x00\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe7\xff\xff\xff\xe3\xff\xff\ +\xff\xe1\xff\xff\xff\xe0\x0f\xff\xff\xe0\x0f\xff\xff\xe0\x1f\xff\ +\xff\xe0?\xff\xff\xe0\x7f\xff\xff\xe0\xff\xff\xff\xe1\xff\xff\ +\xff\xe3\xff\xff\xff\xe7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x06\x00\x06\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x01\xfe\x00\x00\x01\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x01\x80\x00\x00\x01\x80\x00\x00\x03\x00\x00\x00\x03\x00\ +\x00\x00\x06\x00\x00\x00F\x00\x00\x00l\x00\x00\x00|\x00\ +\x00\x00\x7f\x80\x00\x00\x7f\x00\x00\x00~\x00\x00\x00|\x00\ +\x00\x00x\x00\x00\x00p\x00\x00?\xe0\x00\x00 \x00\ +\x00 \x00\x00 \x00\x00 \x00\x00 \x00\ +\x00 \x00\x00 \x00\x00?\xe0\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xfe\x01\xff\xff\xfe\x01\xff\xff\xff\xff\xff\xff\xff\xfe\x7f\ +\xff\xff\xfc?\xff\xff\xfc?\xff\xff\xf8\x7f\xff\xffx\x7f\ +\xff\xff0\xff\xff\xff\x10\xff\xff\xff\x01\xff\xff\xff\x00\x1f\ +\xff\xff\x00?\xff\xff\x00\x7f\xff\xff\x00\xff\xff\xff\x01\xff\ +\xff\xff\x03\xff\xff\x80\x07\xff\xff\x80\x0f\xff\xff\x9f\xcf\xff\ +\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x9f\xcf\xff\ +\xff\x9f\xcf\xff\xff\x9f\xcf\xff\xff\x80\x0f\xff\xff\x80\x0f\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x0b\x00\x09\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x00\x00\x00\x18\ +\x00\x00\x000\x00\x00\x000\x00\x00\x00`\x00\x00\x04`\ +\x00\x00\x06\xc0\x00\x00\x07\xc0\x00\x00\x07\xf8\x00\x00\x07\xf0\ +\x00\x00\x07\xe0\x00\x00\x07\xc0\x00\x00\x07\x80\x00\x01\xff\x00\ +\x00\x01\x01\x00\x00\x01\x01\x00\x00\x01\x01\x00\x00\x01\x01\x00\ +\x00\x01\x01\x00\x00\x01\x01\x00\x00\x01\x01\x00\x00\x01\xff\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xe7\xff\xff\xff\xc3\xff\xff\xff\xc3\ +\xff\xff\xff\x87\xff\xff\xf7\x87\xff\xff\xf3\x0f\xff\xff\xf1\x0f\ +\xff\xff\xf0\x1f\xff\xff\xf0\x01\xff\xff\xf0\x03\xff\xff\xf0\x07\ +\xff\xff\xf0\x0f\xff\xff\xf0\x1f\xff\xfc\x00?\xff\xfc\x00\x7f\ +\xff\xfc\xfe\x7f\xff\xfc\xfe\x7f\xff\xfc\xfe\x7f\xff\xfc\xfe\x7f\ +\xff\xfc\xfe\x7f\xff\xfc\xfe\x7f\xff\xfc\xfe\x7f\xff\xfc\x00\x7f\ +\xff\xfc\x00\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00V\ +\x00\ +\x00\x01Fx\x9c\xc5\xc8\xb1\x0d\x800\x0cD\xd1\xef4\ +\x88\x0a*\xda\xa4\xa4d\x03\xd8\xcc\x8c\x9c\x0d\xccE\x8a\ +D\x01\x15\x0d\xdfz\xb2t\x900J\x81\x99\x91\xcd`\ +\x01V\xd1\xc4!\xa6k\x9d\xdc\xa5\xae\x15\x11\xfc]<\ +s\xd9+d\x99d\xe8?W\xd7\xee\xe1\x12_\xbcu\ +\x01\xec\xfbi\xe6\ +\x00\x00\x01F\ +\x00\ +\x00\x02\x00\x01\x00 \x00\x00\x10\x00\x11\x000\x01\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00 \x00\x00\x00@\x00\x00\ +\x00\x01\x00\x01\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\ +\x00\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xfc\x1f\xc0\x00\x04\x10\ +\x00\x00\x04\x10\x00\x00\x04\x10\x00\x00\x04\x10\x00\x00\x04\x10\ +\x00\x00\x07\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\xfc\x01\xc0\x1f\xfc\x01\xc0\x1f\xfc\x01\xc0\ +\x1f\xff\xf1\xc7\xff\xff\xf1\xc7\xff\xff\xf1\xc7\xff\xff\xf0\x07\ +\xff\xff\xf0\x07\xff\xff\xf0\x07\xff\xff\xff\x7f\xff\xff\xfe?\ +\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xff\x7f\xff\xff\xfe?\ +\xff\xff\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\ +\xff\xff\xff\xff\xff\ +\x00\x00\x00\xef\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00\x09pHYs\x00\x00\x0e\xc3\x00\x00\x0e\xc3\ +\x01\xc7o\xa8d\x00\x00\x00\x18tEXtSof\ +tware\x00paint.net \ +4.0.6\xfc\x8cc\xdf\x00\x00\x00mIDA\ +T8O\xb5\x8c\xd1\x0a\xc0 \x0c\x03\xfdt\xff\xbc\xb3\ +\x83d]\xa8\xd82\xf6p\xa2\xc7\x99af\x9fHe\ +\x87\xe7\xb2\xae\x15\xd0\xf3\xdf}Htb\xce\xb9\xbe\xc9\ +\x80\xcb\x0a\xdb\x01\x88\x13\xff\x0d\xec@\x08\xdc\xa5\x03.\ +\x15\x8dc\xcb7$DD\xe3\xccQBD4\xce\x1c\ +%DD\xe3\xccQBD4\xce\x1ce\x07|\xe6\x80\ +\xe3\xab\x15\xd0\x83\xd7\xa3\x8f\x8d\x0b\xd1.k\xedV\x14\ +\x8b0\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xd0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00\x09pHYs\x00\x00\x0e\xc2\x00\x00\x0e\xc2\ +\x01\x15(J\x80\x00\x00\x00\x18tEXtSof\ +tware\x00paint.net \ +4.0.6\xfc\x8cc\xdf\x00\x00\x00NIDA\ +T8O\xdd\x8c\xc1\x09\x00 \x0c\x03\xbb\xffT\xdd\xac\ +\x1a\xb0\x82\xb6*U\x10\xf4q\x8f\x5cBHD\x8ep\ +e\x04+\xb2\x02+\xa7XQ\xc6\xcc\x9c\xe3\xd8\xd5\xce\ +\x88\x7f\x0e<\xee\x1e`\xacl\x1f\xcc\x5c\xed\x8cx\xff\ +\x00`\xd8\x8f=\x07\x9a\x10G(\x01oN\x98?\xf6\ +\xff\xda\xc5\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x00\xd4\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00\x09pHYs\x00\x00\x0e\xc2\x00\x00\x0e\xc2\ +\x01\x15(J\x80\x00\x00\x00\x18tEXtSof\ +tware\x00paint.net \ +4.0.6\xfc\x8cc\xdf\x00\x00\x00RIDA\ +T8O\xed\x8fA\x0a\xc00\x08\x04}\xba?\xb7\xce\ +a/a\xa1m\xbc\xe4\x90\xc0\x043\xd1\x05\xa3\xaaF\ +X\xf9\x07+\xa1\x0fW\x97\xfe_X\x09\x0a\xc8\xcc~\ +\xfa\x1e\xb0R0<\x0a\xf8\x82\x95\xa0\x15V\xbfb%\ +(`{\x85\x1bpB\x000<\x0ax\xa7\xe2\x01V\ +T\xcf_\x16\xfbf\x81\x00\x00\x00\x00IEND\xae\ +B`\x82\ +\x00\x00\x03\xea\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x93\x00\x00\x00\x15\x08\x06\x00\x00\x00B\x0c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\xd1\xd1\x91\xfe\x9f\xcdfevv\xd6\x02\xc5\xa1\x95S\ +\xb8\xf5\xdf\x87\x96\xad\xdfg\x92\xccK\xf0CO\xe9!\ +\xa6\x86\x86\x86d``@\xd6\xd6\xd6\xf4\xcd\x01\x8a:\ +\x8f\xff\x0c\xda\x18\xc00i\x94\xcb\xe5\x14\xa8\xd1\xd1Q\ +\x85\xcb)\xfc\x02\x12\x7fB\x05M\xcf\x80\x84`\xc4\xa4\ +\x92\xfd\xd5\x00\xc0\x0c\x0e\x0e\xdat\x1a\x19\x19\xd1\xc5\x9f\ +\x09\x22\xeb\xf5\xba\xec\xef\xef\xcb\xd6\xd6\x96\x90nN\xbd\ +!\xb6/\xe6!\x86r\x9e\xd8\xb0\xf9\xa2\xb7\xde\xee5\ +\x9a\x7fgd3+\xd9_\x0d\xf0\x07\x0d\x0f\x0fK$\ +\x12\x91h4\xaa\xaff\xcb\xfbLL\xf0\xc4\x1b =\ +==\xfd\xa9:\xf5\xba\x08\x12\x12\x89\xcf\xdc\x0f\x92\x85\ +\x09\xd3\xe0\xcc\xa9V\xab* \xec\x85\x0cW\xdc\xec\x06\ +\xec\xfe\x96a\x00\x1e\xe0\x82Q'\x08\x12\xb609;\ +\xff\xcc1y\x07P\x7f\x17\xd6Q\x02K\x02\x00\x00\x00\ +\x00IEND\xaeB`\x82\ +\x00\x00\x01\xbb\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0f\x00\x00\x00\x10\x08\x06\x00\x00\x00\xc9V%\x04\ +\x00\x00\x01\x82IDAT(\x91\x8d\xd2O\x88\x8eQ\ +\x14\x06\xf0\xdf7\xf3\xa6Qc#\xb1\x9b\xbe\xc6\xd0,\ +,&\x1dM\x8aI\xa9Ql\xecg\xa1H2J\xb3\ +\xb2\xb4\xc5\xdeJ\x91\xb5\xa6\xc8\xbf\xa5P\x16rD\xb1\ +\xa0\x11\x92\x92\x05if\xc1\xa4)\x8b\xf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x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0f\x00\x00\x00\x12\x08\x06\x00\x00\x00\x84\x9e\x84\x0f\ +\x00\x00\x00\xc8IDAT8\x8d\xa5\xd3=N\x031\ +\x10\x86\xe1gQ\x02]\xe8R\xf3\x97\x0e\xaa\xbd\x12E\ +.\x10J\x84\xc4=\xd2%\x12\x15\x11\xe7\xd8\x8d\x10\xa2\ +\xe5 H\x88M\x11G\xdaX\xded1_7\xdf\xe8\ +\x9d\xf1\x8c\xed\xa2i\x1am\xd5u-\xd2\x19\xbec\xb3\ +,K'\xb1\x99\xd0\x03\xceS\x89>\xf0\x04W\xb9\xf0\ +\xf5\x7f\xe0\x9b\x5cx\x841.s\xe0]\xc7,x\x12\ +\x15\xd9\xd3\xa0\x03\xba\xc3\x10\xb7!\xbe@i;\xffJ\ +\xb8\xf7.x\x88\x0aE\x88OC\xfc\x8a\x97c\xc7^\ +\xe3-\xf2~\xf1\xd86\x0e\xcd\xfc\x84\xf6\xdb]\xe2\xb3\ +/\xfcn;\x1f\xfc\x84b{:\xb6\xed]\xf79\xbe\ +\xfe\x0a\x7f`\x81\xe7T\xb2k\xdbm\xddK|I(\ +\xaa\xaa\xea\xc1\xa75\xc0\x14\xb3\x1cx\x03\xb2\x99!K\ +\xef\xfb\x80\xb9\x00\x00\x00\x00IEND\xaeB`\x82\ +\ +\x00\x00\x02\x1e\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x18\x00\x00\x00\x11\x08\x06\x00\x00\x00\xc7xl0\ +\x00\x00\x01\xe5IDAT8\x8d\x95\xd4]h\x8ea\ +\x18\x07\xf0\xdflIQC\xf2q\x22\x8a\x92\xe2\xd8G\ +!\x0e\x97\x16j\x07D\x88\x94R\xcb\xe7\xa2\x9c\x8d\x92\ +\x906\x16K\xf9\x96!\xc7\xac\xa4\x90\x83\xb7)\x07r\ +\x22\x12\xcd\x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8\ +\x92`k\x1d\xe0\x0eh\x9b\xd9B\xe0g@afk\ +\x81\xf7\x0c,\x03'fvM\x95$m\x94\xea\xbe\x87\ +\x85\xdeV\xe5\xc7M\x92\x94K\x1a\xc4\xb8\xa4\xee\x85_\ +\x89.\xb0\xee\xd6\x0bplf\x0fU|\xd3\x15\xb9\x07\ +\xdaA\xbd\x04<\xd6\xc1\xb5Af6\x04\xae\x02\xeb\xd4\ +\xcc\xc6u|\xed\xd6\x00\xfc\xb0\xf5\x81\xdc\xccZMl\ +\xe3\xed\xf7\x0e\xce\x81\xa3&\x0e\xe0\x07\x81\x1e\x7f\x14\x8c\ +;\xe7\x95\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01{\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x12\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1b\x06/\x5c\ +\x00\x00\x01BIDAT8\x8d\x95\xd3?K\xdbQ\ +\x14\xc6\xf1OB\xaa\x9bb\xfd\xb3IQ\xc8(\x08\x97\ +:\x1b\xa8\x9d\x5c\xb5\xd0\xcdEqt\x93\x80\xef\xa0o\ +\xa0N.\x0e\xba\xd61\x10p\x90\x0a\xbf\x0cm\x17\xb3\ +\xb8\xb8H\x15u\x8a\xa0`\x1c\xe2\ +\x06\x15\x9c`$\xa5t\x05\xc5\x1c\x90\x11\xccD^\xc6\ +%\xfe\xbf\x1e\x96r\x80\x86P\xc5'\x1c\xe3\x0b4\x1a\ +\x8d:\x96\xf3\x80\xae\x03\x92\xd0\x88\x05\x8b8(\x0c\xd8\ +\xa3\x02\xbec\x12-L\x04T\x00k\xfd*\xaa\xa0\x1e\ +y\x1b\xfb]\xe0RJmz7{\x12\x9b\x91\x0f\xf5\ +\xf0\xb4c\xe9\x07\x1aG\x0d\x19\xf6\xfa\xc0\xde\xa2\xdb\xd5\ +fq\x869/\x8d-\xe1a\x10\xd02\x8eB\x7f\xc0\ +\x1a\x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+\x00\x00\x0a\x00\x00\x00\x0d\x08\x06\x00\x00\x00\x907\xff\x05\ +\x00\x00\x00\xb5IDAT(\x91}\xd0\xa1\x8aBQ\ +\x14\x85\xe1O\xb9\xcdd\x9b\xeek\x08\xbe\xc7X\x0c:\ +\x08\xfa V\x1f@\xb1h1\xcc4\xc1l\xbc0\xc1\ +7\x10\x83ED\xc3\x14\x83\x96s`s\xb9\xcc\x82\x13\ +\xf6f\xb1\xfe\xb5O\xa3,\xcbO\xac\xfd\xafY\x11\x86\ +\x01\xfe\xc2\xdc\xc0\x1c\x1f8F\xe3\x0f\xeea\x9e&\xd3\ +\x0e\x9b&N\xd8\xe2\x19L\x1d\xccp\xc3\x17\x148\xa4\ +\x17\x91\x0b\xb4R\xea\x19\x9a5\xc5'\xe8%\xe4*/\ +\xab\xc6\x8c\xbcgdV<&\x22\x87\x19Y\x97\x98\x91\ +{,\xab}rbF>0\xc2+x\xc6\xb8\x145\ +\xc8S%\xac/}\xf88!\x0f\xf8F\xbb\x8eZ\xa0\ +\x9b\x16]\x5c\xab\xdd\x92~\xdf\xc4\xcd&:\xc3\xef\xf7\ +E\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x015\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0f\x00\x00\x00\x0f\x08\x06\x00\x00\x00;\xd6\x95J\ +\x00\x00\x00\xfcIDAT(\x91\x95\xd0\xcf*D\x01\ +\x14\xc7\xf1\xcf\xcc\xcaB<\x06YX\x9d\xe6\x09\x94\x12\ +SJ\x9a\x97\xb0'\x8bY\xc8+XY\x121\xfe\x16\ +\x1b;ew\x1e@\xd9YX\xb0A\xd9\x10c\xe1\xca\ +\xedv\xa7\xc6os:\xe7\xf4\xfd\xfdN\xa7\x91\x99\xab\ +\xf8\xc0aD\xdc\xfb\x87\x1a\x99\xd9\xc1\x1e\xfa\xb8\xc1\x01\ +\x8e\x22\xe2a\x18x\x14O\x18)\xcd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\x06\ +\xf7*\xdd\x9b\xd0\xef+\xe3\xd83\xea\xa8\x8d\xdeY+\ +\x84XT\xefJ\x96-\x8d\x1e7\x11!\xc4\x1f\x044\ +\xeb\xe2\xac\xa9\xca\x94\x91J/\x04&\x10\x10\xd35\xa6\ +\xb3I\xad8\xde\x90\x16\x12\xba\xdc\xf4\xccu\xa9\xf4\x1d\ +\x80\x02\x8e\x08!\x1a5\xde\xe4\x03\x00\x08!\xe6\x02\xc7\ +\x81\x84T\xfa\xa94\xe3\x00\xcb\x09q\x9eV\x96\xe5\xf3\ +\xec\xb2\xde\x86R\xe9\x02`-\xa1,?\x22@\xeex\ +\xc2}\xf0sg\xcd\xf0lu]\xd6\xdb0^H\x9e\ +\x03N\x01\x09`~4\xbeL\x08\x91\xb5\xf1\xcb\xf6@\ +\x9a' `H\xeay\xbe\xa7\xa9:\xfe\x03\x5c\xaa\xea\ +&\xfd\x17M\xd2\x00\x00\x00%tEXtdat\ +e:create\x002016-01\ +-08T15:18:18+00:\ +00\x01E\x99\xf0\x00\x00\x00%tEXtda\ +te:modify\x002016-0\ +1-08T15:18:18+00\ +:00p\x18!L\x00\x00\x00\x00IEND\xae\ +B`\x82\ +\x00\x00\x00\xce\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0c\x00\x00\x00\x0c\x08\x06\x00\x00\x00Vu\x5c\xe7\ +\x00\x00\x00\x95IDAT(\x91\x9d\xd0\xb1\x09\x02Q\ +\x10E\xd1\xb3\x22\x08\xb6a,\x98\xd9\x80\x81\xa0e\x88\ +\x91%\x18Z\x82\x89b\x19\x0a\x826 \xfc`\xc1\xd8\ +\xd0\x16\x04#\x0d\xfe.\xac\xe8\xdf\x05_x\x87\xcb\xcc\ +\x9b,\x84\xf0\xc2\x01S1{L$\xd2\xc6\x19y\x85\ +\xe5\xe8\xa4\x84,\x84\x90\x9a%7lp\xc5\xba`\x0b\ +\xf4\xeb\x84\xb9\xd8\xa1\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\xa5\xe6\x00\x97\xf0\x04;m\xe0\ +x\x91\x06\xb1\x82\x89\xca\xed=,c\x1a\x1fq'\x22\ +~\x9c\x02\x0a\xd2\xc1=\xcd*\x8fh\xb61\xf1\x5c\xf3\ +\xa8_4\xfbr\x0a\xf9\x0b\x9c\x15\x99y\x03oq\x0d\ +\x1f0\x11\x11\xfb\xff\x0dT\x907\xb8\x7f.\xa0\x82<\ +>7p\x02Y\xc0\xc3#S\xefd\xae\x0f\x1eB$\ +\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01x\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x12\x08\x06\x00\x00\x00R;^j\ +\x00\x00\x01?IDAT8\x8d\x9d\xd3=K\x5cA\ +\x14\xc6\xf1\xdf\xae\x06\x04\x8bt\xdb\xa8\x88q#\xa2\xd8\ +X\xa4\xb2\x15\x041\xd8\x05\xa2\x95\xe5\xd6!\xd8,n\ +!~\x06+IJ\xf3\x09\x94\x10P\x904n\x11H\ +0$\xf8\x02.\x0b\x0a\x16Vb\xe1\x8a\x8538\x19\ +]\xc2\xfa\xc0\xe5\x9e\xf3\x1c\xce\x7f\xce\x9d\x99[\xa8\xd7\ +\xeb\x12\xad\xa1\x8a\x96\x7fu\x89\x97\x99w\x8a\xc1bf\ +\x8e\xa3O\x07\xca\x01\xaf\xc2\xf3,@\x01\xe5N\x01\xdd\ +I\xdc\x8f\x9e6\x80\x1d\xf4\x86E&\xf0\x13\xe7\xf9\x04\ +\xb1q\xe8\x09\xc0<\xa6\xf1\x19%|\xc2B\x0ex\x9d\ +\x81r\xbd\xc0J\x88\xabq\xfa\x22\xc6BS\x0a\x18\xc5\ +\x1c\xba\x12\xc0\x12\x86C<\x82\xf7\x110\x80#|\x0c\ +\xc5\x12~\xe3\x9d\x87\xfb\xd0\x13VMUEw\x11\xdb\ +\xf8\x9e\x15oPK\xf2\x8a\xc7\xf7\xa3\x8c\xc5\xb8\x07\xb5\ +\xac\xb8\x81\xc3$ob\x06?B\xbe\x857hD\xc0\ +W\xec\x85\xf8\x1a\xab\x19p3Lz\x10\xf2_\xd8\xc7\ +\xb7\xf4\x14\xe2\x0e\xaf\xa3\xe1i\x1d\x87\xf7Q4\xe2E\ +Z\xc6$\xce\xdc\x9f\xc2\x97\xe0Wp\x91\x00N\xda\x01\ +\xa60\x1b\xe2\xb7I\xc3\x876\x13\xfc\x8dF\xfe3\xfd\ +O\xc7\xb8\x92|b\xa7\x80&\xfe\xe0\xf6\xb9\x80\x16v\ +S\xe3\x0e3\xc49\xa5\x12)N:\x00\x00\x00\x00I\ +END\xaeB`\x82\ +\x00\x00\x01\x1b\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0e\x00\x00\x00\x0d\x08\x06\x00\x00\x00\x99\xdc_\x7f\ +\x00\x00\x00\xe2IDAT(\x91\x9d\xd1/K\x83Q\ +\x14\x06\xf0\xdf\xe6\x8aE\x98_`&\x83U\x10\xbf\x82\ +\x98\x9d0\x16\x945\xbb \xd6\x05\xcd.\x88}j\xb1\ +\x0cV4\x1b_\x164\xac\xb8b\x96\x81\xc5 2\x16\ +v\x06\x97\xd7wC|\xe0p\xcfs\xce\xf3\xdcs\xff\ +\x94\xb2,\xbb\xc0\x99\xdf8\xc1u\xe4}\xec\xa7\xcd2\ +\xeePG7j\xc3\xe0O\x89\xee\x12\xc7\xf8\xc2\x18\xcd\ +\x0a^#z\xd8\xc4\x0e\xaa\x18%\xc6g\x1ca\x15\x0d\ +\xf4\xcaI\xf3\x1b\x07\xf8\xc0\x15\xb6\x93^\x1d-tb\ +\x80\xd4\x08\xefh\xa2\x82\x07\xacc\x037\x18\xe04\xbd\ +c\x1e\x8fh\x87\xa1\x8b\xdb\xd0\x1d\xc6\xa9\x88\x9d\x8b\xd0\ +\xc6.\xf6\x827\xf0\x96\x0a\x8a&\xc2\x04\xe7\x91\x0fq\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e2\ +\x0a\xee\xe2)>a*\x22\x0e\x1ar!3\x0f3\xf3\ +~{\x8c\xd6H\xb3\xb5\xee\xe1\x7f\xe7\xcc\x5c\xc7qL\ +D\xc4a\x9f\x0f^\xe0\x1a\xce\x95\xcc<\x89I\xac\xf6\ +\x13\xd6X\xc50F\x0b.\xa3`;3\x8f\xf4q=\ +\x8a]\xfc\xc1\xa5\x82G\x95\x1b\xc7\xab>\xaeou\x96\ +:\x88{\x05\x17*1\x86\xc1\xcc\x1c\xe9\xe1:\x82)\ +|\xab\xd0\xc5\x82\x1f5\xb9\x8e7X\xea\xe1z\x07\xef\ +p\xb5\x01\x0a>\xd7\xf7\x10~a\xb1\x87xI\xe7p\ +\xa6k\xbeY\xf0\xba\xab\xe0\x06\xf62s\xac\xd5\xf2$\ +\xcec\x1f'*\xbcR\xf0\x04\x9b\x15\x98\xc7\x87\xae\xb9\ +\x9a\xd8\xc7\x16n\xd5|\x03\xcf\x9a#9\xab\xb3\xe93\ +X\x88\x88\xf5v\xcf\x999\xa1\xb3\xed\xef\x98\x8e\x88\x9d\ +\x7fI\x1dq\x82#,l\xf1\x00\x00\x00\x00IEN\ +D\xaeB`\x82\ +\x00\x00\x01\xc6\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x11\x00\x00\x00\x10\x08\x06\x00\x00\x00\xf01\x94_\ +\x00\x00\x01\x8dIDAT8\x8d\x9d\xd3M\x88\xcda\ +\x14\x06\xf0\xdf\x9d\x99\xcd\xd8h\xc6,$ERS\xcc\ +4\xa5\x135\xd9\xcclg(\x12\x1b\x0b)\x16>v\ +\x16\xa2,(\xcdF\xcab\xa6\x1b[\x85\x22+K\xf9\ +X\xb9\x0ee!#D\x16\xa8!\x09\xc9\xc2\xc7\xe2\xff\ +\xcet\xfb\xd7\xcc\x8dS\xef\xe6=\xe7<\xcfs\xbe\x1a\ +\xfe\xd32\xb3\x89\xfd8\xde\xe8\x108\x82\xb5X\x85\xd5\ +\xe8F\x17\xd6c\x1bz\xd0\xea\xe9@x\x06O1\x83\ +\xe5\xd8\x83e\xb8\x82\xbeBp\xa2{\x09\x15\x1bp\x16\ +\xc3\xe8G/\x9ax\x84\x83\xd8\x87\x81\x88hv-\x02\ +\xb0\x157\xf0\x10o\xd1\x8a\x88i\x0c\xe04\x0eG\xc4\ +\x17\xfcVj\x9aO\x5c\x89\xbdE\xe2\x1b\xac@\x94w\ +)3[8R\x00~df?>B#3\x03\xc7\ +\xd0\xc0\xbb\xc26\x8a\x8b\x111U\x08\xee\xa8\x9ay\x0b\ +\xcf\xf1\x12?\xf1=\x22\xee\xf7\x14\xc6\xed\xc51\x8b\xc7\ +\xb8\x80'm\x15\xee\xc4H\x01\x1a\xc4I|\xc2\x98\xc2\ +.3\xc7q\x0d\xbb#\xe2\xf6b\xcd.\xb1S\x98\xc0\ +xD\xccQ\xcd\x5cI\xdc\x81\xcb\x999\xf9/\x00\x0b\ +J\xda\x82\xb6\xe0\xaejt\xdfj\xbeI\x9c\xc7h;\ +\xc0\x82\x926{\x8d\xafu\x80b\xef\x8bo\xae\xee\xa8\ +o\xec\x90jCef/\x8e\xe2\x05n\xe2\x19\x063\ +\xb3;\x22~-\xa5d\x08\xb3\x99y\x08\xaf\xb0\x19\xa7\ +\xf0@5\xf6\x0fXWWR\x07\x19\xc6\x01\xd5qM\ +D\xc4.l\xc29Lc\x0d6v*\xe73\xc6\x22\ +\xe2\xde\xfcGD\xfc\xc1\xd5\xcc\xbc\xae\xba\x97\xbe:\xc8\ +_\xc6l\x83y\x0c\xda\xbaW\x00\x00\x00\x00IEN\ +D\xaeB`\x82\ +\x00\x00\x01\x89\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x15\x00\x00\x00\x14\x08\x06\x00\x00\x00bKv3\ +\x00\x00\x01PIDAT8\x8d\xad\xd4\xb1K[Q\ +\x14\xc7\xf1O$\xb4\xee\x12j\xabq\xaaYJ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\x227\ +\x89g\xea\x1c\x16L\x06v\x1d\x8b\xc4\xd5:\xf1Y<\ +\x96\x03\x93\x81\x1d\xc6\x1b\xac\x11\xf6\xe9\x10\xd69\xf8\x17\ +-\x83l\x7f\xf5\xb9\xae\x1b\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x02\xff\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\ +\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\ +\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x06\ +bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\ +\x00\x09pHYs\x00\x00\x0b\x12\x00\x00\x0b\x12\x01\xd2\ +\xdd~\xfc\x00\x00\x00\x07tIME\x07\xe0\x01\x08\x0f\ +\x12,c4\xebp\x00\x00\x01\xeeIDATX\xc3\ +\xed\x95\xbdk\x14A\x18\xc6\x7fo\x12D\x09\x09\x82 \ +h#H\x02\x16I\x99\xbf }\xdap\xdb\xc8\x92\xca\ +\xe2\x16\xff\x00\xc12U\x88\xec\x15!\xd5\x14\xe2\x1e)\ +\x02Q\xc4t6\x92\xc2\x90\xc6B,\xceBN\x11<\ +\x0c\xf9 \x09\x5c>nR\xdc\x9c\xbeYw7\x93\x8f\ +\xce}\x96\x81w\xe6}v\xe6\xd9g\xde\x99\x85\x12%\ +J\xfc\xef\x90\xbcD%\xac\xde\x03\x06]\xd7*\xfeA\ +\xdd\xd4~\xa6\xb8\x0f\x81\xfb\xc0\x100\x00\x1c\x01m`\ +\x17\xd8\xac\x9b\xda\xb7\xbcu\xfa\xf2\x95\xc9\xa2 \x0d\xa0\ +!\xc8W\xd7\x1a@3\x08\xa3\xf5 \x8c\x1e)\xeec\ +A>\x08\xf2\x0ex#\xc8\xaa \xef\x05\xd9\x00\xee\x04\ +a\xc4\x85\x05\x00\x87\xea\xeb;\xca\x85~`\x02\xf8\xa8\ +&>*\x98g\xb7h\x0b\x06\xce\xdd\xa4\xae\xedS\x89\ +\x89\xdf\x06at\x17X\x03F\x80a\xe0)\xf0\x22\xc5\ +\x9f\x06\xda\x89\x89_{\xcc\x9d\xef\x80uO/\x06H\ +L\xdc\x02\x9e\xdb?Y;\xa9\xb9\x8a\xe7\xb5x\xa1\x03\ +\xe2\xea\xd3b\x11D\x17\xeb'\xf9[\xbb\x0f4W\x8b\ +\xbd\xb2\x80\x02\xec\x03\xc7\xee\xdd\xe1,B\x10FO\x80\ +&\xb0e\xb1;\x82|NL|m\x02\x8e\x81\x13\xf7\ +\xee\xcd\x8c\xfcR\xaa?v)\x07\xb4\x95)[\xc5b\ +{\x9e\xf7g\xe4\xcf\xed{\x09H\xd5\x80N\xdd\x12\xe4\ +\x86\x8b\xdb\x9a\xeb\xf8\xd3\x82\x9c$&^\xf6\xb1\xb3\xcf\ +\x87\x94\xc2m\x15og\x11|\x17\xbf\x88\x80\x8e\x8a'\ +U\xfc\xe5\x12\x1fp\x06\xbe50^\x09\xab[\xc0(\ +\xf0\xccb-\xdd\x0b\xeaU\x9a\x0bP\x09\xabU\xa0\x05\ +\x1c\xb8\xb6\x0d\xfc\xaa\x9b\xda\x0fo\x01\xbd\xb3\xefj`\ +V\x0bs{\xbe\x9a\x98xEs]~)}/\xb8\ +\xfe\x18\xe0/\xc0\xa9n\xd1=r\x1a-\xe0eb\xe2\ +95\xb6\x07\xfc\xe6\xdf\x7fB\x07\xf8\x0e,\x90\xf3\xbf\ +(\x120\x935X7\xb5\xac\xe1y\xd7\xb2\x9c\x04 \ +\xef\x22*Q\xa2D\x89S\xad\x83\xa9\xe2\x81\x96I:\ +\x00\x00\x00%tEXtdate:cre\ +ate\x002016-01-08T1\ +5:18:44+00:00\x8e\x05\xfd\ +\xe0\x00\x00\x00%tEXtdate:mo\ +dify\x002016-01-08T\ +15:18:44+00:00\xffX\ +E\x5c\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\xeb\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x11\x00\x00\x00\x10\x08\x06\x00\x00\x00\xf01\x94_\ +\x00\x00\x01\xb2IDAT8\x8d\x95\xd3Oh\xcfq\ +\x18\x07\xf0\xd7\xf7\xb7%s\x908(.\x8aYM\x19\ +y\x14\x8a\x1c89\xb98\x92\x9b\x96\x7f3\xb2&\x9b\ +?5\x89\xb3\xc2\x8a\x5c8)M\x9a\x03Jqz\x0e\ +\x86\x83\x03\x07\xb2\xd5\xe4_\x88R3\x87\xdfw\xf5m\ +~#O}\xeaS\xef\xe7\xfd\xee\xfd|\x9e\xcf\xbb0\ +Cef+\xce\xa1\x1d\x0f\xd1\x13\x11\xef\x1b\xf5\x16\x0d\ +\xc8\x813X\x8d\x05\x15h\x14\x8fq$\x22^7\x14\ +\xc9\xcc-\xe8\xc7J\xcc\x9d\xc9!\xde!q4\x22\x9e\ +C\x91\x99;p\x18+0\xe7/\xe4\xe9\xf5\x09#\xe8\ +\xada\x02\xcd\xe5\xf9\xdf\x9a\xc0\xaf\x022\xb3\xc0nt\ +\xa3\x0dM\xffp\xf0\x04]\x111\x02\xb5\x12X\x8e]\ +X\x88>\xbc\xc0\xe44\xf2\x07\xdc\xc1N\xacCWf\ +\xce\x83Zf>\xc2S\xbcA[D\x0c\xa0\x03\xa7\xf0\ +\x0a\xe3\x18\xc2\x86\x88\xd8\x16\x11\xb7\xd57\xb7\x0c\xe3\x99\ +y\xbdY}m\xab\xb0V}3\x0f\x22\xe2'Nd\ +\xe6Y\xcc\x8f\x88\xd1);\x99Y\xc3&\xb4\xe23\xee\ +O\xbd\xc9,\x9c\xc4\x01\xbc\xc5\xfe\x88\x18\xae\xceR\x92\ +;\xcb\xbeB}\xa3W\x22b\xb2\xc8\xcc\x96\xd2zg\ +i\x7f\x08{\xf1\x11\xfb0\x8cC\xe8\xc1w\x9c/\xef\ +\x05\x8ec\xb0\xc8\xcc\xaf\x98\x8d\xed\xe5\xbc2\xb3\xb9$\ +\xf6\xa2\x05c\xe8\x8e\x88\x9b%^\xe04\x8e\xe1e\x91\ +\x99m\xb8\x88\xf5\xb8\x85\xce\xa9\x8cdf\x13\xda#\xe2\ +Ye\xac\x0e\x5c.\xdf\xef\x06\x0eV\xbf\xfd\x12\x0cb\ +#\xeebOD\x8cU\xf05\xb8\xa4\x1e\xc8k\xea\x19\ +\xfaB\xe3\x00..\x9dm\xc5=\x5c\xc0\x00\x96\xe2\xaa\ +zf\xbeU9\x7f\x88T\xc4\x16\x95\x02\x9bK\xfb}\ +\x11\xf1\xa3Q\xefos\xf3\x98\x0b\x981\xe3\xce\x00\x00\ +\x00\x00IEND\xaeB`\x82\ +\x00\x00\x02\x91\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x14\x00\x00\x00\x11\x08\x06\x00\x00\x00\xddD\x8c\xbe\ +\x00\x00\x02XIDAT8\x8d}\x93QhVe\ +\x18\xc7\x7f\xcf\xc7>(u\xcb\xae\xc4\xd01\x91\x85|\ +Q\x9a\x9eH\xac\xad\x18\x12\x14\xee\xb2\xb0\xebH(\x1a\ +\x0c\x04a\xdd\x85\x17\x0e\x12/\x82\x04\xe92\xbf`\x22\ +\x08\x0e\xbb\x182%\xb5\xa0\xde\xb352\xa9\x1b\xa9\x8b\ +\xe9\x96\xae\xf8J\xc4\xc2\xfau\xd1\xfb\xe9\xd9\xe7\xf2\xb9\ +9\xe79\xe7\xf9\xff\xfe\xff\x07\xde\x17:J]\xa3\x8e\ +\xa8g\xd5y\xf5\xb6\xba\xa4\xce\xa9\x1f\xa9;;5Y\ +\x87\xfa\xc0\xc7\xb7\xd4\x9b\xea\xd5\x0c|^\xedS\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8\xef\x5c\x0e\x02/\x03#\x11\xd1\ +q\xeb!\xa5\xb4\x1b8\x0et\x03\x83EQ\x94\xed\x95\ +\x89\x88+\xc0\x00\xb0\x19\x98\x00\x86\x80I`\x1a8\xa1\ +n\xcd\xc6\xf56\xb0(\x8a\xb3\xc06\xe0\x12p&\xa5\ +\xd4w/a\xbb\xf2a\xdd\x0f\x8c\xe6\xd5\xbf\x06~\x03\ +\xb6\x00S\xc0\xa1\x88\xb8\xd1\x91\xb4\x96\xd7\xdf\x0b\x0c.\ +\xbfO\xf7\xc1u\xe0\x05`+\xb0\x1e\xb8\x09\x9c\x03f\ +#\xe2\x9f\x954)\xa5\x17\x81}\xff\x02\xe28ya\ +\x96\xfd\xc4\x97\x00\x00\x00\x00IEND\xaeB`\x82\ +\ +\x00\x00\x04x\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\ +\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\ +\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x06\ +bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\ +\x00\x09oFFs\x00\x00\x01@\x00\x00\x00\x00\x00s\ +\x05\xb7\x16\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\ +\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\ +\x07\xdf\x0c\x12\x0e\x1b\x0b$&IW\x00\x00\x00\x09v\ +pAg\x00\x00\x03@\x00\x00\x00 \x00\xbe\xe6\x89Z\ +\x00\x00\x03=IDATX\xc3\xe5\x97MhUG\ +\x14\xc7\x7f'\xba\xf3\xa3`\xa3Q\xb1\xa9-(*\xb5\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4\xfd\xa9\xfe\x0fh\x94\ +\x1a\x05\xed\xa6+V\xfc_`\xfdt\x17\x0f\x01t4\ +\xd8g\x01\xfb\xa6\xbbx\x1d\x80\xa2\xf3\xec\x98m\xd3\xfa\ +\xed\xaf\xbb\x22\x17G\xd3\x0d`&\x80 ?\x02\x9d\x8a\ +>\x11d\x04\xb8\x0b\xdcU\xf4\xc2\xcb\xe8\xc2\xeb-\xff\ +\x03Q\x9bYF6Y\xf5\xec\x00\x00\x00%tEX\ +tdate:create\x00201\ +5-12-18T14:27:11\ ++00:00YM\xe3\xc6\x00\x00\x00%tE\ +Xtdate:modify\x0020\ +15-12-18T14:27:1\ +1+00:00(\x10[z\x00\x00\x00\x00I\ +END\xaeB`\x82\ +\x00\x00\x01U\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xffa\ +\x00\x00\x01\x1cIDAT8\x8d\xa5\x92?K\xc3P\ +\x14\xc5\x7f\xa9\x11%\x8b\x1d\x5c\x5c\x05\x05'\xa1\xdcM\ +\xfc\x02*n\xd9\x5c]\xc5/P\x1c;\xf9=\x1cU\ +\xea\x87\x10\x0eq\x12\xc4\xa5\x11\x8b\xe0\xa6(4R\x9a\ +8\xe4EB\xdaj\x82\x07\x1e\x8f\xfb\xe7\x9c\xfb\xce\xe3\ +z\x922 c6\x92J\xbc\x08\xf8\xc0\x17\xb0\x04\x8c\ +}G\xf6f\x90\x07f\xb6^NH:\x05B3\xdb\ +\x91t\x09\x1cx\xee\x05\xef\x15r\xcbM\xb8\x02\xd2R\ +~\x1b\xd8\x04\xae\x81=`\xc1\x07\x86\xc0\xee\x1c\x0b\xbf\ +\xe1\x0c\xe8\xfb\xc0\xc4\xcc\xe2\xa6lIm \xf5\x8bD\ +\x14E!\xb0_\x93\xff\x9c\xa6\xe99\xe4?Z\xe0(\ +\x08\x82\xc3:\xec$I\x1e\x0a\x81V\xcd\x89s\xf1o\ +\x81\xb2\x85\xa7\xd1ht\x0b,\x03\x9f\x95\xda\x9a;\x8f\ +\xc0[\x96e\xe3)\x81N\xa7s2o\x8a\xa4\x10\xb8\ +\x00\xb6\x80.\xd0\x03V\x9aX\x18\xba\xde\x04\xd8 _\ +\x22\x9a\x08\x0c\x80;\xe0\x1ex1\xb3\x9b)\x0b\x7f\xe0\ +\x158&_\xef\xbe\xa4\xdeOER\x5cS\xa4\xe8_\ +uw[R\xecI\xfa\x00&MD\x1c< \xfe\x06\ +\x8cB^q\x9bC\x89i\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x01\xf9\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x13\x00\x00\x00\x13\x08\x06\x00\x00\x00rP6\xcc\ +\x00\x00\x01\xc0IDAT8\x8d\x9d\xd4M\x88\x8eQ\ +\x14\x07\xf0\xdf\xc3\xe4c\xf0\x8e\xa4\xa4X!a3\xf9\ +*55)!\x0b\x1f\xb1bMYH\x0a)+\x91\ +\x22\x89a%I\x16^5Y\xf8JV>J\x91G\ +Y(\xb11,$\xe3{2\xc64bq\xcfSO\ +\x0f\xaf\xf7\xcd\xa9[\xb7s\xcf\xfd\x9f\xff\xf9\x9fso\ +\x96\xe7\xb9\x16\xac\x1b\x07\xb0\x10\xef\xd0\x83S\xf8U\x0e\ +jk\x01h#.E\xec\x10f\xe1$j8T\x0e\ +\x1c\xd5\x04h-.\x22\xc3\x0eL\xc4\xb2\x00\xdd\x8b\xb1\ +\xad\x82M\x93J\xc9\xb0\x05\xa7\xf1\x13\x0fbM\xc2\x8c\ +\xf2\x85fe\xce\xc58|\xae$\xe9\xc40\xde6c\ +\xb6\x14O#p\x00\xe70=\xce:p\x0d\x93q\x16\ +\xdf\xfe\x05\xb6\x1a\xb7\xb1\x00/\xf1\x15\x1b$}j\xb8\ +\x89%\xb8\x87=U\x16e\xb05\xb8\x82v\x1c\xc4l\ +I\x93\xed\xb8\x80\x1b\x92\xf8O\xa4\xc6\x0c6\x02\xebB\ +/\xc6`\x1f\x1e\x06\xab\x13\x18\xc1\xf9\x88y\x8c\x15\xf8\ +R\x05\x225`\x1e\xae\x07\xa3\xfd8\x82\xc5\xd2@n\ +\x8b\x05w\xb0\xbe\x11P\x01v\x5c\x12\xf6(\x0e\x87?\ +\xc7|l\xc2L<\x0a\xe6#q^\xc3\x1c\xbcF\x7f\ +\xb9\xcc\xe5\xf8\x18\xac\x0a\x1b\x8d]\x18\x8f\xab\xa8\x97\x80\ +`w$\xe1\ +M\xd9\xf9\x1b\x87\xd0i\x8b\x22\xfc\x9f\xfe\x00\x00\x00\x00\ +IEND\xaeB`\x82\ +\x00\x00\x02\xbf\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x16\x00\x00\x00\x13\x08\x06\x00\x00\x00\x94y\xfd\x88\ +\x00\x00\x02\x86IDAT8\x8d\x8d\xd4]\x88\x97U\ +\x10\x06\xf0\xdf\x7fQ\xd0B\xdb2)\x08D]\xc9B\ +\xec\xa6!\x03\xa3\xb2 \xd1J(\x0d#\x13\x14\x0b\x8b\ +\xc0\x82\xad\x9b0\x0a\xa4@\x906BJ\x141\xb0 \ +$\xfb\xf0\x22r\xefV\xcc\x14fS\xe8\x036HJ\ +J\x0d!\xdd\xf2\x03#\xda.\xceYx\xf7M\xc9\x81\ +\xc3\xcb{f\xe693\xcf|t\xb4$3\xc7\xe1s\ +\x04\x0e\xe3B=k#\xe2\xf7js5^\xc63\xf8\ +\x0bK#\xe2@\x13\xa7\xab\x0d\x8c\xf9\x98\x80)8\x8e\ +\x07\xb1\x0c\xab*\xe8t|\x85n\xf4\xe0\x05\xack\x83\ +\x5c\x0a\xf8Z\x1c\x8d\x88\x11|\x8a\x91z\x7fCfN\ +\xc3\x00\xfa\x22\xe2\xb9\x888\x83\x1f0\xf5J\x80\x7f\xc5\ +4\x88\x88\xdd\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,\x08~\ +\xee\xfe\xfb\xe6&\xa9t\xba\x06\x98RRT\x14\x85E\ +\xa3QB\xa1\x10cc\x0fP\xea!ss\xf3\x8d\xc0\ +[%E\xac`\xac\xaa\xea(\x03\xfd\x97\xa9\xac\x8ca\ +\x18\x06\xd9l\x96\x89\x89\xc9#\xc0\xb4\x92\xe2pA\x18\ +@<\x1e\xffxu\xa0\x7f\xa3\xa1\xbe\x9e\xc7O\xc6y\ +\xf6\xfc\x05s\xf3\xf3\xd5A\x10\xcc*)\xaa\x0b\xc2\x80\ +\xd7eeeM\xb6\x9d\xd0\xdd\xdd\x16\x87\xa2QV>\ +\xaf\x90L>\x8a\xe5\xf3\xf9i%Em!\x18V\xc2\ +v\x80\x86\xd6\x96\x96doo\x0f\xef\x16\x17I\xa5\xd3\ +8\x99L,\x97\xcb\xa5\x94\x14\x8d\xbb\xc6~\x81\x9e\x95\ +\xb0\xadxm\x9a\xe6\ +\xd3\xad\xa6\xd0V\xb1\xb4\xe408t\xad\x02\xf8\xe7\xa1\ +\x1e\x88Dp2\xefY_\xfff\x9c\xea<9\xee\xba\ +\xee~\xd34\x93;0\xcf\xf3\xf0<\xef_\xce\x8ed\ +\xb3Y\x06\x87\xae\x97^\xbaxA\xba\xae\x1b6M\xf3\ +\xfe\xd6?\xfb\x1f\xe9\xfb\x01\xfd\x9c\xd6\xcao\xa8\xd4\xb1\ +\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\x5c\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0c\x00\x00\x00\x0c\x08\x06\x00\x00\x00Vu\x5c\xe7\ +\x00\x00\x01#IDAT(\x91m\x90?(\x84\x01\ +\x18\xc6\x7f\xef\xe7\x9b.\x03\xc9\xec\x06\x8aA\xc8`P\ +$\xebe0\xd8t\x03\x83\xc5`30;\x93U\xf9\ +su\x06\x8b\xc5\x22euJ1*\x97l\xca \x94\ +\xae\xfcI\xfd,\xdf\xe9K\x9e\xf1\xe9\xfd=\xcf\xd3\x0b\ +\x99\xd4.\xb5\xa2\xde\xa97\xea\xadZW\xcbjB^\ +\xea\x88\xdaP\xb7\xd5\xc9\x9c_T\xab\xea\x89Z\xc8'\ +7\xd4!u\x8d\x7f\xa4\xae\xaa5\x80P7\x80\x01\xe0\ +\x1c\x98\x02\x8e\x80\xb3\x88x\xf8\x03\xdd\x03s)0\x03\ +\x8cEDS\x058\x05Jj\x118\x88\x88[\xb5\x1b\ +\xa8\x03\xb3)@D4[I\x11\xf1\x08\xec\xa8)\xb0\ +\xac\xf6\x03\x83@\x15XJ\x80\xb6\x5cs\x9a\x03\xbf#\ +b\x0b(\x01_\xc0\x07\xf0\x91\x00\xcfY=@\xaaF\ +\xb6\xb9S]\x07\x8e\x81v`\x02\xb8\x0e\xb5\x0c\xcc\x02\ ++\x999\x0c\xbc\x00\xef\xc0nD\xbcf\xe0<0\x8e\ +\x9a\xa8\x97jM\x9dV7\xd5\xbe\xdcw:\xd4\x0bu\ +\x11\xa0U_\x00\xb6\x81\x1e`\x0f\x18\x02\xde\xb2\xdd\x0b\ +@%\x22\xf6\x7f\x81\x5c\xdah6\xaf\x17\xf8\x04\xae\x80\ +\xc3\x88xj\xdd\xfc\x00\xa7\xf6\xbd\x96\x10\xb6\xbf\xd9\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\xd0\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x14\x00\x00\x00\x10\x08\x06\x00\x00\x00\x16\x18_\x1b\ +\x00\x00\x01\x97IDAT8\x8d\xad\xd4\xcf\x8bOQ\ +\x18\xc7\xf1\xd7w\x9aIJ\x8a\xac\xfc\xc8ld$\x0b\ +\xd33ca!ij\xa2\x99\xd9XY\xda\xd9Q\x9a\ +\x85\xc2\x1f )Jb\xa9l\xa7(EJ\x84,\x1e\ +\xc2\x86\x155\x89\x05\x9b\xafh\xfcfq\xcf\x9d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1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x08\x00\x00\x00\x0d\x08\x06\x00\x00\x00\x94\xc2/8\ +\x00\x00\x00\xd1IDAT\x18\x95]\xd1\xbf/\xc3a\ +\x10\xc7\xf1\x97'\xd5\xc9h\x11F\x83\xe8\x82\xa4\xb1\x96\ +\x8d\x8dAl\x9a\x0e\xfe\x83\xae\x1d\x18\xc4`\xa71\x1b\ +\x0c\x12\x8b\xc9`\xd3\xe1;t3h\x18-\x12\x93(\ +\xea\xc7\xe0\x9e4\xf5I\x9e\xdc=w\xef{\xee\xc9\xdd\ +XQ\x14B\xab8B\x05\x1d\xec\xe01Er\x06\x97\ +X\xc01^q\x81R)\x80\x06&\xd0\xc7\x1efq\ +\x8b\xad\x0c\xac\x87=\xc7s\x9c;l&T\xb1\x14@\ +\x17\xe5\xf0oPM\xd8\xc5x\x04\x9b\x86\xeaa*\xa1\ +\x15\xbd\xa1\x8d\x8f\xf0\xdf\xf0\x95\xf0\x84\x83H\x9c\x18\xd5\ +K\xfe\xe4!~\x02\xce\x9aF/\xcf\xe1\x1d\xfb\xff\xaa\ +\x17\xd1\xcd\xc0<\xceP\x8f\xfb$Vp\x9d[\xdcc\ +\x19\xdb\xf8F\x0d\x0f\xb8\xca/|b\xcd\xdf\x0eN1\ +\x87\x0d\x0c~\x01]'-R\x7f\xd2\xe3\xe9\x00\x00\x00\ +\x00IEND\xaeB`\x82\ +\x00\x00\x01~\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0f\x00\x00\x00\x10\x08\x06\x00\x00\x00\xc9V%\x04\ +\x00\x00\x01EIDAT(\x91\x85\xd2\xbbjVQ\ +\x14\x04\xe0/\x1a\xa3h\xe5\x05A\xd0\x17\x10\x04\x85\x05\ +\xa6P\x10D\xb0\xb5\xb0\xb2Jc\xa1\x9d\x85\x8d\x01\xb1\ +\x15\x1b\x0b\x11\x0b\xf1\x15\x22v\xa9,l\x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xcc)k(e\x9dp!\xa0\xcb\x1e\xaf\x8a\x10\ +d\x0b\xbdv\xbd\xf2\xe7\x22\xe6\x81#\xb9B/\xe3\x13\ +\x93\xb6?\x1aPT\x03\xd2\xb1C\xf1\xe2\xf8\xc4\xa4\x07\ +\x9cg\xb7p\xb5[\x8c\x8dOL\xce\x1aR\x05\xb4\xf3\ +6@W\xc8\xfb\x11\xb0O\xed{\xe6\x0b#mH\x8c\ +\x00\x0fBs\xb1\xc0\xf9n\xb6\xbb\x9bp\xc9\xee\x13\xf0\ +\xeeWh4\xea\x1b\xae\x1b\xfb\x18\x1dN%\xb3a\xc2\ +\x9c\xee\x11\xf0-0\x80~v\x934\x97\xec\xdf\x1bU\ +5\xb4\xb3\xda\xfaP\xa2\xdf\x8c\xdb^u\x99`E\xbc\ +\xe7F\xce\x8c\x8eqj\xf8,\xdd\xdd)\x84\xb3\x9b\xba\ +\xa5R(\xd9\xe0\xde\xec\x0c\x99l\x9e\x9eb\x1f\x8e\xe3\ +\xea\xa7O)\xa4\x94T\xca\xf7\x00\xe8\x1f\x18\xc2q\x1c\ +\x84\x10\xbe\xd7I)Y\xf5\xaa\xccLO\xb10w\x97\ +g\xf8_\xe1\x1f\x16\x8f\x0dW\xeaa@l\x00\x00\x00\ +%tEXtdate:create\ +\x002015-12-18T14:2\ +7:00+00:003\x90\xe8\xec\x00\x00\ +\x00%tEXtdate:modif\ +y\x002015-12-18T14:\ +27:00+00:00B\xcdPP\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01\xa9\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0f\x00\x00\x00\x0e\x08\x06\x00\x00\x00\xf0\x8aF\xef\ +\x00\x00\x01pIDAT(\x91}\xd2\xbbk\x94Q\ +\x14\x04\xf0\xdf.A\x22\xd8\x88O\xb0\xf0Q\xf9\x8a\xa8\ +\x1c\x9bhaa\x1b%\x01\x11\x8b\xfc\x01\x06A1+\ +\x096Z\x88HH\x0am\x04\x03*ha\xe3\xa3\xb3\ +\x08\x98*\x12\xe5@\x1a1\x08V\x0a\x8a\x06\x82b*\ +\x1bS\xec\xfd`\xf7#\xe4\xb4wf\xce\xcc\x9c\xdb\xb0\ +\xc6d\xe6~\xdc\xc1!\xbc\xc3XD\xfc\xaa\xe3\x1a5\ +R?n\xe2\x046w<\xfd\xc4\x5c\x11\xf9\xd2E\xce\ +\xcc\xb3h\xe1\x186\xad\xe5\xa6\xcc2>\xe0VD\xbc\ +od\xe63\x0ca\xe3:\xa4\xfa\xfc\xc5\xedj\xf30\ +\xae\xe10z\xd6!\xfd\xc1|\xd9<_\x01\xdf\xe2\x22\ +\xbea7\xfat\xf7\xb1\xac]\xdc\x06|\xc5Ghf\ +\xe6,\x16\xf1\x19\x17\xb4s\xdf\xc0',\xe15NF\ +\xc4\x00\x86\xb1\x05?2\xf3IO\xb1q\x14\xc7\xb1'\ +\x22\x16q73\xa7\xb0-\x22\xbew88\x82\x83X\ +\xc1\x5c\x95\xb9\x17\xafp\xaaX\x1a\x89\x88\x85\x8a\x91\x99\ +\xe70\x89\xed\x98\x8e\x88\x1642s\x1c\xa3%\xcb%\ +\x9c\xc6\xf5\x92\xff)\xae\xe0\xbf\xf6)\x9b\x98(\x9ac\ +M\x0c\xa2\x17/\xb1\x10\x11\x13\xd8\x81\xc7\xa5\xc4\x91\x88\ +\xd8\x1b\x11/0S\xca\xdd\x89\xf3\x95\xed\x03x\xa8}\ +\xaa\x07\xe5\x14\xff:lo\xc5=\x0c\xe0\x0d.G\xc4\ +R\xfd{\xee\xc34\x02\x8fp\x1fS8S\x9c]\x8d\ +\x88\xdf\x15\xbe\x8b\xdc!\xb2\xab\x88\xf4\xe39Z\x11\xb1\ +R\xc7\xad\x02\xcc\x87tf \xe3\x97\xea\x00\x00\x00\x00\ +IEND\xaeB`\x82\ +\x00\x00\x01\x04\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x08\x00\x00\x00\x0d\x08\x06\x00\x00\x00\x94\xc2/8\ +\x00\x00\x00\xcbIDAT\x18\x95]\xd0!K\x83a\ +\x14\xc5\xf1\xdf\x1e\xa7\xc5j\x19[\xb1\xc9\x92\x22\xab\x82\ +\xc1\xb0\xa8\xc1l\xda\x17\x10\xeb`\x03\x0d~\x82\x81\xb2\ +:0\x18\xd6V\xdc\xa2\xe1\x05WDP\xd1\xb8\xe2\x07\ +\x105\x18\xde\xfb\xe0\xf0\x94{9\xfc9\x97{*E\ +Q\xc0&\xae\xb0\x87G\x9c\xe2\x0e\x12\xaa\xb8\xc57\x06\ +\xd8\xc6\x18\x8d\x0c\x1c\x87\xd9C\x1f\x9fXG'\x03G\ +x\xc2=>p\xa3\xd4A\x06Z\x98\x86\xb9\x86y\xec\ +\xbbh%\xd4\xf0\xeaOg1W\xd1IX\x89\xbb\xf0\ +\x15\xdf\x08\xaf\x9b\xe2\xee\xb2\x06\x01^`\x91\xf0\x8c\xfa\ +\x12\xb0\xc09.E\x07\x0f\xd8\xf9\x97\xd2\xcfK\xc2\x04\ +\xfb\xd8\x08\xef\x04#4s\xc2\x04o\x119\xc3\x10\xef\ +x\xc9\x09?8\xc4\x16\xae\x95\x85\xb5\x95\xd5\xfb\x05\x08\ +|+}\x8e\x949\xf5\x00\x00\x00\x00IEND\xae\ +B`\x82\ +\x00\x00\x06\x1d\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\ +\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\ +\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x06\ +bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\ +\x00\x09oFFs\x00\x00\x01\x00\x00\x00\x00\x00\x00|\ +]\xbdz\x00\x00\x00\x09pHYs\x00\x00\x0b\x12\x00\ +\x00\x0b\x12\x01\xd2\xdd~\xfc\x00\x00\x00\x07tIME\ +\x07\xdf\x0c\x12\x0e\x1b\x00\xb3\xf4\x90\xdf\x00\x00\x00\x09v\ +pAg\x00\x00\x02`\x00\x00\x00 \x00\x1f=\x87\xd8\ +\x00\x00\x04\xe2IDATX\xc3\xed\x97YlTU\ +\x18\x80\xbf\xdb\xb9C;3]fa\xe8\x02\xb4@\x99\ +.\xd0R*\xb4\x104b\xc2\xea\x86\x18\x97 \xea\x83\ +F4\xfaf4F_\x5c\xde$\xf2\xa0\x0f&FE\ +\xe2\x83\x01#\xa6\x88@@)E\x81\xcaRZ\xbaP\ +\xbaP\xa4\xdbl\x1d\x0b\x85v\x98i;\xbd>\xdcs\ +\x87)\x9d\xa5`|\xd2?\xb99\xe7\xfc\xe7\xfc\xe7\xff\ +\xce\xb9\xff\xf9\xcf\xbd\xf0_\x17\xe9^\x0d\x93S\x0cX\ +\xac3\x99\x91\x9c\x82N\x96\x19\x1f\x1b%\x18\x08\xf0\xd7\ +\x80\x9bP(\xf4\xef\x00\xd8\xecY\xcc\xce\x9d\x8f}V\ +6\xf6\xac\xd91\xc7\x0dx\x9c\xf8\xbc.\xdc\xfd\xbdx\ +\x5c\xbd\xff\x1c \xddleaa\x09\x05\x8b\xca4\xd5\ +\xeb\xc0\x9b\x80#\xca\xf03\xc0\x0f\xc0\x1e\xa0\xbf\xf7j\ +\x17\xed\x17\xeb\xf1y\xdd\xf7\x06`\xb6\xd8\xd8\xb0i\x0b\ +RR\x12\xc0W\xc0f \x1d\x98\x00\xde\x07N\x01)\ +b\xae\x5c\xe0\x9b\x08\xf3s\xc0c\x80\xf7\xf7_\x7f\xc6\ +\xd9w\xf5\xee\x00\xcc\x16\x1b\x1b7o\x05\xb0\x00>\xe0\ +i\xa0J\xeb\xbf\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xca\xe2\xa5\x95\xc8z\ +\xfd*\xa0\x5c\xcc]\x90=;7\xee+\x8by\x19\xb5\ +_l@Q\x14'j\x04k\xcf#\xc0!`g^\ +~!\xa5\xe5+\xd8\xf0\xc4\x16\x16\x95UX$I\xda\ +. O\x01%b\x9a]\xf3\x1d\xc5\xe8d9&@\ +\xdcO\xb2\x0c\xb3\x15{f\x0e\x06\xa3\x89\xa4$\x1d\xc5\ +K\x96i\xbbQ\xad(\xcaZI\x92@M\xb1;\x80\ +\x00\xf0\x22\xb0W\x98\x97\x00\xcd\x80Ts\xb8\x0a\xcf\x1d\ +\xe7?n\x0ch2t}\x90!\xf1\x09\x96\xb7\xa0 \ +\xb2k\x8d$I_\xa2\xde\x8a\x00\xfb\x80'\x01.5\ +\x9d'\x10\xf0\x93_X\xd2\x92\x9ea\x91n\x0c]c\ +\xc0\xe3\x8a\xe9#.@\xa4\x0cx\x5c\x8c\x8f\x8d\x22\xeb\ +g\xecB\x8d\x8dm\xa8A\xfa(0\xd8\xd1\xda\xc8\xd5\ +\xae\xb6p\xc0u_\xe9\xc0QTJg[3\x13\x13\ +\xb1\x7fT\xee\xea\xc7\xa4l\xf9*\x1cE\xa5\xc8\xfa\x19\ +a]wW;]\x9d\xadSR\xect\xe5\xae\x7f\xcd\ +dY\x8f=3\x1b\x9dNf\xc0\xeb\x22\x18\xb8uO\ +\x8e\xff\x17M\xfe\x06<\xc9\x9b\xa3b\xcb\x06=\x00\x00\ +\x00%tEXtdate:creat\ +e\x002015-12-18T14:\ +27:00+00:003\x90\xe8\xec\x00\ +\x00\x00%tEXtdate:modi\ +fy\x002015-12-18T14\ +:27:00+00:00B\xcdPP\ +\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01Z\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0e\x00\x00\x00\x11\x08\x06\x00\x00\x00\xed\xc8\x9d\x9f\ +\x00\x00\x01!IDAT(\x91\xc5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\xd3}\x0f4\x0d\xe3\xfc\xadj\xb5\xba\x02\xd0\ +\xfa\xd1\xfa\x18\xc7\xbf_\x9c\xadTF\xe6\xe6\xe7\x94H\ +q\xb7^W\xeb\x82\xe0S\x0e`tt\xec\xb8\xe4A\ +\x10\xe4<\xcf#_(\x0c\x88\x14\xfcgi\x9a\x16\x0f\ +\x88t\x1c\xe7A\xea\xfb[`?\xb9\xefr\xc2\xf6\x13\ +>\x04\xdc\x90\x8d\x7f\x00\xbf\x16\xa5`bD\x0f\x81\x00\ +\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01}\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x14\x00\x00\x00\x10\x08\x06\x00\x00\x00\x16\x18_\x1b\ +\x00\x00\x01DIDAT8\x8d\xad\x93A+DQ\ +\x18\x86\x1f#\x8d\xc8l\x94\x14QC\x16\xa2,N\x83\ +\x8d\x8dbJI\x8d,X($\x14\x0b!)%;\ +eq\xcb\xf0c\xf8\x09\xde\x95\xad\x85\xb2\xb1\xb1`c\ +cc\xe1\xbb:\x9d\xb9\xf72x7_\xefw\xcf\xf7\ +\x9c\xf7\x9e\xd3\x81\x14I:\x95\x94K\xfb\x9e\xa6\xc4\x01\ +I\x1d\xc0!0\xf7/@`\x15h\x02v\xeb\x056\ +\x84\x0d\xfb\xcd\x07\xa0\xc7Z%\xe7\xdc\xed_\x12\xcex\ +0\x80\xbdz\x12&\x017\x03_\x91\xd4\xfb+\xa0\xa4\ +\x22P6\xfbl\xb5\x11\xd8\x0e\xd6\x95$u\xfd$\xe1\ +\x06\x9f\xe7\xfa\x0eL\x02\xaf\xd6_\x97T0\xd8(p\ +\x03D\x99@Iy`\xc5\xec\x95s\xee\xce\x1bj\x03\ +\xd6\x0cv\x0d\x14\x80yI\xd3Y\x09\x17\x80v\xe0\x0d\ +8\xb3^\xe4\xa5\xdc\xf7`\xb1\xaa\x92\x9a\xd3\x80\xf1e\ +\x5c8\xe7\x9e\x00\x9cs/^\xca\xce\x00\x06\xd0\x0f\x1c\ +\xd4\x00%\x8d\x00\xe3\x96\xe6<\x18\xf2S&\xe9HR\ +_\x98p\xcb\xea=p,i\xca6\x9a\x05.\x81\xc7\ +\x0c`\x1e\xa8~\x01\xed\xf6\x96\xcc;`\x07\x980?\ +\x06,\x02\xc3\x19@\x80\xb2\xa4J\x9cp\x19h\x09\x16\ +\x14\xad\x0e|\x03\xf2\x15Ij\xcdQ\xfb2\x00\x06\xad\ +\x0e\xd5\x01\xec\x06N>\x00o\x01\x5c\xe2;\xefo\xbb\ +\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01u\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0b\x00\x00\x00\x10\x08\x06\x00\x00\x00\xc0\xbd\x85~\ +\x00\x00\x01\xcfy\xce=g\xa2!\xc9n\x5c\xc3!\xfc\ +\xc2F\xfc\xc0\xcd\xaaz\xaf\x13\x1eO\xf22\xc9i\x1d\ +\x92\xcc%YJr\x0e&I\xb6c\x11g\xaaj\xc5\ +\x14\x92l\xc6s\x5c\x18p\x19\xb7\xd6\x13BU\xfd\xc6\ +%\xdc\x18p\x0cO\xd6\x13v\x05\xaf\xb1m\x06?\xab\ +j\xb5\xb5\xdc\x87\xa3X\xc6a\xec\xac\xaag\xad\xe6\xdb\ +\x80\x17IN\xb5\x87\x19\xdci\xe7>\xb64\x93\x03X\ +\x19\xf0\x10\x0bIf\xab\xea\x03\x96\xb0\x80/U\xf58\ +\xc9&\xdc\xc5\xed\xa1\xaa\xfe\xe2js\xd3\xfe\x7f\x11\xef\ +Z~\x1d\x0f\xaa\xea\xfb\xd0\x06x\x85!\xc9\x0e|\xc5\ +,\xc6\xed\x9c\xc0S\x18\xba\xa1\x971\xdfo!\xc9A\ +\xbc\xa9\xaa\xb5q\xa0\x11\x8fp\x0f[\xb1\x17Gp\x12\ +WF\xc1d\xcai\xb1\x85k\xed\xdeSUs#\xdf\ +;\xc3.\xec\xef\xf2?=9-\xfe\x88U\xfck]\ +7\xf4\xe40%>\x8f\xb7\xf8\x8cO8\xdb\x93\xff\x01\ +?\x07g7v\xdb#C\x00\x00\x00\x00IEND\ +\xaeB`\x82\ +\x00\x00\x01\x03\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x13\x00\x00\x00\x11\x08\x06\x00\x00\x00?\x98\x97\xc7\ +\x00\x00\x00\xcaIDAT8\x8d\xed\xd2=J\x03Q\ +\x14@\xe1od2\xa6\x11W\x90F\xec\xd2Y\x84\x08\ +.!\xe0\x02DHe\xe1n\xa6\xb2Nm'$\xa5\ +\x16YA\xba\xb1\xb0\xb1\xc8\x16\x04GL\x8a\x99\xe0\xf8\ +\x08f^\xb4\xf4\xc0\xe5\x15\x17\xce\xbb\x7fIQ\x14\x0f\ +\xb8\xd0\x9e\x15\xae1\x0b\x13)Fx\xc6\x02\x07;D\ +=\x0cq\xba-\x99\x22\xc1\x13n[Tu\x82\x17\x5c\ +\xa1\xdfp\x1ca\x99\xb6\x104\xf9\xa8\xdfA\x1d\xdf\xd8\ +\xd5V\xc8\xab\xaa\x930\xee\xf0\x16+\xfb\x89\xf7\xb0\xcd\ +.&\xf5o1\x9cQ\x0d\xaf\xc9\xa1j\xbb\xe3H\xd9\ +\x14\xf9\xb6\x05\x94\xb8\x8f\x94\x1d#\xff\xcb\x99Eo\xf3\ +_\xf6%\xfb\xfc\xa5\xa7D\xb69\x8dKt\x90\xed)\ +K6\xb29\xceq\xd3H\xae\xf6\xa8\xecq\x0d\xfe\xb1\ +\x1c=z\xc7\xebp\x00\x00\x00\x00IEND\xaeB\ +`\x82\ +\x00\x00\x01)\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x12\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1b\x06/\x5c\ +\x00\x00\x00\xf0I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03\xd71\x97d\xe5\xc0\xd0kA'\ +1\xd7\x01\x85W\xb8\x8f\xdb\xad\xdaDU=k\xbc7\ +\xb1\x11\x87\xd1kC_`\xff\x02\xd0\xae\xf8\x88\x9dU\ +\xf5=\xc9\x1a|@\xf0\xb4\xdf\x00G\xb1\xef\x1f\x80\xb0\ +\x15\xe7\x9a|\x19>\xf9\xb5\xe4m\x83?\x9d\xd6\xfa\x8a\ +\x7f\x88\xf3IF\xaa\xea+\xae\xe0=FzIV\xe0\ +\x0b\xd6/\x01\x0a\x8f\xaa\xea\x10\xbf\x97=\xd6Kr\x04\ +\x0f\x97\x08\x1c\xc4xU=\x1f\x1c\xfa8\xf1\x9f@\xb8\ +\xd5\xbc\x18\xfc\x049\xa0\x7f\x85\xe9\xdfLL\x00\x00\x00\ +\x00IEND\xaeB`\x82\ +\x00\x00\x01\xb8\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x11\x00\x00\x00\x12\x08\x06\x00\x00\x00\xbd\xf95T\ +\x00\x00\x01\x7fIDAT8\x8d\x95\xd3;hTQ\ +\x10\xc6\xf1\xdf\xbd((jv;\x05+\xc1\xad\x04!\ +0\x8d\x8d\x16\x82\x88H*A\xd2\xd9\xf8\xa8\x04\x1b5\ +\x82\x9d\x06;\xed\xc4B\x10\x0b\xedl$\xb0`e\x93\ +\x22\x0e\xda\x1bS\x89/\x10\x82\x16\xc1g\xb4\xc8\x89\x5c\ +\xd7\xbb\xbbf\xe0p\x98\xef|\xe7\xcf\xcc\x1cN\x95\x99\ +\xbd\x88X\xb4\xc1\xc8\xccI\x5cA\xa7\xca\xcc{\x98\xc6\ +\x02nF\xc4\xa31\x97\x8f\xe1\x01:E\xba[ef\ +\x0f/\x1b\xbek\x11qu\x0ch\x19\xdd\x92\xee\xadK\ ++\xcbE\xf8\x85'c\x00w\x0a\xe03>F\xc4R\ +]\xce\xfa\x98\xc3\x0f\xf43\xb3;\x04p\x02\xa7\xf18\ +\x22:8\x05\xeb\x903\x11q\x1c\xfb\xf0\xd5\xda|\x06\ +\x01{p\x1f\xd7#b\x0a\x22b\x0e\xaa\x16\xf3v<\ +\xc3+\xac\xcf\xa6\xc6C\xcc\xb4\x0d\xfe\x1fH\x03\xf6\x0d\ +\x9b\x1b\xd2\xdb\x88\xd8\xdd\xe6\xad\xdb\xc4\x12+\x03\xf9\xf7\ +a\xc6Q\x90\xff\x8eQ\x90\xc1\xb3m\x1b\x82d\xe6I\ +\xac\xe2ic\xc9\xcc\x1bm\xfe\xb6\xd7\x99\xc5y\xf4\x22\ +\xe2]C\xdf\x82\xf7\xd6\x9e\xffhD\xac\xfeUIf\ +\x1e){\x1f\x971\xdd\x04@D|\xc1A\x1c\xc6R\ +f\xee\xcc\xcc\x99?\x95d\xe6\xa7R~\x17\xb7\x22\xe2\ +\xc2\xb0\xfe3\xf3\x1cn\x17\xffJD\xec\xa8\xca\x97~\ +^<\x1f\x22b\xd70@\x81L\xe05&\x8at\xa0\ +\xc6\xc5\x86gkf\x1e\x1a\x05\xc1$\x16\xf1\xb3\xe4\x97\ +\xaa\xcc\x9c\xc7\x1b\xccF\xc4\x8b1\x80fE\x9bp\x16\ +\xfb\x7f\x03$D\x8d]u\xca0\xbc\x00\x00\x00\x00I\ +END\xaeB`\x82\ +\x00\x00\x04\xe6\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a Set object h\ +eight 1\x0d\ +\x0a \ +\x0d\x0a \x0d\x0a \x0d\x0a \ + \x0d\ +\x0a \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x01h\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x0c\x00\x00\x00\x10\x08\x06\x00\x00\x00\x22a\x9e\x07\ +\x00\x00\x01/IDAT(\x91m\xd2!H\x9dQ\ +\x14\x07\xf0\xdf\xf7=\xf0\xa5!\x82\x93\x85\x85\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A\ +\x14\xc6\xf1\xdf\xae\xcd\x8d\xd7H\xd8\x88\xc6&tJ\x89\ +B\x22\xdb)t(\x84\x8f\xe0\xa5\xf09T:\x85\x1a\ +A\xa3Pjt\xbe\x00\xb2\x05\xd1\xa0\x14B\x16\xbb\x89\ +(\xee\xacl.\xb9w\xb3JOu\xe6\xccs\xfe9\ +3g2\xb9J\xa5r\x8e)\xed\xe9\x18\xcb\xa8A\x01\ +\xe3a\xe3\x05\xcf(\xe2!\x050\x84W\xf4a\x01\x07\ +\x0d`!\x18\xea(a\x04\xdb(\xa7\xc0\xf6\xb0\x8f+\ +\x9c\x06\xe0!\x96\xf2\xc1P\xc5S\xabg\x0b\xba\xc5l\ +\xa8\x9b\xc7Q>\xdd\x9f\xa9kl\x84x\xae\xf0\x8b\xa1\ +\x88\xc5\x14@)\xb1\xde\xc5\x16\x06\x92\xb0{\x9ca\x06\ +\x11z\x9a\xf6\xde\xf0\x8eK\xf1}5\xf4)\x1e\xc8\x0f\ +\xd8#VS\xbaJU\x12\xd6\x8b\x15td\xd4U\xb1\ +\x83\x8f\xe6dr\x00\xa3Xo\xa1\x895Lfu\x06\ +w\xd8\xcc\x80\x95\x91K&\xff\xfa4\xfe3\xac\x0b\x83\ +m2\x22\xf1\x0f\xf2=\xcdH\xfc\xedT\xd1\x89\x9b\x0c\ +\xc00&\xc4\xef\xb1?\xd4\xd4\x0a\xb8\xc0t\x00F\xc1\ +<\xd6BG\xddMq\x1d'_\xecY0\xc6f\xd8\ +\x84\x84\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x01/\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x08\x00\x00\x00\x10\x08\x06\x00\x00\x00+\x8a>}\ +\x00\x00\x00\xf6IDAT(\x91m\xd0=+\x86\x01\ +\x18\xc5\xf1\xdf\xf3\x84\xb2\xb0\x89\xf4$\xe4\xa5\x8c\xae\x12\ +\x8b\x922\xd9\x18\x14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 +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00\x12\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1b\x06/\x5c\ +\x00\x00\x01\xd5IDAT8\x8dm\xd3M\x88\xceQ\ +\x14\x06\xf0\xdf;\xc6\x82)\xb10jl|5\x92\x8f\ +1u\x94\x90\x95\x95\x9a\x94\x12j2\x09[\x1a6,\ +H6\xa3|\x84\xcd\xa4h\xb2\xd1\x88\x99\x85\xaf\x86\xa4\ +\x88l\x8ef\x8a\x15K\xb3@hR\x94\x91X\xbc\xd7\ +\xf4\xce\xbf9u\xeb\x9e\xf3\x9c\x9es\xces\xef\xa9e\ +\xe6\x1cl\xc3hD\x8c\x9b\xc12\xb3\x0fK\xd0\x1d\x11\ +\x7ff\xca\xa9e\xe6\x03\xcc\xc5j\xb4G\xc4Df\x1e\ +\xc2A\xec\x88\x88\x8f\x999\x86\xa5h-g/\x1eF\ +\xc4\xdb\xffDMh\xc7\x1d\xfc\xc5\xfc\x12_\x8cuh\ +)\xfe0\xceD\xc4/\xdc,\xd8\x93\xc6\x8e\x9a\xb0\x1f\ +[\xf1\x1c\x9b!\x22N\xe3\x18\x96\x97\xbce\xf8Z\xee\ +\xdf\xb0\x16\x9f\xa7\x11E\xc4\x8b\x88\xd8\x8d\xe38\x95\x99\ +\x07\x0a6\x80\xdd\xe5\xde\x82\xef\x99\xb9\x08kp\xf6\x7f\ +\xd1)\x8d\x1a\x9d\xcc\x5c\x88\x07\x18\x88\x88\xfe\xcc<\x82\ +\x11\x5cB?\x8e\xe2bD\xdc\xcd\xcc\x1az\x8b\xb6\xe7\ +\xa6\x11\x15\xb2\x16\xdc\xc6c\x5c+z\xacG'\x86\x22\ +b\xa4\xe4m\xc1u\x0caC\xad\x04[\xd1\x19\x11\x8f\ +\x8a?\x1b]\x111\xdcP`\x05\xc6\x11\xd8\xa4\xfee\ +6b\x14\xef\x9bK\xde\x05tg\xe63L\x94Xo\ +\xa5\xd9\x85\xb8\x887x\x8dA\xcc\xc3J\xdco$\x1a\ +\xc3\x95\x88\xf8\xdd\xd0EG\xe9b\x01\xda\xcah7*\ +\x05\xdeR\x11\xbb\xa2\xd5N\xec\xc2>u\x91g\xe1G\ +\x19\xe9\x9e\xfa\x83L\x15m\x9a\x81\xa0\x96\x99'\xd1\x83\ +\x9e\x92<\x88=\x11q\x19?q\xb5\xe83e\xd5\xe7\ +\xefB\x1f>\xa8\xaf\xc7d\x03\xf6\xb2h\xf4N\xfdC\ +\xdej\xdc\xbbf\xd3m;V\xa9/\xe7d\x05\x9b\xc0\ +y\xf5\xbd\xec\xa8.ou\xb4\xc3h\x8b\x88\xb1\xea\xc8\ +\xea{\xd8\x87/XQ\x05\xa7uT\xf4\xf84\x03\x09\ +\x9c\xc0\x19<\xc5\xab*\xf8\x0f\xdd\xdb\x9d,w\xcc\x1f\ +\xb4\x00\x00\x00\x00IEND\xaeB`\x82\ +\x00\x00\x04\xe9\ +\x89\ +PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ +\x00\x00 \x00\x00\x00 \x08\x06\x00\x00\x00szz\xf4\ +\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\ +\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\ +\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\ +\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x06\ +bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\ +\x00\x09oFFs\x00\x00\x02\xc0\x00\x00\x00\x00\x00\x5c\ +]\xb9S\x00\x00\x00\x09pHYs\x00\x00\x0b\x13\x00\ +\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x00\x07tIME\ +\x07\xdf\x0c\x12\x0e\x1b\x0b$&IW\x00\x00\x00\x09v\ +pAg\x00\x00\x03@\x00\x00\x00 \x00\xbe\xe6\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0rM\xd9\ +\x8f\xb9uU~\xd5F\x17z\x84V\x9c\x1a\xb7\x8f\x08\ +t<\x08D[\x00\x09\x0f4\x84Ke\x1c\x9e3\x90\ +\xf3}x$\x86\xf9S\xc9< \xcc\x077\xe0F\xec\ +\x10Z\xb2\xf9\xddA,I\xd31\x1c\x0f\xf4\x0b\xfc\xde\ +\x9d\x80=\x89\xcbQ\xc7\xbd9\x06\xe6\x81\x13\xd8\x1d\xed\ +.\xc6\xddx@ \xabnL\xc3\xcbY^l\x1en\ + i\xf2@\xbfPd\xd7\x08\x83\xc8^a.\x98\x8e\ +\x9b\xe3\xfb\xdd\x06\xcf\x03\xdf\x09\x83\x0bL\xab\xab\xf2\xf9\ +,/~\x8d\xe9\xeb\x12\xae\xf0S\x8eN\x8b\x07\xb2\xbc\ +\x98\x1c\xc3\xbb\xa5\xae\xca\x1dq{K\xa2\xf2\xb5d\x1e\ +\xc8\xf2\xe2\xfa\xb8lD{\x9b\xb2\xbc\x18\x8b\xee\xba*\ +7\xa5\xb6[\x01\x8cI\x8ahr\xb2\xdf\x10\xfa\xfbP\ +\x043\x94\x1c\xc19q}\xaa\xc6\xea\xaa|'\xda\x1d\ +$\xad\x00f\xc6b\x1c-\x19D\xe5i\xe8\xdb\x01\xc8\ +p\x95\xbf\xcf\x00#\x95\x06>\x1e\xc5\xc3\xfc/\xff\x8e\ +\xfc\x05\x99&,\xa0:Dw\xab\x00\x00\x00%tE\ +Xtdate:create\x0020\ +15-12-18T14:27:1\ +1+00:00YM\xe3\xc6\x00\x00\x00%t\ +EXtdate:modify\x002\ +015-12-18T14:27:\ +11+00:00(\x10[z\x00\x00\x00\x00\ +IEND\xaeB`\x82\ +\x00\x00\x04~\ +\x00\ +\x00\x01\x00\x01\x00\x10\x10\x00\x00\x00\x00 \x00h\x04\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00\ +\x00\x01\x00 \x00\x00\x00\x00\x00@\x04\x00\x00\x13\x0b\x00\ +\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +>\x00\x00\x00\xa1\x00\x00\x00\xd6\x00\x00\x00\xeb\x00\x00\x00\ +\xec\x00\x00\x00\xd8\x00\x00\x00\xa7\x00\x00\x00G\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x9e\x02\x022\ +\xff\x04\x10\x81\xff\x03#\xaa\xff\x02,\xbb\xff\x02-\xbc\ +\xff\x03$\xac\xff\x03\x12\x85\xff\x02\x028\xff\x00\x00\x00\ +\xac\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x0c\x00\x00\x00\xbb\x03\x08\x5c\xff\x02/\xcb\ +\xff\x00;\xca\xff\x00:\xca\xff\x009\xca\xff\x009\xca\ +\xff\x00:\xca\xff\x00;\xca\xff\x022\xcb\xff\x03\x09b\ +\xff\x00\x00\x00\xc9\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x98\x04\x08^\xff\x015\xca\xff\x00:\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x00:\xca\xff\x018\xca\ +\xff\x03\x09c\xff\x00\x00\x00\xaf\x00\x00\x00\x00\x00\x00\x00\ +0\x00\x00\x00\xfd\x02.\xc8\xff\x00:\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x00:\xca\ +\xff\x022\xcb\xff\x02\x027\xff\x00\x00\x00E\x00\x00\x00\ +\x92\x04\x0eu\xff\x00:\xca\xff\x008\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x00;\xca\xff\x03\x13\x87\xff\x00\x00\x00\xaa\x00\x00\x00\ +\xce\x02\x1f\xa4\xff\x00:\xc9\xff\x008\xc9\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x008\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x00:\xca\xff\x03%\xaf\xff\x00\x00\x00\xdc\x00\x00\x00\ +\xea\x02)\xb9\xff\x01:\xca\xff\x088\xd1\xff\x098\xd1\ +\xff\x078\xd0\xff\x058\xce\xff\x038\xcd\xff\x028\xcc\ +\xff\x018\xca\xff\x008\xca\xff\x008\xca\xff\x008\xca\ +\xff\x009\xca\xff\x02-\xbd\xff\x00\x00\x00\xed\x00\x00\x00\ +\xe8\x02)\xb8\xff\x0d:\xd6\xff\x139\xdb\xff\x118\xd9\ +\xff\x0f8\xd7\xff\x0d8\xd6\xff\x0b8\xd4\xff\x0a8\xd3\ +\xff\x088\xd1\xff\x068\xcf\xff\x048\xce\xff\x028\xcb\ +\xff\x009\xc9\xff\x02-\xbd\xff\x00\x00\x00\xed\x00\x00\x00\ +\xcb\x06\x1d\xa5\xff\x1b;\xe2\xff\x1a9\xe2\xff\x189\xe0\ +\xff\x179\xde\xff\x159\xdd\xff\x139\xdb\xff\x129\xda\ +\xff\x108\xd8\xff\x0e8\xd7\xff\x0c8\xd5\xff\x0a8\xd3\ +\xff\x01:\xcb\xff\x03$\xad\xff\x00\x00\x00\xd9\x00\x00\x00\ +\x8b\x07\x0dr\xff\x22;\xe8\xff\x22:\xe9\xff 9\xe7\ +\xff\x1e9\xe5\xff\x1c9\xe3\xff\x1b9\xe2\xff\x199\xe0\ +\xff\x179\xdf\xff\x169\xdd\xff\x149\xdc\xff\x139\xdb\ +\xff\x07;\xd0\xff\x03\x11\x82\xff\x00\x00\x00\xa3\x00\x00\x00\ +(\x00\x00\x00\xfa\x1c+\xd7\xff,;\xf2\xff(:\xee\ +\xff&:\xec\xff$:\xeb\xff#:\xe9\xff!:\xe7\ +\xff\x1f9\xe6\xff\x1d9\xe4\xff\x1c9\xe3\xff\x1b;\xe2\ +\xff\x090\xd1\xff\x02\x02/\xff\x00\x00\x00;\x00\x00\x00\ +\x00\x00\x00\x00\x88\x07\x08[\xff,5\xf1\xff3;\xf8\ +\xff.;\xf3\xff,:\xf1\xff*:\xf0\xff(:\xee\ +\xff':\xed\xff%:\xeb\xff&;\xec\xff\x1c6\xe3\ +\xff\x04\x08]\xff\x00\x00\x00\x9f\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x05\x00\x00\x00\xaa\x08\x08[\xff)+\xe2\ +\xff8;\xfc\xff7;\xfc\xff4;\xf9\xff2;\xf8\ +\xff1;\xf6\xff/;\xf5\xff#/\xe5\xff\x06\x08`\ +\xff\x00\x00\x00\xbb\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x88\x00\x00\x00\ +\xf6\x0e\x0ex\xff\x1e\x1f\xb8\xff)+\xda\xff)+\xdb\ +\xff\x1d!\xba\xff\x0e\x0f~\xff\x00\x00\x00\xfb\x00\x00\x00\ +\x96\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ ++\x00\x00\x00\x8a\x00\x00\x00\xc8\x00\x00\x00\xe7\x00\x00\x00\ +\xe8\x00\x00\x00\xcb\x00\x00\x00\x91\x00\x00\x003\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x0f\x00\ +\x00\xc0\x03\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\ +\x00\x80\x01\x00\x00\xc0\x03\x00\x00\xf0\x0f\x00\x00\ +\x00\x00\x03F\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a source contr\ +ol connected\x0d\x0a \x0d\x0a \ + \x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x03J\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a source contr\ +ol - not setup\x0d\x0a \x0d\x0a\ + \x0d\x0a \x0d\ +\x0a\x0d\x0a\ +\x00\x00\x04~\ +\x00\ +\x00\x01\x00\x01\x00\x10\x10\x00\x00\x00\x00 \x00h\x04\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00\ +\x00\x01\x00 \x00\x00\x00\x00\x00@\x04\x00\x00\x13\x0b\x00\ +\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c\x1a\x1c\ +>\x1c\x0f\x1b\xa1\x1c\x13\x1b\xd6\x1b\x1e\x1b\xeb\x19\x1d\x1a\ +\xec\x17\x0f\x17\xd8\x13\x05\x11\xa7\x0d\x09\x0cG\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00###\x0a#\x19\x22\x9e!$\x22\ +\xff\x18q!\xff\x0d\xb6\x1e\xff\x09\xd0\x1d\xff\x09\xd2\x1d\ +\xff\x0d\xba\x1f\xff\x16x \xff\x18!\x19\xff\x10\x05\x0f\ +\xac\x0f\x0f\x0f\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00%&%\x0c'\x1b&\xbb\x1fK$\xff\x09\xcd\x1d\ +\xff\x00\xfd\x19\xff\x00\xfb\x18\xff\x00\xf7\x18\xff\x00\xf6\x18\ +\xff\x00\xfa\x18\xff\x00\xff\x19\xff\x0a\xd7\x1f\xff\x18P\x1e\ +\xff\x12\x06\x11\xc9\x04\x05\x05\x13\x00\x00\x00\x00\x00\x00\x00\ +\x00-#,\x98\x22I&\xff\x03\xe6\x1a\xff\x00\xfb\x18\ +\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\ +\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf9\x18\xff\x05\xf1\x1c\ +\xff\x18P\x1e\xff\x11\x06\x11\xaf\x00\x00\x00\x00.,.\ +0+.+\xfd\x08\xc8\x1c\xff\x00\xfb\x18\xff\x00\xf0\x19\ +\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\ +\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xfa\x18\ +\xff\x09\xd7\x1e\xff\x19\x22\x1a\xff\x0c\x09\x0cE3&1\ +\x92\x1dk%\xff\x00\xfb\x18\xff\x00\xf0\x19\xff\x00\xf0\x18\ +\xff\x00\xf0\x18\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\ +\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\ +\xff\x00\xff\x19\xff\x16x \xff\x14\x07\x13\xaa3'2\ +\xce\x0f\xa5\x1f\xff\x00\xfc\x17\xff\x00\xf0\x17\xff\x01\xf0\x1a\ +\xff\x02\xf0\x1b\xff\x00\xf0\x19\xff\x00\xf0\x18\xff\x00\xf0\x18\ +\xff\x00\xf0\x18\xff\x00\xf0\x19\xff\x00\xf0\x19\xff\x00\xf0\x19\ +\xff\x00\xfa\x18\xff\x0c\xba\x1f\xff\x1a\x12\x19\xdc5/4\ +\xea\x07\xc2\x1a\xff\x03\xf9\x1b\xff!\xf27\xff%\xf2:\ +\xff\x1e\xf24\xff\x16\xf1-\xff\x0f\xf1&\xff\x08\xf0!\ +\xff\x04\xf0\x1c\xff\x01\xf0\x1a\xff\x00\xf0\x18\xff\x00\xf0\x18\ +\xff\x00\xf7\x18\xff\x08\xd1\x1d\xff\x1b\x1f\x1c\xed616\ +\xe8\x07\xc1\x1b\xff:\xfcO\xffT\xf5e\xffH\xf4Z\ +\xffA\xf4S\xff9\xf4M\xff1\xf3F\xff*\xf2?\ +\xff\x22\xf27\xff\x1a\xf10\xff\x12\xf1*\xff\x08\xf0 \ +\xff\x00\xf7\x17\xff\x08\xd0\x1d\xff\x1d \x1d\xed8.7\ +\xcb \xa1.\xffs\xff\x82\xffr\xf6\x80\xffi\xf6x\ +\xffb\xf6q\xffZ\xf6k\xffS\xf5d\xffL\xf5]\ +\xffD\xf4W\xff=\xf4P\xff6\xf3I\xff-\xf2A\ +\xff\x06\xfb\x1f\xff\x0b\xb5\x1d\xff \x17\x1f\xd9;2:\ +\x8b3i9\xff\x91\xff\x9d\xff\x95\xfa\x9f\xff\x8b\xf8\x96\ +\xff\x83\xf8\x8f\xff{\xf7\x88\xfft\xf7\x82\xffm\xf7{\ +\xffe\xf6t\xff^\xf6n\xffV\xf5g\xffS\xf5d\ +\xff\x1d\xfe5\xff\x13q\x1d\xff\x1f\x12\x1e\xa3><=\ +(262\xfa\x83\xc4\x8a\xff\xbf\xff\xc7\xff\xac\xfa\xb4\ +\xff\xa5\xfa\xae\xff\x9d\xf9\xa7\xff\x96\xf9\xa0\xff\x8e\xf9\x99\ +\xff\x87\xf8\x92\xff\x7f\xf7\x8c\xffx\xf7\x85\xfft\xff\x83\ +\xff(\xce9\xff\x1f' \xff!\x1e!;\x00\x00\x00\ +\x00>;>\x88DME\xff\xbd\xe3\xc2\xff\xdb\xff\xdf\ +\xff\xc7\xfd\xcc\xff\xbe\xfb\xc4\xff\xb6\xfb\xbe\xff\xaf\xfa\xb7\ +\xff\xa8\xfa\xb0\xff\xa1\xfa\xaa\xff\xa3\xff\xad\xffx\xeb\x84\ +\xff$M(\xff'\x1f&\x9f\x00\x00\x00\x00\x00\x00\x00\ +\x00<=<\x05979\xaaLPL\xff\xba\xc7\xbb\ +\xff\xf1\xff\xf4\xff\xee\xff\xf0\xff\xe2\xff\xe6\xff\xda\xff\xdf\ +\xff\xd5\xff\xda\xff\xcd\xff\xd3\xff\x9b\xd0\xa0\xff9M;\ +\xff#\x1d#\xbb\x0d\x0e\x0d\x0b\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00CCC\x04<;<\x889:9\ +\xf6lnl\xff\xa4\xa8\xa4\xff\xc3\xcb\xc4\xff\xc1\xcd\xc2\ +\xff\xa2\xb0\xa3\xffitj\xff333\xfb,'+\ +\x96$$$\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00BBB\ ++555\x8a111\xc8444\xe7333\ +\xe8-+-\xcb,*,\x911113\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x0f\x00\ +\x00\xc0\x03\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\ +\x00\x80\x01\x00\x00\xc0\x03\x00\x00\xf0\x0f\x00\x00\ +\x00\x00\x03L\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a source contr\ +ol - warning v2<\ +/title>\x0d\x0a \ +\x0d\x0a \ +\x0d\x0a \x0d\x0a\x0d\x0a\ +\x00\x00\x04~\ +\x00\ +\x00\x01\x00\x01\x00\x10\x10\x00\x00\x00\x00 \x00h\x04\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00\ +\x00\x01\x00 \x00\x00\x00\x00\x00@\x04\x00\x00\x13\x0b\x00\ +\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +>\x00\x00\x00\xa1\x00\x00\x00\xd6\x00\x00\x00\xeb\x00\x00\x00\ +\xec\x00\x00\x00\xd8\x00\x00\x00\xa7\x00\x00\x00G\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x0a\x00\x00\x00\x9e\x0148\ +\xff\x02\x8c\x92\xff\x01\xbf\xc1\xff\x01\xd5\xd4\xff\x01\xd6\xd5\ +\xff\x01\xc2\xc3\xff\x01\x91\x97\xff\x01;@\xff\x00\x00\x00\ +\xac\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x0c\x00\x00\x00\xbb\x01bh\xff\x01\xe7\xe6\ +\xff\x00\xec\xe6\xff\x00\xec\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xec\xe6\xff\x00\xec\xe6\xff\x01\xe8\xe6\xff\x01io\ +\xff\x00\x00\x00\xc9\x00\x00\x00\x13\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x98\x02cj\xff\x00\xea\xe6\xff\x00\xec\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xec\xe6\xff\x01\xeb\xe6\ +\xff\x01jp\xff\x00\x00\x00\xaf\x00\x00\x00\x00\x00\x00\x00\ +0\x00\x00\x00\xfd\x01\xe4\xe4\xff\x00\xec\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xec\xe6\ +\xff\x01\xe8\xe6\xff\x019>\xff\x00\x00\x00E\x00\x00\x00\ +\x92\x02~\x84\xff\x00\xec\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xec\xe6\xff\x01\x93\x9a\xff\x00\x00\x00\xaa\x00\x00\x00\ +\xce\x02\xb7\xba\xff\x00\xec\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xec\xe6\xff\x01\xc6\xc6\xff\x00\x00\x00\xdc\x00\x00\x00\ +\xea\x01\xd3\xd3\xff\x00\xec\xe6\xff\x04\xeb\xe9\xff\x04\xeb\xe9\ +\xff\x03\xeb\xe9\xff\x02\xeb\xe8\xff\x02\xeb\xe7\xff\x01\xeb\xe7\ +\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\xff\x00\xeb\xe6\ +\xff\x00\xeb\xe6\xff\x01\xd7\xd6\xff\x00\x00\x00\xed\x00\x00\x00\ +\xe8\x01\xd0\xd1\xff\x06\xec\xec\xff\x09\xeb\xee\xff\x08\xeb\xed\ +\xff\x07\xeb\xec\xff\x06\xeb\xeb\xff\x05\xeb\xeb\xff\x05\xeb\xea\ +\xff\x04\xeb\xe9\xff\x03\xeb\xe8\xff\x02\xeb\xe8\xff\x01\xeb\xe7\ +\xff\x00\xeb\xe6\xff\x01\xd7\xd6\xff\x00\x00\x00\xed\x00\x00\x00\ +\xcb\x03\xb4\xb9\xff\x0d\xec\xf1\xff\x0d\xeb\xf1\xff\x0c\xeb\xf0\ +\xff\x0b\xeb\xef\xff\x0a\xeb\xef\xff\x09\xeb\xee\xff\x08\xeb\xed\ +\xff\x07\xeb\xed\xff\x07\xeb\xec\xff\x06\xeb\xeb\xff\x05\xeb\xea\ +\xff\x01\xec\xe6\xff\x01\xc2\xc4\xff\x00\x00\x00\xd9\x00\x00\x00\ +\x8b\x03x\x7f\xff\x10\xec\xf4\xff\x10\xec\xf4\xff\x0f\xec\xf3\ +\xff\x0e\xec\xf3\xff\x0e\xeb\xf2\xff\x0d\xeb\xf1\xff\x0c\xeb\xf1\ +\xff\x0b\xeb\xf0\xff\x0a\xeb\xef\xff\x09\xeb\xee\xff\x09\xeb\xee\ +\xff\x03\xec\xe9\xff\x01\x8d\x93\xff\x00\x00\x00\xa3\x00\x00\x00\ +(\x00\x00\x00\xfa\x0d\xd9\xe5\xff\x15\xec\xf9\xff\x13\xec\xf7\ +\xff\x12\xec\xf6\xff\x11\xec\xf5\xff\x10\xec\xf5\xff\x10\xec\xf4\ +\xff\x0f\xec\xf3\xff\x0e\xeb\xf2\xff\x0d\xeb\xf2\xff\x0d\xec\xf1\ +\xff\x04\xe7\xe9\xff\x0115\xff\x00\x00\x00;\x00\x00\x00\ +\x00\x00\x00\x00\x88\x03^e\xff\x15\xe9\xf8\xff\x18\xec\xfb\ +\xff\x16\xec\xf9\xff\x15\xec\xf9\xff\x14\xec\xf8\xff\x13\xec\xf7\ +\xff\x12\xec\xf6\xff\x12\xec\xf6\xff\x12\xec\xf6\xff\x0d\xea\xf1\ +\xff\x02ci\xff\x00\x00\x00\x9f\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x05\x00\x00\x00\xaa\x03]d\xff\x13\xd9\xea\ +\xff\x1a\xec\xfe\xff\x1a\xec\xfd\xff\x19\xec\xfc\xff\x18\xec\xfb\ +\xff\x17\xec\xfb\xff\x17\xec\xfa\xff\x11\xe3\xf1\xff\x03cj\ +\xff\x00\x00\x00\xbb\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x88\x00\x00\x00\ +\xf6\x06w\x81\xff\x0e\xb2\xc0\xff\x13\xd1\xe2\xff\x13\xd2\xe2\ +\xff\x0e\xb6\xc3\xff\x07~\x88\xff\x00\x00\x00\xfb\x00\x00\x00\ +\x96\x00\x00\x00\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ ++\x00\x00\x00\x8a\x00\x00\x00\xc8\x00\x00\x00\xe7\x00\x00\x00\ +\xe8\x00\x00\x00\xcb\x00\x00\x00\x91\x00\x00\x003\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x0f\x00\ +\x00\xc0\x03\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\ +\x00\x80\x01\x00\x00\xc0\x03\x00\x00\xf0\x0f\x00\x00\ +\x00\x00\x04~\ +\x00\ +\x00\x01\x00\x01\x00\x10\x10\x00\x00\x01\x00 \x00h\x04\x00\ +\x00\x16\x00\x00\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00\ +\x00\x01\x00 \x00\x00\x00\x00\x00@\x04\x00\x00\x13\x0b\x00\ +\x00\x13\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|||\ +>|||\xa1|||\xd6|||\xeb|||\ +\xec|||\xd8|||\xa7|||G\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00|||\x0a|||\x9e\x89\x89\x89\ +\xff\x9e\x9e\x9e\xff\xa8\xa8\xa8\xff\xac\xac\xac\xff\xad\xad\xad\ +\xff\xa9\xa9\xa9\xff\x9f\x9f\x9f\xff\x8b\x8b\x8b\xff|||\ +\xac|||\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00|||\x0c|||\xbb\x94\x94\x94\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\x96\x96\x96\ +\xff|||\xc9|||\x13\x00\x00\x00\x00\x00\x00\x00\ +\x00|||\x98\x95\x95\x95\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\x96\x96\x96\xff|||\xaf\x00\x00\x00\x00|||\ +0|||\xfd\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\x8a\x8a\x8a\xff|||E|||\ +\x92\x9b\x9b\x9b\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\ +\xff\xb0\xb0\xb0\xff\xb0\xb0\xb0\xff\xb0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\xa9\xa9\xa9\xff|||\xd9|||\ +\x8b\x9b\x9b\x9b\xff\xc0\xc0\xc0\xff\xc0\xc0\xc0\xff\xbf\xbf\xbf\ +\xff\xbe\xbe\xbe\xff\xbd\xbd\xbd\xff\xbd\xbd\xbd\xff\xbc\xbc\xbc\ +\xff\xbb\xbb\xbb\xff\xba\xba\xba\xff\xb9\xb9\xb9\xff\xb9\xb9\xb9\ +\xff\xb3\xb3\xb3\xff\x9e\x9e\x9e\xff|||\xa3|||\ +(|||\xfa\xba\xba\xba\xff\xc5\xc5\xc5\xff\xc3\xc3\xc3\ +\xff\xc2\xc2\xc2\xff\xc1\xc1\xc1\xff\xc1\xc1\xc1\xff\xc0\xc0\xc0\ +\xff\xbf\xbf\xbf\xff\xbe\xbe\xbe\xff\xbd\xbd\xbd\xff\xbd\xbd\xbd\ +\xff\xb4\xb4\xb4\xff\x88\x88\x88\xff|||;\x00\x00\x00\ +\x00|||\x88\x95\x95\x95\xff\xc5\xc5\xc5\xff\xc8\xc8\xc8\ +\xff\xc6\xc6\xc6\xff\xc5\xc5\xc5\xff\xc4\xc4\xc4\xff\xc3\xc3\xc3\ +\xff\xc3\xc3\xc3\xff\xc2\xc2\xc2\xff\xc2\xc2\xc2\xff\xbd\xbd\xbd\ +\xff\x95\x95\x95\xff|||\x9f\x00\x00\x00\x00\x00\x00\x00\ +\x00|||\x05|||\xaa\x95\x95\x95\xff\xc0\xc0\xc0\ +\xff\xcb\xcb\xcb\xff\xca\xca\xca\xff\xc9\xc9\xc9\xff\xc8\xc8\xc8\ +\xff\xc7\xc7\xc7\xff\xc7\xc7\xc7\xff\xc0\xc0\xc0\xff\x96\x96\x96\ +\xff|||\xbb|||\x0b\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00|||\x04|||\x88|||\ +\xf6\x9e\x9e\x9e\xff\xb3\xb3\xb3\xff\xbe\xbe\xbe\xff\xbf\xbf\xbf\ +\xff\xb3\xb3\xb3\xff\xa0\xa0\xa0\xff|||\xfb|||\ +\x96|||\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|||\ ++|||\x8a|||\xc8|||\xe7|||\ +\xe8|||\xcb|||\x91|||3\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x0f\x00\ +\x00\xc0\x03\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\ +\x00\x80\x01\x00\x00\xc0\x03\x00\x00\xf0\x0f\x00\x00\ +\x00\x00\x03D\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22?>\x0d\x0a\x0d\x0a source contr\ +ol error v2\x0d\x0a \x0d\x0a \ + \x0d\ +\x0a \x0d\x0a\x0d\x0a\ +" + +qt_resource_name = b"\ +\x00\x0f\ +\x04T\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x000\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04S\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x005\x00.\x00p\x00n\x00g\ +\x00\x09\ +\x0a\xc5\xacG\ +\x00w\ +\x00a\x00t\x00e\x00r\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x06Z\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x000\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04_\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x009\x00.\x00p\x00n\x00g\ +\x00\x16\ +\x0eE\x9e\x87\ +\x00e\ +\x00r\x00r\x00o\x00r\x00_\x00r\x00e\x00p\x00o\x00r\x00t\x00_\x00e\x00r\x00r\x00o\ +\x00r\x00.\x00s\x00v\x00g\ +\x00\x09\ +\x08\xbcm\xc2\ +\x00s\ +\x00t\x00a\x00t\x00u\x00s\x00b\x00a\x00r\ +\x00\x0f\ +\x04P\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x004\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04\x5c\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x008\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00\xf0&'\ +\x00e\ +\x00r\x00r\x00o\x00r\x00_\x00r\x00e\x00p\x00o\x00r\x00t\x00_\x00w\x00a\x00r\x00n\ +\x00i\x00n\x00g\x00.\x00s\x00v\x00g\ +\x00\x18\ +\x0c\x85t\xe7\ +\x00e\ +\x00r\x00r\x00o\x00r\x00_\x00r\x00e\x00p\x00o\x00r\x00t\x00_\x00c\x00o\x00m\x00m\ +\x00e\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00\x0a\ +\x03\xd6;g\ +\x00M\ +\x00a\x00i\x00n\x00W\x00i\x00n\x00d\x00o\x00w\ +\x00\x0f\ +\x04U\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x003\x00.\x00p\x00n\x00g\ +\x00\x09\ +\x0c\xe6\xbd#\ +\x00v\ +\x00i\x00e\x00w\x00p\x00a\x00n\x00e\x00s\ +\x00\x0f\ +\x04a\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x007\x00.\x00p\x00n\x00g\ +\x00\x07\ +\x0a\xc9\xa6S\ +\x00c\ +\x00u\x00r\x00s\x00o\x00r\x00s\ +\x00\x15\ +\x06S\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x007\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04R\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x002\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04^\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x006\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x06P\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x006\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04W\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x001\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04S\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x005\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x06a\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x005\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04T\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x000\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04P\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x004\x00.\x00p\x00n\x00g\ +\x00\x03\ +\x00\x00x\xc3\ +\x00r\ +\x00e\x00s\ +\x00\x14\ +\x07\x22u\xc7\ +\x00a\ +\x00r\x00h\x00i\x00t\x00y\x00p\x00e\x00_\x00t\x00r\x00e\x00e\x00_\x000\x003\x00.\ +\x00p\x00n\x00g\ +\x00\x05\ +\x00O\xa6S\ +\x00I\ +\x00c\x00o\x00n\x00s\ +\x00\x15\ +\x06^\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x004\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04U\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x003\x00.\x00p\x00n\x00g\ +\x00\x14\ +\x07!u\xc7\ +\x00a\ +\x00r\x00h\x00i\x00t\x00y\x00p\x00e\x00_\x00t\x00r\x00e\x00e\x00_\x000\x002\x00.\ +\x00p\x00n\x00g\ +\x00\x15\ +\x06_\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x003\ +\x00.\x00p\x00n\x00g\ +\x00\x0b\ +\x0f\x08B\x1e\ +\x00A\ +\x00p\x00p\x00l\x00i\x00c\x00a\x00t\x00i\x00o\x00n\ +\x00\x0f\ +\x04R\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x002\x00.\x00p\x00n\x00g\ +\x00\x14\ +\x07(u\xc7\ +\x00a\ +\x00r\x00h\x00i\x00t\x00y\x00p\x00e\x00_\x00t\x00r\x00e\x00e\x00_\x000\x001\x00.\ +\x00p\x00n\x00g\ +\x00\x0f\ +\x04a\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x007\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x06\x5c\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x002\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x04W\x95'\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x005\x00_\x000\x001\x00.\x00p\x00n\x00g\ +\x00\x14\ +\x07'u\xc7\ +\x00a\ +\x00r\x00h\x00i\x00t\x00y\x00p\x00e\x00_\x00t\x00r\x00e\x00e\x00_\x000\x000\x00.\ +\x00p\x00n\x00g\ +\x00\x0f\ +\x04^\x95\xc7\ +\x00b\ +\x00m\x00p\x000\x000\x000\x000\x006\x00_\x000\x006\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x06]\x7fG\ +\x00p\ +\x00a\x00r\x00t\x00i\x00c\x00l\x00e\x00s\x00_\x00t\x00r\x00e\x00e\x00_\x000\x001\ +\x00.\x00p\x00n\x00g\ +\x00\x0f\ +\x0e\x0f\xf3\xff\ +\x00o\ +\x003\x00d\x00e\x00_\x00e\x00d\x00i\x00t\x00o\x00r\x00.\x00i\x00c\x00o\ +\x00\x14\ +\x0b\x1b&\xb6\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00D\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\ +\x00t\x00i\x00f\ +\x00\x17\ +\x0c\x9a\xdb\xc7\ +\x00l\ +\x00o\x00c\x00k\x00_\x00c\x00i\x00r\x00c\x00l\x00e\x00_\x00d\x00e\x00f\x00a\x00u\ +\x00l\x00t\x00.\x00s\x00v\x00g\ +\x00\x10\ +\x07T\xb1'\ +\x00D\ +\x00e\x00f\x00a\x00u\x00l\x00t\x00_\x00o\x00p\x00e\x00n\x00.\x00s\x00v\x00g\ +\x00\x19\ +\x0e\xd2\x13\xe7\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00.\x00s\x00v\x00g\ +\x00\x0e\ +\x0b\xd8M\x87\ +\x00l\ +\x00a\x00y\x00e\x00r\x00_\x00i\x00c\x00o\x00n\x00.\x00s\x00v\x00g\ +\x00\x15\ +\x01\xaf\x1c'\ +\x00E\ +\x00n\x00t\x00i\x00t\x00y\x00_\x00N\x00o\x00t\x00_\x00A\x00c\x00t\x00i\x00v\x00e\ +\x00.\x00s\x00v\x00g\ +\x00\x19\ +\x05\xf2\xd2\x07\ +\x00v\ +\x00i\x00s\x00_\x00o\x00n\x00_\x00N\x00o\x00t\x00T\x00r\x00a\x00n\x00s\x00p\x00a\ +\x00r\x00e\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00\x1c\ +\x05A\x11\x07\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00_\x00E\x00d\x00i\x00t\ +\x00o\x00r\x00_\x00O\x00n\x00l\x00y\x00.\x00s\x00v\x00g\ +\x00\x16\ +\x0c>\x8f\xc7\ +\x00v\ +\x00i\x00s\x00_\x00c\x00i\x00r\x00c\x00l\x00e\x00_\x00d\x00e\x00f\x00a\x00u\x00l\ +\x00t\x00.\x00s\x00v\x00g\ +\x00%\ +\x0f-\x08'\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00E\x00d\x00i\x00t\x00o\x00r\x00_\x00O\x00n\x00l\x00y\ +\x00.\x00s\x00v\x00g\ +\x00\x0a\ +\x01\xb91\x87\ +\x00l\ +\x00o\x00c\x00k\x00e\x00d\x00.\x00s\x00v\x00g\ +\x00\x0f\ +\x05bA^\ +\x00E\ +\x00y\x00e\x00_\x00O\x00p\x00e\x00n\x00_\x00H\x00i\x00d\x00d\x00e\x00n\ +\x00\x1b\ +\x05K\x05V\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00P\x00a\x00r\x00t\x00i\x00a\x00l\x00_\x00E\ +\x00n\x00a\x00b\x00l\x00e\x00d\x00.\x00t\x00i\x00f\ +\x00\x0c\ +\x0f^26\ +\x00E\ +\x00y\x00e\x00_\x00O\x00p\x00e\x00n\x00.\x00t\x00i\x00f\ +\x00\x10\ +\x03\xcaZG\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00.\x00s\x00v\x00g\ +\x00\x16\ +\x06\x8e\x16\xc7\ +\x00E\ +\x00n\x00t\x00i\x00t\x00y\x00_\x00E\x00d\x00i\x00t\x00o\x00r\x00_\x00O\x00n\x00l\ +\x00y\x00.\x00s\x00v\x00g\ +\x00\x1b\ +\x04\xe2\x14'\ +\x00l\ +\x00o\x00c\x00k\x00_\x00c\x00i\x00r\x00c\x00l\x00e\x00_\x00t\x00r\x00a\x00n\x00s\ +\x00p\x00a\x00r\x00e\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00\x0d\ +\x01m\xcf\x96\ +\x00E\ +\x00y\x00e\x00_\x00S\x00l\x00a\x00s\x00h\x00.\x00t\x00i\x00f\ +\x00\x14\ +\x0e\x00\x9e6\ +\x00E\ +\x00y\x00e\x00_\x00P\x00a\x00r\x00t\x00i\x00a\x00l\x00_\x00O\x00p\x00e\x00n\x00.\ +\x00t\x00i\x00f\ +\x00\x07\ +\x0c\xf8ZG\ +\x00E\ +\x00y\x00e\x00.\x00s\x00v\x00g\ +\x00\x14\ +\x07T)\xf6\ +\x00E\ +\x00y\x00e\x00_\x00S\x00l\x00a\x00s\x00h\x00_\x00H\x00i\x00d\x00d\x00e\x00n\x00.\ +\x00t\x00i\x00f\ +\x00\x1a\ +\x00\xe3\x5c\xa7\ +\x00v\ +\x00i\x00s\x00_\x00c\x00i\x00r\x00c\x00l\x00e\x00_\x00t\x00r\x00a\x00n\x00s\x00p\ +\x00a\x00r\x00e\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00/\ +\x0a\xf8TG\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00E\x00d\x00i\x00t\x00o\x00r\x00_\x00O\x00n\x00l\x00y\ +\x00_\x00U\x00n\x00s\x00a\x00v\x00a\x00b\x00l\x00e\x00.\x00s\x00v\x00g\ +\x00\x13\ +\x09+\x00\xf6\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00E\x00n\x00a\x00b\x00l\x00e\x00d\x00.\x00t\ +\x00i\x00f\ +\x00\x19\ +\x07,\xf6\x07\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00.\x00s\x00v\x00g\ +\x00.\ +\x07\x84Qg\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00N\x00o\x00t\x00_\x00A\x00c\x00t\x00i\x00v\x00e\x00_\ +\x00U\x00n\x00s\x00a\x00v\x00a\x00b\x00l\x00e\x00.\x00s\x00v\x00g\ +\x00%\ +\x08\xc2\x87g\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00E\x00d\x00i\x00t\x00o\x00r\x00_\x00O\x00n\x00l\x00y\ +\x00.\x00s\x00v\x00g\ +\x00\x19\ +\x0e\x89\x90\x16\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00E\x00n\x00a\x00b\x00l\x00e\x00d\x00_\x00H\ +\x00o\x00v\x00e\x00r\x00.\x00t\x00i\x00f\ +\x00\x1c\ +\x0bd6G\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00E\x00d\x00i\x00t\ +\x00o\x00r\x00_\x00O\x00n\x00l\x00y\x00.\x00s\x00v\x00g\ +\x00\x0b\ +\x052\xac\xa7\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00.\x00s\x00v\x00g\ +\x00\x10\ +\x08Y\x11\xa7\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00.\x00s\x00v\x00g\ +\x00$\ +\x05\xcb\xc5\xc7\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00N\x00o\x00t\x00_\x00A\x00c\x00t\x00i\x00v\x00e\x00.\ +\x00s\x00v\x00g\ +\x00\x1b\ +\x0e\xf5\xfe\xc7\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00N\x00o\x00t\x00_\ +\x00A\x00c\x00t\x00i\x00v\x00e\x00.\x00s\x00v\x00g\ +\x00\x0c\ +\x0e=1\x87\ +\x00u\ +\x00n\x00l\x00o\x00c\x00k\x00e\x00d\x00.\x00s\x00v\x00g\ +\x00\x1a\ +\x00\x9cw\x07\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00U\x00n\x00s\x00a\ +\x00v\x00a\x00b\x00l\x00e\x00.\x00s\x00v\x00g\ +\x00\x1a\ +\x0a\xe9\xdc\x96\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00D\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00_\ +\x00H\x00o\x00v\x00e\x00r\x00.\x00t\x00i\x00f\ +\x00\x0a\ +\x00\xb5\xd1\xa7\ +\x00E\ +\x00n\x00t\x00i\x00t\x00y\x00.\x00s\x00v\x00g\ +\x00#\ +\x08\x0b\xd5\x87\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00E\x00n\x00t\x00i\x00t\x00y\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00U\x00n\x00s\x00a\x00v\x00a\x00b\x00l\x00e\x00.\x00s\ +\x00v\x00g\ +\x00\x13\ +\x0e\x1c\x0e\xf6\ +\x00E\ +\x00y\x00e\x00_\x00S\x00l\x00a\x00s\x00h\x00_\x00H\x00o\x00v\x00e\x00r\x00.\x00t\ +\x00i\x00f\ +\x00\x1b\ +\x03\x98\x0c'\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00_\x00N\x00o\x00t\x00_\ +\x00A\x00c\x00t\x00i\x00v\x00e\x00.\x00s\x00v\x00g\ +\x00\x17\ +\x03\xf8\xf5g\ +\x00l\ +\x00o\x00c\x00k\x00_\x00o\x00n\x00_\x00t\x00r\x00a\x00n\x00s\x00p\x00a\x00r\x00e\ +\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00\x1a\ +\x00\xb2\x86\xa7\ +\x00l\ +\x00o\x00c\x00k\x00_\x00o\x00n\x00_\x00N\x00o\x00t\x00T\x00r\x00a\x00n\x00s\x00p\ +\x00a\x00r\x00e\x00n\x00t\x00.\x00s\x00v\x00g\ +\x00\x08\ +\x00\x95Ug\ +\x00v\ +\x00i\x00s\x00b\x00.\x00s\x00v\x00g\ +\x00\x15\ +\x0c\x87\x8f\xd6\ +\x00E\ +\x00y\x00e\x00_\x00P\x00a\x00r\x00t\x00i\x00a\x00l\x00_\x00S\x00l\x00a\x00s\x00h\ +\x00.\x00t\x00i\x00f\ +\x00\x0f\ +\x09\xcbq\xa7\ +\x00v\ +\x00i\x00s\x00b\x00_\x00h\x00i\x00d\x00d\x00e\x00n\x00.\x00s\x00v\x00g\ +\x00\x12\ +\x02{\xf5\x96\ +\x00E\ +\x00y\x00e\x00_\x00O\x00p\x00e\x00n\x00_\x00H\x00o\x00v\x00e\x00r\x00.\x00t\x00i\ +\x00f\ +\x00$\ +\x0a9L\xa7\ +\x00S\ +\x00l\x00i\x00c\x00e\x00_\x00H\x00a\x00n\x00d\x00l\x00e\x00_\x00M\x00o\x00d\x00i\ +\x00f\x00i\x00e\x00d\x00_\x00N\x00o\x00t\x00_\x00A\x00c\x00t\x00i\x00v\x00e\x00.\ +\x00s\x00v\x00g\ +\x00\x16\ +\x05\x5c\xa1g\ +\x00v\ +\x00i\x00s\x00_\x00o\x00n\x00_\x00t\x00r\x00a\x00n\x00s\x00p\x00a\x00r\x00e\x00n\ +\x00t\x00.\x00s\x00v\x00g\ +\x00\x12\ +\x0cS?'\ +\x00D\ +\x00e\x00f\x00a\x00u\x00l\x00t\x00_\x00c\x00l\x00o\x00s\x00e\x00d\x00.\x00s\x00v\ +\x00g\ +\x00\x1c\ +\x0d\x1b}6\ +\x00P\ +\x00a\x00d\x00l\x00o\x00c\x00k\x00_\x00P\x00a\x00r\x00t\x00i\x00a\x00l\x00_\x00D\ +\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00t\x00i\x00f\ +\x00\x12\ +\x06\xdb\x9dg\ +\x00P\ +\x00r\x00e\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00_\x000\x001\x00.\x00p\x00n\ +\x00g\ +\x00\x0a\ +\x08v\x9cg\ +\x00G\ +\x00l\x00o\x00b\x00a\x00l\x00.\x00s\x00v\x00g\ +\x00\x0a\ +\x0c\x8dj\xa7\ +\x00C\ +\x00a\x00m\x00e\x00r\x00a\x00.\x00s\x00v\x00g\ +\x00\x12\ +\x06\xd8\x9dg\ +\x00P\ +\x00r\x00e\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00_\x000\x000\x00.\x00p\x00n\ +\x00g\ +\x00\x0c\ +\x0d\x08\xc6'\ +\x00V\ +\x00i\x00e\x00w\x00p\x00o\x00r\x00t\x00.\x00s\x00v\x00g\ +\x00\x12\ +\x06\xe1\x9dg\ +\x00P\ +\x00r\x00e\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00_\x000\x003\x00.\x00p\x00n\ +\x00g\ +\x00\x0a\ +\x00k\xd7\xa7\ +\x00M\ +\x00o\x00t\x00i\x00o\x00n\x00.\x00s\x00v\x00g\ +\x00\x12\ +\x06\xde\x9dg\ +\x00P\ +\x00r\x00e\x00f\x00e\x00r\x00e\x00n\x00c\x00e\x00s\x00_\x000\x002\x00.\x00p\x00n\ +\x00g\ +\x00\x09\ +\x09\xba\xcf\xa7\ +\x00D\ +\x00e\x00b\x00u\x00g\x00.\x00s\x00v\x00g\ +\x00\x10\ +\x03l\x17\xc7\ +\x00E\ +\x00x\x00p\x00e\x00r\x00i\x00m\x00e\x00n\x00t\x00a\x00l\x00.\x00s\x00v\x00g\ +\x00\x09\ +\x02\xc6\xc0\xc7\ +\x00F\ +\x00i\x00l\x00e\x00s\x00.\x00s\x00v\x00g\ +\x00\x0a\ +\x04o\x98\xe7\ +\x00G\ +\x00i\x00z\x00m\x00o\x00s\x00.\x00s\x00v\x00g\ +\x00\x07\ +\x0f\x07J\x02\ +\x00h\ +\x00i\x00t\x00.\x00c\x00u\x00r\ +\x00\x0e\ +\x06\x0c\xfb\x82\ +\x00a\ +\x00r\x00r\x00o\x00w\x00_\x00d\x00o\x00w\x00n\x00.\x00c\x00u\x00r\ +\x00\x0b\ +\x06\x89\xd9\x82\ +\x00c\ +\x00u\x00r\x00s\x00o\x00r\x001\x00.\x00c\x00u\x00r\ +\x00\x0b\ +\x06\x80\xd9\x82\ +\x00c\ +\x00u\x00r\x00s\x00o\x00r\x002\x00.\x00c\x00u\x00r\ +\x00\x17\ +\x06h\xad\xa2\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00s\x00o\x00_\x00s\x00e\x00l\x00_\x00p\x00l\ +\x00u\x00s\x00.\x00c\x00u\x00r\ +\x00\x0d\ +\x08\x8c:\xe2\ +\x00l\ +\x00e\x00f\x00t\x00r\x00i\x00g\x00h\x00t\x00.\x00c\x00u\x00r\ +\x00\x0e\ +\x03\x0c\x0f\xc2\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00H\x00i\x00t\x00.\x00c\x00u\x00r\ +\x00\x12\ +\x03\xfe\x1c\x82\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00s\x00m\x00o\x00o\x00t\x00h\x00.\x00c\x00u\ +\x00r\ +\x00\x11\ +\x06\x8d\xde\x82\ +\x00a\ +\x00r\x00r\x00o\x00w\x00_\x00u\x00p\x00r\x00i\x00g\x00h\x00t\x00.\x00c\x00u\x00r\ +\ +\x00\x0e\ +\x02\xc2\xa5\x82\ +\x00a\ +\x00r\x00r\x00_\x00a\x00d\x00d\x00k\x00e\x00y\x00.\x00c\x00u\x00r\ +\x00\x15\ +\x07\x0a7B\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00g\x00e\x00t\x00h\x00e\x00i\x00g\x00h\x00t\ +\x00.\x00c\x00u\x00r\ +\x00\x10\ +\x08\x83\x1e\x22\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00p\x00l\x00u\x00s\x00.\x00c\x00u\x00r\ +\x00\x11\ +\x0d\xbf%b\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00r\x00o\x00t\x00a\x00t\x00e\x00.\x00c\x00u\x00r\ +\ +\x00\x0f\ +\x07\xb5h\x82\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00m\x00o\x00v\x00e\x00.\x00c\x00u\x00r\ +\x00\x13\ +\x00.\xa8\x22\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00l\x00i\x00n\x00k\x00n\x00o\x00w\x00.\x00c\ +\x00u\x00r\ +\x00\x10\ +\x07\x0b\x1e\x82\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00l\x00i\x00n\x00k\x00.\x00c\x00u\x00r\ +\x00\x11\ +\x01\x93\x0c\x22\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00m\x00i\x00n\x00u\x00s\x00.\x00c\x00u\x00r\ +\ +\x00\x13\ +\x0aQ\xeab\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00D\x00r\x00a\x00g\x00I\x00t\x00e\x00m\x00.\x00c\ +\x00u\x00r\ +\x00\x0c\ +\x0b\xd0gb\ +\x00a\ +\x00r\x00r\x00o\x00w\x00_\x00u\x00p\x00.\x00c\x00u\x00r\ +\x00\x0f\ +\x0eO\xc8\x02\ +\x00p\ +\x00i\x00c\x00k\x00_\x00c\x00u\x00r\x00s\x00o\x00r\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x0el\xec\xa2\ +\x00c\ +\x00u\x00r\x000\x000\x000\x000\x001\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x0em\xec\xa2\ +\x00c\ +\x00u\x00r\x000\x000\x000\x000\x002\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x0en\xec\xa2\ +\x00c\ +\x00u\x00r\x000\x000\x000\x000\x003\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x05\xaa\xdb\xa2\ +\x00h\ +\x00a\x00n\x00d\x00D\x00r\x00a\x00g\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x0eo\xec\xa2\ +\x00c\ +\x00u\x00r\x000\x000\x000\x000\x004\x00.\x00c\x00u\x00r\ +\x00\x10\ +\x03y\xfd\xc2\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00s\x00c\x00a\x00l\x00e\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x0ep\xec\xa2\ +\x00c\ +\x00u\x00r\x000\x000\x000\x000\x005\x00.\x00c\x00u\x00r\ +\x00\x0c\ +\x02\xaeA\x82\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00.\x00c\x00u\x00r\ +\x00\x15\ +\x0eb\xe8\x22\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00s\x00o\x00_\x00s\x00e\x00l\x00e\x00c\x00t\ +\x00.\x00c\x00u\x00r\ +\x00\x13\ +\x096M\x02\ +\x00a\ +\x00r\x00r\x00o\x00w\x00_\x00d\x00o\x00w\x00n\x00r\x00i\x00g\x00h\x00t\x00.\x00c\ +\x00u\x00r\ +\x00\x13\ +\x0f\xbas\x02\ +\x00p\ +\x00o\x00i\x00n\x00t\x00e\x00r\x00_\x00f\x00l\x00a\x00t\x00t\x00e\x00n\x00.\x00c\ +\x00u\x00r\ +\x00\x0c\ +\x0fy\xb7\xc7\ +\x00m\ +\x00a\x00x\x00i\x00m\x00i\x00z\x00e\x00.\x00p\x00n\x00g\ +\x00\x10\ +\x0a5o'\ +\x00h\ +\x00i\x00d\x00e\x00_\x00h\x00e\x00l\x00p\x00e\x00r\x00s\x00.\x00p\x00n\x00g\ +\x00\x10\ +\x0a\x9d~\xc7\ +\x00d\ +\x00i\x00s\x00p\x00l\x00a\x00y\x00_\x00i\x00n\x00f\x00o\x00.\x00p\x00n\x00g\ +\x00\x17\ +\x04\xb0\xfe\xc7\ +\x00e\ +\x00d\x00i\x00t\x00w\x00i\x00t\x00h\x00b\x00u\x00t\x00t\x00o\x00n\x00_\x00d\x00a\ +\x00r\x00k\x00.\x00p\x00n\x00g\ +\x00\x08\ +\x06b\x87\xf3\ +\x00t\ +\x00o\x00o\x00l\x00b\x00a\x00r\x00s\ +\x00\x1d\ +\x08\xa8\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x005\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x98q\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x004\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x000\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x004\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00N\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x006\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd5\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x002\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xa7\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x004\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x005\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x003\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00C\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x005\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd4\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x001\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\xecq\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x001\x000\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00$\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x002\x000\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xa6\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x003\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x9aq\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x002\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x002\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x002\x00.\x00p\x00n\x00g\ +\x00\x1e\ +\x076,\x87\ +\x00p\ +\x00r\x00o\x00c\x00e\x00d\x00u\x00r\x00a\x00l\x00m\x00a\x00t\x00e\x00r\x00i\x00a\ +\x00l\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd3\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x000\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xa5\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x002\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x9fq\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x001\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x007\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x001\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00E\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x003\x00.\x00p\x00n\x00g\ +\x00\x13\ +\x0c\xd0\x1e\x87\ +\x00m\ +\x00i\x00s\x00c\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x000\x00.\x00p\ +\x00n\x00g\ +\x00\x1d\ +\x08\xa4\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x001\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x9cq\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x000\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x004\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x000\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xdb\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x008\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00B\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x002\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x97q\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x009\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00?\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x009\x00.\x00p\x00n\x00g\ +\x00\x10\ +\x0f\xf1A\xe7\ +\x00O\ +\x00b\x00j\x00S\x00e\x00l\x00e\x00c\x00t\x00i\x00o\x00n\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xa3\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x000\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xda\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x007\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00G\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x001\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xac\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x009\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x94q\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x008\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00<\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x008\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd9\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x006\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00#\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x002\x005\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00D\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x000\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xab\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x008\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x99q\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x007\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00A\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x007\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00O\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x009\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd8\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x005\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00 \xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x002\x004\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xaa\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x007\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x96q\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x006\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00>\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x006\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00L\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x008\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x9d|'\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x003\ +\x00.\x00s\x00v\x00g\ +\x00\x1d\ +\x08\xd7\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x004\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00%\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x002\x003\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xa9\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x000\x006\x00.\x00p\x00n\x00g\ +\x00\x15\ +\x0e\x9bq\xa7\ +\x00o\ +\x00b\x00j\x00e\x00c\x00t\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\x00-\x000\x005\ +\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x003\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x001\x005\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00Q\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x000\x007\x00.\x00p\x00n\x00g\ +\x00\x1d\ +\x08\xd6\xaf\xe7\ +\x00s\ +\x00t\x00a\x00n\x00d\x00a\x00r\x00d\x00_\x00v\x00i\x00e\x00w\x00s\x00_\x00t\x00o\ +\x00o\x00l\x00b\x00a\x00r\x00-\x001\x003\x00.\x00p\x00n\x00g\ +\x00\x18\ +\x00\x22\xce\x87\ +\x00e\ +\x00d\x00i\x00t\x00_\x00m\x00o\x00d\x00e\x00_\x00t\x00o\x00o\x00l\x00b\x00a\x00r\ +\x00-\x002\x002\x00.\x00p\x00n\x00g\ +\x00\x10\ +\x0c\x99\xf5\x1f\ +\x00b\ +\x00a\x00l\x00l\x00_\x00o\x00f\x00f\x00l\x00i\x00n\x00e\x00.\x00i\x00c\x00o\ +\x00\x1c\ +\x0d\xbb\x8bG\ +\x00s\ +\x00o\x00u\x00r\x00c\x00e\x00_\x00c\x00o\x00n\x00t\x00r\x00o\x00l\x00_\x00c\x00o\ +\x00n\x00n\x00e\x00c\x00t\x00e\x00d\x00.\x00s\x00v\x00g\ +\x00\x1c\ +\x03ZJ\xe7\ +\x00s\ +\x00o\x00u\x00r\x00c\x00e\x00_\x00c\x00o\x00n\x00t\x00r\x00o\x00l\x00-\x00n\x00o\ +\x00t\x00_\x00s\x00e\x00t\x00u\x00p\x00.\x00s\x00v\x00g\ +\x00\x0f\ +\x0a\x0d'\xdf\ +\x00b\ +\x00a\x00l\x00l\x00_\x00o\x00n\x00l\x00i\x00n\x00e\x00.\x00i\x00c\x00o\ +\x00\x1d\ +\x03\xe3zG\ +\x00s\ +\x00o\x00u\x00r\x00c\x00e\x00_\x00c\x00o\x00n\x00t\x00r\x00o\x00l\x00-\x00w\x00a\ +\x00r\x00n\x00i\x00n\x00g\x00_\x00v\x002\x00.\x00s\x00v\x00g\ +\x00\x10\ +\x0c\xa1\xe6\x1f\ +\x00b\ +\x00a\x00l\x00l\x00_\x00p\x00e\x00n\x00d\x00i\x00n\x00g\x00.\x00i\x00c\x00o\ +\x00\x11\ +\x08tl?\ +\x00b\ +\x00a\x00l\x00l\x00_\x00d\x00i\x00s\x00a\x00b\x00l\x00e\x00d\x00.\x00i\x00c\x00o\ +\ +\x00\x1b\ +\x00\x22\x12'\ +\x00s\ +\x00o\x00u\x00r\x00c\x00e\x00_\x00c\x00o\x00n\x00t\x00r\x00o\x00l\x00_\x00e\x00r\ +\x00r\x00o\x00r\x00_\x00v\x002\x00.\x00s\x00v\x00g\ +" + +qt_resource_struct = b"\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00)\x00\x00\x00\x01\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x03\xa8\x00\x02\x00\x00\x00\x0c\x00\x00\x00\xc5\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x03\xe2\x00\x02\x00\x00\x002\x00\x00\x00\x93\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x01F\x00\x00\x00\x00\x00\x01\x00\x00\xb19\ +\x00\x00\x01y+\x8f\x93\xf2\ +\x00\x00\x01\xb2\x00\x02\x00\x00\x00\x01\x00\x00\x00Y\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x03\x84\x00\x00\x00\x00\x00\x01\x00\x00\xc6s\ +\x00\x00\x01x\xc7F\xf7\x89\ +\x00\x00\x00\xfe\x00\x00\x00\x00\x00\x01\x00\x00\xad\x12\ +\x00\x00\x01x\xc7F\xf7\xee\ +\x00\x00\x04\xc0\x00\x00\x00\x00\x00\x01\x00\x00\xceG\ +\x00\x00\x01x\xc7F\xf7\xd7\ +\x00\x00\x02p\x00\x00\x00\x00\x00\x01\x00\x00\xbec\ +\x00\x00\x01x\xc7F\xf8\x08\ +\x00\x00\x03\x0c\x00\x00\x00\x00\x00\x01\x00\x00\xc3\xef\ +\x00\x00\x01x\xc7F\xf8\x04\ +\x00\x00\x00$\x00\x00\x00\x00\x00\x01\x00\x00\x01\x88\ +\x00\x00\x01x\xc7F\xf7\x88\ +\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x01x\xc7F\xf7\xd9\ +\x00\x00\x03`\x00\x00\x00\x00\x00\x01\x00\x00\xc5\xe4\ +\x00\x00\x01x\xc7F\xf85\ +\x00\x00\x04\x22\x00\x00\x00\x00\x00\x01\x00\x00\xca\x80\ +\x00\x00\x01x\xc7F\xf7\xa9\ +\x00\x00\x01\xcc\x00\x00\x00\x00\x00\x01\x00\x00\xba{\ +\x00\x00\x01x\xc7F\xf7\xed\ +\x00\x00\x05f\x00\x00\x00\x00\x00\x01\x00\x00\xd6\xb3\ +\x00\x00\x01x\xc7F\xf7\x85\ +\x00\x00\x02\xe8\x00\x00\x00\x00\x00\x01\x00\x00\xc3E\ +\x00\x00\x01x\xc7F\xf88\ +\x00\x00\x01\x22\x00\x00\x00\x00\x00\x01\x00\x00\xae\x8b\ +\x00\x00\x01x\xc7F\xf7\x81\ +\x00\x00\x02\x94\x00\x00\x00\x00\x00\x01\x00\x00\xbfR\ +\x00\x00\x01x\xc7F\xf7|\ +\x00\x00\x05\xb8\x00\x00\x00\x00\x00\x01\x00\x00\xd9\x9f\ +\x00\x00\x01x\xc7F\xf6\xe8\ +\x00\x00\x00\x90\x00\x00\x00\x00\x00\x01\x00\x00\xa6\x97\ +\x00\x00\x01x\xc7F\xf7}\ +\x00\x00\x02\x08\x00\x00\x00\x00\x00\x01\x00\x00\xbb\x91\ +\x00\x00\x01x\xc7F\xf7\x82\ +\x00\x00\x05\x12\x00\x00\x00\x00\x00\x01\x00\x00\xd0\xa7\ +\x00\x00\x01x\xc7F\xf6\xeb\ +\x00\x00\x02\xb8\x00\x00\x00\x00\x00\x01\x00\x00\xc2a\ +\x00\x00\x01x\xc7F\xf8\x07\ +\x00\x00\x02@\x00\x00\x00\x00\x00\x01\x00\x00\xbd\x8a\ +\x00\x00\x01x\xc7F\xf8\x13\ +\x00\x00\x00`\x00\x00\x00\x00\x00\x01\x00\x00\xa5\xc3\ +\x00\x00\x01x\xc7F\xf8\x17\ +\x00\x00\x056\x00\x00\x00\x00\x00\x01\x00\x00\xd5\xb3\ +\x00\x00\x01x\xc7F\xf7\xf5\ +\x00\x00\x05\xdc\x00\x00\x00\x00\x00\x01\x00\x00\xdd\xf0\ +\x00\x00\x01x\xc7F\xf8&\ +\x00\x00\x03\xf2\x00\x00\x00\x00\x00\x01\x00\x00\xc9M\ +\x00\x00\x01x\xc7F\xf7\xf1\ +\x00\x00\x04t\x00\x00\x00\x00\x00\x01\x00\x00\xcd>\ +\x00\x00\x01x\xc7F\xf7\xf2\ +\x00\x00\x030\x00\x00\x00\x00\x00\x01\x00\x00\xc4\xe2\ +\x00\x00\x01x\xc7F\xf7\xf3\ +\x00\x00\x04F\x00\x00\x00\x00\x00\x01\x00\x00\xccj\ +\x00\x00\x01x\xc7F\xf8\x11\ +\x00\x00\x03\xb4\x00\x00\x00\x00\x00\x01\x00\x00\xc8y\ +\x00\x00\x01x\xc7F\xf8\x12\ +\x00\x00\x05\x8a\x00\x00\x00\x00\x00\x01\x00\x00\xd8\xcb\ +\x00\x00\x01x\xc7F\xf8\x15\ +\x00\x00\x04\xe4\x00\x00\x00\x00\x00\x01\x00\x00\xcf\xd3\ +\x00\x00\x01x\xc7F\xf8\x16\ +\x00\x00\x00\xe6\x00\x02\x00\x00\x00\x01\x00\x00\x00P\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x03\xf4\ +\x00\x00\x01x\xc7G\x01\xc4\ +\x00\x00\x02,\x00\x02\x00\x00\x00\x01\x00\x00\x000\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x01|\x00\x00\x00\x00\x00\x01\x00\x00\xb3\xeb\ +\x00\x00\x01y+\x8f\x93\xef\ +\x00\x00\x01\xf0\x00\x02\x00\x00\x00\x04\x00\x00\x00,\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\xb4\x00\x00\x00\x00\x00\x01\x00\x00\xa9\x0c\ +\x00\x00\x01y+\x8f\x93\xf0\ +\x00\x00\x04\xa4\x00\x02\x00\x00\x00\x01\x00\x00\x00*\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x03\xa8\x00\x02\x00\x00\x00\x01\x00\x00\x00+\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x06\x0c\x00\x01\x00\x00\x00\x01\x00\x00\xde\xc4\ +\x00\x00\x01y\x1f\xa4\xb3Q\ +\x00\x00\x16\x86\x00\x00\x00\x00\x00\x01\x00\x05\x97+\ +\x00\x00\x01x\xc7F\xed\xa9\ +\x00\x00\x16:\x00\x00\x00\x00\x00\x01\x00\x05\x95\x7f\ +\x00\x00\x01x\xc7F\xf0\x97\ +\x00\x00\x16`\x00\x00\x00\x00\x00\x01\x00\x05\x96S\ +\x00\x00\x01x\xc7F\xeb4\ +\x00\x00\x16\x1c\x00\x00\x00\x00\x00\x01\x00\x05\x94\x8c\ +\x00\x00\x01x\xc7F\xf0\x87\ +\x00\x00\x03\xa8\x00\x02\x00\x00\x00\x1f\x00\x00\x001\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x13\xb4\x00\x00\x00\x00\x00\x01\x00\x05\x80\xf9\ +\x00\x00\x01x\xc7D\x85\xca\ +\x00\x00\x14\x06\x00\x00\x00\x00\x00\x01\x00\x05\x83\x8d\ +\x00\x00\x01x\xc7D\x85\xcc\ +\x00\x00\x15v\x00\x00\x00\x00\x00\x01\x00\x05\x90T\ +\x00\x00\x01x\xc7D\x85\xc3\ +\x00\x00\x12\xf0\x00\x00\x00\x00\x00\x01\x00\x05z\x87\ +\x00\x00\x01x\xc7D\x83\xc5\ +\x00\x00\x12|\x00\x00\x00\x00\x00\x01\x00\x05w\x97\ +\x00\x00\x01x\xc7D\x85\xbb\ +\x00\x00\x152\x00\x00\x00\x00\x00\x01\x00\x05\x8d\xc0\ +\x00\x00\x01x\xc7D\x85e\ +\x00\x00\x12\x9e\x00\x00\x00\x00\x00\x01\x00\x05x\xe1\ +\x00\x00\x01x\xc7D\x85\xd0\ +\x00\x00\x14\xf6\x00\x00\x00\x00\x00\x01\x00\x05\x8b,\ +\x00\x00\x01x\xc7D\x84\xb4\ +\x00\x00\x11\xce\x00\x01\x00\x00\x00\x01\x00\x05s\x95\ +\x00\x00\x01x\xc7D\x83\xca\ +\x00\x00\x12(\x00\x00\x00\x00\x00\x01\x00\x05u\xe9\ +\x00\x00\x01x\xc7D\x85\xd2\ +\x00\x00\x12\x0c\x00\x01\x00\x00\x00\x01\x00\x05u>\ +\x00\x00\x01x\xc7D\x84\x12\ +\x00\x00\x11\xf0\x00\x00\x00\x00\x00\x01\x00\x05s\xf4\ +\x00\x00\x01x\xc7D\x84\x12\ +\x00\x00\x12\xc8\x00\x01\x00\x00\x00\x01\x00\x05z+\ +\x00\x00\x01x\xc7D\x83\xcf\ +\x00\x00\x13\x12\x00\x00\x00\x00\x00\x01\x00\x05{\xd1\ +\x00\x00\x01x\xc7D\x85\xc7\ +\x00\x00\x13\xe0\x00\x00\x00\x00\x00\x01\x00\x05\x82C\ +\x00\x00\x01x\xc7D\x85\xc8\ +\x00\x00\x13\x90\x00\x00\x00\x00\x00\x01\x00\x05\x7f\xaf\ +\x00\x00\x01x\xc7D\x85d\ +\x00\x00\x13B\x00\x00\x00\x00\x00\x01\x00\x05}\x1b\ +\x00\x00\x01x\xc7D\x85\xce\ +\x00\x00\x12\x5c\x00\x01\x00\x00\x00\x01\x00\x05w3\ +\x00\x00\x01x\xc7D\x85-\ +\x00\x00\x15\xc4\x00\x01\x00\x00\x00\x01\x00\x05\x92\xe8\ +\x00\x00\x01x\xc7D\x83\xcb\ +\x00\x00\x14.\x00\x01\x00\x00\x00\x01\x00\x05\x84\xd7\ +\x00\x00\x01x\xc7D\x85\xb9\ +\x00\x00\x14Z\x00\x01\x00\x00\x00\x01\x00\x05\x85\xa4\ +\x00\x00\x01x\xc7D\x83\xcc\ +\x00\x00\x13h\x00\x00\x00\x00\x00\x01\x00\x05~e\ +\x00\x00\x01x\xc7D\x85d\ +\x00\x00\x14x\x00\x00\x00\x00\x00\x01\x00\x05\x86\x04\ +\x00\x00\x01x\xc7D\x85\xb6\ +\x00\x00\x15\x94\x00\x00\x00\x00\x00\x01\x00\x05\x91\x9e\ +\x00\x00\x01x\xc7D\x85\xd4\ +\x00\x00\x14\x9c\x00\x00\x00\x00\x00\x01\x00\x05\x87N\ +\x00\x00\x01x\xc7D\x84\x0b\ +\x00\x00\x14\xba\x00\x00\x00\x00\x00\x01\x00\x05\x88\x98\ +\x00\x00\x01x\xc7D\x84\x0d\ +\x00\x00\x14\xd8\x00\x00\x00\x00\x00\x01\x00\x05\x89\xe2\ +\x00\x00\x01x\xc7D\x84\x0e\ +\x00\x00\x15\x14\x00\x00\x00\x00\x00\x01\x00\x05\x8cv\ +\x00\x00\x01x\xc7D\x84\x0e\ +\x00\x00\x15X\x00\x00\x00\x00\x00\x01\x00\x05\x8f\x0a\ +\x00\x00\x01x\xc7D\x84\x0f\ +\x00\x00\x11\xba\x00\x01\x00\x00\x00\x01\x00\x05s6\ +\x00\x00\x01x\xc7D\x84\xb5\ +\x00\x00\x15\xf0\x00\x00\x00\x00\x00\x01\x00\x05\x93B\ +\x00\x00\x01x\xc7D\x85\xc5\ +\x00\x00\x03\xa8\x00\x02\x00\x00\x00\x08\x00\x00\x00Q\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00$\x98\x00\x00\x00\x00\x00\x01\x00\x06+\x0e\ +\x00\x00\x01y+\x8f\x94\x0d\ +\x00\x00#\xa8\x00\x00\x00\x00\x00\x01\x00\x06\x16\xea\ +\x00\x00\x01y+\x8f\x94\x0b\ +\x00\x00$\x0a\x00\x00\x00\x00\x00\x01\x00\x06\x1e\xba\ +\x00\x00\x01y+\x8f\x94\x0b\ +\x00\x00$p\x00\x00\x00\x00\x00\x01\x00\x06&\x8c\ +\x00\x00\x01x\xc7F\xf7d\ +\x00\x00#\xe6\x00\x00\x00\x00\x00\x01\x00\x06\x1a8\ +\x00\x00\x01x\xc7F\xf6\xff\ +\x00\x00#D\x00\x00\x00\x00\x00\x01\x00\x06\x0f\x1e\ +\x00\x00\x01x\xc7F\xf6\xed\ +\x00\x00$J\x00\x00\x00\x00\x00\x01\x00\x06\x22\x0a\ +\x00\x00\x01x\xc7F\xf6\xf0\ +\x00\x00#j\x00\x00\x00\x00\x00\x01\x00\x06\x13\xa0\ +\x00\x00\x01y+\x8f\x94\x0c\ +\x00\x00\x16\xba\x00\x02\x00\x00\x009\x00\x00\x00Z\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00 :\x00\x00\x00\x00\x00\x01\x00\x05\xf1\xf4\ +\x00\x00\x01x\xc7F\xf0|\ +\x00\x00#\x0e\x00\x00\x00\x00\x00\x01\x00\x06\x0a1\ +\x00\x00\x01x\xc7F\xed\xa1\ +\x00\x00\x1e\xb2\x00\x00\x00\x00\x00\x01\x00\x05\xe2\xb6\ +\x00\x00\x01x\xc7F\xef\xf0\ +\x00\x00\x19\x08\x00\x00\x00\x00\x00\x01\x00\x05\xaf\x1d\ +\x00\x00\x01x\xc7F\xf0\xa1\ +\x00\x00!\xbc\x00\x00\x00\x00\x00\x01\x00\x05\xff\xfd\ +\x00\x00\x01x\xc7F\xf0W\ +\x00\x00\x17@\x00\x00\x00\x00\x00\x01\x00\x05\x9d\xdd\ +\x00\x00\x01x\xc7F\xed\xd6\ +\x00\x00\x19\xae\x00\x00\x00\x00\x00\x01\x00\x05\xb2\xec\ +\x00\x00\x01x\xc7F\xe9{\ +\x00\x00\x22b\x00\x00\x00\x00\x00\x01\x00\x06\x04c\ +\x00\x00\x01x\xc7F\xef\xab\ +\x00\x00\x1b\xde\x00\x00\x00\x00\x00\x01\x00\x05\xc5\xad\ +\x00\x00\x01x\xc7F\xcb~\ +\x00\x00\x18,\x00\x00\x00\x00\x00\x01\x00\x05\xa5\x22\ +\x00\x00\x01x\xc7F\xf0\x90\ +\x00\x00\x1a\xd6\x00\x00\x00\x00\x00\x01\x00\x05\xba\xbf\ +\x00\x00\x01x\xc7F\xe9@\ +\x00\x00\x1e<\x00\x00\x00\x00\x00\x01\x00\x05\xdcu\ +\x00\x00\x01x\xc7F\xf0=\ +\x00\x00 \xe0\x00\x00\x00\x00\x00\x01\x00\x05\xf6-\ +\x00\x00\x01x\xc7F\xf0\x03\ +\x00\x00\x1c\xba\x00\x00\x00\x00\x00\x01\x00\x05\xd0B\ +\x00\x00\x01x\xc7F\xed\xd8\ +\x00\x00\x1f\x8e\x00\x00\x00\x00\x00\x01\x00\x05\xec\xea\ +\x00\x00\x01x\xc7F\xed\xda\ +\x00\x00\x1cT\x00\x00\x00\x00\x00\x01\x00\x05\xcb\x82\ +\x00\x00\x01x\xc7F\xcc\x09\ +\x00\x00\x18b\x00\x00\x00\x00\x00\x01\x00\x05\xa6\x14\ +\x00\x00\x01x\xc7F\xe9f\ +\x00\x00\x1e\xe8\x00\x00\x00\x00\x00\x01\x00\x05\xe4c\ +\x00\x00\x01x\xc7F\xe9\x86\ +\x00\x00\x1b\x0c\x00\x00\x00\x00\x00\x01\x00\x05\xbc\x0d\ +\x00\x00\x01x\xc7F\xcb\xfe\ +\x00\x00\x1d\x96\x00\x00\x00\x00\x00\x01\x00\x05\xd7\x13\ +\x00\x00\x01x\xc7F\xe9\x82\ +\x00\x00!\x16\x00\x00\x00\x00\x00\x01\x00\x05\xf7\xeb\ +\x00\x00\x01x\xc7F\xe7N\ +\x00\x00\x17v\x00\x00\x00\x00\x00\x01\x00\x05\x9f\xff\ +\x00\x00\x01x\xc7F\xe97\ +\x00\x00\x1f\xc4\x00\x00\x00\x00\x00\x01\x00\x05\xee\xfa\ +\x00\x00\x01x\xc7F\xe7\xa5\ +\x00\x00\x22\x98\x00\x00\x00\x00\x00\x01\x00\x06\x06c\ +\x00\x00\x01x\xc7F\xe6\xb8\ +\x00\x00\x19\xe4\x00\x00\x00\x00\x00\x01\x00\x05\xb4\x0b\ +\x00\x00\x01x\xc7F\xef\xeb\ +\x00\x00\x1d\x16\x00\x00\x00\x00\x00\x01\x00\x05\xd3\xe3\ +\x00\x00\x01x\xc7F\xef\xe2\ +\x00\x00\x1bn\x00\x00\x00\x00\x00\x01\x00\x05\xc1)\ +\x00\x00\x01x\xc7F\xef\x93\ +\x00\x00\x1af\x00\x00\x00\x00\x00\x01\x00\x05\xb7h\ +\x00\x00\x01x\xc7F\xef\xee\ +\x00\x00\x19>\x00\x00\x00\x00\x00\x01\x00\x05\xaf\xef\ +\x00\x00\x01x\xc7F\xf00\ +\x00\x00\x17\xec\x00\x00\x00\x00\x00\x01\x00\x05\xa2\xf2\ +\x00\x00\x01x\xc7F\xed\xd3\ +\x00\x00\x16\xd0\x00\x00\x00\x00\x00\x01\x00\x05\x9b\x19\ +\x00\x00\x01x\xc7F\xef\xe6\ +\x00\x00!\xf2\x00\x00\x00\x00\x00\x01\x00\x06\x01P\ +\x00\x00\x01x\xc7F\xf0f\ +\x00\x00 p\x00\x00\x00\x00\x00\x01\x00\x05\xf2\xfb\ +\x00\x00\x01x\xc7F\xf0k\ +\x00\x00\x1f\x1e\x00\x00\x00\x00\x00\x01\x00\x05\xe5k\ +\x00\x00\x01x\xc7F\xed\xc2\ +\x00\x00\x1d\xcc\x00\x00\x00\x00\x00\x01\x00\x05\xd8!\ +\x00\x00\x01x\xc7F\xf0\x0e\ +\x00\x00\x1a&\x00\x00\x00\x00\x00\x01\x00\x05\xb5\xde\ +\x00\x00\x01x\xc7F\xf0%\ +\x00\x00\x18\x98\x00\x00\x00\x00\x00\x01\x00\x05\xa7M\ +\x00\x00\x01x\xc7F\xf0I\ +\x00\x00\x17\xac\x00\x00\x00\x00\x00\x01\x00\x05\xa1s\ +\x00\x00\x01x\xc7F\xf0,\ +\x00\x00\x22\xce\x00\x00\x00\x00\x00\x01\x00\x06\x08\x1f\ +\x00\x00\x01x\xc7F\xed\xdd\ +\x00\x00!|\x00\x00\x00\x00\x00\x01\x00\x05\xfe\x91\ +\x00\x00\x01x\xc7F\xf04\ +\x00\x00\x1f\xfa\x00\x00\x00\x00\x00\x01\x00\x05\xf0{\ +\x00\x00\x01x\xc7F\xf0*\ +\x00\x00\x1er\x00\x00\x00\x00\x00\x01\x00\x05\xdd\xd6\ +\x00\x00\x01x\xc7F\xed\xc6\ +\x00\x00\x1dV\x00\x00\x00\x00\x00\x01\x00\x05\xd5\xb7\ +\x00\x00\x01x\xc7F\xf0@\ +\x00\x00\x1c\x14\x00\x00\x00\x00\x00\x01\x00\x05\xca)\ +\x00\x00\x01x\xc7F\xf0K\ +\x00\x00\x1bB\x00\x00\x00\x00\x00\x01\x00\x05\xbe&\ +\x00\x00\x01x\xc7F\xed\xcb\ +\x00\x00\x1e\x0c\x00\x00\x00\x00\x00\x01\x00\x05\xd9\xa3\ +\x00\x00\x01x\xc7F\xed\xc8\ +\x00\x00 \xb0\x00\x00\x00\x00\x00\x01\x00\x05\xf4(\ +\x00\x00\x01x\xc7F\xef\xa6\ +\x00\x00\x1c\x8a\x00\x00\x00\x00\x00\x01\x00\x05\xcd\x7f\ +\x00\x00\x01x\xc7F\xed\xce\ +\x00\x00\x17\x10\x00\x00\x00\x00\x00\x01\x00\x05\x9c\xd8\ +\x00\x00\x01x\xc7F\xf0\x80\ +\x00\x00\x1f^\x00\x00\x00\x00\x00\x01\x00\x05\xeb\x8c\ +\x00\x00\x01x\xc7F\xf0:\ +\x00\x00\x19~\x00\x00\x00\x00\x00\x01\x00\x05\xb1p\ +\x00\x00\x01x\xc7F\xf0(\ +\x00\x00\x222\x00\x00\x00\x00\x00\x01\x00\x06\x02\x83\ +\x00\x00\x01x\xc7F\xef\xdd\ +\x00\x00\x1b\xae\x00\x00\x00\x00\x00\x01\x00\x05\xc3\x18\ +\x00\x00\x01x\xc7F\xed\xd1\ +\x00\x00!L\x00\x00\x00\x00\x00\x01\x00\x05\xf9\xa7\ +\x00\x00\x01y+\x8f\x93{\ +\x00\x00\x1a\xa6\x00\x00\x00\x00\x00\x01\x00\x05\xb92\ +\x00\x00\x01x\xc7F\xf0\x0c\ +\x00\x00\x18\xd8\x00\x00\x00\x00\x00\x01\x00\x05\xa8\xa5\ +\x00\x00\x01x\xc7F\xed\xa4\ +\x00\x00\x1c\xf0\x00\x00\x00\x00\x00\x01\x00\x05\xd2\x83\ +\x00\x00\x01x\xc7F\xe9<\ +\x00\x00\x0e\xba\x00\x00\x00\x00\x00\x01\x00\x04(&\ +\x00\x00\x01y+\x8f\x94\x12\ +\x00\x00\x0d\x0a\x00\x00\x00\x00\x00\x01\x00\x03\x91\x87\ +\x00\x00\x01y+\x8f\x93\xdc\ +\x00\x00\x0e\x80\x00\x00\x00\x00\x00\x01\x00\x04#\x0e\ +\x00\x00\x01y+\x8f\x94\x08\ +\x00\x00\x0d~\x00\x00\x00\x00\x00\x01\x00\x03\xf4\x82\ +\x00\x00\x01y+\x8f\x93\xcd\ +\x00\x00\x09\xf6\x00\x00\x00\x00\x00\x01\x00\x032\x17\ +\x00\x00\x01y+\x8f\x94\x10\ +\x00\x00\x09f\x00\x01\x00\x00\x00\x01\x00\x02i(\ +\x00\x00\x01x\xc7F\xf5\xfe\ +\x00\x00\x07\x12\x00\x00\x00\x00\x00\x01\x00\x01\x87\xf3\ +\x00\x00\x01y+\x8f\x93\xce\ +\x00\x00\x08:\x00\x00\x00\x00\x00\x01\x00\x01\xa3\x1b\ +\x00\x00\x01y+\x8f\x94\x0a\ +\x00\x00\x0f$\x00\x00\x00\x00\x00\x01\x00\x04jD\ +\x00\x00\x01x\xc7F\xf6G\ +\x00\x00\x0e\x10\x00\x00\x00\x00\x00\x01\x00\x04\x15\xa7\ +\x00\x00\x01y+\x8f\x93\xe3\ +\x00\x00\x08\xd2\x00\x00\x00\x00\x00\x01\x00\x02^f\ +\x00\x00\x01y+\x8f\x93\xd6\ +\x00\x00\x0eL\x00\x00\x00\x00\x00\x01\x00\x04\x1d\xe2\ +\x00\x00\x01y+\x8f\x94\x09\ +\x00\x00\x09*\x00\x00\x00\x00\x00\x01\x00\x02f\x89\ +\x00\x00\x01y+\x8f\x94\x07\ +\x00\x00\x0c \x00\x00\x00\x00\x00\x01\x00\x03u!\ +\x00\x00\x01y+\x8f\x93\xd5\ +\x00\x00\x07z\x00\x00\x00\x00\x00\x01\x00\x01\x96/\ +\x00\x00\x01y+\x8f\x93\xdf\ +\x00\x00\x08x\x00\x00\x00\x00\x00\x01\x00\x01\xbe\xd0\ +\x00\x00\x01x\xc7F\xf6*\ +\x00\x00\x0f\x9c\x00\x00\x00\x00\x00\x01\x00\x04\x87Q\ +\x00\x00\x01y+\x8f\x94\x12\ +\x00\x00\x08T\x00\x00\x00\x00\x00\x01\x00\x01\xa9(\ +\x00\x00\x01x\xc7F\xf61\ +\x00\x00\x0cb\x00\x00\x00\x00\x00\x01\x00\x03\x81c\ +\x00\x00\x01y+\x8f\x93\xda\ +\x00\x00\x07B\x00\x00\x00\x00\x00\x01\x00\x01\x8c\x97\ +\x00\x00\x01y+\x8f\x94\x11\ +\x00\x00\x08\xf8\x00\x00\x00\x00\x00\x01\x00\x02b\x14\ +\x00\x00\x01y+\x8f\x93\xce\ +\x00\x00\x0a\xc0\x00\x00\x00\x00\x00\x01\x00\x03N\xe6\ +\x00\x00\x01y+\x8f\x93\xd8\ +\x00\x00\x09\xc8\x00\x01\x00\x00\x00\x01\x00\x03\x12$\ +\x00\x00\x01x\xc7F\xf5\xf8\ +\x00\x00\x06\x92\x00\x00\x00\x00\x00\x01\x00\x01|\xed\ +\x00\x00\x01y+\x8f\x93\xcc\ +\x00\x00\x0a\xf8\x00\x00\x00\x00\x00\x01\x00\x03R\x98\ +\x00\x00\x01y+\x8f\x93\xdb\ +\x00\x00\x0d\x98\x00\x00\x00\x00\x00\x01\x00\x03\xf8 \ +\x00\x00\x01y+\x8f\x93\xdc\ +\x00\x00\x0c<\x00\x00\x00\x00\x00\x01\x00\x03|B\ +\x00\x00\x01y+\x8f\x93\xde\ +\x00\x00\x0bZ\x00\x00\x00\x00\x00\x01\x00\x03W)\ +\x00\x00\x01y+\x8f\x93\xd8\ +\x00\x00\x0a\x94\x00\x00\x00\x00\x00\x01\x00\x039\x16\ +\x00\x00\x01x\xc7F\xf60\ +\x00\x00\x0f\x00\x00\x00\x00\x00\x00\x01\x00\x04`\xcc\ +\x00\x00\x01y+\x8f\x94\x13\ +\x00\x00\x0fN\x00\x00\x00\x00\x00\x01\x00\x04\x7f\x0c\ +\x00\x00\x01y+\x8f\x93\xe2\ +\x00\x00\x0dD\x00\x00\x00\x00\x00\x01\x00\x03\x95\x12\ +\x00\x00\x01x\xc7F\xf6\x18\ +\x00\x00\x0a0\x00\x00\x00\x00\x00\x01\x00\x034\xb6\ +\x00\x00\x01y+\x8f\x93\xd9\ +\x00\x00\x060\x00\x00\x00\x00\x00\x01\x00\x01\x1a\xc3\ +\x00\x00\x01x\xc7F\xf6\x1b\ +\x00\x00\x0b\xe2\x00\x00\x00\x00\x00\x01\x00\x03p\xae\ +\x00\x00\x01y+\x8f\x93\xd7\ +\x00\x00\x06\xf0\x00\x00\x00\x00\x00\x01\x00\x01\x84\xba\ +\x00\x00\x01y+\x8f\x93\xfd\ +\x00\x00\x07\xb8\x00\x00\x00\x00\x00\x01\x00\x01\x9bR\ +\x00\x00\x01y+\x8f\x94\x0f\ +\x00\x00\x0f\xce\x00\x00\x00\x00\x00\x01\x00\x04\x90\xf8\ +\x00\x00\x01y+\x8f\x93\xcb\ +\x00\x00\x0e\xd0\x00\x01\x00\x00\x00\x01\x00\x04/\x99\ +\x00\x00\x01x\xc7F\xf5\xf3\ +\x00\x00\x06^\x00\x00\x00\x00\x00\x01\x00\x01zK\ +\x00\x00\x01y+\x8f\x94\x06\ +\x00\x00\x09\xb4\x00\x00\x00\x00\x00\x01\x00\x03\x0c\xa3\ +\x00\x00\x01y+\x8f\x93\xd0\ +\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x01\x00\x04\x93\xb2\ +\x00\x00\x01x\xc7F\xf5\xf0\ +\x00\x00\x09\x86\x00\x00\x00\x00\x00\x01\x00\x02\x8c\x97\ +\x00\x00\x01x\xc7F\xf6$\ +\x00\x00\x0d\xe4\x00\x01\x00\x00\x00\x01\x00\x03\xfb\xab\ +\x00\x00\x01x\xc7F\xf6\x04\ +\x00\x00\x0c\xec\x00\x00\x00\x00\x00\x01\x00\x03\x8a\xa7\ +\x00\x00\x01y+\x8f\x94\x0e\ +\x00\x00\x0b\xaa\x00\x00\x00\x00\x00\x01\x00\x03[\xa0\ +\x00\x00\x01x\xc7F\xf6L\ +\x00\x00\x06\xb8\x00\x00\x00\x00\x00\x01\x00\x01\x7f\x95\ +\x00\x00\x01y+\x8f\x93\xe0\ +\x00\x00\x0c\xb0\x00\x00\x00\x00\x00\x01\x00\x03\x86\x07\ +\x00\x00\x01y+\x8f\x93\xdd\ +\x00\x00\x07\xea\x00\x00\x00\x00\x00\x01\x00\x01\x9d\xf4\ +\x00\x00\x01y+\x8f\x93\xe1\ +\x00\x00\x08\xb4\x00\x00\x00\x00\x00\x01\x00\x02H\xcc\ +\x00\x00\x01x\xc7F\xf6D\ +\x00\x00\x11\x06\x00\x00\x00\x00\x00\x01\x00\x05@\xf3\ +\x00\x00\x01y+\x8f\x93\xd4\ +\x00\x00\x11\x88\x00\x00\x00\x00\x00\x01\x00\x05k\xae\ +\x00\x00\x01y+\x8f\x93\xd1\ +\x00\x00\x11b\x00\x00\x00\x00\x00\x01\x00\x05Yl\ +\x00\x00\x01y+\x8f\x93\xcf\ +\x00\x00\x11\xa0\x00\x00\x00\x00\x00\x01\x00\x05o\xc9\ +\x00\x00\x01y+\x8f\x93\xd2\ +\x00\x00\x10\x94\x00\x00\x00\x00\x00\x01\x00\x059\xf7\ +\x00\x00\x01x\xc7F\xf8/\ +\x00\x00\x106\x00\x00\x00\x00\x00\x01\x00\x05!\xc2\ +\x00\x00\x01x\xc7F\xf8,\ +\x00\x00\x11 \x00\x00\x00\x00\x00\x01\x00\x05F\xfd\ +\x00\x00\x01x\xc7F\xf83\ +\x00\x00\x10\xdc\x00\x00\x00\x00\x00\x01\x00\x05@%\ +\x00\x00\x01x\xc7F\xf8(\ +\x00\x00\x10`\x00\x00\x00\x00\x00\x01\x00\x05\x22O\ +\x00\x00\x01y+\x8f\x93\xd3\ +\x00\x00\x11J\x00\x00\x00\x00\x00\x01\x00\x05G\xa1\ +\x00\x00\x01y+\x8f\x93\xca\ +\x00\x00\x10z\x00\x00\x00\x00\x00\x01\x00\x0509\ +\x00\x00\x01y+\x8f\x93\xc9\ +\x00\x00\x10\xbe\x00\x00\x00\x00\x00\x01\x00\x05:\xa6\ +\x00\x00\x01y+\x8f\x93\xe3\ +" + +def qInitResources(): + QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +def qCleanupResources(): + QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) + +qInitResources() diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py index a9dcf97af9..552f9fff01 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_configuration_manager.py @@ -43,7 +43,7 @@ class TestConfigurationManager(TestCase): mock_find_files_with_suffix_under_directory: MagicMock, mock_get_default_account_id: MagicMock, mock_get_default_region: MagicMock) -> None: - TestConfigurationManager._expected_configuration_manager.setup() + TestConfigurationManager._expected_configuration_manager.setup("") mock_get_current_directory_path.assert_called_once() mock_check_path_exists.assert_called_once_with(TestConfigurationManager._expected_directory_path) mock_find_files_with_suffix_under_directory.assert_called_once_with( @@ -58,3 +58,29 @@ class TestConfigurationManager(TestCase): TestConfigurationManager._expected_account_id assert TestConfigurationManager._expected_configuration_manager.configuration.region == \ TestConfigurationManager._expected_region + + @patch("utils.aws_utils.get_default_region", return_value=_expected_region) + @patch("utils.aws_utils.get_default_account_id", return_value=_expected_account_id) + @patch("utils.file_utils.find_files_with_suffix_under_directory", return_value=_expected_config_files) + @patch("utils.file_utils.check_path_exists", return_value=True) + @patch("utils.file_utils.normalize_file_path", return_value=_expected_directory_path) + def test_setup_get_configuration_setup_with_path_as_expected(self, mock_normalize_file_path: MagicMock, + mock_check_path_exists: MagicMock, + mock_find_files_with_suffix_under_directory: MagicMock, + mock_get_default_account_id: MagicMock, + mock_get_default_region: MagicMock) -> None: + TestConfigurationManager._expected_configuration_manager.setup(TestConfigurationManager._expected_directory_path) + mock_normalize_file_path.assert_called_once() + mock_check_path_exists.assert_called_once_with(TestConfigurationManager._expected_directory_path) + mock_find_files_with_suffix_under_directory.assert_called_once_with( + TestConfigurationManager._expected_directory_path, constants.RESOURCE_MAPPING_CONFIG_FILE_NAME_SUFFIX) + mock_get_default_account_id.assert_called_once() + mock_get_default_region.assert_called_once() + assert TestConfigurationManager._expected_configuration_manager.configuration.config_directory == \ + TestConfigurationManager._expected_directory_path + assert TestConfigurationManager._expected_configuration_manager.configuration.config_files == \ + TestConfigurationManager._expected_config_files + assert TestConfigurationManager._expected_configuration_manager.configuration.account_id == \ + TestConfigurationManager._expected_account_id + assert TestConfigurationManager._expected_configuration_manager.configuration.region == \ + TestConfigurationManager._expected_region diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py index eb8304182f..e5c84c6579 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/manager/test_view_manager.py @@ -36,7 +36,7 @@ class TestViewManager(TestCase): main_window_patcher: patch = patch("manager.view_manager.QMainWindow") cls._mock_main_window = main_window_patcher.start() - window_icon_patcher: patch = patch("manager.view_manager.QPixmap") + window_icon_patcher: patch = patch("manager.view_manager.QIcon") window_icon_patcher.start() stacked_pages_patcher: patch = patch("manager.view_manager.QStackedWidget") diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py index 7244431e76..51bd6ade23 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/tests/unit/utils/test_aws_utils.py @@ -37,13 +37,12 @@ class TestAWSUtils(TestCase): .build() def setUp(self) -> None: - client_patcher: patch = patch("boto3.client") - self.addCleanup(client_patcher.stop) - self._mock_client: MagicMock = client_patcher.start() - session_patcher: patch = patch("boto3.session.Session") self.addCleanup(session_patcher.stop) self._mock_session: MagicMock = session_patcher.start() + self._mock_client: MagicMock = self._mock_session.return_value.client + + aws_utils.setup_default_session("default") def test_get_default_account_id_return_expected_account_id(self) -> None: mocked_sts_client: MagicMock = self._mock_client.return_value diff --git a/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py b/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py index 329d3ff44e..b0c3c9c1b3 100755 --- a/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py +++ b/Gems/AWSCore/Code/Tools/ResourceMappingTool/utils/aws_utils.py @@ -26,6 +26,8 @@ aws account, region, resources, etc. _PAGINATION_MAX_ITEMS: int = 10 _PAGINATION_PAGE_SIZE: int = 10 +default_session: boto3.session.Session = None + class AWSConstants(object): CLOUDFORMATION_SERVICE_NAME: str = "cloudformation" @@ -53,15 +55,20 @@ def _close_client_connection(client: BaseClient) -> None: def _initialize_boto3_aws_client(service: str, region: str = "") -> BaseClient: if region: - boto3_client: BaseClient = boto3.client(service, region_name=region) + boto3_client: BaseClient = default_session.client(service, region_name=region) else: - boto3_client: BaseClient = boto3.client(service) + boto3_client: BaseClient = default_session.client(service) boto3_client.meta.events.register( f"after-call.{service}.*", lambda **kwargs: _close_client_connection(boto3_client) ) return boto3_client +def setup_default_session(profile: str) -> None: + global default_session + default_session = boto3.session.Session(profile_name=profile) + + def get_default_account_id() -> str: sts_client: BaseClient = _initialize_boto3_aws_client(AWSConstants.STS_SERVICE_NAME) try: @@ -72,7 +79,7 @@ def get_default_account_id() -> str: def get_default_region() -> str: - region: str = boto3.session.Session().region_name + region: str = default_session.region_name if region: return region diff --git a/Gems/AWSCore/Code/awscore_editor_files.cmake b/Gems/AWSCore/Code/awscore_editor_files.cmake index 652f0455e1..13bfbb6102 100644 --- a/Gems/AWSCore/Code/awscore_editor_files.cmake +++ b/Gems/AWSCore/Code/awscore_editor_files.cmake @@ -12,6 +12,8 @@ set(FILES Include/Private/AWSCoreEditorSystemComponent.h Include/Private/Editor/AWSCoreEditorManager.h + Include/Private/Editor/Constants/AWSCoreEditorMenuLinks.h + Include/Private/Editor/Constants/AWSCoreEditorMenuNames.h Include/Private/Editor/UI/AWSCoreEditorMenu.h Include/Private/Editor/UI/AWSCoreResourceMappingToolAction.h Source/AWSCoreEditorSystemComponent.cpp diff --git a/Gems/AWSMetrics/Code/CMakeLists.txt b/Gems/AWSMetrics/Code/CMakeLists.txt index ffa9ac0408..aa790371d2 100644 --- a/Gems/AWSMetrics/Code/CMakeLists.txt +++ b/Gems/AWSMetrics/Code/CMakeLists.txt @@ -23,6 +23,7 @@ ly_add_target( PRIVATE AZ::AzCore AZ::AzFramework + PUBLIC Gem::AWSCore ) @@ -40,10 +41,15 @@ ly_add_target( PRIVATE AZ::AzCore AZ::AzFramework - Gem::AWSCore Gem::AWSMetrics.Static + RUNTIME_DEPENDENCIES + Gem::AWSCore ) +# Servers and Clients use the above metrics module +ly_create_alias(NAME AWSMetrics.Servers NAMESPACE Gem TARGETS Gem::AWSMetrics) +ly_create_alias(NAME AWSMetrics.Clients NAMESPACE Gem TARGETS Gem::AWSMetrics) + ################################################################################ # Tests ################################################################################ @@ -63,8 +69,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest AZ::AzCore AZ::AzFramework - Gem::AWSCore Gem::AWSMetrics.Static + RUNTIME_DEPENDENCIES + Gem::AWSCore ) ly_add_googletest( NAME Gem::AWSMetrics.Tests diff --git a/Gems/AWSMetrics/Code/Source/AWSMetricsModule.cpp b/Gems/AWSMetrics/Code/Source/AWSMetricsModule.cpp index 4967202483..f180e3e248 100644 --- a/Gems/AWSMetrics/Code/Source/AWSMetricsModule.cpp +++ b/Gems/AWSMetrics/Code/Source/AWSMetricsModule.cpp @@ -32,4 +32,4 @@ namespace AWSMetrics // DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM // The first parameter should be GemName_GemIdLower // The second should be the fully qualified name of the class above -AZ_DECLARE_MODULE_CLASS(AWSMetrics_cc6fc7a18fc047039a369a26100fcbbe, AWSMetrics::AWSMetricsModule) +AZ_DECLARE_MODULE_CLASS(Gem_AWSMetrics, AWSMetrics::AWSMetricsModule) diff --git a/Gems/Achievements/Code/CMakeLists.txt b/Gems/Achievements/Code/CMakeLists.txt index b49409bd5e..4b2aa07dab 100644 --- a/Gems/Achievements/Code/CMakeLists.txt +++ b/Gems/Achievements/Code/CMakeLists.txt @@ -44,3 +44,6 @@ ly_add_target( PRIVATE Gem::Achievements.Static ) + +# we'll load the above "Gem::Achievements" module in clients only. +ly_create_alias(NAME Achievements.Clients NAMESPACE Gem TARGETS Gem::Achievements) diff --git a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt index df97feaa3f..bdf76eca60 100644 --- a/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt +++ b/Gems/AssetMemoryAnalyzer/Code/CMakeLists.txt @@ -43,6 +43,10 @@ ly_add_target( Gem::ImGui ) +# AssetMemoryAnalyzer is available in clients and servers. +ly_create_alias(NAME AssetMemoryAnalyzer.Clients NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer) +ly_create_alias(NAME AssetMemoryAnalyzer.Servers NAMESPACE Gem TARGETS Gem::AssetMemoryAnalyzer) + ################################################################################ # Tests ################################################################################ @@ -65,3 +69,4 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) NAME Gem::AssetMemoryAnalyzer.Tests ) endif() + diff --git a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp index f371210d68..25d607dce3 100644 --- a/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp +++ b/Gems/AssetMemoryAnalyzer/Code/Source/AssetMemoryAnalyzer.cpp @@ -81,12 +81,12 @@ namespace AssetMemoryAnalyzer using AssetTree = AZ::Debug::AssetTree; using AssetTreeNode = typename AssetTree::NodeType; using AllocationTable = AZ::Debug::AllocationTable; - using MasterCodePoints = AZStd::unordered_set, AZStd::equal_to, AZ::Debug::AZStdAssetTrackingAllocator>; + using CodePoints = AZStd::unordered_set, AZStd::equal_to, AZ::Debug::AZStdAssetTrackingAllocator>; using mutex_type = AZStd::mutex; using lock_type = AZStd::lock_guard; mutex_type m_mutex; - MasterCodePoints m_masterCodePoints; + CodePoints m_codePoints; AssetTree m_assetTree; AllocationTable m_allocationTable; AZ::Debug::AssetTracking m_assetTracking; @@ -195,7 +195,7 @@ namespace AssetMemoryAnalyzer { // Store a record for this allocation, at this code-point lock_type lock(m_mutex); - auto insertResult = m_masterCodePoints.emplace(Data::CodePoint{ fileName ? fileName : "", lineNum, category }); + auto insertResult = m_codePoints.emplace(Data::CodePoint{ fileName ? fileName : "", lineNum, category }); Data::CodePoint* cp = &*insertResult.first; m_allocationTable.Get().emplace(address, AllocationTable::RecordType{ activeAsset, (uint32_t)byteSize, Data::AllocationData{ cp, categoryInfo } }); static_cast(activeAsset)->m_data.m_totalAllocations[(int)category]++; diff --git a/Gems/AssetValidation/Code/CMakeLists.txt b/Gems/AssetValidation/Code/CMakeLists.txt index 983ddd9e9d..f62baf57f5 100644 --- a/Gems/AssetValidation/Code/CMakeLists.txt +++ b/Gems/AssetValidation/Code/CMakeLists.txt @@ -65,3 +65,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND PAL_TRAIT_BUILD_HOST_TOOLS) NAME Gem::AssetValidation.Tests ) endif() + +# AssetValidation should be active in all clients plus tools +ly_create_alias(NAME AssetValidation.Clients NAMESPACE Gem TARGETS Gem::AssetValidation) +ly_create_alias(NAME AssetValidation.Tools NAMESPACE Gem TARGETS Gem::AssetValidation) + diff --git a/Gems/AssetValidation/Code/Tests/AssetValidationTestShared.h b/Gems/AssetValidation/Code/Tests/AssetValidationTestShared.h index ab9e65b896..d67260de3e 100644 --- a/Gems/AssetValidation/Code/Tests/AssetValidationTestShared.h +++ b/Gems/AssetValidation/Code/Tests/AssetValidationTestShared.h @@ -152,8 +152,11 @@ struct AssetValidationTest { AZ::SettingsRegistry::Register(&m_registry); - AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_Bootstrap(m_registry); + auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + m_registry.Set(projectPathKey, "AutomatedTesting"); AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(m_registry); + // Set the engine root to the temporary directory and re-update the runtime file paths auto enginePathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/engine_path"; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h index b8deb50cc5..9f6b6e629f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingBus.h @@ -13,8 +13,14 @@ #pragma once #include +#include #include +namespace AssetBuilderSDK +{ + struct JobProduct; +} + namespace ImageProcessingAtom { class ImageProcessingRequests @@ -35,4 +41,39 @@ namespace ImageProcessingAtom virtual IImageObjectPtr LoadImagePreview(const AZStd::string& filePath) = 0; }; using ImageProcessingRequestBus = AZ::EBus; + + class ImageBuilderRequests + : public AZ::EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + ///////////////////////////////////////////////////////////////////////// + + //! Create an image object + virtual IImageObjectPtr CreateImage( + AZ::u32 width, + AZ::u32 height, + AZ::u32 maxMipCount, + EPixelFormat pixelFormat) = 0; + + //! Convert an image and save its products to the specified folder + virtual AZStd::vector ConvertImageObject( + IImageObjectPtr imageObject, + const AZStd::string& presetName, + const AZStd::string& platformName, + const AZStd::string& outputDir, + const AZ::Data::AssetId& sourceAssetId, + const AZStd::string& sourceAssetName) = 0; + + //! Return whether the specified platform is supported by the image builder + virtual bool DoesSupportPlatform(const AZStd::string& platformId) = 0; + + //! Return whether the specified preset requires an image to be square and a power of 2 + virtual bool IsPresetFormatSquarePow2(const AZStd::string& presetName, const AZStd::string& platformName) = 0; + }; + + using ImageBuilderRequestBus = AZ::EBus; } // namespace ImageProcessingAtom diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingEditorBus.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingEditorBus.h index acd1d7a2da..bf5289bc45 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingEditorBus.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Include/Atom/ImageProcessing/ImageProcessingEditorBus.h @@ -13,8 +13,6 @@ #include -class QString; - namespace ImageProcessingAtomEditor { class ImageProcessingEditorRequests diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp index 04b015a66f..bf584c4d63 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Editor/EditorCommon.cpp @@ -108,11 +108,11 @@ namespace ImageProcessingAtomEditor { readableString = "PC"; } - else if (platformStrLowerCase == "es3") + else if (platformStrLowerCase == "android") { readableString = "Android"; } - else if (platformStrLowerCase == "osx_gl") + else if (platformStrLowerCase == "mac") { readableString = "macOS"; } diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp index 59c799a601..34d18a26eb 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.cpp @@ -88,11 +88,13 @@ namespace ImageProcessingAtom m_assetHandlers.emplace_back(AZ::RPI::MakeAssetHandler()); ImageProcessingRequestBus::Handler::BusConnect(); + ImageBuilderRequestBus::Handler::BusConnect(); } void BuilderPluginComponent::Deactivate() { ImageProcessingRequestBus::Handler::BusDisconnect(); + ImageBuilderRequestBus::Handler::BusDisconnect(); m_imageBuilder.BusDisconnect(); BuilderSettingManager::DestroyInstance(); CPixelFormats::DestroyInstance(); @@ -146,6 +148,78 @@ namespace ImageProcessingAtom return image; } + IImageObjectPtr BuilderPluginComponent::CreateImage( + AZ::u32 width, + AZ::u32 height, + AZ::u32 maxMipCount, + EPixelFormat pixelFormat) + { + IImageObjectPtr image(IImageObject::CreateImage(width, height, maxMipCount, pixelFormat)); + return image; + } + + AZStd::vector BuilderPluginComponent::ConvertImageObject( + IImageObjectPtr imageObject, + const AZStd::string& presetName, + const AZStd::string& platformName, + const AZStd::string& outputDir, + const AZ::Data::AssetId& sourceAssetId, + const AZStd::string& sourceAssetName) + { + AZStd::vector outProducts; + + AZStd::string_view presetFilePath; + const PresetSettings* preset = BuilderSettingManager::Instance()->GetPreset(presetName, platformName, &presetFilePath); + if (preset == nullptr) + { + AZ_Assert(false, "Cannot find preset with name %s.", presetName.c_str()); + return outProducts; + } + + AZStd::unique_ptr desc = AZStd::make_unique(); + TextureSettings& textureSettings = desc->m_textureSetting; + textureSettings.m_preset = preset->m_uuid; + desc->m_inputImage = imageObject; + desc->m_presetSetting = *preset; + desc->m_isPreview = false; + desc->m_platform = platformName; + desc->m_filePath = presetFilePath; + desc->m_isStreaming = BuilderSettingManager::Instance()->GetBuilderSetting(platformName)->m_enableStreaming; + desc->m_imageName = sourceAssetName; + desc->m_outputFolder = outputDir; + desc->m_sourceAssetId = sourceAssetId; + + // Create an image convert process + ImageConvertProcess process(AZStd::move(desc)); + process.ProcessAll(); + bool result = process.IsSucceed(); + if (result) + { + process.GetAppendOutputProducts(outProducts); + } + + return outProducts; + } + + bool BuilderPluginComponent::DoesSupportPlatform(const AZStd::string& platformId) + { + return ImageProcessingAtom::BuilderSettingManager::Instance()->DoesSupportPlatform(platformId); + } + + bool BuilderPluginComponent::IsPresetFormatSquarePow2(const AZStd::string& presetName, const AZStd::string& platformName) + { + AZStd::string_view filePath; + const PresetSettings* preset = BuilderSettingManager::Instance()->GetPreset(presetName, platformName, &filePath); + if (preset == nullptr) + { + AZ_Assert(false, "Cannot find preset with name %s.", presetName.c_str()); + return false; + } + + const PixelFormatInfo* info = CPixelFormats::GetInstance().GetPixelFormatInfo(preset->m_pixelFormat); + return info->bSquarePow2; + } + void ImageBuilderWorker::ShutDown() { // it is important to note that this will be called on a different thread than your process job thread diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h index fd099eb08a..a88ad3f587 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/ImageBuilderComponent.h @@ -47,6 +47,7 @@ namespace ImageProcessingAtom class BuilderPluginComponent : public AZ::Component , protected ImageProcessingRequestBus::Handler + , protected ImageBuilderRequestBus::Handler { public: AZ_COMPONENT(BuilderPluginComponent, "{A227F803-D2E4-406E-93EC-121EF45A64A1}") @@ -71,6 +72,24 @@ namespace ImageProcessingAtom IImageObjectPtr LoadImagePreview(const AZStd::string& filePath) override; //////////////////////////////////////////////////////////////////////// + //////////////////////////////////////////////////////////////////////// + // ImageBuilderRequestBus interface implementation + IImageObjectPtr CreateImage( + AZ::u32 width, + AZ::u32 height, + AZ::u32 maxMipCount, + EPixelFormat pixelFormat) override; + AZStd::vector ConvertImageObject( + IImageObjectPtr imageObject, + const AZStd::string& presetName, + const AZStd::string& platformName, + const AZStd::string& outputDir, + const AZ::Data::AssetId& sourceAssetId, + const AZStd::string& sourceAssetName) override; + bool DoesSupportPlatform(const AZStd::string& platformId) override; + bool IsPresetFormatSquarePow2(const AZStd::string& presetName, const AZStd::string& platformName) override; + //////////////////////////////////////////////////////////////////////// + private: BuilderPluginComponent(const BuilderPluginComponent&) = delete; diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h index 28c1e78bb6..ef0e7f9619 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/Mac/ImageProcessing_Traits_Mac.h @@ -12,7 +12,7 @@ #pragma once #define AZ_TRAIT_IMAGEPROCESSING_BESSEL_FUNCTION_FIRST_ORDER j1 -#define AZ_TRAIT_IMAGEPROCESSING_DEFAULT_PLATFORM "osx_gl" +#define AZ_TRAIT_IMAGEPROCESSING_DEFAULT_PLATFORM "mac" #define AZ_TRAIT_IMAGEPROCESSING_DEFINE_DIRECT3D_CONSTANTS 1 #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 1 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h index 28c1e78bb6..ef0e7f9619 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Source/Platform/iOS/ImageProcessing_Traits_iOS.h @@ -12,7 +12,7 @@ #pragma once #define AZ_TRAIT_IMAGEPROCESSING_BESSEL_FUNCTION_FIRST_ORDER j1 -#define AZ_TRAIT_IMAGEPROCESSING_DEFAULT_PLATFORM "osx_gl" +#define AZ_TRAIT_IMAGEPROCESSING_DEFAULT_PLATFORM "mac" #define AZ_TRAIT_IMAGEPROCESSING_DEFINE_DIRECT3D_CONSTANTS 1 #define AZ_TRAIT_IMAGEPROCESSING_PVRTEXLIB_USE_WINDLL_IMPORT 0 #define AZ_TRAIT_IMAGEPROCESSING_SQUISH_DO_NOT_USE_FASTCALL 1 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/1024x1024_24bit.tif.exportsettings b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/1024x1024_24bit.tif.exportsettings index 0417122033..7bce3041b9 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/1024x1024_24bit.tif.exportsettings +++ b/Gems/Atom/Asset/ImageProcessingAtom/Code/Tests/TestAssets/1024x1024_24bit.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /bumptype=none /M=62,18,32,83,50,50 /preset=Diffuse_highQ /mipgentype=kaiser /reduce="es3:0,ios:3,osx_gl:0,pc:4,provo:1" /ser=0 +/autooptimizefile=0 /bumptype=none /M=62,18,32,83,50,50 /preset=Diffuse_highQ /mipgentype=kaiser /reduce="android:0,ios:3,mac:0,pc:4,provo:1" /ser=0 diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Albedo.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Albedo.preset index 0b68493198..3a5122f18e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Albedo.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Albedo.preset @@ -25,7 +25,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{08A95286-ADB2-41E4-96EB-DB48F4726D6A}", "Name": "Albedo", "RGB_Weight": "CIEXYZ", @@ -67,7 +67,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{08A95286-ADB2-41E4-96EB-DB48F4726D6A}", "Name": "Albedo", "RGB_Weight": "CIEXYZ", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithCoverage.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithCoverage.preset index 3773857e0a..692ef99b1c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithCoverage.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithCoverage.preset @@ -23,7 +23,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{57ED16B1-407B-4E29-BCFC-D3BAE60F2C85}", "Name": "AlbedoWithCoverage", "RGB_Weight": "CIEXYZ", @@ -61,7 +61,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{57ED16B1-407B-4E29-BCFC-D3BAE60F2C85}", "Name": "AlbedoWithCoverage", "RGB_Weight": "CIEXYZ", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithGenericAlpha.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithGenericAlpha.preset index 530e36038d..4ebe773f0e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithGenericAlpha.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithGenericAlpha.preset @@ -23,7 +23,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{5D9ECB52-4CD9-4CB8-80E3-10CAE5EFB8A2}", "Name": "AlbedoWithGenericAlpha", "RGB_Weight": "CIEXYZ", @@ -61,7 +61,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{5D9ECB52-4CD9-4CB8-80E3-10CAE5EFB8A2}", "Name": "AlbedoWithGenericAlpha", "RGB_Weight": "CIEXYZ", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithOpacity.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithOpacity.preset index 6d6c156683..6049ef5bd4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithOpacity.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/AlbedoWithOpacity.preset @@ -23,7 +23,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{7BB7BC6C-D3DA-4184-AC42-BCD8C57DE565}", "Name": "AlbedoWithOpacity", "RGB_Weight": "CIEXYZ", @@ -61,7 +61,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{7BB7BC6C-D3DA-4184-AC42-BCD8C57DE565}", "Name": "AlbedoWithOpacity", "RGB_Weight": "CIEXYZ", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/AmbientOcclusion.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/AmbientOcclusion.preset index 4e69ae67f2..56dec20f3e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/AmbientOcclusion.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/AmbientOcclusion.preset @@ -17,7 +17,7 @@ "PixelFormat": "BC4" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{02ED0ECE-B198-49D9-85BC-CEBA6C28546C}", "Name": "AmbientOcclusion", "SourceColor": "Linear", @@ -43,7 +43,7 @@ ], "PixelFormat": "EAC_R11" }, - "osx_gl": { + "mac": { "UUID": "{02ED0ECE-B198-49D9-85BC-CEBA6C28546C}", "Name": "AmbientOcclusion", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/CloudShadows.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/CloudShadows.preset index f37acd2f9d..2280a06302 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/CloudShadows.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/CloudShadows.preset @@ -11,7 +11,7 @@ "IsPowerOf2": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{884B5F7C-44AC-4E9E-8B8A-559D098BE2C7}", "Name": "CloudShadows", "DestColor": "Linear", @@ -25,7 +25,7 @@ "PixelFormat": "EAC_R11", "IsPowerOf2": true }, - "osx_gl": { + "mac": { "UUID": "{884B5F7C-44AC-4E9E-8B8A-559D098BE2C7}", "Name": "CloudShadows", "DestColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ColorChart.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ColorChart.preset index 46327e87ed..5f0480cee7 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ColorChart.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ColorChart.preset @@ -15,7 +15,7 @@ "IsColorChart": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{0A17A85F-07EE-48A0-8BF8-D42F0A5E0B3C}", "Name": "ColorChart", "SourceColor": "Linear", @@ -37,7 +37,7 @@ "PixelFormat": "R8G8B8X8", "IsColorChart": true }, - "osx_gl": { + "mac": { "UUID": "{0A17A85F-07EE-48A0-8BF8-D42F0A5E0B3C}", "Name": "ColorChart", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ConvolvedCubemap.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ConvolvedCubemap.preset index fe87f49426..abdf6501be 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ConvolvedCubemap.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ConvolvedCubemap.preset @@ -30,7 +30,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{2174E04B-73BB-4DF1-8961-4900DC3C9D72}", "Name": "ConvolvedCubemap", "SourceColor": "Linear", @@ -82,7 +82,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{2174E04B-73BB-4DF1-8961-4900DC3C9D72}", "Name": "ConvolvedCubemap", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Decal_AlbedoWithOpacity.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Decal_AlbedoWithOpacity.preset index 2c47f9eaed..f1e43e74b1 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Decal_AlbedoWithOpacity.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Decal_AlbedoWithOpacity.preset @@ -18,7 +18,7 @@ "NumberResidentMips": 255 }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{E06B5087-2640-49B6-B9BA-D40048162B90}", "Name": "Decal_AlbedoWithOpacity", "FileMasks": [ @@ -46,7 +46,7 @@ // Decal Texture Arrays need all mips available immediately for packing. "NumberResidentMips": 255 }, - "osx_gl": { + "mac": { "UUID": "{E06B5087-2640-49B6-B9BA-D40048162B90}", "Name": "Decal_AlbedoWithOpacity", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness.preset index 23ec2347cd..991692c5cc 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness.preset @@ -18,7 +18,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{5096FC7B-0B2D-4466-9943-AD59922968E8}", "Name": "Detail_MergedAlbedoNormalsSmoothness", "SourceColor": "Linear", @@ -46,7 +46,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{5096FC7B-0B2D-4466-9943-AD59922968E8}", "Name": "Detail_MergedAlbedoNormalsSmoothness", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness_Lossless.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness_Lossless.preset index 3145c5cf8a..fec11218e8 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness_Lossless.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Detail_MergedAlbedoNormalsSmoothness_Lossless.preset @@ -17,7 +17,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{B6FC1AEF-907C-4157-9A1A-D9960F0E5B9A}", "Name": "Detail_MergedAlbedoNormalsSmoothness_Lossless", "SourceColor": "Linear", @@ -43,7 +43,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{B6FC1AEF-907C-4157-9A1A-D9960F0E5B9A}", "Name": "Detail_MergedAlbedoNormalsSmoothness_Lossless", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Displacement.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Displacement.preset index 86ba9d74c0..520e4ae193 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Displacement.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Displacement.preset @@ -28,7 +28,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{D7B4BEA6-6427-4295-B61B-62776D0056DE}", "Name": "Displacement", "SourceColor": "Linear", @@ -77,7 +77,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{D7B4BEA6-6427-4295-B61B-62776D0056DE}", "Name": "Displacement", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Emissive.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Emissive.preset index 5a98d2cd30..ffb16482fd 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Emissive.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Emissive.preset @@ -18,7 +18,7 @@ "DiscardAlpha": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{07041D83-E0C3-4726-8735-CA0FE550C9A0}", "Name": "Emissive", "RGB_Weight": "CIEXYZ", @@ -46,7 +46,7 @@ "PixelFormat": "ASTC_6x6", "DiscardAlpha": true }, - "osx_gl": { + "mac": { "UUID": "{07041D83-E0C3-4726-8735-CA0FE550C9A0}", "Name": "Emissive", "RGB_Weight": "CIEXYZ", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Gradient.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Gradient.preset index 9cf32093d1..33d7babf00 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Gradient.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Gradient.preset @@ -11,7 +11,7 @@ "IsPowerOf2": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{0D26B387-2FBA-456D-AB8E-613020BCC7F8}", "Name": "Gradient", "SourceColor": "Linear", @@ -25,7 +25,7 @@ "DestColor": "Linear", "IsPowerOf2": true }, - "osx_gl": { + "mac": { "UUID": "{0D26B387-2FBA-456D-AB8E-613020BCC7F8}", "Name": "Gradient", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Greyscale.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Greyscale.preset index c77c77b988..f06682be42 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Greyscale.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Greyscale.preset @@ -18,7 +18,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{B6B04FD3-BD7B-44AC-AD93-6FECD2BD4D76}", "Name": "Greyscale", "SourceColor": "Linear", @@ -46,7 +46,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{B6B04FD3-BD7B-44AC-AD93-6FECD2BD4D76}", "Name": "Greyscale", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLDiffuse.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLDiffuse.preset index fb4155a974..8bd6b348d1 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLDiffuse.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLDiffuse.preset @@ -28,7 +28,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{E3706342-BF21-4D9C-AE28-9670EB3EF3C5}", "Name": "IBLDiffuse", "FileMasks": [ @@ -74,7 +74,7 @@ "SubId": 3000 } }, - "osx_gl": { + "mac": { "UUID": "{E3706342-BF21-4D9C-AE28-9670EB3EF3C5}", "Name": "IBLDiffuse", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSkybox.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSkybox.preset index 530eb3d048..402fc470eb 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSkybox.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSkybox.preset @@ -26,7 +26,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{E6441EAC-9843-484B-8EFC-C03B2935B48D}", "Name": "IBLSkybox", "FileMasks": [ @@ -68,7 +68,7 @@ "IBLDiffusePreset": "{E3706342-BF21-4D9C-AE28-9670EB3EF3C5}" } }, - "osx_gl": { + "mac": { "UUID": "{E6441EAC-9843-484B-8EFC-C03B2935B48D}", "Name": "IBLSkybox", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSpecular.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSpecular.preset index db5a9276bd..d940f425c2 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSpecular.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/IBLSpecular.preset @@ -30,7 +30,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{908DA68C-97FB-4C4A-97BC-5A55F30F14FA}", "Name": "IBLSpecular", "FileMasks": [ @@ -80,7 +80,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{908DA68C-97FB-4C4A-97BC-5A55F30F14FA}", "Name": "IBLSpecular", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ImageBuilder.settings b/Gems/Atom/Asset/ImageProcessingAtom/Config/ImageBuilder.settings index c8d921a8ff..82a57dd614 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ImageBuilder.settings +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ImageBuilder.settings @@ -5,7 +5,7 @@ "ClassData": { "AnalysisFingerprint": "2", "BuildSettings": { - "es3": { + "android": { "GlossScale": 16.0, "GlossBias": 0.0, "Streaming": false, @@ -17,7 +17,7 @@ "Streaming": false, "Enable": true }, - "osx_gl": { + "mac": { "GlossScale": 16.0, "GlossBias": 0.0, "Streaming": false, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_R32F.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_R32F.preset new file mode 100644 index 0000000000..1bb23c6e96 --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_R32F.preset @@ -0,0 +1,45 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "MultiplatformPresetSettings", + "ClassData": { + "DefaultPreset": { + "UUID": "{10D4D7D8-23E2-4FC5-BE6A-DA9949D2C603}", + "Name": "LUT_R32F", + "FileMasks": ["_lutr32f"], + "SourceColor": "Linear", + "DestColor": "Linear", + "PixelFormat": "R32F" + }, + "PlatformsPresets": { + "es3": { + "UUID": "{10D4D7D8-23E2-4FC5-BE6A-DA9949D2C603}", + "Name": "LUT_R32F", + "SourceColor": "Linear", + "DestColor": "Linear", + "PixelFormat": "R32F" + }, + "ios": { + "UUID": "{10D4D7D8-23E2-4FC5-BE6A-DA9949D2C603}", + "Name": "LUT_R32F", + "SourceColor": "Linear", + "DestColor": "Linear", + "PixelFormat": "R32F" + }, + "osx_gl": { + "UUID": "{10D4D7D8-23E2-4FC5-BE6A-DA9949D2C603}", + "Name": "LUT_R32F", + "SourceColor": "Linear", + "DestColor": "Linear", + "PixelFormat": "R32F" + }, + "provo": { + "UUID": "{10D4D7D8-23E2-4FC5-BE6A-DA9949D2C603}", + "Name": "LUT_R32F", + "SourceColor": "Linear", + "DestColor": "Linear", + "PixelFormat": "R32F" + } + } + } +} diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG16.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG16.preset index 6bfb697a5e..183653d111 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG16.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG16.preset @@ -11,7 +11,7 @@ "PixelFormat": "R16G16" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{D55CBCD3-AF2D-4515-98AB-E278F6B3B5F6}", "Name": "LUT_RG16", "SourceColor": "Linear", @@ -25,7 +25,7 @@ "DestColor": "Linear", "PixelFormat": "R16G16" }, - "osx_gl": { + "mac": { "UUID": "{D55CBCD3-AF2D-4515-98AB-E278F6B3B5F6}", "Name": "LUT_RG16", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG32F.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG32F.preset index a010d26a9c..2cf0c6ca0a 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG32F.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG32F.preset @@ -12,7 +12,7 @@ "PixelFormat": "R32G32F" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{52470B8B-0798-4E03-B0D3-039D5141CFEC}", "Name": "LUT_RG32F", "SourceColor": "Linear", @@ -26,7 +26,7 @@ "DestColor": "Linear", "PixelFormat": "R32G32F" }, - "osx_gl": { + "mac": { "UUID": "{52470B8B-0798-4E03-B0D3-039D5141CFEC}", "Name": "LUT_RG32F", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG8.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG8.preset index ca636f486a..9838d532b2 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG8.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RG8.preset @@ -14,7 +14,7 @@ "PixelFormat": "R8G8" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{3791319D-043B-4011-8B6F-3DE96D0C4309}", "Name": "LUT_RG8", "SourceColor": "Linear", @@ -34,7 +34,7 @@ ], "PixelFormat": "R8G8" }, - "osx_gl": { + "mac": { "UUID": "{3791319D-043B-4011-8B6F-3DE96D0C4309}", "Name": "LUT_RG8", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16.preset new file mode 100644 index 0000000000..f36d566d7e --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16.preset @@ -0,0 +1,59 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "MultiplatformPresetSettings", + "ClassData": { + "DefaultPreset": { + "UUID": "{ABDFCED1-0565-4B7B-9BC1-82C473BCEEA2}", + "Name": "LUT_RGBA16", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16" + ], + "PixelFormat": "R16G16B16A16" + }, + "PlatformsPresets": { + "es3": { + "UUID": "{ABDFCED1-0565-4B7B-9BC1-82C473BCEEA2}", + "Name": "LUT_RGBA16", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16" + ], + "PixelFormat": "R16G16B16A16" + }, + "ios": { + "UUID": "{ABDFCED1-0565-4B7B-9BC1-82C473BCEEA2}", + "Name": "LUT_RGBA16", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16" + ], + "PixelFormat": "R16G16B16A16" + }, + "osx_gl": { + "UUID": "{ABDFCED1-0565-4B7B-9BC1-82C473BCEEA2}", + "Name": "LUT_RGBA16", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16" + ], + "PixelFormat": "R16G16B16A16" + }, + "provo": { + "UUID": "{ABDFCED1-0565-4B7B-9BC1-82C473BCEEA2}", + "Name": "LUT_RGBA16", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16" + ], + "PixelFormat": "R16G16B16A16" + } + } + } +} diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16F.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16F.preset new file mode 100644 index 0000000000..367c5101b3 --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA16F.preset @@ -0,0 +1,59 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "MultiplatformPresetSettings", + "ClassData": { + "DefaultPreset": { + "UUID": "{6D75F093-C826-437A-AD94-8631A5A4E8A2}", + "Name": "LUT_RGBA16F", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16f" + ], + "PixelFormat": "R16G16B16A16F" + }, + "PlatformsPresets": { + "es3": { + "UUID": "{6D75F093-C826-437A-AD94-8631A5A4E8A2}", + "Name": "LUT_RGBA16F", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16f" + ], + "PixelFormat": "R16G16B16A16F" + }, + "ios": { + "UUID": "{6D75F093-C826-437A-AD94-8631A5A4E8A2}", + "Name": "LUT_RGBA16F", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16f" + ], + "PixelFormat": "R16G16B16A16F" + }, + "osx_gl": { + "UUID": "{6D75F093-C826-437A-AD94-8631A5A4E8A2}", + "Name": "LUT_RGBA16F", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16f" + ], + "PixelFormat": "R16G16B16A16F" + }, + "provo": { + "UUID": "{6D75F093-C826-437A-AD94-8631A5A4E8A2}", + "Name": "LUT_RGBA16F", + "SourceColor": "Linear", + "DestColor": "Linear", + "FileMasks": [ + "_lutrgba16f" + ], + "PixelFormat": "R16G16B16A16F" + } + } + } +} diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA32F.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA32F.preset index 717ece058d..3a456825bf 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA32F.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA32F.preset @@ -12,7 +12,7 @@ "PixelFormat": "R32G32B32A32F" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{AC4C49D4-2C70-425A-8DBF-E7FB2C61CF8D}", "Name": "LUT_RGBA32F", "SourceColor": "Linear", @@ -26,7 +26,7 @@ "DestColor": "Linear", "PixelFormat": "R32G32B32A32F" }, - "osx_gl": { + "mac": { "UUID": "{AC4C49D4-2C70-425A-8DBF-E7FB2C61CF8D}", "Name": "LUT_RGBA32F", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA8.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA8.preset index 6dbb29f830..49bf33dd84 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA8.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LUT_RGBA8.preset @@ -10,7 +10,7 @@ "DestColor": "Linear" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{3A6BB297-B610-4EA5-8DA4-610FB12B9EC0}", "Name": "LUT_RGBA8", "SourceColor": "Linear", @@ -22,7 +22,7 @@ "SourceColor": "Linear", "DestColor": "Linear" }, - "osx_gl": { + "mac": { "UUID": "{3A6BB297-B610-4EA5-8DA4-610FB12B9EC0}", "Name": "LUT_RGBA8", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LayerMask.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LayerMask.preset index 9c57f80709..5ce06aaea2 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LayerMask.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LayerMask.preset @@ -15,7 +15,7 @@ "PixelFormat": "R8G8B8X8" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{B1AC2F76-CB1A-46A8-B92D-B8DFBB564FCF}", "Name": "LayerMask", "SourceColor": "Linear", @@ -37,7 +37,7 @@ ], "PixelFormat": "R8G8B8X8" }, - "osx_gl": { + "mac": { "UUID": "{B1AC2F76-CB1A-46A8-B92D-B8DFBB564FCF}", "Name": "LayerMask", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LensOptics.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LensOptics.preset index 84294dfbcc..9f4b5bf68d 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LensOptics.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LensOptics.preset @@ -9,7 +9,7 @@ "PixelFormat": "BC1" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{3000A993-0A04-4E08-A813-DFB1A47A0980}", "Name": "LensOptics", "PixelFormat": "ETC2" @@ -19,7 +19,7 @@ "Name": "LensOptics", "PixelFormat": "ASTC_4x4" }, - "osx_gl": { + "mac": { "UUID": "{3000A993-0A04-4E08-A813-DFB1A47A0980}", "Name": "LensOptics", "PixelFormat": "BC1" diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LightProjector.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LightProjector.preset index 8c98394d36..ede264a78e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LightProjector.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LightProjector.preset @@ -14,7 +14,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{1DFEF41A-D97F-40FB-99D3-C142A3E5225E}", "Name": "LightProjector", "DestColor": "Linear", @@ -34,7 +34,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{1DFEF41A-D97F-40FB-99D3-C142A3E5225E}", "Name": "LightProjector", "DestColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/LoadingScreen.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/LoadingScreen.preset index f64c48eb95..ad0e2ddf06 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/LoadingScreen.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/LoadingScreen.preset @@ -9,7 +9,7 @@ "PixelFormat": "R8G8B8X8" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{9ED87726-12AB-4BE0-9397-AD62AE56D9E2}", "Name": "LoadingScreen", "PixelFormat": "R8G8B8X8" @@ -19,7 +19,7 @@ "Name": "LoadingScreen", "PixelFormat": "R8G8B8X8" }, - "osx_gl": { + "mac": { "UUID": "{9ED87726-12AB-4BE0-9397-AD62AE56D9E2}", "Name": "LoadingScreen", "PixelFormat": "R8G8B8X8" diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Minimap.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Minimap.preset index a402a2636c..9370de063d 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Minimap.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Minimap.preset @@ -15,7 +15,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{0D2F4C31-A665-4862-9C63-9E49A58E9A37}", "Name": "Minimap", "SuppressEngineReduce": true, @@ -37,7 +37,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{0D2F4C31-A665-4862-9C63-9E49A58E9A37}", "Name": "Minimap", "SuppressEngineReduce": true, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/MuzzleFlash.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/MuzzleFlash.preset index f5ecc58d1a..459cd5b1fb 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/MuzzleFlash.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/MuzzleFlash.preset @@ -14,7 +14,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{8BCC23A5-D08E-458E-B0B3-087C65FA1D31}", "Name": "MuzzleFlash", "SuppressEngineReduce": true, @@ -34,7 +34,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{8BCC23A5-D08E-458E-B0B3-087C65FA1D31}", "Name": "MuzzleFlash", "SuppressEngineReduce": true, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Normals.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Normals.preset index 104f3b4a39..04307eada4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Normals.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Normals.preset @@ -27,7 +27,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{508B21D5-5250-4003-97EC-1CF28D571ACF}", "Name": "Normals", "SourceColor": "Linear", @@ -75,7 +75,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{508B21D5-5250-4003-97EC-1CF28D571ACF}", "Name": "Normals", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsFromDisplacement.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsFromDisplacement.preset index c513720b68..46e97c3443 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsFromDisplacement.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsFromDisplacement.preset @@ -19,7 +19,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{8AE5D8D7-ECF8-4B7D-91DE-8F787E3B4210}", "Name": "NormalsFromDisplacement", "SourceColor": "Linear", @@ -49,7 +49,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{8AE5D8D7-ECF8-4B7D-91DE-8F787E3B4210}", "Name": "NormalsFromDisplacement", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness.preset index e773f7d910..b8f6e38ac1 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness.preset @@ -25,7 +25,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{6EE749F4-846E-4F7A-878C-F211F85EA59F}", "Name": "NormalsWithSmoothness", "SourceColor": "Linear", @@ -67,7 +67,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{6EE749F4-846E-4F7A-878C-F211F85EA59F}", "Name": "NormalsWithSmoothness", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness_Legacy.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness_Legacy.preset index 4cf7af6f29..58bb02cd72 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness_Legacy.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/NormalsWithSmoothness_Legacy.preset @@ -22,7 +22,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{A92541B8-2E70-4EF1-BA88-1DC1EA2A2341}", "Name": "NormalsWithSmoothness_Legacy", "SourceColor": "Linear", @@ -58,7 +58,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{A92541B8-2E70-4EF1-BA88-1DC1EA2A2341}", "Name": "NormalsWithSmoothness_Legacy", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Opacity.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Opacity.preset index 265379d053..bbd7fd5db9 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Opacity.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Opacity.preset @@ -27,7 +27,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{F3D5E572-A3CF-435A-A2AB-75D2B6907847}", "Name": "Opacity", "SourceColor": "Linear", @@ -73,7 +73,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{F3D5E572-A3CF-435A-A2AB-75D2B6907847}", "Name": "Opacity", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage.preset index 03744dee9e..e51848a116 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage.preset @@ -8,7 +8,7 @@ "Name": "ReferenceImage" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{C659D222-F56B-4B61-A2F8-C1FA547F3C39}", "Name": "ReferenceImage" }, @@ -16,7 +16,7 @@ "UUID": "{C659D222-F56B-4B61-A2F8-C1FA547F3C39}", "Name": "ReferenceImage" }, - "osx_gl": { + "mac": { "UUID": "{C659D222-F56B-4B61-A2F8-C1FA547F3C39}", "Name": "ReferenceImage" }, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinear.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinear.preset index 4d75e7ae1d..d9b9c17d07 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinear.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinear.preset @@ -13,7 +13,7 @@ "DiscardAlpha": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{46D9F30F-793C-4449-BCEF-12A396E61B2C}", "Name": "ReferenceImage_HDRLinear", "SourceColor": "Linear", @@ -31,7 +31,7 @@ "PixelFormat": "R9G9B9E5", "DiscardAlpha": true }, - "osx_gl": { + "mac": { "UUID": "{46D9F30F-793C-4449-BCEF-12A396E61B2C}", "Name": "ReferenceImage_HDRLinear", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinearUncompressed.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinearUncompressed.preset index 8344102425..8a5a83afa3 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinearUncompressed.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_HDRLinearUncompressed.preset @@ -13,7 +13,7 @@ "DiscardAlpha": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{EEF24422-C8F0-4ECE-B32A-C70DB8129466}", "Name": "ReferenceImage_HDRLinearUncompressed", "SourceColor": "Linear", @@ -31,7 +31,7 @@ "PixelFormat": "R16G16B16A16F", "DiscardAlpha": true }, - "osx_gl": { + "mac": { "UUID": "{EEF24422-C8F0-4ECE-B32A-C70DB8129466}", "Name": "ReferenceImage_HDRLinearUncompressed", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_Linear.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_Linear.preset index 515e9b0512..bf72f21b06 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_Linear.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReferenceImage_Linear.preset @@ -11,7 +11,7 @@ "SuppressEngineReduce": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{02C3D9F5-3637-49BA-A48A-D68D629A4D14}", "Name": "ReferenceImage_Linear", "SourceColor": "Linear", @@ -25,7 +25,7 @@ "DestColor": "Linear", "SuppressEngineReduce": true }, - "osx_gl": { + "mac": { "UUID": "{02C3D9F5-3637-49BA-A48A-D68D629A4D14}", "Name": "ReferenceImage_Linear", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance.preset index 58e283add7..1844e0186e 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance.preset @@ -34,7 +34,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{7A3CC95E-0A0C-4CA1-8357-5712B028B77D}", "Name": "Reflectance", "SourceColor": "Linear", @@ -92,7 +92,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{7A3CC95E-0A0C-4CA1-8357-5712B028B77D}", "Name": "Reflectance", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReflectanceWithSmoothness_Legacy.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReflectanceWithSmoothness_Legacy.preset index e386d08a35..e51cc7122b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/ReflectanceWithSmoothness_Legacy.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/ReflectanceWithSmoothness_Legacy.preset @@ -16,7 +16,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{851128B5-7454-42C4-83CE-FCFE071834C5}", "Name": "ReflectanceWithSmoothness_Legacy", "FileMasks": [ @@ -40,7 +40,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{851128B5-7454-42C4-83CE-FCFE071834C5}", "Name": "ReflectanceWithSmoothness_Legacy", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance_Linear.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance_Linear.preset index 767b0b67eb..07cc39c955 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance_Linear.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Reflectance_Linear.preset @@ -18,7 +18,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{9B2114F5-118A-4B3A-9CFE-97FA01EC8CFE}", "Name": "Reflectance_Linear", "DestColor": "Linear", @@ -46,7 +46,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{9B2114F5-118A-4B3A-9CFE-97FA01EC8CFE}", "Name": "Reflectance_Linear", "DestColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Font.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Font.preset index b2bbf905db..f76741148c 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Font.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Font.preset @@ -12,7 +12,7 @@ "IsPowerOf2": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{F34E3711-5F34-4DBC-8F5D-6340D3989F4B}", "Name": "SF_Font", "SourceColor": "Linear", @@ -28,7 +28,7 @@ "SuppressEngineReduce": true, "IsPowerOf2": true }, - "osx_gl": { + "mac": { "UUID": "{F34E3711-5F34-4DBC-8F5D-6340D3989F4B}", "Name": "SF_Font", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Gradient.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Gradient.preset index 41ba10f55c..aff25dc83d 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Gradient.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Gradient.preset @@ -12,7 +12,7 @@ "IsPowerOf2": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{E7F9DF56-DCB0-4683-96EE-F04DA547BE24}", "Name": "SF_Gradient", "SourceColor": "Linear", @@ -28,7 +28,7 @@ "SuppressEngineReduce": true, "IsPowerOf2": true }, - "osx_gl": { + "mac": { "UUID": "{E7F9DF56-DCB0-4683-96EE-F04DA547BE24}", "Name": "SF_Gradient", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image.preset index e36e42860d..46a32ce5d4 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image.preset @@ -13,7 +13,7 @@ "IsPowerOf2": true }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{189A42CB-AEE3-4B80-B276-0FDB0ECA140C}", "Name": "SF_Image", "SourceColor": "Linear", @@ -31,7 +31,7 @@ "PixelFormat": "PVRTC4", "IsPowerOf2": true }, - "osx_gl": { + "mac": { "UUID": "{189A42CB-AEE3-4B80-B276-0FDB0ECA140C}", "Name": "SF_Image", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image_nonpower2.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image_nonpower2.preset index fa2fe2ae72..0ba70d2ca3 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image_nonpower2.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/SF_Image_nonpower2.preset @@ -12,7 +12,7 @@ "PixelFormat": "BC1" }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{C456B8AB-C360-4822-BCDD-225252D0E697}", "Name": "SF_Image_nonpower2", "SourceColor": "Linear", @@ -28,7 +28,7 @@ "SuppressEngineReduce": true, "PixelFormat": "PVRTC4" }, - "osx_gl": { + "mac": { "UUID": "{C456B8AB-C360-4822-BCDD-225252D0E697}", "Name": "SF_Image_nonpower2", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Skybox.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Skybox.preset index 9102bd53bb..4f71855ecf 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Skybox.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Skybox.preset @@ -21,7 +21,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{F359CD3B-37E6-4627-B4F6-2DFC2C0E3C1C}", "Name": "Skybox", "FileMasks": [ @@ -55,7 +55,7 @@ "RequiresConvolve": false } }, - "osx_gl": { + "mac": { "UUID": "{F359CD3B-37E6-4627-B4F6-2DFC2C0E3C1C}", "Name": "Skybox", "FileMasks": [ diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo.preset index 19881f93d7..84a70935f1 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo.preset @@ -16,7 +16,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{88D07159-2FC0-4CBE-82CC-A9DC258C9351}", "Name": "Terrain_Albedo", "SourceColor": "Linear", @@ -40,7 +40,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{88D07159-2FC0-4CBE-82CC-A9DC258C9351}", "Name": "Terrain_Albedo", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo_HighPassed.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo_HighPassed.preset index 2fcbb012d4..1d83737ef9 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo_HighPassed.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Terrain_Albedo_HighPassed.preset @@ -15,7 +15,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{7827AA52-0A7B-43E7-8CD4-55E0BC513AF1}", "Name": "Terrain_Albedo_HighPassed", "SourceColor": "Linear", @@ -37,7 +37,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{7827AA52-0A7B-43E7-8CD4-55E0BC513AF1}", "Name": "Terrain_Albedo_HighPassed", "SourceColor": "Linear", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/Uncompressed.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/Uncompressed.preset index d0dbbcba6f..6e28cafe11 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/Uncompressed.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/Uncompressed.preset @@ -13,7 +13,7 @@ } }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{E996A696-991C-4FFC-B270-F5AD408B0618}", "Name": "Uncompressed", "PixelFormat": "R8G8B8X8", @@ -31,7 +31,7 @@ "MipGenType": "Box" } }, - "osx_gl": { + "mac": { "UUID": "{E996A696-991C-4FFC-B270-F5AD408B0618}", "Name": "Uncompressed", "PixelFormat": "R8G8B8X8", diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Compressed.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Compressed.preset index 01595a3425..6f70e8f14f 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Compressed.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Compressed.preset @@ -13,7 +13,7 @@ "FileMasks": [ "_ui" ] }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{2828FBFE-BDF9-45A7-9370-F93822719CCF}", "Name": "UserInterface_Compressed", "SuppressEngineReduce": true, @@ -25,7 +25,7 @@ "SuppressEngineReduce": true, "PixelFormat": "ASTC_6x6" }, - "osx_gl": { + "mac": { "UUID": "{2828FBFE-BDF9-45A7-9370-F93822719CCF}", "Name": "UserInterface_Compressed", "SuppressEngineReduce": true, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Lossless.preset b/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Lossless.preset index 78c63790ab..39066b242b 100644 --- a/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Lossless.preset +++ b/Gems/Atom/Asset/ImageProcessingAtom/Config/UserInterface_Lossless.preset @@ -13,7 +13,7 @@ "FileMasks": [ "_ui" ] }, "PlatformsPresets": { - "es3": { + "android": { "UUID": "{83003128-F63E-422B-AEC2-68F0A947225F}", "Name": "UserInterface_Lossless", "SuppressEngineReduce": true, @@ -25,7 +25,7 @@ "SuppressEngineReduce": true, "PixelFormat": "R8G8B8A8" }, - "osx_gl": { + "mac": { "UUID": "{83003128-F63E-422B-AEC2-68F0A947225F}", "Name": "UserInterface_Lossless", "SuppressEngineReduce": true, diff --git a/Gems/Atom/Asset/ImageProcessingAtom/gem.json b/Gems/Atom/Asset/ImageProcessingAtom/gem.json new file mode 100644 index 0000000000..86256bff9d --- /dev/null +++ b/Gems/Atom/Asset/ImageProcessingAtom/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "ImageProcessingAtom", + "display_name": "Atom Image Processing", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt index 7d82ca5869..dd8afec534 100644 --- a/Gems/Atom/Asset/Shader/Code/CMakeLists.txt +++ b/Gems/Atom/Asset/Shader/Code/CMakeLists.txt @@ -98,7 +98,39 @@ ly_add_target( Gem::Atom_RPI.Edit RUNTIME_DEPENDENCIES 3rdParty::DirectXShaderCompilerDxc - 3rdParty::DirectXShaderCompilerDxcAz 3rdParty::SPIRVCross 3rdParty::azslc ) + +################################################################################ +# Tests +################################################################################ +if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + + ly_add_target( + NAME Atom_Asset_Shader.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + atom_asset_shader_builders_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + . + Source/Editor + Tests + BUILD_DEPENDENCIES + PRIVATE + AZ::AtomCore + AZ::AzTest + AZ::AzFramework + AZ::AzToolsFramework + Legacy::CryCommon + Gem::Atom_RPI.Public + Gem::Atom_RHI.Public + Gem::Atom_RPI.Edit + Gem::Atom_Asset_Shader.Static + ) + ly_add_googletest( + NAME Gem::Atom_Asset_Shader.Tests + ) + +endif() diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslBuilder.cpp index 0ce7109067..668d6866d3 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslBuilder.cpp @@ -185,7 +185,8 @@ namespace AZ // we can't use a temporary folder because CreateJobs API does not warrant side effects, and does not prepare a temp folder. // we can't use the OS temp folder anyway, because many includes (eg #include "../RPI/Shadow.h") are relative and will only work from the original location AZStd::string prependedPath = ShaderBuilderUtility::DumpAzslPrependedCode( - BuilderName, prependedAzslSourceCode, originalLocation, ShaderBuilderUtility::ExtractStemName(fullPath.c_str()), shaderPlatformInterface->GetAPIName().GetStringView()); + BuilderName, prependedAzslSourceCode, originalLocation, ShaderBuilderUtility::ExtractStemName(fullPath.c_str()), + shaderPlatformInterface->GetAPIName().GetStringView()); // run mcpp PreprocessorData preprocessorData = PreprocessSource(prependedPath, fullPath, buildOptions.m_preprocessorSettings); jobDescriptor.m_jobParameters[(u32)JobParameterIndices::PreprocessorError] = preprocessorData.diagnostics; // save for ProcessJob @@ -221,7 +222,7 @@ namespace AZ } // eg: ("D:/p/x.a", "D:/p/x.b") -> yes - static bool HasSameStemName(const AZStd::string& lhsPath, const AZStd::string& rhsPath) + static bool HasSameFileName(const AZStd::string& lhsPath, const AZStd::string& rhsPath) { using namespace StringFunc::Path; AZStd::string stem1; @@ -307,7 +308,8 @@ namespace AZ buildOptions.m_compilerArguments.Merge(shaderAssetSource.m_compiler); // Earlier, we declared a job dependency on the .azsl's job, let's access the produced assets: - uint32_t subId = ShaderBuilderUtility::MakeAzslBuildProductSubId(RPI::ShaderAssetSubId::GeneratedSource, platformInterface->GetAPIType()); + uint32_t subId = ShaderBuilderUtility::MakeAzslBuildProductSubId( + RPI::ShaderAssetSubId::GeneratedHlslSource, platformInterface->GetAPIType()); auto assetIdOutcome = RPI::AssetUtils::MakeAssetId(inputFiles->m_azslSourceFullPath, subId); AZ_Warning(BuilderName, assetIdOutcome.IsSuccess(), "Product of dependency %s not found: this is an oddity but build can continue.", inputFiles->m_azslSourceFullPath.c_str()); if (assetIdOutcome.IsSuccess()) @@ -325,7 +327,7 @@ namespace AZ AZ_TracePrintf(BuilderName, "Product output already built by %s is not reusable because of incompatible azslc CompilerHints: launching independent build", inputFiles->m_azslSourceFullPath.c_str()); } - if (HasSameStemName(fullSourcePath, inputFiles->m_azslSourceFullPath)) + if (HasSameFileName(fullSourcePath, inputFiles->m_azslSourceFullPath)) { // let's add a "distinguisher" to the names of the outproduct artifacts of this build round.* // Because otherwise the asset processor is not going to accept an overwrite of the ones output by the .azsl job diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp index 417a5b4a88..e3b482742b 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.cpp @@ -26,6 +26,7 @@ #include #include +#include // [GFX TODO] Remove when [ATOM-15472] #include #include @@ -122,7 +123,7 @@ namespace AZ namespace SubProducts = ShaderBuilderUtility::AzslSubProducts; - Outcome AzslCompiler::EmitFullData(const AZStd::string& parameters, const AZStd::string& outputFile /* = ""*/) const + Outcome AzslCompiler::EmitFullData(const AZStd::string& parameters, const AZStd::string& outputFile /* = ""*/, const char * addSuffix) const { bool success = Compile("--full " + parameters, outputFile); if (!success) @@ -133,11 +134,22 @@ namespace AZ SubProducts::Paths productPaths = SubProducts::Paths(SubProducts::Paths::capacity()); for (auto subProduct : SubProducts::SuffixListMembers) { - productPaths[subProduct.m_value] = outputFile.empty() ? m_inputFilePath : outputFile; // that's a reproduction of azslc's behavior (no "-o" = input name is used) - AzFramework::StringFunc::Path::ReplaceExtension(productPaths[subProduct.m_value], subProduct.m_string.data()); + AZStd::string subProductFilePath = outputFile.empty() ? m_inputFilePath : outputFile; // that's a reproduction of azslc's behavior (no "-o" = input name is used) + AzFramework::StringFunc::Path::ReplaceExtension(subProductFilePath, subProduct.m_string.data()); // append .json if it's one of those subs: auto listOfJsons = { SubProducts::ia, SubProducts::om, SubProducts::srg, SubProducts::options, SubProducts::bindingdep }; - productPaths[subProduct.m_value] += AZStd::any_of(AZ_BEGIN_END(listOfJsons), [&](auto v) { return v == subProduct.m_value; }) ? ".json" : ""; + subProductFilePath += AZStd::any_of(AZ_BEGIN_END(listOfJsons), [&](auto v) { return v == subProduct.m_value; }) ? ".json" : ""; + + // [GFX TODO] Remove when [ATOM-15472] + if (addSuffix) + { + // Rename the product file. + AZStd::string finalSubProductFilePath = AZStd::string::format("%s%s", subProductFilePath.c_str(), addSuffix); + AZ::IO::Move(subProductFilePath.c_str(), finalSubProductFilePath.c_str()); + subProductFilePath = finalSubProductFilePath; + } + + productPaths[subProduct.m_value] = subProductFilePath; } productPaths[SubProducts::azslin] = GetInputFilePath(); // post-fixup this one after the loop, because it's not an output of azslc, it's an output of the builder though. return { productPaths }; diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.h index cb30da068f..8da03cd6e5 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslCompiler.h @@ -38,8 +38,9 @@ namespace AZ //! @param inputFilePath The target input file to compile. Should be a valid AZSL file with no preprocessing directives. AzslCompiler(const AZStd::string& inputFilePath); + //! [GFX TODO] Remove @addSuffix when [ATOM-15472] //! compile with --full and generate all .json files - Outcome EmitFullData(const AZStd::string& parameters, const AZStd::string& outputFile = "") const; + Outcome EmitFullData(const AZStd::string& parameters, const AZStd::string& outputFile = "", const char * addSuffix = nullptr) const; //! compile to HLSL independently bool EmitShader(AZ::IO::GenericStream& outputStream, const AZStd::string& extraCompilerParams) const; //! compile with --ia independently and populate document @output diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslData.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslData.h index 4ea7a51fb1..303e2f355f 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslData.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslData.h @@ -83,23 +83,41 @@ namespace AZ AZStd::string m_azslFileName; //!< Name for the source .azsl file }; - struct AzslCodeTopData - { - SrgDataContainer m_srgData; - AzslFunctions m_functions; - StructContainer m_structs; - RootConstantData m_rootConstantData; - }; + //! DEPRECATED [ATOM-15472] + //! This class is used to collect all the json files produced by the compilation + //! of an AZSL file as objects. struct AzslData { AzslData(const AZStd::shared_ptr& a_sources) : m_sources(a_sources) { } AZStd::shared_ptr m_sources; AZStd::string m_preprocessedFullPath; // Full path to a preprocessed version of the original AZSL file - AZStd::string m_shaderCodePrefix; // AssetProcessor generated shader code which is added to the - // AZSLc emitted code prior to invoking the native shader compiler - AzslCodeTopData m_topData; + AZStd::string m_shaderCodePrefix; // AssetProcessor generated shader code which is added to the + // AZSLc emitted code prior to invoking the native shader compiler + + SrgDataContainer m_srgData; + AzslFunctions m_functions; + StructContainer m_structs; + RootConstantData m_rootConstantData; + }; + + //! This class is used to collect all the json files produced by the compilation + //! of an AZSL file as objects. + struct AzslData2 + { + AzslData2(const AZStd::shared_ptr& a_sources) + : m_sources(a_sources) + { + } + + AZStd::shared_ptr m_sources; + AZStd::string m_preprocessedFullPath; // Full path to a preprocessed version of the original AZSL file + + SrgDataContainer m_srgData; + AzslFunctions m_functions; + StructContainer m_structs; + RootConstantData m_rootConstantData; }; } // ShaderBuilder } // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp index a0f9f7db22..bc2e810f84 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.cpp @@ -86,7 +86,7 @@ namespace AZ // Register AZSL's compilation products Builder AssetBuilderSDK::AssetBuilderDesc azslBuilderDescriptor; azslBuilderDescriptor.m_name = "AZSL Builder"; - azslBuilderDescriptor.m_version = 7; // LKG Merge + azslBuilderDescriptor.m_version = 8; // ATOM-15276 // register all extensions thay may carry azsl code. header. main shader. or SRG azslBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); azslBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.azsl", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); @@ -102,7 +102,7 @@ namespace AZ // Register Shader Resource Group Layout Builder AssetBuilderSDK::AssetBuilderDesc srgLayoutBuilderDescriptor; srgLayoutBuilderDescriptor.m_name = "Shader Resource Group Layout Builder"; - srgLayoutBuilderDescriptor.m_version = 54; // Enable Null Rhi for AutomatedTesting + srgLayoutBuilderDescriptor.m_version = 55; // ATOM-15276 srgLayoutBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.azsl", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); srgLayoutBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern("*.azsli", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); @@ -118,7 +118,7 @@ namespace AZ // Register Shader Asset Builder AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilderDescriptor; shaderAssetBuilderDescriptor.m_name = "Shader Asset Builder"; - shaderAssetBuilderDescriptor.m_version = 98; // Enable Null Rhi for AutomatedTesting + shaderAssetBuilderDescriptor.m_version = 100; // ATOM-14298 // .shader file changes trigger rebuilds shaderAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); shaderAssetBuilderDescriptor.m_busId = azrtti_typeid(); @@ -133,7 +133,7 @@ namespace AZ shaderVariantAssetBuilderDescriptor.m_name = "Shader Variant Asset Builder"; // Both "Shader Variant Asset Builder" and "Shader Asset Builder" produce ShaderVariantAsset products. If you update // ShaderVariantAsset you will need to update BOTH version numbers, not just "Shader Variant Asset Builder". - shaderVariantAssetBuilderDescriptor.m_version = 19; // Enable Null Rhi for AutomatedTesting + shaderVariantAssetBuilderDescriptor.m_version = 21; // ATOM-14298 shaderVariantAssetBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", RPI::ShaderVariantListSourceData::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); shaderVariantAssetBuilderDescriptor.m_busId = azrtti_typeid(); shaderVariantAssetBuilderDescriptor.m_createJobFunction = AZStd::bind(&ShaderVariantAssetBuilder::CreateJobs, &m_shaderVariantAssetBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); @@ -145,7 +145,7 @@ namespace AZ // Register Precompiled Shader Builder AssetBuilderSDK::AssetBuilderDesc precompiledShaderBuilderDescriptor; precompiledShaderBuilderDescriptor.m_name = "Precompiled Shader Builder"; - precompiledShaderBuilderDescriptor.m_version = 7; // ATOM-14780 + precompiledShaderBuilderDescriptor.m_version = 8; // ATOM-15276 precompiledShaderBuilderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZStd::string::format("*.%s", AZ::PrecompiledShaderBuilder::Extension), AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); precompiledShaderBuilderDescriptor.m_busId = azrtti_typeid(); precompiledShaderBuilderDescriptor.m_createJobFunction = AZStd::bind(&PrecompiledShaderBuilder::CreateJobs, &m_precompiledShaderBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); @@ -153,6 +153,43 @@ namespace AZ m_precompiledShaderBuilder.BusConnect(precompiledShaderBuilderDescriptor.m_busId); AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, precompiledShaderBuilderDescriptor); + + // Register Shader Asset Builder 2 + AssetBuilderSDK::AssetBuilderDesc shaderAssetBuilder2Descriptor; + shaderAssetBuilder2Descriptor.m_name = "Shader Asset Builder 2"; + shaderAssetBuilder2Descriptor.m_version = 1; // ATOM-15276 + // .shader2 file changes trigger rebuilds + shaderAssetBuilder2Descriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( + AZStd::string::format("*.%s", RPI::ShaderSourceData::Extension2), + AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); + shaderAssetBuilder2Descriptor.m_busId = azrtti_typeid(); + shaderAssetBuilder2Descriptor.m_createJobFunction = + AZStd::bind(&ShaderAssetBuilder2::CreateJobs, &m_shaderAssetBuilder2, AZStd::placeholders::_1, AZStd::placeholders::_2); + shaderAssetBuilder2Descriptor.m_processJobFunction = + AZStd::bind(&ShaderAssetBuilder2::ProcessJob, &m_shaderAssetBuilder2, AZStd::placeholders::_1, AZStd::placeholders::_2); + + m_shaderAssetBuilder2.BusConnect(shaderAssetBuilder2Descriptor.m_busId); + AssetBuilderSDK::AssetBuilderBus::Broadcast( + &AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, shaderAssetBuilder2Descriptor); + + // Register Shader Variant Asset Builder 2 + AssetBuilderSDK::AssetBuilderDesc shaderVariantAssetBuilder2Descriptor; + shaderVariantAssetBuilder2Descriptor.m_name = "Shader Variant Asset Builder 2"; + // Both "Shader Variant Asset Builder" and "Shader Asset Builder" produce ShaderVariantAsset products. If you update + // ShaderVariantAsset you will need to update BOTH version numbers, not just "Shader Variant Asset Builder". + shaderVariantAssetBuilder2Descriptor.m_version = 1; // ATOM-15276 + shaderVariantAssetBuilder2Descriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern( + AZStd::string::format("*.%s", RPI::ShaderVariantListSourceData::Extension2), + AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); + shaderVariantAssetBuilder2Descriptor.m_busId = azrtti_typeid(); + shaderVariantAssetBuilder2Descriptor.m_createJobFunction = AZStd::bind( + &ShaderVariantAssetBuilder2::CreateJobs, &m_shaderVariantAssetBuilder2, AZStd::placeholders::_1, AZStd::placeholders::_2); + shaderVariantAssetBuilder2Descriptor.m_processJobFunction = AZStd::bind( + &ShaderVariantAssetBuilder2::ProcessJob, &m_shaderVariantAssetBuilder2, AZStd::placeholders::_1, AZStd::placeholders::_2); + + m_shaderVariantAssetBuilder2.BusConnect(shaderVariantAssetBuilder2Descriptor.m_busId); + AssetBuilderSDK::AssetBuilderBus::Broadcast( + &AssetBuilderSDK::AssetBuilderBus::Handler::RegisterBuilderInformation, shaderVariantAssetBuilder2Descriptor); } void AzslShaderBuilderSystemComponent::Deactivate() @@ -161,6 +198,8 @@ namespace AZ m_srgLayoutBuilder.BusDisconnect(); m_shaderVariantAssetBuilder.BusDisconnect(); m_precompiledShaderBuilder.BusDisconnect(); + m_shaderAssetBuilder2.BusDisconnect(); + m_shaderVariantAssetBuilder2.BusDisconnect(); RHI::ShaderPlatformInterfaceRegisterBus::Handler::BusDisconnect(); ShaderPlatformInterfaceRequestBus::Handler::BusDisconnect(); diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.h index 9d685c0d12..2f881f45d2 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/AzslShaderBuilderSystemComponent.h @@ -18,12 +18,14 @@ #include -#include -#include -#include -#include -#include -#include +#include "AzslBuilder.h" +#include "SrgLayoutBuilder.h" +#include "ShaderAssetBuilder.h" +#include "ShaderVariantAssetBuilder.h" +#include "PrecompiledShaderBuilder.h" +#include "ShaderPlatformInterfaceRequest.h" +#include "ShaderAssetBuilder2.h" +#include "ShaderVariantAssetBuilder2.h" namespace AZ { @@ -71,6 +73,8 @@ namespace AZ ShaderAssetBuilder m_shaderAssetBuilder; ShaderVariantAssetBuilder m_shaderVariantAssetBuilder; PrecompiledShaderBuilder m_precompiledShaderBuilder; + ShaderAssetBuilder2 m_shaderAssetBuilder2; + ShaderVariantAssetBuilder2 m_shaderVariantAssetBuilder2; /// Contains the ShaderPlatformInterface for all registered RHIs AZStd::unordered_map m_shaderPlatformInterfaces; diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp index c9d23aecd1..5f2acf251c 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.cpp @@ -62,7 +62,7 @@ namespace AZ } } - GlobalBuildOptions ReadBuildOptions(const char* builderName) + GlobalBuildOptions ReadBuildOptions(const char* builderName, const char* optionalIncludeFolder) { GlobalBuildOptions output; // try to parse some config file for eventual additional options @@ -79,7 +79,7 @@ namespace AZ { AZ_TracePrintf(builderName, "config file [%s] not found.", globalBuildOption.c_str()); } - InitializePreprocessorOptions(output.m_preprocessorSettings, builderName); + InitializePreprocessorOptions(output.m_preprocessorSettings, builderName, optionalIncludeFolder); return output; } } diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.h index f55d395609..9e85f5bcdd 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/GlobalBuildOptions.h @@ -33,6 +33,9 @@ namespace AZ RHI::ShaderCompilerArguments m_compilerArguments; }; - GlobalBuildOptions ReadBuildOptions(const char* builderName); + //! Reads the global options used when compiling shaders. The options are defined in /Config/shader_global_build_options.json + //! @param builderName: A string with the name of the builder calling this API. Used for trace debugging. + //! @param optionalIncludeFolder: An additional directory to add to the list of include folders for the C-preprocessor. + GlobalBuildOptions ReadBuildOptions(const char* builderName, const char* optionalIncludeFolder = nullptr); } } diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.cpp index 84a95b2c54..14193d774f 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.cpp @@ -58,6 +58,35 @@ namespace AZ } } + void PreprocessorOptions::RemovePredefinedMacros(const AZStd::vector& macroNames) + { + for (const auto& macroName : macroNames) + { + m_predefinedMacros.erase( + AZStd::remove_if( + m_predefinedMacros.begin(), m_predefinedMacros.end(), + [&](const AZStd::string& predefinedMacro) { + // Haystack, needle, bCaseSensitive + if (!AzFramework::StringFunc::StartsWith(predefinedMacro, macroName, true)) + { + return false; + } + // If found, let's make sure it is not just a substring. + if (predefinedMacro.size() == macroName.size()) + { + return true; + } + // The predefinedMacro can be a string like "macro=value". If we find '=' it is a match. + if (predefinedMacro.c_str()[macroName.size()] == '=') + { + return true; + } + return false; + }), + m_predefinedMacros.end()); + } + } + //! Binder helper to Matsui C-Pre-Processor library class McppBinder { @@ -286,7 +315,8 @@ namespace AZ } // populate options with scan folders and contents of parsing shader_global_build_options.json - void InitializePreprocessorOptions(PreprocessorOptions& options, [[maybe_unused]] const char* builderName) + void InitializePreprocessorOptions( + PreprocessorOptions& options, [[maybe_unused]] const char* builderName, const char* optionalIncludeFolder) { AZ_TraceContext("Init include-paths lookup options", "preprocessor"); @@ -303,6 +333,10 @@ namespace AZ // Add the project path to list of include paths AZ::IO::FixedMaxPathString projectPath = AZ::Utils::GetProjectPath(); scanFoldersSet.emplace(projectPath.c_str(), projectPath.size()); + if (optionalIncludeFolder) + { + scanFoldersSet.emplace(optionalIncludeFolder, strnlen(optionalIncludeFolder, AZ::IO::MaxPathLength)); + } // but while we transfer to the set, we're going to keep only folders where +/ShaderLib exists for (AZStd::string folder : scanFoldersVector) { diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.h index 7718dba6c4..b5fbf438a3 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/CommonFiles/Preprocessor.h @@ -47,9 +47,13 @@ namespace AZ //! folders are relative to the dev folder of the project AZStd::vector m_projectIncludePaths; - //! passed as -D macro1[=value1] -D macro2 ... + //! Each string is of the type "name[=value]" + //! passed as -Dmacro1[=value1] -Dmacro2 ... to MCPP. AZStd::vector m_predefinedMacros; + //! Removes all macros from @m_predefinedMacros that appear in @macroNames + void RemovePredefinedMacros(const AZStd::vector& macroNames); + //! if needed, we may add configurations like //! "keep comments" or "don't predefine non-standard macros" //! or "output diagnostics to std.err" or "enable digraphs/trigraphs"... @@ -59,7 +63,10 @@ namespace AZ //! It will populate your option with a default base of include folders given by the Asset Processor scan folders. //! This is going to look for a Config/shader_global_build_options.json in one of the scan folders //! (that file can specify additional include files and preprocessor macros). - void InitializePreprocessorOptions(PreprocessorOptions& options, const char* builderName); + //! @param options: Outout parameter, will contain the preprocessor options. + //! @param builderName: Used for debugging. + //! @param optionalIncludeFolder: If not null, will be added to the list of include folders for the c-preprocessor in @options. + void InitializePreprocessorOptions(PreprocessorOptions& options, const char* builderName, const char* optionalIncludeFolder = nullptr); /** * Runs the preprocessor on the given source file path, and stores results in outputData. diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp index d6197ff279..8d491d5d4d 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder.cpp @@ -166,17 +166,6 @@ namespace AZ response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; } - static uint32_t GetRootVariantAssetSubId(const RHI::ShaderPlatformInterface& shaderPlatformInterface) - { - //The 2 Most significant bits encode the the RHI::API unique index. - const uint32_t apiUniqueIndex = shaderPlatformInterface.GetAPIUniqueIndex(); - AZ_Assert(apiUniqueIndex <= RHI::Limits::APIType::PerPlatformApiUniqueIndexMax, - "Invalid api unique index [%u] from ShaderPlatformInterface [%s]", apiUniqueIndex, shaderPlatformInterface.GetAPIName().GetCStr()); - const uint32_t rhiApiSubId = apiUniqueIndex << 30; - const uint32_t productSubID = rhiApiSubId | static_cast(RPI::ShaderAssetSubId::RootShaderVariantAsset); - return productSubID; - } - static AssetBuilderSDK::ProcessJobResultCode CompileForAPI( const ShaderBuilderUtility::AzslSubProducts::Paths& pathOfProductFiles, RPI::ShaderAssetCreator& shaderAssetCreator, @@ -201,7 +190,7 @@ namespace AZ if (shaderSourceDataDescriptor.m_programSettings.m_entryPoints.empty()) { AZ_TracePrintf(ShaderAssetBuilderName, "ProgramSettings do not specify entry points, will use GetDefaultEntryPointsFromShader()\n"); - ShaderVariantAssetBuilder::GetDefaultEntryPointsFromAzslData(azslData, shaderEntryPoints); + ShaderBuilderUtility::GetDefaultEntryPointsFromFunctionDataList(azslData.m_functions, shaderEntryPoints); } else { @@ -249,7 +238,9 @@ namespace AZ // so the root ShaderVariantAsset is found when the ShaderAsset is deserialized. AZStd::string fullSourcePath; AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.c_str(), request.m_sourceFile.c_str(), fullSourcePath, true); - const uint32_t productSubID = GetRootVariantAssetSubId(*shaderPlatformInterface); + const uint32_t productSubID = RPI::ShaderAsset::MakeAssetProductSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), + aznumeric_cast(RPI::ShaderAssetSubId::RootShaderVariantAsset)); auto assetIdOutcome = RPI::AssetUtils::MakeAssetId(fullSourcePath, productSubID); AZ_Assert(assetIdOutcome.IsSuccess(), "Failed to get AssetId from shader %s", fullSourcePath.c_str()); const Data::AssetId variantAssetId = assetIdOutcome.TakeValue(); @@ -288,12 +279,13 @@ namespace AZ // add byproducts as job output products: if (variantCreationContext.m_outputByproducts) { + uint32_t subProductType = aznumeric_cast(RPI::ShaderAssetSubId::GeneratedHlslSource) + 1; for (const AZStd::string& byproduct : variantCreationContext.m_outputByproducts->m_intermediatePaths) { AssetBuilderSDK::JobProduct jobProduct; jobProduct.m_productFileName = byproduct; jobProduct.m_productAssetType = Uuid::CreateName("DebugInfoByProduct-PdbOrDxilTxt"); - jobProduct.m_productSubID = ShaderBuilderUtility::MakeDebugByproductSubId(shaderPlatformInterface->GetAPIType(), byproduct); + jobProduct.m_productSubID = RPI::ShaderAsset::MakeAssetProductSubId(shaderPlatformInterface->GetAPIUniqueIndex(), subProductType++); response.m_outputProducts.push_back(AZStd::move(jobProduct)); } } @@ -305,12 +297,12 @@ namespace AZ attributeMaps.resize(RHI::ShaderStageCount); for (const auto& shaderEntry : shaderSourceDataDescriptor.m_programSettings.m_entryPoints) { - auto findId = AZStd::find_if(AZ_BEGIN_END(azslData.m_topData.m_functions), [&shaderEntry](const auto& func) + auto findId = AZStd::find_if(AZ_BEGIN_END(azslData.m_functions), [&shaderEntry](const auto& func) { return func.m_name == shaderEntry.m_name; }); - if (findId == azslData.m_topData.m_functions.end()) + if (findId == azslData.m_functions.end()) { // shaderData.m_functions only contains Vertex, Fragment and Compute entries for now // Tessellation shaders will need to be handled too diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.cpp new file mode 100644 index 0000000000..5758db1da2 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.cpp @@ -0,0 +1,683 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +*/ + +#include "ShaderAssetBuilder2.h" + +#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 "AzslBuilder.h" +#include "ShaderVariantAssetBuilder2.h" +#include "ShaderBuilderUtility.h" +#include "ShaderPlatformInterfaceRequest.h" +#include "AtomShaderConfig.h" + +#include +#include +namespace AZ +{ + namespace ShaderBuilder + { + static constexpr char ShaderAssetBuilder2Name[] = "ShaderAssetBuilder2"; + static constexpr uint32_t ShaderAssetBuildTimestampParam = 0; + + void ShaderAssetBuilder2::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const + { + AZStd::string fullPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, true); + + AZ_TracePrintf(ShaderAssetBuilder2Name, "CreateJobs for Shader \"%s\"\n", fullPath.data()); + + // Used to synchronize versions of the ShaderAsset and ShaderVariantTreeAsset, especially during hot-reload. + // Note it's probably important for this to be set once outside the platform loop so every platform's ShaderAsset + // has the same value, because later the ShaderVariantTreeAsset job will fetch this value from the local ShaderAsset + // which could cross platforms (i.e. building an android ShaderVariantTreeAsset on PC would fetch the tiemstamp from + // the PC's ShaderAsset). + AZStd::sys_time_t shaderAssetBuildTimestamp = AZStd::GetTimeNowMicroSecond(); + + // Need to get the name of the azsl file from the .shader source asset, to be able to declare a dependency to SRG Layout Job. + // and the macro options to preprocess. + auto descriptorParseOutcome = ShaderBuilderUtility::LoadShaderDataJson(fullPath); + if (!descriptorParseOutcome.IsSuccess()) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Failed to parse Shader Descriptor JSON: %s", + descriptorParseOutcome.GetError().c_str()); + return; + } + + RPI::ShaderSourceData shaderSourceData = descriptorParseOutcome.TakeValue(); + + AZStd::string azslFullPath; + ShaderBuilderUtility::GetAbsolutePathToAzslFile(fullPath, shaderSourceData.m_source, azslFullPath); + if (!IO::FileIOBase::GetInstance()->Exists(azslFullPath.c_str())) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Shader program listed as the source entry does not exist: %s.", azslFullPath.c_str()); + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Failed; + return; + } + + + GlobalBuildOptions buildOptions = ReadBuildOptions(ShaderAssetBuilder2Name); + + // [GFX TODO] [ATOM-14966] In principle, based on macro definitions, included files can change per supervariant. + // So, the list of source asset dependencies must be collected by running MCPP on each supervariant. + // For now, we will run MCPP only once because CreateJobs() should be as light as possible. + // + // Regardless of the PlatformInfo and enabled ShaderPlatformInterfaces, the azsl file will be preprocessed + // with the sole purpose of extracting all included files. For each included file a SourceDependency will be declared. + PreprocessorData output; + buildOptions.m_compilerArguments.Merge(shaderSourceData.m_compiler); + PreprocessFile(azslFullPath, output, buildOptions.m_preprocessorSettings, true, true); + for (auto includePath : output.includedPaths) + { + // m_sourceFileDependencyList does not support paths with "." or ".." for relative lookup, but the preprocessor + // may produce path strings like "C:/a/b/c/../../d/file.azsli" so we have to normalize + AzFramework::StringFunc::Path::Normalize(includePath); + + AssetBuilderSDK::SourceFileDependency includeFileDependency; + includeFileDependency.m_sourceFileDependencyPath = includePath; + response.m_sourceFileDependencyList.emplace_back(includeFileDependency); + } + + { + // Add the AZSL as source dependency + AssetBuilderSDK::SourceFileDependency azslFileDependency; + azslFileDependency.m_sourceFileDependencyPath = azslFullPath; + response.m_sourceFileDependencyList.emplace_back(azslFileDependency); + } + + for (const AssetBuilderSDK::PlatformInfo& platformInfo : request.m_enabledPlatforms) + { + AZ_TraceContext("For platform", platformInfo.m_identifier.data()); + + // Get the platform interfaces to be able to access the prepend file + AZStd::vector platformInterfaces = ShaderBuilderUtility::DiscoverValidShaderPlatformInterfaces(platformInfo); + if (platformInterfaces.empty()) + { + continue; + } + + AssetBuilderSDK::JobDescriptor jobDescriptor; + jobDescriptor.m_priority = 2; + // [GFX TODO][ATOM-2830] Set 'm_critical' back to 'false' once proper fix for Atom startup issues are in + jobDescriptor.m_critical = true; + jobDescriptor.m_jobKey = ShaderAssetBuilder2JobKey; + jobDescriptor.SetPlatformIdentifier(platformInfo.m_identifier.c_str()); + jobDescriptor.m_jobParameters.emplace(ShaderAssetBuildTimestampParam, AZStd::to_string(shaderAssetBuildTimestamp)); + + response.m_createJobOutputs.push_back(jobDescriptor); + } // for all request.m_enabledPlatforms + + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; + } + + static bool SerializeOutShaderAsset(Data::Asset shaderAsset, + const AZStd::string& tempDirPath, + AssetBuilderSDK::ProcessJobResponse& response) + { + AZStd::string shaderAssetFileName = AZStd::string::format("%s.%s", shaderAsset->GetName().GetCStr(), RPI::ShaderAsset2::Extension); + AZStd::string shaderAssetOutputPath; + AzFramework::StringFunc::Path::ConstructFull(tempDirPath.data(), shaderAssetFileName.data(), shaderAssetOutputPath, true); + + if (!Utils::SaveObjectToFile(shaderAssetOutputPath, DataStream::ST_BINARY, shaderAsset.Get())) + { + AZ_Error(ShaderAssetBuilder2Name, false, "Failed to output Shader Descriptor"); + return false; + } + + AssetBuilderSDK::JobProduct shaderJobProduct; + if (!AssetBuilderSDK::OutputObject(shaderAsset.Get(), shaderAssetOutputPath, azrtti_typeid(), + aznumeric_cast(RPI::ShaderAsset2ProductSubId::ShaderAsset2), shaderJobProduct)) + { + AZ_Error(ShaderAssetBuilder2Name, false, "Failed to output product dependencies."); + return false; + } + response.m_outputProducts.push_back(AZStd::move(shaderJobProduct)); + + return true; + } + + static AZ::Outcome BuildAttributesMap( + const RHI::ShaderPlatformInterface* shaderPlatformInterface, + const AzslData& azslData, + const MapOfStringToStageType& shaderEntryPoints, + bool& hasRasterProgram) + { + hasRasterProgram = false; + bool hasComputeProgram = false; + bool hasRayTracingProgram = false; + RHI::ShaderStageAttributeMapList attributeMaps; + attributeMaps.resize(RHI::ShaderStageCount); + for (const auto& shaderEntryPoint : shaderEntryPoints) + { + auto shaderEntryName = shaderEntryPoint.first; + auto shaderStageType = shaderEntryPoint.second; + auto assetBuilderShaderType = ShaderBuilderUtility::ToAssetBuilderShaderType(shaderStageType); + hasRasterProgram |= shaderPlatformInterface->IsShaderStageForRaster(assetBuilderShaderType); + hasComputeProgram |= shaderPlatformInterface->IsShaderStageForCompute(assetBuilderShaderType); + hasRayTracingProgram |= shaderPlatformInterface->IsShaderStageForRayTracing(assetBuilderShaderType); + + auto findId = AZStd::find_if(AZ_BEGIN_END(azslData.m_functions), [&shaderEntryPoint](const auto& func) { + return func.m_name == shaderEntryPoint.first; + }); + + if (findId == azslData.m_functions.end()) + { + // shaderData.m_functions only contains Vertex, Fragment and Compute entries for now + // Tessellation shaders will need to be handled too + continue; + } + + const auto shaderStage = ToRHIShaderStage(assetBuilderShaderType); + for (const auto& attr : findId->attributesList) + { + // Some stages like RHI::ShaderStage::Tessellation are compound and consist of two or more shader entries + const Name& attributeName = attr.first; + const RHI::ShaderStageAttributeArguments& args = attr.second; + const auto stageIndex = static_cast(shaderStage); + AZ_Assert(stageIndex < RHI::ShaderStageCount, "Invalid shader stage specified!"); + attributeMaps[stageIndex][attributeName] = args; + } + } + + if (hasRasterProgram && hasComputeProgram) + { + return AZ::Failure(AZStd::string(" Shader asset descriptor defines both a raster entry point and a compute entry point.")); + } + + if (!hasRasterProgram && !hasComputeProgram && !hasRayTracingProgram) + { + AZStd::string entryPointNames = ShaderBuilderUtility::GetAcceptableDefaultEntryPointNames(azslData); + return AZ::Failure( + AZStd::string::format( "Shader asset descriptor has a program variant that does not define any entry points. Either declare entry " + "points in the .shader file, or use one of the available default names (not case-sensitive): [%s]", + entryPointNames.c_str())); + } + + return AZ::Success(attributeMaps); + } + + void ShaderAssetBuilder2::ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const + { + const AZStd::sys_time_t startTime = AZStd::GetTimeNowTicks(); + AZStd::string shaderFullPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.c_str(), request.m_sourceFile.c_str(), shaderFullPath, true); + // Save .shader file name (no extension and no parent directory path) + AZStd::string shaderFileName; + AzFramework::StringFunc::Path::GetFileName(request.m_sourceFile.c_str(), shaderFileName); + + // No error checking because the same calls were already executed during CreateJobs() + auto descriptorParseOutcome = ShaderBuilderUtility::LoadShaderDataJson(shaderFullPath); + RPI::ShaderSourceData shaderSourceData = descriptorParseOutcome.TakeValue(); + AZStd::string azslFullPath; + ShaderBuilderUtility::GetAbsolutePathToAzslFile(shaderFullPath, shaderSourceData.m_source, azslFullPath); + AZ_TracePrintf(ShaderAssetBuilder2Name, "Original AZSL File: %s \n", azslFullPath.c_str()); + + // The directory where the Azsl file was found must be added to the list of include paths + AZStd::string azslFolderPath; + AzFramework::StringFunc::Path::GetFolderPath(azslFullPath.c_str(), azslFolderPath); + GlobalBuildOptions buildOptions = ReadBuildOptions(ShaderAssetBuilder2Name, azslFolderPath.c_str()); + + // Request the list of valid shader platform interfaces for the target platform. + AZStd::vector platformInterfaces = ShaderBuilderUtility::DiscoverEnabledShaderPlatformInterfaces( + request.m_platformInfo, shaderSourceData); + if (platformInterfaces.empty()) + { + //No work to do. Exit gracefully. + AZ_TracePrintf(ShaderAssetBuilder2Name, + "No azshader is produced on behalf of %s because all valid RHI backends were disabled for this shader.\n", + shaderFullPath.c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + return; + } + + // Get the time stamp string as sys_time_t, and also convert back to string to make sure it was converted correctly. + AZStd::sys_time_t shaderAssetBuildTimestamp = 0; + auto shaderAssetBuildTimestampIterator = request.m_jobDescription.m_jobParameters.find(ShaderAssetBuildTimestampParam); + if (shaderAssetBuildTimestampIterator != request.m_jobDescription.m_jobParameters.end()) + { + shaderAssetBuildTimestamp = AZStd::stoull(shaderAssetBuildTimestampIterator->second); + + if (AZStd::to_string(shaderAssetBuildTimestamp) != shaderAssetBuildTimestampIterator->second) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + AZ_Assert(false, "Incorrect conversion of ShaderAssetBuildTimestampParam"); + return; + } + } + + auto supervariantList = ShaderBuilderUtility::GetSupervariantListFromShaderSourceData(shaderSourceData); + + RPI::ShaderAssetCreator2 shaderAssetCreator; + shaderAssetCreator.Begin(Uuid::CreateRandom()); + + shaderAssetCreator.SetName(AZ::Name{shaderFileName.c_str()}); + shaderAssetCreator.SetDrawListName(Name(shaderSourceData.m_drawListName)); + shaderAssetCreator.SetShaderAssetBuildTimestamp(shaderAssetBuildTimestamp); + + // The ShaderOptionGroupLayout must be the same across all supervariants because + // there can be only a single ShaderVariantTreeAsset per ShaderAsset. + // We will store here the one that results when the *.azslin file is + // compiled for the default, nameless, supervariant. + // For all other supervariants we just make sure the hashes are the same + // as this one. + RPI::Ptr finalShaderOptionGroupLayout = nullptr; + + + // Time to describe the big picture. + // 1- Preprocess an AZSL file with MCPP (a C-Preprocessor), and generate a flat AZSL file without #include lines and any macros in it. + // Let's call it the Flat-AZSL file. There are two levels of macro definition that need to be merged before we can invoke MCPP: + // 1.1- From /Config/shader_global_build_options.json, which we have stored in the local variable @buildOptions. + // 1.2- From the "Supervariant" definition key, which can be different for each supervariant. + // 2- There will be one Flat-AZSL per supervariant. Each Flat-AZSL will be transpiled to HLSL with AZSLc. This means there will be one HLSL file + // per supervariant. + // 3- The generated HLSL (one HLSL per supervariant) file may contain C-Preprocessor Macros inserted by AZSLc. And that file will be given to DXC. + // DXC has a preprocessor embedded in it. DXC will be executed once for each entry function listed in the .shader file. + // There will be one DXIL compiled binary for each entry function. All the DXIL compiled binaries for each supervariant will be combined + // in the ROOT ShaderVariantAsset. + + // Remark: In general, the work done by the ShaderVariantAssetBuilder is similar, but it will start from the HLSL file created; in step 2, mentioned above; by this builder, + // for each supervariant. + + // At this moment We have global build options that should be merged with the build options that are common + // to all the supervariants of this shader. + buildOptions.m_compilerArguments.Merge(shaderSourceData.m_compiler); + + for (RHI::ShaderPlatformInterface* shaderPlatformInterface : platformInterfaces) + { + AZStd::string apiName(shaderPlatformInterface->GetAPIName().GetCStr()); + AZ_TraceContext("Platform API", apiName); + // Signal the begin of shader data for an RHI API. + shaderAssetCreator.BeginAPI(shaderPlatformInterface->GetAPIType()); + + // Each shaderPlatformInterface has its own azsli header that needs to be prepended to the AZSL file before + // preprocessing. We will create a new temporary file that contains the combined data. + RHI::PrependArguments args; + args.m_sourceFile = azslFullPath.c_str(); + args.m_prependFile = shaderPlatformInterface->GetAzslHeader(request.m_platformInfo); + args.m_addSuffixToFileName = apiName.c_str(); + args.m_destinationFolder = request.m_tempDirPath.c_str(); + + AZStd::string prependedAzslFilePath = RHI::PrependFile(args); + if (prependedAzslFilePath == azslFullPath) + { + // The specific error is already reported by RHI::PrependFile(). + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + // Cache common AZSLC invokation arguments related with the current RHI Backend. + // Each supervariant can, optionally, remove or add more arguments for AZSLc. + AZStd::string commonAzslcCompilerParameters = + shaderPlatformInterface->GetAzslCompilerParameters(buildOptions.m_compilerArguments); + commonAzslcCompilerParameters += " "; + commonAzslcCompilerParameters += + shaderPlatformInterface->GetAzslCompilerWarningParameters(buildOptions.m_compilerArguments); + AtomShaderConfig::AddParametersFromConfigFile(commonAzslcCompilerParameters, request.m_platformInfo); + + // The register number only makes sense if the platform uses "spaces", + // since the register Id of the resource will not change even if the pipeline layout changes. + // We can pass in a default ShaderCompilerArguments because all we care about is whether the shaderPlatformInterface + // appends the "--use-spaces" flag. + const bool platformUsesRegisterSpaces = + (AzFramework::StringFunc::Find(commonAzslcCompilerParameters, "--use-spaces") != AZStd::string::npos); + + uint32_t supervariantIndex = 0; + for (const auto& supervariantInfo : supervariantList) + { + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + if (jobCancelListener.IsCancelled()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Cancelled; + return; + } + + shaderAssetCreator.BeginSupervariant(supervariantInfo.m_name); + + // Let's combine the global macro definitions, with the macro definitions particular to this + // supervariant. Two steps: + // 1- Supervariants can specify which macros to remove from the global definitions. + AZStd::vector macroDefinitionNamesToRemove = supervariantInfo.GetCombinedListOfMacroDefinitionNamesToRemove(); + PreprocessorOptions preprocessorOptions = buildOptions.m_preprocessorSettings; + preprocessorOptions.RemovePredefinedMacros(macroDefinitionNamesToRemove); + // 2- Supervariants can specify which macros to add. + AZStd::vector macroDefinitionsToAdd = supervariantInfo.GetMacroDefinitionsToAdd(); + preprocessorOptions.m_predefinedMacros.insert( + preprocessorOptions.m_predefinedMacros.end(), macroDefinitionsToAdd.begin(), macroDefinitionsToAdd.end()); + // Run the preprocessor. + PreprocessorData output; + PreprocessFile(prependedAzslFilePath, output, preprocessorOptions, true, true); + RHI::ReportErrorMessages(ShaderAssetBuilder2Name, output.diagnostics); + // Dump the preprocessed string as a flat AZSL file with extension .azslin, which will be given to AZSLc to generate the HLSL file. + AZStd::string superVariantAzslinStemName = shaderFileName; + if (!supervariantInfo.m_name.IsEmpty()) + { + superVariantAzslinStemName += AZStd::string::format("-%s", supervariantInfo.m_name.GetCStr()); + } + AZStd::string azslinFullPath = ShaderBuilderUtility::DumpPreprocessedCode( + ShaderAssetBuilder2Name, output.code, request.m_tempDirPath, superVariantAzslinStemName, + apiName, true /*add2*/); + if (azslinFullPath.empty()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + AZ_TracePrintf(ShaderAssetBuilder2Name, "Preprocessed AZSL File: %s \n", prependedAzslFilePath.c_str()); + + // Before transpiling the flat-AZSL(.azslin) file into HLSL it is necessary + // to setup the AZSLc arguments as required by the current supervariant. + AZStd::string azslcCompilerParameters = supervariantInfo.GetCustomizedArgumentsForAzslc(commonAzslcCompilerParameters); + + // Ready to transpile the azslin file into HLSL. + ShaderBuilder::AzslCompiler azslc(azslinFullPath); + AZStd::string hlslFullPath = AZStd::string::format("%s_%s.hlsl2", superVariantAzslinStemName.c_str(), apiName.c_str()); + AzFramework::StringFunc::Path::Join(request.m_tempDirPath.c_str(), hlslFullPath.c_str(), hlslFullPath, true); + auto emitFullOutcome = azslc.EmitFullData(azslcCompilerParameters, hlslFullPath, "2"); + if (!emitFullOutcome.IsSuccess()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + ShaderBuilderUtility::AzslSubProducts::Paths subProductsPaths = emitFullOutcome.TakeValue(); + + // In addition to the hlsl file, there are other json files that were generated. + // Each output file will become a product. + for (int i = 0; i < subProductsPaths.size(); ++i) + { + AssetBuilderSDK::JobProduct jobProduct; + jobProduct.m_productFileName = subProductsPaths[i]; + static const AZ::Uuid AzslOutcomeType = "{6977AEB1-17AD-4992-957B-23BB2E85B18B}"; + jobProduct.m_productAssetType = AzslOutcomeType; + // uint32_t rhiApiUniqueIndex, uint32_t supervariantIndex, uint32_t subProductType + jobProduct.m_productSubID = RPI::ShaderAsset2::MakeProductAssetSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), supervariantIndex, + aznumeric_cast(ShaderBuilderUtility::AzslSubProducts::SubList[i])); + jobProduct.m_dependenciesHandled = true; + // Note that the output products are not traditional product assets that will be used by the game project. + // They are artifacts that are produced once, cached, and used later by other AssetBuilders as a way to centralize + // build organization. + response.m_outputProducts.push_back(AZStd::move(jobProduct)); + } + + AZStd::shared_ptr files(new ShaderFiles); + AzslData azslData(files); + azslData.m_preprocessedFullPath = azslinFullPath; + RPI::ShaderResourceGroupLayoutList srgLayoutList; + RPI::Ptr shaderOptionGroupLayout = RPI::ShaderOptionGroupLayout::Create(); + BindingDependencies bindingDependencies; + RootConstantData rootConstantData; + AssetBuilderSDK::ProcessJobResultCode azslJsonReadResult = ShaderBuilderUtility::PopulateAzslDataFromJsonFiles( + ShaderAssetBuilder2Name, subProductsPaths, platformUsesRegisterSpaces, azslData, srgLayoutList, shaderOptionGroupLayout, + bindingDependencies, rootConstantData); + if (azslJsonReadResult != AssetBuilderSDK::ProcessJobResult_Success) + + { + response.m_resultCode = azslJsonReadResult; + return; + } + + shaderAssetCreator.SetSrgLayoutList(srgLayoutList); + + if (!finalShaderOptionGroupLayout) + { + finalShaderOptionGroupLayout = shaderOptionGroupLayout; + shaderAssetCreator.SetShaderOptionGroupLayout(finalShaderOptionGroupLayout); + const uint32_t usedShaderOptionBits = shaderOptionGroupLayout->GetBitSize(); + AZ_TracePrintf( + ShaderAssetBuilder2Name, "Note: This shader uses %u of %u available shader variant key bits. \n", + usedShaderOptionBits, RPI::ShaderVariantKeyBitCount); + } + else + { + if (finalShaderOptionGroupLayout->GetHash() != shaderOptionGroupLayout->GetHash()) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Supervariant %s has a different ShaderOptionGroupLayout", + supervariantInfo.m_name.GetCStr()) + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + } + + // Discover entry points & type of programs. + MapOfStringToStageType shaderEntryPoints; + if (shaderSourceData.m_programSettings.m_entryPoints.empty()) + { + AZ_TracePrintf( + ShaderAssetBuilder2Name, + "ProgramSettings do not specify entry points, will use GetDefaultEntryPointsFromShader()\n"); + ShaderBuilderUtility::GetDefaultEntryPointsFromFunctionDataList(azslData.m_functions, shaderEntryPoints); + } + else + { + for (const auto& entryPoint : shaderSourceData.m_programSettings.m_entryPoints) + { + shaderEntryPoints[entryPoint.m_name] = entryPoint.m_type; + } + } + + bool hasRasterProgram = false; + auto attributeMapsOutcome = BuildAttributesMap(shaderPlatformInterface, azslData, shaderEntryPoints, hasRasterProgram); + if (!attributeMapsOutcome.IsSuccess()) + { + AZ_Error(ShaderAssetBuilder2Name, false, "%s\n", attributeMapsOutcome.GetError().c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + shaderAssetCreator.SetShaderStageAttributeMapList(attributeMapsOutcome.TakeValue()); + + // Check if we were canceled before we do any heavy processing of + // the shader data (compiling the shader kernels, processing SRG + // and pipeline layout data, etc.). + if (jobCancelListener.IsCancelled()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Cancelled; + return; + } + + RHI::Ptr pipelineLayoutDescriptor = + ShaderBuilderUtility::BuildPipelineLayoutDescriptorForApi( + ShaderAssetBuilder2Name, srgLayoutList, shaderEntryPoints, buildOptions.m_compilerArguments, rootConstantData, + shaderPlatformInterface, bindingDependencies); + if (!pipelineLayoutDescriptor) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Failed to build pipeline layout descriptor for api=[%s]", + shaderPlatformInterface->GetAPIName().GetCStr()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + shaderAssetCreator.SetPipelineLayout(pipelineLayoutDescriptor); + + + RPI::ShaderInputContract shaderInputContract; + RPI::ShaderOutputContract shaderOutputContract; + size_t colorAttachmentCount = 0; + ShaderBuilderUtility::CreateShaderInputAndOutputContracts( + azslData, shaderEntryPoints, *shaderOptionGroupLayout.get(), + subProductsPaths[ShaderBuilderUtility::AzslSubProducts::om], + subProductsPaths[ShaderBuilderUtility::AzslSubProducts::ia], + shaderInputContract, shaderOutputContract, colorAttachmentCount); + shaderAssetCreator.SetInputContract(shaderInputContract); + shaderAssetCreator.SetOutputContract(shaderOutputContract); + + if (hasRasterProgram) + { + // Set the various states to what is in the descriptor. + const RHI::TargetBlendState& targetBlendState = shaderSourceData.m_blendState; + RHI::RenderStates renderStates; + renderStates.m_rasterState = shaderSourceData.m_rasterState; + renderStates.m_depthStencilState = shaderSourceData.m_depthStencilState; + // [GFX TODO][ATOM-930] We should support unique blend states per RT + for (size_t i = 0; i < colorAttachmentCount; ++i) + { + renderStates.m_blendState.m_targets[i] = targetBlendState; + } + + shaderAssetCreator.SetRenderStates(renderStates); + } + + Outcome hlslSourceCodeOutcome = Utils::ReadFile(hlslFullPath); + if (!hlslSourceCodeOutcome.IsSuccess()) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Failed to obtain shader source from %s. [%s]", hlslFullPath.c_str(), + hlslSourceCodeOutcome.GetError().c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + AZStd::string hlslSourceCode = hlslSourceCodeOutcome.TakeValue(); + + // The root ShaderVariantAsset needs to be created with the known uuid of the source .shader asset because + // the ShaderAsset owns a Data::Asset<> reference that gets serialized. It must have the correct uuid + // so the root ShaderVariantAsset is found when the ShaderAsset is deserialized. + uint32_t rootVariantProductSubId = RPI::ShaderAsset2::MakeProductAssetSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), supervariantIndex, + aznumeric_cast(RPI::ShaderAsset2ProductSubId::RootShaderVariantAsset)); + auto assetIdOutcome = RPI::AssetUtils::MakeAssetId(shaderFullPath, rootVariantProductSubId); + AZ_Assert(assetIdOutcome.IsSuccess(), "Failed to get AssetId from shader %s", shaderFullPath.c_str()); + const Data::AssetId variantAssetId = assetIdOutcome.TakeValue(); + + RPI::ShaderVariantListSourceData::VariantInfo rootVariantInfo; + ShaderVariantCreationContext2 shaderVariantCreationContext = { + *shaderPlatformInterface, + request.m_platformInfo, + buildOptions.m_compilerArguments, + request.m_tempDirPath, + startTime, + shaderSourceData, + *shaderOptionGroupLayout.get(), + shaderEntryPoints, + variantAssetId, + superVariantAzslinStemName, + hlslFullPath, + hlslSourceCode}; + + + AZStd::optional outputByproducts; + auto rootShaderVariantAssetOutcome = ShaderVariantAssetBuilder2::CreateShaderVariantAsset(rootVariantInfo, shaderVariantCreationContext, outputByproducts); + if (!rootShaderVariantAssetOutcome.IsSuccess()) + { + AZ_Error(ShaderAssetBuilder2Name, false, "%s\n", rootShaderVariantAssetOutcome.GetError().c_str()) + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + Data::Asset rootShaderVariantAsset = rootShaderVariantAssetOutcome.TakeValue(); + + shaderAssetCreator.SetRootShaderVariantAsset(rootShaderVariantAsset); + + if (!shaderAssetCreator.EndSupervariant()) + { + AZ_Error( + ShaderAssetBuilder2Name, false, "Failed to create shader asset for supervariant [%s]", supervariantInfo.m_name.GetCStr()) + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + // Time to save the root variant related assets in the cache. + AssetBuilderSDK::JobProduct assetProduct; + if (!ShaderVariantAssetBuilder2::SerializeOutShaderVariantAsset( + rootShaderVariantAsset, superVariantAzslinStemName, request.m_tempDirPath, *shaderPlatformInterface, + rootVariantProductSubId, + assetProduct)) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + response.m_outputProducts.push_back(assetProduct); + + if (outputByproducts) + { + // add byproducts as job output products: + uint32_t subProductType = aznumeric_cast(RPI::ShaderAsset2ProductSubId::FirstByProduct); + for (const AZStd::string& byproduct : outputByproducts.value().m_intermediatePaths) + { + AssetBuilderSDK::JobProduct jobProduct; + jobProduct.m_productFileName = byproduct; + jobProduct.m_productAssetType = Uuid::CreateName("DebugInfoByProduct-PdbOrDxilTxt"); + jobProduct.m_productSubID = RPI::ShaderAsset2::MakeProductAssetSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), supervariantIndex, + subProductType++); + response.m_outputProducts.push_back(AZStd::move(jobProduct)); + } + } + + + supervariantIndex++; + + } // end for the supervariant + + shaderAssetCreator.EndAPI(); + + } // end for all ShaderPlatformInterfaces + + Data::Asset shaderAsset; + if (!shaderAssetCreator.End(shaderAsset)) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + if (!SerializeOutShaderAsset(shaderAsset, request.m_tempDirPath, response)) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + + const AZStd::sys_time_t endTime = AZStd::GetTimeNowTicks(); + const AZStd::sys_time_t deltaTime = endTime - startTime; + const float elapsedTimeSeconds = (float)(deltaTime) / (float)AZStd::GetTimeTicksPerSecond(); + + AZ_TracePrintf(ShaderAssetBuilder2Name, "Finished processing %s in %.2f seconds\n", request.m_sourceFile.c_str(), elapsedTimeSeconds); + + ShaderBuilderUtility::LogProfilingData(ShaderAssetBuilder2Name, shaderFileName); + } + + } // ShaderBuilder +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.h new file mode 100644 index 0000000000..915d4e53d0 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderAssetBuilder2.h @@ -0,0 +1,60 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +#include + +namespace AZ +{ + namespace Data + { + class AssetHandler; + } + + namespace RHI + { + class ShaderPlatformInterface; + } + + namespace ShaderBuilder + { + struct AzslData; + + class ShaderAssetBuilder2 + : public AssetBuilderSDK::AssetBuilderCommandBus::Handler + { + public: + AZ_TYPE_INFO(ShaderAssetBuilder2, "{C94DA151-82BC-4475-86FA-E6C92A0BD6F8}"); + + static constexpr const char* ShaderAssetBuilder2JobKey = "Shader Asset 2"; + + ShaderAssetBuilder2() = default; + ~ShaderAssetBuilder2() = default; + + // Asset Builder Callback Functions ... + void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const; + void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; + + // AssetBuilderSDK::AssetBuilderCommandBus interface overrides ... + void ShutDown() override { }; + + private: + AZ_DISABLE_COPY_MOVE(ShaderAssetBuilder2); + }; + + } // ShaderBuilder +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp index 19b2f328c1..c256caac4a 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.cpp @@ -29,7 +29,8 @@ #include #include -#include +#include // DEPRECATED - [ATOM-15472] +#include #include #include @@ -41,13 +42,15 @@ #include "ShaderPlatformInterfaceRequest.h" #include "AtomShaderConfig.h" +#include "SrgLayoutUtility.h" + namespace AZ { namespace ShaderBuilder { namespace ShaderBuilderUtility { - static const char* ShaderBuilderUtilityName = "ShaderBuilderUtility"; + static constexpr char ShaderBuilderUtilityName[] = "ShaderBuilderUtility"; Outcome LoadShaderDataJson(const AZStd::string& fullPathToJsonFile) { @@ -84,22 +87,8 @@ namespace AZ AzFramework::StringFunc::Path::ReplaceExtension(absoluteAzslPath, "azsl"); } - uint32_t MakeDebugByproductSubId(RHI::APIType apiType, const AZStd::string& productFileName) - { - // bits: ----- 24 -----|- 4 -|- 4 - - // fn hash | id + api | 0xF - uint32_t subId = 0xF; // to avoid collisions with subid of other source outputs using RPI::ShaderAssetSubId::GeneratedSource + api - uint32_t id_api = static_cast(RPI::ShaderAssetSubId::DebugByProduct); - id_api += apiType; - id_api <<= 4; - subId |= id_api; - size_t fnHash = AZStd::hash()(productFileName); - subId |= static_cast(fnHash) & 0xFFFFFF00; - return subId; - } - static bool LoadShaderResourceGroupAssets( - [[maybe_unused]] const char* BuilderName, + [[maybe_unused]] const char* builderName, const SrgDataContainer& resourceGroups, ShaderResourceGroupAssets& srgAssets) { @@ -121,7 +110,7 @@ namespace AZ if (!assetFound) { - AZ_Error(BuilderName, false, "Could not find asset identified by path '%s'", srgFilePath.c_str()); + AZ_Error(builderName, false, "Could not find asset identified by path '%s'", srgFilePath.c_str()); readSRGsSuccessfuly = false; continue; } @@ -139,7 +128,7 @@ namespace AZ : asset.GetStatus() == Status::ReadyPreNotify ? "ready-pre-notify" : asset.GetStatus() == Status::Error ? "error" : "not-loaded/ready/unknown"; - AZ_Error(BuilderName, false, "Searching SRG [%s]: Could not load SRG asset. (asset status [%s]) AssetId='%s' Path='%s'", + AZ_Error(builderName, false, "Searching SRG [%s]: Could not load SRG asset. (asset status [%s]) AssetId='%s' Path='%s'", srgData.m_name.c_str(), statusString.c_str(), assetId.ToString().c_str(), srgFilePath.c_str()); @@ -148,7 +137,7 @@ namespace AZ } else if (!asset->IsValid()) { - AZ_Error(BuilderName, false, "SRG asset has no layout information. AssetId='%s' Path='%s'", + AZ_Error(builderName, false, "SRG asset has no layout information. AssetId='%s' Path='%s'", assetId.ToString().c_str(), srgFilePath.c_str()); readSRGsSuccessfuly = false; continue; @@ -182,8 +171,10 @@ namespace AZ return files; } + + //! [GFX TODO] [ATOM-15472] Deprecated, remove when this ticket is addressed. AssetBuilderSDK::ProcessJobResultCode PopulateAzslDataFromJsonFiles( - const char* BuilderName, + const char* builderName, const AzslSubProducts::Paths& pathOfJsonFiles, AzslData& azslData, ShaderResourceGroupAssets& srgAssets, @@ -204,7 +195,7 @@ namespace AZ outcomes[i] = JsonSerializationUtils::ReadJsonFile(pathOfJsonFiles[i]); if (!outcomes[i].IsSuccess()) { - AZ_Error(BuilderName, false, "%s", outcomes[i].GetError().c_str()); + AZ_Error(builderName, false, "%s", outcomes[i].GetError().c_str()); allReadSuccess = false; } } @@ -215,22 +206,22 @@ namespace AZ // Get full list of functions eligible for vertex shader entry points // along with metadata for constructing the InputAssembly for each of them - if (!azslc.ParseIaPopulateFunctionData(outcomes[AzslSubProducts::ia].GetValue(), azslData.m_topData.m_functions)) + if (!azslc.ParseIaPopulateFunctionData(outcomes[AzslSubProducts::ia].GetValue(), azslData.m_functions)) { return AssetBuilderSDK::ProcessJobResult_Failed; } // Each SRG is built as a separate asset in the SrgLayoutBuilder, here we just // build the list and load the data from multiple dependency assets. - if (!azslc.ParseSrgPopulateSrgData(outcomes[AzslSubProducts::srg].GetValue(), azslData.m_topData.m_srgData)) + if (!azslc.ParseSrgPopulateSrgData(outcomes[AzslSubProducts::srg].GetValue(), azslData.m_srgData)) { return AssetBuilderSDK::ProcessJobResult_Failed; } // Add all Shader Resource Group Assets that were defined in the shader code to the shader asset - if (!LoadShaderResourceGroupAssets(BuilderName, azslData.m_topData.m_srgData, srgAssets)) + if (!LoadShaderResourceGroupAssets(builderName, azslData.m_srgData, srgAssets)) { - AZ_Error(BuilderName, false, "Failed to obtain shader resource group assets"); + AZ_Error(builderName, false, "Failed to obtain shader resource group assets"); return AssetBuilderSDK::ProcessJobResult_Failed; } @@ -238,7 +229,7 @@ namespace AZ // for each option and what is its default value. if (!azslc.ParseOptionsPopulateOptionGroupLayout(outcomes[AzslSubProducts::options].GetValue(), shaderOptionGroupLayout)) { - AZ_Error(BuilderName, false, "Failed to find a valid list of shader options!"); + AZ_Error(builderName, false, "Failed to find a valid list of shader options!"); return AssetBuilderSDK::ProcessJobResult_Failed; } @@ -246,14 +237,100 @@ namespace AZ // and informs us on register indexes and shader stages using these resources if (!azslc.ParseBindingdepPopulateBindingDependencies(outcomes[AzslSubProducts::bindingdep].GetValue(), bindingDependencies)) // consuming data from binding-dep { - AZ_Error(BuilderName, false, "Failed to obtain shader resource binding reflection"); + AZ_Error(builderName, false, "Failed to obtain shader resource binding reflection"); return AssetBuilderSDK::ProcessJobResult_Failed; } // access the root constants reflection if (!azslc.ParseSrgPopulateRootConstantData(outcomes[AzslSubProducts::srg].GetValue(), rootConstantData)) // consuming data from --srg ("InlineConstantBuffer" subjson section) { - AZ_Error(BuilderName, false, "Failed to obtain root constant data reflection"); + AZ_Error(builderName, false, "Failed to obtain root constant data reflection"); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + return AssetBuilderSDK::ProcessJobResult_Success; + } + + + AssetBuilderSDK::ProcessJobResultCode PopulateAzslDataFromJsonFiles( + const char* builderName, + const AzslSubProducts::Paths& pathOfJsonFiles, + const bool platformUsesRegisterSpaces, + AzslData& azslData, + RPI::ShaderResourceGroupLayoutList& srgLayoutList, + RPI::Ptr shaderOptionGroupLayout, + BindingDependencies& bindingDependencies, + RootConstantData& rootConstantData) + { + AzslCompiler azslc( + azslData + .m_preprocessedFullPath); // set the input file for eventual error messages, but the compiler won't be called on it. + bool allReadSuccess = true; + // read: input assembly reflection + // shader resource group reflection + // options reflection + // binding dependencies reflection + int indicesOfInterest[] = { + AzslSubProducts::ia, AzslSubProducts::srg, AzslSubProducts::options, AzslSubProducts::bindingdep}; + AZStd::unordered_map> outcomes; + for (int i : indicesOfInterest) + { + outcomes[i] = JsonSerializationUtils::ReadJsonFile(pathOfJsonFiles[i]); + if (!outcomes[i].IsSuccess()) + { + AZ_Error(builderName, false, "%s", outcomes[i].GetError().c_str()); + allReadSuccess = false; + } + } + if (!allReadSuccess) + { + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // Get full list of functions eligible for vertex shader entry points + // along with metadata for constructing the InputAssembly for each of them + if (!azslc.ParseIaPopulateFunctionData(outcomes[AzslSubProducts::ia].GetValue(), azslData.m_functions)) + { + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // Each SRG is built as a separate asset in the SrgLayoutBuilder, here we just + // build the list and load the data from multiple dependency assets. + if (!azslc.ParseSrgPopulateSrgData(outcomes[AzslSubProducts::srg].GetValue(), azslData.m_srgData)) + { + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // Add all Shader Resource Group Assets that were defined in the shader code to the shader asset + if (!SrgLayoutUtility::LoadShaderResourceGroupLayouts(builderName, azslData.m_srgData, platformUsesRegisterSpaces, srgLayoutList)) + { + AZ_Error(builderName, false, "Failed to obtain shader resource group assets"); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // The shader options define what options are available, what are the allowed values/range + // for each option and what is its default value. + if (!azslc.ParseOptionsPopulateOptionGroupLayout(outcomes[AzslSubProducts::options].GetValue(), shaderOptionGroupLayout)) + { + AZ_Error(builderName, false, "Failed to find a valid list of shader options!"); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // It analyzes the shader external bindings (all SRG contents) + // and informs us on register indexes and shader stages using these resources + if (!azslc.ParseBindingdepPopulateBindingDependencies( + outcomes[AzslSubProducts::bindingdep].GetValue(), bindingDependencies)) // consuming data from binding-dep + { + AZ_Error(builderName, false, "Failed to obtain shader resource binding reflection"); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + // access the root constants reflection + if (!azslc.ParseSrgPopulateRootConstantData( + outcomes[AzslSubProducts::srg].GetValue(), + rootConstantData)) // consuming data from --srg ("InlineConstantBuffer" subjson section) + { + AZ_Error(builderName, false, "Failed to obtain root constant data reflection"); return AssetBuilderSDK::ProcessJobResult_Failed; } @@ -312,7 +389,7 @@ namespace AZ } RHI::Ptr BuildPipelineLayoutDescriptorForApi( - [[maybe_unused]] const char* BuilderName, + [[maybe_unused]] const char* builderName, RHI::ShaderPlatformInterface* shaderPlatformInterface, BindingDependencies& bindingDependencies /*inout*/, const ShaderResourceGroupAssets& srgAssets, @@ -356,7 +433,7 @@ namespace AZ const BindingDependencies::SrgResources* srgResources = bindingDependencies.GetSrg(srgName); if (!srgResources) { - AZ_Error(BuilderName, false, "SRG %s not found in the dependency dataset", srgName.data()); + AZ_Error(builderName, false, "SRG %s not found in the dependency dataset", srgName.data()); return nullptr; } @@ -385,23 +462,21 @@ namespace AZ for (const auto& constantData : rootConstantData->m_constants) { RHI::ShaderInputConstantDescriptor rootConstantDesc( - constantData.m_nameId, - constantData.m_constantByteOffset, - constantData.m_constantByteSize, + constantData.m_nameId, constantData.m_constantByteOffset, constantData.m_constantByteSize, rootConstantData->m_bindingInfo.m_registerId); - + rootConstantsLayout->AddShaderInput(rootConstantDesc); } } - + if (!rootConstantsLayout->Finalize()) { - AZ_Error(BuilderName, false, "Failed to finalize root constants layout"); + AZ_Error(builderName, false, "Failed to finalize root constants layout"); return nullptr; } pipelineLayoutDescriptor->SetRootConstantsLayout(*rootConstantsLayout); - + RHI::ShaderPlatformInterface::RootConstantsInfo rootConstantInfo; if (rootConstantData) { @@ -415,14 +490,15 @@ namespace AZ rootConstantInfo.m_registerId = dummyRootConstantData.m_bindingInfo.m_registerId; } rootConstantInfo.m_totalSizeInBytes = rootConstantsLayout->GetDataSize(); - + // Build platform-specific PipelineLayoutDescriptor data, and finalize - if (!shaderPlatformInterface->BuildPipelineLayoutDescriptor(pipelineLayoutDescriptor, srgInfos, rootConstantInfo, shaderCompilerArguments)) + if (!shaderPlatformInterface->BuildPipelineLayoutDescriptor( + pipelineLayoutDescriptor, srgInfos, rootConstantInfo, shaderCompilerArguments)) { - AZ_Error(BuilderName, false, "Failed to build pipeline layout descriptor"); + AZ_Error(builderName, false, "Failed to build pipeline layout descriptor"); return nullptr; } - + return pipelineLayoutDescriptor; } @@ -442,7 +518,7 @@ namespace AZ } else { - formatted = AZStd::string::format("%s.%s.%s", stemName.c_str(), apiTypeString.c_str(), extension.c_str()); + formatted = AZStd::string::format("%s_%s.%s", stemName.c_str(), apiTypeString.c_str(), extension.c_str()); } AzFramework::StringFunc::Path::Join(dumpDirectory.c_str(), formatted.c_str(), finalFilePath, true, true); AZ::IO::FileIOStream outFileStream(finalFilePath.data(), AZ::IO::OpenMode::ModeWrite); @@ -463,14 +539,20 @@ namespace AZ return finalFilePath; } - AZStd::string DumpPreprocessedCode(const char* builderName, const AZStd::string& preprocessedCode, const AZStd::string& tempDirPath, const AZStd::string& stemName, const AZStd::string& apiTypeString) + // [GFX TODO] Remove 'add2' when [ATOM-15472] + AZStd::string DumpPreprocessedCode(const char* builderName, const AZStd::string& preprocessedCode, const AZStd::string& tempDirPath, const AZStd::string& stemName, const AZStd::string& apiTypeString, bool add2) { + if (add2) + { + return DumpCode(builderName, preprocessedCode, tempDirPath, stemName, apiTypeString, "azslin2"); + } + return DumpCode(builderName, preprocessedCode, tempDirPath, stemName, apiTypeString, "azslin"); } AZStd::string DumpAzslPrependedCode(const char* builderName, const AZStd::string& nonPreprocessedYetAzslSource, const AZStd::string& tempDirPath, const AZStd::string& stemName, const AZStd::string& apiTypeString) { - return DumpCode(builderName, nonPreprocessedYetAzslSource, tempDirPath, stemName, apiTypeString, "azsl.prepend"); + return DumpCode(builderName, nonPreprocessedYetAzslSource, tempDirPath, stemName, apiTypeString, "azslprepend"); } AZStd::string ExtractStemName(const char* path) @@ -489,6 +571,83 @@ namespace AZ return platformInterfaces; } + + AZStd::vector DiscoverEnabledShaderPlatformInterfaces(const AssetBuilderSDK::PlatformInfo& info, const RPI::ShaderSourceData& shaderSourceData) + { + // Request the list of valid shader platform interfaces for the target platform. + AZStd::vector platformInterfaces; + ShaderPlatformInterfaceRequestBus::BroadcastResult( + platformInterfaces, &ShaderPlatformInterfaceRequest::GetShaderPlatformInterface, info); + + // Let's remove the unwanted RHI interfaces from the list. + platformInterfaces.erase( + AZStd::remove_if(AZ_BEGIN_END(platformInterfaces), + [&](const RHI::ShaderPlatformInterface* shaderPlatformInterface) { + return !shaderPlatformInterface || + shaderSourceData.IsRhiBackendDisabled(shaderPlatformInterface->GetAPIName()) || + (shaderPlatformInterface->GetAPIUniqueIndex() == static_cast(AZ::RHI::APIIndex::Null)); + }), + platformInterfaces.end()); + return platformInterfaces; + } + + static bool IsValidSupervariantName(const AZStd::string& supervariantName) + { + return AZStd::all_of(AZ_BEGIN_END(supervariantName), + [](AZStd::string::value_type ch) + { + return AZStd::is_alnum(ch); // allow alpha numeric only + } + ); + } + + AZStd::vector GetSupervariantListFromShaderSourceData( + const RPI::ShaderSourceData& shaderSourceData) + { + AZStd::vector supervariants; + supervariants.reserve(shaderSourceData.m_supervariants.size() + 1); + + // Add the supervariants, always making sure that: + // 1- The default, nameless, supervariant goes to the front. + // 2- Each supervariant has a unique name + AZStd::unordered_set uniqueSuperVariants; // This set helps duplicate detection. + // Although it is not common, it is possible to declare a nameless supervariant. + bool addedNamelessSupervariant = false; + for (const auto& supervariantInfo : shaderSourceData.m_supervariants) + { + if (!IsValidSupervariantName(supervariantInfo.m_name.GetStringView())) + { + AZ_Error( + ShaderBuilderUtilityName, false, "The supervariant name: [%s] contains invalid characters. Only [a-zA-Z0-9] are supported", + supervariantInfo.m_name.GetCStr()); + return {}; // Return an empty vector. + } + if (uniqueSuperVariants.count(supervariantInfo.m_name)) + { + AZ_Error( + ShaderBuilderUtilityName, false, "It is invalid to specify more than one supervariant with the same name: [%s]", + supervariantInfo.m_name.GetCStr()); + return {}; // Return an empty vector. + } + uniqueSuperVariants.emplace(supervariantInfo.m_name); + supervariants.push_back(supervariantInfo); + if (supervariantInfo.m_name.IsEmpty()) + { + addedNamelessSupervariant = true; + // Always move the default, nameless, variant to the begining of the list. + AZStd::swap(supervariants.front(), supervariants.back()); + } + } + if (!addedNamelessSupervariant) + { + supervariants.push_back({}); + // Always move the default, nameless, variant to the begining of the list. + AZStd::swap(supervariants.front(), supervariants.back()); + } + + return supervariants; + } + static void ReadShaderCompilerProfiling([[maybe_unused]] const char* builderName, RHI::ShaderCompilerProfiling& shaderCompilerProfiling, AZStd::string_view shaderPath) { AZStd::string folderPath; @@ -561,12 +720,64 @@ namespace AZ uint32_t MakeAzslBuildProductSubId(RPI::ShaderAssetSubId subId, RHI::APIType apiType) { - auto subIdMaxEnumerator = RPI::ShaderAssetSubId::GeneratedSource; + auto subIdMaxEnumerator = RPI::ShaderAssetSubId::GeneratedHlslSource; // separate bit space between subid enum, and api-type: int shiftLeft = static_cast(log2(static_cast(subIdMaxEnumerator))) + 1; return static_cast(subId) + (apiType << shiftLeft); } + Outcome ObtainBuildArtifactPathFromShaderAssetBuilder2( + const uint32_t rhiUniqueIndex, const AZStd::string& platformIdentifier, const AZStd::string& shaderJsonPath, + const uint32_t supervariantIndex, RPI::ShaderAssetSubId shaderAssetSubId) + { + // platform id from identifier + AzFramework::PlatformId platformId = AzFramework::PlatformId::PC; + if (platformIdentifier == "pc") + { + platformId = AzFramework::PlatformId::PC; + } + else if (platformIdentifier == "mac") + { + platformId = AzFramework::PlatformId::MAC_ID; + } + else if (platformIdentifier == "android") + { + platformId = AzFramework::PlatformId::ANDROID_ID; + } + else if (platformIdentifier == "ios") + { + platformId = AzFramework::PlatformId::IOS; + } + + uint32_t assetSubId = RPI::ShaderAsset2::MakeProductAssetSubId(rhiUniqueIndex, supervariantIndex, aznumeric_cast(shaderAssetSubId)); + auto assetIdOutcome = RPI::AssetUtils::MakeAssetId(shaderJsonPath, assetSubId); + if (!assetIdOutcome.IsSuccess()) + { + return Failure(AZStd::string::format( + "Missing ShaderAssetBuilder2 product %s, for sub %d", shaderJsonPath.c_str(), (uint32_t)shaderAssetSubId)); + } + + Data::AssetId assetId = assetIdOutcome.TakeValue(); + // get the relative path: + AZStd::string assetPath; + Data::AssetCatalogRequestBus::BroadcastResult(assetPath, &Data::AssetCatalogRequests::GetAssetPathById, assetId); + + // get the root: + AZStd::string assetRoot = AzToolsFramework::PlatformAddressedAssetCatalog::GetAssetRootForPlatform(platformId); + // join + AZStd::string assetFullPath; + AzFramework::StringFunc::Path::Join(assetRoot.c_str(), assetPath.c_str(), assetFullPath); + bool fileExists = IO::FileIOBase::GetInstance()->Exists(assetFullPath.c_str()) && + !IO::FileIOBase::GetInstance()->IsDirectory(assetFullPath.c_str()); + if (!fileExists) + { + return Failure(AZStd::string::format( + "asset [%s] from shader source %s and subId %d doesn't exist", assetFullPath.c_str(), shaderJsonPath.c_str(), + (uint32_t)shaderAssetSubId)); + } + return AZ::Success(assetFullPath); + } + Outcome ObtainBuildArtifactsFromAzslBuilder([[maybe_unused]] const char* builderName, const AZStd::string& sourceFullPath, RHI::APIType apiType, const AZStd::string& platform) { AzslSubProducts::Paths products; @@ -577,13 +788,13 @@ namespace AZ { platformId = AzFramework::PlatformId::PC; } - else if (platform == "osx_gl") + else if (platform == "mac") { - platformId = AzFramework::PlatformId::OSX; + platformId = AzFramework::PlatformId::MAC_ID; } - else if (platform == "es3") + else if (platform == "android") { - platformId = AzFramework::PlatformId::ES3; + platformId = AzFramework::PlatformId::ANDROID_ID; } else if (platform == "ios") { @@ -619,6 +830,7 @@ namespace AZ return AZ::Success(products); } + // DEPRECATED [ATOM-15472] // See header for info. // REMARK: The approach to string searching and matching done in this function is kind of naive // because the strings can match text within a comment block, etc. So it is not 100% fool proof. @@ -672,6 +884,399 @@ namespace AZ return SrgSkipFileResult::ContinueProcess; } + + RHI::Ptr BuildPipelineLayoutDescriptorForApi( + [[maybe_unused]] const char* builderName, const RPI::ShaderResourceGroupLayoutList& srgLayoutList, const MapOfStringToStageType& shaderEntryPoints, + const RHI::ShaderCompilerArguments& shaderCompilerArguments, const RootConstantData& rootConstantData, + RHI::ShaderPlatformInterface* shaderPlatformInterface, BindingDependencies& bindingDependencies /*inout*/) + { + PruneNonEntryFunctions(bindingDependencies, shaderEntryPoints); + + // Translates from a list of function names that use a resource to a shader stage mask. + auto getRHIShaderStageMask = [&shaderEntryPoints](const BindingDependencies::FunctionsNameVector& functions) { + RHI::ShaderStageMask mask = RHI::ShaderStageMask::None; + // Iterate through all the functions that are using the resource. + for (const auto& functionName : functions) + { + // Search the function name into the list of valid entry points into the shader. + auto findId = + AZStd::find_if(shaderEntryPoints.begin(), shaderEntryPoints.end(), [&functionName, &mask](const auto& item) { + return item.first == functionName; + }); + + if (findId != shaderEntryPoints.end()) + { + // Use the entry point shader stage type to calculate the mask. + RHI::ShaderHardwareStage hardwareStage = ToAssetBuilderShaderType(findId->second); + mask |= static_cast(AZ_BIT(static_cast(RHI::ToRHIShaderStage(hardwareStage)))); + } + } + + return mask; + }; + + // Build general PipelineLayoutDescriptor data that is provided for all platforms + RHI::Ptr pipelineLayoutDescriptor = + shaderPlatformInterface->CreatePipelineLayoutDescriptor(); + RHI::ShaderPlatformInterface::ShaderResourceGroupInfoList srgInfos; + for (const auto& srgLayout : srgLayoutList) + { + // Search the binding info for a Shader Resource Group. + AZStd::string_view srgName = srgLayout->GetName().GetStringView(); + const BindingDependencies::SrgResources* srgResources = bindingDependencies.GetSrg(srgName); + if (!srgResources) + { + AZ_Error(builderName, false, "SRG %s not found in the dependency dataset", srgName.data()); + return nullptr; + } + + RHI::ShaderResourceGroupBindingInfo srgBindingInfo; + srgBindingInfo.m_spaceId = srgResources->m_registerSpace; + const RHI::ShaderResourceGroupLayout* layout = srgLayout.get(); + // Calculate the binding in for the constant data. All constant data share the same binding info. + srgBindingInfo.m_constantDataBindingInfo = { + getRHIShaderStageMask(srgResources->m_srgConstantsDependencies.m_binding.m_dependentFunctions), + srgResources->m_srgConstantsDependencies.m_binding.m_registerId}; + // Calculate the binding info for each resource of the Shader Resource Group. + for (auto const& resource : srgResources->m_resources) + { + auto const& resourceInfo = resource.second; + srgBindingInfo.m_resourcesRegisterMap.insert( + {AZ::Name(resourceInfo.m_selfName), + RHI::ResourceBindingInfo( + getRHIShaderStageMask(resourceInfo.m_dependentFunctions), resourceInfo.m_registerId)}); + } + pipelineLayoutDescriptor->AddShaderResourceGroupLayoutInfo(*layout, srgBindingInfo); + srgInfos.push_back(RHI::ShaderPlatformInterface::ShaderResourceGroupInfo{layout, srgBindingInfo}); + } + + RHI::Ptr rootConstantsLayout = RHI::ConstantsLayout::Create(); + for (const auto& constantData : rootConstantData.m_constants) + { + RHI::ShaderInputConstantDescriptor rootConstantDesc( + constantData.m_nameId, constantData.m_constantByteOffset, constantData.m_constantByteSize, + rootConstantData.m_bindingInfo.m_registerId); + + rootConstantsLayout->AddShaderInput(rootConstantDesc); + } + + + if (!rootConstantsLayout->Finalize()) + { + AZ_Error(builderName, false, "Failed to finalize root constants layout"); + return nullptr; + } + + pipelineLayoutDescriptor->SetRootConstantsLayout(*rootConstantsLayout); + + RHI::ShaderPlatformInterface::RootConstantsInfo rootConstantInfo; + rootConstantInfo.m_spaceId = rootConstantData.m_bindingInfo.m_space; + rootConstantInfo.m_registerId = rootConstantData.m_bindingInfo.m_registerId; + rootConstantInfo.m_totalSizeInBytes = rootConstantsLayout->GetDataSize(); + + // Build platform-specific PipelineLayoutDescriptor data, and finalize + if (!shaderPlatformInterface->BuildPipelineLayoutDescriptor( + pipelineLayoutDescriptor, srgInfos, rootConstantInfo, shaderCompilerArguments)) + { + AZ_Error(builderName, false, "Failed to build pipeline layout descriptor"); + return nullptr; + } + + return pipelineLayoutDescriptor; + } + + static bool IsSystemValueSemantic(const AZStd::string_view semantic) + { + // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics#system-value-semantics + return AzFramework::StringFunc::StartsWith(semantic, "sv_", false); + } + + static bool CreateShaderInputContract( + const AzslData& azslData, + const AZStd::string& vertexShaderName, + const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout, + const AZStd::string& pathToIaJson, + RPI::ShaderInputContract& contract) + { + StructData inputStruct; + inputStruct.m_id = ""; + + auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(pathToIaJson); + if (!jsonOutcome.IsSuccess()) + { + AZ_Error(ShaderBuilderUtilityName, false, "%s", jsonOutcome.GetError().c_str()); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + AzslCompiler azslc(azslData.m_preprocessedFullPath); + if (!azslc.ParseIaPopulateStructData(jsonOutcome.GetValue(), vertexShaderName, inputStruct)) + { + AZ_Error(ShaderBuilderUtilityName, false, "Failed to parse input layout\n"); + return false; + } + + if (inputStruct.m_id.empty()) + { + AZ_Error( + ShaderBuilderUtilityName, false, "Failed to find the input struct for vertex shader %s.", + vertexShaderName.c_str()); + return false; + } + + for (const auto& member : inputStruct.m_members) + { + RHI::ShaderSemantic streamChannelSemantic{Name{member.m_semanticText}, static_cast(member.m_semanticIndex)}; + + // Semantics that represent a system-generated value do not map to an input stream + if (IsSystemValueSemantic(streamChannelSemantic.m_name.GetStringView())) + { + continue; + } + + contract.m_streamChannels.push_back(); + contract.m_streamChannels.back().m_semantic = streamChannelSemantic; + + if (member.m_variable.m_typeModifier == MatrixMajor::ColumnMajor) + { + contract.m_streamChannels.back().m_componentCount = member.m_variable.m_cols; + } + else + { + contract.m_streamChannels.back().m_componentCount = member.m_variable.m_rows; + } + + // [GFX_TODO][ATOM-14475]: Come up with a more elegant way to mark optional channels and their corresponding shader + // option + static const char OptionalInputStreamPrefix[] = "m_optional_"; + if (AzFramework::StringFunc::StartsWith(member.m_variable.m_name, OptionalInputStreamPrefix, true)) + { + AZStd::string expectedOptionName = AZStd::string::format( + "o_%s_isBound", member.m_variable.m_name.substr(strlen(OptionalInputStreamPrefix)).c_str()); + + RPI::ShaderOptionIndex shaderOptionIndex = shaderOptionGroupLayout.FindShaderOptionIndex(Name{expectedOptionName}); + if (!shaderOptionIndex.IsValid()) + { + AZ_Error( + ShaderBuilderUtilityName, false, "Shader option '%s' not found for optional input stream '%s'", + expectedOptionName.c_str(), member.m_variable.m_name.c_str()); + return false; + } + + const RPI::ShaderOptionDescriptor& option = shaderOptionGroupLayout.GetShaderOption(shaderOptionIndex); + if (option.GetType() != RPI::ShaderOptionType::Boolean) + { + AZ_Error(ShaderBuilderUtilityName, false, "Shader option '%s' must be a bool.", expectedOptionName.c_str()); + return false; + } + + if (option.GetDefaultValue().GetStringView() != "false") + { + AZ_Error( + ShaderBuilderUtilityName, false, "Shader option '%s' must default to false.", + expectedOptionName.c_str()); + return false; + } + + contract.m_streamChannels.back().m_isOptional = true; + contract.m_streamChannels.back().m_streamBoundIndicatorIndex = shaderOptionIndex; + } + } + + return true; + } + + static bool CreateShaderOutputContract( + const AzslData& azslData, + const AZStd::string& fragmentShaderName, + const AZStd::string& pathToOmJson, + RPI::ShaderOutputContract& contract) + { + StructData outputStruct; + outputStruct.m_id = ""; + + auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(pathToOmJson); + if (!jsonOutcome.IsSuccess()) + { + AZ_Error(ShaderBuilderUtilityName, false, "%s", jsonOutcome.GetError().c_str()); + return AssetBuilderSDK::ProcessJobResult_Failed; + } + + AzslCompiler azslc(azslData.m_preprocessedFullPath); + if (!azslc.ParseOmPopulateStructData(jsonOutcome.GetValue(), fragmentShaderName, outputStruct)) + { + AZ_Error(ShaderBuilderUtilityName, false, "Failed to parse output layout\n"); + return false; + } + + for (const auto& member : outputStruct.m_members) + { + RHI::ShaderSemantic semantic = RHI::ShaderSemantic::Parse(member.m_semanticText); + + bool depthFound = false; + + if (semantic.m_name.GetStringView() == "SV_Target") + { + contract.m_requiredColorAttachments.push_back(); + // Render targets only support 1-D vector types and those are always column-major (per DXC) + contract.m_requiredColorAttachments.back().m_componentCount = member.m_variable.m_cols; + } + else if ( + semantic.m_name.GetStringView() == "SV_Depth" || semantic.m_name.GetStringView() == "SV_DepthGreaterEqual" || + semantic.m_name.GetStringView() == "SV_DepthLessEqual") + { + if (depthFound) + { + AZ_Error( + ShaderBuilderUtilityName, false, + "SV_Depth specified more than once in the fragment shader output structure"); + return false; + } + depthFound = true; + } + else + { + AZ_Error( + ShaderBuilderUtilityName, false, "Unsupported shader output semantic '%s'.", semantic.m_name.GetCStr()); + return false; + } + } + + return true; + } + + bool CreateShaderInputAndOutputContracts( + const AzslData& azslData, + const MapOfStringToStageType& shaderEntryPoints, + const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout, + const AZStd::string& pathToOmJson, + const AZStd::string& pathToIaJson, + RPI::ShaderInputContract& shaderInputContract, + RPI::ShaderOutputContract& shaderOutputContract, + size_t& colorAttachmentCount) + { + bool success = true; + for (const auto& shaderEntryPoint : shaderEntryPoints) + { + auto shaderEntryName = shaderEntryPoint.first; + auto shaderStageType = shaderEntryPoint.second; + + if (shaderStageType == RPI::ShaderStageType::Vertex) + { + const bool layoutCreated = CreateShaderInputContract(azslData, shaderEntryName, shaderOptionGroupLayout, pathToIaJson, shaderInputContract); + if (!layoutCreated) + { + success = false; + AZ_Error( + ShaderBuilderUtilityName, false, "Could not create the input contract for the vertex function %s", + shaderEntryName.c_str()); + continue; // Using continue to report all the errors found + } + } + + if (shaderStageType == RPI::ShaderStageType::Fragment) + { + const bool layoutCreated = + CreateShaderOutputContract(azslData, shaderEntryName, pathToOmJson, shaderOutputContract); + if (!layoutCreated) + { + success = false; + AZ_Error( + ShaderBuilderUtilityName, false, "Could not create the output contract for the fragment function %s", + shaderEntryName.c_str()); + continue; // Using continue to report all the errors found + } + + colorAttachmentCount = shaderOutputContract.m_requiredColorAttachments.size(); + } + } + return success; + } + + + //! Returns a list of acceptable default entry point names + static void GetAcceptableDefaultEntryPoints( + const AZStd::vector& azslFunctionDataList, + AZStd::unordered_map& defaultEntryPoints) + { + for (const auto& func : azslFunctionDataList) + { + if (!func.m_hasShaderStageVaryings) + { + // Not declaring any semantics for a shader entry is valid, but unusual. + // A shader entry with no semantics must be explicitly listed and won't be selected by default. + continue; + } + + if (func.m_name.starts_with("VS") || func.m_name.ends_with("VS")) + { + defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Vertex; + AZ_TracePrintf( + ShaderBuilderUtilityName, "Assuming \"%s\" is a valid Vertex shader entry point.\n", func.m_name.c_str()); + } + else if (func.m_name.starts_with("PS") || func.m_name.ends_with("PS")) + { + defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Fragment; + AZ_TracePrintf( + ShaderBuilderUtilityName, "Assuming \"%s\" is a valid Fragment shader entry point.\n", + func.m_name.c_str()); + } + else if (func.m_name.starts_with("CS") || func.m_name.ends_with("CS")) + { + defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Compute; + AZ_TracePrintf( + ShaderBuilderUtilityName, "Assuming \"%s\" is a valid Compute shader entry point.\n", func.m_name.c_str()); + } + } + } + + + // DEPRECATED [ATOM-15472 + //! Returns a list of acceptable default entry point names + //! This function + static void GetAcceptableDefaultEntryPoints( + const AzslData& azslData, AZStd::unordered_map& defaultEntryPoints) + { + return GetAcceptableDefaultEntryPoints(azslData.m_functions, defaultEntryPoints); + } + + + void GetDefaultEntryPointsFromFunctionDataList( + const AZStd::vector azslFunctionDataList, + AZStd::unordered_map& shaderEntryPoints) + { + AZStd::unordered_map defaultEntryPoints; + GetAcceptableDefaultEntryPoints(azslFunctionDataList, defaultEntryPoints); + + for (const auto& functionData : azslFunctionDataList) + { + for (const auto& defaultEntryPoint : defaultEntryPoints) + { + // Equal defaults to case insensitive compares... + if (AzFramework::StringFunc::Equal(defaultEntryPoint.first.c_str(), functionData.m_name.c_str())) + { + shaderEntryPoints[defaultEntryPoint.first] = defaultEntryPoint.second; + break; // stop looping default entry points and go to the next shader function + } + } + } + } + + AZStd::string GetAcceptableDefaultEntryPointNames(const AzslData& azslData) + { + AZStd::unordered_map defaultEntryPointList; + GetAcceptableDefaultEntryPoints(azslData, defaultEntryPointList); + + AZStd::vector defaultEntryPointNamesList; + for (const auto& shaderEntryPoint : defaultEntryPointList) + { + defaultEntryPointNamesList.push_back(shaderEntryPoint.first); + } + AZStd::string shaderEntryPoints; + AzFramework::StringFunc::Join( + shaderEntryPoints, defaultEntryPointNamesList.begin(), defaultEntryPointNamesList.end(), ", "); + return AZStd::move(shaderEntryPoints); + } + } // namespace ShaderBuilderUtility } // namespace ShaderBuilder } // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.h index d6926d0086..e31c6c70a1 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderBuilderUtility.h @@ -18,8 +18,10 @@ #include #include +#include #include +#include "AzslData.h" namespace AZ { @@ -27,7 +29,6 @@ namespace AZ { class AzslCompiler; struct ShaderFiles; - struct AzslData; struct BindingDependencies; struct RootConstantData; @@ -40,8 +41,6 @@ namespace AZ void GetAbsolutePathToAzslFile(const AZStd::string& shaderTemplatePathAndFile, AZStd::string specifiedShaderPathAndName, AZStd::string& absoluteShaderPath); - uint32_t MakeDebugByproductSubId(RHI::APIType apiType, const AZStd::string& productFileName); - //! Opens and read the .shader, returns expanded file paths AZStd::shared_ptr PrepareSourceInput( const char* builderName, @@ -54,13 +53,20 @@ namespace AZ using SubId = RPI::ShaderAssetSubId; // product sub id enumerators: - static constexpr SubId SubList[] = { SubId::PostPreprocessingPureAzsl, SubId::IaJson, SubId::OmJson, SubId::SrgJson, SubId::OptionsJson, SubId::BindingdepJson, SubId::GeneratedSource }; + static constexpr SubId SubList[] = {SubId::PostPreprocessingPureAzsl, + SubId::IaJson, + SubId::OmJson, + SubId::SrgJson, + SubId::OptionsJson, + SubId::BindingdepJson, + SubId::GeneratedHlslSource}; // in the same order, their file name suffix (they replicate what's in AzslcMain.cpp. and hlsl corresponds to what's in AzslBuilder.cpp) // a type to declare variables holding the full paths of their files using Paths = AZStd::fixed_vector; }; + //! [GFX TODO] [ATOM-15472] Deprecated, remove when this ticket is addressed. //! Collects and generates the necessary data for compiling a shader. //! @azslData must have paths correctly set. //! shaderOptionGroupLayout, azslData, srgAssets get the output data. @@ -74,6 +80,16 @@ namespace AZ RootConstantData& rootConstantData ); + //! Collects all the JSON files generated during AZSL compilation and loads the data as objects. + //! @azslData must have paths correctly set. + //! @azslData, @srgLayoutList, @shaderOptionGroupLayout, @bindingDependencies and @rootConstantData get the output data. + AssetBuilderSDK::ProcessJobResultCode PopulateAzslDataFromJsonFiles( + const char* builderName, const AzslSubProducts::Paths& pathOfJsonFiles, + const bool platformUsesRegisterSpaces, AzslData& azslData, + RPI::ShaderResourceGroupLayoutList& srgLayoutList, RPI::Ptr shaderOptionGroupLayout, + BindingDependencies& bindingDependencies, RootConstantData& rootConstantData); + + RHI::ShaderHardwareStage ToAssetBuilderShaderType(RPI::ShaderStageType stageType); //! Must be called before shaderPlatformInterface->CompilePlatformInternal() @@ -82,7 +98,7 @@ namespace AZ //! The pipeline layout descriptor is returned, but the same data will also be set into the @shaderPlatformInterface //! object, which is why it is important to call this method before calling shaderPlatformInterface->CompilePlatformInternal(). RHI::Ptr BuildPipelineLayoutDescriptorForApi( - const char* BuilderName, + const char* builderName, RHI::ShaderPlatformInterface* shaderPlatformInterface, BindingDependencies& bindingDependencies /*inout*/, const ShaderResourceGroupAssets& srgAssets, @@ -91,6 +107,33 @@ namespace AZ const RootConstantData* rootConstantData = nullptr ); + + //! Must be called before shaderPlatformInterface->CompilePlatformInternal() + //! This function will prune non entry functions from BindingDependencies and use the + //! rest of input data to create a pipeline layout descriptor. + //! The pipeline layout descriptor is returned, but the same data will also be set into the @shaderPlatformInterface + //! object, which is why it is important to call this method before calling shaderPlatformInterface->CompilePlatformInternal(). + RHI::Ptr BuildPipelineLayoutDescriptorForApi( + const char* builderName, + const RPI::ShaderResourceGroupLayoutList& srgLayoutList, + const MapOfStringToStageType& shaderEntryPoints, + const RHI::ShaderCompilerArguments& shaderCompilerArguments, + const RootConstantData& rootConstantData, + RHI::ShaderPlatformInterface* shaderPlatformInterface, + BindingDependencies& bindingDependencies /*inout*/); + + + bool CreateShaderInputAndOutputContracts( + const AzslData& azslData, const MapOfStringToStageType& shaderEntryPoints, + const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout, const AZStd::string& pathToOmJson, + const AZStd::string& pathToIaJson, RPI::ShaderInputContract& shaderInputContract, + RPI::ShaderOutputContract& shaderOutputContract, size_t& colorAttachmentCount); + + + //! Returns a list of acceptable default entry point names as a single string for debug messages. + AZStd::string GetAcceptableDefaultEntryPointNames(const AzslData& shaderData); + + //! Create a file from a string's content. //! That file will be named filename.api.azslin //! This is meant to be used at this stage: @@ -102,7 +145,8 @@ namespace AZ const AZStd::string& preprocessedCode, const AZStd::string& tempDirPath, const AZStd::string& preprocessedFileName, - const AZStd::string& apiTypeString = ""); + const AZStd::string& apiTypeString = "", + bool add2 = false); // [GFX TODO] Remove add2 when [ATOM-15472] //! Create a file from a string's content. //! That file will be named filename.api.azsl.prepend @@ -121,12 +165,30 @@ namespace AZ AZStd::string ExtractStemName(const char* path); AZStd::vector DiscoverValidShaderPlatformInterfaces(const AssetBuilderSDK::PlatformInfo& info); + AZStd::vector DiscoverEnabledShaderPlatformInterfaces( + const AssetBuilderSDK::PlatformInfo& info, const RPI::ShaderSourceData& shaderSourceData); + + // The idea is that the "Supervariants" json property is optional in .shader files, + // For cases when it is not specified, this function will return a vector with one item, the default, nameless, supervariant. + // If "Supervariants" is not empty, then this function will make sure the first supervariant in the list + // is the default, nameless, supervariant. + AZStd::vector GetSupervariantListFromShaderSourceData( + const RPI::ShaderSourceData& shaderSourceData); + + void GetDefaultEntryPointsFromFunctionDataList( + const AZStd::vector azslFunctionDataList, + AZStd::unordered_map& shaderEntryPoints); void LogProfilingData(const char* builderName, AZStd::string_view shaderPath); //! Job products sub id generation helper for AzslBuilder uint32_t MakeAzslBuildProductSubId(RPI::ShaderAssetSubId subId, RHI::APIType apiType); + //! Returns the asset path of a product artifact produced by ShaderAssetBuilder2. + Outcome ObtainBuildArtifactPathFromShaderAssetBuilder2( + const uint32_t rhiUniqueIndex, const AZStd::string& platformIdentifier, const AZStd::string& shaderJsonPath, + const uint32_t supervariantIndex, RPI::ShaderAssetSubId shaderAssetSubId); + //! Reconstructs the expected output product paths of the AzslBuilder (from the 2 arguments @azslSourceFullPath and @apiType) Outcome ObtainBuildArtifactsFromAzslBuilder(const char* builderName, const AZStd::string& azslSourceFullPath, RHI::APIType apiType, const AZStd::string& platform); diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp index 02cb8bd242..7114b50906 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.cpp @@ -276,12 +276,6 @@ namespace AZ return LoadResult{LoadResult::Code::DeferredError, AZStd::string::format("ShaderSourceData file does not exist: %s.", shaderSourceFileFullPath.c_str())}; } - // Let's open the shader source, because We need the source code of its AZSL file - auto outcomeShaderData = ShaderBuilderUtility::LoadShaderDataJson(shaderSourceFileFullPath); - if (!outcomeShaderData.IsSuccess()) - { - return LoadResult{LoadResult::Code::DeferredError, AZStd::string::format("Failed to parse Shader Descriptor JSON: %s", outcomeShaderData.GetError().c_str())}; - } return LoadResult{LoadResult::Code::Success}; } // LoadShaderVariantListAndAzslSource @@ -420,15 +414,6 @@ namespace AZ return; } - if (jobParameters.find(ShouldExitEarlyFromProcessJobParam) != jobParameters.end()) - { - AZ_TracePrintf( - ShaderVariantAssetBuilderName, "Doing nothing on behalf of [%s] because it's been overriden by game project.", - jobParameters.at(ShaderVariantLoadErrorParam).c_str()); - response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; - return; - } - AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); if (jobCancelListener.IsCancelled()) { @@ -589,7 +574,7 @@ namespace AZ if (shaderSourceDataDescriptor.m_programSettings.m_entryPoints.empty()) { AZ_TracePrintf(ShaderVariantAssetBuilderName, "ProgramSettings do not specify entry points, will use GetDefaultEntryPointsFromShader()\n"); - ShaderVariantAssetBuilder::GetDefaultEntryPointsFromAzslData(azslData, shaderEntryPoints); + ShaderBuilderUtility::GetDefaultEntryPointsFromFunctionDataList(azslData.m_functions, shaderEntryPoints); } else { @@ -778,7 +763,7 @@ namespace AZ } // Time to save the asset in the cache tmp folder. - const uint32_t productSubID = RPI::ShaderVariantAsset::GetAssetSubId(shaderPlatformInterface->GetAPIUniqueIndex(), shaderVariantAsset->GetStableId()); + const uint32_t productSubID = RPI::ShaderVariantAsset::MakeAssetProductSubId(shaderPlatformInterface->GetAPIUniqueIndex(), shaderVariantAsset->GetStableId()); AssetBuilderSDK::JobProduct assetProduct; if (!SerializeOutShaderVariantAsset(shaderVariantAsset, shaderSourceFileFullPath, request.m_tempDirPath, *shaderPlatformInterface, productSubID, assetProduct)) { @@ -788,12 +773,14 @@ namespace AZ response.m_outputProducts.push_back(assetProduct); // add byproducts as job output products: + uint32_t subProductType = aznumeric_cast(RPI::ShaderAssetSubId::GeneratedHlslSource) + 1; for (const AZStd::string& byproduct : byproducts.m_intermediatePaths) { AssetBuilderSDK::JobProduct jobProduct; jobProduct.m_productFileName = byproduct; jobProduct.m_productAssetType = Uuid::CreateName("DebugInfoByProduct-PdbOrDxilTxt"); - jobProduct.m_productSubID = ShaderBuilderUtility::MakeDebugByproductSubId(shaderPlatformInterface->GetAPIType(), byproduct); + jobProduct.m_productSubID = RPI::ShaderVariantAsset::MakeAssetProductSubId( + shaderPlatformInterface->GetAPIType(), shaderVariantAsset->GetStableId(), subProductType++); response.m_outputProducts.push_back(AZStd::move(jobProduct)); } } @@ -801,53 +788,6 @@ namespace AZ response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; } - - /// Returns a list of acceptable default entry point names - static void GetAcceptableDefaultEntryPoints(const AzslData& shaderData, AZStd::unordered_map& defaultEntryPoints) - { - for (const auto& func : shaderData.m_topData.m_functions) - { - if (!func.m_hasShaderStageVaryings) - { - // Not declaring any semantics for a shader entry is valid, but unusual. - // A shader entry with no semantics must be explicitly listed and won't be selected by default. - continue; - } - - if (func.m_name.starts_with("VS") || func.m_name.ends_with("VS")) - { - defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Vertex; - AZ_TracePrintf(ShaderVariantAssetBuilderName, "Assuming \"%s\" is a valid Vertex shader entry point.\n", func.m_name.c_str()); - } - else if (func.m_name.starts_with("PS") || func.m_name.ends_with("PS")) - { - defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Fragment; - AZ_TracePrintf(ShaderVariantAssetBuilderName, "Assuming \"%s\" is a valid Fragment shader entry point.\n", func.m_name.c_str()); - } - else if (func.m_name.starts_with("CS") || func.m_name.ends_with("CS")) - { - defaultEntryPoints[func.m_name] = RPI::ShaderStageType::Compute; - AZ_TracePrintf(ShaderVariantAssetBuilderName, "Assuming \"%s\" is a valid Compute shader entry point.\n", func.m_name.c_str()); - } - } - } - - /// Returns a list of acceptable default entry point names as a single string for messages - static AZStd::string GetAcceptableDefaultEntryPointNames(const AzslData& shaderData) - { - AZStd::unordered_map defaultEntryPointList; - GetAcceptableDefaultEntryPoints(shaderData, defaultEntryPointList); - - AZStd::vector defaultEntryPointNamesList; - for (const auto& shaderEntryPoint : defaultEntryPointList) - { - defaultEntryPointNamesList.push_back(shaderEntryPoint.first); - } - AZStd::string shaderEntryPoints; - AzFramework::StringFunc::Join(shaderEntryPoints, defaultEntryPointNamesList.begin(), defaultEntryPointNamesList.end(), ", "); - return AZStd::move(shaderEntryPoints); - } - static bool CreateShaderVariant( ShaderVariantCreationContext& variantCreationContext, const AzslData& azslData, @@ -945,7 +885,7 @@ namespace AZ if (!hasRasterProgram && !hasComputeProgram && !hasRayTracingProgram) { - AZStd::string entryPointNames = GetAcceptableDefaultEntryPointNames(azslData); + AZStd::string entryPointNames = ShaderBuilderUtility::GetAcceptableDefaultEntryPointNames(azslData); AZ_Error(ShaderVariantAssetBuilderName, false, "Shader asset descriptor has a program variant that does not define any entry points. Either declare entry points in the .shader file, or use one of the available default names (not case-sensitive): [%s]", entryPointNames.data()); @@ -990,198 +930,6 @@ namespace AZ return isVariantValid; } - static bool IsSystemValueSemantic(const AZStd::string_view semantic) - { - // https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-semantics#system-value-semantics - return AzFramework::StringFunc::StartsWith(semantic, "sv_", false); - } - - static bool CreateShaderInputContract( - const AzslData& azslData, - const AZStd::string& vertexShaderName, - const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout, - RPI::ShaderInputContract& contract, - const AZStd::string& pathToIaJson) - { - StructData inputStruct; - inputStruct.m_id = ""; - - auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(pathToIaJson); - if (!jsonOutcome.IsSuccess()) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "%s", jsonOutcome.GetError().c_str()); - return AssetBuilderSDK::ProcessJobResult_Failed; - } - - AzslCompiler azslc(azslData.m_preprocessedFullPath); - if (!azslc.ParseIaPopulateStructData(jsonOutcome.GetValue(), vertexShaderName, inputStruct)) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to parse input layout\n"); - return false; - } - - if (inputStruct.m_id.empty()) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to find the input struct for vertex shader %s.", vertexShaderName.c_str()); - return false; - } - - for (const auto& member : inputStruct.m_members) - { - RHI::ShaderSemantic streamChannelSemantic{ - Name{ member.m_semanticText }, - static_cast(member.m_semanticIndex) }; - - // Semantics that represent a system-generated value do not map to an input stream - if (IsSystemValueSemantic(streamChannelSemantic.m_name.GetStringView())) - { - continue; - } - - contract.m_streamChannels.push_back(); - contract.m_streamChannels.back().m_semantic = streamChannelSemantic; - - if (member.m_variable.m_typeModifier == MatrixMajor::ColumnMajor) - { - contract.m_streamChannels.back().m_componentCount = member.m_variable.m_cols; - } - else - { - contract.m_streamChannels.back().m_componentCount = member.m_variable.m_rows; - } - - // [GFX_TODO][ATOM-14475]: Come up with a more elegant way to mark optional channels and their corresponding shader option - static const char OptionalInputStreamPrefix[] = "m_optional_"; - if (AzFramework::StringFunc::StartsWith(member.m_variable.m_name, OptionalInputStreamPrefix, true)) - { - AZStd::string expectedOptionName = AZStd::string::format("o_%s_isBound", member.m_variable.m_name.substr(strlen(OptionalInputStreamPrefix)).c_str()); - - RPI::ShaderOptionIndex shaderOptionIndex = shaderOptionGroupLayout.FindShaderOptionIndex(Name{expectedOptionName}); - if (!shaderOptionIndex.IsValid()) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Shader option '%s' not found for optional input stream '%s'", expectedOptionName.c_str(), member.m_variable.m_name.c_str()); - return false; - } - - const RPI::ShaderOptionDescriptor& option = shaderOptionGroupLayout.GetShaderOption(shaderOptionIndex); - if (option.GetType() != RPI::ShaderOptionType::Boolean) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Shader option '%s' must be a bool.", expectedOptionName.c_str()); - return false; - } - - if (option.GetDefaultValue().GetStringView() != "false") - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Shader option '%s' must default to false.", expectedOptionName.c_str()); - return false; - } - - contract.m_streamChannels.back().m_isOptional = true; - contract.m_streamChannels.back().m_streamBoundIndicatorIndex = shaderOptionIndex; - } - } - - return true; - } - - static bool CreateShaderOutputContract( - const AzslData& azslData, - const AZStd::string& fragmentShaderName, - RPI::ShaderOutputContract& contract, - const AZStd::string& pathToOmJson) - { - StructData outputStruct; - outputStruct.m_id = ""; - - auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(pathToOmJson); - if (!jsonOutcome.IsSuccess()) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "%s", jsonOutcome.GetError().c_str()); - return AssetBuilderSDK::ProcessJobResult_Failed; - } - - AzslCompiler azslc(azslData.m_preprocessedFullPath); - if (!azslc.ParseOmPopulateStructData(jsonOutcome.GetValue(), fragmentShaderName, outputStruct)) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Failed to parse output layout\n"); - return false; - } - - for (const auto& member : outputStruct.m_members) - { - RHI::ShaderSemantic semantic = RHI::ShaderSemantic::Parse(member.m_semanticText); - - bool depthFound = false; - - if (semantic.m_name.GetStringView() == "SV_Target") - { - contract.m_requiredColorAttachments.push_back(); - // Render targets only support 1-D vector types and those are always column-major (per DXC) - contract.m_requiredColorAttachments.back().m_componentCount = member.m_variable.m_cols; - } - else if (semantic.m_name.GetStringView() == "SV_Depth" || - semantic.m_name.GetStringView() == "SV_DepthGreaterEqual" || - semantic.m_name.GetStringView() == "SV_DepthLessEqual") - { - if (depthFound) - { - AZ_Error(ShaderVariantAssetBuilderName, false, "SV_Depth specified more than once in the fragment shader output structure"); - return false; - } - depthFound = true; - } - else - { - AZ_Error(ShaderVariantAssetBuilderName, false, "Unsupported shader output semantic '%s'.", semantic.m_name.GetCStr()); - return false; - } - } - - return true; - } - - static bool CreateShaderInputAndOutputContracts( - const AzslData& azslData, - const MapOfStringToStageType& shaderEntryPoints, - const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout, - RPI::ShaderInputContract& shaderInputContract, - RPI::ShaderOutputContract& shaderOutputContract, - size_t& colorAttachmentCount, - const AZStd::string& pathToOmJson, - const AZStd::string& pathToIaJson) - { - bool success = true; - for (const auto& shaderEntryPoint : shaderEntryPoints) - { - auto shaderEntryName = shaderEntryPoint.first; - auto shaderStageType = shaderEntryPoint.second; - - if (shaderStageType == RPI::ShaderStageType::Vertex) - { - const bool layoutCreated = CreateShaderInputContract(azslData, shaderEntryName, shaderOptionGroupLayout, shaderInputContract, pathToIaJson); - if (!layoutCreated) - { - success = false; - AZ_Error(ShaderVariantAssetBuilderName, false, "Could not create the input contract for the vertex function %s", shaderEntryName.c_str()); - continue; // Using continue to report all the errors found - } - } - - if (shaderStageType == RPI::ShaderStageType::Fragment) - { - const bool layoutCreated = CreateShaderOutputContract(azslData, shaderEntryName, shaderOutputContract, pathToOmJson); - if (!layoutCreated) - { - success = false; - AZ_Error(ShaderVariantAssetBuilderName, false, "Could not create the output contract for the fragment function %s", shaderEntryName.c_str()); - continue; // Using continue to report all the errors found - } - - colorAttachmentCount = shaderOutputContract.m_requiredColorAttachments.size(); - } - } - return success; - } AZ::Outcome, AZStd::string> ShaderVariantAssetBuilder::CreateShaderVariantAssetForAPI( const RPI::ShaderVariantListSourceData::VariantInfo& variantInfo, @@ -1195,8 +943,8 @@ namespace AZ RPI::ShaderInputContract shaderInputContract; RPI::ShaderOutputContract shaderOutputContract; size_t colorAttachmentCount = 0; - CreateShaderInputAndOutputContracts(azslData, variantCreationContext.m_shaderEntryPoints, variantCreationContext.m_shaderOptionGroupLayout, - shaderInputContract, shaderOutputContract, colorAttachmentCount, pathToOmJson, pathToIaJson); + ShaderBuilderUtility::CreateShaderInputAndOutputContracts(azslData, variantCreationContext.m_shaderEntryPoints, variantCreationContext.m_shaderOptionGroupLayout, pathToOmJson, + pathToIaJson, shaderInputContract, shaderOutputContract, colorAttachmentCount); const RPI::ShaderOptionGroupLayout& shaderOptionGroupLayout = variantCreationContext.m_shaderOptionGroupLayout; // Temporary structure used for sorting and caching intermediate results @@ -1284,25 +1032,6 @@ namespace AZ return AZ::Success(AZStd::move(shaderVariantAsset)); } - void ShaderVariantAssetBuilder::GetDefaultEntryPointsFromAzslData(const AzslData& shaderData, AZStd::unordered_map& shaderEntryPoints) - { - AZStd::unordered_map defaultEntryPoints; - GetAcceptableDefaultEntryPoints(shaderData, defaultEntryPoints); - - for (const auto& functionData : shaderData.m_topData.m_functions) - { - for (const auto& defaultEntryPoint : defaultEntryPoints) - { - // Equal defaults to case insensitive compares... - if (AzFramework::StringFunc::Equal(defaultEntryPoint.first.c_str(), functionData.m_name.c_str())) - { - shaderEntryPoints[defaultEntryPoint.first] = defaultEntryPoint.second; - break; // stop looping default entry points and go to the next shader function - } - } - } - } - bool ShaderVariantAssetBuilder::SerializeOutShaderVariantAsset(const Data::Asset shaderVariantAsset, const AZStd::string& shaderSourceFileFullPath, const AZStd::string& tempDirPath, const RHI::ShaderPlatformInterface& shaderPlatformInterface, const uint32_t productSubID, AssetBuilderSDK::JobProduct& assetProduct) { diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.h index 7dd76f7ef1..84ab4fbc70 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.h +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder.h @@ -73,8 +73,6 @@ namespace AZ static bool SerializeOutShaderVariantAsset(const Data::Asset shaderVariantAsset, const AZStd::string& shaderFullPath, const AZStd::string& tempDirPath, const RHI::ShaderPlatformInterface& shaderPlatformInterface, const uint32_t productSubID, AssetBuilderSDK::JobProduct& assetProduct); - static void GetDefaultEntryPointsFromAzslData(const AzslData& shaderData, AZStd::unordered_map& shaderEntryPoints); - // AssetBuilderSDK::AssetBuilderCommandBus interface overrides ... void ShutDown() override { }; diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.cpp new file mode 100644 index 0000000000..961e54c7a8 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.cpp @@ -0,0 +1,978 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +*/ + +#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 "ShaderAssetBuilder2.h" +#include "ShaderBuilderUtility.h" +#include "AzslData.h" +#include "AzslCompiler.h" +#include "AzslBuilder.h" +#include +#include +#include +#include "AtomShaderConfig.h" + +namespace AZ +{ + namespace ShaderBuilder + { + static constexpr char ShaderVariantAssetBuilder2Name[] = "ShaderVariantAssetBuilder2"; + + static void AddShaderAssetJobDependency2( + AssetBuilderSDK::JobDescriptor& jobDescriptor, const AssetBuilderSDK::PlatformInfo& platformInfo, + const AZStd::string& shaderVariantListFilePath, const AZStd::string& shaderFilePath) + { + AZStd::vector possibleDependencies = + AZ::RPI::AssetUtils::GetPossibleDepenencyPaths(shaderVariantListFilePath, shaderFilePath); + for (auto& file : possibleDependencies) + { + AssetBuilderSDK::JobDependency jobDependency; + jobDependency.m_jobKey = ShaderAssetBuilder2::ShaderAssetBuilder2JobKey; + jobDependency.m_platformIdentifier = platformInfo.m_identifier; + jobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; + jobDependency.m_sourceFile.m_sourceFileDependencyPath = file; + jobDescriptor.m_jobDependencyList.push_back(jobDependency); + } + } + + //! Returns true if @sourceFileFullPath starts with a valid asset processor scan folder, false otherwise. + //! In case of true, it splits @sourceFileFullPath into @scanFolderFullPath and @filePathFromScanFolder. + //! @sourceFileFullPath The full path to a source asset file. + //! @scanFolderFullPath [out] Gets the full path of the scan folder where the source file is located. + //! @filePathFromScanFolder [out] Get the file path relative to @scanFolderFullPath. + static bool SplitSourceAssetPathIntoScanFolderFullPathAndRelativeFilePath2(const AZStd::string& sourceFileFullPath, AZStd::string& scanFolderFullPath, AZStd::string& filePathFromScanFolder) + { + AZStd::vector scanFolders; + bool success = false; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(success, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAssetSafeFolders, scanFolders); + if (!success) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Couldn't get the scan folders"); + return false; + } + + for (AZStd::string scanFolder : scanFolders) + { + AzFramework::StringFunc::Path::Normalize(scanFolder); + if (!AZ::StringFunc::StartsWith(sourceFileFullPath, scanFolder)) + { + continue; + } + const size_t scanFolderSize = scanFolder.size(); + const size_t sourcePathSize = sourceFileFullPath.size(); + scanFolderFullPath = scanFolder; + filePathFromScanFolder = sourceFileFullPath.substr(scanFolderSize + 1, sourcePathSize - scanFolderSize - 1); + return true; + } + + return false; + } + + //! Validates if a given .shadervariantlist file is located at the correct path for a given .shader full path. + //! There are two valid paths: + //! 1- Lower Precedence: The same folder where the .shader file is located. + //! 2- Higher Precedence: //ShaderVariants/. + //! The "Higher Precedence" path gives the option to game projects to override what variants to generate. If this + //! file exists then the "Lower Precedence" path is disregarded. + //! A .shader full path is located under an AP scan folder. + //! Example: "/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shader" + //! - In this example the Scan Folder is "/Gems/Atom/Feature/Common/Assets", while the subfolder is "Materials/Types". + //! The "Higher Precedence" expected valid location for the .shadervariantlist would be: + //! - //ShaderVariants/Materials/Types/StandardPBR_ForwardPass.shadervariantlist. + //! The "Lower Precedence" valid location would be: + //! - /Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.shadervariantlist. + //! @shouldExitEarlyFromProcessJob [out] Set to true if ProcessJob should do no work but return successfully. + //! Set to false if ProcessJob should do work and create assets. + //! When @shaderVariantListFileFullPath is provided by a Gem/Feature instead of the Game Project + //! We check if the game project already defined the shader variant list, and if it did it means + //! ProcessJob should do no work, but return successfully nonetheless. + static bool ValidateShaderVariantListLocation2(const AZStd::string& shaderVariantListFileFullPath, + const AZStd::string& shaderFileFullPath, bool& shouldExitEarlyFromProcessJob) + { + AZStd::string scanFolderFullPath; + AZStd::string shaderProductFileRelativePath; + if (!SplitSourceAssetPathIntoScanFolderFullPathAndRelativeFilePath2(shaderFileFullPath, scanFolderFullPath, shaderProductFileRelativePath)) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Couldn't get the scan folder for shader [%s]", shaderFileFullPath.c_str()); + return false; + } + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "For shader [%s], Scan folder full path [%s], relative file path [%s]", shaderFileFullPath.c_str(), scanFolderFullPath.c_str(), shaderProductFileRelativePath.c_str()); + + AZStd::string shaderVariantListFileRelativePath = shaderProductFileRelativePath; + AzFramework::StringFunc::Path::ReplaceExtension(shaderVariantListFileRelativePath, RPI::ShaderVariantListSourceData::Extension); + + const char * gameProjectPath = nullptr; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(gameProjectPath, &AzToolsFramework::AssetSystem::AssetSystemRequest::GetAbsoluteDevGameFolderPath); + + AZStd::string expectedHigherPrecedenceFileFullPath; + AzFramework::StringFunc::Path::Join(gameProjectPath, RPI::ShaderVariantTreeAsset::CommonSubFolder, expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */); + AzFramework::StringFunc::Path::Join(expectedHigherPrecedenceFileFullPath.c_str(), shaderProductFileRelativePath.c_str(), expectedHigherPrecedenceFileFullPath, false /* handle directory overlap? */, false /* be case insensitive? */); + AzFramework::StringFunc::Path::ReplaceExtension(expectedHigherPrecedenceFileFullPath, AZ::RPI::ShaderVariantListSourceData::Extension); + AzFramework::StringFunc::Path::Normalize(expectedHigherPrecedenceFileFullPath); + + AZStd::string normalizedShaderVariantListFileFullPath = shaderVariantListFileFullPath; + AzFramework::StringFunc::Path::Normalize(normalizedShaderVariantListFileFullPath); + + if (expectedHigherPrecedenceFileFullPath == normalizedShaderVariantListFileFullPath) + { + // Whenever the Game Project declares a *.shadervariantlist file we always do work. + shouldExitEarlyFromProcessJob = false; + return true; + } + + AZ::Data::AssetInfo assetInfo; + AZStd::string watchFolder; + bool foundHigherPrecedenceAsset = false; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(foundHigherPrecedenceAsset + , &AzToolsFramework::AssetSystem::AssetSystemRequest::GetSourceInfoBySourcePath + , expectedHigherPrecedenceFileFullPath.c_str(), assetInfo, watchFolder); + if (foundHigherPrecedenceAsset) + { + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "The shadervariantlist [%s] has been overriden by the game project with [%s]", + normalizedShaderVariantListFileFullPath.c_str(), expectedHigherPrecedenceFileFullPath.c_str()); + shouldExitEarlyFromProcessJob = true; + return true; + } + + // Check the "Lower Precedence" case, .shader path == .shadervariantlist path. + AZStd::string normalizedShaderFileFullPath = shaderFileFullPath; + AzFramework::StringFunc::Path::Normalize(normalizedShaderFileFullPath); + + AZStd::string normalizedShaderFileFullPathWithoutExtension = normalizedShaderFileFullPath; + AzFramework::StringFunc::Path::StripExtension(normalizedShaderFileFullPathWithoutExtension); + + AZStd::string normalizedShaderVariantListFileFullPathWithoutExtension = normalizedShaderVariantListFileFullPath; + AzFramework::StringFunc::Path::StripExtension(normalizedShaderVariantListFileFullPathWithoutExtension); + +#if AZ_TRAIT_OS_USE_WINDOWS_FILE_PATHS + //In certain circumstances, the capitalization of the drive letter may not match + const bool caseSensitive = false; +#else + //On the other platforms there's no drive letter, so it should be a non-issue. + const bool caseSensitive = true; +#endif + if (!StringFunc::Equal(normalizedShaderFileFullPathWithoutExtension.c_str(), normalizedShaderVariantListFileFullPathWithoutExtension.c_str(), caseSensitive)) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "For shader file at path [%s], the shader variant list [%s] is expected to be located at [%s.%s] or [%s]" + , normalizedShaderFileFullPath.c_str(), normalizedShaderVariantListFileFullPath.c_str(), + normalizedShaderFileFullPathWithoutExtension.c_str(), RPI::ShaderVariantListSourceData::Extension, + expectedHigherPrecedenceFileFullPath.c_str()); + return false; + } + + shouldExitEarlyFromProcessJob = false; + return true; + } + + // We treat some issues as warnings and return "Success" from CreateJobs allows us to report the dependency. + // If/when a valid dependency file appears, that will trigger the ShaderVariantAssetBuilder2 to run again. + // Since CreateJobs will pass, we forward this message to ProcessJob which will report it as an error. + struct LoadResult2 + { + enum class Code + { + Error, + DeferredError, + Success + }; + + Code m_code; + AZStd::string m_deferredMessage; // Only used when m_code == DeferredError + }; + + static LoadResult2 LoadShaderVariantList2(const AZStd::string& variantListFullPath, RPI::ShaderVariantListSourceData& shaderVariantList, AZStd::string& shaderSourceFileFullPath, + bool& shouldExitEarlyFromProcessJob) + { + // 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)) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to parse Shader Variant List Descriptor JSON from [%s]", variantListFullPath.c_str()); + return LoadResult2{LoadResult2::Code::Error}; + } + + const AZStd::string resolvedShaderPath = AZ::RPI::AssetUtils::ResolvePathReference(variantListFullPath, shaderVariantList.m_shaderFilePath); + if (!AZ::IO::LocalFileIO::GetInstance()->Exists(resolvedShaderPath.c_str())) + { + return LoadResult2{LoadResult2::Code::DeferredError, AZStd::string::format("The shader path [%s] was not found.", resolvedShaderPath.c_str())}; + } + + shaderSourceFileFullPath = resolvedShaderPath; + + if (!ValidateShaderVariantListLocation2(variantListFullPath, shaderSourceFileFullPath, shouldExitEarlyFromProcessJob)) + { + return LoadResult2{LoadResult2::Code::Error}; + } + + if (shouldExitEarlyFromProcessJob) + { + return LoadResult2{LoadResult2::Code::Success}; + } + + auto resultOutcome = RPI::ShaderVariantTreeAssetCreator::ValidateStableIdsAreUnique(shaderVariantList.m_shaderVariants); + if (!resultOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Variant info validation error: %s", resultOutcome.GetError().c_str()); + return LoadResult2{LoadResult2::Code::Error}; + } + + if (!IO::FileIOBase::GetInstance()->Exists(shaderSourceFileFullPath.c_str())) + { + return LoadResult2{LoadResult2::Code::DeferredError, AZStd::string::format("ShaderSourceData file does not exist: %s.", shaderSourceFileFullPath.c_str())}; + } + + return LoadResult2{LoadResult2::Code::Success}; + } // LoadShaderVariantListAndAzslSource + + void ShaderVariantAssetBuilder2::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const + { + AZStd::string variantListFullPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), variantListFullPath, true); + + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "CreateJobs for Shader Variant List \"%s\"\n", variantListFullPath.data()); + + RPI::ShaderVariantListSourceData shaderVariantList; + AZStd::string shaderSourceFileFullPath; + bool shouldExitEarlyFromProcessJob = false; + const LoadResult2 loadResult = LoadShaderVariantList2(variantListFullPath, shaderVariantList, shaderSourceFileFullPath, shouldExitEarlyFromProcessJob); + + if (loadResult.m_code == LoadResult2::Code::Error) + { + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Failed; + return; + } + + if (loadResult.m_code == LoadResult2::Code::DeferredError || shouldExitEarlyFromProcessJob) + { + for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) + { + // Let's create fake jobs that will fail ProcessJob, but are useful to establish dependency on the shader file. + AssetBuilderSDK::JobDescriptor jobDescriptor; + + jobDescriptor.m_priority = -5000; + jobDescriptor.m_critical = false; + jobDescriptor.m_jobKey = ShaderVariantAssetBuilder2JobKey; + jobDescriptor.SetPlatformIdentifier(info.m_identifier.data()); + + AddShaderAssetJobDependency2(jobDescriptor, info, variantListFullPath, shaderVariantList.m_shaderFilePath); + + if (loadResult.m_code == LoadResult2::Code::DeferredError) + { + jobDescriptor.m_jobParameters.emplace(ShaderVariantLoadErrorParam, loadResult.m_deferredMessage); + } + + if (shouldExitEarlyFromProcessJob) + { + // The value doesn't matter, what matters is the presence of the key which will + // signal that no assets should be produced on behalf of this shadervariantlist because + // the game project overrode it. + jobDescriptor.m_jobParameters.emplace(ShouldExitEarlyFromProcessJobParam, variantListFullPath); + } + + response.m_createJobOutputs.push_back(jobDescriptor); + } + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; + return; + } + + for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) + { + AZ_TraceContext("For platform", info.m_identifier.data()); + + // First job is for the ShaderVariantTreeAsset. + { + AssetBuilderSDK::JobDescriptor jobDescriptor; + + // The ShaderVariantTreeAsset is high priority, but must be generated after the ShaderAsset + jobDescriptor.m_priority = 1; + jobDescriptor.m_critical = false; + + jobDescriptor.m_jobKey = GetShaderVariantTreeAssetJobKey(); + jobDescriptor.SetPlatformIdentifier(info.m_identifier.data()); + + AddShaderAssetJobDependency2(jobDescriptor, info, variantListFullPath, shaderVariantList.m_shaderFilePath); + + jobDescriptor.m_jobParameters.emplace(ShaderSourceFilePathJobParam, shaderSourceFileFullPath); + + response.m_createJobOutputs.push_back(jobDescriptor); + } + + // One job for each variant. Each job will produce one ".azshadervariant" per RHI per supervariant. + for (const AZ::RPI::ShaderVariantListSourceData::VariantInfo& variantInfo : shaderVariantList.m_shaderVariants) + { + AZStd::string variantInfoAsJsonString; + const bool convertSuccess = AZ::RPI::JsonUtils::SaveObjectToJsonString(variantInfo, variantInfoAsJsonString); + AZ_Assert(convertSuccess, "Failed to convert VariantInfo to json string"); + + AssetBuilderSDK::JobDescriptor jobDescriptor; + + // There can be tens/hundreds of thousands of shader variants. By default each shader will get + // a root variant that can be used at runtime. In order to prevent the AssetProcessor from + // being overtaken by shader variant compilation We mark all non-root shader variant generation + // as non critical and very low priority. + jobDescriptor.m_priority = -5000; + jobDescriptor.m_critical = false; + + jobDescriptor.m_jobKey = GetShaderVariantAssetJobKey(RPI::ShaderVariantStableId{variantInfo.m_stableId}); + jobDescriptor.SetPlatformIdentifier(info.m_identifier.data()); + + // The ShaderVariantAssets are job dependent on the ShaderVariantTreeAsset. + AssetBuilderSDK::SourceFileDependency fileDependency; + fileDependency.m_sourceFileDependencyPath = variantListFullPath; + AssetBuilderSDK::JobDependency variantTreeJobDependency; + variantTreeJobDependency.m_jobKey = GetShaderVariantTreeAssetJobKey(); + variantTreeJobDependency.m_platformIdentifier = info.m_identifier; + variantTreeJobDependency.m_sourceFile = fileDependency; + variantTreeJobDependency.m_type = AssetBuilderSDK::JobDependencyType::Order; + jobDescriptor.m_jobDependencyList.emplace_back(variantTreeJobDependency); + + jobDescriptor.m_jobParameters.emplace(ShaderVariantJobVariantParam, variantInfoAsJsonString); + jobDescriptor.m_jobParameters.emplace(ShaderSourceFilePathJobParam, shaderSourceFileFullPath); + + response.m_createJobOutputs.push_back(jobDescriptor); + } + + } + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; + } // CreateJobs + + void ShaderVariantAssetBuilder2::ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const + { + const auto& jobParameters = request.m_jobDescription.m_jobParameters; + + if (jobParameters.find(ShaderVariantLoadErrorParam) != jobParameters.end()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Error during CreateJobs: %s", jobParameters.at(ShaderVariantLoadErrorParam).c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + if (jobParameters.find(ShouldExitEarlyFromProcessJobParam) != jobParameters.end()) + { + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Doing nothing on behalf of [%s] because it's been overridden by game project.", jobParameters.at(ShaderVariantLoadErrorParam).c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + return; + } + + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + if (jobCancelListener.IsCancelled()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Cancelled; + return; + } + + if (request.m_jobDescription.m_jobKey == GetShaderVariantTreeAssetJobKey()) + { + ProcessShaderVariantTreeJob(request, response); + } + else + { + ProcessShaderVariantJob(request, response); + } + } + + + static RPI::Ptr LoadShaderOptionsGroupLayoutFromShaderAssetBuilder2( + const RHI::ShaderPlatformInterface* shaderPlatformInterface, + const AssetBuilderSDK::PlatformInfo& platformInfo, + const AzslCompiler& azslCompiler, + const AZStd::string& shaderSourceFileFullPath, + const RPI::SupervariantIndex supervariantIndex) + { + auto optionsGroupPathOutcome = ShaderBuilderUtility::ObtainBuildArtifactPathFromShaderAssetBuilder2( + shaderPlatformInterface->GetAPIUniqueIndex(), platformInfo.m_identifier, shaderSourceFileFullPath, supervariantIndex.GetIndex(), + AZ::RPI::ShaderAssetSubId::OptionsJson); + if (!optionsGroupPathOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s", optionsGroupPathOutcome.GetError().c_str()); + return nullptr; + } + auto optionsGroupJsonPath = optionsGroupPathOutcome.TakeValue(); + RPI::Ptr shaderOptionGroupLayout = RPI::ShaderOptionGroupLayout::Create(); + // The shader options define what options are available, what are the allowed values/range + // for each option and what is its default value. + auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(optionsGroupJsonPath); + if (!jsonOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s", jsonOutcome.GetError().c_str()); + return nullptr; + } + if (!azslCompiler.ParseOptionsPopulateOptionGroupLayout(jsonOutcome.GetValue(), shaderOptionGroupLayout)) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to find a valid list of shader options!"); + return nullptr; + } + + return shaderOptionGroupLayout; + } + + static void LoadShaderFunctionsFromShaderAssetBuilder2( + const RHI::ShaderPlatformInterface* shaderPlatformInterface, const AssetBuilderSDK::PlatformInfo& platformInfo, + const AzslCompiler& azslCompiler, const AZStd::string& shaderSourceFileFullPath, + const RPI::SupervariantIndex supervariantIndex, + AzslFunctions& functions) + { + auto functionsJsonPathOutcome = ShaderBuilderUtility::ObtainBuildArtifactPathFromShaderAssetBuilder2( + shaderPlatformInterface->GetAPIUniqueIndex(), platformInfo.m_identifier, shaderSourceFileFullPath, supervariantIndex.GetIndex(), + AZ::RPI::ShaderAssetSubId::IaJson); + if (!functionsJsonPathOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s", functionsJsonPathOutcome.GetError().c_str()); + return; + } + + auto functionsJsonPath = functionsJsonPathOutcome.TakeValue(); + auto jsonOutcome = JsonSerializationUtils::ReadJsonFile(functionsJsonPath); + if (!jsonOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s", jsonOutcome.GetError().c_str()); + return; + } + if (!azslCompiler.ParseIaPopulateFunctionData(jsonOutcome.GetValue(), functions)) + { + functions.clear(); + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to find shader functions."); + return; + } + } + + + // Returns the content of the hlsl file for the given supervariant as produced by ShaderAsssetBuilder2. + // In addition to the content it also returns the full path of the hlsl file in @hlslSourcePath. + static AZStd::string LoadHlslFileFromShaderAssetBuilder2( + const RHI::ShaderPlatformInterface* shaderPlatformInterface, const AssetBuilderSDK::PlatformInfo& platformInfo, + const AZStd::string& shaderSourceFileFullPath, const RPI::SupervariantIndex supervariantIndex, AZStd::string& hlslSourcePath) + { + auto hlslSourcePathOutcome = ShaderBuilderUtility::ObtainBuildArtifactPathFromShaderAssetBuilder2( + shaderPlatformInterface->GetAPIUniqueIndex(), platformInfo.m_identifier, shaderSourceFileFullPath, supervariantIndex.GetIndex(), + AZ::RPI::ShaderAssetSubId::GeneratedHlslSource); + if (!hlslSourcePathOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s", hlslSourcePathOutcome.GetError().c_str()); + return ""; + } + + hlslSourcePath = hlslSourcePathOutcome.TakeValue(); + Outcome hlslSourceOutcome = Utils::ReadFile(hlslSourcePath); + if (!hlslSourceOutcome.IsSuccess()) + { + AZ_Error( + ShaderVariantAssetBuilder2Name, false, "Failed to obtain shader source from %s. [%s]", hlslSourcePath.c_str(), + hlslSourceOutcome.TakeError().c_str()); + return ""; + } + return hlslSourceOutcome.TakeValue(); + } + + void ShaderVariantAssetBuilder2::ProcessShaderVariantTreeJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const + { + AZStd::string variantListFullPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), variantListFullPath, true); + + RPI::ShaderVariantListSourceData shaderVariantListDescriptor; + if (!RPI::JsonUtils::LoadObjectFromFile(variantListFullPath, shaderVariantListDescriptor)) + { + AZ_Assert(false, "Failed to parse Shader Variant List Descriptor JSON [%s]", variantListFullPath.c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + const AZStd::string& shaderSourceFileFullPath = request.m_jobDescription.m_jobParameters.at(ShaderSourceFilePathJobParam); + + //For debugging purposes will create a dummy azshadervarianttree file. + AZStd::string shaderName; + AzFramework::StringFunc::Path::GetFileName(shaderSourceFileFullPath.c_str(), shaderName); + + // No error checking because the same calls were already executed during CreateJobs() + auto descriptorParseOutcome = ShaderBuilderUtility::LoadShaderDataJson(shaderSourceFileFullPath); + RPI::ShaderSourceData shaderSourceDescriptor = descriptorParseOutcome.TakeValue(); + RPI::Ptr shaderOptionGroupLayout; + + // Request the list of valid shader platform interfaces for the target platform. + AZStd::vector platformInterfaces = + ShaderBuilderUtility::DiscoverEnabledShaderPlatformInterfaces(request.m_platformInfo, shaderSourceDescriptor); + if (platformInterfaces.empty()) + { + // No work to do. Exit gracefully. + AZ_TracePrintf( + ShaderVariantAssetBuilder2Name, + "No azshadervarianttree is produced on behalf of %s because all valid RHI backends were disabled for this shader.\n", + shaderSourceFileFullPath.c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + return; + } + + + // set the input file for eventual error messages, but the compiler won't be called on it. + AZStd::string azslFullPath; + ShaderBuilderUtility::GetAbsolutePathToAzslFile(shaderSourceFileFullPath, shaderSourceDescriptor.m_source, azslFullPath); + AzslCompiler azslc(azslFullPath); + + AZStd::string previousLoopApiName; + for (RHI::ShaderPlatformInterface* shaderPlatformInterface : platformInterfaces) + { + auto thisLoopApiName = shaderPlatformInterface->GetAPIName().GetStringView(); + RPI::Ptr loopLocal_ShaderOptionGroupLayout = + LoadShaderOptionsGroupLayoutFromShaderAssetBuilder2( + shaderPlatformInterface, request.m_platformInfo, azslc, shaderSourceFileFullPath, RPI::DefaultSupervariantIndex); + if (!loopLocal_ShaderOptionGroupLayout) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + if (shaderOptionGroupLayout && shaderOptionGroupLayout->GetHash() != loopLocal_ShaderOptionGroupLayout->GetHash()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "There was a discrepancy in shader options between %s and %s", previousLoopApiName.c_str(), thisLoopApiName.data()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + shaderOptionGroupLayout = loopLocal_ShaderOptionGroupLayout; + previousLoopApiName = thisLoopApiName; + } + + RPI::ShaderVariantTreeAssetCreator shaderVariantTreeAssetCreator; + shaderVariantTreeAssetCreator.Begin(Uuid::CreateRandom()); + shaderVariantTreeAssetCreator.SetShaderOptionGroupLayout(*shaderOptionGroupLayout); + shaderVariantTreeAssetCreator.SetVariantInfos(shaderVariantListDescriptor.m_shaderVariants); + Data::Asset shaderVariantTreeAsset; + if (!shaderVariantTreeAssetCreator.End(shaderVariantTreeAsset)) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to build Shader Variant Tree Asset"); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + AZStd::string filename = AZStd::string::format("%s.%s", shaderName.c_str(), RPI::ShaderVariantTreeAsset::Extension); + AZStd::string assetPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_tempDirPath.c_str(), filename.c_str(), assetPath, true); + if (!AZ::Utils::SaveObjectToFile(assetPath, AZ::DataStream::ST_BINARY, shaderVariantTreeAsset.Get())) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to save Shader Variant Tree Asset to \"%s\"", assetPath.c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + AssetBuilderSDK::JobProduct assetProduct; + assetProduct.m_productSubID = RPI::ShaderVariantTreeAsset::ProductSubID; + assetProduct.m_productFileName = assetPath; + assetProduct.m_productAssetType = azrtti_typeid(); + assetProduct.m_dependenciesHandled = true; // This builder has no dependencies to output + response.m_outputProducts.push_back(assetProduct); + + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Shader Variant Tree Asset [%s] compiled successfully.\n", assetPath.c_str()); + + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + } + + void ShaderVariantAssetBuilder2::ProcessShaderVariantJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const + { + const AZStd::sys_time_t startTime = AZStd::GetTimeNowTicks(); + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + + AZStd::string fullPath; + AzFramework::StringFunc::Path::ConstructFull(request.m_watchFolder.data(), request.m_sourceFile.data(), fullPath, true); + + const auto& jobParameters = request.m_jobDescription.m_jobParameters; + const AZStd::string& shaderSourceFileFullPath = jobParameters.at(ShaderSourceFilePathJobParam); + AZStd::string shaderFileName; + AzFramework::StringFunc::Path::GetFileName(shaderSourceFileFullPath.c_str(), shaderFileName); + + const AZStd::string& variantJsonString = jobParameters.at(ShaderVariantJobVariantParam); + RPI::ShaderVariantListSourceData::VariantInfo variantInfo; + const bool fromJsonStringSuccess = AZ::RPI::JsonUtils::LoadObjectFromJsonString(variantJsonString, variantInfo); + AZ_Assert(fromJsonStringSuccess, "Failed to convert json string to VariantInfo"); + + RPI::ShaderSourceData shaderSourceDescriptor; + AZStd::shared_ptr sources = ShaderBuilderUtility::PrepareSourceInput(ShaderVariantAssetBuilder2Name, shaderSourceFileFullPath, shaderSourceDescriptor); + + // set the input file for eventual error messages, but the compiler won't be called on it. + AzslCompiler azslc(sources->m_azslSourceFullPath); + + // Request the list of valid shader platform interfaces for the target platform. + AZStd::vector platformInterfaces = + ShaderBuilderUtility::DiscoverEnabledShaderPlatformInterfaces(request.m_platformInfo, shaderSourceDescriptor); + if (platformInterfaces.empty()) + { + // No work to do. Exit gracefully. + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, + "No azshader is produced on behalf of %s because all valid RHI backends were disabled for this shader.\n", + shaderSourceFileFullPath.c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + return; + } + + auto supervariantList = ShaderBuilderUtility::GetSupervariantListFromShaderSourceData(shaderSourceDescriptor); + + GlobalBuildOptions buildOptions = ReadBuildOptions(ShaderVariantAssetBuilder2Name); + // At this moment We have global build options that should be merged with the build options that are common + // to all the supervariants of this shader. + buildOptions.m_compilerArguments.Merge(shaderSourceDescriptor.m_compiler); + + //! The ShaderOptionGroupLayout is common across all RHIs & Supervariants + RPI::Ptr shaderOptionGroupLayout = nullptr; + + // Generate shaders for each of those ShaderPlatformInterfaces. + for (RHI::ShaderPlatformInterface* shaderPlatformInterface : platformInterfaces) + { + AZ_TraceContext("ShaderPlatformInterface", shaderPlatformInterface->GetAPIName().GetCStr()); + + // Loop through all the Supervariants. + uint32_t supervariantIndexCounter = 0; + for (const auto& supervariantInfo : supervariantList) + { + RPI::SupervariantIndex supervariantIndex(supervariantIndexCounter); + + // Check if we were canceled before we do any heavy processing of + // the shader variant data. + if (jobCancelListener.IsCancelled()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Cancelled; + return; + } + + AZStd::string shaderStemNamePrefix = shaderFileName; + if (supervariantIndex.GetIndex() > 0) + { + shaderStemNamePrefix += supervariantInfo.m_name.GetStringView(); + } + + // We need these additional pieces of information To build a shader variant asset: + // 1- ShaderOptionsGroupLayout (Need to load it once, because it's the same acrosss all supervariants + RHIs) + // 2- entryFunctions + // 3- hlsl code. + + // 1- ShaderOptionsGroupLayout + if (!shaderOptionGroupLayout) + { + shaderOptionGroupLayout = + LoadShaderOptionsGroupLayoutFromShaderAssetBuilder2( + shaderPlatformInterface, request.m_platformInfo, azslc, shaderSourceFileFullPath, supervariantIndex); + if (!shaderOptionGroupLayout) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + } + + // 2- entryFunctions. + AzslFunctions azslFunctions; + LoadShaderFunctionsFromShaderAssetBuilder2( + shaderPlatformInterface, request.m_platformInfo, azslc, shaderSourceFileFullPath, supervariantIndex, azslFunctions); + if (azslFunctions.empty()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + MapOfStringToStageType shaderEntryPoints; + if (shaderSourceDescriptor.m_programSettings.m_entryPoints.empty()) + { + AZ_TracePrintf( + ShaderVariantAssetBuilder2Name, + "ProgramSettings do not specify entry points, will use GetDefaultEntryPointsFromShader()\n"); + ShaderBuilderUtility::GetDefaultEntryPointsFromFunctionDataList(azslFunctions, shaderEntryPoints); + } + else + { + for (const auto& entryPoint : shaderSourceDescriptor.m_programSettings.m_entryPoints) + { + shaderEntryPoints[entryPoint.m_name] = entryPoint.m_type; + } + } + + // 3- hlslCode + AZStd::string hlslSourcePath; + AZStd::string hlslCode = LoadHlslFileFromShaderAssetBuilder2( + shaderPlatformInterface, request.m_platformInfo, shaderSourceFileFullPath, supervariantIndex, hlslSourcePath); + if (hlslCode.empty() || hlslSourcePath.empty()) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + + // Setup the shader variant creation context: + ShaderVariantCreationContext2 shaderVariantCreationContext = + { + *shaderPlatformInterface, request.m_platformInfo, buildOptions.m_compilerArguments, request.m_tempDirPath, + startTime, + shaderSourceDescriptor, + *shaderOptionGroupLayout.get(), + shaderEntryPoints, + Uuid::CreateRandom(), + shaderStemNamePrefix, + hlslSourcePath, hlslCode + }; + + AZStd::optional outputByproducts; + auto shaderVariantAssetOutcome = CreateShaderVariantAsset(variantInfo, shaderVariantCreationContext, outputByproducts); + if (!shaderVariantAssetOutcome.IsSuccess()) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "%s\n", shaderVariantAssetOutcome.GetError().c_str()); + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + Data::Asset shaderVariantAsset = shaderVariantAssetOutcome.TakeValue(); + + + // Time to save the asset in the tmp folder so it ends up in the Cache folder. + const uint32_t productSubID = RPI::ShaderVariantAsset2::MakeAssetProductSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), supervariantIndex.GetIndex(), + shaderVariantAsset->GetStableId()); + AssetBuilderSDK::JobProduct assetProduct; + if (!SerializeOutShaderVariantAsset(shaderVariantAsset, shaderStemNamePrefix, + request.m_tempDirPath, *shaderPlatformInterface, productSubID, + assetProduct)) + { + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Failed; + return; + } + response.m_outputProducts.push_back(assetProduct); + + if (outputByproducts) + { + // add byproducts as job output products: + uint32_t subProductType = RPI::ShaderVariantAsset2::ShaderVariantAsset2SubProductType; + for (const AZStd::string& byproduct : outputByproducts.value().m_intermediatePaths) + { + AssetBuilderSDK::JobProduct jobProduct; + jobProduct.m_productFileName = byproduct; + jobProduct.m_productAssetType = Uuid::CreateName("DebugInfoByProduct-PdbOrDxilTxt"); + jobProduct.m_productSubID = RPI::ShaderVariantAsset2::MakeAssetProductSubId( + shaderPlatformInterface->GetAPIUniqueIndex(), supervariantIndex.GetIndex(), shaderVariantAsset->GetStableId(), + subProductType++); + response.m_outputProducts.push_back(AZStd::move(jobProduct)); + } + } + supervariantIndexCounter++; + } // End of supervariant for block + + } + + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + } + + bool ShaderVariantAssetBuilder2::SerializeOutShaderVariantAsset( + const Data::Asset shaderVariantAsset, const AZStd::string& shaderStemNamePrefix, + const AZStd::string& tempDirPath, + const RHI::ShaderPlatformInterface& shaderPlatformInterface, const uint32_t productSubID, AssetBuilderSDK::JobProduct& assetProduct) + { + AZStd::string filename = AZStd::string::format( + "%s_%s_%u.%s", shaderStemNamePrefix.c_str(), shaderPlatformInterface.GetAPIName().GetCStr(), + shaderVariantAsset->GetStableId().GetIndex(), RPI::ShaderVariantAsset2::Extension); + + AZStd::string assetPath; + AzFramework::StringFunc::Path::ConstructFull(tempDirPath.c_str(), filename.c_str(), assetPath, true); + + if (!AZ::Utils::SaveObjectToFile(assetPath, AZ::DataStream::ST_BINARY, shaderVariantAsset.Get())) + { + AZ_Error(ShaderVariantAssetBuilder2Name, false, "Failed to save Shader Variant Asset to \"%s\"", assetPath.c_str()); + return false; + } + + assetProduct.m_productSubID = productSubID; + assetProduct.m_productFileName = assetPath; + assetProduct.m_productAssetType = azrtti_typeid(); + assetProduct.m_dependenciesHandled = true; // This builder has no dependencies to output + + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Shader Variant Asset [%s] compiled successfully.\n", assetPath.c_str()); + return true; + } + + + AZ::Outcome, AZStd::string> ShaderVariantAssetBuilder2::CreateShaderVariantAsset( + const RPI::ShaderVariantListSourceData::VariantInfo& shaderVariantInfo, + ShaderVariantCreationContext2& creationContext, + AZStd::optional& outputByproducts) + { + // Temporary structure used for sorting and caching intermediate results + struct OptionCache + { + AZ::Name m_optionName; + AZ::Name m_valueName; + RPI::ShaderOptionIndex m_optionIndex; // Cached m_optionName + RPI::ShaderOptionValue m_value; // Cached m_valueName + }; + AZStd::vector optionList; + // We can not have more options than the number of options in the layout: + optionList.reserve(creationContext.m_shaderOptionGroupLayout.GetShaderOptionCount()); + + // This loop will validate and cache the indices for each option value: + for (const auto& shaderOption : shaderVariantInfo.m_options) + { + Name optionName{shaderOption.first}; + Name optionValue{shaderOption.second}; + + RPI::ShaderOptionIndex optionIndex = creationContext.m_shaderOptionGroupLayout.FindShaderOptionIndex(optionName); + if (optionIndex.IsNull()) + { + return AZ::Failure(AZStd::string::format("Invalid shader option: %s", optionName.GetCStr())); + } + + const RPI::ShaderOptionDescriptor& option = creationContext.m_shaderOptionGroupLayout.GetShaderOption(optionIndex); + RPI::ShaderOptionValue value = option.FindValue(optionValue); + if (value.IsNull()) + { + return AZ::Failure( + AZStd::string::format("Invalid value (%s) for shader option: %s", optionValue.GetCStr(), optionName.GetCStr())); + } + + optionList.push_back(OptionCache{optionName, optionValue, optionIndex, value}); + } + + // Create one instance of the shader variant + RPI::ShaderOptionGroup optionGroup(&creationContext.m_shaderOptionGroupLayout); + + //! Contains the series of #define macro values that define a variant. Can be empty (root variant). + //! If this string is NOT empty, a new temporary hlsl file will be created that will be the combination + //! of this string + @m_hlslSourceContent. + AZStd::string hlslCodeToPrependForVariant; + + // We want to go over all options listed in the variant and set their respective values + // This loop will populate the optionGroup and m_shaderCodePrefix in order of the option priority + for (const auto& optionCache : optionList) + { + const RPI::ShaderOptionDescriptor& option = creationContext.m_shaderOptionGroupLayout.GetShaderOption(optionCache.m_optionIndex); + + // Assign the option value specified in the variant: + option.Set(optionGroup, optionCache.m_value); + + // Populate all shader option defines. We have already confirmed they're valid. + hlslCodeToPrependForVariant += AZStd::string::format( + "#define %s_OPTION_DEF %s\n", optionCache.m_optionName.GetCStr(), optionCache.m_valueName.GetCStr()); + } + + AZStd::string variantShaderSourcePath; + // Check if we need to prepend any code prefix + if (!hlslCodeToPrependForVariant.empty()) + { + // Prepend any shader code prefix that we should apply to this variant + // and save it back to a file. + AZStd::string variantShaderSourceString(hlslCodeToPrependForVariant); + variantShaderSourceString += creationContext.m_hlslSourceContent; + + AZStd::string shaderAssetName = AZStd::string::format( + "%s_%s_%u.hlsl", creationContext.m_shaderStemNamePrefix.c_str(), + creationContext.m_shaderPlatformInterface.GetAPIName().GetCStr(), shaderVariantInfo.m_stableId); + AzFramework::StringFunc::Path::Join( + creationContext.m_tempDirPath.c_str(), shaderAssetName.c_str(), variantShaderSourcePath, true, true); + + auto outcome = Utils::WriteFile(variantShaderSourceString, variantShaderSourcePath); + if (!outcome.IsSuccess()) + { + return AZ::Failure(AZStd::string::format("Failed to create file %s", variantShaderSourcePath.c_str())); + } + } + else + { + variantShaderSourcePath = creationContext.m_hlslSourcePath; + } + + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Variant StableId: %u", shaderVariantInfo.m_stableId); + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Variant Shader Options: %s", optionGroup.ToString().c_str()); + + const RPI::ShaderVariantStableId shaderVariantStableId{shaderVariantInfo.m_stableId}; + + // By this time the optionGroup was populated with all option values for the variant and + // the m_shaderCodePrefix contains all option related preprocessing macros + // Let's add the requested variant: + RPI::ShaderVariantAssetCreator2 variantCreator; + RPI::ShaderOptionGroup shaderOptions{&creationContext.m_shaderOptionGroupLayout, optionGroup.GetShaderVariantId()}; + variantCreator.Begin( + creationContext.m_shaderVariantAssetId, optionGroup.GetShaderVariantId(), shaderVariantStableId, + shaderOptions.IsFullySpecified()); + + const AZStd::unordered_map& shaderEntryPoints = creationContext.m_shaderEntryPoints; + for (const auto& shaderEntryPoint : shaderEntryPoints) + { + auto shaderEntryName = shaderEntryPoint.first; + auto shaderStageType = shaderEntryPoint.second; + + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Entry Point: %s", shaderEntryName.c_str()); + AZ_TracePrintf(ShaderVariantAssetBuilder2Name, "Begin compiling shader function \"%s\"", shaderEntryName.c_str()); + + auto assetBuilderShaderType = ShaderBuilderUtility::ToAssetBuilderShaderType(shaderStageType); + + // Compile HLSL to the platform specific shader. + RHI::ShaderPlatformInterface::StageDescriptor descriptor; + bool shaderWasCompiled = creationContext.m_shaderPlatformInterface.CompilePlatformInternal( + creationContext.m_platformInfo, variantShaderSourcePath, shaderEntryName, assetBuilderShaderType, + creationContext.m_tempDirPath, descriptor, creationContext.m_shaderCompilerArguments); + + if (!shaderWasCompiled) + { + return AZ::Failure(AZStd::string::format("Could not compile the shader function %s", shaderEntryName.c_str())); + } + // bubble up the byproducts to the caller by moving them to the context. + outputByproducts.emplace(AZStd::move(descriptor.m_byProducts)); + + RHI::Ptr shaderStageFunction = creationContext.m_shaderPlatformInterface.CreateShaderStageFunction(descriptor); + variantCreator.SetShaderFunction(ToRHIShaderStage(assetBuilderShaderType), shaderStageFunction); + + if (descriptor.m_byProducts.m_dynamicBranchCount != AZ::RHI::ShaderPlatformInterface::ByProducts::UnknownDynamicBranchCount) + { + AZ_TracePrintf( + ShaderVariantAssetBuilder2Name, "Finished compiling shader function. Number of dynamic branches: %u", + descriptor.m_byProducts.m_dynamicBranchCount); + } + else + { + AZ_TracePrintf( + ShaderVariantAssetBuilder2Name, "Finished compiling shader function. Number of dynamic branches: unknown"); + } + } + + Data::Asset shaderVariantAsset; + variantCreator.End(shaderVariantAsset); + return AZ::Success(AZStd::move(shaderVariantAsset)); + } + + } // ShaderBuilder +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.h new file mode 100644 index 0000000000..c0b632d9bd --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/ShaderVariantAssetBuilder2.h @@ -0,0 +1,107 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +#include +#include +#include +#include + +#include "ShaderBuilderUtility.h" + +namespace AZ +{ + namespace ShaderBuilder + { + struct AzslData; + + //! This is nothing more than a class to help consolidate all + //! the data needed to generate a shader variant and prevent + //! all the functions involved in the process to have too many + //! arguments. + struct ShaderVariantCreationContext2 + { + RHI::ShaderPlatformInterface& m_shaderPlatformInterface; + const AssetBuilderSDK::PlatformInfo& m_platformInfo; + const RHI::ShaderCompilerArguments& m_shaderCompilerArguments; + //! Used to write temporary files during shader compilation, like *.hlsl, or *.air, or *.metallib, etc. + const AZStd::string& m_tempDirPath; + //! Used to synchronize versions of the ShaderAsset and ShaderVariantAsset, + //! especially during hot-reload. A (ShaderVariantAsset.timestamp) >= (ShaderAsset.timestamp). + const AZStd::sys_time_t m_assetBuildTimestamp; + const RPI::ShaderSourceData& m_shaderSourceDataDescriptor; + const RPI::ShaderOptionGroupLayout& m_shaderOptionGroupLayout; + const MapOfStringToStageType& m_shaderEntryPoints; + const Data::AssetId m_shaderVariantAssetId; + const AZStd::string& m_shaderStemNamePrefix; //- + const AZStd::string& m_hlslSourcePath; + const AZStd::string& m_hlslSourceContent; + }; + + class ShaderVariantAssetBuilder2 + : public AssetBuilderSDK::AssetBuilderCommandBus::Handler + { + public: + AZ_TYPE_INFO(ShaderVariantAssetBuilder2, "{C959AEC2-2083-4488-AD88-F61B1144535B}"); + + static constexpr char ShaderVariantAssetBuilder2JobKey[] = "Shader Variant Asset 2"; + + ShaderVariantAssetBuilder2() = default; + ~ShaderVariantAssetBuilder2() = default; + + // Asset Builder Callback Functions ... + void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, AssetBuilderSDK::CreateJobsResponse& response) const; + void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; + + //! The ShaderVariantAsset returned by this function won't be written to the filesystem. + //! You should call SerializeOutShaderVariantAsset to write it to the temp folder assigned + //! by the asset processor. + static AZ::Outcome, AZStd::string> CreateShaderVariantAsset( + const RPI::ShaderVariantListSourceData::VariantInfo& shaderVariantInfo, + ShaderVariantCreationContext2& creationContext, + AZStd::optional& outputByproducts); + + static bool SerializeOutShaderVariantAsset( + const Data::Asset shaderVariantAsset, + const AZStd::string& shaderStemNamePrefix, const AZStd::string& tempDirPath, + const RHI::ShaderPlatformInterface& shaderPlatformInterface, const uint32_t productSubID, AssetBuilderSDK::JobProduct& assetProduct); + + // AssetBuilderSDK::AssetBuilderCommandBus interface overrides ... + void ShutDown() override { }; + + private: + AZ_DISABLE_COPY_MOVE(ShaderVariantAssetBuilder2); + + static constexpr uint32_t ShaderVariantLoadErrorParam = 0; + static constexpr uint32_t ShaderSourceFilePathJobParam = 2; + static constexpr uint32_t ShaderVariantJobVariantParam = 3; + static constexpr uint32_t ShouldExitEarlyFromProcessJobParam = 4; + + //! Called from ProcessJob when the job is supposed to create a ShaderVariantTreeAsset. + void ProcessShaderVariantTreeJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; + + //! Called from ProcessJob when the job is supposed to create ShaderVariantAssets. One ShaderVariantAsset will be produced per RHI::APIType + //! supported by the platform. + void ProcessShaderVariantJob(const AssetBuilderSDK::ProcessJobRequest& request, AssetBuilderSDK::ProcessJobResponse& response) const; + + static AZStd::string GetShaderVariantTreeAssetJobKey() { return AZStd::string::format("%s_varianttree", ShaderVariantAssetBuilder2JobKey); } + static AZStd::string GetShaderVariantAssetJobKey(RPI::ShaderVariantStableId variantStableId) { return AZStd::string::format("%s_variant_%u", ShaderVariantAssetBuilder2JobKey, variantStableId.GetIndex()); } + + }; + + } // ShaderBuilder +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutBuilder.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutBuilder.cpp index 0b9b813815..a7721c84a2 100644 --- a/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutBuilder.cpp +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutBuilder.cpp @@ -345,17 +345,21 @@ namespace AZ for(const SrgDataEntry& srgDataEntry : entry.second) { RHI::ShaderPlatformInterface* shaderPlatformInterface = srgDataEntry.first; + + // The register number only makes sense if the platform uses "spaces", + // since the register Id of the resource will not change even if the pipeline layout changes. + // We can pass in a default ShaderCompilerArguments because all we care about is whether the shaderPlatformInterface + // appends the + // "--use-spaces" flag. + AZStd::string azslCompilerParameters = + shaderPlatformInterface->GetAzslCompilerParameters(RHI::ShaderCompilerArguments{}); + bool useRegisterId = (AzFramework::StringFunc::Find(azslCompilerParameters, "--use-spaces") != AZStd::string::npos); + const SrgData& srgData = srgDataEntry.second; srgAssetCreator.BeginAPI(shaderPlatformInterface->GetAPIType()); srgAssetCreator.SetBindingSlot(srgData.m_bindingSlot.m_index); - // The register number only makes sense if the platform uses "spaces", - // since the register Id of the resource will not change even if the pipeline layout changes. - // We can pass in a default ShaderCompilerArguments because all we care about is whether the shaderPlatformInterface appends the "--use-spaces" flag. - AZStd::string azslCompilerParameters = shaderPlatformInterface->GetAzslCompilerParameters(RHI::ShaderCompilerArguments{}); - bool useRegisterId = (AzFramework::StringFunc::Find(azslCompilerParameters, "--use-spaces") != AZStd::string::npos); - // Samplers for (const SamplerSrgData& samplerData : srgData.m_samplers) { diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.cpp b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.cpp new file mode 100644 index 0000000000..fc3fbfc32c --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.cpp @@ -0,0 +1,231 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include "SrgLayoutUtility.h" + +#include + +namespace AZ +{ + namespace ShaderBuilder + { + namespace SrgLayoutUtility + { + static constexpr char SrgLayoutUtilityName[] = "SrgLayoutUtility"; + + RHI::ShaderInputImageType ToShaderInputImageType(TextureType textureType) + { + switch (textureType) + { + case TextureType::Texture1D: + return RHI::ShaderInputImageType::Image1D; + case TextureType::Texture1DArray: + return RHI::ShaderInputImageType::Image1DArray; + case TextureType::Texture2D: + return RHI::ShaderInputImageType::Image2D; + case TextureType::Texture2DArray: + return RHI::ShaderInputImageType::Image2DArray; + case TextureType::Texture2DMS: + return RHI::ShaderInputImageType::Image2DMultisample; + case TextureType::Texture2DMSArray: + return RHI::ShaderInputImageType::Image2DMultisampleArray; + case TextureType::Texture3D: + return RHI::ShaderInputImageType::Image3D; + case TextureType::TextureCube: + return RHI::ShaderInputImageType::ImageCube; + case TextureType::RwTexture1D: + return RHI::ShaderInputImageType::Image1D; + case TextureType::RwTexture1DArray: + return RHI::ShaderInputImageType::Image1DArray; + case TextureType::RwTexture2D: + return RHI::ShaderInputImageType::Image2D; + case TextureType::RwTexture2DArray: + return RHI::ShaderInputImageType::Image2DArray; + case TextureType::RwTexture3D: + return RHI::ShaderInputImageType::Image3D; + case TextureType::RasterizerOrderedTexture1D: + return RHI::ShaderInputImageType::Image1D; + case TextureType::RasterizerOrderedTexture1DArray: + return RHI::ShaderInputImageType::Image1DArray; + case TextureType::RasterizerOrderedTexture2D: + return RHI::ShaderInputImageType::Image2D; + case TextureType::RasterizerOrderedTexture2DArray: + return RHI::ShaderInputImageType::Image2DArray; + case TextureType::RasterizerOrderedTexture3D: + return RHI::ShaderInputImageType::Image3D; + case TextureType::SubpassInput: + return RHI::ShaderInputImageType::SubpassInput; + default: + AZ_Assert(false, "Unhandled TextureType"); + return RHI::ShaderInputImageType::Unknown; + } + } + + RHI::ShaderInputBufferType ToShaderInputBufferType(BufferType bufferType) + { + switch (bufferType) + { + case BufferType::Buffer: + case BufferType::RwBuffer: + case BufferType::RasterizerOrderedBuffer: + return RHI::ShaderInputBufferType::Typed; + case BufferType::AppendStructuredBuffer: + case BufferType::ConsumeStructuredBuffer: + case BufferType::RasterizerOrderedStructuredBuffer: + case BufferType::RwStructuredBuffer: + case BufferType::StructuredBuffer: + return RHI::ShaderInputBufferType::Structured; + case BufferType::RasterizerOrderedByteAddressBuffer: + case BufferType::ByteAddressBuffer: + case BufferType::RwByteAddressBuffer: + return RHI::ShaderInputBufferType::Raw; + case BufferType::RaytracingAccelerationStructure: + return RHI::ShaderInputBufferType::AccelerationStructure; + default: + AZ_Assert(false, "Unhandled BufferType"); + return RHI::ShaderInputBufferType::Unknown; + } + } + + bool LoadShaderResourceGroupLayouts( + [[maybe_unused]] const char* builderName, const SrgDataContainer& resourceGroups, + const bool platformUsesRegisterSpaces, RPI::ShaderResourceGroupLayoutList& srgLayoutList) + { + // The register number only makes sense if the platform uses "spaces", + // since the register Id of the resource will not change even if the pipeline layout changes. + // All we care about is whether the shaderPlatformInterface appends the "--use-spaces" flag. + bool useRegisterId = platformUsesRegisterSpaces; + + // Load all SRGs included in source file + for (const SrgData& srgData : resourceGroups) + { + RHI::Ptr newSrgLayout = RHI::ShaderResourceGroupLayout::Create(); + newSrgLayout->SetName(AZ::Name{srgData.m_name.c_str()}); + newSrgLayout->SetBindingSlot(srgData.m_bindingSlot.m_index); + + // Samplers + for (const SamplerSrgData& samplerData : srgData.m_samplers) + { + if (samplerData.m_isDynamic) + { + newSrgLayout->AddShaderInput( + {samplerData.m_nameId, samplerData.m_count, + useRegisterId ? samplerData.m_registerId : RHI::UndefinedRegisterSlot}); + } + else + { + newSrgLayout->AddStaticSampler( + {samplerData.m_nameId, samplerData.m_descriptor, + useRegisterId ? samplerData.m_registerId : RHI::UndefinedRegisterSlot}); + } + } + + // Images + for (const TextureSrgData& textureData : srgData.m_textures) + { + const RHI::ShaderInputImageAccess imageAccess = + textureData.m_isReadOnlyType ? RHI::ShaderInputImageAccess::Read : RHI::ShaderInputImageAccess::ReadWrite; + + const RHI::ShaderInputImageType imageType = SrgLayoutUtility::ToShaderInputImageType(textureData.m_type); + + if (imageType != RHI::ShaderInputImageType::Unknown) + { + if (textureData.m_count != aznumeric_cast(-1)) + { + newSrgLayout->AddShaderInput( + {textureData.m_nameId, imageAccess, imageType, textureData.m_count, + useRegisterId ? textureData.m_registerId : RHI::UndefinedRegisterSlot}); + } + else + { + // unbounded array + newSrgLayout->AddShaderInput( + {textureData.m_nameId, imageAccess, imageType, + useRegisterId ? textureData.m_registerId : RHI::UndefinedRegisterSlot}); + } + } + else + { + AZ_Error( + builderName, false, "Failed to build Shader Resource Group Asset: Image %s has an unknown type.", + textureData.m_nameId.GetCStr()); + return false; + } + } + + // Buffers + { + for (const ConstantBufferData& cbData : srgData.m_constantBuffers) + { + newSrgLayout->AddShaderInput( + {cbData.m_nameId, RHI::ShaderInputBufferAccess::Constant, RHI::ShaderInputBufferType::Constant, + cbData.m_count, cbData.m_strideSize, useRegisterId ? cbData.m_registerId : RHI::UndefinedRegisterSlot}); + } + + for (const BufferSrgData& bufferData : srgData.m_buffers) + { + const RHI::ShaderInputBufferAccess bufferAccess = + bufferData.m_isReadOnlyType ? RHI::ShaderInputBufferAccess::Read : RHI::ShaderInputBufferAccess::ReadWrite; + + const RHI::ShaderInputBufferType bufferType = SrgLayoutUtility::ToShaderInputBufferType(bufferData.m_type); + + if (bufferType != RHI::ShaderInputBufferType::Unknown) + { + if (bufferData.m_count != aznumeric_cast(-1)) + { + newSrgLayout->AddShaderInput( + {bufferData.m_nameId, bufferAccess, bufferType, bufferData.m_count, bufferData.m_strideSize, + useRegisterId ? bufferData.m_registerId : RHI::UndefinedRegisterSlot}); + } + else + { + // unbounded array + newSrgLayout->AddShaderInput( + {bufferData.m_nameId, bufferAccess, bufferType, bufferData.m_strideSize, + useRegisterId ? bufferData.m_registerId : RHI::UndefinedRegisterSlot}); + } + } + else + { + AZ_Error( + builderName, false, + "Failed to build Shader Resource Group Asset: Buffer %s has un unknown type.", + bufferData.m_nameId.GetCStr()); + return false; + } + } + } + + // SRG Constants + uint32_t constantDataRegisterId = useRegisterId ? srgData.m_srgConstantDataRegisterId : RHI::UndefinedRegisterSlot; + for (const SrgConstantData& srgConstants : srgData.m_srgConstantData) + { + newSrgLayout->AddShaderInput( + {srgConstants.m_nameId, srgConstants.m_constantByteOffset, srgConstants.m_constantByteSize, + constantDataRegisterId}); + } + + // Shader Variant Key fallback + if (srgData.m_fallbackSize > 0) + { + // Designates this SRG as a ShaderVariantKey fallback + newSrgLayout->SetShaderVariantKeyFallback(srgData.m_fallbackName, srgData.m_fallbackSize); + } + + srgLayoutList.push_back(newSrgLayout); + } + + return true; + } + + } // namespace SrgLayoutUtility + } // namespace ShaderBuilder +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.h b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.h new file mode 100644 index 0000000000..43607f600c --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Source/Editor/SrgLayoutUtility.h @@ -0,0 +1,34 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +#include "CommonFiles/CommonTypes.h" +#include +#include "ShaderBuilderUtility.h" + +namespace AZ +{ + namespace ShaderBuilder + { + namespace SrgLayoutUtility + { + + bool LoadShaderResourceGroupLayouts( + [[maybe_unused]] const char* builderName, const SrgDataContainer& resourceGroups, const bool platformUsesRegisterSpaces, + RPI::ShaderResourceGroupLayoutList& srgLayoutList); + + } // SrgLayoutUtility namespace + } // ShaderBuilder namespace +} // AZ diff --git a/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.cpp b/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.cpp new file mode 100644 index 0000000000..276c225e05 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.cpp @@ -0,0 +1,41 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include "ShaderBuilderTestFixture.h" + +#include +#include + +namespace UnitTest +{ + void ShaderBuilderTestFixture::SetUp() + { + AllocatorsTestFixture::SetUp(); + + AZ::AllocatorInstance::Create(); + AZ::AllocatorInstance::Create(); + + AZ::NameDictionary::Create(); + } + + void ShaderBuilderTestFixture::TearDown() + { + AZ::NameDictionary::Destroy(); + + AZ::AllocatorInstance::Destroy(); + AZ::AllocatorInstance::Destroy(); + + AllocatorsTestFixture::TearDown(); + } + +} + diff --git a/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.h b/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.h new file mode 100644 index 0000000000..450cc6bde5 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Tests/Common/ShaderBuilderTestFixture.h @@ -0,0 +1,34 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +namespace UnitTest +{ + /** + * Unit test fixture for setting up memory allocation pools and the AZ::Name dictionary. + * In the future will be extended as needed. + */ + class ShaderBuilderTestFixture + : public AllocatorsTestFixture + { + protected: + /////////////////////////////////////////////////////////////////////// + // AllocatorsTestFixture overrides + void SetUp() override; + void TearDown() override; + /////////////////////////////////////////////////////////////////////// + }; +} // namespace UnitTest + diff --git a/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp b/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp new file mode 100644 index 0000000000..2e5ee3fc09 --- /dev/null +++ b/Gems/Atom/Asset/Shader/Code/Tests/SupervariantCmdArgumentTests.cpp @@ -0,0 +1,523 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include + +#include +#include +#include + +#include + +#include "Common/ShaderBuilderTestFixture.h" + +namespace UnitTest +{ + using namespace AZ; + + struct KeyValueView + { + AZStd::string_view m_key; + AZStd::string_view m_value; + }; + + class SupervariantCmdArgumentTests : public ShaderBuilderTestFixture + { + protected: + static constexpr char MCPP_MACRO1[] = "MACRO1"; + static constexpr char MCPP_VALUE1[] = "VALUE1a"; + static constexpr char MCPP_NEW_VALUE1[] = "VALUE1b"; // Missing A is not a typo + + static constexpr char MCPP_MACRO2[] = "MACRO2"; + static constexpr char MCPP_VALUE2[] = "VALUE2"; + + static constexpr char MCPP_MACRO3[] = "MACRO3"; + static constexpr char MCPP_VALUE3[] = "VALUE3a"; + static constexpr char MCPP_NEW_VALUE3[] = "VALUE3b"; + + static constexpr char MCPP_MACRO4[] = "MACRO4"; + + static constexpr char MCPP_MACRO5[] = "MACRO5"; + + static constexpr char MCPP_MACRO6[] = "MACRO6"; + static constexpr char MCPP_VALUE6[] = "VALUE6"; + + static constexpr char AZSLC_ARG1[] = "--azsl1"; + + static constexpr char AZSLC_ARG2[] = "--azsl2"; + static constexpr char AZSLC_VAL2[] = "open,source"; + static constexpr char AZSLC_NEW_VAL2a[] = "closed,binary"; + static constexpr char AZSLC_NEW_VAL2b[] = "closed,source"; + + static constexpr char AZSLC_ARG3[] = "--azsl3"; + static constexpr char AZSLC_VAL3[] = "blue"; + + static constexpr char AZSLC_ARG4[] = "-azsl4"; + + static constexpr char AZSLC_ARG5[] = "--azsl5"; + static constexpr char AZSLC_VAL5[] = "smith,wick,john,45,-1,-1"; + static constexpr char AZSLC_NEW_VAL5[] = "apple,seed,crisp,-1,2,0"; + + static constexpr char AZSLC_ARG6[] = "--azsl6"; + + static constexpr char AZSLC_ARG7[] = "--azsl7"; + + //! Helper function. + //! Given an input list of {Key, Value} pairs returns a list of strings where each string is of the form: "Key=Value". + AZStd::vector CreateListOfStringsFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + { + AZStd::vector listOfStrings; + for (const auto& keyValue : listOfKeyValues) + { + if (keyValue.m_value.empty()) + { + listOfStrings.push_back(keyValue.m_key); + } + else + { + listOfStrings.push_back(AZStd::string::format("%s=%s", keyValue.m_key.data(), keyValue.m_value.data())); + } + } + return listOfStrings; + } + + //! Helper function. + //! Given an input list of {Key, Value} pairs returns a list of strings where each string is of the form: "Key1", "Value1", "Key2", "Value2". + AZStd::vector CreateListOfSingleStringsFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + { + AZStd::vector listOfStrings; + for (const auto& keyValue : listOfKeyValues) + { + listOfStrings.push_back(keyValue.m_key); + if (!keyValue.m_value.empty()) + { + listOfStrings.push_back(keyValue.m_value); + } + } + return listOfStrings; + } + + //! Helper function. + //! @param outputString: [out] The string " @argName" gets appended to it (The space is intentional). + //! Alternatively, if @argValue is NOT empty, then the string " @argName=@argValue" is + //! appended to it. + //! @param argName: A typical command line argument. "-p" or "--some". + //! @param argValue: A string representing the value that should be appended to @argName. + void AppendCmdLineArgument(AZStd::string& outputString, AZStd::string_view argName, AZStd::string_view argValue) const + { + if (argValue.empty()) + { + outputString += AZStd::string::format(" %s", argName.data()); + } + else + { + outputString += AZStd::string::format(" %s=%s", argName.data(), argValue.data()); + } + } + + //! Helper function. + //! Similar to above, but assumes that @argName refers to just the name of a macro definition so the appended string will always start + //! with "-D". + void AppendMacroDefinitionArgument(AZStd::string& outputString, AZStd::string_view argName, AZStd::string_view argValue) const + { + AppendCmdLineArgument(outputString, AZStd::string::format("-D%s", argName.data()), argValue); + } + + //! A helper made of helpers. + //! Returns a command line string that results of concatenating the input list of {Key, Value} pairs (with '='). + //! Example of a returned string: + //! "key1=value1 key2 key3 key4=value" + AZStd::string CreateCmdLineStringFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + { + AZStd::string cmdLineString; + for (const auto& keyValueView : listOfKeyValues) + { + AppendCmdLineArgument(cmdLineString, keyValueView.m_key, keyValueView.m_value); + } + return cmdLineString; + } + + //! A helper made of helpers. + //! Returns a command line string of macro definitions that results of concatenating the input list of {Key, Value} pairs. + //! Example of a returned string: + //! "-Dkey1=value1 -Dkey2 -Dkey3 -Dkey4=value" + AZStd::string CreateMacroDefinitionCmdLineStringFromListOfKeyValues(AZStd::array_view listOfKeyValues) const + { + AZStd::string cmdLineString; + for (const auto& keyValueView : listOfKeyValues) + { + AppendMacroDefinitionArgument(cmdLineString, keyValueView.m_key, keyValueView.m_value); + } + return cmdLineString; + } + + //! @param includePaths A List of folder paths + //! @param predefinedMacros A List of strings with format: "name[=value]" + ShaderBuilder::PreprocessorOptions CreatePreprocessorOptions( + AZStd::array_view includePaths, AZStd::array_view predefinedMacros) const + { + ShaderBuilder::PreprocessorOptions preprocessorOptions; + + preprocessorOptions.m_projectIncludePaths.reserve(includePaths.size()); + for (const auto& path : includePaths) + { + preprocessorOptions.m_projectIncludePaths.push_back(path); + } + + preprocessorOptions.m_predefinedMacros.reserve(predefinedMacros.size()); + for (const auto& macro : predefinedMacros) + { + preprocessorOptions.m_predefinedMacros.push_back(macro); + } + + return preprocessorOptions; + } + + //! @param azslcAdditionalFreeArguments: A string representing series of command line arguments for AZSLc. + //! @param dxcAdditionalFreeArguments: A string representing series of command line arguments for DXC. + RHI::ShaderCompilerArguments CreateShaderCompilerArguments( + AZStd::string_view azslcAdditionalFreeArguments, AZStd::string_view dxcAdditionalFreeArguments) const + { + RHI::ShaderCompilerArguments shaderCompilerArguments; + shaderCompilerArguments.m_azslcWarningLevel = 1; + shaderCompilerArguments.m_azslcAdditionalFreeArguments = azslcAdditionalFreeArguments; + shaderCompilerArguments.m_defaultMatrixOrder = RHI::MatrixOrder::Row; + shaderCompilerArguments.m_dxcAdditionalFreeArguments = dxcAdditionalFreeArguments; + + return shaderCompilerArguments; + } + + + //! @param includePaths A List of folder paths + //! @param predefinedMacros A List of strings with format: "name[=value]" + //! @param azslcAdditionalFreeArguments A string representing series of command line arguments for AZSLc. + //! @param dxcAdditionalFreeArguments: A string representing series of command line arguments for DXC. + ShaderBuilder::GlobalBuildOptions CreateGlobalBuildOptions( + AZStd::array_view includePaths, + AZStd::array_view predefinedMacros, + AZStd::string_view azslcAdditionalFreeArguments, + AZStd::string_view dxcAdditionalFreeArguments) const + { + ShaderBuilder::GlobalBuildOptions globalBuildOptions; + globalBuildOptions.m_preprocessorSettings = CreatePreprocessorOptions(includePaths, predefinedMacros); + globalBuildOptions.m_compilerArguments = + CreateShaderCompilerArguments(azslcAdditionalFreeArguments, dxcAdditionalFreeArguments); + return globalBuildOptions; + } + + //! @param name Name of the supervariant. + //! @param plusArguments A string with command line arguments that contains both C-preprocessor macro definitions + //! and other command line arguments for AZSLc. + //! @param minusArguments A string with command line arguments that should be removed from the finalized command line arguments. + //! it can contain both, C-preprocessor macro definitions and other command line arguments for AZSLc. + RPI::ShaderSourceData::SupervariantInfo CreateSupervariantInfo( + AZStd::string_view name, AZStd::string_view plusArguments, AZStd::string_view minusArguments) const + { + RPI::ShaderSourceData::SupervariantInfo supervariantInfo; + supervariantInfo.m_name = name; + supervariantInfo.m_plusArguments = plusArguments; + supervariantInfo.m_minusArguments = minusArguments; + return supervariantInfo; + } + + bool StringContainsAllSubstrings(AZStd::string_view haystack, AZStd::array_view substrings) + { + return AZStd::all_of(AZ_BEGIN_END(substrings), + [&](AZStd::string_view needle) -> bool + { + return (haystack.find(needle) != AZStd::string::npos); + } + ); + } + + bool StringDoesNotContainAnyOneOfTheSubstrings(AZStd::string_view haystack, AZStd::array_view substrings) + { + return AZStd::all_of(AZ_BEGIN_END(substrings), [&](AZStd::string_view needle) -> bool { + return (haystack.find(needle) == AZStd::string::npos); + }); + } + + //! @returns: True if all strings in @substring appear in @vectorOfString. + //! @remark: Keep in mind that this is not the same as saying that all strings in @vectorOfStrings appear in @substrings. + bool VectorContainsAllSubstrings( + AZStd::array_view vectorOfStrings, AZStd::array_view substrings) + { + return AZStd::all_of( + AZ_BEGIN_END(substrings), + [&](AZStd::string_view needle) -> bool { + bool res = AZStd::any_of(AZ_BEGIN_END(vectorOfStrings), + [&](AZStd::string_view haystack) -> bool + { + return haystack.find(needle) != AZStd::string::npos; + } + ); + return res; + } + ); + } + + //! @returns: True only if None of the strings in @vectorOfStrings contains any of the strings in @substrings. + bool VectorDoesNotContainAnyOneOfTheSubstrings(AZStd::array_view vectorOfStrings, AZStd::array_view substrings) + { + return AZStd::all_of(AZ_BEGIN_END(vectorOfStrings), [&](AZStd::string_view haystack) -> bool { + return StringDoesNotContainAnyOneOfTheSubstrings(haystack, substrings); + }); + } + + }; // class SupervariantCmdArgumentTests + + + TEST_F(SupervariantCmdArgumentTests, CommandLineArgumentUtils_ValidateHelperFunctions) + { + // In this test the idea is to validate the static helper functions in AZ::RHI::ShaderCompilerArguments class + // that are useful for command line argument manipulation, etc. + AZStd::vector argumentList = { + {AZSLC_ARG1, ""}, {AZSLC_ARG2, AZSLC_VAL2}, {AZSLC_ARG3, AZSLC_VAL3}, {AZSLC_ARG4, ""}, {AZSLC_ARG5, AZSLC_VAL5}, + }; + + auto argumentsAsString = CreateCmdLineStringFromListOfKeyValues(argumentList); + auto listOfArgumentNames = AZ::RHI::CommandLineArgumentUtils::GetListOfArgumentNames(argumentsAsString); + + EXPECT_TRUE(AZStd::all_of(AZ_BEGIN_END(argumentList), [&](const KeyValueView& needle) -> bool { + return (AZStd::find(AZ_BEGIN_END(listOfArgumentNames), needle.m_key) != listOfArgumentNames.end()) && + // Make sure the values did not make into the expected list of keys. + (AZStd::find(AZ_BEGIN_END(listOfArgumentNames), needle.m_value) == listOfArgumentNames.end()); + })); + + AZStd::vector listOfArgumentsToRemove = { AZSLC_ARG4, AZSLC_ARG2 }; + auto stringWithRemovedArguments = + AZ::RHI::CommandLineArgumentUtils::RemoveArgumentsFromCommandLineString(listOfArgumentsToRemove, argumentsAsString); + EXPECT_TRUE(AZStd::all_of(AZ_BEGIN_END(listOfArgumentsToRemove), [&](const AZStd::string& needle) -> bool { + return stringWithRemovedArguments.find(needle) == AZStd::string::npos; + })); + + AZStd::vector listOfSurvivingArguments = {AZSLC_ARG1, AZSLC_ARG3, AZSLC_ARG5}; + EXPECT_TRUE(AZStd::all_of(AZ_BEGIN_END(listOfSurvivingArguments), [&](const AZStd::string& needle) -> bool { + return stringWithRemovedArguments.find(needle) != AZStd::string::npos; + })); + + auto stringWithoutExtraSpaces = + AZ::RHI::CommandLineArgumentUtils::RemoveExtraSpaces(" --arg1 -arg2 --arg3=foo --arg4=bar "); + EXPECT_EQ(stringWithoutExtraSpaces, AZStd::string("--arg1 -arg2 --arg3=foo --arg4=bar")); + + auto stringAsMergedArguments = + AZ::RHI::CommandLineArgumentUtils::MergeCommandLineArguments("--arg1 -arg2 --arg3=foo", "--arg3=bar --arg4"); + EXPECT_EQ(stringAsMergedArguments, AZStd::string("--arg1 -arg2 --arg3=bar --arg4")); + + EXPECT_TRUE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("-DMACRO")); + EXPECT_TRUE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("-D MACRO")); + EXPECT_TRUE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--help -D MACRO")); + EXPECT_TRUE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--help -p -DMACRO --more")); + EXPECT_TRUE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--help -p -D MACRO=VALUE --more")); + EXPECT_FALSE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--help -p --more")); + EXPECT_FALSE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--help -p --more --DFAKE")); + EXPECT_FALSE(AZ::RHI::CommandLineArgumentUtils::HasMacroDefinitions("--DFAKE1 --help -p --more --D FAKE2")); + } + + TEST_F(SupervariantCmdArgumentTests, ShaderCompilerArguments_ValidateCommandLineArgumentsMerge) + { + // In this test we validate that AZ::RHI::ShaderCompilerArguments::Merge() works as expected + // by merging AZSLC & DXC arguments giving higher priority to the arguments in the "right". + + auto shaderCompilerArgumentsLeft = CreateShaderCompilerArguments( + "--azsl1 --azsl2=avalue2a -azsl3 --azsl4=avalue4a", + "--dxc1=dvalue1a -dxc2 --dxc3=dvalue3a --dxc4"); + auto shaderCompilerArgumentsRight = CreateShaderCompilerArguments( + "--azsl1 --azsl2=avalue2b -azsl3 --azsl4=avalue4a --azsl5", + "--dxc1=dvalue1a -dxc2 --dxc3=dvalue3b --dxc4 --dxc5=dvalue5a"); + + shaderCompilerArgumentsLeft.Merge(shaderCompilerArgumentsRight); + EXPECT_EQ(shaderCompilerArgumentsLeft.m_azslcAdditionalFreeArguments, "--azsl1 --azsl2=avalue2b -azsl3 --azsl4=avalue4a --azsl5"); + EXPECT_EQ(shaderCompilerArgumentsLeft.m_dxcAdditionalFreeArguments, "--dxc1=dvalue1a -dxc2 --dxc3=dvalue3b --dxc4 --dxc5=dvalue5a"); + } + + + TEST_F(SupervariantCmdArgumentTests, SupervariantInfo_ValidateMemberFunctions) + { + // In this test all member functions of the ShaderSourceData::SupervariantInfo class + // are validated. + + AZStd::vector mcppMacrosList = { + {MCPP_MACRO1, MCPP_VALUE1}, + {MCPP_MACRO2, MCPP_VALUE2}, + {MCPP_MACRO3, MCPP_VALUE3}, + {MCPP_MACRO4, ""}, + }; + + AZStd::string argumentsToAddOrReplace; + AppendMacroDefinitionArgument(argumentsToAddOrReplace, MCPP_MACRO3, MCPP_NEW_VALUE3); + AppendCmdLineArgument(argumentsToAddOrReplace, AZSLC_ARG2, AZSLC_NEW_VAL2a); + AppendMacroDefinitionArgument(argumentsToAddOrReplace, MCPP_MACRO1, MCPP_NEW_VALUE1); + AppendCmdLineArgument(argumentsToAddOrReplace, AZSLC_ARG5, AZSLC_NEW_VAL5); + AppendMacroDefinitionArgument(argumentsToAddOrReplace, MCPP_MACRO5, ""); + AppendCmdLineArgument(argumentsToAddOrReplace, AZSLC_ARG6, ""); + + AZStd::string argumentsToRemove; + AppendCmdLineArgument(argumentsToRemove, AZSLC_ARG3, ""); + AppendMacroDefinitionArgument(argumentsToRemove, MCPP_MACRO2, ""); + AppendCmdLineArgument(argumentsToRemove, AZSLC_ARG4, ""); + AppendMacroDefinitionArgument(argumentsToRemove, MCPP_MACRO4, ""); + + auto supervariantInfo = CreateSupervariantInfo("Dummy", argumentsToAddOrReplace, argumentsToRemove); + + auto macroListToRemove = supervariantInfo.GetCombinedListOfMacroDefinitionNamesToRemove(); + AZStd::vector macroNamesToRemoveThatMustBePresent = { MCPP_MACRO1, MCPP_MACRO2, MCPP_MACRO3, MCPP_MACRO4, MCPP_MACRO5 }; + EXPECT_EQ(macroListToRemove.size(), macroNamesToRemoveThatMustBePresent.size()); + EXPECT_TRUE( + VectorContainsAllSubstrings(macroListToRemove, macroNamesToRemoveThatMustBePresent) + ); + + auto macroListToAdd = supervariantInfo.GetMacroDefinitionsToAdd(); + AZStd::vector macroNamesToAddThatMustBePresent = {MCPP_MACRO1, MCPP_MACRO3, MCPP_MACRO5}; + EXPECT_EQ(macroListToAdd.size(), macroNamesToAddThatMustBePresent.size()); + EXPECT_TRUE(VectorContainsAllSubstrings(macroListToAdd, macroNamesToAddThatMustBePresent)); + + // The result of GetCustomizedArgumentsForAzslc() is the most important value to test + AZStd::vector freeAzslcArgumentList = { + {AZSLC_ARG1, ""}, {AZSLC_ARG2, AZSLC_VAL2}, {AZSLC_ARG3, AZSLC_VAL3}, {AZSLC_ARG4, ""}, {AZSLC_ARG5, AZSLC_VAL5}, + }; + AZStd::string azslcArgs = CreateCmdLineStringFromListOfKeyValues(freeAzslcArgumentList); + AZStd::string customizedAzslcArgs = supervariantInfo.GetCustomizedArgumentsForAzslc(azslcArgs); + + AZStd::vector stringsThatMustBePresent = { + AZSLC_ARG1, AZSLC_ARG2, AZSLC_NEW_VAL2a, AZSLC_ARG5, AZSLC_NEW_VAL5, AZSLC_ARG6}; + EXPECT_TRUE(StringContainsAllSubstrings(customizedAzslcArgs, stringsThatMustBePresent)); + + AZStd::vector stringsThatCanNotBePresent = { AZSLC_ARG3, AZSLC_VAL3, AZSLC_ARG4, + // Because GetCustomizedArgumentsForAzslc() only returns arguments for AZSLc, none of the macro related + // arguments can be present + MCPP_MACRO1, MCPP_VALUE1, MCPP_NEW_VALUE1, + MCPP_MACRO2, MCPP_VALUE2, + MCPP_MACRO3, MCPP_VALUE3, MCPP_NEW_VALUE3, + MCPP_MACRO4, + MCPP_MACRO5 + }; + + EXPECT_TRUE( + StringDoesNotContainAnyOneOfTheSubstrings(customizedAzslcArgs, stringsThatCanNotBePresent) + ); + } + + + TEST_F(SupervariantCmdArgumentTests, ShaderAssetBuilder_ValidateInfluenceOfSupervariantInfoOnGlobalBuildOptions) + { + // In this test we validate how the ShaderAssetBuilder configure the commmand line arguments it passes + // to MCPP, AZSLc & DXC. It basically starts with a GlobalBuildOptions, that gets further customized by + // the ShaderCompilerArguments from ShaderSourceData(.shader file) and later further customized + // by each SupervariantInfo in ShaderSourceData. + + // The first step is to define the initial values of the GlobalBuildOptions. + AZStd::vector globalMcppMacrosList = { + {MCPP_MACRO1, MCPP_VALUE1}, + {MCPP_MACRO2, MCPP_VALUE2}, + {MCPP_MACRO3, MCPP_VALUE3}, + {MCPP_MACRO4, ""}, + }; + + AZStd::vector globalAzslArguments = { + {AZSLC_ARG1, ""}, + {AZSLC_ARG2, AZSLC_VAL2}, + {AZSLC_ARG3, AZSLC_VAL3}, + {AZSLC_ARG4, ""}, + {AZSLC_ARG5, AZSLC_VAL5}, + }; + + auto globalBuildOptions = CreateGlobalBuildOptions( + AZStd::vector(), CreateListOfStringsFromListOfKeyValues(globalMcppMacrosList), + CreateCmdLineStringFromListOfKeyValues(globalAzslArguments), + "" /* Don't care about DXC in this test */); + + // The second step is to load the Shader Compiler Arguments from the .shader file. + // These arguments will be merged in @globalBuildOptions, but the .shader arguments have + // higher priority. + AZStd::vector shaderAzslArguments = { + {AZSLC_ARG2, AZSLC_NEW_VAL2a}, + {AZSLC_ARG6, ""}, + }; + auto shaderCompilerArguments = CreateShaderCompilerArguments( + CreateCmdLineStringFromListOfKeyValues(shaderAzslArguments), "" /* Don't care about DXC in this test */); + globalBuildOptions.m_compilerArguments.Merge(shaderCompilerArguments); + + // Let's create the dummy supervariant. It will have some MCPP & AZSLc arguments to be added/replaced AND other MCPP & AZSLc arguments to be removed. + AZStd::vector supervariantAzslArgumentsToAdd = { + {AZSLC_ARG2, AZSLC_NEW_VAL2b}, + {AZSLC_ARG7, ""}, + }; + AZStd::vector supervariantMacroDefinitionsToAdd = { + {MCPP_MACRO1, MCPP_NEW_VALUE1}, + {MCPP_MACRO3, MCPP_NEW_VALUE3}, + {MCPP_MACRO5, ""}, + }; + auto supervariantArgumentsToAdd = CreateCmdLineStringFromListOfKeyValues(supervariantAzslArgumentsToAdd) + + CreateMacroDefinitionCmdLineStringFromListOfKeyValues(supervariantMacroDefinitionsToAdd); + + AZStd::vector supervariantAzslArgumentsToRemove = { + {AZSLC_ARG4, ""}, + {AZSLC_ARG1, ""}, + }; + AZStd::vector supervariantMacrosToRemove = { + {MCPP_MACRO2, ""}, + {MCPP_MACRO4, ""}, + }; + auto supervariantArgumentsToRemove = CreateCmdLineStringFromListOfKeyValues(supervariantAzslArgumentsToRemove) + + CreateMacroDefinitionCmdLineStringFromListOfKeyValues(supervariantMacrosToRemove); + + //CreateMacroDefinitionCmdLineStringFromListOfKeyValues + auto supervariantInfo = CreateSupervariantInfo("Dummy", + supervariantArgumentsToAdd, // These arguments will be added or replace existing ones. + supervariantArgumentsToRemove); // These arguments must be removed. + + AZStd::vector macroDefinitionNamesToRemove = supervariantInfo.GetCombinedListOfMacroDefinitionNamesToRemove(); + globalBuildOptions.m_preprocessorSettings.RemovePredefinedMacros(macroDefinitionNamesToRemove); + AZStd::vector macroDefinitionsToAdd = supervariantInfo.GetMacroDefinitionsToAdd(); + globalBuildOptions.m_preprocessorSettings.m_predefinedMacros.insert( + globalBuildOptions.m_preprocessorSettings.m_predefinedMacros.end(), macroDefinitionsToAdd.begin(), macroDefinitionsToAdd.end()); + + // Validate macro definitions that must be present. + EXPECT_TRUE( + VectorContainsAllSubstrings( + globalBuildOptions.m_preprocessorSettings.m_predefinedMacros, + AZStd::vector({MCPP_MACRO1, MCPP_NEW_VALUE1, MCPP_MACRO3, MCPP_NEW_VALUE3, MCPP_MACRO5})) + ); + + // Validate macro definitions that can't be present. + EXPECT_TRUE( + VectorDoesNotContainAnyOneOfTheSubstrings( + globalBuildOptions.m_preprocessorSettings.m_predefinedMacros, + AZStd::vector({MCPP_MACRO2, MCPP_VALUE3, MCPP_MACRO4})) + ); + + AZStd::string azslcArgsFromGlobalBuildOptions = globalBuildOptions.m_compilerArguments.MakeAdditionalAzslcCommandLineString(); + + // The result of GetCustomizedArgumentsForAzslc() is the most important value to test + AZStd::string customizedAzslcArgs = supervariantInfo.GetCustomizedArgumentsForAzslc(azslcArgsFromGlobalBuildOptions); + + EXPECT_TRUE( + StringContainsAllSubstrings(customizedAzslcArgs, CreateListOfSingleStringsFromListOfKeyValues(supervariantAzslArgumentsToAdd)) + ); + + EXPECT_TRUE( + StringDoesNotContainAnyOneOfTheSubstrings(customizedAzslcArgs, CreateListOfSingleStringsFromListOfKeyValues(supervariantAzslArgumentsToRemove)) + ); + + EXPECT_TRUE( + StringContainsAllSubstrings(customizedAzslcArgs, AZStd::vector({AZSLC_ARG3, AZSLC_VAL3, AZSLC_ARG5, AZSLC_VAL5})) + ); + } + + +} //namespace UnitTest + +AZ_UNIT_TEST_HOOK(DEFAULT_UNIT_TEST_ENV); + diff --git a/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_files.cmake b/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_files.cmake index 2032838f94..b3b2032c54 100644 --- a/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_files.cmake +++ b/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_files.cmake @@ -34,8 +34,14 @@ set(FILES Source/Editor/AzslCompiler.h Source/Editor/ShaderVariantAssetBuilder.cpp Source/Editor/ShaderVariantAssetBuilder.h + Source/Editor/ShaderVariantAssetBuilder2.cpp + Source/Editor/ShaderVariantAssetBuilder2.h Source/Editor/AtomShaderConfig.cpp Source/Editor/AtomShaderConfig.h Source/Editor/PrecompiledShaderBuilder.cpp Source/Editor/PrecompiledShaderBuilder.h + Source/Editor/ShaderAssetBuilder2.cpp + Source/Editor/ShaderAssetBuilder2.h + Source/Editor/SrgLayoutUtility.cpp + Source/Editor/SrgLayoutUtility.h ) diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/android_runtime_dependencies.cmake b/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_tests_files.cmake similarity index 78% rename from Templates/DefaultProject/Template/Code/Platform/Android/android_runtime_dependencies.cmake rename to Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_tests_files.cmake index a1ebd6e455..9f22f9f632 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Android/android_runtime_dependencies.cmake +++ b/Gems/Atom/Asset/Shader/Code/atom_asset_shader_builders_tests_files.cmake @@ -1,4 +1,4 @@ -# {BEGIN_LICENSE} +# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # @@ -7,8 +7,10 @@ # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} +# -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Vulkan.Private +set(FILES + Tests/Common/ShaderBuilderTestFixture.h + Tests/Common/ShaderBuilderTestFixture.cpp + Tests/SupervariantCmdArgumentTests.cpp ) diff --git a/Gems/Atom/Asset/Shader/gem.json b/Gems/Atom/Asset/Shader/gem.json new file mode 100644 index 0000000000..71c741f436 --- /dev/null +++ b/Gems/Atom/Asset/Shader/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "AtomShader", + "display_name": "Atom Shader Builder", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp index e3bdb28046..012a229fe8 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.cpp @@ -123,6 +123,12 @@ namespace AZ m_windowHandle = m_nativeWindow->GetWindowHandle(); } + else + { + // Disable default scene creation for non-games projects + // This can be manually overridden via the DefaultWindowBus. + m_createDefaultScene = false; + } AzFramework::AssetCatalogEventBus::Handler::BusConnect(); TickBus::Handler::BusConnect(); @@ -351,6 +357,17 @@ namespace AZ scene->AddRenderPipeline(brdfTexturePipeline); } + // Send notification when the scene and its pipeline are ready. + // Use the first created pipeline's scene as our default scene for now to allow + // consumers waiting on scene availability to initialize. + if (!m_defaultSceneReady) + { + m_defaultScene = scene; + Render::Bootstrap::NotificationBus::Broadcast( + &Render::Bootstrap::NotificationBus::Handler::OnBootstrapSceneReady, m_defaultScene.get()); + m_defaultSceneReady = true; + } + return true; } @@ -364,9 +381,6 @@ namespace AZ { m_renderPipelineId = pipeline->GetId(); } - - // Send notification when the scene and its pipeline are ready - Render::Bootstrap::NotificationBus::Broadcast(&Render::Bootstrap::NotificationBus::Handler::OnBootstrapSceneReady, m_defaultScene.get()); } void BootstrapSystemComponent::DestroyDefaultScene() diff --git a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h index 7323a54221..65390ff153 100644 --- a/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h +++ b/Gems/Atom/Bootstrap/Code/Source/BootstrapSystemComponent.h @@ -125,6 +125,7 @@ namespace AZ Data::Instance m_brdfTexture; bool m_createDefaultScene = true; + bool m_defaultSceneReady = false; // Maps AZ scenes to RPI scene weak pointers to allow looking up a ScenePtr instead of a raw Scene* AZStd::unordered_map> m_azSceneToAtomSceneMap; diff --git a/Gems/Atom/Bootstrap/gem.json b/Gems/Atom/Bootstrap/gem.json new file mode 100644 index 0000000000..8aa5cade6e --- /dev/null +++ b/Gems/Atom/Bootstrap/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_Bootstrap", + "display_name": "Atom Bootstrap", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/Component/DebugCamera/gem.json b/Gems/Atom/Component/DebugCamera/gem.json new file mode 100644 index 0000000000..06d39d1fc0 --- /dev/null +++ b/Gems/Atom/Component/DebugCamera/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_Component_DebugCamera", + "display_name": "Atom Debug Camera Component", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.materialtype index 214fc02660..9a2edc9fca 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/ReflectionProbe/ReflectionProbeVisualization.materialtype @@ -469,7 +469,7 @@ "max": 1.0, "connection": { "type": "ShaderInput", - "id": "m_depthFactor" + "id": "m_heightmapScale" } }, { @@ -479,18 +479,7 @@ "type": "Image", "connection": { "type": "ShaderInput", - "id": "m_depthMap" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_depthInverted" + "id": "m_heightmap" } }, { diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype index 954e01c592..3696188514 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR.materialtype @@ -1,5 +1,5 @@ { - "description": "Material Type with properties used to define Enhanced PBR material shading model.", + "description": "Material Type with properties used to define Enhanced PBR, a metallic-roughness Physically-Based Rendering (PBR) material shading model, with advanced features like subsurface scattering, transmission, and anisotropy.", "propertyLayout": { "version": 3, "groups": [ @@ -32,7 +32,7 @@ "id": "clearCoat", "displayName": "Clear Coat", "description": "Properties for configuring gloss clear coat" - }, + }, { "id": "normal", "displayName": "Normal", @@ -205,6 +205,13 @@ "id": "m_baseColorMap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -228,13 +235,6 @@ "type": "ShaderOption", "id": "o_baseColorTextureBlendMode" } - }, - { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map.", - "type": "Bool", - "defaultValue": true } ], "metallic": [ @@ -261,6 +261,13 @@ "id": "m_metallicMap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -272,29 +279,9 @@ "type": "ShaderInput", "id": "m_metallicMapUvIndex" } - }, - { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true } ], "roughness": [ - { - "id": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "id": "m_roughnessFactor" - } - }, { "id": "textureMap", "displayName": "Texture Map", @@ -305,6 +292,13 @@ "id": "m_roughnessMap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -346,11 +340,18 @@ } }, { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true + // Note that "factor" is mutually exclusive with "lowerBound"/"upperBound". These are swapped by a lua functor. + "id": "factor", + "displayName": "Factor", + "description": "Controls the roughness value", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "max": 1.0, + "connection": { + "type": "ShaderInput", + "id": "m_roughnessFactor" + } } ], "anisotropy": [ @@ -416,6 +417,13 @@ "id": "m_specularF0Map" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -428,13 +436,7 @@ "id": "m_specularF0MapUvIndex" } }, - { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR { "id": "enableMultiScatterCompensation", "displayName": "Multiscattering Compensation", @@ -452,11 +454,7 @@ "displayName": "Enable", "description": "Enable clear coat", "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "id": "o_clearCoat_feature_enabled" - } + "defaultValue": false }, { "id": "factor", @@ -481,6 +479,13 @@ "id": "m_clearCoatInfluenceMap" } }, + { + "id": "useInfluenceMap", + "displayName": " Use Texture", + "description": "Whether to use the texture map, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, { "id": "influenceMapUv", "displayName": " UV", @@ -493,13 +498,6 @@ "id": "m_clearCoatInfluenceMapUvIndex" } }, - { - "id": "useInfluenceMap", - "displayName": " Use Texture", - "description": "Whether to use the texture map, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, { "id": "roughness", "displayName": "Roughness", @@ -523,6 +521,13 @@ "id": "m_clearCoatRoughnessMap" } }, + { + "id": "useRoughnessMap", + "displayName": " Use Texture", + "description": "Whether to use the texture map, or just default to the roughness value.", + "type": "Bool", + "defaultValue": true + }, { "id": "roughnessMapUv", "displayName": " UV", @@ -535,13 +540,6 @@ "id": "m_clearCoatRoughnessMapUvIndex" } }, - { - "id": "useRoughnessMap", - "displayName": " Use Texture", - "description": "Whether to use the texture map, or just default to the roughness value.", - "type": "Bool", - "defaultValue": true - }, { "id": "normalStrength", "displayName": "Normal Strength", @@ -565,9 +563,16 @@ "id": "m_clearCoatNormalMap" } }, + { + "id": "useNormalMap", + "displayName": " Use Texture", + "description": "Whether to use the normal map", + "type": "Bool", + "defaultValue": true + }, { "id": "normalMapUv", - "displayName": "UV", + "displayName": " UV", "description": "Normal texture map UV set", "type": "Enum", "enumIsUv": true, @@ -576,29 +581,9 @@ "type": "ShaderInput", "id": "m_clearCoatNormalMapUvIndex" } - }, - { - "id": "useNormalMap", - "displayName": "Use Texture", - "description": "Whether to use the normal map", - "type": "Bool", - "defaultValue": true } ], "normal": [ - { - "id": "factor", - "displayName": "Factor", - "description": "Strength factor for scaling the values", - "type": "Float", - "defaultValue": 1.0, - "min": 0.0, - "softMax": 2.0, - "connection": { - "type": "ShaderInput", - "id": "m_normalFactor" - } - }, { "id": "textureMap", "displayName": "Texture Map", @@ -609,6 +594,13 @@ "id": "m_normalMap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map, or just rely on vertex normals.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -621,13 +613,6 @@ "id": "m_normalMapUvIndex" } }, - { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map, or just rely on vertex normals.", - "type": "Bool", - "defaultValue": true - }, { "id": "flipX", "displayName": "Flip X Channel", @@ -649,6 +634,19 @@ "type": "ShaderInput", "id": "m_flipNormalY" } + }, + { + "id": "factor", + "displayName": "Factor", + "description": "Strength factor for scaling the values", + "type": "Float", + "defaultValue": 1.0, + "min": 0.0, + "softMax": 2.0, + "connection": { + "type": "ShaderInput", + "id": "m_normalFactor" + } } ], "opacity": [ @@ -725,7 +723,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -872,18 +870,14 @@ "displayName": "Enable", "description": "Enable the emissive group", "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "id": "o_emissiveEnabled" - } + "defaultValue": false }, { "id": "unit", "displayName": "Units", "description": "The photometric units of the Intensity property.", "type": "Enum", - "enumValues": [ "Ev100" ], + "enumValues": ["Ev100"], "defaultValue": "Ev100" }, { @@ -918,51 +912,51 @@ "id": "m_emissiveMap" } }, - { - "id": "textureMapUv", - "displayName": "UV", - "description": "Emissive texture map UV set", - "type": "Enum", - "enumValues": [ "UV0", "UV1" ], - "defaultValue": "UV0", - "connection": { - "type": "ShaderInput", - "id": "m_emissiveMapUvIndex" - } - }, { "id": "useTexture", "displayName": "Use Texture", "description": "Whether to use the texture map.", "type": "Bool", "defaultValue": true - } - ], - "parallax": [ - { - "id": "enable", - "displayName": "Enable", - "description": "Whether to enable the parallax feature.", - "type": "Bool", - "defaultValue": false - }, - { - "id": "textureMap", - "displayName": "Texture Map", - "description": "Depthmap to create parallax effect.", - "type": "Image", - "connection": { - "type": "ShaderInput", - "id": "m_depthMap" - } }, { "id": "textureMapUv", "displayName": "UV", - "description": "Depth texture map UV set", + "description": "Emissive texture map UV set", "type": "Enum", - "enumValues": [ "UV0", "UV1" ], - "defaultValue": "UV0", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "id": "m_emissiveMapUvIndex" + } + } + ], + "parallax": [ + { + "id": "textureMap", + "displayName": "Heightmap", + "description": "Displacement heightmap to create parallax effect.", + "type": "Image", + "connection": { + "type": "ShaderInput", + "id": "m_heightmap" + } + }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the heightmap.", + "type": "Bool", + "defaultValue": true + }, + { + "id": "textureMapUv", + "displayName": "UV", + "description": "Heightmap UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", "connection": { "type": "ShaderInput", "id": "m_parallaxUvIndex" @@ -973,12 +967,12 @@ "displayName": "Heightmap Scale", "description": "The total height of the heightmap in local model units.", "type": "Float", - "defaultValue": 0.0, + "defaultValue": 0.05, "min": 0.0, "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_depthFactor" + "id": "m_heightmapScale" } }, { @@ -991,18 +985,7 @@ "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_depthOffset" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_depthInverted" + "id": "m_heightmapOffset" } }, { @@ -1011,7 +994,7 @@ "description": "Select the algorithm to use for parallax mapping.", "type": "Enum", "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "Basic", + "defaultValue": "POM", "connection": { "type": "ShaderOption", "id": "o_parallax_algorithm" @@ -1055,7 +1038,7 @@ "subsurfaceScattering": [ { "id": "enableSubsurfaceScattering", - "displayName": "Enable Subsurface Scattering", + "displayName": "Subsurface Scattering", "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", "type": "Bool", "defaultValue": false, @@ -1069,7 +1052,7 @@ "displayName": " Factor", "description": "Strength factor for scaling percentage of subsurface scattering effect applied", "type": "float", - "defaultValue": 0.0, + "defaultValue": 1.0, "min": 0.0, "max": 1.0, "connection": { @@ -1087,18 +1070,6 @@ "id": "m_subsurfaceScatteringInfluenceMap" } }, - { - "id": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumValues": [ "UV0", "UV1" ], - "defaultValue": "UV0", - "connection": { - "type": "ShaderInput", - "id": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, { "id": "useInfluenceMap", "displayName": " Use Influence Map", @@ -1106,6 +1077,18 @@ "type": "Bool", "defaultValue": true }, + { + "id": "influenceMapUv", + "displayName": " UV", + "description": "Influence map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "id": "m_subsurfaceScatteringInfluenceMapUvIndex" + } + }, { "id": "scatterColor", "displayName": " Scatter color", @@ -1136,11 +1119,16 @@ } }, { - "id": "enableTransmission", - "displayName": "Enable Transmission", - "description": "Enable transmission feature", - "type": "Bool", - "defaultValue": false + "id": "transmissionMode", + "displayName": "Transmission", + "description": "Algorithm used for calculating transmission", + "type": "Enum", + "enumValues": [ "None", "ThickObject", "ThinObject" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "id": "o_transmission_mode" + } }, { "id": "thickness", @@ -1161,18 +1149,6 @@ "id": "m_transmissionThicknessMap" } }, - { - "id": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumValues": [ "UV0", "UV1" ], - "defaultValue": "UV0", - "connection": { - "type": "ShaderInput", - "id": "m_transmissionThicknessMapUvIndex" - } - }, { "id": "useThicknessMap", "displayName": " Use Thickness Map", @@ -1180,6 +1156,18 @@ "type": "Bool", "defaultValue": true }, + { + "id": "thicknessMapUv", + "displayName": " UV", + "description": "Thickness map UV set", + "type": "Enum", + "enumIsUv": true, + "defaultValue": "Tiled", + "connection": { + "type": "ShaderInput", + "id": "m_transmissionThicknessMapUvIndex" + } + }, { "id": "transmissionTint", "displayName": " Transmission Tint", @@ -1187,18 +1175,6 @@ "type": "Color", "defaultValue": [ 1.0, 0.8, 0.6 ] }, - { - "id": "transmissionMode", - "displayName": " Mode", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "id": "o_transmission_mode" - } - }, { "id": "transmissionPower", "displayName": " Power", @@ -1287,7 +1263,7 @@ } }, { - "id": "detailMapsMapUv", + "id": "textureMapUv", "displayName": "Detail Map UVs", "description": "Which UV set to use for detail map texture sampling", "type": "Enum", @@ -1388,7 +1364,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -1506,7 +1482,7 @@ { "file": "Shaders/Depth/DepthPassTransparentMax.shader", "tag": "DepthPassTransparentMax" - } + } ], "functors": [ { @@ -1549,26 +1525,9 @@ "lightUnitProperty": "emissive.unit", "shaderInput": "m_emissiveIntensity", "ev100Index": 0, - "nitIndex": 1, - "ev100MinMax": [ -10, 20 ], - "nitMinMax": [ 0.001, 100000.0 ] - } - }, - { - // Enable/Disable shader based on different option. - "type": "ShaderEnable", - "args": { - "opacityMode": "opacity.mode", - "parallaxEnable": "parallax.enable", - "parallaxPdoEnable": "parallax.pdo", - "pbrShaderNoEdsIndex": 0, - "pbrShaderWithEdsIndex": 1, - "shadowShaderNoPSIndex": 2, - "shadowShaderWithPSIndex": 3, - "depthShaderNoPSIndex": 4, - "depthShaderWithPSIndex": 5, - "depthShaderTransparentMin": 8, - "depthShaderTransparentMax": 9 + "nitIndex" : 1, + "ev100MinMax": [-10, 20], + "nitMinMax": [0.001, 100000.0] } }, { @@ -1590,120 +1549,40 @@ "tintThickenssShaderInput": "m_transmissionTintThickness" } }, - { - // Reads material properties to determine whether a specific texture map should be sampled at runtime, and sets a shader option accordingly. - // @param textureProperty - which material property contains the texture asset reference (or maybe null) - // @param useTextureProperty - a boolean flag that toggles whether the texture should be sampled (if it's not null) - // @param shaderTags - which shader in the 'shaders' list above is configured by this functor - // @param shaderOption - the name of a shader option in the AZSL file that controls sampling of this texture + { "type": "UseTexture", "args": { "textureProperty": "baseColor.textureMap", - "dependentProperties": ["baseColor.textureMapUv"], "useTextureProperty": "baseColor.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], + "dependentProperties": ["baseColor.textureMapUv", "baseColor.textureBlendMode"], "shaderOption": "o_baseColor_useTexture" } }, { - // See the comment above for details. "type": "UseTexture", "args": { "textureProperty": "metallic.textureMap", - "dependentProperties": ["metallic.textureMapUv"], "useTextureProperty": "metallic.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], + "dependentProperties": ["metallic.textureMapUv"], "shaderOption": "o_metallic_useTexture" } }, { - // See the comment above for details. - "type": "UseTexture", - "args": { - "textureProperty": "roughness.textureMap", - "dependentProperties": ["roughness.textureMapUv"], - "useTextureProperty": "roughness.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_roughness_useTexture" - } - }, - { - // See the comment above for details. "type": "UseTexture", "args": { "textureProperty": "specularF0.textureMap", - "dependentProperties": ["specularF0.textureMapUv"], "useTextureProperty": "specularF0.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], + "dependentProperties": ["specularF0.textureMapUv"], "shaderOption": "o_specularF0_useTexture" } }, { - // See the comment above for details. - "type": "UseTexture", - "args": { - "textureProperty": "clearCoat.influenceMap", - "dependentProperties": ["clearCoat.influenceMapUv"], - "useTextureProperty": "clearCoat.useInfluenceMap", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_clearCoat_factor_useTexture" - } - }, - { - // See the comment above for details. - "type": "UseTexture", - "args": { - "textureProperty": "clearCoat.roughnessMap", - "dependentProperties": ["clearCoat.roughnessMapUv"], - "useTextureProperty": "clearCoat.useRoughnessMap", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_clearCoat_roughness_useTexture" - } - }, - { - // See the comment above for details. - "type": "UseTexture", - "args": { - "textureProperty": "clearCoat.normalMap", - "dependentProperties": ["clearCoat.normalMapUv"], - "useTextureProperty": "clearCoat.useNormalMap", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_clearCoat_normal_useTexture" - } - }, - { - // See the comment above for details. "type": "UseTexture", "args": { "textureProperty": "normal.textureMap", - "dependentProperties": ["normal.textureMapUv"], "useTextureProperty": "normal.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_normal_useTexture" + "dependentProperties": ["normal.textureMapUv", "normal.factor", "normal.flipX", "normal.flipY"], + "shaderOption": "o_normal_useTexture" } }, { @@ -1725,335 +1604,21 @@ } }, { - // See the comment above for details. - "type": "UseTexture", + "type": "Lua", "args": { - "textureProperty": "emissive.textureMap", - "dependentProperties": ["emissive.textureMapUv"], - "useTextureProperty": "emissive.useTexture", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_emissive_useTexture" + "file": "StandardPBR_ClearCoatState.lua" } }, { - // See the comment above for details. - "type": "UseTexture", + "type": "Lua", "args": { - "textureProperty": "subsurfaceScattering.influenceMap", - "dependentProperties": ["subsurfaceScattering.influenceMapUv"], - "useTextureProperty": "subsurfaceScattering.useInfluenceMap", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_subsurfaceScattering_useTexture" + "file": "StandardPBR_ClearCoatEnableFeature.lua" } }, { - // See the comment above for details. - "type": "UseTexture", + "type": "Lua", "args": { - "textureProperty": "subsurfaceScattering.thicknessMap", - "dependentProperties": ["subsurfaceScattering.thicknessMapUv"], - "useTextureProperty": "subsurfaceScattering.useThicknessMap", - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], - "shaderOption": "o_transmission_useTexture" - } - }, - { - // Controls visibility for properties in the editor. - // @param actions - a list of actions that are executed in order. visibility will be set when triggerProperty hits the triggerValue. - // @param affectedProperties - the properties that are affected by actions. - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "emissive.enable", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "emissive.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "emissive.color", - "emissive.intensity", - "emissive.useTexture", - "emissive.unit" - ] - } - }, - { - // Controls visibility for properties in the editor. - // @param actions - a list of actions that are executed in order. visibility will be set when triggerProperty hits the triggerValue. - // @param affectedProperties - the properties that are affected by actions. - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "emissive.useTexture", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "emissive.useTexture", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "emissive.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "emissive.textureMap", - "emissive.textureMapUv" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "clearCoat.useInfluenceMap", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "clearCoat.useInfluenceMap", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "clearCoat.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "clearCoat.influenceMap", - "clearCoat.influenceMapUv" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "clearCoat.useRoughnessMap", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "clearCoat.useRoughnessMap", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "clearCoat.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "clearCoat.roughnessMap", - "clearCoat.roughnessMapUv" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "clearCoat.useNormalMap", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "clearCoat.useNormalMap", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "clearCoat.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "clearCoat.normalMap", - "clearCoat.normalMapUv" - ] - } - - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "subsurfaceScattering.useInfluenceMap", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "subsurfaceScattering.useInfluenceMap", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "subsurfaceScattering.enableSubsurfaceScattering", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "subsurfaceScattering.influenceMap", - "subsurfaceScattering.influenceMapUv" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "subsurfaceScattering.useThicknessMap", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "subsurfaceScattering.useThicknessMap", - "triggerValue": false, - "visibility": "Disabled" - }, - { - "triggerProperty": "subsurfaceScattering.enableTransmission", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "subsurfaceScattering.thicknessMap", - "subsurfaceScattering.thicknessMapUv" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "clearCoat.enable", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "clearCoat.enable", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "clearCoat.factor", - "clearCoat.useInfluenceMap", - "clearCoat.roughness", - "clearCoat.useRoughnessMap", - "clearCoat.useNormalMap" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "subsurfaceScattering.transmissionMode", - "triggerValue": "ThickObject", - "visibility": "Enabled" - }, - { - "triggerProperty": "subsurfaceScattering.transmissionMode", - "triggerValue": "None", - "visibility": "Hidden" - }, - { - "triggerProperty": "subsurfaceScattering.transmissionMode", - "triggerValue": "ThinObject", - "visibility": "Hidden" - }, - { - "triggerProperty": "subsurfaceScattering.enableTransmission", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "subsurfaceScattering.transmissionPower", - "subsurfaceScattering.transmissionDistortion", - "subsurfaceScattering.transmissionAttenuation" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "subsurfaceScattering.enableSubsurfaceScattering", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "subsurfaceScattering.enableSubsurfaceScattering", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "subsurfaceScattering.subsurfaceScatterFactor", - "subsurfaceScattering.useInfluenceMap", - "subsurfaceScattering.scatterColor", - "subsurfaceScattering.scatterDistance", - "subsurfaceScattering.quality" - ] - } - }, - { - "type": "UpdatePropertyVisibility", - "args": { - "actions": [ - { - "triggerProperty": "subsurfaceScattering.enableTransmission", - "triggerValue": true, - "visibility": "Enabled" - }, - { - "triggerProperty": "subsurfaceScattering.enableTransmission", - "triggerValue": false, - "visibility": "Hidden" - } - ], - "affectedProperties": [ - "subsurfaceScattering.thickness", - "subsurfaceScattering.useThicknessMap", - "subsurfaceScattering.transmissionTint", - "subsurfaceScattering.transmissionMode", - "subsurfaceScattering.transmissionScale" - ] + "file": "StandardPBR_EmissiveState.lua" } }, { @@ -2062,30 +1627,24 @@ "file": "StandardPBR_ParallaxState.lua" } }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_Roughness.lua" + } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_SubsurfaceState.lua" + } + }, { "type": "Lua", "args": { "file": "StandardPBR_HandleOpacityDoubleSided.lua" } }, - { - "type": "OverrideDrawList", - "args": { - "triggerProperty": "opacity.mode", - "triggerValue": "Blended", - "shaderIndex": 1, - "drawList": "transparent" - } - }, - { - "type": "OverrideDrawList", - "args": { - "triggerProperty": "opacity.mode", - "triggerValue": "TintedTransparent", - "shaderIndex": 1, - "drawList": "transparent" - } - }, { "type": "Lua", "args": { @@ -2097,6 +1656,12 @@ "args": { "file": "MaterialInputs/DetailMapsCommonFunctor.lua" } + }, + { + "type": "Lua", + "args": { + "file": "StandardPBR_ShaderEnable.lua" + } } ], "uvNameMap": { @@ -2104,3 +1669,4 @@ "UV1": "Unwrapped" } } + diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli index 34af9229c2..b6d6439268 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Common.azsli @@ -108,7 +108,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial // Callback function for ParallaxMapping.azsli DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) { - return SampleDepthOrHeightMap(MaterialSrg::m_depthInverted, MaterialSrg::m_depthMap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); + return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); } COMMON_OPTIONS_PARALLAX() @@ -116,7 +116,7 @@ COMMON_OPTIONS_PARALLAX() bool ShouldHandleParallax() { // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. - return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useDepthMap; + return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; } bool ShouldHandleParallaxInDepthShaders() 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 db99ee7e24..d70e3b899a 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 @@ -77,15 +77,14 @@ PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) if(ShouldHandleParallaxInDepthShaders()) { - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, OUT.m_depth); } 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 a91e88afad..a8b4075d51 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.azsl @@ -117,19 +117,12 @@ VSOutput EnhancedPbr_ForwardPassVS(VSInput IN) PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depth) { // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - - if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering && MaterialSrg::m_parallaxUvIndex != 0) - || (o_normal_useTexture && MaterialSrg::m_normalMapUvIndex != 0) - || (o_clearCoat_enabled && o_clearCoat_normal_useTexture && MaterialSrg::m_clearCoatNormalMapUvIndex != 0) - || (o_detail_normal_useTexture && MaterialSrg::m_detail_allMapsUvIndex != 0)) + if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering) || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture) || o_detail_normal_useTexture) { - // Generate the tangent/bitangent for UV[1+] - const int startIndex = 1; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, startIndex); + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } // ------- Depth & Parallax ------- @@ -148,7 +141,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depth, IN.m_position.w, displacementIsClipped); @@ -260,7 +253,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Convert the angle from [0..1] = [0 .. 180 degrees] to radians [0 .. PI] const float anisotropyAngle = MaterialSrg::m_anisotropicAngle * PI; const float anisotropyFactor = MaterialSrg::m_anisotropicFactor; - surface.anisotropy.Init(surface.normal, tangents[0], bitangents[0], anisotropyAngle, anisotropyFactor, surface.roughnessA); + surface.anisotropy.Init(surface.normal, IN.m_tangent, IN.m_bitangent, anisotropyAngle, anisotropyFactor, surface.roughnessA); } // ------- Lighting Data ------- @@ -274,16 +267,16 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; - // ------- Occlusion ------- - - lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); - lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); - // ------- Emissive ------- float2 emissiveUv = IN.m_uv[MaterialSrg::m_emissiveMapUvIndex]; lightingData.emissiveLighting = GetEmissiveInput(MaterialSrg::m_emissiveMap, MaterialSrg::m_sampler, emissiveUv, MaterialSrg::m_emissiveIntensity, MaterialSrg::m_emissiveColor.rgb, o_emissiveEnabled, o_emissive_useTexture); + // ------- Occlusion ------- + + lightingData.diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_diffuseOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_diffuseOcclusionMapUvIndex], MaterialSrg::m_diffuseOcclusionFactor, o_diffuseOcclusion_useTexture); + lightingData.specularOcclusion = GetOcclusionInput(MaterialSrg::m_specularOcclusionMap, MaterialSrg::m_sampler, IN.m_uv[MaterialSrg::m_specularOcclusionMapUvIndex], MaterialSrg::m_specularOcclusionFactor, o_specularOcclusion_useTexture); + // ------- Clearcoat ------- // [GFX TODO][ATOM-14603]: Clean up the double uses of these clear coat flags diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.shader index 7964e3c84a..a0e9708468 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.shader +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_ForwardPass.shader @@ -31,8 +31,7 @@ }, "CompilerHints" : { - "DisableOptimizations" : true, - "DxcGenerateDebugInfo" : true + "DisableOptimizations" : false }, "ProgramSettings": diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.azsl index 80aedcd6f4..6d3d4f2ea5 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/EnhancedPBR_Shadowmap_WithPS.azsl @@ -80,15 +80,15 @@ PSDepthOutput MainPS(VertexOutput IN, bool isFrontFace : SV_IsFrontFace) { static const float ShadowMapDepthBias = 0.000001; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, OUT.m_depth); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsCommonFunctor.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsCommonFunctor.lua index 15e4b4f416..e1a3dd6f29 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsCommonFunctor.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/DetailMapsCommonFunctor.lua @@ -35,16 +35,16 @@ end function Process(context) local isFeatureEnabled = context:GetMaterialPropertyValue_bool("detailLayerGroup.enableDetailLayer") - local blendMaskTexture = context:GetMaterialPropertyValue_image("detailLayerGroup.blendDetailMask") + local blendMaskTexture = context:GetMaterialPropertyValue_Image("detailLayerGroup.blendDetailMask") local blendMaskTextureEnabled = context:GetMaterialPropertyValue_bool("detailLayerGroup.enableDetailMaskTexture") context:SetShaderOptionValue_bool("o_detail_blendMask_useTexture", isFeatureEnabled and blendMaskTextureEnabled and blendMaskTexture ~= nil) local baseColorDetailEnabled = context:GetMaterialPropertyValue_bool("detailLayerGroup.enableBaseColor") - local baseColorDetailTexture = context:GetMaterialPropertyValue_image("detailLayerGroup.baseColorDetailMap") + local baseColorDetailTexture = context:GetMaterialPropertyValue_Image("detailLayerGroup.baseColorDetailMap") context:SetShaderOptionValue_bool("o_detail_baseColor_useTexture", isFeatureEnabled and baseColorDetailEnabled and baseColorDetailTexture ~= nil) local normalDetailEnabled = context:GetMaterialPropertyValue_bool("detailLayerGroup.enableNormals") - local normalDetailTexture = context:GetMaterialPropertyValue_image("detailLayerGroup.normalDetailMap") + local normalDetailTexture = context:GetMaterialPropertyValue_Image("detailLayerGroup.normalDetailMap") context:SetShaderOptionValue_bool("o_detail_normal_useTexture", isFeatureEnabled and normalDetailEnabled and normalDetailTexture ~= nil) end @@ -78,7 +78,7 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("detailUV.rotateDegrees", mainVisibility) context:SetMaterialPropertyVisibility("detailUV.scale", mainVisibility) - local blendMaskTexture = context:GetMaterialPropertyValue_image("detailLayerGroup.blendDetailMask") + local blendMaskTexture = context:GetMaterialPropertyValue_Image("detailLayerGroup.blendDetailMask") if(nil == blendMaskTexture) then context:SetMaterialPropertyVisibility("detailLayerGroup.enableDetailMaskTexture", MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility("detailLayerGroup.blendDetailMaskUv", MaterialPropertyVisibility_Hidden) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/ParallaxInput.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/ParallaxInput.azsli index ffd7c18045..84d4bfcc02 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/ParallaxInput.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/MaterialInputs/ParallaxInput.azsli @@ -22,15 +22,14 @@ // You can optionally provide a prefix for the set of inputs which corresponds to a prefix string supplied by the .materialtype file. This is common for multi-layered material types. #define COMMON_SRG_INPUTS_PARALLAX(prefix) \ -Texture2D prefix##m_depthMap; \ -float prefix##m_depthFactor; \ -float prefix##m_depthOffset; \ -bool prefix##m_depthInverted; +Texture2D prefix##m_heightmap; \ +float prefix##m_heightmapScale; \ +float prefix##m_heightmapOffset; #define COMMON_OPTIONS_PARALLAX(prefix) \ -option bool prefix##o_useDepthMap; +option bool prefix##o_useHeightmap; -void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float depthFactor, float depthOffset, +void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float heightmapScale, float heightmapOffset, float4x4 objectWorldMatrix, float3x3 uvMatrix, float3x3 uvMatrixInverse, inout float2 uv, inout float3 worldPosition, inout float depthNDC, inout float depthCS, out bool isClipped) { @@ -48,8 +47,8 @@ void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float dep dirToCamera = ViewSrg::m_worldPosition.xyz - worldPosition; } - ParallaxOffset tangentOffset = GetParallaxOffset( depthFactor, - depthOffset, + ParallaxOffset tangentOffset = GetParallaxOffset( heightmapScale, + -heightmapOffset, uv, dirToCamera, tangent, @@ -62,7 +61,7 @@ void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float dep if(o_parallax_enablePixelDepthOffset) { - PixelDepthOffset pdo = CalcPixelDepthOffset(depthFactor, + PixelDepthOffset pdo = CalcPixelDepthOffset(heightmapScale, tangentOffset.m_offsetTS, worldPosition, tangent, @@ -81,19 +80,19 @@ void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float dep } } -void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float depthFactor, float depthOffset, +void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float heightmapScale, float heightmapOffset, float4x4 objectWorldMatrix, float3x3 uvMatrix, float3x3 uvMatrixInverse, inout float2 uv, inout float3 worldPosition, inout float depthNDC, inout float depthCS) { bool isClipped; - GetParallaxInput(normal, tangent, bitangent, depthFactor, depthOffset, objectWorldMatrix, uvMatrix, uvMatrixInverse, uv, worldPosition, depthNDC, depthCS, isClipped); + GetParallaxInput(normal, tangent, bitangent, heightmapScale, heightmapOffset, objectWorldMatrix, uvMatrix, uvMatrixInverse, uv, worldPosition, depthNDC, depthCS, isClipped); } -void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float depthFactor, float depthOffset, +void GetParallaxInput(float3 normal, float3 tangent, float3 bitangent, float heightmapScale, float heightmapOffset, float4x4 objectWorldMatrix, float3x3 uvMatrix, float3x3 uvMatrixInverse, inout float2 uv, inout float3 worldPosition, inout float depthNDC) { float depthCS; - GetParallaxInput(normal, tangent, bitangent, depthFactor, depthOffset, objectWorldMatrix, uvMatrix, uvMatrixInverse, uv, worldPosition, depthNDC, depthCS); + GetParallaxInput(normal, tangent, bitangent, heightmapScale, heightmapOffset, objectWorldMatrix, uvMatrix, uvMatrixInverse, uv, worldPosition, depthNDC, depthCS); } diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl index 84095ac163..4fe1f2b364 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.azsl @@ -101,7 +101,7 @@ struct VSOutput float2 m_uv[UvSetCount] : UV1; float2 m_detailUv : UV3; - float4 m_blendMask : UV8; + float4 m_wrinkleBlendFactors : UV8; }; #include @@ -132,11 +132,11 @@ VSOutput SkinVS(VSInput IN) if(o_blendMask_isBound) { - OUT.m_blendMask = IN.m_optional_blendMask; + OUT.m_wrinkleBlendFactors = IN.m_optional_blendMask; } else { - OUT.m_blendMask = float4(0,1,0,0); + OUT.m_wrinkleBlendFactors = float4(0,0,0,0); } VertexHelper(IN, OUT, worldPosition, false); @@ -180,17 +180,12 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) float3x3 uvMatrix = CreateIdentity3x3(); // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - - if ( (o_normal_useTexture && MaterialSrg::m_normalMapUvIndex != 0) || - (o_detail_normal_useTexture && MaterialSrg::m_detail_allMapsUvIndex != 0)) + if (o_normal_useTexture || o_detail_normal_useTexture) { - // Generate the tangent/bitangent for UV[1+] - const int startIndex = 1; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, startIndex); + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } Surface surface; @@ -214,7 +209,22 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) float2 normalUv = IN.m_uv[MaterialSrg::m_normalMapUvIndex]; float detailLayerNormalFactor = MaterialSrg::m_detail_normal_factor * detailLayerBlendFactor; - + + // ------- Wrinkle Map Setup ------- + + // Combine the optional per-morph target wrinkle masks + float4 wrinkleBlendFactors = float4(0.0, 0.0, 0.0, 0.0); + for(uint wrinkleMaskIndex = 0; wrinkleMaskIndex < ObjectSrg::m_wrinkle_mask_count; ++wrinkleMaskIndex) + { + wrinkleBlendFactors += ObjectSrg::m_wrinkle_masks[wrinkleMaskIndex].Sample(MaterialSrg::m_sampler, normalUv) * ObjectSrg::GetWrinkleMaskWeight(wrinkleMaskIndex); + } + + // If texture based morph target driven masks are being used, use those values instead of the per-vertex colors + if(ObjectSrg::m_wrinkle_mask_count) + { + IN.m_wrinkleBlendFactors = saturate(wrinkleBlendFactors); + } + // Since the wrinkle normal maps should all be in the same tangent space as the main normal map, we should be able to blend the raw normal map // texture values before doing all the tangent space transforms, so we only have to do the transforms once, for better performance. @@ -223,12 +233,12 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) { normalMapSample = SampleNormalXY(MaterialSrg::m_normalMap, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY); } - if(o_wrinkleLayers_enabled && o_blendMask_isBound && o_wrinkleLayers_normal_enabled) + if(o_wrinkleLayers_enabled && o_wrinkleLayers_normal_enabled) { - normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture1, normalMapSample, MaterialSrg::m_wrinkle_normal_texture1, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_blendMask.r); - normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture2, normalMapSample, MaterialSrg::m_wrinkle_normal_texture2, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_blendMask.g); - normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture3, normalMapSample, MaterialSrg::m_wrinkle_normal_texture3, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_blendMask.b); - normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture4, normalMapSample, MaterialSrg::m_wrinkle_normal_texture4, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_blendMask.a); + normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture1, normalMapSample, MaterialSrg::m_wrinkle_normal_texture1, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_wrinkleBlendFactors.r); + normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture2, normalMapSample, MaterialSrg::m_wrinkle_normal_texture2, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_wrinkleBlendFactors.g); + normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture3, normalMapSample, MaterialSrg::m_wrinkle_normal_texture3, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_wrinkleBlendFactors.b); + normalMapSample = ApplyNormalWrinkleMap(o_wrinkleLayers_normal_useTexture4, normalMapSample, MaterialSrg::m_wrinkle_normal_texture4, MaterialSrg::m_sampler, normalUv, MaterialSrg::m_flipNormalX, MaterialSrg::m_flipNormalY, IN.m_wrinkleBlendFactors.a); } if(o_detail_normal_useTexture) @@ -255,7 +265,7 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) float3 baseColor = GetBaseColorInput(MaterialSrg::m_baseColorMap, MaterialSrg::m_sampler, baseColorUv, MaterialSrg::m_baseColor, o_baseColor_useTexture); bool useSampledBaseColor = o_baseColor_useTexture; - if(o_wrinkleLayers_enabled && o_blendMask_isBound && o_wrinkleLayers_baseColor_enabled) + if(o_wrinkleLayers_enabled && o_wrinkleLayers_baseColor_enabled) { // If any of the wrinkle maps are applied, we will use the Base Color blend settings to apply the MaterialSrg::m_baseColor tint to the wrinkle maps, // even if the main base color map is not used. @@ -272,10 +282,10 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) baseColor = float3(1,1,1); } - baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture1, baseColor, MaterialSrg::m_wrinkle_baseColor_texture1, MaterialSrg::m_sampler, baseColorUv, IN.m_blendMask.r); - baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture2, baseColor, MaterialSrg::m_wrinkle_baseColor_texture2, MaterialSrg::m_sampler, baseColorUv, IN.m_blendMask.g); - baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture3, baseColor, MaterialSrg::m_wrinkle_baseColor_texture3, MaterialSrg::m_sampler, baseColorUv, IN.m_blendMask.b); - baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture4, baseColor, MaterialSrg::m_wrinkle_baseColor_texture4, MaterialSrg::m_sampler, baseColorUv, IN.m_blendMask.a); + baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture1, baseColor, MaterialSrg::m_wrinkle_baseColor_texture1, MaterialSrg::m_sampler, baseColorUv, IN.m_wrinkleBlendFactors.r); + baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture2, baseColor, MaterialSrg::m_wrinkle_baseColor_texture2, MaterialSrg::m_sampler, baseColorUv, IN.m_wrinkleBlendFactors.g); + baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture3, baseColor, MaterialSrg::m_wrinkle_baseColor_texture3, MaterialSrg::m_sampler, baseColorUv, IN.m_wrinkleBlendFactors.b); + baseColor = ApplyBaseColorWrinkleMap(o_wrinkleLayers_baseColor_useTexture4, baseColor, MaterialSrg::m_wrinkle_baseColor_texture4, MaterialSrg::m_sampler, baseColorUv, IN.m_wrinkleBlendFactors.a); } @@ -283,13 +293,13 @@ PbrLightingOutput SkinPS_Common(VSOutput IN) baseColor = ApplyTextureOverlay(o_detail_baseColor_useTexture, baseColor, MaterialSrg::m_detail_baseColor_texture, MaterialSrg::m_sampler, IN.m_detailUv, detailLayerBaseColorFactor); - if(o_wrinkleLayers_enabled && o_wrinkleLayers_showBlendMaskValues && o_blendMask_isBound) + if(o_wrinkleLayers_enabled && o_wrinkleLayers_showBlendMaskValues) { // Overlay debug colors to highlight the different blend weights coming from the vertex color stream. - if(o_wrinkleLayers_count > 0) { baseColor = lerp(baseColor, float3(1,0,0), IN.m_blendMask.r); } - if(o_wrinkleLayers_count > 1) { baseColor = lerp(baseColor, float3(0,1,0), IN.m_blendMask.g); } - if(o_wrinkleLayers_count > 2) { baseColor = lerp(baseColor, float3(0,0,1), IN.m_blendMask.b); } - if(o_wrinkleLayers_count > 3) { baseColor = lerp(baseColor, float3(1,1,1), IN.m_blendMask.a); } + if(o_wrinkleLayers_count > 0) { baseColor = lerp(baseColor, float3(1,0,0), IN.m_wrinkleBlendFactors.r); } + if(o_wrinkleLayers_count > 1) { baseColor = lerp(baseColor, float3(0,1,0), IN.m_wrinkleBlendFactors.g); } + if(o_wrinkleLayers_count > 2) { baseColor = lerp(baseColor, float3(0,0,1), IN.m_wrinkleBlendFactors.b); } + if(o_wrinkleLayers_count > 3) { baseColor = lerp(baseColor, float3(1,1,1), IN.m_wrinkleBlendFactors.a); } } // ------- Specular ------- diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype index b8951d69c7..f8c49d579c 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin.materialtype @@ -287,6 +287,13 @@ "id": "m_specularF0Map" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the texture map, or just default to the Factor value.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", @@ -299,13 +306,7 @@ "id": "m_specularF0MapUvIndex" } }, - { - "id": "useTexture", - "displayName": "Use Texture", - "description": "Whether to use the texture map, or just default to the Factor value.", - "type": "Bool", - "defaultValue": true - }, + // Consider moving this to the "general" group to be consistent with StandardMultilayerPBR { "id": "enableMultiScatterCompensation", "displayName": "Multiscattering Compensation", @@ -616,7 +617,7 @@ "type": "float", "defaultValue": 6.0, "min": 0.0, - "softMax": 20.0 + "softMax": 20.0 }, { "id": "transmissionDistortion", @@ -909,7 +910,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -987,15 +988,6 @@ { "file": "Shaders/MotionVector/SkinnedMeshMotionVector.shader", "tag": "SkinnedMeshMotionVector" - }, - // Used by the light culling system to produce accurate depth bounds for this object when it uses blended transparency - { - "file": "Shaders/Depth/DepthPassTransparentMin.shader", - "tag": "DepthPassTransparentMin" - }, - { - "file": "Shaders/Depth/DepthPassTransparentMax.shader", - "tag": "DepthPassTransparentMax" } ], "functors": [ @@ -1020,18 +1012,18 @@ "type": "HandleSubsurfaceScatteringParameters", "args": { "mode": "subsurfaceScattering.transmissionMode", - "scale" : "subsurfaceScattering.transmissionScale", - "power" : "subsurfaceScattering.transmissionPower", - "distortion" : "subsurfaceScattering.transmissionDistortion", - "attenuation" : "subsurfaceScattering.transmissionAttenuation", - "tintColor" : "subsurfaceScattering.transmissionTint", - "thickness" : "subsurfaceScattering.thickness", + "scale": "subsurfaceScattering.transmissionScale", + "power": "subsurfaceScattering.transmissionPower", + "distortion": "subsurfaceScattering.transmissionDistortion", + "attenuation": "subsurfaceScattering.transmissionAttenuation", + "tintColor": "subsurfaceScattering.transmissionTint", + "thickness": "subsurfaceScattering.thickness", "enabled": "subsurfaceScattering.enableSubsurfaceScattering", - "scatterDistanceColor" : "subsurfaceScattering.scatterColor", - "scatterDistanceIntensity" : "subsurfaceScattering.scatterDistance", - "scatterDistanceShaderInput" : "m_scatterDistance", - "parametersShaderInput" : "m_transmissionParams", - "tintThickenssShaderInput" : "m_transmissionTintThickness" + "scatterDistanceColor": "subsurfaceScattering.scatterColor", + "scatterDistanceIntensity": "subsurfaceScattering.scatterDistance", + "scatterDistanceShaderInput": "m_scatterDistance", + "parametersShaderInput": "m_transmissionParams", + "tintThickenssShaderInput": "m_transmissionTintThickness" } }, { @@ -1047,8 +1039,8 @@ "type": "UseTexture", "args": { "textureProperty": "specularF0.textureMap", - "dependentProperties": ["specularF0.textureMapUv"], "useTextureProperty": "specularF0.useTexture", + "dependentProperties": ["specularF0.textureMapUv"], "shaderOption": "o_specularF0_useTexture" } }, diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_WrinkleMaps.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_WrinkleMaps.lua index d77918f521..9e1bc3763a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_WrinkleMaps.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/Skin_WrinkleMaps.lua @@ -65,8 +65,8 @@ function Process(context) for i=1,MAX_WRINKLE_LAYER_COUNT do if(i <= count) then - isBaseColorTextureMissing = isBaseColorEnabled and nil == context:GetMaterialPropertyValue_image("wrinkleLayers.baseColorMap" .. i) - isNormalTextureMissing = isNormalEnabled and nil == context:GetMaterialPropertyValue_image("wrinkleLayers.normalMap" .. i) + isBaseColorTextureMissing = isBaseColorEnabled and nil == context:GetMaterialPropertyValue_Image("wrinkleLayers.baseColorMap" .. i) + isNormalTextureMissing = isNormalEnabled and nil == context:GetMaterialPropertyValue_Image("wrinkleLayers.normalMap" .. i) context:SetShaderOptionValue_bool("o_wrinkleLayers_baseColor_useTexture" .. i, not isBaseColorTextureMissing) context:SetShaderOptionValue_bool("o_wrinkleLayers_normal_useTexture" .. i, not isNormalTextureMissing) else diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR.materialtype index e2119dcf12..ca6cb77b0a 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR.materialtype @@ -3,11 +3,6 @@ "propertyLayout": { "version": 3, "groups": [ - { - "id": "general", - "displayName": "General", - "description": "General settings." - }, { "id": "blend", "displayName": "Blend Settings", @@ -23,17 +18,17 @@ "displayName": "UVs", "description": "Properties for configuring UV transforms for the entire material, including the blend masks." }, - { - "id": "subsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Properties for configuring subsurface scattering effects." - }, { // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader "id": "irradiance", "displayName": "Irradiance", "description": "Properties for configuring the irradiance used in global illumination." }, + { + "id": "general", + "displayName": "General", + "description": "General settings." + }, //############################################################################################## // Layer 1 Groups //############################################################################################## @@ -79,8 +74,8 @@ }, { "id": "layer1_parallax", - "displayName": "Layer 1: Parallax Mapping", - "description": "Properties for parallax effect produced by depthmap." + "displayName": "Layer 1: Displacement", + "description": "Properties for surface displacement, which can be used for displacement-based blending and/or a parallax effect." }, { "id": "layer1_uv", @@ -132,8 +127,8 @@ }, { "id": "layer2_parallax", - "displayName": "Layer 2: Parallax Mapping", - "description": "Properties for parallax effect produced by depthmap." + "displayName": "Layer 2: Displacement", + "description": "Properties for surface displacement, which can be used for displacement-based blending and/or a parallax effect." }, { "id": "layer2_uv", @@ -185,8 +180,8 @@ }, { "id": "layer3_parallax", - "displayName": "Layer 3: Parallax Mapping", - "description": "Properties for parallax effect produced by depthmap." + "displayName": "Layer 3: Displacement", + "description": "Properties for surface displacement, which can be used for displacement-based blending and/or a parallax effect." }, { "id": "layer3_uv", @@ -199,18 +194,6 @@ // General Properties //############################################################################################## "general": [ - { - "id": "debugDrawMode", - "displayName": "Debug Draw Mode", - "description": "Enables various debug view features.", - "type": "Enum", - "enumValues": [ "None", "BlendMaskValues", "DepthMaps" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "id": "o_debugDrawMode" - } - }, { "id": "applySpecularAA", "displayName": "Apply Specular AA", @@ -300,21 +283,43 @@ } ], "blend": [ + { + "id": "enableLayer2", + "displayName": "Enable Layer 2", + "description": "Whether to enable layer 2.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "id": "o_layer2_enabled" + } + }, + { + "id": "enableLayer3", + "displayName": "Enable Layer 3", + "description": "Whether to enable layer 3.", + "type": "Bool", + "defaultValue": false, + "connection": { + "type": "ShaderOption", + "id": "o_layer3_enabled" + } + }, { "id": "blendSource", "displayName": "Blend Source", "description": "The source to use for defining the blend mask. Note VertexColors mode will still use the texture as a fallback if the mesh does not have a COLOR0 stream.", "type": "Enum", - "enumValues": ["TextureMap", "VertexColors"], - "defaultValue": "TextureMap", + "enumValues": ["BlendMaskTexture", "BlendMaskVertexColors", "Displacement", "Displacement_With_BlendMaskTexture", "Displacement_With_BlendMaskVertexColors"], + "defaultValue": "BlendMaskTexture", "connection": { "type": "ShaderOption", - "id": "o_blendSource" + "id": "o_layerBlendSource" } }, { "id": "textureMap", - "displayName": "Blend Mask", + "displayName": "Blend Mask Texture", "description": "RGB image where each channel is the blend mask for one of the three available layers.", "type": "Image", "defaultValue": "Textures/DefaultBlendMask_layers.png", @@ -334,15 +339,44 @@ "type": "ShaderInput", "id": "m_blendMaskUvIndex" } + }, + { + "id": "displacementBlendDistance", + "displayName": "Blend Distance", + "description": "Adjusts how smoothly to transition between layers when displacement blending is enabled.", + "type": "Float", + "defaultValue": 0.0, + "min": 0.0, + "softMax": 0.1, + "step": 0.001, + "connection": { + "type": "ShaderInput", + "id": "m_displacementBlendDistance" + } + }, + { + "id": "debugDrawMode", + "displayName": "Debug Draw Mode", + "description": "Enables various debug view features.", + "type": "Enum", + "enumValues": [ "None", "BlendMask", "Displacement", "FinalBlendWeights" ], + "defaultValue": "None", + "connection": { + "type": "ShaderOption", + "id": "o_debugDrawMode" + } } ], "parallax": [ { + // Note parallax is enabled by default so that as soon as a user hooks up displacement settings they will see some parallax applied. + // The functor that controls parallax will set o_parallax_feature_enabled=false when all the individual layers have no displacement, so + // a default value of true here will not have any initial impact on performance. "id": "enable", "displayName": "Enable", "description": "Whether to enable the parallax feature for this material.", "type": "Bool", - "defaultValue": false + "defaultValue": true }, { "id": "parallaxUv", @@ -374,7 +408,7 @@ "description": "Quality of parallax mapping.", "type": "Enum", "enumValues": [ "Low", "Medium", "High", "Ultra" ], - "defaultValue": "Medium", + "defaultValue": "Low", "connection": { "type": "ShaderOption", "id": "o_parallax_quality" @@ -410,7 +444,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -467,183 +501,6 @@ "step": 0.1 } ], - "subsurfaceScattering": [ - { - "id": "enableSubsurfaceScattering", - "displayName": "Subsurface Scattering", - "description": "Enable subsurface scattering feature, this will disable metallic and parallax mapping property due to incompatibility", - "type": "Bool", - "defaultValue": false, - "connection": { - "type": "ShaderOption", - "id": "o_enableSubsurfaceScattering" - } - }, - { - "id": "subsurfaceScatterFactor", - "displayName": " Factor", - "description": "Strength factor for scaling percentage of subsurface scattering effect applied", - "type": "float", - "defaultValue": 1.0, - "min": 0.0, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "id": "m_subsurfaceScatteringFactor" - } - }, - { - "id": "influenceMap", - "displayName": " Influence Map", - "description": "Use texture map to control the strength of subsurface scattering", - "type": "Image", - "connection": { - "type": "ShaderInput", - "id": "m_subsurfaceScatteringInfluenceMap" - } - }, - { - "id": "useInfluenceMap", - "displayName": " Use Influence Map", - "description": "Whether to use the texture map as influence mask.", - "type": "Bool", - "defaultValue": true - }, - { - "id": "influenceMapUv", - "displayName": " UV", - "description": "Influence map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "id": "m_subsurfaceScatteringInfluenceMapUvIndex" - } - }, - { - "id": "scatterColor", - "displayName": " Scatter color", - "description": "Color of volume light traveled through", - "type": "Color", - "defaultValue": [ 1.0, 0.27, 0.13 ] - }, - { - "id": "scatterDistance", - "displayName": " Scatter distance", - "description": "How far light traveled inside the volume", - "type": "float", - "defaultValue": 8, - "min": 0.0, - "softMax": 20.0 - }, - { - "id": "quality", - "displayName": " Quality", - "description": "How much percent of sample will be used for each pixel, more samples improve quality and reduce artifacts, especially when the scatter distance is relatively large, but slow down computation time, 1.0 = full set 200 samples per pixel", - "type": "float", - "defaultValue": 0.4, - "min": 0.2, - "max": 1.0, - "connection": { - "type": "ShaderInput", - "id": "m_subsurfaceScatteringQuality" - } - }, - { - "id": "transmissionMode", - "displayName": "Transmission", - "description": "Algorithm used for calculating transmission", - "type": "Enum", - "enumValues": [ "None", "ThickObject", "ThinObject" ], - "defaultValue": "None", - "connection": { - "type": "ShaderOption", - "id": "o_transmission_mode" - } - }, - { - "id": "thickness", - "displayName": " Thickness", - "description": "Normalized global thickness, the maxima between this value (multiplied by thickness map if enabled) and thickness from shadow map (if applicable) will be used as final thickness of pixel", - "type": "float", - "defaultValue": 0.5, - "min": 0.0, - "max": 1.0 - }, - { - "id": "thicknessMap", - "displayName": " Thickness Map", - "description": "Use a greyscale texture for per pixel thickness", - "type": "Image", - "connection": { - "type": "ShaderInput", - "id": "m_transmissionThicknessMap" - } - }, - { - "id": "useThicknessMap", - "displayName": " Use Thickness Map", - "description": "Whether to use the thickness map", - "type": "Bool", - "defaultValue": true - }, - { - "id": "thicknessMapUv", - "displayName": " UV", - "description": "Thickness map UV set", - "type": "Enum", - "enumIsUv": true, - "defaultValue": "Tiled", - "connection": { - "type": "ShaderInput", - "id": "m_transmissionThicknessMapUvIndex" - } - }, - { - "id": "transmissionTint", - "displayName": " Transmission Tint", - "description": "Color of the volume light travelling through", - "type": "Color", - "defaultValue": [ 1.0, 0.8, 0.6 ] - }, - { - "id": "transmissionPower", - "displayName": " Power", - "description": "How much transmitted light scatter radially ", - "type": "float", - "defaultValue": 6.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "id": "transmissionDistortion", - "displayName": " Distortion", - "description": "How much light direction distorted towards surface normal", - "type": "float", - "defaultValue": 0.1, - "min": 0.0, - "max": 1.0 - }, - { - "id": "transmissionAttenuation", - "displayName": " Attenuation", - "description": "How fast transmitted light fade with thickness", - "type": "float", - "defaultValue": 4.0, - "min": 0.0, - "softMax": 20.0 - }, - { - "id": "transmissionScale", - "displayName": " Scale", - "description": "Strength of transmission", - "type": "float", - "defaultValue": 3.0, - "min": 0.0, - "softMax": 20.0 - } - ], "irradiance": [ // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader { @@ -1250,34 +1107,34 @@ } ], "layer1_parallax": [ - { - "id": "enable", - "displayName": "Enable", - "description": "Whether to enable the parallax feature.", - "type": "Bool", - "defaultValue": false - }, { "id": "textureMap", - "displayName": "Texture Map", - "description": "Depthmap to create parallax effect.", + "displayName": "Heightmap", + "description": "Displacement heightmap, which can be used for layer blending and/or a parallax effect.", "type": "Image", "connection": { "type": "ShaderInput", - "id": "m_layer1_m_depthMap" + "id": "m_layer1_m_heightmap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the heightmap.", + "type": "Bool", + "defaultValue": true + }, { "id": "factor", - "displayName": "Heightmap Scale", + "displayName": "Scale", "description": "The total height of the heightmap in local model units.", "type": "Float", - "defaultValue": 0.0, + "defaultValue": 0.05, "min": 0.0, "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer1_m_depthFactor" + "id": "m_layer1_m_heightmapScale" } }, { @@ -1290,18 +1147,7 @@ "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer1_m_depthOffset" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_layer1_m_depthInverted" + "id": "m_layer1_m_heightmapOffset" } } ], @@ -1312,7 +1158,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -1956,34 +1802,34 @@ } ], "layer2_parallax": [ - { - "id": "enable", - "displayName": "Enable", - "description": "Whether to enable the parallax feature.", - "type": "Bool", - "defaultValue": false - }, { "id": "textureMap", - "displayName": "Texture Map", - "description": "Depthmap to create parallax effect.", + "displayName": "Heightmap", + "description": "Displacement heightmap, which can be used for layer blending and/or a parallax effect.", "type": "Image", "connection": { "type": "ShaderInput", - "id": "m_layer2_m_depthMap" + "id": "m_layer2_m_heightmap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the heightmap.", + "type": "Bool", + "defaultValue": true + }, { "id": "factor", - "displayName": "Heightmap Scale", + "displayName": "Scale", "description": "The total height of the heightmap in local model units.", "type": "Float", - "defaultValue": 0.0, + "defaultValue": 0.05, "min": 0.0, "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer2_m_depthFactor" + "id": "m_layer2_m_heightmapScale" } }, { @@ -1996,18 +1842,7 @@ "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer2_m_depthOffset" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_layer2_m_depthInverted" + "id": "m_layer2_m_heightmapOffset" } } ], @@ -2018,7 +1853,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -2662,34 +2497,34 @@ } ], "layer3_parallax": [ - { - "id": "enable", - "displayName": "Enable", - "description": "Whether to enable the parallax feature.", - "type": "Bool", - "defaultValue": false - }, { "id": "textureMap", - "displayName": "Texture Map", - "description": "Depthmap to create parallax effect.", + "displayName": "Heightmap", + "description": "Displacement heightmap, which can be used for layer blending and/or a parallax effect.", "type": "Image", "connection": { "type": "ShaderInput", - "id": "m_layer3_m_depthMap" + "id": "m_layer3_m_heightmap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the heightmap.", + "type": "Bool", + "defaultValue": true + }, { "id": "factor", - "displayName": "Heightmap Scale", + "displayName": "Scale", "description": "The total height of the heightmap in local model units.", "type": "Float", - "defaultValue": 0.0, + "defaultValue": 0.05, "min": 0.0, "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer3_m_depthFactor" + "id": "m_layer3_m_heightmapScale" } }, { @@ -2702,18 +2537,7 @@ "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_layer3_m_depthOffset" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_layer3_m_depthInverted" + "id": "m_layer3_m_heightmapOffset" } } ], @@ -2724,7 +2548,7 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", @@ -2845,22 +2669,9 @@ } }, { - // Preprocess & build parameter set for subsurface scattering and translucency - "type": "HandleSubsurfaceScatteringParameters", + "type": "Lua", "args": { - "mode": "subsurfaceScattering.transmissionMode", - "scale" : "subsurfaceScattering.transmissionScale", - "power" : "subsurfaceScattering.transmissionPower", - "distortion" : "subsurfaceScattering.transmissionDistortion", - "attenuation" : "subsurfaceScattering.transmissionAttenuation", - "tintColor" : "subsurfaceScattering.transmissionTint", - "thickness" : "subsurfaceScattering.thickness", - "enabled": "subsurfaceScattering.enableSubsurfaceScattering", - "scatterDistanceColor" : "subsurfaceScattering.scatterColor", - "scatterDistanceIntensity" : "subsurfaceScattering.scatterDistance", - "scatterDistanceShaderInput" : "m_scatterDistance", - "parametersShaderInput" : "m_transmissionParams", - "tintThickenssShaderInput" : "m_transmissionTintThickness" + "file": "StandardMultilayerPBR_LayerEnable.lua" } }, { @@ -2872,13 +2683,7 @@ { "type": "Lua", "args": { - "file": "StandardMultilayerPBR_Parallax.lua" - } - }, - { - "type": "Lua", - "args": { - "file": "StandardPBR_SubsurfaceState.lua" + "file": "StandardMultilayerPBR_Displacement.lua" } }, //############################################################################################## @@ -2995,12 +2800,12 @@ } }, { - "type": "Lua", + "type": "UseTexture", "args": { - "file": "StandardMultilayerPBR_ParallaxPerLayer.lua", - "propertyNamePrefix": "layer1_", - "srgNamePrefix": "m_layer1_", - "optionsNamePrefix": "o_layer1_" + "textureProperty": "layer1_parallax.textureMap", + "useTextureProperty": "layer1_parallax.useTexture", + "dependentProperties": ["layer1_parallax.factor"], + "shaderOption": "o_layer1_o_useHeightmap" } }, { @@ -3132,12 +2937,12 @@ } }, { - "type": "Lua", + "type": "UseTexture", "args": { - "file": "StandardMultilayerPBR_ParallaxPerLayer.lua", - "propertyNamePrefix": "layer2_", - "srgNamePrefix": "m_layer2_", - "optionsNamePrefix": "o_layer2_" + "textureProperty": "layer2_parallax.textureMap", + "useTextureProperty": "layer2_parallax.useTexture", + "dependentProperties": ["layer2_parallax.factor"], + "shaderOption": "o_layer2_o_useHeightmap" } }, { @@ -3269,14 +3074,14 @@ } }, { - "type": "Lua", + "type": "UseTexture", "args": { - "file": "StandardMultilayerPBR_ParallaxPerLayer.lua", - "propertyNamePrefix": "layer3_", - "srgNamePrefix": "m_layer3_", - "optionsNamePrefix": "o_layer3_" + "textureProperty": "layer3_parallax.textureMap", + "useTextureProperty": "layer3_parallax.useTexture", + "dependentProperties": ["layer3_parallax.factor"], + "shaderOption": "o_layer3_o_useHeightmap" } - }, + }, { // Maps 2D scale, offset, and rotate properties into a float3x3 transform matrix. "type": "Transform2D", diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Common.azsli index ba0eaf2ac1..1750da5020 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Common.azsli @@ -15,6 +15,7 @@ #include #include #include +#include #include "MaterialInputs/BaseColorInput.azsli" #include "MaterialInputs/RoughnessInput.azsli" @@ -45,6 +46,16 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial Texture2D m_blendMaskTexture; uint m_blendMaskUvIndex; + // When parallax mapping is used, these limit the heightmap intersection search range to the narrowest band possible, to give the best quality result. + // These are also support other calculations related to displacement-based blending, even when parallax is not used. + float m_displacementMin; // The lowest displacement value possible from all layers combined (negative values are below the surface) + float m_displacementMax; // The highest displacement value possible from all layers combined (negative values are below the surface) + + // When displacement-based blending is used, this is the height range where the surface properties of different layers will be blended together. + // We use an absolute value rather than a relative factor because disconnecting this property from the influence of other properties makes per-layer + // displacement adjustments feel more natural if they don't impact the blend distance. + float m_displacementBlendDistance; + // Auto-generate material SRG fields for common inputs for each layer DEFINE_LAYER_SRG_INPUTS(m_layer1_) DEFINE_LAYER_SRG_INPUTS(m_layer2_) @@ -61,10 +72,6 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial uint m_parallaxUvIndex; - // These are used to limit the heightmap intersection search range to the narrowest band possible, to give the best quality result. - float m_displacementMin; // The lowest displacement value possible from all layers combined - float m_displacementMax; // The highest displacement value possible from all layers combined - float3x3 m_uvMatrix; float4 m_pad4; // [GFX TODO][ATOM-14595] This is a workaround for a data stomping bug. Remove once it's fixed. float3x3 m_uvMatrixInverse; @@ -91,33 +98,18 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial MipFilter = Linear; }; - // Parameters for subsurface scattering - float m_subsurfaceScatteringFactor; - float m_subsurfaceScatteringQuality; - float3 m_scatterDistance; - Texture2D m_subsurfaceScatteringInfluenceMap; - uint m_subsurfaceScatteringInfluenceMapUvIndex; - - // Parameters for transmission - - // Elements of m_transmissionParams: - // Thick object mode: (attenuation coefficient, power, distortion, scale) - // Thin object mode: (float3 scatter distance, scale) - float4 m_transmissionParams; - - // (float3 TintColor, thickness) - float4 m_transmissionTintThickness; - Texture2D m_transmissionThicknessMap; - uint m_transmissionThicknessMapUvIndex; } // ------ Shader Options ---------------------------------------- -enum class DebugDrawMode { None, BlendMaskValues, DepthMaps }; +option bool o_layer2_enabled; +option bool o_layer3_enabled; + +enum class DebugDrawMode { None, BlendMask, Displacement, FinalBlendWeights }; option DebugDrawMode o_debugDrawMode; -enum class BlendMaskSource { TextureMap, VertexColors, Fallback }; -option BlendMaskSource o_blendSource; +enum class LayerBlendSource { BlendMaskTexture, BlendMaskVertexColors, Displacement, Displacement_With_BlendMaskTexture, Displacement_With_BlendMaskVertexColors, Fallback }; +option LayerBlendSource o_layerBlendSource; // Indicates whether the vertex input struct's "m_optional_blendMask" is bound. If false, it is not safe to read from m_optional_blendMask. // This option gets set automatically by the system at runtime; there is a soft naming convention that associates it with m_optional_blendMask. @@ -126,65 +118,242 @@ option BlendMaskSource o_blendSource; option bool o_blendMask_isBound; // ------ Blend Utilities ---------------------------------------- +// This is mainly used to pass extra data to the GetDepth callback function during the parallax depth search. +// But since we have it, we use it in some other functions as well rather than passing it around. +static float3 s_blendMaskFromVertexStream; -//! Returns the BlendMaskSource that will actually be used when rendering (not necessarily the same BlendMaskSource specified by the user) -BlendMaskSource GetFinalBlendMaskSource() +// TODO: Consider storing the result of GetFinalLayerBlendSource() in a static similar to s_blendMaskFromVertexStream. That might give better performance when variants aren't used. + +//! Returns the LayerBlendSource that will actually be used when rendering (not necessarily the same LayerBlendSource specified by the user) +LayerBlendSource GetFinalLayerBlendSource() { - if(o_blendSource == BlendMaskSource::TextureMap) + if(o_layerBlendSource == LayerBlendSource::BlendMaskTexture) { - return BlendMaskSource::TextureMap; + return o_layerBlendSource; } - else if(o_blendSource == BlendMaskSource::VertexColors) + else if(o_layerBlendSource == LayerBlendSource::BlendMaskVertexColors) { if(o_blendMask_isBound) { - return BlendMaskSource::VertexColors; + return o_layerBlendSource; } else { - return BlendMaskSource::TextureMap; + return LayerBlendSource::Fallback; + } + } + else if(o_layerBlendSource == LayerBlendSource::Displacement) + { + return o_layerBlendSource; + } + else if(o_layerBlendSource == LayerBlendSource::Displacement_With_BlendMaskTexture) + { + return o_layerBlendSource; + } + else if(o_layerBlendSource == LayerBlendSource::Displacement_With_BlendMaskVertexColors) + { + if(o_blendMask_isBound) + { + return o_layerBlendSource; + } + else + { + return LayerBlendSource::Displacement; } } else { - return BlendMaskSource::Fallback; + return LayerBlendSource::Fallback; } } -//! Return the final blend mask values to be used for rendering, based on the available data and configuration. -float3 GetBlendMaskValues(float2 uv, float3 vertexBlendMask) +//! Return the applicable blend mask values from the blend mask texture or vertex colors, and filters out any that don't apply. +//! layer1 is an implicit base layer +//! layer2 mask is in the r channel +//! layer3 mask is in the g channel +//! b is reserved for perhaps a dedicated puddle layer +//! @param blendSource indicates where to get the blend mask from +//! @param blendMaskUv for sampling a blend mask texture, if that's the blend source +//! @param blendMaskVertexColors the vertex color values to use for the blend mask, if that's the blend source +//! @return the blend mask values, or 0 if there is no blend mask +float3 GetApplicableBlendMaskValues(LayerBlendSource blendSource, float2 blendMaskUv, float3 blendMaskVertexColors) { - float3 blendMaskValues; + float3 blendSourceValues = float3(0,0,0); - switch(GetFinalBlendMaskSource()) + if(o_layer2_enabled || o_layer3_enabled) { - case BlendMaskSource::TextureMap: - blendMaskValues = MaterialSrg::m_blendMaskTexture.Sample(MaterialSrg::m_sampler, uv).rgb; - break; - case BlendMaskSource::VertexColors: - blendMaskValues = vertexBlendMask; - break; - case BlendMaskSource::Fallback: - blendMaskValues = float3(1,1,1); - break; + switch(blendSource) + { + case LayerBlendSource::Displacement: + // In this case the blend mask has no effect, returning (1,1,1) disables any impact of the mask. + blendSourceValues = float3(1,1,1); + break; + case LayerBlendSource::BlendMaskTexture: + case LayerBlendSource::Displacement_With_BlendMaskTexture: + blendSourceValues = MaterialSrg::m_blendMaskTexture.Sample(MaterialSrg::m_sampler, blendMaskUv).rgb; + break; + case LayerBlendSource::BlendMaskVertexColors: + case LayerBlendSource::Displacement_With_BlendMaskVertexColors: + blendSourceValues = blendMaskVertexColors; + break; + } + + if(!o_layer2_enabled) + { + blendSourceValues.r = 0.0; + } + + if(!o_layer3_enabled) + { + blendSourceValues.g = 0.0; + } } - blendMaskValues = blendMaskValues / (blendMaskValues.r + blendMaskValues.g + blendMaskValues.b); - - return blendMaskValues; + return blendSourceValues; } -float BlendLayers(float layer1, float layer2, float layer3, float3 blendMaskValues) +//! When dealing with masks for displacement-based blending, we sometimes need to push the value below the min displacement to make it disappear. +float GetSubMinDisplacement() { - return dot(float3(layer1, layer2, layer3), blendMaskValues); + return MaterialSrg::m_displacementMin - 0.001; + //return MaterialSrg::m_displacementMin - max(MaterialSrg::m_displacementBlendDistance, 0.001); } -float2 BlendLayers(float2 layer1, float2 layer2, float2 layer3, float3 blendMaskValues) + +float3 ApplyBlendMaskToDepthValues(float3 blendMaskValues, float3 layerDepthValues, float zeroMaskDisplacement); + +//! Return the final blend weights to be used for rendering, based on the available data and configuration. +//! @param blendSource - indicates where to get the blend mask from +//! @param blendMaskValues - blend mask values as returned by GetApplicableBlendMaskValues() +//! @param layerDepthValues - the depth values for each layer, used if the blend source includes displacement. See GetLayerDepthValues(). +//! Note the blendMaskValues will not be applied here, those should have already been applied to layerDepthValues. +//! @param layerDepthBlendDistance - controls how smoothly to blend layers 2 and 3 with the base layer, when the blend source includes displacement. +//! When layers are close together their weights will be blended together, otherwise the highest layer will have the full weight. +//! @return The blend weights for each layer. +//! Even though layer1 not explicitly specified in the blend mask data, it is explicitly included with the returned values. +//! layer1 = r +//! layer2 = g +//! layer3 = b +float3 GetBlendWeights(LayerBlendSource blendSource, float3 blendMaskValues, float3 layerDepthValues, float layerDepthBlendDistance) { - return layer1 * blendMaskValues.r + layer2 * blendMaskValues.g + layer3 * blendMaskValues.b; + float3 blendWeights; + + if(o_layer2_enabled || o_layer3_enabled) + { + if(LayerBlendSource::Displacement == blendSource || + LayerBlendSource::Displacement_With_BlendMaskTexture == blendSource || + LayerBlendSource::Displacement_With_BlendMaskVertexColors == blendSource) + { + // Calculate the blend weights based on displacement values... + + // The inputs are depth values, but we change them to height values to make the code a bit more intuitive. + float3 layerHeightValues = -layerDepthValues; + + float highestPoint = layerHeightValues.x; + if(o_layer2_enabled) + { + highestPoint = max(highestPoint, layerHeightValues.y); + } + if(o_layer3_enabled) + { + highestPoint = max(highestPoint, layerHeightValues.z); + } + + if(layerDepthBlendDistance > 0.0001) + { + float lowestVisiblePoint = highestPoint - layerDepthBlendDistance; + blendWeights = smoothstep(lowestVisiblePoint, highestPoint, layerHeightValues); + + if(!o_layer2_enabled) + { + blendWeights.y = 0.0; + } + + if(!o_layer3_enabled) + { + blendWeights.z = 0.0; + } + } + else + { + blendWeights = float3(layerHeightValues.x >= highestPoint ? 1.0 : 0.0, + layerHeightValues.y >= highestPoint && o_layer2_enabled ? 1.0 : 0.0, + layerHeightValues.z >= highestPoint && o_layer3_enabled ? 1.0 : 0.0); + } + + // Calculate blend weights such that multiplying and adding them with layer data is equivalent + // to lerping between each layer. + // final = lerp(final, layer1, blendWeights.r) + // final = lerp(final, layer2, blendWeights.g) + // final = lerp(final, layer3, blendWeights.b) + + blendWeights.y = (1 - blendWeights.z) * blendWeights.y; + blendWeights.x = 1 - blendWeights.y - blendWeights.z; + } + else + { + // Calculate blend weights such that multiplying and adding them with layer data is equivalent + // to lerping between each layer. + // final = lerp(final, layer1, blendWeights.r) + // final = lerp(final, layer2, blendWeights.g) + // final = lerp(final, layer3, blendWeights.b) + + blendWeights.b = blendMaskValues.g; + blendWeights.g = (1.0 - blendMaskValues.g) * blendMaskValues.r; + blendWeights.r = (1.0 - blendMaskValues.g) * (1.0 - blendMaskValues.r); + } + + } + else + { + blendWeights = float3(1,0,0); + } + + return blendWeights; } -float3 BlendLayers(float3 layer1, float3 layer2, float3 layer3, float3 blendMaskValues) + +float3 GetLayerDepthValues(float2 uv, float2 uv_ddx, float2 uv_ddy); + +//! Return the final blend weights to be used for rendering, based on the available data and configuration. +//! Note this will sample the displacement maps in the case of LayerBlendSource::Displacement. If you have already +//! the layer depth values, use the GetBlendWeights() overload that takes layerDepthValues instead. +float3 GetBlendWeights(LayerBlendSource blendSource, float2 uv, float3 blendMaskVertexColors) { - return layer1 * blendMaskValues.r + layer2 * blendMaskValues.g + layer3 * blendMaskValues.b; + float3 layerDepthValues = float3(0,0,0); + + float3 blendMaskValues = GetApplicableBlendMaskValues(blendSource, uv, blendMaskVertexColors); + + if(blendSource == LayerBlendSource::Displacement || + blendSource == LayerBlendSource::Displacement_With_BlendMaskTexture || + blendSource == LayerBlendSource::Displacement_With_BlendMaskVertexColors) + { + bool useBlendMask = + LayerBlendSource::Displacement_With_BlendMaskTexture == blendSource || + LayerBlendSource::Displacement_With_BlendMaskVertexColors == blendSource; + + layerDepthValues = GetLayerDepthValues(uv, ddx_fine(uv), ddy_fine(uv)); + + if(useBlendMask) + { + // Unlike the GetDepth() callback used for parallax, we don't just shift the values toward GetSubMinDisplacement(), + // we shift extra to ensure that completely masked-out layers are not blended onto upper layers. + layerDepthValues = ApplyBlendMaskToDepthValues(blendMaskValues, layerDepthValues, GetSubMinDisplacement() - MaterialSrg::m_displacementBlendDistance); + } + } + + return GetBlendWeights(blendSource, blendMaskValues, layerDepthValues, MaterialSrg::m_displacementBlendDistance); +} + +float BlendLayers(float layer1, float layer2, float layer3, float3 blendWeights) +{ + return dot(float3(layer1, layer2, layer3), blendWeights); +} +float2 BlendLayers(float2 layer1, float2 layer2, float2 layer3, float3 blendWeights) +{ + return layer1 * blendWeights.r + layer2 * blendWeights.g + layer3 * blendWeights.b; +} +float3 BlendLayers(float3 layer1, float3 layer2, float3 layer3, float3 blendWeights) +{ + return layer1 * blendWeights.r + layer2 * blendWeights.g + layer3 * blendWeights.b; } // ------ Parallax Utilities ---------------------------------------- @@ -203,65 +372,127 @@ bool ShouldHandleParallaxInDepthShaders() return ShouldHandleParallax() && o_parallax_enablePixelDepthOffset; } -// These static values are used to pass extra data to the GetDepth callback function during the parallax depth search. -static float3 s_blendMaskFromVertexStream; - -//! Setup static variables that are needed by the GetDepth callback function -//! @param vertexBlendMask the blend mask values from the vertex input stream. -void GetDepth_Setup(float3 vertexBlendMask) -{ - s_blendMaskFromVertexStream = vertexBlendMask; -} - -// Callback function for ParallaxMapping.azsli -DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) +//! Returns the depth values for each layer. +float3 GetLayerDepthValues(float2 uv, float2 uv_ddx, float2 uv_ddy) { float3 layerDepthValues = float3(0,0,0); - - if(o_layer1_o_useDepthMap) + + // layer1 { - float2 layerUv = uv; - if(MaterialSrg::m_parallaxUvIndex == 0) + if(o_layer1_o_useHeightmap) { - layerUv = mul(MaterialSrg::m_layer1_m_uvMatrix, float3(uv, 1.0)).xy; + float2 layerUv = uv; + if(MaterialSrg::m_parallaxUvIndex == 0) + { + layerUv = mul(MaterialSrg::m_layer1_m_uvMatrix, float3(uv, 1.0)).xy; + } + + layerDepthValues.r = SampleDepthFromHeightmap(MaterialSrg::m_layer1_m_heightmap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; + layerDepthValues.r *= MaterialSrg::m_layer1_m_heightmapScale; } - layerDepthValues.r = SampleDepthOrHeightMap(MaterialSrg::m_layer1_m_depthInverted, MaterialSrg::m_layer1_m_depthMap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; - layerDepthValues.r *= MaterialSrg::m_layer1_m_depthFactor; - layerDepthValues.r -= MaterialSrg::m_layer1_m_depthOffset; + layerDepthValues.r -= MaterialSrg::m_layer1_m_heightmapOffset; } - if(o_layer2_o_useDepthMap) + if(o_layer2_enabled) { - float2 layerUv = uv; - if(MaterialSrg::m_parallaxUvIndex == 0) + if(o_layer2_o_useHeightmap) { - layerUv = mul(MaterialSrg::m_layer2_m_uvMatrix, float3(uv, 1.0)).xy; + float2 layerUv = uv; + if(MaterialSrg::m_parallaxUvIndex == 0) + { + layerUv = mul(MaterialSrg::m_layer2_m_uvMatrix, float3(uv, 1.0)).xy; + } + + layerDepthValues.g = SampleDepthFromHeightmap(MaterialSrg::m_layer2_m_heightmap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; + layerDepthValues.g *= MaterialSrg::m_layer2_m_heightmapScale; } - layerDepthValues.g = SampleDepthOrHeightMap(MaterialSrg::m_layer2_m_depthInverted, MaterialSrg::m_layer2_m_depthMap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; - layerDepthValues.g *= MaterialSrg::m_layer2_m_depthFactor; - layerDepthValues.g -= MaterialSrg::m_layer2_m_depthOffset; + layerDepthValues.g -= MaterialSrg::m_layer2_m_heightmapOffset; + } - if(o_layer3_o_useDepthMap) + if(o_layer3_enabled) { - float2 layerUv = uv; - if(MaterialSrg::m_parallaxUvIndex == 0) + if(o_layer3_o_useHeightmap) { - layerUv = mul(MaterialSrg::m_layer3_m_uvMatrix, float3(uv, 1.0)).xy; + float2 layerUv = uv; + if(MaterialSrg::m_parallaxUvIndex == 0) + { + layerUv = mul(MaterialSrg::m_layer3_m_uvMatrix, float3(uv, 1.0)).xy; + } + + layerDepthValues.b = SampleDepthFromHeightmap(MaterialSrg::m_layer3_m_heightmap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; + layerDepthValues.b *= MaterialSrg::m_layer3_m_heightmapScale; } - layerDepthValues.b = SampleDepthOrHeightMap(MaterialSrg::m_layer3_m_depthInverted, MaterialSrg::m_layer3_m_depthMap, MaterialSrg::m_sampler, layerUv, uv_ddx, uv_ddy).m_depth; - layerDepthValues.b *= MaterialSrg::m_layer3_m_depthFactor; - layerDepthValues.b -= MaterialSrg::m_layer3_m_depthOffset; + layerDepthValues.b -= MaterialSrg::m_layer3_m_heightmapOffset; + } - // Note, when the blend source is BlendMaskSource::VertexColors, parallax will not be able to blend correctly between layers. It will end up using the same blend mask values - // for every UV position when searching for the intersection. This leads to smearing artifacts at the transition point, but these won't be so noticeable as long as + return layerDepthValues; +} + + +//! Uses a layer blend mask to further displace each layer's surface so that it disappears beyond the other surfaces. +//! Note the blend mask does not apply to the first layer, it is the implicit base layer. Layers 2 and 3 are masked by the r and g channels of the mask. +//! @param blendMaskValues layer mask values as returned by GetApplicableBlendMaskValues() +//! @param layerDepthValues layer depth values as returned by GetLayerDepthValues() +//! @param zeroMaskDisplacement the target displacement value that corresponds to a mask value of 0 +//! @return new layer depth values that have been adjusted according to the layerMaskValues +float3 ApplyBlendMaskToDepthValues(float3 blendMaskValues, float3 layerDepthValues, float zeroMaskDisplacement) +{ + if(o_layer2_enabled || o_layer3_enabled) + { + // We add to the depth value rather than lerp toward m_displacementMin to avoid squashing the topology, but instead lower it out of sight. + + if(o_layer2_enabled) + { + float dropoffRange = MaterialSrg::m_layer2_m_heightmapOffset - zeroMaskDisplacement; + layerDepthValues.g += dropoffRange * (1-blendMaskValues.r); + } + + if(o_layer3_enabled) + { + float dropoffRange = MaterialSrg::m_layer3_m_heightmapOffset - zeroMaskDisplacement; + layerDepthValues.b += dropoffRange * (1-blendMaskValues.g); + } + } + + return layerDepthValues; +} + +//! Callback function for ParallaxMapping.azsli +DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) +{ + LayerBlendSource blendSource = GetFinalLayerBlendSource(); + + float3 layerDepthValues = GetLayerDepthValues(uv, uv_ddx, uv_ddy); + + // Note, when the blend source uses the blend mask from the vertex colors, parallax will not be able to blend correctly between layers. It will end up using the same blend mask values + // for every UV position when searching for the intersection. This leads to smearing artifacts at the transition point, but these won't be as noticeable if // you have a small depth factor relative to the size of the blend transition. - float3 blendMaskValues = GetBlendMaskValues(uv, s_blendMaskFromVertexStream); + float3 blendMaskValues = GetApplicableBlendMaskValues(blendSource, uv, s_blendMaskFromVertexStream); + + bool useBlendMask = + LayerBlendSource::Displacement_With_BlendMaskTexture == blendSource || + LayerBlendSource::Displacement_With_BlendMaskVertexColors == blendSource; + + if(useBlendMask) + { + // Regarding GetSubMinDisplacement(), when a mask of 0 pushes the surface all the way to the bottom, we want that + // to go a little below the min so it will disappear if there is something else right at the min. + + layerDepthValues = ApplyBlendMaskToDepthValues(blendMaskValues, layerDepthValues, GetSubMinDisplacement()); + } + + // When blending the depth together, we don't use MaterialSrg::m_displacementBlendDistance. The intention is that m_displacementBlendDistance + // is for transitioning the appearance of the surface itself, but we still want a distinct change in the heightmap. If someday we want to + // support smoothly blending the depth as well, there is a bit more work to do to get it to play nice with the blend mask code in GetLayerDepthValues(). + float layerDepthBlendDistance = 0.0f; + float3 blendWeightValues = GetBlendWeights(blendSource, blendMaskValues, layerDepthValues, layerDepthBlendDistance); + + float depth = BlendLayers(layerDepthValues.r, layerDepthValues.g, layerDepthValues.b, blendWeightValues); - float depth = BlendLayers(layerDepthValues.r, layerDepthValues.g, layerDepthValues.b, blendMaskValues); return DepthResultAbsolute(depth); } 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 ae156d7313..cf4d53e805 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 @@ -84,7 +84,7 @@ VSDepthOutput MainVS(VSInput IN) } else { - OUT.m_blendMask = float3(1,1,1); + OUT.m_blendMask = float3(0,0,0); } return OUT; @@ -103,12 +103,12 @@ PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) if(ShouldHandleParallaxInDepthShaders()) { - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); - - GetDepth_Setup(IN.m_blendMask); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); + + s_blendMaskFromVertexStream = IN.m_blendMask; float depth; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Displacement.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Displacement.lua new file mode 100644 index 0000000000..d2bf8f28d3 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Displacement.lua @@ -0,0 +1,195 @@ +-------------------------------------------------------------------------------------- +-- +-- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +-- its licensors. +-- +-- For complete copyright and license terms please see the LICENSE at the root of this +-- distribution (the "License"). All use of this software is governed by the License, +-- or, if provided, by the license below or the license accompanying this file. Do not +-- remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- +-- +---------------------------------------------------------------------------------------------------- + +-- This functor handles general parallax properties that affect the entire material. + +function GetMaterialPropertyDependencies() + return { + "blend.blendSource", + "blend.enableLayer2", + "blend.enableLayer3", + "parallax.enable", + "layer1_parallax.textureMap", + "layer2_parallax.textureMap", + "layer3_parallax.textureMap", + "layer1_parallax.useTexture", + "layer2_parallax.useTexture", + "layer3_parallax.useTexture", + "layer1_parallax.factor", + "layer2_parallax.factor", + "layer3_parallax.factor", + "layer1_parallax.offset", + "layer2_parallax.offset", + "layer3_parallax.offset" + } +end + +function GetShaderOptionDependencies() + return {"o_parallax_feature_enabled"} +end + +-- These values must align with LayerBlendSource in StandardMultilayerPBR_Common.azsli. +LayerBlendSource_BlendMaskTexture = 0 +LayerBlendSource_BlendMaskVertexColors = 1 +LayerBlendSource_Displacement = 2 +LayerBlendSource_Displacement_With_BlendMaskTexture = 3 +LayerBlendSource_Displacement_With_BlendMaskVertexColors = 4 + +function BlendSourceUsesDisplacement(context) + local blendSource = context:GetMaterialPropertyValue_enum("blend.blendSource") + local blendSourceIncludesDisplacement = (blendSource == LayerBlendSource_Displacement or + blendSource == LayerBlendSource_Displacement_With_BlendMaskTexture or + blendSource == LayerBlendSource_Displacement_With_BlendMaskVertexColors) + return blendSourceIncludesDisplacement +end + +function IsParallaxNeededForLayer(context, layerNumber) + local enableLayer = true + if(layerNumber > 1) then -- layer 1 is always enabled, it is the implicit base layer + enableLayer = context:GetMaterialPropertyValue_bool("blend.enableLayer" .. layerNumber) + end + + if not enableLayer then + return false + end + + local parallaxGroupName = "layer" .. layerNumber .. "_parallax." + + local factor = context:GetMaterialPropertyValue_float(parallaxGroupName .. "factor") + local offset = context:GetMaterialPropertyValue_float(parallaxGroupName .. "offset") + + if factor == 0.0 and offset == 0.0 then + return false + end + + local hasTexture = nil ~= context:GetMaterialPropertyValue_Image(parallaxGroupName .. "textureMap") + local useTexture = context:GetMaterialPropertyValue_bool(parallaxGroupName .. "useTexture") + + if not hasTexture or not useTexture then + factorLayer = 0.0 + end + + if factor == 0.0 and offset == 0.0 then + return false + end + + return true +end + +-- Calculates the min and max displacement height values encompassing all enabled layers. +-- @return a table with two values {min,max}. Negative values are below the surface and positive values are above the surface. +function CalcOverallHeightRange(context) + + local heightMinMax = {nil, nil} + + local function GetMergedHeightRange(heightMinMax, offset, factor) + top = offset + bottom = offset - factor + + if(heightMinMax[1] == nil) then + heightMinMax[1] = top + else + heightMinMax[1] = math.max(heightMinMax[1], top) + end + + if(heightMinMax[0] == nil) then + heightMinMax[0] = bottom + else + heightMinMax[0] = math.min(heightMinMax[0], bottom) + end + end + + local enableParallax = context:GetMaterialPropertyValue_bool("parallax.enable") + + if(enableParallax or BlendSourceUsesDisplacement(context)) then + local hasTextureLayer1 = nil ~= context:GetMaterialPropertyValue_Image("layer1_parallax.textureMap") + local hasTextureLayer2 = nil ~= context:GetMaterialPropertyValue_Image("layer2_parallax.textureMap") + local hasTextureLayer3 = nil ~= context:GetMaterialPropertyValue_Image("layer3_parallax.textureMap") + + local useTextureLayer1 = context:GetMaterialPropertyValue_bool("layer1_parallax.useTexture") + local useTextureLayer2 = context:GetMaterialPropertyValue_bool("layer2_parallax.useTexture") + local useTextureLayer3 = context:GetMaterialPropertyValue_bool("layer3_parallax.useTexture") + + local factorLayer1 = context:GetMaterialPropertyValue_float("layer1_parallax.factor") + local factorLayer2 = context:GetMaterialPropertyValue_float("layer2_parallax.factor") + local factorLayer3 = context:GetMaterialPropertyValue_float("layer3_parallax.factor") + + if not hasTextureLayer1 or not useTextureLayer1 then factorLayer1 = 0 end + if not hasTextureLayer2 or not useTextureLayer2 then factorLayer2 = 0 end + if not hasTextureLayer3 or not useTextureLayer3 then factorLayer3 = 0 end + + local offsetLayer1 = context:GetMaterialPropertyValue_float("layer1_parallax.offset") + local offsetLayer2 = context:GetMaterialPropertyValue_float("layer2_parallax.offset") + local offsetLayer3 = context:GetMaterialPropertyValue_float("layer3_parallax.offset") + + local enableLayer2 = context:GetMaterialPropertyValue_bool("blend.enableLayer2") + local enableLayer3 = context:GetMaterialPropertyValue_bool("blend.enableLayer3") + + GetMergedHeightRange(heightMinMax, offsetLayer1, factorLayer1) + if(enableLayer2) then GetMergedHeightRange(heightMinMax, offsetLayer2, factorLayer2) end + if(enableLayer3) then GetMergedHeightRange(heightMinMax, offsetLayer3, factorLayer3) end + + else + heightMinMax = {0,0} + end + + return heightMinMax +end + +function Process(context) + local heightMinMax = CalcOverallHeightRange(context) + context:SetShaderConstant_float("m_displacementMin", heightMinMax[0]) + context:SetShaderConstant_float("m_displacementMax", heightMinMax[1]) + + local parallaxFeatureEnabled = context:GetMaterialPropertyValue_bool("parallax.enable") + if parallaxFeatureEnabled then + if not IsParallaxNeededForLayer(context, 1) and + not IsParallaxNeededForLayer(context, 2) and + not IsParallaxNeededForLayer(context, 3) then + parallaxFeatureEnabled = false + end + end + + context:SetShaderOptionValue_bool("o_parallax_feature_enabled", parallaxFeatureEnabled) +end + +function ProcessEditor(context) + local enableParallaxSettings = context:GetMaterialPropertyValue_bool("parallax.enable") + + local parallaxSettingVisibility = MaterialPropertyVisibility_Enabled + if(not enableParallaxSettings) then + parallaxSettingVisibility = MaterialPropertyVisibility_Hidden + end + + context:SetMaterialPropertyVisibility("parallax.parallaxUv", parallaxSettingVisibility) + context:SetMaterialPropertyVisibility("parallax.algorithm", parallaxSettingVisibility) + context:SetMaterialPropertyVisibility("parallax.quality", parallaxSettingVisibility) + context:SetMaterialPropertyVisibility("parallax.pdo", parallaxSettingVisibility) + context:SetMaterialPropertyVisibility("parallax.showClipping", parallaxSettingVisibility) + + if BlendSourceUsesDisplacement(context) then + context:SetMaterialPropertyVisibility("blend.displacementBlendDistance", MaterialPropertyVisibility_Enabled) + else + context:SetMaterialPropertyVisibility("blend.displacementBlendDistance", MaterialPropertyVisibility_Hidden) + end + + -- We set the displacementBlendDistance slider range to match the range of displacement, so the slider will feel good + -- regardless of how big the overall displacement is. Using a soft max allows the user to exceed the limit if desired, + -- but the main reason for the *soft* max is to avoid impacting the value of displacementBlendDistance which could + -- otherwise lead to edge cases. + local heightMinMax = CalcOverallHeightRange(context) + local totalDisplacementRange = heightMinMax[1] - heightMinMax[0] + context:SetMaterialPropertySoftMaxValue_float("blend.displacementBlendDistance", math.max(totalDisplacementRange, 0.001)) +end + 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 bc32aa1370..19efc60a1e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ForwardPass.azsl @@ -55,7 +55,6 @@ DEFINE_LAYER_OPTIONS(o_layer1_) DEFINE_LAYER_OPTIONS(o_layer2_) DEFINE_LAYER_OPTIONS(o_layer3_) -#include "MaterialInputs/SubsurfaceInput.azsli" #include "MaterialInputs/TransmissionInput.azsli" #include "StandardMultilayerPBR_Common.azsli" @@ -117,7 +116,7 @@ VSOutput ForwardPassVS(VSInput IN) } else { - OUT.m_blendMask = float3(1,1,1); + OUT.m_blendMask = float3(0,0,0); } // Shadow coords will be calculated in the pixel shader in this case @@ -127,6 +126,181 @@ VSOutput ForwardPassVS(VSInput IN) return OUT; } +//! Collects all the raw Standard material inputs for a single layer. See ProcessStandardMaterialInputs(). +struct StandardMaterialInputs +{ + COMMON_SRG_INPUTS_BASE_COLOR() + COMMON_SRG_INPUTS_ROUGHNESS() + COMMON_SRG_INPUTS_METALLIC() + COMMON_SRG_INPUTS_SPECULAR_F0() + COMMON_SRG_INPUTS_NORMAL() + COMMON_SRG_INPUTS_CLEAR_COAT() + COMMON_SRG_INPUTS_OCCLUSION() + COMMON_SRG_INPUTS_EMISSIVE() + // Note parallax is omitted here because that requires special handling. + + bool m_normal_useTexture; + bool m_baseColor_useTexture; + bool m_metallic_useTexture; + bool m_specularF0_useTexture; + bool m_roughness_useTexture; + bool m_emissiveEnabled; + bool m_emissive_useTexture; + bool m_diffuseOcclusion_useTexture; + bool m_specularOcclusion_useTexture; + bool m_clearCoatEnabled; + bool m_clearCoat_factor_useTexture; + bool m_clearCoat_roughness_useTexture; + bool m_clearCoat_normal_useTexture; + + TextureBlendMode m_baseColorTextureBlendMode; + + float2 m_vertexUv[UvSetCount]; + float3x3 m_uvMatrix; + float m_normal; + float3 m_tangents[UvSetCount]; + float3 m_bitangents[UvSetCount]; + + sampler m_sampler; + + bool m_isFrontFace; +}; + +//! Holds the final processed material inputs, after all flags have been checked, textures have been sampled, factors have been applied, etc. +//! This data is ready to be copied into a Surface and/or LightingData struct for the lighting system to consume. +class ProcessedMaterialInputs +{ + float3 m_normalTS; //!< Normal in tangent-space + float3 m_baseColor; + float3 m_specularF0Factor; + float m_metallic; + float m_roughness; + float3 m_emissiveLighting; + float m_diffuseAmbientOcclusion; + float m_specularOcclusion; + ClearCoatSurfaceData m_clearCoat; + + void InitializeToZero() + { + m_normalTS = float3(0,0,0); + m_baseColor = float3(0,0,0); + m_specularF0Factor = float3(0,0,0); + m_metallic = 0.0f; + m_roughness = 0.0f; + m_emissiveLighting = float3(0,0,0); + m_diffuseAmbientOcclusion = 0; + m_specularOcclusion = 0; + m_clearCoat.InitializeToZero(); + } +}; + +//! Processes the set of Standard material inputs for a single layer. +//! The FILL_STANDARD_MATERIAL_INPUTS() macro below can be used to fill the StandardMaterialInputs struct. +ProcessedMaterialInputs ProcessStandardMaterialInputs(StandardMaterialInputs inputs) +{ + ProcessedMaterialInputs result; + + float2 transformedUv[UvSetCount]; + transformedUv[0] = mul(inputs.m_uvMatrix, float3(inputs.m_vertexUv[0], 1.0)).xy; + transformedUv[1] = inputs.m_vertexUv[1]; + + float3x3 normalUvMatrix = inputs.m_normalMapUvIndex == 0 ? inputs.m_uvMatrix : CreateIdentity3x3(); + result.m_normalTS = GetNormalInputTS(inputs.m_normalMap, inputs.m_sampler, transformedUv[inputs.m_normalMapUvIndex], inputs.m_flipNormalX, inputs.m_flipNormalY, normalUvMatrix, inputs.m_normal_useTexture, inputs.m_normalFactor); + + float3 sampledBaseColor = GetBaseColorInput(inputs.m_baseColorMap, inputs.m_sampler, transformedUv[inputs.m_baseColorMapUvIndex], inputs.m_baseColor.rgb, inputs.m_baseColor_useTexture); + result.m_baseColor = BlendBaseColor(sampledBaseColor, inputs.m_baseColor.rgb, inputs.m_baseColorFactor, inputs.m_baseColorTextureBlendMode, inputs.m_baseColor_useTexture); + result.m_specularF0Factor = GetSpecularInput(inputs.m_specularF0Map, inputs.m_sampler, transformedUv[inputs.m_specularF0MapUvIndex], inputs.m_specularF0Factor, inputs.m_specularF0_useTexture); + result.m_metallic = GetMetallicInput(inputs.m_metallicMap, inputs.m_sampler, transformedUv[inputs.m_metallicMapUvIndex], inputs.m_metallicFactor, inputs.m_metallic_useTexture); + result.m_roughness = GetRoughnessInput(inputs.m_roughnessMap, MaterialSrg::m_sampler, transformedUv[inputs.m_roughnessMapUvIndex], inputs.m_roughnessFactor, inputs.m_roughnessLowerBound, inputs.m_roughnessUpperBound, inputs.m_roughness_useTexture); + + result.m_emissiveLighting = GetEmissiveInput(inputs.m_emissiveMap, inputs.m_sampler, transformedUv[inputs.m_emissiveMapUvIndex], inputs.m_emissiveIntensity, inputs.m_emissiveColor.rgb, inputs.m_emissiveEnabled, inputs.m_emissive_useTexture); + result.m_diffuseAmbientOcclusion = GetOcclusionInput(inputs.m_diffuseOcclusionMap, inputs.m_sampler, transformedUv[inputs.m_diffuseOcclusionMapUvIndex], inputs.m_diffuseOcclusionFactor, inputs.m_diffuseOcclusion_useTexture); + result.m_specularOcclusion = GetOcclusionInput(inputs.m_specularOcclusionMap, MaterialSrg::m_sampler, transformedUv[inputs.m_specularOcclusionMapUvIndex], inputs.m_specularOcclusionFactor, inputs.m_specularOcclusion_useTexture); + + result.m_clearCoat.InitializeToZero(); + if(inputs.m_clearCoatEnabled) + { + float3x3 clearCoatUvMatrix = inputs.m_clearCoatNormalMapUvIndex == 0 ? inputs.m_uvMatrix : CreateIdentity3x3(); + + GetClearCoatInputs(inputs.m_clearCoatInfluenceMap, transformedUv[inputs.m_clearCoatInfluenceMapUvIndex], inputs.m_clearCoatFactor, inputs.m_clearCoat_factor_useTexture, + inputs.m_clearCoatRoughnessMap, transformedUv[inputs.m_clearCoatRoughnessMapUvIndex], inputs.m_clearCoatRoughness, inputs.m_clearCoat_roughness_useTexture, + inputs.m_clearCoatNormalMap, transformedUv[inputs.m_clearCoatNormalMapUvIndex], inputs.m_normal, inputs.m_clearCoat_normal_useTexture, inputs.m_clearCoatNormalStrength, + clearCoatUvMatrix, inputs.m_tangents[inputs.m_clearCoatNormalMapUvIndex], inputs.m_bitangents[inputs.m_clearCoatNormalMapUvIndex], + inputs.m_sampler, inputs.m_isFrontFace, + result.m_clearCoat.factor, result.m_clearCoat.roughness, result.m_clearCoat.normal); + } + + return result; +} + +//! Fills a StandardMaterialInputs struct with data from the MaterialSrg, shader options, and local vertex data. +#define FILL_STANDARD_MATERIAL_INPUTS(inputs, srgLayerPrefix, optionsLayerPrefix, blendWeight) \ + inputs.m_sampler = MaterialSrg::m_sampler; \ + inputs.m_vertexUv = IN.m_uv; \ + inputs.m_uvMatrix = srgLayerPrefix##m_uvMatrix; \ + inputs.m_normal = IN.m_normal; \ + inputs.m_tangents = tangents; \ + inputs.m_bitangents = bitangents; \ + inputs.m_isFrontFace = isFrontFace; \ + \ + inputs.m_normalMapUvIndex = srgLayerPrefix##m_normalMapUvIndex; \ + inputs.m_normalMap = srgLayerPrefix##m_normalMap; \ + inputs.m_flipNormalX = srgLayerPrefix##m_flipNormalX; \ + inputs.m_flipNormalY = srgLayerPrefix##m_flipNormalY; \ + inputs.m_normal_useTexture = optionsLayerPrefix##o_normal_useTexture; \ + inputs.m_normalFactor = srgLayerPrefix##m_normalFactor * blendWeight; \ + inputs.m_baseColorMap = srgLayerPrefix##m_baseColorMap; \ + inputs.m_baseColorMapUvIndex = srgLayerPrefix##m_baseColorMapUvIndex; \ + inputs.m_baseColor = srgLayerPrefix##m_baseColor; \ + inputs.m_baseColor_useTexture = optionsLayerPrefix##o_baseColor_useTexture; \ + inputs.m_baseColorFactor = srgLayerPrefix##m_baseColorFactor; \ + inputs.m_baseColorTextureBlendMode = optionsLayerPrefix##o_baseColorTextureBlendMode; \ + inputs.m_metallicMap = srgLayerPrefix##m_metallicMap; \ + inputs.m_metallicMapUvIndex = srgLayerPrefix##m_metallicMapUvIndex; \ + inputs.m_metallicFactor = srgLayerPrefix##m_metallicFactor; \ + inputs.m_metallic_useTexture = optionsLayerPrefix##o_metallic_useTexture; \ + inputs.m_specularF0Map = srgLayerPrefix##m_specularF0Map; \ + inputs.m_specularF0MapUvIndex = srgLayerPrefix##m_specularF0MapUvIndex; \ + inputs.m_specularF0Factor = srgLayerPrefix##m_specularF0Factor; \ + inputs.m_specularF0_useTexture = optionsLayerPrefix##o_specularF0_useTexture; \ + inputs.m_roughnessMap = srgLayerPrefix##m_roughnessMap; \ + inputs.m_roughnessMapUvIndex = srgLayerPrefix##m_roughnessMapUvIndex; \ + inputs.m_roughnessFactor = srgLayerPrefix##m_roughnessFactor; \ + inputs.m_roughnessLowerBound = srgLayerPrefix##m_roughnessLowerBound; \ + inputs.m_roughnessUpperBound = srgLayerPrefix##m_roughnessUpperBound; \ + inputs.m_roughness_useTexture = optionsLayerPrefix##o_roughness_useTexture; \ + \ + inputs.m_emissiveMap = srgLayerPrefix##m_emissiveMap; \ + inputs.m_emissiveMapUvIndex = srgLayerPrefix##m_emissiveMapUvIndex; \ + inputs.m_emissiveIntensity = srgLayerPrefix##m_emissiveIntensity; \ + inputs.m_emissiveColor = srgLayerPrefix##m_emissiveColor; \ + inputs.m_emissiveEnabled = optionsLayerPrefix##o_emissiveEnabled; \ + inputs.m_emissive_useTexture = optionsLayerPrefix##o_emissive_useTexture; \ + \ + inputs.m_diffuseOcclusionMap = srgLayerPrefix##m_diffuseOcclusionMap; \ + inputs.m_diffuseOcclusionMapUvIndex = srgLayerPrefix##m_diffuseOcclusionMapUvIndex; \ + inputs.m_diffuseOcclusionFactor = srgLayerPrefix##m_diffuseOcclusionFactor; \ + inputs.m_diffuseOcclusion_useTexture = optionsLayerPrefix##o_diffuseOcclusion_useTexture; \ + \ + inputs.m_specularOcclusionMap = srgLayerPrefix##m_specularOcclusionMap; \ + inputs.m_specularOcclusionMapUvIndex = srgLayerPrefix##m_specularOcclusionMapUvIndex; \ + inputs.m_specularOcclusionFactor = srgLayerPrefix##m_specularOcclusionFactor; \ + inputs.m_specularOcclusion_useTexture = optionsLayerPrefix##o_specularOcclusion_useTexture; \ + \ + inputs.m_clearCoatEnabled = o_clearCoat_feature_enabled && optionsLayerPrefix##o_clearCoat_enabled; \ + inputs.m_clearCoatInfluenceMap = srgLayerPrefix##m_clearCoatInfluenceMap; \ + inputs.m_clearCoatInfluenceMapUvIndex = srgLayerPrefix##m_clearCoatInfluenceMapUvIndex; \ + inputs.m_clearCoatFactor = srgLayerPrefix##m_clearCoatFactor; \ + inputs.m_clearCoat_factor_useTexture = optionsLayerPrefix##o_clearCoat_factor_useTexture; \ + inputs.m_clearCoatRoughnessMap = srgLayerPrefix##m_clearCoatRoughnessMap; \ + inputs.m_clearCoatRoughnessMapUvIndex = srgLayerPrefix##m_clearCoatRoughnessMapUvIndex; \ + inputs.m_clearCoatRoughness = srgLayerPrefix##m_clearCoatRoughness; \ + inputs.m_clearCoat_roughness_useTexture = optionsLayerPrefix##o_clearCoat_roughness_useTexture; \ + inputs.m_clearCoatNormalMap = srgLayerPrefix##m_clearCoatNormalMap; \ + inputs.m_clearCoatNormalMapUvIndex = srgLayerPrefix##m_clearCoatNormalMapUvIndex; \ + inputs.m_clearCoat_normal_useTexture = optionsLayerPrefix##o_clearCoat_normal_useTexture; \ + inputs.m_clearCoatNormalStrength = srgLayerPrefix##m_clearCoatNormalStrength; + // ---------- Pixel Shader ---------- @@ -134,50 +308,55 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float { depthNDC = IN.m_position.z; + s_blendMaskFromVertexStream = IN.m_blendMask; + + LayerBlendSource blendSource = GetFinalLayerBlendSource(); + // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - - if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering && MaterialSrg::m_parallaxUvIndex != 0) - || (o_layer1_o_normal_useTexture && MaterialSrg::m_layer1_m_normalMapUvIndex != 0) - || (o_layer2_o_normal_useTexture && MaterialSrg::m_layer2_m_normalMapUvIndex != 0) - || (o_layer3_o_normal_useTexture && MaterialSrg::m_layer3_m_normalMapUvIndex != 0) - || (o_layer1_o_clearCoat_normal_useTexture && MaterialSrg::m_layer1_m_clearCoatNormalMapUvIndex != 0) - || (o_layer2_o_clearCoat_normal_useTexture && MaterialSrg::m_layer2_m_clearCoatNormalMapUvIndex != 0) - || (o_layer3_o_clearCoat_normal_useTexture && MaterialSrg::m_layer3_m_clearCoatNormalMapUvIndex != 0) + if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering) + || o_layer1_o_normal_useTexture + || o_layer2_o_normal_useTexture + || o_layer3_o_normal_useTexture + || o_layer1_o_clearCoat_normal_useTexture + || o_layer2_o_clearCoat_normal_useTexture + || o_layer3_o_clearCoat_normal_useTexture ) { - // Generate the tangent/bitangent for UV[1+] - const int startIndex = 1; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, startIndex); + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } // ------- Debug Modes ------- - if(o_debugDrawMode == DebugDrawMode::BlendMaskValues) + if(o_debugDrawMode == DebugDrawMode::BlendMask) { - float3 blendMaskValues = GetBlendMaskValues(IN.m_uv[MaterialSrg::m_blendMaskUvIndex], IN.m_blendMask); + float3 blendMaskValues = GetApplicableBlendMaskValues(blendSource, IN.m_uv[MaterialSrg::m_blendMaskUvIndex], IN.m_blendMask); return DebugOutput(blendMaskValues); } - if(o_debugDrawMode == DebugDrawMode::DepthMaps) + if(o_debugDrawMode == DebugDrawMode::Displacement) { - GetDepth_Setup(IN.m_blendMask); - float depth = GetNormalizedDepth(-MaterialSrg::m_displacementMax, -MaterialSrg::m_displacementMin, IN.m_uv[MaterialSrg::m_parallaxUvIndex], float2(0,0), float2(0,0)); - return DebugOutput(float3(depth,depth,depth)); + float startDepth = -MaterialSrg::m_displacementMax; + float stopDepth = -MaterialSrg::m_displacementMin; + float depth = GetNormalizedDepth(startDepth, stopDepth, IN.m_uv[MaterialSrg::m_parallaxUvIndex], float2(0,0), float2(0,0)); + float height = 1 - saturate(depth); + return DebugOutput(float3(height,height,height)); + } + + if(o_debugDrawMode == DebugDrawMode::FinalBlendWeights) + { + float3 blendWeights = GetBlendWeights(blendSource, IN.m_uv[MaterialSrg::m_blendMaskUvIndex], IN.m_blendMask); + return DebugOutput(blendWeights); } // ------- Parallax ------- bool displacementIsClipped = false; - // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scatteirng is enabled if(ShouldHandleParallax()) { - GetDepth_Setup(IN.m_blendMask); - float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); @@ -198,108 +377,98 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float } } - Surface surface; - surface.position = IN.m_worldPosition; - - // ------- Setup the per-layer UV transforms ------- - - float2 uvLayer1[UvSetCount]; - float2 uvLayer2[UvSetCount]; - float2 uvLayer3[UvSetCount]; - - // Only UV0 will be applied transforms from each layer. - uvLayer1[0] = mul(MaterialSrg::m_layer1_m_uvMatrix, float3(IN.m_uv[0], 1.0)).xy; - uvLayer2[0] = mul(MaterialSrg::m_layer2_m_uvMatrix, float3(IN.m_uv[0], 1.0)).xy; - uvLayer3[0] = mul(MaterialSrg::m_layer3_m_uvMatrix, float3(IN.m_uv[0], 1.0)).xy; - uvLayer1[1] = IN.m_uv[1]; - uvLayer2[1] = IN.m_uv[1]; - uvLayer3[1] = IN.m_uv[1]; - // ------- Calculate Layer Blend Mask Values ------- // Now that any parallax has been calculated, we calculate the blend factors for any layers that are impacted by the parallax. - float3 blendMaskValues = GetBlendMaskValues(IN.m_uv[MaterialSrg::m_blendMaskUvIndex], IN.m_blendMask); + float3 blendWeights = GetBlendWeights(blendSource, IN.m_uv[MaterialSrg::m_blendMaskUvIndex], IN.m_blendMask); - // ------- Normal ------- + // ------- Layer 1 (base layer) ----------- + + ProcessedMaterialInputs lightingInputLayer1; + if(blendWeights.r > 0) + { + StandardMaterialInputs inputs; + FILL_STANDARD_MATERIAL_INPUTS(inputs, MaterialSrg::m_layer1_, o_layer1_, blendWeights.r) + lightingInputLayer1 = ProcessStandardMaterialInputs(inputs); + } + else + { + lightingInputLayer1.InitializeToZero(); + blendWeights.r = 0; + } - float3 layer1_normalFactor = MaterialSrg::m_layer1_m_normalFactor * blendMaskValues.r; - float3 layer2_normalFactor = MaterialSrg::m_layer2_m_normalFactor * blendMaskValues.g; - float3 layer3_normalFactor = MaterialSrg::m_layer3_m_normalFactor * blendMaskValues.b; - float3x3 layer1_uvMatrix = MaterialSrg::m_layer1_m_normalMapUvIndex == 0 ? MaterialSrg::m_layer1_m_uvMatrix : CreateIdentity3x3(); - float3x3 layer2_uvMatrix = MaterialSrg::m_layer2_m_normalMapUvIndex == 0 ? MaterialSrg::m_layer2_m_uvMatrix : CreateIdentity3x3(); - float3x3 layer3_uvMatrix = MaterialSrg::m_layer3_m_normalMapUvIndex == 0 ? MaterialSrg::m_layer3_m_uvMatrix : CreateIdentity3x3(); - float3 layer1_normalTS = GetNormalInputTS(MaterialSrg::m_layer1_m_normalMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_normalMapUvIndex], MaterialSrg::m_layer1_m_flipNormalX, MaterialSrg::m_layer1_m_flipNormalY, layer1_uvMatrix, o_layer1_o_normal_useTexture, layer1_normalFactor); - float3 layer2_normalTS = GetNormalInputTS(MaterialSrg::m_layer2_m_normalMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_normalMapUvIndex], MaterialSrg::m_layer2_m_flipNormalX, MaterialSrg::m_layer2_m_flipNormalY, layer2_uvMatrix, o_layer2_o_normal_useTexture, layer2_normalFactor); - float3 layer3_normalTS = GetNormalInputTS(MaterialSrg::m_layer3_m_normalMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_normalMapUvIndex], MaterialSrg::m_layer3_m_flipNormalX, MaterialSrg::m_layer3_m_flipNormalY, layer3_uvMatrix, o_layer3_o_normal_useTexture, layer3_normalFactor); + // ----------- Layer 2 ----------- + + ProcessedMaterialInputs lightingInputLayer2; + if(o_layer2_enabled && blendWeights.g > 0) + { + StandardMaterialInputs inputs; + FILL_STANDARD_MATERIAL_INPUTS(inputs, MaterialSrg::m_layer2_, o_layer2_, blendWeights.g) + lightingInputLayer2 = ProcessStandardMaterialInputs(inputs); + } + else + { + lightingInputLayer2.InitializeToZero(); + blendWeights.g = 0; + } - float3 normalTS = ReorientTangentSpaceNormal(layer1_normalTS, layer2_normalTS); - normalTS = ReorientTangentSpaceNormal(normalTS, layer3_normalTS); + // ----------- Layer 3 ----------- + + ProcessedMaterialInputs lightingInputLayer3; + if(o_layer3_enabled && blendWeights.b > 0) + { + StandardMaterialInputs inputs; + FILL_STANDARD_MATERIAL_INPUTS(inputs, MaterialSrg::m_layer3_, o_layer3_, blendWeights.b) + lightingInputLayer3 = ProcessStandardMaterialInputs(inputs); + } + else + { + lightingInputLayer3.InitializeToZero(); + blendWeights.b = 0; + } + + // ------- Combine all layers --------- + + Surface surface; + surface.position = IN.m_worldPosition; + surface.transmission.InitializeToZero(); + + // ------- Combine Normals --------- + + float3 normalTS = float3(0,0,1); + if(blendWeights.r > 0) + { + normalTS = lightingInputLayer1.m_normalTS; + } + if(o_layer2_enabled && blendWeights.g > 0) + { + normalTS = ReorientTangentSpaceNormal(normalTS, lightingInputLayer2.m_normalTS); + } + if(o_layer3_enabled && blendWeights.b > 0) + { + normalTS = ReorientTangentSpaceNormal(normalTS, lightingInputLayer3.m_normalTS); + } // [GFX TODO][ATOM-14591]: This will only work if the normal maps all use the same UV stream. We would need to add support for having them in different UV streams. surface.normal = normalize(TangentSpaceToWorld(normalTS, IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex])); - - // ------- Base Color ------- - - float2 layer1_baseColorUv = uvLayer1[MaterialSrg::m_layer1_m_baseColorMapUvIndex]; - float2 layer2_baseColorUv = uvLayer2[MaterialSrg::m_layer2_m_baseColorMapUvIndex]; - float2 layer3_baseColorUv = uvLayer3[MaterialSrg::m_layer3_m_baseColorMapUvIndex]; + + // ------- Combine Albedo, roughness, specular, roughness --------- - float3 layer1_sampledColor = GetBaseColorInput(MaterialSrg::m_layer1_m_baseColorMap, MaterialSrg::m_sampler, layer1_baseColorUv, MaterialSrg::m_layer1_m_baseColor.rgb, o_layer1_o_baseColor_useTexture); - float3 layer2_sampledColor = GetBaseColorInput(MaterialSrg::m_layer2_m_baseColorMap, MaterialSrg::m_sampler, layer2_baseColorUv, MaterialSrg::m_layer2_m_baseColor.rgb, o_layer2_o_baseColor_useTexture); - float3 layer3_sampledColor = GetBaseColorInput(MaterialSrg::m_layer3_m_baseColorMap, MaterialSrg::m_sampler, layer3_baseColorUv, MaterialSrg::m_layer3_m_baseColor.rgb, o_layer3_o_baseColor_useTexture); - float3 layer1_baseColor = BlendBaseColor(layer1_sampledColor, MaterialSrg::m_layer1_m_baseColor.rgb, MaterialSrg::m_layer1_m_baseColorFactor, o_layer1_o_baseColorTextureBlendMode, o_layer1_o_baseColor_useTexture); - float3 layer2_baseColor = BlendBaseColor(layer2_sampledColor, MaterialSrg::m_layer2_m_baseColor.rgb, MaterialSrg::m_layer2_m_baseColorFactor, o_layer2_o_baseColorTextureBlendMode, o_layer2_o_baseColor_useTexture); - float3 layer3_baseColor = BlendBaseColor(layer3_sampledColor, MaterialSrg::m_layer3_m_baseColor.rgb, MaterialSrg::m_layer3_m_baseColorFactor, o_layer3_o_baseColorTextureBlendMode, o_layer3_o_baseColor_useTexture); - float3 baseColor = BlendLayers(layer1_baseColor, layer2_baseColor, layer3_baseColor, blendMaskValues); + float3 baseColor = BlendLayers(lightingInputLayer1.m_baseColor, lightingInputLayer2.m_baseColor, lightingInputLayer3.m_baseColor, blendWeights); + float3 specularF0Factor = BlendLayers(lightingInputLayer1.m_specularF0Factor, lightingInputLayer2.m_specularF0Factor, lightingInputLayer3.m_specularF0Factor, blendWeights); + float3 metallic = BlendLayers(lightingInputLayer1.m_metallic, lightingInputLayer2.m_metallic, lightingInputLayer3.m_metallic, blendWeights); if(o_parallax_highlightClipping && displacementIsClipped) { ApplyParallaxClippingHighlight(baseColor); } - // ------- Metallic ------- - - float metallic = 0; - if(!o_enableSubsurfaceScattering) // If subsurface scattering is enabled skip texture lookup for metallic, as this quantity won't be used anyway - { - float layer1_metallic = GetMetallicInput(MaterialSrg::m_layer1_m_metallicMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_metallicMapUvIndex], MaterialSrg::m_layer1_m_metallicFactor, o_layer1_o_metallic_useTexture); - float layer2_metallic = GetMetallicInput(MaterialSrg::m_layer2_m_metallicMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_metallicMapUvIndex], MaterialSrg::m_layer2_m_metallicFactor, o_layer2_o_metallic_useTexture); - float layer3_metallic = GetMetallicInput(MaterialSrg::m_layer3_m_metallicMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_metallicMapUvIndex], MaterialSrg::m_layer3_m_metallicFactor, o_layer3_o_metallic_useTexture); - metallic = BlendLayers(layer1_metallic, layer2_metallic, layer3_metallic, blendMaskValues); - } - - // ------- Specular ------- - - float layer1_specularF0Factor = GetSpecularInput(MaterialSrg::m_layer1_m_specularF0Map, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_specularF0MapUvIndex], MaterialSrg::m_layer1_m_specularF0Factor, o_layer1_o_specularF0_useTexture); - float layer2_specularF0Factor = GetSpecularInput(MaterialSrg::m_layer2_m_specularF0Map, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_specularF0MapUvIndex], MaterialSrg::m_layer2_m_specularF0Factor, o_layer2_o_specularF0_useTexture); - float layer3_specularF0Factor = GetSpecularInput(MaterialSrg::m_layer3_m_specularF0Map, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_specularF0MapUvIndex], MaterialSrg::m_layer3_m_specularF0Factor, o_layer3_o_specularF0_useTexture); - float specularF0Factor = BlendLayers(layer1_specularF0Factor, layer2_specularF0Factor, layer3_specularF0Factor, blendMaskValues); - surface.SetAlbedoAndSpecularF0(baseColor, specularF0Factor, metallic); - // ------- Roughness ------- - - float layer1_roughness = GetRoughnessInput(MaterialSrg::m_layer1_m_roughnessMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_roughnessMapUvIndex], MaterialSrg::m_layer1_m_roughnessFactor, MaterialSrg::m_layer1_m_roughnessLowerBound, MaterialSrg::m_layer1_m_roughnessUpperBound, o_layer1_o_roughness_useTexture); - float layer2_roughness = GetRoughnessInput(MaterialSrg::m_layer2_m_roughnessMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_roughnessMapUvIndex], MaterialSrg::m_layer2_m_roughnessFactor, MaterialSrg::m_layer2_m_roughnessLowerBound, MaterialSrg::m_layer2_m_roughnessUpperBound, o_layer2_o_roughness_useTexture); - float layer3_roughness = GetRoughnessInput(MaterialSrg::m_layer3_m_roughnessMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_roughnessMapUvIndex], MaterialSrg::m_layer3_m_roughnessFactor, MaterialSrg::m_layer3_m_roughnessLowerBound, MaterialSrg::m_layer3_m_roughnessUpperBound, o_layer3_o_roughness_useTexture); - surface.roughnessLinear = BlendLayers(layer1_roughness, layer2_roughness, layer3_roughness, blendMaskValues); - + surface.roughnessLinear = BlendLayers(lightingInputLayer1.m_roughness, lightingInputLayer2.m_roughness, lightingInputLayer3.m_roughness, blendWeights); surface.CalculateRoughnessA(); - - // ------- Subsurface ------- - - float2 subsurfaceUv = IN.m_uv[MaterialSrg::m_subsurfaceScatteringInfluenceMapUvIndex]; - float surfaceScatteringFactor = GetSubsurfaceInput(MaterialSrg::m_subsurfaceScatteringInfluenceMap, MaterialSrg::m_sampler, subsurfaceUv, MaterialSrg::m_subsurfaceScatteringFactor); - - // ------- Transmission ------- - - float2 transmissionUv = IN.m_uv[MaterialSrg::m_transmissionThicknessMapUvIndex]; - float4 transmissionTintThickness = GeTransmissionInput(MaterialSrg::m_transmissionThicknessMap, MaterialSrg::m_sampler, transmissionUv, MaterialSrg::m_transmissionTintThickness); - surface.transmission.tint = transmissionTintThickness.rgb; - surface.transmission.thickness = transmissionTintThickness.w; - surface.transmission.transmissionParams = MaterialSrg::m_transmissionParams; - // ------- Lighting Data ------- - + // ------- Init and Combine Lighting Data ------- + LightingData lightingData; // Light iterator @@ -308,88 +477,22 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Directional light shadow coordinates lightingData.shadowCoords = IN.m_shadowCoords; - - // ------- Emissive ------- - float3 layer1_emissive = GetEmissiveInput(MaterialSrg::m_layer1_m_emissiveMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_emissiveMapUvIndex], MaterialSrg::m_layer1_m_emissiveIntensity, MaterialSrg::m_layer1_m_emissiveColor.rgb, o_layer1_o_emissiveEnabled, o_layer1_o_emissive_useTexture); - float3 layer2_emissive = GetEmissiveInput(MaterialSrg::m_layer2_m_emissiveMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_emissiveMapUvIndex], MaterialSrg::m_layer2_m_emissiveIntensity, MaterialSrg::m_layer2_m_emissiveColor.rgb, o_layer2_o_emissiveEnabled, o_layer2_o_emissive_useTexture); - float3 layer3_emissive = GetEmissiveInput(MaterialSrg::m_layer3_m_emissiveMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_emissiveMapUvIndex], MaterialSrg::m_layer3_m_emissiveIntensity, MaterialSrg::m_layer3_m_emissiveColor.rgb, o_layer3_o_emissiveEnabled, o_layer3_o_emissive_useTexture); - lightingData.emissiveLighting = BlendLayers(layer1_emissive, layer2_emissive, layer3_emissive, blendMaskValues); + lightingData.emissiveLighting = BlendLayers(lightingInputLayer1.m_emissiveLighting, lightingInputLayer2.m_emissiveLighting, lightingInputLayer3.m_emissiveLighting, blendWeights); + lightingData.specularOcclusion = BlendLayers(lightingInputLayer1.m_specularOcclusion, lightingInputLayer2.m_specularOcclusion, lightingInputLayer3.m_specularOcclusion, blendWeights); + lightingData.diffuseAmbientOcclusion = BlendLayers(lightingInputLayer1.m_diffuseAmbientOcclusion, lightingInputLayer2.m_diffuseAmbientOcclusion, lightingInputLayer3.m_diffuseAmbientOcclusion, blendWeights); - // ------- Occlusion ------- - - float layer1_diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_layer1_m_diffuseOcclusionMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_diffuseOcclusionMapUvIndex], MaterialSrg::m_layer1_m_diffuseOcclusionFactor, o_layer1_o_diffuseOcclusion_useTexture); - float layer2_diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_layer2_m_diffuseOcclusionMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_diffuseOcclusionMapUvIndex], MaterialSrg::m_layer2_m_diffuseOcclusionFactor, o_layer2_o_diffuseOcclusion_useTexture); - float layer3_diffuseAmbientOcclusion = GetOcclusionInput(MaterialSrg::m_layer3_m_diffuseOcclusionMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_diffuseOcclusionMapUvIndex], MaterialSrg::m_layer3_m_diffuseOcclusionFactor, o_layer3_o_diffuseOcclusion_useTexture); - lightingData.diffuseAmbientOcclusion = BlendLayers(layer1_diffuseAmbientOcclusion, layer2_diffuseAmbientOcclusion, layer3_diffuseAmbientOcclusion, blendMaskValues); + lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); - float layer1_specularOcclusion = GetOcclusionInput(MaterialSrg::m_layer1_m_specularOcclusionMap, MaterialSrg::m_sampler, uvLayer1[MaterialSrg::m_layer1_m_specularOcclusionMapUvIndex], MaterialSrg::m_layer1_m_specularOcclusionFactor, o_layer1_o_specularOcclusion_useTexture); - float layer2_specularOcclusion = GetOcclusionInput(MaterialSrg::m_layer2_m_specularOcclusionMap, MaterialSrg::m_sampler, uvLayer2[MaterialSrg::m_layer2_m_specularOcclusionMapUvIndex], MaterialSrg::m_layer2_m_specularOcclusionFactor, o_layer2_o_specularOcclusion_useTexture); - float layer3_specularOcclusion = GetOcclusionInput(MaterialSrg::m_layer3_m_specularOcclusionMap, MaterialSrg::m_sampler, uvLayer3[MaterialSrg::m_layer3_m_specularOcclusionMapUvIndex], MaterialSrg::m_layer3_m_specularOcclusionFactor, o_layer3_o_specularOcclusion_useTexture); - lightingData.specularOcclusion = BlendLayers(layer1_specularOcclusion, layer2_specularOcclusion, layer3_specularOcclusion, blendMaskValues); - - // ------- Clearcoat ------- + // ------- Combine Clearcoat ------- if(o_clearCoat_feature_enabled) { - // --- Layer 1 --- - - float layer1_clearCoatFactor = 0.0f; - float layer1_clearCoatRoughness = 0.0f; - float3 layer1_clearCoatNormal = float3(0.0, 0.0, 0.0); - if(o_layer1_o_clearCoat_enabled) - { - float3x3 layer1_uvMatrix = MaterialSrg::m_layer1_m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_layer1_m_uvMatrix : CreateIdentity3x3(); - - GetClearCoatInputs(MaterialSrg::m_layer1_m_clearCoatInfluenceMap, uvLayer1[MaterialSrg::m_layer1_m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_layer1_m_clearCoatFactor, o_layer1_o_clearCoat_factor_useTexture, - MaterialSrg::m_layer1_m_clearCoatRoughnessMap, uvLayer1[MaterialSrg::m_layer1_m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_layer1_m_clearCoatRoughness, o_layer1_o_clearCoat_roughness_useTexture, - MaterialSrg::m_layer1_m_clearCoatNormalMap, uvLayer1[MaterialSrg::m_layer1_m_clearCoatNormalMapUvIndex], IN.m_normal, o_layer1_o_clearCoat_normal_useTexture, MaterialSrg::m_layer1_m_clearCoatNormalStrength, - layer1_uvMatrix, tangents[MaterialSrg::m_layer1_m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_layer1_m_clearCoatNormalMapUvIndex], - MaterialSrg::m_sampler, isFrontFace, - layer1_clearCoatFactor, layer1_clearCoatRoughness, layer1_clearCoatNormal); - } - - // --- Layer 2 --- - - float layer2_clearCoatFactor = 0.0f; - float layer2_clearCoatRoughness = 0.0f; - float3 layer2_clearCoatNormal = float3(0.0, 0.0, 0.0); - if(o_layer2_o_clearCoat_enabled) - { - float3x3 layer2_uvMatrix = MaterialSrg::m_layer2_m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_layer2_m_uvMatrix : CreateIdentity3x3(); - - GetClearCoatInputs(MaterialSrg::m_layer2_m_clearCoatInfluenceMap, uvLayer2[MaterialSrg::m_layer2_m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_layer2_m_clearCoatFactor, o_layer2_o_clearCoat_factor_useTexture, - MaterialSrg::m_layer2_m_clearCoatRoughnessMap, uvLayer2[MaterialSrg::m_layer2_m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_layer2_m_clearCoatRoughness, o_layer2_o_clearCoat_roughness_useTexture, - MaterialSrg::m_layer2_m_clearCoatNormalMap, uvLayer2[MaterialSrg::m_layer2_m_clearCoatNormalMapUvIndex], IN.m_normal, o_layer2_o_clearCoat_normal_useTexture, MaterialSrg::m_layer2_m_clearCoatNormalStrength, - layer2_uvMatrix, tangents[MaterialSrg::m_layer2_m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_layer2_m_clearCoatNormalMapUvIndex], - MaterialSrg::m_sampler, isFrontFace, - layer2_clearCoatFactor, layer2_clearCoatRoughness, layer2_clearCoatNormal); - } - - // --- Layer 3 --- - - float layer3_clearCoatFactor = 0.0f; - float layer3_clearCoatRoughness = 0.0f; - float3 layer3_clearCoatNormal = float3(0.0, 0.0, 0.0); - if(o_layer3_o_clearCoat_enabled) - { - float3x3 layer3_uvMatrix = MaterialSrg::m_layer3_m_clearCoatNormalMapUvIndex == 0 ? MaterialSrg::m_layer3_m_uvMatrix : CreateIdentity3x3(); - - GetClearCoatInputs(MaterialSrg::m_layer3_m_clearCoatInfluenceMap, uvLayer3[MaterialSrg::m_layer3_m_clearCoatInfluenceMapUvIndex], MaterialSrg::m_layer3_m_clearCoatFactor, o_layer3_o_clearCoat_factor_useTexture, - MaterialSrg::m_layer3_m_clearCoatRoughnessMap, uvLayer3[MaterialSrg::m_layer3_m_clearCoatRoughnessMapUvIndex], MaterialSrg::m_layer3_m_clearCoatRoughness, o_layer3_o_clearCoat_roughness_useTexture, - MaterialSrg::m_layer3_m_clearCoatNormalMap, uvLayer3[MaterialSrg::m_layer3_m_clearCoatNormalMapUvIndex], IN.m_normal, o_layer3_o_clearCoat_normal_useTexture, MaterialSrg::m_layer3_m_clearCoatNormalStrength, - layer3_uvMatrix, tangents[MaterialSrg::m_layer3_m_clearCoatNormalMapUvIndex], bitangents[MaterialSrg::m_layer3_m_clearCoatNormalMapUvIndex], - MaterialSrg::m_sampler, isFrontFace, - layer3_clearCoatFactor, layer3_clearCoatRoughness, layer3_clearCoatNormal); - } - - // --- Blend Layers --- - - surface.clearCoat.factor = BlendLayers(layer1_clearCoatFactor, layer2_clearCoatFactor, layer3_clearCoatFactor, blendMaskValues); - surface.clearCoat.roughness = BlendLayers(layer1_clearCoatRoughness, layer2_clearCoatRoughness, layer3_clearCoatRoughness, blendMaskValues); + surface.clearCoat.factor = BlendLayers(lightingInputLayer1.m_clearCoat.factor, lightingInputLayer2.m_clearCoat.factor, lightingInputLayer3.m_clearCoat.factor, blendWeights); + surface.clearCoat.roughness = BlendLayers(lightingInputLayer1.m_clearCoat.roughness, lightingInputLayer2.m_clearCoat.roughness, lightingInputLayer3.m_clearCoat.roughness, blendWeights); // [GFX TODO][ATOM-14592] This is not the right way to blend the normals. We need to use ReorientTangentSpaceNormal(), and that requires GetClearCoatInputs() to return the normal in TS instead of WS. - surface.clearCoat.normal = BlendLayers(layer1_clearCoatNormal, layer2_clearCoatNormal, layer3_clearCoatNormal, blendMaskValues); + surface.clearCoat.normal = BlendLayers(lightingInputLayer1.m_clearCoat.normal, lightingInputLayer2.m_clearCoat.normal, lightingInputLayer3.m_clearCoat.normal, blendWeights); surface.clearCoat.normal = normalize(surface.clearCoat.normal); // manipulate base layer f0 if clear coat is enabled @@ -409,11 +512,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float // Clear coat layer has fixed IOR = 1.5 and transparent => F0 = (1.5 - 1)^2 / (1.5 + 1)^2 = 0.04 lightingData.diffuseResponse *= 1.0 - (FresnelSchlickWithRoughness(lightingData.NdotV, float3(0.04, 0.04, 0.04), surface.clearCoat.roughness) * surface.clearCoat.factor); } - - // ------- Multiscatter ------- - - lightingData.CalculateMultiscatterCompensation(surface.specularF0, o_specularF0_enableMultiScatterCompensation); - + // ------- Lighting Calculation ------- // Apply Decals @@ -426,17 +525,14 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float ApplyIBL(surface, lightingData); // Finalize Lighting - lightingData.FinalizeLighting(surface.transmission.tint); + lightingData.FinalizeLighting(0); const float alpha = 1.0; PbrLightingOutput lightingOutput = GetPbrLightingOutput(surface, lightingData, alpha); - // Pack factor and quality, drawback: because of precision limit of float16 cannot represent exact 1, maximum representable value is 0.9961 - uint factorAndQuality = dot(round(float2(saturate(surfaceScatteringFactor), MaterialSrg::m_subsurfaceScatteringQuality) * 255), float2(256, 1)); - lightingOutput.m_diffuseColor.w = factorAndQuality * (o_enableSubsurfaceScattering ? 1.0 : -1.0); - + lightingOutput.m_diffuseColor.w = -1; // Disable subsurface scattering return lightingOutput; } diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_LayerEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_LayerEnable.lua new file mode 100644 index 0000000000..f60aac6149 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_LayerEnable.lua @@ -0,0 +1,49 @@ +-------------------------------------------------------------------------------------- +-- +-- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +-- its licensors. +-- +-- For complete copyright and license terms please see the LICENSE at the root of this +-- distribution (the "License"). All use of this software is governed by the License, +-- or, if provided, by the license below or the license accompanying this file. Do not +-- remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- +-- +---------------------------------------------------------------------------------------------------- + +-- This functor hides the properties for disabled material layers. + +function GetMaterialPropertyDependencies() + return { + "blend.enableLayer2", + "blend.enableLayer3" + } +end + +function SetLayerVisibility(context, layerNamePrefix, isVisible) + + local visibility = MaterialPropertyGroupVisibility_Enabled + if(not isVisible) then + visibility = MaterialPropertyGroupVisibility_Hidden + end + + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "baseColor", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "metallic", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "roughness", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "specularF0", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "normal", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "clearCoat", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "occlusion", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "emissive", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "parallax", visibility) + context:SetMaterialPropertyGroupVisibility(layerNamePrefix .. "uv", visibility) +end + +function ProcessEditor(context) + local enableLayer2 = context:GetMaterialPropertyValue_bool("blend.enableLayer2") + local enableLayer3 = context:GetMaterialPropertyValue_bool("blend.enableLayer3") + + SetLayerVisibility(context, "layer2_", context:GetMaterialPropertyValue_bool("blend.enableLayer2")) + SetLayerVisibility(context, "layer3_", context:GetMaterialPropertyValue_bool("blend.enableLayer3")) +end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Parallax.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Parallax.lua deleted file mode 100644 index 8880a4b842..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Parallax.lua +++ /dev/null @@ -1,97 +0,0 @@ --------------------------------------------------------------------------------------- --- --- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or --- its licensors. --- --- For complete copyright and license terms please see the LICENSE at the root of this --- distribution (the "License"). All use of this software is governed by the License, --- or, if provided, by the license below or the license accompanying this file. Do not --- remove or modify any license notices. This file is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- --- ----------------------------------------------------------------------------------------------------- - --- This functor handles general parallax properties that affect the entire material. - -function GetMaterialPropertyDependencies() - return { - "parallax.enable", - "layer1_parallax.enable", - "layer2_parallax.enable", - "layer3_parallax.enable", - "layer1_parallax.factor", - "layer2_parallax.factor", - "layer3_parallax.factor", - "layer1_parallax.offset", - "layer2_parallax.offset", - "layer3_parallax.offset" - } -end - -function GetShaderOptionDependencies() - return {"o_parallax_feature_enabled"} -end - -function MergeRange(heightMinMax, offset, factor) - top = offset - bottom = offset - factor - - if(heightMinMax[1] == nil) then - heightMinMax[1] = top - else - heightMinMax[1] = math.max(heightMinMax[1], top) - end - - if(heightMinMax[0] == nil) then - heightMinMax[0] = bottom - else - heightMinMax[0] = math.min(heightMinMax[0], bottom) - end -end - -function Process(context) - local enableParallax = context:GetMaterialPropertyValue_bool("parallax.enable") - local enable1 = context:GetMaterialPropertyValue_bool("layer1_parallax.enable") - local enable2 = context:GetMaterialPropertyValue_bool("layer2_parallax.enable") - local enable3 = context:GetMaterialPropertyValue_bool("layer3_parallax.enable") - enableParallax = enableParallax and (enable1 or enable2 or enable3) - context:SetShaderOptionValue_bool("o_parallax_feature_enabled", enableParallax) - - if(enableParallax) then - local factorLayer1 = context:GetMaterialPropertyValue_float("layer1_parallax.factor") - local factorLayer2 = context:GetMaterialPropertyValue_float("layer2_parallax.factor") - local factorLayer3 = context:GetMaterialPropertyValue_float("layer3_parallax.factor") - - local offsetLayer1 = context:GetMaterialPropertyValue_float("layer1_parallax.offset") - local offsetLayer2 = context:GetMaterialPropertyValue_float("layer2_parallax.offset") - local offsetLayer3 = context:GetMaterialPropertyValue_float("layer3_parallax.offset") - - local heightMinMax = {nil, nil} - if(enable1) then MergeRange(heightMinMax, offsetLayer1, factorLayer1) end - if(enable2) then MergeRange(heightMinMax, offsetLayer2, factorLayer2) end - if(enable3) then MergeRange(heightMinMax, offsetLayer3, factorLayer3) end - - if(heightMinMax[1] - heightMinMax[0] < 0.0001) then - context:SetShaderOptionValue_bool("o_parallax_feature_enabled", false) - else - context:SetShaderConstant_float("m_displacementMin", heightMinMax[0]) - context:SetShaderConstant_float("m_displacementMax", heightMinMax[1]) - end - end -end - -function ProcessEditor(context) - local enable = context:GetMaterialPropertyValue_bool("parallax.enable") - - local visibility = MaterialPropertyVisibility_Enabled - if(not enable) then - visibility = MaterialPropertyVisibility_Hidden - end - - context:SetMaterialPropertyVisibility("parallax.parallaxUv", visibility) - context:SetMaterialPropertyVisibility("parallax.algorithm", visibility) - context:SetMaterialPropertyVisibility("parallax.quality", visibility) - context:SetMaterialPropertyVisibility("parallax.pdo", visibility) - context:SetMaterialPropertyVisibility("parallax.showClipping", visibility) -end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ParallaxPerLayer.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ParallaxPerLayer.lua deleted file mode 100644 index 119dfed436..0000000000 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ParallaxPerLayer.lua +++ /dev/null @@ -1,49 +0,0 @@ --------------------------------------------------------------------------------------- --- --- All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or --- its licensors. --- --- For complete copyright and license terms please see the LICENSE at the root of this --- distribution (the "License"). All use of this software is governed by the License, --- or, if provided, by the license below or the license accompanying this file. Do not --- remove or modify any license notices. This file is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- --- ----------------------------------------------------------------------------------------------------- - --- This functor handles parallax properties that are specific to a single layer. - -function GetMaterialPropertyDependencies() - return {"parallax.enable", "parallax.textureMap"} -end - -function GetShaderOptionDependencies() - return {"o_useDepthMap"} -end - -function Process(context) - local enable = context:GetMaterialPropertyValue_bool("parallax.enable") - local textureMap = context:GetMaterialPropertyValue_image("parallax.textureMap") - context:SetShaderOptionValue_bool("o_useDepthMap", enable and textureMap ~= nil) -end - -function ProcessEditor(context) - local enable = context:GetMaterialPropertyValue_bool("parallax.enable") - - if enable then - context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Enabled) - else - context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Hidden) - end - - local textureMap = context:GetMaterialPropertyValue_image("parallax.textureMap") - local visibility = MaterialPropertyVisibility_Enabled - if(not enable or textureMap == nil) then - visibility = MaterialPropertyVisibility_Hidden - end - - context:SetMaterialPropertyVisibility("parallax.factor", visibility) - context:SetMaterialPropertyVisibility("parallax.offset", visibility) - context:SetMaterialPropertyVisibility("parallax.invert", visibility) -end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ShaderEnable.lua index 69df610ab2..778edeea18 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ShaderEnable.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_ShaderEnable.lua @@ -24,7 +24,7 @@ function Process(context) local shadowMap = context:GetShaderByTag("Shadowmap") local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") - local shadowMapWitPS = context:GetShaderByTag("Shadowmap_WithPS") + local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") local forwardPass = context:GetShaderByTag("ForwardPass") local shadingAffectsDepth = parallaxEnabled and parallaxPdoEnabled; @@ -34,6 +34,6 @@ function Process(context) forwardPassEDS:SetEnabled(not shadingAffectsDepth) depthPassWithPS:SetEnabled(shadingAffectsDepth) - shadowMapWitPS:SetEnabled(shadingAffectsDepth) + shadowMapWithPS:SetEnabled(shadingAffectsDepth) forwardPass:SetEnabled(shadingAffectsDepth) end diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.azsl index c76dd15975..6c80dc874b 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.azsl @@ -83,7 +83,7 @@ VertexOutput MainVS(VertexInput IN) } else { - OUT.m_blendMask = float3(1,1,1); + OUT.m_blendMask = float3(0,0,0); } return OUT; @@ -102,12 +102,12 @@ PSDepthOutput MainPS(VertexOutput IN, bool isFrontFace : SV_IsFrontFace) if(ShouldHandleParallaxInDepthShaders()) { - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); - GetDepth_Setup(IN.m_blendMask); + s_blendMaskFromVertexStream = IN.m_blendMask; float depthNDC; diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype index a74ceb1783..183cddd4cb 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR.materialtype @@ -601,7 +601,7 @@ "displayName": "Opacity Mode", "description": "Opacity mode for this texture.", "type": "Enum", - "enumValues": [ "Opaque", "Cutout", "Blended" ], + "enumValues": [ "Opaque", "Cutout", "Blended", "TintedTransparent" ], "defaultValue": "Opaque", "connection": { "type": "ShaderOption", @@ -669,12 +669,12 @@ "description": "Center point for scaling and rotation transformations.", "type": "vector2", "vectorLabels": [ "U", "V" ], - "defaultValue": [ 0.0, 0.0 ] + "defaultValue": [ 0.5, 0.5 ] }, { "id": "tileU", "displayName": "Tile U", - "description": "Scales texture coordinates in V.", + "description": "Scales texture coordinates in U.", "type": "float", "defaultValue": 1.0, "step": 0.1 @@ -879,27 +879,27 @@ } ], "parallax": [ - { - "id": "enable", - "displayName": "Enable", - "description": "Whether to enable the parallax feature.", - "type": "Bool", - "defaultValue": false - }, { "id": "textureMap", - "displayName": "Texture Map", - "description": "Depthmap to create parallax effect.", + "displayName": "Heightmap", + "description": "Displacement heightmap to create parallax effect.", "type": "Image", "connection": { "type": "ShaderInput", - "id": "m_depthMap" + "id": "m_heightmap" } }, + { + "id": "useTexture", + "displayName": "Use Texture", + "description": "Whether to use the heightmap.", + "type": "Bool", + "defaultValue": true + }, { "id": "textureMapUv", "displayName": "UV", - "description": "Depth texture map UV set", + "description": "Heightmap UV set", "type": "Enum", "enumIsUv": true, "defaultValue": "Tiled", @@ -913,12 +913,12 @@ "displayName": "Heightmap Scale", "description": "The total height of the heightmap in local model units.", "type": "Float", - "defaultValue": 0.0, + "defaultValue": 0.05, "min": 0.0, "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_depthFactor" + "id": "m_heightmapScale" } }, { @@ -931,18 +931,7 @@ "softMax": 0.1, "connection": { "type": "ShaderInput", - "id": "m_depthOffset" - } - }, - { - "id": "invert", - "displayName": "Invert", - "description": "Invert to depthmap if the texture is heightmap", - "type": "Bool", - "defaultValue": true, - "connection": { - "type": "ShaderInput", - "id": "m_depthInverted" + "id": "m_heightmapOffset" } }, { @@ -951,7 +940,7 @@ "description": "Select the algorithm to use for parallax mapping.", "type": "Enum", "enumValues": [ "Basic", "Steep", "POM", "Relief", "ContactRefinement" ], - "defaultValue": "Basic", + "defaultValue": "POM", "connection": { "type": "ShaderOption", "id": "o_parallax_algorithm" @@ -1139,7 +1128,7 @@ "type": "float", "defaultValue": 6.0, "min": 0.0, - "softMax": 20.0 + "softMax": 20.0 }, { "id": "transmissionDistortion", @@ -1170,7 +1159,7 @@ } ], "irradiance": [ - // Note: this property group is used in the DiffuseGlobalIllumination pass, it is not read by the StandardPBR shader + // Note: this property group is used in the DiffuseGlobalIllumination pass and not by the main forward shader { "id": "color", "displayName": "Color", @@ -1199,6 +1188,14 @@ "file": "./StandardPBR_ForwardPass_EDS.shader", "tag": "ForwardPass_EDS" }, + { + "file": "./StandardPBR_LowEndForward.shader", + "tag": "LowEndForward" + }, + { + "file": "./StandardPBR_LowEndForward_EDS.shader", + "tag": "LowEndForward_EDS" + }, { "file": "Shaders/Shadow/Shadowmap.shader", "tag": "Shadowmap" @@ -1269,18 +1266,18 @@ "type": "HandleSubsurfaceScatteringParameters", "args": { "mode": "subsurfaceScattering.transmissionMode", - "scale" : "subsurfaceScattering.transmissionScale", - "power" : "subsurfaceScattering.transmissionPower", - "distortion" : "subsurfaceScattering.transmissionDistortion", - "attenuation" : "subsurfaceScattering.transmissionAttenuation", - "tintColor" : "subsurfaceScattering.transmissionTint", - "thickness" : "subsurfaceScattering.thickness", + "scale": "subsurfaceScattering.transmissionScale", + "power": "subsurfaceScattering.transmissionPower", + "distortion": "subsurfaceScattering.transmissionDistortion", + "attenuation": "subsurfaceScattering.transmissionAttenuation", + "tintColor": "subsurfaceScattering.transmissionTint", + "thickness": "subsurfaceScattering.thickness", "enabled": "subsurfaceScattering.enableSubsurfaceScattering", - "scatterDistanceColor" : "subsurfaceScattering.scatterColor", - "scatterDistanceIntensity" : "subsurfaceScattering.scatterDistance", - "scatterDistanceShaderInput" : "m_scatterDistance", - "parametersShaderInput" : "m_transmissionParams", - "tintThickenssShaderInput" : "m_transmissionTintThickness" + "scatterDistanceColor": "subsurfaceScattering.scatterColor", + "scatterDistanceIntensity": "subsurfaceScattering.scatterDistance", + "scatterDistanceShaderInput": "m_scatterDistance", + "parametersShaderInput": "m_transmissionParams", + "tintThickenssShaderInput": "m_transmissionTintThickness" } }, { @@ -1289,10 +1286,6 @@ "textureProperty": "baseColor.textureMap", "useTextureProperty": "baseColor.useTexture", "dependentProperties": ["baseColor.textureMapUv", "baseColor.textureBlendMode"], - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], "shaderOption": "o_baseColor_useTexture" } }, @@ -1302,10 +1295,6 @@ "textureProperty": "metallic.textureMap", "useTextureProperty": "metallic.useTexture", "dependentProperties": ["metallic.textureMapUv"], - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], "shaderOption": "o_metallic_useTexture" } }, @@ -1315,10 +1304,6 @@ "textureProperty": "specularF0.textureMap", "useTextureProperty": "specularF0.useTexture", "dependentProperties": ["specularF0.textureMapUv"], - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], "shaderOption": "o_specularF0_useTexture" } }, @@ -1328,10 +1313,6 @@ "textureProperty": "normal.textureMap", "useTextureProperty": "normal.useTexture", "dependentProperties": ["normal.textureMapUv", "normal.factor", "normal.flipX", "normal.flipY"], - "shaderTags": [ - "ForwardPass", - "ForwardPass_EDS" - ], "shaderOption": "o_normal_useTexture" } }, @@ -1395,15 +1376,6 @@ "file": "StandardPBR_HandleOpacityDoubleSided.lua" } }, - { - "type": "OverrideDrawList", - "args": { - "triggerProperty": "opacity.mode", - "triggerValue": "Blended", - "shaderIndex": 1, - "drawList": "transparent" - } - }, { "type": "Lua", "args": { 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 8289291ef4..ffa00d7efd 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ClearCoatState.lua @@ -34,7 +34,7 @@ function GetShaderOptionDependencies() end function UpdateUseTextureState(context, clearCoatEnabled, textureMapPropertyName, useTexturePropertyName, shaderOptionName) - local textureMap = context:GetMaterialPropertyValue_image(textureMapPropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) local useTextureMap = context:GetMaterialPropertyValue_bool(useTexturePropertyName) context:SetShaderOptionValue_bool(shaderOptionName, clearCoatEnabled and useTextureMap and textureMap ~= nil) end @@ -50,7 +50,7 @@ end -- Note this logic matches that of the UseTextureFunctor class. function UpdateTextureDependentPropertyVisibility(context, textureMapPropertyName, useTexturePropertyName, uvPropertyName) - local textureMap = context:GetMaterialPropertyValue_image(textureMapPropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) local useTexture = context:GetMaterialPropertyValue_bool(useTexturePropertyName) if(textureMap == nil) then diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Common.azsli b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Common.azsli index 5723a6cd1e..87562c3d20 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Common.azsli +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Common.azsli @@ -97,7 +97,7 @@ ShaderResourceGroup MaterialSrg : SRG_PerMaterial // Callback function for ParallaxMapping.azsli DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy) { - return SampleDepthOrHeightMap(MaterialSrg::m_depthInverted, MaterialSrg::m_depthMap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); + return SampleDepthFromHeightmap(MaterialSrg::m_heightmap, MaterialSrg::m_sampler, uv, uv_ddx, uv_ddy); } @@ -106,7 +106,7 @@ COMMON_OPTIONS_PARALLAX() bool ShouldHandleParallax() { // Parallax mapping's non uniform uv transformations break screen space subsurface scattering, disable it when subsurface scattering is enabled. - return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useDepthMap; + return !o_enableSubsurfaceScattering && o_parallax_feature_enabled && o_useHeightmap; } bool ShouldHandleParallaxInDepthShaders() 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 28708c12d5..cc2b4ce659 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 @@ -78,15 +78,15 @@ PSDepthOutput MainPS(VSDepthOutput IN, bool isFrontFace : SV_IsFrontFace) if(ShouldHandleParallaxInDepthShaders()) { - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, OUT.m_depth); } diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_EmissiveState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_EmissiveState.lua index a8ac2e8a4a..7ee5876adb 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_EmissiveState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_EmissiveState.lua @@ -22,7 +22,7 @@ end function Process(context) local enable = context:GetMaterialPropertyValue_bool("emissive.enable") - local textureMap = context:GetMaterialPropertyValue_image("emissive.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("emissive.textureMap") local useTextureMap = context:GetMaterialPropertyValue_bool("emissive.useTexture") context:SetShaderOptionValue_bool("o_emissiveEnabled", enable) @@ -47,7 +47,7 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("emissive.textureMapUv", mainVisibility) if(enable) then - local textureMap = context:GetMaterialPropertyValue_image("emissive.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("emissive.textureMap") local useTextureMap = context:GetMaterialPropertyValue_bool("emissive.useTexture") if(textureMap == nil) then 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 f362349a7b..286b9b23df 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ForwardPass.azsl @@ -10,6 +10,8 @@ * */ +#include "Atom/Features/ShaderQualityOptions.azsli" + #include "StandardPBR_Common.azsli" // SRGs @@ -108,19 +110,12 @@ VSOutput StandardPbr_ForwardPassVS(VSInput IN) PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float depthNDC) { // ------- Tangents & Bitangets ------- + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - - if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering && MaterialSrg::m_parallaxUvIndex != 0) - || (o_normal_useTexture && MaterialSrg::m_normalMapUvIndex != 0) - || (o_clearCoat_enabled && o_clearCoat_normal_useTexture && MaterialSrg::m_clearCoatNormalMapUvIndex != 0) - ) + if ((o_parallax_feature_enabled && !o_enableSubsurfaceScattering) || o_normal_useTexture || (o_clearCoat_enabled && o_clearCoat_normal_useTexture)) { - // Generate the tangent/bitangent for UV[1+] - const int startIndex = 1; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, startIndex); + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); } // ------- Depth & Parallax ------- @@ -135,7 +130,7 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, depthNDC, IN.m_position.w, displacementIsClipped); @@ -299,6 +294,24 @@ PbrLightingOutput ForwardPassPS_Common(VSOutput IN, bool isFrontFace, out float lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse lightingOutput.m_diffuseColor.rgb += lightingOutput.m_specularColor.rgb; // add specular } + else if (o_opacity_mode == OpacityMode::TintedTransparent) + { + // See OpacityMode::Blended above for the basic method. TintedTransparent adds onto the above concept by supporting + // colored alpha. This is currently a very basic calculation that uses the baseColor as a multiplier with strength + // determined by the alpha. We'll modify this later to be more physically accurate and allow surface depth, + // absorption, and interior color to be specified. + // + // The technique uses dual source blending to allow two separate sources to be part of the blending equation + // even though ultimately only a single render target is being written to. m_diffuseColor is render target 0 and + // m_specularColor render target 1, and the blend mode is (dest * source1color) + (source * 1.0). + // + // This means that m_specularColor.rgb (source 1) is multiplied against the destination, then + // m_diffuseColor.rgb (source) is added to that, and the final result is stored in render target 0. + + lightingOutput.m_diffuseColor.rgb *= lightingOutput.m_diffuseColor.w; // pre-multiply diffuse + lightingOutput.m_diffuseColor.rgb += lightingOutput.m_specularColor.rgb; // add specular + lightingOutput.m_specularColor.rgb = baseColor * (1.0 - lightingOutput.m_diffuseColor.w); + } else { // Pack factor and quality, drawback: because of precision limit of float16 cannot represent exact 1, maximum representable value is 0.9961 @@ -317,13 +330,18 @@ ForwardPassOutputWithDepth StandardPbr_ForwardPassPS(VSOutput IN, bool isFrontFa PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; + OUT.m_depth = depth; +#else OUT.m_diffuseColor = lightingOutput.m_diffuseColor; OUT.m_specularColor = lightingOutput.m_specularColor; OUT.m_specularF0 = lightingOutput.m_specularF0; OUT.m_albedo = lightingOutput.m_albedo; OUT.m_normal = lightingOutput.m_normal; OUT.m_depth = depth; - +#endif return OUT; } @@ -335,12 +353,16 @@ ForwardPassOutput StandardPbr_ForwardPassPS_EDS(VSOutput IN, bool isFrontFace : PbrLightingOutput lightingOutput = ForwardPassPS_Common(IN, isFrontFace, depth); +#ifdef UNIFIED_FORWARD_OUTPUT + OUT.m_color.rgb = lightingOutput.m_diffuseColor.rgb + lightingOutput.m_specularColor.rgb; + OUT.m_color.a = lightingOutput.m_diffuseColor.a; +#else OUT.m_diffuseColor = lightingOutput.m_diffuseColor; OUT.m_specularColor = lightingOutput.m_specularColor; OUT.m_specularF0 = lightingOutput.m_specularF0; OUT.m_albedo = lightingOutput.m_albedo; OUT.m_normal = lightingOutput.m_normal; - +#endif return OUT; } 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 6cc595d712..20d3ee47ae 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_HandleOpacityMode.lua @@ -60,10 +60,13 @@ function Process(context) if(opacityMode == OpacityMode_Blended) then ConfigureAlphaBlending(context:GetShader(ForwardPassIndex)) + context:GetShader(ForwardPassIndex):SetDrawListTagOverride("transparent") elseif(opacityMode == OpacityMode_TintedTransparent) then ConfigureDualSourceBlending(context:GetShader(ForwardPassIndex)) + context:GetShader(ForwardPassIndex):SetDrawListTagOverride("transparent") else ResetAlphaBlending(context:GetShader(ForwardPassIndex)) + context:GetShader(ForwardPassIndex):SetDrawListTagOverride("") -- reset to default draw list end end @@ -90,7 +93,7 @@ function ProcessEditor(context) context:SetMaterialPropertyVisibility("opacity.textureMap", MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility("opacity.textureMapUv", MaterialPropertyVisibility_Hidden) else - local textureMap = context:GetMaterialPropertyValue_image("opacity.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("opacity.textureMap") if(nil == textureMap) then context:SetMaterialPropertyVisibility("opacity.textureMapUv", MaterialPropertyVisibility_Disabled) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.azsl new file mode 100644 index 0000000000..c87faffcbe --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.azsl @@ -0,0 +1,17 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +// NOTE: This file is a temporary workaround until .shader files can #define macros for their .azsl files + +#define QUALITY_LOW_END 1 + +#include "StandardPBR_ForwardPass.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.shader new file mode 100644 index 0000000000..44139608ca --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward.shader @@ -0,0 +1,59 @@ +{ + // Note: "LowEnd" shaders are for supporting the low end pipeline + // These shaders can be safely added to materials without incurring additional runtime draw + // items as draw items for shaders are only created if the scene has a pass with a matching + // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items + // for this shader will be created. + + "Source" : "./StandardPBR_LowEndForward.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "lowEndForward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward_EDS.shader b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward_EDS.shader new file mode 100644 index 0000000000..9faa1d3698 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_LowEndForward_EDS.shader @@ -0,0 +1,59 @@ +{ + // Note: "LowEnd" shaders are for supporting the low end pipeline + // These shaders can be safely added to materials without incurring additional runtime draw + // items as draw items for shaders are only created if the scene has a pass with a matching + // DrawListTag. If your pipeline doesn't have a "lowEndForward" DrawListTag, no draw items + // for this shader will be created. + + "Source" : "./StandardPBR_LowEndForward.azsl", + + "DepthStencilState" : + { + "Depth" : + { + "Enable" : true, + "CompareFunc" : "GreaterEqual" + }, + "Stencil" : + { + "Enable" : true, + "ReadMask" : "0x00", + "WriteMask" : "0xFF", + "FrontFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + }, + "BackFace" : + { + "Func" : "Always", + "DepthFailOp" : "Keep", + "FailOp" : "Keep", + "PassOp" : "Replace" + } + } + }, + + "CompilerHints" : { + "DisableOptimizations" : false + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "StandardPbr_ForwardPassVS", + "type": "Vertex" + }, + { + "name": "StandardPbr_ForwardPassPS_EDS", + "type": "Fragment" + } + ] + }, + + "DrawList" : "lowEndForward" +} diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ParallaxState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ParallaxState.lua index 0287e1105e..771726aea7 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ParallaxState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ParallaxState.lua @@ -13,35 +13,39 @@ ---------------------------------------------------------------------------------------------------- function GetMaterialPropertyDependencies() - return {"parallax.enable", "parallax.textureMap"} + return {"parallax.textureMap", "parallax.useTexture"} end function GetShaderOptionDependencies() - return {"o_parallax_feature_enabled", "o_useDepthMap"} + return {"o_parallax_feature_enabled", "o_useHeightmap"} end function Process(context) - local enable = context:GetMaterialPropertyValue_bool("parallax.enable") - local textureMap = context:GetMaterialPropertyValue_image("parallax.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") + local useTexture = context:GetMaterialPropertyValue_bool("parallax.useTexture") + local enable = textureMap ~= nil and useTexture context:SetShaderOptionValue_bool("o_parallax_feature_enabled", enable) - context:SetShaderOptionValue_bool("o_useDepthMap", enable and textureMap ~= nil) + context:SetShaderOptionValue_bool("o_useHeightmap", enable) end function ProcessEditor(context) - local enable = context:GetMaterialPropertyValue_bool("parallax.enable") + local textureMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") - if enable then - context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Enabled) + if textureMap ~= nil then + context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Enabled) else - context:SetMaterialPropertyVisibility("parallax.textureMap", MaterialPropertyVisibility_Hidden) + context:SetMaterialPropertyVisibility("parallax.useTexture", MaterialPropertyVisibility_Hidden) end - local textureMap = context:GetMaterialPropertyValue_image("parallax.textureMap") + local useTexture = context:GetMaterialPropertyValue_bool("parallax.useTexture") + local visibility = MaterialPropertyVisibility_Enabled - if(not enable or textureMap == nil) then + if(textureMap == nil) then visibility = MaterialPropertyVisibility_Hidden + elseif not useTexture then + visibility = MaterialPropertyVisibility_Disabled end - + context:SetMaterialPropertyVisibility("parallax.factor", visibility) context:SetMaterialPropertyVisibility("parallax.offset", visibility) context:SetMaterialPropertyVisibility("parallax.showClipping", visibility) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Roughness.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Roughness.lua index 4887bc47e8..222e69cd3d 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Roughness.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Roughness.lua @@ -21,13 +21,13 @@ function GetShaderOptionDependencies() end function Process(context) - local textureMap = context:GetMaterialPropertyValue_image("roughness.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("roughness.textureMap") local useTexture = context:GetMaterialPropertyValue_bool("roughness.useTexture") context:SetShaderOptionValue_bool("o_roughness_useTexture", useTexture and textureMap ~= nil) end function ProcessEditor(context) - local textureMap = context:GetMaterialPropertyValue_image("roughness.textureMap") + local textureMap = context:GetMaterialPropertyValue_Image("roughness.textureMap") local useTexture = context:GetMaterialPropertyValue_bool("roughness.useTexture") if(nil == textureMap) then diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ShaderEnable.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ShaderEnable.lua index 7c3d989c35..b245fde3df 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ShaderEnable.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_ShaderEnable.lua @@ -13,7 +13,7 @@ ---------------------------------------------------------------------------------------------------- function GetMaterialPropertyDependencies() - return {"opacity.mode", "parallax.enable", "parallax.pdo"} + return {"opacity.mode", "parallax.textureMap", "parallax.useTexture", "parallax.pdo"} end OpacityMode_Opaque = 0 @@ -21,17 +21,38 @@ OpacityMode_Cutout = 1 OpacityMode_Blended = 2 OpacityMode_TintedTransparent = 3 +function TryGetShaderByTag(context, shaderTag) + if context:HasShaderWithTag(shaderTag) then + return context:GetShaderByTag(shaderTag) + else + return nil + end +end + +function TrySetShaderEnabled(shader, enabled) + if shader then + shader:SetEnabled(enabled) + end +end + function Process(context) local opacityMode = context:GetMaterialPropertyValue_enum("opacity.mode") - local parallaxEnabled = context:GetMaterialPropertyValue_bool("parallax.enable") + local displacementMap = context:GetMaterialPropertyValue_Image("parallax.textureMap") + local useDisplacementMap = context:GetMaterialPropertyValue_bool("parallax.useTexture") + local parallaxEnabled = displacementMap ~= nil and useDisplacementMap local parallaxPdoEnabled = context:GetMaterialPropertyValue_bool("parallax.pdo") local depthPass = context:GetShaderByTag("DepthPass") local shadowMap = context:GetShaderByTag("Shadowmap") local forwardPassEDS = context:GetShaderByTag("ForwardPass_EDS") + local depthPassWithPS = context:GetShaderByTag("DepthPass_WithPS") - local shadowMapWitPS = context:GetShaderByTag("Shadowmap_WithPS") + local shadowMapWithPS = context:GetShaderByTag("Shadowmap_WithPS") local forwardPass = context:GetShaderByTag("ForwardPass") + + -- Use TryGetShaderByTag because these shaders only exist in StandardPBR but this script is also used for EnhancedPBR + local lowEndForwardEDS = TryGetShaderByTag(context, "LowEndForward_EDS") + local lowEndForward = TryGetShaderByTag(context, "LowEndForward") if parallaxEnabled and parallaxPdoEnabled then depthPass:SetEnabled(false) @@ -39,16 +60,22 @@ function Process(context) forwardPassEDS:SetEnabled(false) depthPassWithPS:SetEnabled(true) - shadowMapWitPS:SetEnabled(true) + shadowMapWithPS:SetEnabled(true) forwardPass:SetEnabled(true) + + TrySetShaderEnabled(lowEndForwardEDS, false) + TrySetShaderEnabled(lowEndForward, true) else depthPass:SetEnabled(opacityMode == OpacityMode_Opaque) shadowMap:SetEnabled(opacityMode == OpacityMode_Opaque) forwardPassEDS:SetEnabled((opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) depthPassWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) - shadowMapWitPS:SetEnabled(opacityMode == OpacityMode_Cutout) + shadowMapWithPS:SetEnabled(opacityMode == OpacityMode_Cutout) forwardPass:SetEnabled(opacityMode == OpacityMode_Cutout) + + TrySetShaderEnabled(lowEndForwardEDS, (opacityMode == OpacityMode_Opaque) or (opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) + TrySetShaderEnabled(lowEndForward, opacityMode == OpacityMode_Cutout) end context:GetShaderByTag("DepthPassTransparentMin"):SetEnabled((opacityMode == OpacityMode_Blended) or (opacityMode == OpacityMode_TintedTransparent)) diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.azsl b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.azsl index 7f24b29700..8b6fee849e 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.azsl +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_Shadowmap_WithPS.azsl @@ -81,15 +81,14 @@ PSDepthOutput MainPS(VertexOutput IN, bool isFrontFace : SV_IsFrontFace) { static const float ShadowMapDepthBias = 0.000001; - // We support two UV streams, but only a single stream of tangent/bitangent. So for UV[1+] we generated the tangent/bitangent in screen-space. - float3 tangents[UvSetCount] = { IN.m_tangent.xyz, float3(0, 0, 0) }; - float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, float3(0, 0, 0) }; - PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents, 1); + float3 tangents[UvSetCount] = { IN.m_tangent.xyz, IN.m_tangent.xyz }; + float3 bitangents[UvSetCount] = { IN.m_bitangent.xyz, IN.m_bitangent.xyz }; + PrepareGeneratedTangent(IN.m_normal, IN.m_worldPosition, isFrontFace, IN.m_uv, UvSetCount, tangents, bitangents); float3x3 uvMatrix = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrix : CreateIdentity3x3(); float3x3 uvMatrixInverse = MaterialSrg::m_parallaxUvIndex == 0 ? MaterialSrg::m_uvMatrixInverse : CreateIdentity3x3(); - GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_depthFactor, MaterialSrg::m_depthOffset, + GetParallaxInput(IN.m_normal, tangents[MaterialSrg::m_parallaxUvIndex], bitangents[MaterialSrg::m_parallaxUvIndex], MaterialSrg::m_heightmapScale, MaterialSrg::m_heightmapOffset, ObjectSrg::GetWorldMatrix(), uvMatrix, uvMatrixInverse, IN.m_uv[MaterialSrg::m_parallaxUvIndex], IN.m_worldPosition, OUT.m_depth); diff --git a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_SubsurfaceState.lua b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_SubsurfaceState.lua index fb07ac89a3..d8a69ba355 100644 --- a/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_SubsurfaceState.lua +++ b/Gems/Atom/Feature/Common/Assets/Materials/Types/StandardPBR_SubsurfaceState.lua @@ -35,7 +35,7 @@ TransmissionMode_ThickObject = 1 TransmissionMode_ThinObject = 2 function UpdateUseTextureState(context, subsurfaceScatteringEnabled, textureMapPropertyName, useTexturePropertyName, shaderOptionName) - local textureMap = context:GetMaterialPropertyValue_image(textureMapPropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) local useTextureMap = context:GetMaterialPropertyValue_bool(useTexturePropertyName) context:SetShaderOptionValue_bool(shaderOptionName, subsurfaceScatteringEnabled and useTextureMap and textureMap ~= nil) end @@ -53,7 +53,7 @@ function UpdateTextureDependentPropertyVisibility(context, featureEnabled, textu context:SetMaterialPropertyVisibility(useTexturePropertyName, MaterialPropertyVisibility_Hidden) context:SetMaterialPropertyVisibility(uvPropertyName, MaterialPropertyVisibility_Hidden) else - local textureMap = context:GetMaterialPropertyValue_image(textureMapPropertyName) + local textureMap = context:GetMaterialPropertyValue_Image(textureMapPropertyName) local useTextureMap = context:GetMaterialPropertyValue_bool(useTexturePropertyName) if(textureMap == nil) then diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass b/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass index 31a8ed1879..b66e3bb4e1 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/Forward.pass @@ -148,22 +148,6 @@ }, "LoadAction": "Clear" } - }, - { - "Name": "ScatterDistanceOutput", - "SlotType": "Output", - "ScopeAttachmentUsage": "RenderTarget", - "LoadStoreAction": { - "ClearValue": { - "Value": [ - 0.0, - 0.0, - 0.0, - 0.0 - ] - }, - "LoadAction": "Clear" - } } ], "ImageAttachments": [ @@ -238,19 +222,6 @@ "AssetRef": { "FilePath": "Textures/BRDFTexture.attimage" } - }, - { - "Name": "ScatterDistanceImage", - "SizeSource": { - "Source": { - "Pass": "Parent", - "Attachment": "SwapChainOutput" - } - }, - "ImageDescriptor": { - "Format": "R11G11B10_FLOAT", - "SharedQueueMask": "Graphics" - } } ], "Connections": [ @@ -295,13 +266,6 @@ "Pass": "This", "Attachment": "BRDFTexture" } - }, - { - "LocalSlot": "ScatterDistanceOutput", - "AttachmentRef": { - "Pass": "This", - "Attachment": "ScatterDistanceImage" - } } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Passes/LightAdaptationParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/LightAdaptationParent.pass new file mode 100644 index 0000000000..ff55ebc200 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/LightAdaptationParent.pass @@ -0,0 +1,146 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "LightAdaptationParentTemplate", + "PassClass": "ParentPass", + "Slots": [ + // Inputs... + { + "Name": "LightingInput", + "SlotType": "Input" + }, + // SwapChain here is only used to reference the frame height and format + { + "Name": "SwapChainOutput", + "SlotType": "InputOutput" + }, + // Outputs... + { + "Name": "Output", + "SlotType": "Output" + }, + // Debug Outputs... + { + "Name": "LuminanceMipChainOutput", + "SlotType": "Output" + } + ], + "Connections": [ + { + "LocalSlot": "Output", + "AttachmentRef": { + "Pass": "DisplayMapperPass", + "Attachment": "Output" + } + }, + { + "LocalSlot": "LuminanceMipChainOutput", + "AttachmentRef": { + "Pass": "DownsampleLuminanceMipChain", + "Attachment": "MipChainInputOutput" + } + } + ], + "PassRequests": [ + { + "Name": "DownsampleLuminanceMinAvgMax", + "TemplateName": "DownsampleLuminanceMinAvgMaxCS", + "Connections": [ + { + "LocalSlot": "Input", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "LightingInput" + } + } + ] + }, + { + "Name": "DownsampleLuminanceMipChain", + "TemplateName": "DownsampleMipChainTemplate", + "Connections": [ + { + "LocalSlot": "MipChainInputOutput", + "AttachmentRef": { + "Pass": "DownsampleLuminanceMinAvgMax", + "Attachment": "Output" + } + } + ], + "PassData": { + "$type": "DownsampleMipChainPassData", + "ShaderAsset": { + "FilePath": "Shaders/PostProcessing/DownsampleMinAvgMaxCS.shader" + } + } + }, + { + "Name": "EyeAdaptationPass", + "TemplateName": "EyeAdaptationTemplate", + "Enabled": true, + "Connections": [ + { + "LocalSlot": "SceneLuminanceInput", + "AttachmentRef": { + "Pass": "DownsampleLuminanceMipChain", + "Attachment": "MipChainInputOutput" + } + } + ] + }, + { + "Name": "LookModificationTransformPass", + "TemplateName": "LookModificationTransformTemplate", + "Enabled": true, + "Connections": [ + { + "LocalSlot": "Input", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "LightingInput" + } + }, + { + "LocalSlot": "EyeAdaptationDataInput", + "AttachmentRef": { + "Pass": "EyeAdaptationPass", + "Attachment": "EyeAdaptationDataInputOutput" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + }, + { + "Name": "DisplayMapperPass", + "TemplateName": "DisplayMapperTemplate", + "Enabled": true, + "Connections": [ + { + "LocalSlot": "Input", + "AttachmentRef": { + "Pass": "LookModificationTransformPass", + "Attachment": "Output" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + } + ] + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/LowEndForward.pass b/Gems/Atom/Feature/Common/Assets/Passes/LowEndForward.pass new file mode 100644 index 0000000000..4b865fcb6d --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/LowEndForward.pass @@ -0,0 +1,133 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "LowEndForwardPassTemplate", + "PassClass": "RasterPass", + "Slots": [ + // Inputs... + { + "Name": "BRDFTextureInput", + "ShaderInputName": "m_brdfMap", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader" + }, + { + "Name": "DirectionalLightShadowmap", + "ShaderInputName": "m_directionalLightShadowmap", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader", + "ImageViewDesc": { + "IsArray": 1 + } + }, + { + "Name": "ExponentialShadowmapDirectional", + "ShaderInputName": "m_directionalLightExponentialShadowmap", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader", + "ImageViewDesc": { + "IsArray": 1 + } + }, + { + "Name": "ProjectedShadowmap", + "ShaderInputName": "m_projectedShadowmaps", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader", + "ImageViewDesc": { + "IsArray": 1 + } + }, + { + "Name": "ExponentialShadowmapProjected", + "ShaderInputName": "m_projectedExponentialShadowmap", + "SlotType": "Input", + "ScopeAttachmentUsage": "Shader", + "ImageViewDesc": { + "IsArray": 1 + } + }, + { + "Name": "TileLightData", + "SlotType": "Input", + "ShaderInputName": "m_tileLightData", + "ScopeAttachmentUsage": "Shader" + }, + { + "Name": "LightListRemapped", + "SlotType": "Input", + "ShaderInputName": "m_lightListRemapped", + "ScopeAttachmentUsage": "Shader" + }, + // Input/Outputs... + { + "Name": "DepthStencilInputOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "DepthStencil" + }, + // Outputs... + { + "Name": "LightingOutput", + "SlotType": "Output", + "ScopeAttachmentUsage": "RenderTarget", + "LoadStoreAction": { + "ClearValue": { + "Value": [ + 0.0, + 0.0, + 0.0, + 0.0 + ] + }, + "LoadAction": "Clear" + } + } + ], + "ImageAttachments": [ + { + "Name": "LightingAttachment", + "SizeSource": { + "Source": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + }, + "MultisampleSource": { + "Pass": "This", + "Attachment": "DepthStencilInputOutput" + }, + "ImageDescriptor": { + "Format": "R16G16B16A16_FLOAT", + "SharedQueueMask": "Graphics" + } + }, + { + "Name": "BRDFTexture", + "Lifetime": "Imported", + "AssetRef": { + "FilePath": "Textures/BRDFTexture.attimage" + } + } + ], + "Connections": [ + { + "LocalSlot": "LightingOutput", + "AttachmentRef": { + "Pass": "This", + "Attachment": "LightingAttachment" + } + }, + { + "LocalSlot": "BRDFTextureInput", + "AttachmentRef": { + "Pass": "This", + "Attachment": "BRDFTexture" + } + } + ] + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/LowEndPipeline.pass b/Gems/Atom/Feature/Common/Assets/Passes/LowEndPipeline.pass new file mode 100644 index 0000000000..38a4524aa2 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/LowEndPipeline.pass @@ -0,0 +1,351 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "LowEndPipelineTemplate", + "PassClass": "ParentPass", + "Slots": [ + { + "Name": "SwapChainOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget" + } + ], + "PassRequests": [ + { + "Name": "MorphTargetPass", + "TemplateName": "MorphTargetPassTemplate" + }, + { + "Name": "SkinningPass", + "TemplateName": "SkinningPassTemplate", + "Connections": [ + { + "LocalSlot": "SkinnedMeshOutputStream", + "AttachmentRef": { + "Pass": "MorphTargetPass", + "Attachment": "MorphTargetDeltaOutput" + } + } + ] + }, + { + "Name": "DepthPrePass", + "TemplateName": "DepthMSAAParentTemplate", + "Connections": [ + { + "LocalSlot": "SkinnedMeshes", + "AttachmentRef": { + "Pass": "SkinningPass", + "Attachment": "SkinnedMeshOutputStream" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + }, + { + "Name": "LightCullingPass", + "TemplateName": "LightCullingParentTemplate", + "Connections": [ + { + "LocalSlot": "SkinnedMeshes", + "AttachmentRef": { + "Pass": "SkinningPass", + "Attachment": "SkinnedMeshOutputStream" + } + }, + { + "LocalSlot": "DepthMSAA", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "DepthMSAA" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + }, + { + "Name": "ShadowPass", + "TemplateName": "ShadowParentTemplate", + "Connections": [ + { + "LocalSlot": "SkinnedMeshes", + "AttachmentRef": { + "Pass": "SkinningPass", + "Attachment": "SkinnedMeshOutputStream" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + }, + { + "Name": "ForwardPass", + "TemplateName": "LowEndForwardPassTemplate", + "Connections": [ + // Inputs... + { + "LocalSlot": "DirectionalLightShadowmap", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "DirectionalShadowmap" + } + }, + { + "LocalSlot": "ExponentialShadowmapDirectional", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "DirectionalESM" + } + }, + { + "LocalSlot": "ProjectedShadowmap", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "ProjectedShadowmap" + } + }, + { + "LocalSlot": "ExponentialShadowmapProjected", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "ProjectedESM" + } + }, + { + "LocalSlot": "TileLightData", + "AttachmentRef": { + "Pass": "LightCullingPass", + "Attachment": "TileLightData" + } + }, + { + "LocalSlot": "LightListRemapped", + "AttachmentRef": { + "Pass": "LightCullingPass", + "Attachment": "LightListRemapped" + } + }, + // Input/Outputs... + { + "LocalSlot": "DepthStencilInputOutput", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "DepthMSAA" + } + } + ], + "PassData": { + "$type": "RasterPassData", + "DrawListTag": "lowEndForward", + "PipelineViewTag": "MainCamera", + "PassSrgAsset": { + "FilePath": "shaderlib/atom/features/pbr/forwardpasssrg.azsli:PassSrg" + } + } + }, + { + "Name": "SkyBoxPass", + "TemplateName": "SkyBoxTemplate", + "Enabled": true, + "Connections": [ + { + "LocalSlot": "SpecularInputOutput", + "AttachmentRef": { + "Pass": "ForwardPass", + "Attachment": "LightingOutput" + } + }, + { + "LocalSlot": "SkyBoxDepth", + "AttachmentRef": { + "Pass": "ForwardPass", + "Attachment": "DepthStencilInputOutput" + } + } + ] + }, + { + "Name": "MSAAResolvePass", + "TemplateName": "MSAAResolveColorTemplate", + "Connections": [ + { + "LocalSlot": "Input", + "AttachmentRef": { + "Pass": "SkyBoxPass", + "Attachment": "SpecularInputOutput" + } + } + ] + }, + { + "Name": "TransparentPass", + "TemplateName": "TransparentParentTemplate", + "Connections": [ + { + "LocalSlot": "DirectionalShadowmap", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "DirectionalShadowmap" + } + }, + { + "LocalSlot": "DirectionalESM", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "DirectionalESM" + } + }, + { + "LocalSlot": "ProjectedShadowmap", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "ProjectedShadowmap" + } + }, + { + "LocalSlot": "ProjectedESM", + "AttachmentRef": { + "Pass": "ShadowPass", + "Attachment": "ProjectedESM" + } + }, + { + "LocalSlot": "TileLightData", + "AttachmentRef": { + "Pass": "LightCullingPass", + "Attachment": "TileLightData" + } + }, + { + "LocalSlot": "LightListRemapped", + "AttachmentRef": { + "Pass": "LightCullingPass", + "Attachment": "LightListRemapped" + } + }, + { + "LocalSlot": "InputLinearDepth", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "DepthLinear" + } + }, + { + "LocalSlot": "DepthStencil", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "Depth" + } + }, + { + "LocalSlot": "InputOutput", + "AttachmentRef": { + "Pass": "MSAAResolvePass", + "Attachment": "Output" + } + } + ] + }, + { + "Name": "LightAdaptation", + "TemplateName": "LightAdaptationParentTemplate", + "Connections": [ + { + "LocalSlot": "LightingInput", + "AttachmentRef": { + "Pass": "TransparentPass", + "Attachment": "InputOutput" + } + }, + { + "LocalSlot": "SwapChainOutput", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + }, + { + "Name": "AuxGeomPass", + "TemplateName": "AuxGeomPassTemplate", + "Enabled": true, + "Connections": [ + { + "LocalSlot": "ColorInputOutput", + "AttachmentRef": { + "Pass": "LightAdaptation", + "Attachment": "Output" + } + }, + { + "LocalSlot": "DepthInputOutput", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "Depth" + } + } + ], + "PassData": { + "$type": "RasterPassData", + "DrawListTag": "auxgeom", + "PipelineViewTag": "MainCamera" + } + }, + { + "Name": "UIPass", + "TemplateName": "UIParentTemplate", + "Connections": [ + { + "LocalSlot": "InputOutput", + "AttachmentRef": { + "Pass": "AuxGeomPass", + "Attachment": "ColorInputOutput" + } + } + ] + }, + { + "Name": "CopyToSwapChain", + "TemplateName": "FullscreenCopyTemplate", + "Connections": [ + { + "LocalSlot": "Input", + "AttachmentRef": { + "Pass": "UIPass", + "Attachment": "InputOutput" + } + }, + { + "LocalSlot": "Output", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "SwapChainOutput" + } + } + ] + } + ] + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass index ee943f6d39..af7408b48c 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/MainPipeline.pass @@ -251,6 +251,13 @@ "Attachment": "LightListRemapped" } }, + { + "LocalSlot": "InputLinearDepth", + "AttachmentRef": { + "Pass": "DepthPrePass", + "Attachment": "DepthLinear" + } + }, { "LocalSlot": "DepthStencil", "AttachmentRef": { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass index dda120e164..a691fe2534 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/OpaqueParent.pass @@ -305,7 +305,7 @@ }, { "Name": "SkyBoxPass", - "TemplateName": "SkyBoxTemplate", + "TemplateName": "SkyBoxTwoOutputsTemplate", "Enabled": true, "Connections": [ { diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset index b83ab65ff2..c56e8932b1 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset +++ b/Gems/Atom/Feature/Common/Assets/Passes/PassTemplates.azasset @@ -92,6 +92,10 @@ "Name": "SkyBoxTemplate", "Path": "Passes/SkyBox.pass" }, + { + "Name": "SkyBoxTwoOutputsTemplate", + "Path": "Passes/SkyBox_TwoOutputs.pass" + }, { "Name": "UIPassTemplate", "Path": "Passes/UI.pass" @@ -483,6 +487,18 @@ { "Name": "UIParentTemplate", "Path": "Passes/UIParent.pass" + }, + { + "Name": "LightAdaptationParentTemplate", + "Path": "Passes/LightAdaptationParent.pass" + }, + { + "Name": "LowEndForwardPassTemplate", + "Path": "Passes/LowEndForward.pass" + }, + { + "Name": "LowEndPipelineTemplate", + "Path": "Passes/LowEndPipeline.pass" } ] } diff --git a/Gems/Atom/Feature/Common/Assets/Passes/PostProcessParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/PostProcessParent.pass index 37b1ee5c5a..36f7f1e985 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/PostProcessParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/PostProcessParent.pass @@ -40,7 +40,7 @@ { "LocalSlot": "Output", "AttachmentRef": { - "Pass": "DisplayMapperPass", + "Pass": "LightAdaptation", "Attachment": "Output" } }, @@ -54,8 +54,8 @@ { "LocalSlot": "LuminanceMipChainOutput", "AttachmentRef": { - "Pass": "DownsampleLuminanceMipChain", - "Attachment": "MipChainInputOutput" + "Pass": "LightAdaptation", + "Attachment": "LuminanceMipChainOutput" } } ], @@ -115,94 +115,16 @@ } ] }, - // Everything before this point deals in raw lighting values - // --------------------------------------------------------- - // Everything after starts to map to values we see on screen { - "Name": "DownsampleLuminanceMinAvgMax", - "TemplateName": "DownsampleLuminanceMinAvgMaxCS", + "Name": "LightAdaptation", + "TemplateName": "LightAdaptationParentTemplate", "Connections": [ { - "LocalSlot": "Input", + "LocalSlot": "LightingInput", "AttachmentRef": { "Pass": "BloomPass", "Attachment": "InputOutput" } - } - ] - }, - { - "Name": "DownsampleLuminanceMipChain", - "TemplateName": "DownsampleMipChainTemplate", - "Connections": [ - { - "LocalSlot": "MipChainInputOutput", - "AttachmentRef": { - "Pass": "DownsampleLuminanceMinAvgMax", - "Attachment": "Output" - } - } - ], - "PassData": { - "$type": "DownsampleMipChainPassData", - "ShaderAsset": { - "FilePath": "Shaders/PostProcessing/DownsampleMinAvgMaxCS.shader" - } - } - }, - { - "Name": "EyeAdaptationPass", - "TemplateName": "EyeAdaptationTemplate", - "Enabled": false, - "Connections": [ - { - "LocalSlot": "SceneLuminanceInput", - "AttachmentRef": { - "Pass": "DownsampleLuminanceMipChain", - "Attachment": "MipChainInputOutput" - } - } - ] - }, - { - "Name": "LookModificationTransformPass", - "TemplateName": "LookModificationTransformTemplate", - "Enabled": true, - "Connections": [ - { - "LocalSlot": "Input", - "AttachmentRef": { - "Pass": "BloomPass", - "Attachment": "InputOutput" - } - }, - { - "LocalSlot": "EyeAdaptationDataInput", - "AttachmentRef": { - "Pass": "EyeAdaptationPass", - "Attachment": "EyeAdaptationDataInputOutput" - } - }, - { - "LocalSlot": "SwapChainOutput", - "AttachmentRef": { - "Pass": "Parent", - "Attachment": "SwapChainOutput" - } - } - ] - }, - { - "Name": "DisplayMapperPass", - "TemplateName": "DisplayMapperTemplate", - "Enabled": true, - "Connections": [ - { - "LocalSlot": "Input", - "AttachmentRef": { - "Pass": "LookModificationTransformPass", - "Attachment": "Output" - } }, { "LocalSlot": "SwapChainOutput", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SkyBox.pass b/Gems/Atom/Feature/Common/Assets/Passes/SkyBox.pass index 57f442e5de..fb16271ba7 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/SkyBox.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/SkyBox.pass @@ -12,11 +12,6 @@ "SlotType": "InputOutput", "ScopeAttachmentUsage": "RenderTarget" }, - { - "Name": "ReflectionInputOutput", - "SlotType": "InputOutput", - "ScopeAttachmentUsage": "RenderTarget" - }, { "Name": "SkyBoxDepth", "SlotType": "InputOutput", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/SkyBox_TwoOutputs.pass b/Gems/Atom/Feature/Common/Assets/Passes/SkyBox_TwoOutputs.pass new file mode 100644 index 0000000000..0ed7b39288 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Passes/SkyBox_TwoOutputs.pass @@ -0,0 +1,43 @@ +{ + "Type": "JsonSerialization", + "Version": 1, + "ClassName": "PassAsset", + "ClassData": { + "PassTemplate": { + "Name": "SkyBoxTwoOutputsTemplate", + "PassClass": "FullScreenTriangle", + "Slots": [ + { + "Name": "SpecularInputOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget" + }, + { + "Name": "ReflectionInputOutput", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "RenderTarget" + }, + { + "Name": "SkyBoxDepth", + "SlotType": "InputOutput", + "ScopeAttachmentUsage": "DepthStencil" + } + ], + "PassData": { + "$type": "FullscreenTrianglePassData", + "ShaderAsset": { + "FilePath": "shaders/skybox/skybox_twooutputs.shader" + }, + "PipelineViewTag": "MainCamera", + "ShaderDataMappings": { + "FloatMappings": [ + { + "Name": "m_sunIntensityMultiplier", + "Value": 1.0 + } + ] + } + } + } + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass b/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass index 415aa2fec0..3bb184a1f8 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/Transparent.pass @@ -67,6 +67,12 @@ "ShaderInputName": "m_lightListRemapped", "ScopeAttachmentUsage": "Shader" }, + { + "Name": "InputLinearDepth", + "SlotType": "Input", + "ShaderInputName": "m_linearDepthTexture", + "ScopeAttachmentUsage": "Shader" + }, // Input/Outputs { "Name": "DepthStencil", diff --git a/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass b/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass index 32517484f3..b278f2bcb4 100644 --- a/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass +++ b/Gems/Atom/Feature/Common/Assets/Passes/TransparentParent.pass @@ -32,6 +32,10 @@ "Name": "LightListRemapped", "SlotType": "Input" }, + { + "Name": "InputLinearDepth", + "SlotType": "Input" + }, // Input/Outputs... { "Name": "DepthStencil", @@ -91,6 +95,13 @@ "Attachment": "LightListRemapped" } }, + { + "LocalSlot": "InputLinearDepth", + "AttachmentRef": { + "Pass": "Parent", + "Attachment": "InputLinearDepth" + } + }, // Input/Outputs... { "LocalSlot": "DepthStencil", diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli index 8bcd21b19b..60d5bf38f2 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/LightCulling/NVLC.azsli @@ -26,7 +26,7 @@ // //---------------------------------------------------------------------------------- -#define Depth_to_Z(d, unprojectZ) (unprojectZ.x / (d + unprojectZ.y)) +#define DepthBufferToViewSpace(d, unprojectZ) (unprojectZ.x / (d + unprojectZ.y)) #define NVLC_MAX_POSSIBLE_LIGHTS_PER_BIN 256 @@ -187,7 +187,7 @@ float4 RemapZToUnit(float4 z, float2 minmaxz) uint DepthSamplesToBinMask2x(float2 d, float2 minmaxz, float2 unprojectZ) { - float2 z = Depth_to_Z(d, unprojectZ); + float2 z = DepthBufferToViewSpace(d, unprojectZ); // Tile_UnitValueToBit will convert that 0 to 1 value into 0.0 to 31.99999 float2 bit = Tile_UnitValueToBit(RemapZToUnit(z, minmaxz)); @@ -207,7 +207,7 @@ uint DepthSamplesToBinMask2x(float2 d, float2 minmaxz, float2 unprojectZ) uint DepthSamplesToBinMask4x(float4 d, float2 minmaxz, float2 unprojectZ) { - float4 z = Depth_to_Z(d, unprojectZ); + float4 z = DepthBufferToViewSpace(d, unprojectZ); // Tile_UnitValueToBit will convert that 0 to 1 value into 0.0 to 31.99999 float4 bit = Tile_UnitValueToBit(RemapZToUnit(z, minmaxz)); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/DefaultObjectSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/DefaultObjectSrg.azsli index 50896cdf25..abc4ec7fc4 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/DefaultObjectSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/DefaultObjectSrg.azsli @@ -31,6 +31,16 @@ ShaderResourceGroup ObjectSrg : SRG_PerObject return SceneSrg::GetObjectToWorldInverseTransposeMatrix(m_objectId); } + //[GFX TODO][ATOM-15280] Move wrinkle mask data from the default object srg into something specific to the Skin shader + uint m_wrinkle_mask_count; + float4 m_wrinkle_mask_weights[4]; + Texture2D m_wrinkle_masks[16]; + + float GetWrinkleMaskWeight(uint index) + { + return m_wrinkle_mask_weights[index / 4][index % 4]; + } + //! Reflection Probe (smallest probe volume that overlaps the object position) struct ReflectionProbeData { diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassOutput.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassOutput.azsli index acc215f1c9..5821deb3b1 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassOutput.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/ForwardPassOutput.azsli @@ -10,6 +10,21 @@ * */ +#ifdef UNIFIED_FORWARD_OUTPUT + +struct ForwardPassOutput +{ + float4 m_color : SV_Target0; +}; + +struct ForwardPassOutputWithDepth +{ + float4 m_color : SV_Target0; + float m_depth : SV_Depth; +}; + +#else + struct ForwardPassOutput { float4 m_diffuseColor : SV_Target0; //!< RGB = Diffuse Lighting, A = Blend Alpha (for blended surfaces) OR A = special encoding of surfaceScatteringFactor, m_subsurfaceScatteringQuality, o_enableSubsurfaceScattering @@ -30,3 +45,5 @@ struct ForwardPassOutputWithDepth float4 m_normal : SV_Target4; float m_depth : SV_Depth; }; + +#endif diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli index 7400005508..3be9d5756a 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/Lights/Ibl.azsli @@ -12,38 +12,39 @@ #pragma once +// --- Static Options Available --- +// FORCE_IBL_IN_FORWARD_PASS - forces IBL lighting to be run in the forward pass, used in pipelines that don't have a reflection pass + #include #include #include #include -void ApplyIblDiffuse( +float3 GetIblDiffuse( float3 normal, float3 albedo, - float3 diffuseResponse, - out float3 outDiffuse) + float3 diffuseResponse) { float3 irradianceDir = MultiplyVectorQuaternion(normal, SceneSrg::m_iblOrientation); float3 diffuseSample = SceneSrg::m_diffuseEnvMap.Sample(SceneSrg::m_samplerEnv, GetCubemapCoords(irradianceDir)).rgb; - outDiffuse = diffuseResponse * albedo * diffuseSample; + return diffuseResponse * albedo * diffuseSample; } -void ApplyIblSpecular( +float3 GetIblSpecular( float3 position, float3 normal, float3 specularF0, float roughnessLinear, float3 dirToCamera, - float2 brdf, - out float3 outSpecular) + float2 brdf) { float3 reflectDir = reflect(-dirToCamera, normal); reflectDir = MultiplyVectorQuaternion(reflectDir, SceneSrg::m_iblOrientation); // global - outSpecular = SceneSrg::m_specularEnvMap.SampleLevel(SceneSrg::m_samplerEnv, GetCubemapCoords(reflectDir), GetRoughnessMip(roughnessLinear)).rgb; + float3 outSpecular = SceneSrg::m_specularEnvMap.SampleLevel(SceneSrg::m_samplerEnv, GetCubemapCoords(reflectDir), GetRoughnessMip(roughnessLinear)).rgb; outSpecular *= (specularF0 * brdf.x + brdf.y); // reflection probe @@ -72,86 +73,55 @@ void ApplyIblSpecular( outSpecular = lerp(outSpecular, probeSpecular, blendAmount); } + return outSpecular; } void ApplyIBL(Surface surface, inout LightingData lightingData) { - if (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent) +#ifdef FORCE_IBL_IN_FORWARD_PASS + bool useDiffuseIbl = true; + bool useSpecularIbl = true; + bool useIbl = o_enableIBL; +#else + bool isTransparent = (o_opacity_mode == OpacityMode::Blended || o_opacity_mode == OpacityMode::TintedTransparent); + bool useDiffuseIbl = isTransparent; + bool useSpecularIbl = (isTransparent || o_meshUseForwardPassIBLSpecular || o_materialUseForwardPassIBLSpecular); + bool useIbl = o_enableIBL && (useDiffuseIbl || useSpecularIbl); +#endif + + if(useIbl) { - // transparencies currently require IBL in the forward pass - if (o_enableIBL) + float iblExposureFactor = pow(2.0, SceneSrg::m_iblExposure); + + if(useDiffuseIbl) { - float3 iblDiffuse = 0.0f; - ApplyIblDiffuse( - surface.normal, - surface.albedo, - lightingData.diffuseResponse, - iblDiffuse); - - float3 iblSpecular = 0.0f; - ApplyIblSpecular( - surface.position, - surface.normal, - surface.specularF0, - surface.roughnessLinear, - lightingData.dirToCamera, - lightingData.brdf, - iblSpecular); - - // Adjust IBL lighting by exposure. - float iblExposureFactor = pow(2.0, SceneSrg::m_iblExposure); + float3 iblDiffuse = GetIblDiffuse(surface.normal, surface.albedo, lightingData.diffuseResponse); lightingData.diffuseLighting += (iblDiffuse * iblExposureFactor * lightingData.diffuseAmbientOcclusion); - lightingData.specularLighting += (iblSpecular * iblExposureFactor); } - } - else if (o_meshUseForwardPassIBLSpecular || o_materialUseForwardPassIBLSpecular) - { - if (o_enableIBL) - { - float3 iblSpecular = 0.0f; - ApplyIblSpecular( - surface.position, - surface.normal, - surface.specularF0, - surface.roughnessLinear, - lightingData.dirToCamera, - lightingData.brdf, - iblSpecular); + if(useSpecularIbl) + { + float3 iblSpecular = GetIblSpecular(surface.position, surface.normal, surface.specularF0, surface.roughnessLinear, lightingData.dirToCamera, lightingData.brdf); iblSpecular *= lightingData.multiScatterCompensation; - if (o_clearCoat_feature_enabled) + if (o_clearCoat_feature_enabled && surface.clearCoat.factor > 0.0f) { - if (surface.clearCoat.factor > 0.0f) - { - float clearCoatNdotV = saturate(dot(surface.clearCoat.normal, lightingData.dirToCamera)); - clearCoatNdotV = max(clearCoatNdotV, 0.01f); // [GFX TODO][ATOM-4466] This is a current band-aid for specular noise at grazing angles. - float2 clearCoatBrdf = PassSrg::m_brdfMap.Sample(PassSrg::LinearSampler, GetBRDFTexCoords(surface.clearCoat.roughness, clearCoatNdotV)).rg; + float clearCoatNdotV = saturate(dot(surface.clearCoat.normal, lightingData.dirToCamera)); + clearCoatNdotV = max(clearCoatNdotV, 0.01f); // [GFX TODO][ATOM-4466] This is a current band-aid for specular noise at grazing angles. + float2 clearCoatBrdf = PassSrg::m_brdfMap.Sample(PassSrg::LinearSampler, GetBRDFTexCoords(surface.clearCoat.roughness, clearCoatNdotV)).rg; - // clear coat uses fixed IOR = 1.5 represents polyurethane which is the most common material for gloss clear coat - // coat layer assumed to be dielectric thus don't need multiple scattering compensation - float3 clearCoatSpecularF0 = float3(0.04f, 0.04f, 0.04f); - float3 clearCoatIblSpecular = 0.0f; + // clear coat uses fixed IOR = 1.5 represents polyurethane which is the most common material for gloss clear coat + // coat layer assumed to be dielectric thus don't need multiple scattering compensation + float3 clearCoatSpecularF0 = float3(0.04f, 0.04f, 0.04f); + float3 clearCoatIblSpecular = GetIblSpecular(surface.position, surface.clearCoat.normal, clearCoatSpecularF0, surface.clearCoat.roughness, lightingData.dirToCamera, clearCoatBrdf); - ApplyIblSpecular( - surface.position, - surface.clearCoat.normal, - clearCoatSpecularF0, - surface.clearCoat.roughness, - lightingData.dirToCamera, - clearCoatBrdf, - clearCoatIblSpecular); - - clearCoatIblSpecular *= surface.clearCoat.factor; + clearCoatIblSpecular *= surface.clearCoat.factor; - // attenuate base layer energy - float3 clearCoatResponse = FresnelSchlickWithRoughness(clearCoatNdotV, clearCoatSpecularF0, surface.clearCoat.roughness) * surface.clearCoat.factor; - iblSpecular = iblSpecular * (1.0 - clearCoatResponse) * (1.0 - clearCoatResponse) + clearCoatIblSpecular; - } + // attenuate base layer energy + float3 clearCoatResponse = FresnelSchlickWithRoughness(clearCoatNdotV, clearCoatSpecularF0, surface.clearCoat.roughness) * surface.clearCoat.factor; + iblSpecular = iblSpecular * (1.0 - clearCoatResponse) * (1.0 - clearCoatResponse) + clearCoatIblSpecular; } - - float iblExposureFactor = pow(2.0f, SceneSrg::m_iblExposure); lightingData.specularLighting += (iblSpecular * iblExposureFactor); } } 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 bb63d27df0..1a74a68e96 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 @@ -43,7 +43,6 @@ class Surface }; - // Specular Anti-Aliasing technique from this paper: // http://www.jp.square-enix.com/tech/library/pdf/ImprovedGeometricSpecularAA.pdf void Surface::ApplySpecularAA() diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli index 14cff21739..d9367f9d03 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/PBR/TransparentPassSrg.azsli @@ -35,4 +35,5 @@ ShaderResourceGroup PassSrg : SRG_PerPass Texture2D m_tileLightData; StructuredBuffer m_lightListRemapped; + Texture2D m_linearDepthTexture; } diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli index 8b1efc8eea..ff2a37d29b 100644 --- a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ParallaxMapping.azsli @@ -58,7 +58,7 @@ DepthResult DepthResultAbsolute(float depth) //! The client shader must define this function. //! This allows the client shader to implement special depth map sampling, for example procedurally generating or blending depth maps. -//! In simple cases though, the implementation of GetDepth() can simply call SampleDepthOrHeightMap(). +//! In simple cases though, the implementation of GetDepth() can simply call SampleDepthFromHeightmap(). //! @param uv the UV coordinates to use for sampling //! @param uv_ddx will be set to ddx_fine(uv) //! @param uv_ddy will be set to ddy_fine(uv) @@ -66,13 +66,12 @@ DepthResult DepthResultAbsolute(float depth) DepthResult GetDepth(float2 uv, float2 uv_ddx, float2 uv_ddy); //! Convenience function that can be used to implement GetDepth(). -//! @param isHeightmap indicates whether to sample the map is a height map rather than a depth map. //! @return see struct DepthResult. In this case it will always contain a Code::Normalized result. -DepthResult SampleDepthOrHeightMap(bool isHeightmap, Texture2D map, sampler mapSampler, float2 uv, float2 uv_ddx, float2 uv_ddy) +DepthResult SampleDepthFromHeightmap(Texture2D map, sampler mapSampler, float2 uv, float2 uv_ddx, float2 uv_ddy) { DepthResult result; result.m_resultCode = DepthResultCode_Normalized; - result.m_depth = abs((isHeightmap * 1.0) - map.SampleGrad(mapSampler, uv, uv_ddx, uv_ddy).r); + result.m_depth = 1.0 - map.SampleGrad(mapSampler, uv, uv_ddx, uv_ddy).r; return result; } @@ -169,20 +168,20 @@ ParallaxOffset AdvancedParallaxMapping(float depthFactor, float depthOffset, flo float2 ddx_uv = ddx_fine(uv); float2 ddy_uv = ddy_fine(uv); - float depthSearchStart = -depthOffset; + float depthSearchStart = depthOffset; float depthSearchEnd = depthSearchStart + depthFactor; float inverseDepthFactor = 1.0 / depthFactor; // This is the relative position at which we begin searching for intersection. // It is adjusted according to the depthOffset, raising or lowering the whole surface by depthOffset units. - float3 parallaxOffset = dirToCameraTS.xyz * dirToCameraZInverse * depthOffset; + float3 parallaxOffset = -dirToCameraTS.xyz * dirToCameraZInverse * depthOffset; // Get an initial heightmap sample to start the intersection search, starting at our initial parallaxOffset position. float currentSample = GetNormalizedDepth(depthSearchStart, depthSearchEnd, inverseDepthFactor, uv + parallaxOffset.xy, ddx_uv, ddy_uv); float prevSample; - // Note that when depthOffset < 0, we could actually narrow the search so that instead of going through the entire [depthSearchStart,depthSearchEnd] range + // Note that when depthOffset > 0, we could actually narrow the search so that instead of going through the entire [depthSearchStart,depthSearchEnd] range // of the heightmap, we could go through the range [0,depthSearchEnd]. This would give more accurate results and fewer artifacts // in case where the magnitude of depthOffset is significant. But for the sake of simplicity we currently search the whole range in all cases. @@ -271,7 +270,7 @@ ParallaxOffset AdvancedParallaxMapping(float depthFactor, float depthOffset, flo } // Even though we do a bunch of clamping above when calling GetClampedDepth(), there are still cases where the parallax offset - // can be noticeably above the surface and still needs to be clamped here. The main case is when depthFactor==0 and depthOffset>1. + // can be noticeably above the surface and still needs to be clamped here. The main case is when depthFactor==0 and depthOffset<1. if(parallaxOffset.z > 0.0) { parallaxOffset = float3(0,0,0); @@ -371,13 +370,13 @@ ParallaxOffset CalculateParallaxOffset(float depthFactor, float depthOffset, flo // @param dirToCameraTS - normalized direction to the camera, in tangent space. // @param dirToLightTS - normalized direction to a light source, in tangent space, for self-shadowing (if enabled via o_parallax_shadow). ParallaxOffset GetParallaxOffset( float depthFactor, - float depthOffset, - float2 uv, - float3 dirToCameraWS, - float3 tangentWS, - float3 bitangentWS, - float3 normalWS, - float3x3 uvMatrix) + float depthOffset, + float2 uv, + float3 dirToCameraWS, + float3 tangentWS, + float3 bitangentWS, + float3 normalWS, + float3x3 uvMatrix) { // Tangent space eye vector float3 dirToCameraTS = normalize(WorldSpaceToTangent(dirToCameraWS, normalWS, tangentWS, bitangentWS)); diff --git a/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli new file mode 100644 index 0000000000..cc4aa7cf42 --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/ShaderLib/Atom/Features/ShaderQualityOptions.azsli @@ -0,0 +1,26 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +// This file translates quality option macros like QUALITY_LOW_END to their relevant settings + +#ifdef QUALITY_LOW_END + + // Unifies the forward output into a single lighting buffer instead of splitting it into a GBuffer + #define UNIFIED_FORWARD_OUTPUT 1 + + // Forces IBL lighting to be executed in the forward pass instead of subsequent refleciton passes + #define FORCE_IBL_IN_FORWARD_PASS 1 + +#endif + diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl index a5d761d815..c96828e23f 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseComposite_nomsaa.azsl @@ -91,7 +91,7 @@ float3 SampleProbeIrradiance(uint2 probeIrradianceCoords, float depth, float3 no { for (int x = -extent; x <= extent; ++x) { - float3 downsampledNormal = PassSrg::m_downsampledNormal.Load(int3(probeIrradianceCoords, 0), int2(x, y)).rgb; + float3 downsampledNormal = PassSrg::m_downsampledNormal.Load(int3(probeIrradianceCoords + int2(x, y), 0)).rgb; downsampledNormal = downsampledNormal * 2.0f - 1.0f; float normalDot = dot(downsampledNormal, normal); @@ -100,10 +100,10 @@ float3 SampleProbeIrradiance(uint2 probeIrradianceCoords, float depth, float3 no if (normalDot > NormalMatchTolerance) { // the normals are almost identical, if the depth is within the tolerance we can optimize by just taking this sample - float downsampledDepth = PassSrg::m_downsampledDepth.Load(int3(probeIrradianceCoords, 0), int2(x, y)).r; + float downsampledDepth = PassSrg::m_downsampledDepth.Load(int3(probeIrradianceCoords + int2(x, y), 0)).r; if (abs(depth - downsampledDepth) <= DepthTolerance) { - float3 probeIrradiance = PassSrg::m_downsampledProbeIrradiance.Load(int3(probeIrradianceCoords,0), int2(x, y)).rgb; + float3 probeIrradiance = PassSrg::m_downsampledProbeIrradiance.Load(int3(probeIrradianceCoords + int2(x, y),0)).rgb; probeIrradiance = saturate(probeIrradiance); return probeIrradiance; } @@ -115,7 +115,7 @@ float3 SampleProbeIrradiance(uint2 probeIrradianceCoords, float depth, float3 no } } - float3 probeIrradiance = PassSrg::m_downsampledProbeIrradiance.Load(int3(probeIrradianceCoords, 0), closestOffset).rgb; + float3 probeIrradiance = PassSrg::m_downsampledProbeIrradiance.Load(int3(probeIrradianceCoords + closestOffset, 0)).rgb; probeIrradiance = saturate(probeIrradiance); return probeIrradiance; } diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl index f10fc67da5..d2e73927e0 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/DiffuseGlobalIllumination/DiffuseProbeGridDownsample_nomsaa.azsl @@ -70,8 +70,8 @@ PSOutput MainPS(VSOutput IN) { for (uint x = 0; x < ImageScale; ++x) { - float depth = PassSrg::m_depth.Load(int3(screenCoords, 0), int2(x, y)).r; - float4 encodedNormal = PassSrg::m_normal.Load(int3(screenCoords, 0), int2(x, y)); + float depth = PassSrg::m_depth.Load(int3(screenCoords + int2(x, y), 0)).r; + float4 encodedNormal = PassSrg::m_normal.Load(int3(screenCoords + int2(x, y), 0)); // take the closest depth sample to ensure we're getting the normal closest to the viewer // (larger depth value due to reverse depth) diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl index fba2175c9b..a8b2ab76db 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/LightCulling/LightCullingTilePrepare.azsl @@ -150,7 +150,7 @@ uint ComputeTransparentBitMask(float2 minmaxZ) return 0; } - float2 minmaxZ_transparent = Depth_to_Z(minmaxDepth_transparent, PassSrg::m_constantData.m_unprojectZ); + float2 minmaxZ_transparent = DepthBufferToViewSpace(minmaxDepth_transparent, PassSrg::m_constantData.m_unprojectZ); float2 minmaxUnit_transparent = RemapZToUnit(minmaxZ_transparent, minmaxZ); @@ -295,7 +295,7 @@ void MainCS( float2 minmaxDepth_opaque = ComputeDepthMinMaxFrom2Samples(opaqueDepthSamples); minmaxDepth_both = ExpandMinMax(minmaxDepth_opaque, minmaxDepth_transparent); UpdateMinMaxFromAllThreads(minmaxDepth_both, minmaxDepth_transparent, isPixelOnScreen); - minmaxDepth_both = Depth_to_Z(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ); + minmaxDepth_both = DepthBufferToViewSpace(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ); // if zNear == zFar we want to map z == zNear to 0-bit, so we have to keep zNear without modifications minmaxDepth_both.y = IncrementULP(minmaxDepth_both.y); @@ -313,7 +313,7 @@ void MainCS( float2 minmaxDepth_opaque = ComputeDepthMinMaxFrom4Samples(opaqueDepthSamples); minmaxDepth_both = ExpandMinMax(minmaxDepth_opaque, minmaxDepth_transparent); UpdateMinMaxFromAllThreads(minmaxDepth_both, minmaxDepth_transparent, isPixelOnScreen); - minmaxDepth_both = Depth_to_Z(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ); + minmaxDepth_both = DepthBufferToViewSpace(minmaxDepth_both, PassSrg::m_constantData.m_unprojectZ); // if zNear == zFar we want to map z == zNear to 0-bit, so we have to keep zNear without modifications minmaxDepth_both.y = IncrementULP(minmaxDepth_both.y); diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox.azsl b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox.azsl index 1ee30a4f98..1bebb2ec47 100644 --- a/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox.azsl +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox.azsl @@ -10,6 +10,9 @@ * */ +// --- Static Options Available --- +// SKYBOX_TWO_OUTPUTS - Skybox renders to two rendertargets instead of one (SkyBox_TwoOutputs.pass writes to specular and reflection targets) + #include #include #include @@ -102,7 +105,9 @@ float3 GetCubemapCoords(float3 original) struct PSOutput { float4 m_specular : SV_Target0; +#ifdef SKYBOX_TWO_OUTPUTS float4 m_reflection : SV_Target1; +#endif }; PSOutput MainPS(VSOutput input) @@ -163,6 +168,8 @@ PSOutput MainPS(VSOutput input) PSOutput OUT; OUT.m_specular = float4(color, 1.0); +#ifdef SKYBOX_TWO_OUTPUTS OUT.m_reflection = float4(color, 1.0); +#endif return OUT; } diff --git a/Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.cpp b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.azsl similarity index 77% rename from Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.cpp rename to Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.azsl index 6fdd7bdc45..feacd2f44f 100644 --- a/Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.cpp +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.azsl @@ -10,4 +10,8 @@ * */ -#include "precompiled.h" +// NOTE: This file is a temporary workaround until .shader files can #define macros for their .azsl files + +#define SKYBOX_TWO_OUTPUTS + +#include "SkyBox.azsl" diff --git a/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.shader b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.shader new file mode 100644 index 0000000000..ec80d4a20e --- /dev/null +++ b/Gems/Atom/Feature/Common/Assets/Shaders/SkyBox/SkyBox_TwoOutputs.shader @@ -0,0 +1,22 @@ +{ + "Source" : "SkyBox_TwoOutputs", + + "DepthStencilState" : { + "Depth" : { "Enable" : true, "CompareFunc" : "GreaterEqual" } + }, + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "MainVS", + "type": "Vertex" + }, + { + "name": "MainPS", + "type": "Fragment" + } + ] + } +} diff --git a/Gems/Atom/Feature/Common/Assets/Textures/DefaultBlendMask_layers.png b/Gems/Atom/Feature/Common/Assets/Textures/DefaultBlendMask_layers.png index d1606516af..5e60261dd7 100644 --- a/Gems/Atom/Feature/Common/Assets/Textures/DefaultBlendMask_layers.png +++ b/Gems/Atom/Feature/Common/Assets/Textures/DefaultBlendMask_layers.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f74ffab6ee15906158d27cbd2e5556e8fcdfd7820c0d0fd4b403de8a7af81662 -size 5651 +oid sha256:6660fa05dbf1e90298472fb41d99fff80a80de64ee88d17af4d0df3bdafb1ff6 +size 52877 diff --git a/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/AreaTex.dds.assetinfo b/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/AreaTex.dds.assetinfo index 53dbfb2623..72a7948174 100644 --- a/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/AreaTex.dds.assetinfo +++ b/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/AreaTex.dds.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/SearchTex.dds.assetinfo b/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/SearchTex.dds.assetinfo index 3ae9447621..86d698d24e 100644 --- a/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/SearchTex.dds.assetinfo +++ b/Gems/Atom/Feature/Common/Assets/Textures/PostProcessing/SearchTex.dds.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/Atom/Feature/Common/Assets/Textures/sampleEnvironment/PaperMill_E_3k.exr.assetinfo b/Gems/Atom/Feature/Common/Assets/Textures/sampleEnvironment/PaperMill_E_3k.exr.assetinfo index da00149fb0..16cb0dd668 100644 --- a/Gems/Atom/Feature/Common/Assets/Textures/sampleEnvironment/PaperMill_E_3k.exr.assetinfo +++ b/Gems/Atom/Feature/Common/Assets/Textures/sampleEnvironment/PaperMill_E_3k.exr.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + 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 84ef494216..841cdf67c8 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 @@ -33,11 +33,12 @@ set(FILES Materials/Types/StandardMultilayerPBR_Common.azsli Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.azsl Materials/Types/StandardMultilayerPBR_DepthPass_WithPS.shader + Materials/Types/StandardMultilayerPBR_Displacement.lua Materials/Types/StandardMultilayerPBR_ForwardPass.azsl Materials/Types/StandardMultilayerPBR_ForwardPass.shader Materials/Types/StandardMultilayerPBR_ForwardPass_EDS.shader - Materials/Types/StandardMultilayerPBR_Parallax.lua - Materials/Types/StandardMultilayerPBR_ParallaxPerLayer.lua + Materials/Types/StandardMultilayerPBR_LayerEnable.lua + Materials/Types/StandardMultilayerPBR_ShaderEnable.lua Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.azsl Materials/Types/StandardMultilayerPBR_Shadowmap_WithPS.shader Materials/Types/StandardPBR.materialtype @@ -52,6 +53,9 @@ set(FILES Materials/Types/StandardPBR_ForwardPass_EDS.shader Materials/Types/StandardPBR_HandleOpacityDoubleSided.lua Materials/Types/StandardPBR_HandleOpacityMode.lua + Materials/Types/StandardPBR_LowEndForward.azsl + Materials/Types/StandardPBR_LowEndForward.shader + Materials/Types/StandardPBR_LowEndForward_EDS.shader Materials/Types/StandardPBR_ParallaxState.lua Materials/Types/StandardPBR_Roughness.lua Materials/Types/StandardPBR_ShaderEnable.lua @@ -116,6 +120,7 @@ set(FILES Passes/DiffuseProbeGridBlendDistance.pass Passes/DiffuseProbeGridBlendIrradiance.pass Passes/DiffuseProbeGridBorderUpdate.pass + Passes/DiffuseProbeGridClassification.pass Passes/DiffuseProbeGridDownsample.pass Passes/DiffuseProbeGridRayTracing.pass Passes/DiffuseProbeGridRelocation.pass @@ -144,6 +149,7 @@ set(FILES Passes/FullscreenCopy.pass Passes/FullscreenOutputOnly.pass Passes/ImGui.pass + Passes/LightAdaptationParent.pass Passes/LightCulling.pass Passes/LightCullingHeatmap.pass Passes/LightCullingParent.pass @@ -152,6 +158,8 @@ set(FILES Passes/LightCullingTilePrepareMSAA.pass Passes/LookModificationComposite.pass Passes/LookModificationTransform.pass + Passes/LowEndForward.pass + Passes/LowEndPipeline.pass Passes/LuminanceHeatmap.pass Passes/LuminanceHistogramGenerator.pass Passes/MainPipeline.pass @@ -179,13 +187,16 @@ set(FILES Passes/ReflectionScreenSpace.pass Passes/ReflectionScreenSpaceBlur.pass Passes/ReflectionScreenSpaceBlurHorizontal.pass + Passes/ReflectionScreenSpaceBlurMobile.pass Passes/ReflectionScreenSpaceBlurVertical.pass Passes/ReflectionScreenSpaceComposite.pass + Passes/ReflectionScreenSpaceMobile.pass Passes/ReflectionScreenSpaceTrace.pass Passes/Reflections_nomsaa.pass Passes/ShadowParent.pass Passes/Skinning.pass Passes/SkyBox.pass + Passes/SkyBox_TwoOutputs.pass Passes/SMAA1xApplyLinearHDRColor.pass Passes/SMAA1xApplyPerceptualColor.pass Passes/SMAABlendingWeightCalculation.pass @@ -205,6 +216,7 @@ set(FILES ShaderLib/Atom/Features/IndirectRendering.azsli ShaderLib/Atom/Features/MatrixUtility.azsli ShaderLib/Atom/Features/ParallaxMapping.azsli + ShaderLib/Atom/Features/ShaderQualityOptions.azsli ShaderLib/Atom/Features/SphericalHarmonicsUtility.azsli ShaderLib/Atom/Features/SrgSemantics.azsli ShaderLib/Atom/Features/ColorManagement/TransformColor.azsli @@ -272,6 +284,7 @@ set(FILES ShaderLib/Atom/Features/PostProcessing/GlyphData.azsli ShaderLib/Atom/Features/PostProcessing/GlyphRender.azsli ShaderLib/Atom/Features/PostProcessing/PostProcessUtil.azsli + ShaderLib/Atom/Features/RayTracing/RayTracingSceneSrg.azsli ShaderLib/Atom/Features/ScreenSpace/ScreenSpaceUtil.azsli ShaderLib/Atom/Features/Shadow/BicubicPcfFilters.azsli ShaderLib/Atom/Features/Shadow/DirectionalLightShadow.azsli @@ -471,4 +484,6 @@ set(FILES Shaders/SkinnedMesh/LinearSkinningPassSRG.azsli Shaders/SkyBox/SkyBox.azsl Shaders/SkyBox/SkyBox.shader + Shaders/SkyBox/SkyBox_TwoOutputs.azsl + Shaders/SkyBox/SkyBox_TwoOutputs.shader ) diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h index a89653c359..03fbb93923 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h @@ -60,6 +60,12 @@ namespace AZ : public DisplayMapperFeatureProcessorInterface { public: + enum OutputDeviceTransformFlags + { + AlterSurround = 0x1, // Apply gamma adjustment to compensate for dim surround + ApplyDesaturation = 0x2, // Apply desaturation to compensate for luminance difference + ApplyCATD60toD65 = 0x4, // Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point + }; AZ_RTTI(AZ::Render::AcesDisplayMapperFeatureProcessor, "{995C2B93-8B08-4313-89B0-02394F90F1B8}", AZ::Render::DisplayMapperFeatureProcessorInterface); @@ -92,12 +98,6 @@ namespace AZ static void ApplyLdrOdtParameters(DisplayMapperParameters* pOutParameters); static void ApplyHdrOdtParameters(DisplayMapperParameters* pOutParameters, const OutputDeviceTransformType& odtType); - enum OutputDeviceTransformFlags { - AlterSurround = 0x1, // Apply gamma adjustment to compensate for dim surround - ApplyDesaturation = 0x2, // Apply desaturation to compensate for luminance difference - ApplyCATD60toD65 = 0x4, // Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point - }; - enum OutputDeviceTransformMode { Srgb = 0, PerceptualQuantizer, diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h index 15b416597d..73ce175d99 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessorInterface.h @@ -14,6 +14,9 @@ #include #include +#include +#include +#include namespace AZ { @@ -23,6 +26,57 @@ namespace AZ using DiffuseProbeGridHandle = AZStd::shared_ptr; + enum class DiffuseProbeGridMode : uint8_t + { + RealTime, + Baked, + AutoSelect + }; + + enum class DiffuseProbeGridTextureNotificationType + { + None, + Ready, + Error + }; + + struct DiffuseProbeGridTexture + { + const AZStd::shared_ptr> m_data; + RHI::Format m_format; + RHI::Size m_size; + }; + + static const char* DiffuseProbeGridIrradianceFileName = "Irradiance_lutrgba16.dds"; + static const char* DiffuseProbeGridDistanceFileName = "Distance_lutrg32f.dds"; + static const char* DiffuseProbeGridRelocationFileName = "Relocation_lutrgba16f.dds"; + static const char* DiffuseProbeGridClassificationFileName = "Classification_lutr32f.dds"; + + using DiffuseProbeGridBakeTexturesCallback = AZStd::function; + + struct DiffuseProbeGridBakedTextures + { + // irradiance and distance images can be used directly + Data::Instance m_irradianceImage; + AZStd::string m_irradianceImageRelativePath; + + Data::Instance m_distanceImage; + AZStd::string m_distanceImageRelativePath; + + // relocation and classification images need to be recreated as RW textures + RHI::ImageDescriptor m_relocationImageDescriptor; + AZStd::array_view m_relocationImageData; + AZStd::string m_relocationImageRelativePath; + + RHI::ImageDescriptor m_classificationImageDescriptor; + AZStd::array_view m_classificationImageData; + AZStd::string m_classificationImageRelativePath; + }; + // DiffuseProbeGridFeatureProcessorInterface provides an interface to the feature processor for code outside of Atom class DiffuseProbeGridFeatureProcessorInterface : public RPI::FeatureProcessor @@ -44,6 +98,29 @@ namespace AZ virtual void Enable(const DiffuseProbeGridHandle& probeGrid, bool enable) = 0; virtual void SetGIShadows(const DiffuseProbeGridHandle& probeGrid, bool giShadows) = 0; virtual void SetUseDiffuseIbl(const DiffuseProbeGridHandle& probeGrid, bool useDiffuseIbl) = 0; + virtual void SetMode(const DiffuseProbeGridHandle& probeGrid, DiffuseProbeGridMode mode) = 0; + virtual void SetBakedTextures(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridBakedTextures& bakedTextures) = 0; + + virtual void BakeTextures( + const DiffuseProbeGridHandle& probeGrid, + DiffuseProbeGridBakeTexturesCallback callback, + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) = 0; + + // check for and retrieve a new baked texture asset (does not apply to hot-reloaded assets, only initial bakes) + virtual bool CheckTextureAssetNotification( + const AZStd::string& relativePath, + Data::Asset& outTextureAsset, + DiffuseProbeGridTextureNotificationType& outNotificationType) = 0; + + virtual bool AreBakedTexturesReferenced( + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) = 0; + }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/AcesOutputTransformPass.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/AcesOutputTransformPass.h index 5fce71fc07..5a0ccdb32a 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/AcesOutputTransformPass.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/AcesOutputTransformPass.h @@ -46,6 +46,7 @@ namespace AZ static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); void SetDisplayBufferFormat(RHI::Format format); + void SetAcesParameterOverrides(const AcesParameterOverrides& acesParameterOverrides); private: explicit AcesOutputTransformPass(const RPI::PassDescriptor& descriptor); @@ -65,6 +66,8 @@ namespace AZ AZ::Render::DisplayMapperParameters m_displayMapperParameters = {}; RHI::Format m_displayBufferFormat = RHI::Format::Unknown; + + AcesParameterOverrides m_acesParameterOverrides; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h index b645df4f6f..4dc090b831 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/DisplayMapper/DisplayMapperConfigurationDescriptor.h @@ -24,6 +24,48 @@ namespace AZ namespace Render { + /** + * The ACES display mapper parameter overrides. + * These parameters override default ACES parameters when m_overrideDefaults is true. + */ + struct AcesParameterOverrides final + { + AZ_TYPE_INFO(AcesParameterOverrides, "{3EE8C0D4-3792-46C0-B91C-B89A81C36B91}"); + static void Reflect(ReflectContext* context); + + void LoadPreset(); + + // When enabled allows parameter overrides for ACES configuration + bool m_overrideDefaults = false; + + // Apply gamma adjustment to compensate for dim surround + bool m_alterSurround = true; + // Apply desaturation to compensate for luminance difference + bool m_applyDesaturation = true; + // Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point + bool m_applyCATD60toD65 = true; + + // Reference white and black luminance values + float m_cinemaLimitsBlack = 0.02f; + float m_cinemaLimitsWhite = 48.0f; + + // luminance linear extension below this + float m_minPoint = 0.0028798957f; + // luminance mid grey + float m_midPoint = 4.8f; + // luminance linear extension above this + float m_maxPoint = 1005.71912f; + + // Gamma adjustment to be applied to compensate for the condition of the viewing environment. + // Note that ACES uses a value of 0.9811 for adjusting from dark to dim surrounding. + float m_surroundGamma = 0.9811f; + // Optional gamma value that is applied as basic gamma curve OETF + float m_gamma = 2.2f; + + // Allows specifying default preset for different ODT modes + OutputDeviceTransformType m_preset = OutputDeviceTransformType_48Nits; + }; + //! A descriptor used to configure the DisplayMapper struct DisplayMapperConfigurationDescriptor final { @@ -37,6 +79,8 @@ namespace AZ bool m_ldrGradingLutEnabled = false; Data::Asset m_ldrColorGradingLut; + + AcesParameterOverrides m_acesParameterOverrides; }; //! Custom pass data for DisplayMapperPass. diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h index 7875e38fc0..0d61ef82d1 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessor.h @@ -148,6 +148,8 @@ namespace AZ Data::Instance GetModel(const MeshHandle& meshHandle) const override; Data::Asset GetModelAsset(const MeshHandle& meshHandle) const override; + Data::Instance GetObjectSrg(const MeshHandle& meshHandle) const override; + void QueueObjectSrgForCompile(const MeshHandle& meshHandle) const override; void SetMaterialAssignmentMap(const MeshHandle& meshHandle, const Data::Instance& material) override; void SetMaterialAssignmentMap(const MeshHandle& meshHandle, const MaterialAssignmentMap& materials) override; const MaterialAssignmentMap& GetMaterialAssignmentMap(const MeshHandle& meshHandle) const override; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h index c2360068de..fb5bff5584 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Mesh/MeshFeatureProcessorInterface.h @@ -61,6 +61,14 @@ namespace AZ virtual Data::Instance GetModel(const MeshHandle& meshHandle) const = 0; //! Gets the underlying RPI::ModelAsset for a meshHandle. virtual Data::Asset GetModelAsset(const MeshHandle& meshHandle) const = 0; + //! Gets the ObjectSrg for a meshHandle. + //! Updating the ObjectSrg should be followed by a call to QueueObjectSrgForCompile, + //! instead of compiling the srg directly. This way, if the srg has already been queued for compile, + //! it will not be queued twice in the same frame. The ObjectSrg should not be updated during + //! Simulate, or it will create a race between updating the data and the call to Compile + virtual Data::Instance GetObjectSrg(const MeshHandle& meshHandle) const = 0; + //! Queues the object srg for compile. + virtual void QueueObjectSrgForCompile(const MeshHandle& meshHandle) const = 0; //! Sets the MaterialAssignmentMap for a meshHandle, using just a single material for the DefaultMaterialAssignmentId. //! Note if there is already a material assignment map, this will replace the entire map with just a single material. virtual void SetMaterialAssignmentMap(const MeshHandle& meshHandle, const Data::Instance& material) = 0; diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h index 56ecd7de4d..8bef9ea427 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/MorphTargets/MorphTargetInputBuffers.h @@ -53,6 +53,7 @@ namespace AZ void SetBufferViewsOnShaderResourceGroup(const Data::Instance& perInstanceSRG); private: RHI::Ptr m_vertexDeltaBufferView; + Data::Instance m_vertexDeltaBuffer; }; struct MorphTargetMetaData diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.h b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.h index 101387205f..be761d8e7b 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.h +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.h @@ -1,14 +1,14 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #pragma once @@ -26,14 +26,15 @@ namespace AZ , public AzToolsFramework::EditorEntityVisibilityNotificationBus::Handler { public: - using BaseClass = AzToolsFramework::Components::EditorComponentAdapter; - AZ_RTTI((EditorRenderComponentAdapter, "{AAF38BE4-EA2F-408B-9C44-63C7FBAC6B33}", TController, TRuntimeComponent, TConfiguration), BaseClass); + AZ_RTTI( + (EditorRenderComponentAdapter, "{AAF38BE4-EA2F-408B-9C44-63C7FBAC6B33}", TController, TRuntimeComponent, TConfiguration), + BaseClass); static void Reflect(AZ::ReflectContext* context); EditorRenderComponentAdapter() = default; - EditorRenderComponentAdapter(const TConfiguration& config); + explicit EditorRenderComponentAdapter(const TConfiguration& config); // AzToolsFramework::Components::EditorComponentAdapter overrides void Activate() override; @@ -50,7 +51,8 @@ namespace AZ // Convert pre-existing EditorCompnentAdapter based serialized data to EditorRenderComponentAdapter template - static bool ConvertToEditorRenderComponentAdapter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); + static bool ConvertToEditorRenderComponentAdapter( + AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.inl b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.inl index e3f7ccd44d..633ec0e0ca 100644 --- a/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.inl +++ b/Gems/Atom/Feature/Common/Code/Include/Atom/Feature/Utils/EditorRenderComponentAdapter.inl @@ -1,14 +1,14 @@ /* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ #include #include @@ -19,11 +19,12 @@ namespace AZ { template template - bool EditorRenderComponentAdapter::ConvertToEditorRenderComponentAdapter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) + bool EditorRenderComponentAdapter::ConvertToEditorRenderComponentAdapter( + AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) { if (classElement.GetVersion() < TVersion) { - // Get the and remove the EditorComponentAdapter base class data that was previpously serialized + // Get the and remove the EditorComponentAdapter base class data that was previously serialized AzToolsFramework::Components::EditorComponentAdapter oldBaseClassData; if (!classElement.FindSubElementAndGetData(AZ_CRC("BaseClass1", 0xd4925735), oldBaseClassData)) @@ -41,8 +42,8 @@ namespace AZ // Replace the old base class data with EditorRenderComponentAdapter EditorRenderComponentAdapter newBaseClassData; - AZ::SerializeContext::DataElementNode& newBaseClassElement = classElement.GetSubElement( - classElement.AddElementWithData(context, "BaseClass1", newBaseClassData)); + AZ::SerializeContext::DataElementNode& newBaseClassElement = + classElement.GetSubElement(classElement.AddElementWithData(context, "BaseClass1", newBaseClassData)); // Overwrite EditorRenderComponentAdapter base class data with retrieved EditorComponentAdapter base class data if (!newBaseClassElement.RemoveElementByName(AZ_CRC("BaseClass1", 0xd4925735))) @@ -62,25 +63,24 @@ namespace AZ { BaseClass::Reflect(context); - if (AZ::SerializeContext* serializeContext = azrtti_cast(context)) + if (auto serializeContext = azrtti_cast(context)) { - serializeContext->Class() - ->Version(0) - ; + serializeContext->Class()->Version(0); if (AZ::EditContext* editContext = serializeContext->GetEditContext()) { - editContext->Class( - "EditorRenderComponentAdapter", "") + // clang-format off + editContext->Class("EditorRenderComponentAdapter", "") ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ; + ->Attribute(AZ::Edit::Attributes::AutoExpand, true); + // clang-format on } } } template - EditorRenderComponentAdapter::EditorRenderComponentAdapter(const TConfiguration& config) + EditorRenderComponentAdapter::EditorRenderComponentAdapter( + const TConfiguration& config) : BaseClass(config) { } @@ -103,7 +103,8 @@ namespace AZ bool EditorRenderComponentAdapter::IsVisible() const { bool visible = true; - AzToolsFramework::EditorEntityInfoRequestBus::EventResult(visible, this->GetEntityId(), &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsVisible); + AzToolsFramework::EditorEntityInfoRequestBus::EventResult( + visible, this->GetEntityId(), &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsVisible); return visible; } @@ -114,15 +115,16 @@ namespace AZ } template - void EditorRenderComponentAdapter::OnEntityVisibilityChanged([[maybe_unused]] bool visibility) + void EditorRenderComponentAdapter::OnEntityVisibilityChanged( + [[maybe_unused]] bool visibility) { this->m_controller.Deactivate(); if (this->ShouldActivateController()) { - this->m_controller.Activate(this->GetEntityId()); + AzFramework::Components::ComponentActivateHelper::Activate( + this->m_controller, AZ::EntityComponentIdPair(this->GetEntityId(), this->GetId())); } } - } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h index 39fd7b4380..418ee0cfb8 100644 --- a/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Mocks/MockMeshFeatureProcessor.h @@ -23,6 +23,8 @@ namespace UnitTest MOCK_METHOD1(CloneMesh, MeshHandle(const MeshHandle&)); MOCK_CONST_METHOD1(GetModel, AZStd::intrusive_ptr(const MeshHandle&)); MOCK_CONST_METHOD1(GetModelAsset, AZ::Data::Asset(const MeshHandle&)); + MOCK_CONST_METHOD1(GetObjectSrg, AZStd::intrusive_ptr(const MeshHandle&)); + MOCK_CONST_METHOD1(QueueObjectSrgForCompile, void(const MeshHandle&)); MOCK_CONST_METHOD1(GetMaterialAssignmentMap, const AZ::Render::MaterialAssignmentMap&(const MeshHandle&)); MOCK_METHOD2(ConnectModelChangeEventHandler, void(const MeshHandle&, ModelChangedEvent::Handler&)); MOCK_METHOD3(SetTransform, void(const MeshHandle&, const AZ::Transform&, const AZ::Vector3&)); diff --git a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp index 089a6168b1..16f20d7178 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CommonSystemComponent.cpp @@ -14,8 +14,6 @@ #include #include #include -#include -#include #include #include @@ -114,7 +112,6 @@ namespace AZ ProjectedShadowFeatureProcessor::Reflect(context); SkyBoxFeatureProcessor::Reflect(context); UseTextureFunctor::Reflect(context); - PropertyVisibilityFunctor::Reflect(context); DrawListFunctor::Reflect(context); SubsurfaceTransmissionParameterFunctor::Reflect(context); Transform2DFunctor::Reflect(context); @@ -126,7 +123,6 @@ namespace AZ DisplayMapperPassData::Reflect(context); ConvertEmissiveUnitFunctor::Reflect(context); LookupTableAsset::Reflect(context); - ShaderEnableFunctor::Reflect(context); ReflectionProbeFeatureProcessor::Reflect(context); DecalTextureArrayFeatureProcessor::Reflect(context); SMAAFeatureProcessor::Reflect(context); diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp index ade4b5b592..9b40097716 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.cpp @@ -203,7 +203,7 @@ namespace AZ if (m_shadowingLightHandle.IsValid()) { uint32_t shadowFilterMethod = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_shadowFilterMethod; - RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(AZ::Name{"o_directional_shadow_filtering_method"}, AZ::RPI::ShaderOptionValue{shadowFilterMethod}); + RPI::ShaderSystemInterface::Get()->SetGlobalShaderOption(m_directionalShadowFilteringMethodName, AZ::RPI::ShaderOptionValue{shadowFilterMethod}); const uint32_t cascadeCount = m_shadowData.at(nullptr).GetData(m_shadowingLightHandle.GetIndex()).m_cascadeCount; ShadowProperty& property = m_shadowProperties.GetData(m_shadowingLightHandle.GetIndex()); @@ -656,6 +656,7 @@ namespace AZ CacheRenderPipelineIdsForPersistentView(); SetConfigurationToPasses(); SetCameraViewNameToPass(); + UpdateViewsOfCascadeSegments(); } void DirectionalLightFeatureProcessor::CacheCascadedShadowmapsPass() { @@ -1344,6 +1345,15 @@ namespace AZ } } + void DirectionalLightFeatureProcessor::UpdateViewsOfCascadeSegments() + { + if (m_shadowingLightHandle.IsValid()) + { + const uint16_t cascadeCount = GetCascadeCount(m_shadowingLightHandle); + UpdateViewsOfCascadeSegments(m_shadowingLightHandle, cascadeCount); + } + } + Aabb DirectionalLightFeatureProcessor::CalculateShadowViewAabb( LightHandle handle, const RPI::View* cameraView, diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h index a276ea3f3e..f8c00c859c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/DirectionalLightFeatureProcessor.h @@ -296,6 +296,8 @@ namespace AZ //! This updates the shadowmap view. void UpdateShadowmapViews(LightHandle handle); + void UpdateViewsOfCascadeSegments(); + //! This calculate shadow view AABB. Aabb CalculateShadowViewAabb( LightHandle handle, @@ -372,6 +374,7 @@ namespace AZ uint32_t m_shadowmapIndexTableBufferNameIndex = 0; Name m_lightTypeName = Name("directional"); + Name m_directionalShadowFilteringMethodName = Name("o_directional_shadow_filtering_method"); static constexpr const char* FeatureProcessorName = "DirectionalLightFeatureProcessor"; }; } // namespace Render diff --git a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp index a76467bccd..816ef25bc6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/CoreLights/LightCullingTilePreparePass.cpp @@ -175,12 +175,18 @@ namespace AZ void LightCullingTilePreparePass::OnShaderReinitialized(const AZ::RPI::Shader&) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } void LightCullingTilePreparePass::OnShaderAssetReinitialized(const Data::Asset&) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } void LightCullingTilePreparePass::OnShaderVariantReinitialized( @@ -188,7 +194,10 @@ namespace AZ AZ::RPI::ShaderVariantStableId) { LoadShader(); - ChooseShaderVariant(); + if (!m_flags.m_queuedForBuildAttachment && !m_flags.m_isBuildingAttachments) + { + ChooseShaderVariant(); + } } } // namespace Render diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp index 55fa633e5d..7c97af4f79 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalFeatureProcessor.cpp @@ -279,7 +279,7 @@ namespace AZ if (handle.IsValid()) { Quaternion orientation = world.GetRotation(); - Vector3 scale = world.GetScale() * nonUniformScale; + Vector3 scale = world.GetUniformScale() * nonUniformScale; SetDecalHalfSize(handle, scale); SetDecalPosition(handle, world.GetTranslation()); diff --git a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp index febb0b16c5..e783f3b531 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Decals/DecalTextureArrayFeatureProcessor.cpp @@ -285,7 +285,7 @@ namespace AZ { if (handle.IsValid()) { - SetDecalHalfSize(handle, nonUniformScale * world.GetScale()); + SetDecalHalfSize(handle, nonUniformScale * world.GetUniformScale()); SetDecalPosition(handle, world.GetTranslation()); SetDecalOrientation(handle, world.GetRotation()); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp index 5be1303434..a55d8fc78c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,11 @@ namespace AZ { namespace Render { + DiffuseProbeGrid::DiffuseProbeGrid() + : m_textureReadback(this) + { + } + DiffuseProbeGrid::~DiffuseProbeGrid() { m_scene->GetCullingScene()->UnregisterCullable(m_cullable); @@ -166,6 +172,84 @@ namespace AZ m_updateRenderObjectSrg = true; } + void DiffuseProbeGrid::SetMode(DiffuseProbeGridMode mode) + { + // handle auto-select + if (mode == DiffuseProbeGridMode::AutoSelect) + { + RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); + m_mode = (device->GetFeatures().m_rayTracing) ? DiffuseProbeGridMode::RealTime : DiffuseProbeGridMode::Baked; + } + else + { + m_mode = mode; + } + + m_updateTextures = true; + } + + void DiffuseProbeGrid::SetBakedTextures(const DiffuseProbeGridBakedTextures& bakedTextures) + { + AZ_Assert(bakedTextures.m_irradianceImage.get(), "Invalid Irradiance image passed to SetBakedTextures"); + AZ_Assert(bakedTextures.m_distanceImage.get(), "Invalid Distance image passed to SetBakedTextures"); + AZ_Assert(bakedTextures.m_relocationImageData.size() > 0, "Invalid Relocation image data passed to SetBakedTextures"); + AZ_Assert(bakedTextures.m_classificationImageData.size() > 0, "Invalid Classification image data passed to SetBakedTextures"); + + m_bakedIrradianceImage = bakedTextures.m_irradianceImage; + m_bakedDistanceImage = bakedTextures.m_distanceImage; + + m_bakedIrradianceRelativePath = bakedTextures.m_irradianceImageRelativePath; + m_bakedDistanceRelativePath = bakedTextures.m_distanceImageRelativePath; + m_bakedRelocationRelativePath = bakedTextures.m_relocationImageRelativePath; + m_bakedClassificationRelativePath = bakedTextures.m_classificationImageRelativePath; + + m_bakedRelocationImageData.resize(bakedTextures.m_relocationImageData.size()); + memcpy(m_bakedRelocationImageData.data(), bakedTextures.m_relocationImageData.data(), bakedTextures.m_relocationImageData.size()); + + m_bakedClassificationImageData.resize(bakedTextures.m_classificationImageData.size()); + memcpy(m_bakedClassificationImageData.data(), bakedTextures.m_classificationImageData.data(), bakedTextures.m_classificationImageData.size()); + + // create the relocation and distance RW textures now, these are needed for shader compatibility + // (image data is copied in UpdateTextures) + { + m_bakedRelocationImage = RHI::Factory::Get().CreateImage(); + RHI::ImageInitRequest initRequest; + initRequest.m_image = m_bakedRelocationImage.get(); + initRequest.m_descriptor = RHI::ImageDescriptor::Create2D( + RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, + bakedTextures.m_relocationImageDescriptor.m_size.m_width, + bakedTextures.m_relocationImageDescriptor.m_size.m_height, + bakedTextures.m_relocationImageDescriptor.m_format); + + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(initRequest); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize Relocation image"); + } + + { + m_bakedClassificationImage = RHI::Factory::Get().CreateImage(); + RHI::ImageInitRequest initRequest; + initRequest.m_image = m_bakedClassificationImage.get(); + initRequest.m_descriptor = RHI::ImageDescriptor::Create2D( + RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, + bakedTextures.m_classificationImageDescriptor.m_size.m_width, + bakedTextures.m_classificationImageDescriptor.m_size.m_height, + bakedTextures.m_classificationImageDescriptor.m_format); + + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(initRequest); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize Classification image"); + } + + m_updateTextures = true; + } + + bool DiffuseProbeGrid::HasValidBakedTextures() const + { + return m_bakedIrradianceImage.get() && + m_bakedDistanceImage.get() && + m_bakedRelocationImage.get() && + m_bakedClassificationImage.get(); + } + uint32_t DiffuseProbeGrid::GetTotalProbeCount() const { return m_probeCountX * m_probeCountY * m_probeCountZ; @@ -188,83 +272,117 @@ namespace AZ RHI::Ptr device = RHI::RHISystemInterface::Get()->GetDevice(); - // advance to the next image in the frame image array - m_currentImageIndex = (m_currentImageIndex + 1) % ImageFrameCount; - - // probe raytrace - { - uint32_t width = m_numRaysPerProbe; - uint32_t height = GetTotalProbeCount(); - - m_rayTraceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); - - RHI::ImageInitRequest request; - request.m_image = m_rayTraceImage[m_currentImageIndex].get(); - request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite, width, height, DiffuseProbeGridRenderData::RayTraceImageFormat); - [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); - AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeRayTraceImage image"); - } - uint32_t probeCountX; uint32_t probeCountY; GetTexture2DProbeCount(probeCountX, probeCountY); - // probe irradiance + if (m_mode == DiffuseProbeGridMode::RealTime) { - uint32_t width = probeCountX * (DefaultNumIrradianceTexels + 2); - uint32_t height = probeCountY * (DefaultNumIrradianceTexels + 2); + // advance to the next image in the frame image array + m_currentImageIndex = (m_currentImageIndex + 1) % ImageFrameCount; - m_irradianceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + // probe raytrace + { + uint32_t width = m_numRaysPerProbe; + uint32_t height = GetTotalProbeCount(); - RHI::ImageInitRequest request; - request.m_image = m_irradianceImage[m_currentImageIndex].get(); - request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite, width, height, DiffuseProbeGridRenderData::IrradianceImageFormat); - RHI::ClearValue clearValue = RHI::ClearValue::CreateVector4Float(0.0f, 0.0f, 0.0f, 0.0f); - request.m_optimizedClearValue = &clearValue; - [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); - AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeIrradianceImage image"); + m_rayTraceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + + RHI::ImageInitRequest request; + request.m_image = m_rayTraceImage[m_currentImageIndex].get(); + request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, width, height, DiffuseProbeGridRenderData::RayTraceImageFormat); + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeRayTraceImage image"); + } + + // probe irradiance + { + uint32_t width = probeCountX * (DefaultNumIrradianceTexels + 2); + uint32_t height = probeCountY * (DefaultNumIrradianceTexels + 2); + + m_irradianceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + + RHI::ImageInitRequest request; + request.m_image = m_irradianceImage[m_currentImageIndex].get(); + request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, width, height, DiffuseProbeGridRenderData::IrradianceImageFormat); + RHI::ClearValue clearValue = RHI::ClearValue::CreateVector4Float(0.0f, 0.0f, 0.0f, 0.0f); + request.m_optimizedClearValue = &clearValue; + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeIrradianceImage image"); + } + + // probe distance + { + uint32_t width = probeCountX * (DefaultNumDistanceTexels + 2); + uint32_t height = probeCountY * (DefaultNumDistanceTexels + 2); + + m_distanceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + + RHI::ImageInitRequest request; + request.m_image = m_distanceImage[m_currentImageIndex].get(); + request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, width, height, DiffuseProbeGridRenderData::DistanceImageFormat); + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeDistanceImage image"); + } + + // probe relocation + { + uint32_t width = probeCountX; + uint32_t height = probeCountY; + + m_relocationImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + + RHI::ImageInitRequest request; + request.m_image = m_relocationImage[m_currentImageIndex].get(); + request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, width, height, DiffuseProbeGridRenderData::RelocationImageFormat); + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeRelocationImage image"); + } + + // probe classification + { + uint32_t width = probeCountX; + uint32_t height = probeCountY; + + m_classificationImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + + RHI::ImageInitRequest request; + request.m_image = m_classificationImage[m_currentImageIndex].get(); + request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead, width, height, DiffuseProbeGridRenderData::ClassificationImageFormat); + [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeClassificationImage image"); + } } - - // probe distance + else if (m_mode == DiffuseProbeGridMode::Baked && HasValidBakedTextures()) { - uint32_t width = probeCountX * (DefaultNumDistanceTexels + 2); - uint32_t height = probeCountY * (DefaultNumDistanceTexels + 2); + // copy the baked relocation and classification texture data to the RW textures + // (these need to be RW for shader compatibility) + RHI::ImageSubresourceRange range{ 0, 0, 0 ,0 }; + RHI::ImageSubresourceLayoutPlaced layout; - m_distanceImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); + // relocation + { + m_bakedRelocationImage->GetSubresourceLayouts(range, &layout, nullptr); - RHI::ImageInitRequest request; - request.m_image = m_distanceImage[m_currentImageIndex].get(); - request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite, width, height, DiffuseProbeGridRenderData::DistanceImageFormat); - [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); - AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeDistanceImage image"); - } + RHI::ImageUpdateRequest updateRequest; + updateRequest.m_image = m_bakedRelocationImage.get(); + updateRequest.m_sourceSubresourceLayout = layout; + updateRequest.m_sourceData = m_bakedRelocationImageData.data(); + updateRequest.m_imageSubresourcePixelOffset = RHI::Origin(0, 0, 0); + m_renderData->m_imagePool->UpdateImageContents(updateRequest); + } - // probe relocation - { - uint32_t width = probeCountX; - uint32_t height = probeCountY; + // classification + { + m_bakedClassificationImage->GetSubresourceLayouts(range, &layout, nullptr); - m_relocationImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); - - RHI::ImageInitRequest request; - request.m_image = m_relocationImage[m_currentImageIndex].get(); - request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite, width, height, DiffuseProbeGridRenderData::RelocationImageFormat); - [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); - AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeRelocationImage image"); - } - - // probe classification - { - uint32_t width = probeCountX; - uint32_t height = probeCountY; - - m_classificationImage[m_currentImageIndex] = RHI::Factory::Get().CreateImage(); - - RHI::ImageInitRequest request; - request.m_image = m_classificationImage[m_currentImageIndex].get(); - request.m_descriptor = RHI::ImageDescriptor::Create2D(RHI::ImageBindFlags::ShaderReadWrite, width, height, DiffuseProbeGridRenderData::ClassificationImageFormat); - [[maybe_unused]] RHI::ResultCode result = m_renderData->m_imagePool->InitImage(request); - AZ_Assert(result == RHI::ResultCode::Success, "Failed to initialize m_probeClassificationImage image"); + RHI::ImageUpdateRequest updateRequest; + updateRequest.m_image = m_bakedClassificationImage.get(); + updateRequest.m_sourceSubresourceLayout = layout; + updateRequest.m_sourceData = m_bakedClassificationImageData.data(); + updateRequest.m_imageSubresourcePixelOffset = RHI::Origin(0, 0, 0); + m_renderData->m_imagePool->UpdateImageContents(updateRequest); + } } m_updateTextures = false; @@ -639,16 +757,16 @@ namespace AZ m_renderObjectSrg->SetConstant(constantIndex, m_ambientMultiplier); imageIndex = srgLayout->FindShaderInputImageIndex(Name("m_probeIrradiance")); - m_renderObjectSrg->SetImageView(imageIndex, m_irradianceImage[m_currentImageIndex]->GetImageView(m_renderData->m_probeIrradianceImageViewDescriptor).get()); + m_renderObjectSrg->SetImageView(imageIndex, GetIrradianceImage()->GetImageView(m_renderData->m_probeIrradianceImageViewDescriptor).get()); imageIndex = srgLayout->FindShaderInputImageIndex(Name("m_probeDistance")); - m_renderObjectSrg->SetImageView(imageIndex, m_distanceImage[m_currentImageIndex]->GetImageView(m_renderData->m_probeDistanceImageViewDescriptor).get()); + m_renderObjectSrg->SetImageView(imageIndex, GetDistanceImage()->GetImageView(m_renderData->m_probeDistanceImageViewDescriptor).get()); imageIndex = srgLayout->FindShaderInputImageIndex(Name("m_probeOffsets")); - m_renderObjectSrg->SetImageView(imageIndex, m_relocationImage[m_currentImageIndex]->GetImageView(m_renderData->m_probeRelocationImageViewDescriptor).get()); + m_renderObjectSrg->SetImageView(imageIndex, GetRelocationImage()->GetImageView(m_renderData->m_probeRelocationImageViewDescriptor).get()); imageIndex = srgLayout->FindShaderInputImageIndex(Name("m_probeStates")); - m_renderObjectSrg->SetImageView(imageIndex, m_classificationImage[m_currentImageIndex]->GetImageView(m_renderData->m_probeClassificationImageViewDescriptor).get()); + m_renderObjectSrg->SetImageView(imageIndex, GetClassificationImage()->GetImageView(m_renderData->m_probeClassificationImageViewDescriptor).get()); SetGridConstants(m_renderObjectSrg); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.h index e1ca2123a5..ff6ad719cf 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGrid.h @@ -17,6 +17,7 @@ #include #include #include +#include namespace AZ { @@ -26,11 +27,12 @@ namespace AZ struct DiffuseProbeGridRenderData { + // [GFX TODO][ATOM-15650] Change DiffuseProbeGrid Classification texture to R8_UINT static const RHI::Format RayTraceImageFormat = RHI::Format::R32G32B32A32_FLOAT; static const RHI::Format IrradianceImageFormat = RHI::Format::R16G16B16A16_UNORM; static const RHI::Format DistanceImageFormat = RHI::Format::R32G32_FLOAT; static const RHI::Format RelocationImageFormat = RHI::Format::R16G16B16A16_FLOAT; - static const RHI::Format ClassificationImageFormat = RHI::Format::R8_UINT; + static const RHI::Format ClassificationImageFormat = RHI::Format::R32_FLOAT; // image pool RHI::Ptr m_imagePool; @@ -61,7 +63,7 @@ namespace AZ class DiffuseProbeGrid final { public: - DiffuseProbeGrid() = default; + DiffuseProbeGrid(); ~DiffuseProbeGrid(); void Init(RPI::Scene* scene, DiffuseProbeGridRenderData* diffuseProbeGridRenderData); @@ -96,6 +98,9 @@ namespace AZ bool GetUseDiffuseIbl() const { return m_useDiffuseIbl; } void SetUseDiffuseIbl(bool useDiffuseIbl) { m_useDiffuseIbl = useDiffuseIbl; } + DiffuseProbeGridMode GetMode() const { return m_mode; } + void SetMode(DiffuseProbeGridMode mode); + uint32_t GetNumRaysPerProbe() const { return m_numRaysPerProbe; } uint32_t GetRemainingRelocationIterations() const { return aznumeric_cast(m_remainingRelocationIterations); } @@ -133,11 +138,16 @@ namespace AZ void UpdateRenderObjectSrg(); // textures - const RHI::Ptr& GetRayTraceImage() { return m_rayTraceImage[m_currentImageIndex]; } - const RHI::Ptr& GetIrradianceImage() { return m_irradianceImage[m_currentImageIndex]; } - const RHI::Ptr& GetDistanceImage() { return m_distanceImage[m_currentImageIndex]; } - const RHI::Ptr& GetRelocationImage() { return m_relocationImage[m_currentImageIndex]; } - const RHI::Ptr& GetClassificationImage() { return m_classificationImage[m_currentImageIndex]; } + const RHI::Ptr GetRayTraceImage() { return m_rayTraceImage[m_currentImageIndex]; } + const RHI::Ptr GetIrradianceImage() { return m_mode == DiffuseProbeGridMode::RealTime ? m_irradianceImage[m_currentImageIndex] : m_bakedIrradianceImage->GetRHIImage(); } + const RHI::Ptr GetDistanceImage() { return m_mode == DiffuseProbeGridMode::RealTime ? m_distanceImage[m_currentImageIndex] : m_bakedDistanceImage->GetRHIImage(); } + const RHI::Ptr GetRelocationImage() { return m_mode == DiffuseProbeGridMode::RealTime ? m_relocationImage[m_currentImageIndex] : m_bakedRelocationImage; } + const RHI::Ptr GetClassificationImage() { return m_mode == DiffuseProbeGridMode::RealTime ? m_classificationImage[m_currentImageIndex] : m_bakedClassificationImage; } + + const AZStd::string& GetBakedIrradianceRelativePath() const { return m_bakedIrradianceRelativePath; } + const AZStd::string& GetBakedDistanceRelativePath() const { return m_bakedDistanceRelativePath; } + const AZStd::string& GetBakedRelocationRelativePath() const { return m_bakedRelocationRelativePath; } + const AZStd::string& GetBakedClassificationRelativePath() const { return m_bakedClassificationRelativePath; } // attachment Ids const RHI::AttachmentId GetRayTraceImageAttachmentId() const { return m_rayTraceImageAttachmentId; } @@ -152,6 +162,12 @@ namespace AZ bool GetIrradianceClearRequired() const { return m_irradianceClearRequired; } void ResetIrradianceClearRequired() { m_irradianceClearRequired = false; } + // texture readback + DiffuseProbeGridTextureReadback& GetTextureReadback() { return m_textureReadback; } + + void SetBakedTextures(const DiffuseProbeGridBakedTextures& bakedTextures); + bool HasValidBakedTextures() const; + static constexpr uint32_t DefaultNumIrradianceTexels = 6; static constexpr uint32_t DefaultNumDistanceTexels = 14; static constexpr int32_t DefaultNumRelocationIterations = 100; @@ -221,7 +237,10 @@ namespace AZ // culling RPI::Cullable m_cullable; - // textures + // grid mode (RealTime or Baked) + DiffuseProbeGridMode m_mode = DiffuseProbeGridMode::RealTime; + + // real-time textures static const uint32_t MaxTextureDimension = 8192; static const uint32_t ImageFrameCount = 3; RHI::Ptr m_rayTraceImage[ImageFrameCount]; @@ -233,6 +252,25 @@ namespace AZ bool m_updateTextures = false; bool m_irradianceClearRequired = true; + // baked textures + Data::Instance m_bakedIrradianceImage; + Data::Instance m_bakedDistanceImage; + RHI::Ptr m_bakedRelocationImage; + RHI::Ptr m_bakedClassificationImage; + + // baked texture relative paths + AZStd::string m_bakedIrradianceRelativePath; + AZStd::string m_bakedDistanceRelativePath; + AZStd::string m_bakedRelocationRelativePath; + AZStd::string m_bakedClassificationRelativePath; + + // baked texture data (only needed for the relocation and classification textures) + AZStd::vector m_bakedRelocationImageData; + AZStd::vector m_bakedClassificationImageData; + + // texture readback + DiffuseProbeGridTextureReadback m_textureReadback; + // Srgs Data::Instance m_rayTraceSrg; Data::Instance m_blendIrradianceSrg; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.cpp index 3df13556d3..2a06dacf3f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendDistancePass.cpp @@ -87,7 +87,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -111,7 +111,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // probe raytrace image { @@ -150,7 +150,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -167,7 +167,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendDistanceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.cpp index 4e05b8ef31..4818018ea3 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBlendIrradiancePass.cpp @@ -87,7 +87,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -111,7 +111,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // probe raytrace image { @@ -150,7 +150,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -167,7 +167,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetBlendIrradianceSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.cpp index 59549de331..8821de8a9d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridBorderUpdatePass.cpp @@ -100,7 +100,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -124,7 +124,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // probe irradiance image { @@ -153,7 +153,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see line ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -173,7 +173,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { uint32_t probeCountX; uint32_t probeCountY; diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.cpp index db85914cee..65f1c2dd5a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridClassificationPass.cpp @@ -91,7 +91,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -115,7 +115,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // probe raytrace image { @@ -143,7 +143,7 @@ namespace AZ { RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -159,7 +159,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetClassificationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp index 1aaa06c797..060d51d1d0 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp @@ -45,6 +45,7 @@ namespace AZ RHI::RHISystemInterface* rhiSystem = RHI::RHISystemInterface::Get(); m_diffuseProbeGrids.reserve(InitialProbeGridAllocationSize); + m_realTimeDiffuseProbeGrids.reserve(InitialProbeGridAllocationSize); RHI::BufferPoolDescriptor desc; desc.m_heapMemoryLevel = RHI::HeapMemoryLevel::Device; @@ -61,7 +62,7 @@ namespace AZ // image pool { RHI::ImagePoolDescriptor imagePoolDesc; - imagePoolDesc.m_bindFlags = RHI::ImageBindFlags::ShaderReadWrite; + imagePoolDesc.m_bindFlags = RHI::ImageBindFlags::ShaderReadWrite | RHI::ImageBindFlags::CopyRead; m_probeGridRenderData.m_imagePool = RHI::Factory::Get().CreateImagePool(); [[maybe_unused]] RHI::ResultCode result = m_probeGridRenderData.m_imagePool->Init(*rhiSystem->GetDevice(), imagePoolDesc); @@ -123,6 +124,32 @@ namespace AZ m_needUpdatePipelineStates = false; } + // check pending textures and connect bus for notifications + for (auto& notificationEntry : m_notifyTextureAssets) + { + if (notificationEntry.m_assetId.IsValid()) + { + // asset already has an assetId + continue; + } + + // query for the assetId + AZ::Data::AssetId assetId; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetId, + &AZ::Data::AssetCatalogRequests::GetAssetIdByPath, + notificationEntry.m_relativePath.c_str(), + azrtti_typeid(), + false); + + if (assetId.IsValid()) + { + notificationEntry.m_assetId = assetId; + notificationEntry.m_asset.Create(assetId, true); + Data::AssetBus::MultiHandler::BusConnect(assetId); + } + } + // if the volumes changed we need to re-sort the probe list if (m_probeGridSortRequired) { @@ -139,6 +166,7 @@ namespace AZ }; AZStd::sort(m_diffuseProbeGrids.begin(), m_diffuseProbeGrids.end(), sortFn); + AZStd::sort(m_realTimeDiffuseProbeGrids.begin(), m_realTimeDiffuseProbeGrids.end(), sortFn); m_probeGridSortRequired = false; } @@ -160,6 +188,9 @@ namespace AZ diffuseProbeGrid->SetExtents(extents); diffuseProbeGrid->SetProbeSpacing(probeSpacing); m_diffuseProbeGrids.push_back(diffuseProbeGrid); + + UpdateRealTimeList(diffuseProbeGrid); + m_probeGridSortRequired = true; return diffuseProbeGrid; @@ -169,6 +200,7 @@ namespace AZ { AZ_Assert(probeGrid.get(), "RemoveProbeGrid called with an invalid handle"); + // remove from main list auto itEntry = AZStd::find_if(m_diffuseProbeGrids.begin(), m_diffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) { return (entry == probeGrid); @@ -176,6 +208,18 @@ namespace AZ AZ_Assert(itEntry != m_diffuseProbeGrids.end(), "RemoveProbeGrid called with a probe grid that is not in the probe list"); m_diffuseProbeGrids.erase(itEntry); + + // remove from side list of real-time grids + itEntry = AZStd::find_if(m_realTimeDiffuseProbeGrids.begin(), m_realTimeDiffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) + { + return (entry == probeGrid); + }); + + if (itEntry != m_realTimeDiffuseProbeGrids.end()) + { + m_realTimeDiffuseProbeGrids.erase(itEntry); + } + probeGrid = nullptr; } @@ -247,6 +291,134 @@ namespace AZ probeGrid->SetUseDiffuseIbl(useDiffuseIbl); } + void DiffuseProbeGridFeatureProcessor::BakeTextures( + const DiffuseProbeGridHandle& probeGrid, + DiffuseProbeGridBakeTexturesCallback callback, + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) + { + AZ_Assert(probeGrid.get(), "BakeTextures called with an invalid handle"); + + AddNotificationEntry(irradianceTextureRelativePath); + AddNotificationEntry(distanceTextureRelativePath); + AddNotificationEntry(relocationTextureRelativePath); + AddNotificationEntry(classificationTextureRelativePath); + + probeGrid->GetTextureReadback().BeginTextureReadback(callback); + } + + void DiffuseProbeGridFeatureProcessor::UpdateRealTimeList(const DiffuseProbeGridHandle& diffuseProbeGrid) + { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::RealTime) + { + // add to side list of real-time grids + auto itEntry = AZStd::find_if(m_realTimeDiffuseProbeGrids.begin(), m_realTimeDiffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) + { + return (entry == diffuseProbeGrid); + }); + + if (itEntry == m_realTimeDiffuseProbeGrids.end()) + { + m_realTimeDiffuseProbeGrids.push_back(diffuseProbeGrid); + } + } + else + { + // remove from side list of real-time grids + auto itEntry = AZStd::find_if(m_realTimeDiffuseProbeGrids.begin(), m_realTimeDiffuseProbeGrids.end(), [&](AZStd::shared_ptr const& entry) + { + return (entry == diffuseProbeGrid); + }); + + if (itEntry != m_realTimeDiffuseProbeGrids.end()) + { + m_realTimeDiffuseProbeGrids.erase(itEntry); + } + } + } + + void DiffuseProbeGridFeatureProcessor::AddNotificationEntry(const AZStd::string& relativePath) + { + AZStd::string assetPath = relativePath + ".streamingimage"; + + // check to see if this is an existing asset + AZ::Data::AssetId assetId; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetId, + &AZ::Data::AssetCatalogRequests::GetAssetIdByPath, + assetPath.c_str(), + azrtti_typeid(), + false); + + // We only track notifications for new texture assets, meaning assets that are created the first time a DiffuseProbeGrid is baked. + // On subsequent bakes the existing assets are automatically reloaded by the RPI since they are already known by the asset system. + if (!assetId.IsValid()) + { + m_notifyTextureAssets.push_back({ assetPath, assetId }); + } + } + + bool DiffuseProbeGridFeatureProcessor::CheckTextureAssetNotification( + const AZStd::string& relativePath, + Data::Asset& outTextureAsset, + DiffuseProbeGridTextureNotificationType& outNotificationType) + { + for (NotifyTextureAssetVector::iterator itNotification = m_notifyTextureAssets.begin(); itNotification != m_notifyTextureAssets.end(); ++itNotification) + { + if (itNotification->m_relativePath == relativePath) + { + outNotificationType = itNotification->m_notificationType; + if (outNotificationType != DiffuseProbeGridTextureNotificationType::None) + { + outTextureAsset = itNotification->m_asset; + m_notifyTextureAssets.erase(itNotification); + } + + return true; + } + } + + return false; + } + + bool DiffuseProbeGridFeatureProcessor::AreBakedTexturesReferenced( + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) + { + for (auto& diffuseProbeGrid : m_diffuseProbeGrids) + { + if ((diffuseProbeGrid->GetBakedIrradianceRelativePath() == irradianceTextureRelativePath) || + (diffuseProbeGrid->GetBakedDistanceRelativePath() == distanceTextureRelativePath) || + (diffuseProbeGrid->GetBakedRelocationRelativePath() == relocationTextureRelativePath) || + (diffuseProbeGrid->GetBakedClassificationRelativePath() == classificationTextureRelativePath)) + { + return true; + } + } + + return false; + } + + void DiffuseProbeGridFeatureProcessor::SetMode(const DiffuseProbeGridHandle& probeGrid, DiffuseProbeGridMode mode) + { + AZ_Assert(probeGrid.get(), "SetMode called with an invalid handle"); + probeGrid->SetMode(mode); + + UpdateRealTimeList(probeGrid); + + m_probeGridSortRequired = true; + } + + void DiffuseProbeGridFeatureProcessor::SetBakedTextures(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridBakedTextures& bakedTextures) + { + AZ_Assert(probeGrid.get(), "SetBakedTextures called with an invalid handle"); + probeGrid->SetBakedTextures(bakedTextures); + } + void DiffuseProbeGridFeatureProcessor::CreateBoxMesh() { // vertex positions @@ -418,5 +590,34 @@ namespace AZ } } + void DiffuseProbeGridFeatureProcessor::HandleAssetNotification(Data::Asset asset, DiffuseProbeGridTextureNotificationType notificationType) + { + for (NotifyTextureAssetVector::iterator itNotification = m_notifyTextureAssets.begin(); itNotification != m_notifyTextureAssets.end(); ++itNotification) + { + if (itNotification->m_assetId == asset.GetId()) + { + // store the texture asset + itNotification->m_asset = Data::static_pointer_cast(asset); + itNotification->m_notificationType = notificationType; + + // stop notifications on this asset + Data::AssetBus::MultiHandler::BusDisconnect(itNotification->m_assetId); + + break; + } + } + } + + void DiffuseProbeGridFeatureProcessor::OnAssetReady(Data::Asset asset) + { + HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Ready); + } + + void DiffuseProbeGridFeatureProcessor::OnAssetError(Data::Asset asset) + { + AZ_Error("ReflectionProbeFeatureProcessor", false, "Failed to load cubemap [%s]", asset.GetHint().c_str()); + + HandleAssetNotification(asset, DiffuseProbeGridTextureNotificationType::Error); + } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h index ad36f8aafa..19e9bf1b1d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h @@ -22,6 +22,7 @@ namespace AZ //! This class manages DiffuseProbeGrids which generate diffuse global illumination class DiffuseProbeGridFeatureProcessor final : public DiffuseProbeGridFeatureProcessorInterface + , private Data::AssetBus::MultiHandler { public: AZ_RTTI(AZ::Render::DiffuseProbeGridFeatureProcessor, "{BCD232F9-1EBF-4D0D-A5F4-84AEC933A93C}", DiffuseProbeGridFeatureProcessorInterface); @@ -46,6 +47,27 @@ namespace AZ void Enable(const DiffuseProbeGridHandle& probeGrid, bool enable) override; void SetGIShadows(const DiffuseProbeGridHandle& probeGrid, bool giShadows) override; void SetUseDiffuseIbl(const DiffuseProbeGridHandle& probeGrid, bool useDiffuseIbl) override; + void SetMode(const DiffuseProbeGridHandle& probeGrid, DiffuseProbeGridMode mode) override; + void SetBakedTextures(const DiffuseProbeGridHandle& probeGrid, const DiffuseProbeGridBakedTextures& bakedTextures) override; + + void BakeTextures( + const DiffuseProbeGridHandle& probeGrid, + DiffuseProbeGridBakeTexturesCallback callback, + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) override; + + bool CheckTextureAssetNotification( + const AZStd::string& relativePath, + Data::Asset& outTextureAsset, + DiffuseProbeGridTextureNotificationType& outNotificationType) override; + + bool AreBakedTexturesReferenced( + const AZStd::string& irradianceTextureRelativePath, + const AZStd::string& distanceTextureRelativePath, + const AZStd::string& relocationTextureRelativePath, + const AZStd::string& classificationTextureRelativePath) override; // FeatureProcessor overrides void Activate() override; @@ -56,12 +78,28 @@ namespace AZ using DiffuseProbeGridVector = AZStd::vector>; DiffuseProbeGridVector& GetProbeGrids() { return m_diffuseProbeGrids; } + // retrieve the side list of probe grids that are using real-time (raytraced) mode + DiffuseProbeGridVector& GetRealTimeProbeGrids() { return m_realTimeDiffuseProbeGrids; } + private: AZ_DISABLE_COPY_MOVE(DiffuseProbeGridFeatureProcessor); // create the box vertex and index streams, which are used to render the probe volumes void CreateBoxMesh(); + // AssetBus::MultiHandler overrides... + void OnAssetReady(Data::Asset asset) override; + void OnAssetError(Data::Asset asset) override; + + // updates the real-time list for a specific probe grid + void UpdateRealTimeList(const DiffuseProbeGridHandle& diffuseProbeGrid); + + // adds a notification entry for a new asset + void AddNotificationEntry(const AZStd::string& relativePath); + + // notifies and removes the notification entry + void HandleAssetNotification(Data::Asset asset, DiffuseProbeGridTextureNotificationType notificationType); + // RPI::SceneNotificationBus::Handler overrides void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override; void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override; @@ -70,10 +108,13 @@ namespace AZ void UpdatePipelineStates(); void UpdatePasses(); - // list of diffuse probe grids + // list of all diffuse probe grids const size_t InitialProbeGridAllocationSize = 64; DiffuseProbeGridVector m_diffuseProbeGrids; + // side list of diffuse probe grids that are in real-time mode (subset of m_diffuseProbeGrids) + DiffuseProbeGridVector m_realTimeDiffuseProbeGrids; + // position structure for the box vertices struct Position { @@ -102,6 +143,17 @@ namespace AZ // indicates the the diffuse probe grid render pipeline state needs to be updated bool m_needUpdatePipelineStates = false; + + // list of texture assets that we need to check during Simulate() to see if they are ready + struct NotifyTextureAssetEntry + { + AZStd::string m_relativePath; + AZ::Data::AssetId m_assetId; + Data::Asset m_asset; + DiffuseProbeGridTextureNotificationType m_notificationType = DiffuseProbeGridTextureNotificationType::None; + }; + typedef AZStd::vector NotifyTextureAssetVector; + NotifyTextureAssetVector m_notifyTextureAssets; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.cpp index b2b5f60660..65d71b8272 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRayTracingPass.cpp @@ -136,7 +136,7 @@ namespace AZ } DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -153,9 +153,9 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); RayTracingFeatureProcessor* rayTracingFeatureProcessor = scene->GetFeatureProcessor(); - frameGraph.SetEstimatedItemCount(aznumeric_cast(diffuseProbeGridFeatureProcessor->GetProbeGrids().size())); + frameGraph.SetEstimatedItemCount(aznumeric_cast(diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().size())); - for (const auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (const auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // TLAS { @@ -260,7 +260,7 @@ namespace AZ rayTracingFeatureProcessor->GetMeshInfoBuffer() && rayTracingFeatureProcessor->GetSubMeshCount()) { - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader // inputs (see line ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -308,7 +308,7 @@ namespace AZ m_rayTracingShaderTable) { // submit the DispatchRaysItem for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroups[] = { diffuseProbeGrid->GetRayTraceSrg()->GetRHIShaderResourceGroup(), diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.cpp index 2bd6595b71..86a26f002d 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRelocationPass.cpp @@ -91,7 +91,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetProbeGrids().empty()) + if (!diffuseProbeGridFeatureProcessor || diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids().empty()) { // no diffuse probe grids return; @@ -108,7 +108,7 @@ namespace AZ // create the Relocation Srgs for each DiffuseProbeGrid, and check to see if any grids need relocation bool needRelocation = false; - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { uint32_t rayTracingDataRevision = rayTracingFeatureProcessor->GetRevision(); if (rayTracingDataRevision != m_rayTracingDataRevision) @@ -139,7 +139,7 @@ namespace AZ RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // probe raytrace image { @@ -167,7 +167,7 @@ namespace AZ { RPI::Scene* scene = m_pipeline->GetScene(); DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() in ShaderResourceGroupData.cpp) @@ -187,7 +187,7 @@ namespace AZ DiffuseProbeGridFeatureProcessor* diffuseProbeGridFeatureProcessor = scene->GetFeatureProcessor(); // submit the DispatchItems for each DiffuseProbeGrid - for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) { const RHI::ShaderResourceGroup* shaderResourceGroup = diffuseProbeGrid->GetRelocationSrg()->GetRHIShaderResourceGroup(); commandList->SetShaderResourceGroupForDispatch(*shaderResourceGroup); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.cpp index af6fce6f6a..4f9221a65f 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.cpp @@ -79,6 +79,12 @@ namespace AZ params.m_scissorState = scissor; Base::FrameBeginInternal(params); + + for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetRealTimeProbeGrids()) + { + // process attachment readback + diffuseProbeGrid->GetTextureReadback().FrameBegin(params); + } } void DiffuseProbeGridRenderPass::SetupFrameGraphDependencies(RHI::FrameGraphInterface frameGraph) @@ -88,8 +94,21 @@ namespace AZ for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked && + !diffuseProbeGrid->HasValidBakedTextures()) + { + continue; + } + // probe irradiance image { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked) + { + // import the irradiance image now, since it is baked and therefore was not imported during the raytracing pass + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(diffuseProbeGrid->GetIrradianceImageAttachmentId(), diffuseProbeGrid->GetIrradianceImage()); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import probeIrradianceImage"); + } + RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetIrradianceImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeIrradianceImageViewDescriptor; @@ -100,6 +119,13 @@ namespace AZ // probe distance image { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked) + { + // import the distance image now, since it is baked and therefore was not imported during the raytracing pass + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(diffuseProbeGrid->GetDistanceImageAttachmentId(), diffuseProbeGrid->GetDistanceImage()); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import probeDistanceImage"); + } + RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetDistanceImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeDistanceImageViewDescriptor; @@ -110,6 +136,13 @@ namespace AZ // probe relocation image { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked) + { + // import the relocation image now, since it is baked and therefore was not imported during the raytracing pass + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(diffuseProbeGrid->GetRelocationImageAttachmentId(), diffuseProbeGrid->GetRelocationImage()); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import probeRelocationImage"); + } + RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetRelocationImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeRelocationImageViewDescriptor; @@ -120,6 +153,13 @@ namespace AZ // probe classification image { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked) + { + // import the classification image now, since it is baked and therefore was not imported during the raytracing pass + [[maybe_unused]] RHI::ResultCode result = frameGraph.GetAttachmentDatabase().ImportImage(diffuseProbeGrid->GetClassificationImageAttachmentId(), diffuseProbeGrid->GetClassificationImage()); + AZ_Assert(result == RHI::ResultCode::Success, "Failed to import probeClassificationImage"); + } + RHI::ImageScopeAttachmentDescriptor desc; desc.m_attachmentId = diffuseProbeGrid->GetClassificationImageAttachmentId(); desc.m_imageViewDescriptor = diffuseProbeGrid->GetRenderData()->m_probeClassificationImageViewDescriptor; @@ -127,6 +167,8 @@ namespace AZ frameGraph.UseShaderAttachment(desc, RHI::ScopeAttachmentAccess::ReadWrite); } + + diffuseProbeGrid->GetTextureReadback().Update(GetName()); } Base::SetupFrameGraphDependencies(frameGraph); @@ -139,6 +181,12 @@ namespace AZ for (auto& diffuseProbeGrid : diffuseProbeGridFeatureProcessor->GetProbeGrids()) { + if (diffuseProbeGrid->GetMode() == DiffuseProbeGridMode::Baked && + !diffuseProbeGrid->HasValidBakedTextures()) + { + continue; + } + // the diffuse probe grid Srg must be updated in the Compile phase in order to successfully bind the ReadWrite shader inputs // (see ValidateSetImageView() of ShaderResourceGroupData.cpp) diffuseProbeGrid->UpdateRenderObjectSrg(); diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.cpp b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.cpp new file mode 100644 index 0000000000..bc619cc277 --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.cpp @@ -0,0 +1,134 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace AZ +{ + namespace Render + { + DiffuseProbeGridTextureReadback::DiffuseProbeGridTextureReadback(DiffuseProbeGrid* diffuseProbeGrid) + : m_diffuseProbeGrid(diffuseProbeGrid) + { + } + + void DiffuseProbeGridTextureReadback::BeginTextureReadback(DiffuseProbeGridBakeTexturesCallback callback) + { + AZ_Assert(m_readbackState == DiffuseProbeGridReadbackState::Idle, "DiffuseProbeGridTextureReadback is already processing a readback request"); + + m_callback = callback; + m_readbackState = DiffuseProbeGridReadbackState::Irradiance; + } + + void DiffuseProbeGridTextureReadback::Update(const AZ::Name& passName) + { + if (m_readbackState == DiffuseProbeGridReadbackState::Idle || m_readbackState == DiffuseProbeGridReadbackState::Complete) + { + return; + } + + if (m_attachmentReadback.get() && m_attachmentReadback->GetReadbackState() > RPI::AttachmentReadback::ReadbackState::Idle) + { + // still processing previous request + return; + } + + AZStd::string readbackName = AZStd::string::format("DiffuseProbeGridReadback_%s", passName.GetCStr()); + RHI::ImageDescriptor descriptor; + RHI::AttachmentId attachmentId; + RPI::AttachmentReadback::CallbackFunction callbackFunction; + + switch (m_readbackState) + { + case DiffuseProbeGridReadbackState::Irradiance: + descriptor = m_diffuseProbeGrid->GetIrradianceImage()->GetDescriptor(); + attachmentId = m_diffuseProbeGrid->GetIrradianceImageAttachmentId(); + callbackFunction = [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) + { + m_irradianceReadbackResult = readbackResult; + m_readbackState = DiffuseProbeGridReadbackState::Distance; + }; + break; + case DiffuseProbeGridReadbackState::Distance: + descriptor = m_diffuseProbeGrid->GetDistanceImage()->GetDescriptor(); + attachmentId = m_diffuseProbeGrid->GetDistanceImageAttachmentId(); + callbackFunction = [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) + { + m_distanceReadbackResult = readbackResult; + m_readbackState = DiffuseProbeGridReadbackState::Relocation; + }; + break; + case DiffuseProbeGridReadbackState::Relocation: + descriptor = m_diffuseProbeGrid->GetRelocationImage()->GetDescriptor(); + attachmentId = m_diffuseProbeGrid->GetRelocationImageAttachmentId(); + callbackFunction = [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) + { + m_relocationReadbackResult = readbackResult; + m_readbackState = DiffuseProbeGridReadbackState::Classification; + }; + break; + case DiffuseProbeGridReadbackState::Classification: + descriptor = m_diffuseProbeGrid->GetClassificationImage()->GetDescriptor(); + attachmentId = m_diffuseProbeGrid->GetClassificationImageAttachmentId(); + callbackFunction = [this](const AZ::RPI::AttachmentReadback::ReadbackResult& readbackResult) + { + m_classificationReadbackResult = readbackResult; + m_readbackState = DiffuseProbeGridReadbackState::Complete; + }; + break; + default: + AZ_Assert(false, "Unknown readback state"); + } + + m_attachmentReadback = AZStd::make_shared(AZ::RHI::ScopeId{ "DiffuseProbeGridTextureReadBack" }); + m_attachmentReadback->SetCallback(callbackFunction); + + AZ::RPI::PassAttachment passAttachment; + passAttachment.m_descriptor = descriptor; + passAttachment.m_path = attachmentId; + passAttachment.m_name = readbackName; + passAttachment.m_lifetime = RHI::AttachmentLifetimeType::Imported; + + m_attachmentReadback->ReadPassAttachment(&passAttachment, AZ::Name(readbackName)); + } + + void DiffuseProbeGridTextureReadback::FrameBegin(AZ::RPI::Pass::FramePrepareParams& params) + { + if (m_readbackState == DiffuseProbeGridReadbackState::Idle) + { + return; + } + + if (!m_attachmentReadback.get()) + { + return; + } + + if (m_readbackState == DiffuseProbeGridReadbackState::Complete) + { + // readback of all textures is complete, invoke callback and return to Idle state + m_callback( + { m_irradianceReadbackResult.m_dataBuffer, m_irradianceReadbackResult.m_imageDescriptor.m_format, m_irradianceReadbackResult.m_imageDescriptor.m_size }, + { m_distanceReadbackResult.m_dataBuffer, m_distanceReadbackResult.m_imageDescriptor.m_format, m_distanceReadbackResult.m_imageDescriptor.m_size }, + { m_relocationReadbackResult.m_dataBuffer, m_relocationReadbackResult.m_imageDescriptor.m_format, m_relocationReadbackResult.m_imageDescriptor.m_size }, + { m_classificationReadbackResult.m_dataBuffer, m_classificationReadbackResult.m_imageDescriptor.m_format, m_classificationReadbackResult.m_imageDescriptor.m_size }); + + m_readbackState = DiffuseProbeGridReadbackState::Idle; + m_attachmentReadback.reset(); + return; + } + + m_attachmentReadback->FrameBegin(params); + } + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h new file mode 100644 index 0000000000..1becd6fb3e --- /dev/null +++ b/Gems/Atom/Feature/Common/Code/Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h @@ -0,0 +1,60 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include +#include +#include + +namespace AZ +{ + namespace Render + { + class DiffuseProbeGrid; + + enum class DiffuseProbeGridReadbackState + { + Idle, + Irradiance, + Distance, + Relocation, + Classification, + Complete + }; + + //! This class contains functionality necessary to read back the DiffuseProbeGrid textures, which + //! allows them to be saved as assets to run the DiffuseProbeGrid in non-realtime mode. + class DiffuseProbeGridTextureReadback final + { + public: + DiffuseProbeGridTextureReadback(DiffuseProbeGrid* diffuseProbeGrid); + ~DiffuseProbeGridTextureReadback() = default; + + void BeginTextureReadback(DiffuseProbeGridBakeTexturesCallback callback); + void Update(const AZ::Name& passName); + void FrameBegin(AZ::RPI::Pass::FramePrepareParams& params); + + private: + + DiffuseProbeGrid* m_diffuseProbeGrid = nullptr; + DiffuseProbeGridReadbackState m_readbackState = DiffuseProbeGridReadbackState::Idle; + AZStd::shared_ptr m_attachmentReadback; + DiffuseProbeGridBakeTexturesCallback m_callback; + + AZ::RPI::AttachmentReadback::ReadbackResult m_irradianceReadbackResult; + AZ::RPI::AttachmentReadback::ReadbackResult m_distanceReadbackResult; + AZ::RPI::AttachmentReadback::ReadbackResult m_relocationReadbackResult; + AZ::RPI::AttachmentReadback::ReadbackResult m_classificationReadbackResult; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/AcesOutputTransformPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/AcesOutputTransformPass.cpp index b2103739ba..6fe38ff032 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/AcesOutputTransformPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/AcesOutputTransformPass.cpp @@ -102,6 +102,36 @@ namespace AZ AcesDisplayMapperFeatureProcessor::GetAcesDisplayMapperParameters(&m_displayMapperParameters, OutputDeviceTransformType_48Nits); } } + + if (m_acesParameterOverrides.m_overrideDefaults) + { + m_displayMapperParameters.m_OutputDisplayTransformFlags = 0; + if (m_acesParameterOverrides.m_alterSurround) + { + m_displayMapperParameters.m_OutputDisplayTransformFlags |= AcesDisplayMapperFeatureProcessor::AlterSurround; + } + if (m_acesParameterOverrides.m_applyDesaturation) + { + m_displayMapperParameters.m_OutputDisplayTransformFlags |= AcesDisplayMapperFeatureProcessor::ApplyDesaturation; + } + if (m_acesParameterOverrides.m_applyCATD60toD65) + { + m_displayMapperParameters.m_OutputDisplayTransformFlags |= AcesDisplayMapperFeatureProcessor::ApplyCATD60toD65; + } + + m_displayMapperParameters.m_cinemaLimits[0] = m_acesParameterOverrides.m_cinemaLimitsBlack; + m_displayMapperParameters.m_cinemaLimits[1] = m_acesParameterOverrides.m_cinemaLimitsWhite; + m_displayMapperParameters.m_acesSplineParams.minPoint[0] = m_acesParameterOverrides.m_minPoint; + m_displayMapperParameters.m_acesSplineParams.midPoint[0] = m_acesParameterOverrides.m_midPoint; + m_displayMapperParameters.m_acesSplineParams.maxPoint[0] = m_acesParameterOverrides.m_maxPoint; + m_displayMapperParameters.m_surroundGamma = m_acesParameterOverrides.m_surroundGamma; + m_displayMapperParameters.m_gamma = m_acesParameterOverrides.m_gamma; + } + } + + void AcesOutputTransformPass::SetAcesParameterOverrides(const AcesParameterOverrides& acesParameterOverrides) + { + m_acesParameterOverrides = acesParameterOverrides; } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperConfigurationDescriptor.cpp b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperConfigurationDescriptor.cpp index d80a02d083..e91e125b40 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperConfigurationDescriptor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperConfigurationDescriptor.cpp @@ -9,14 +9,54 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ + #include #include +#include namespace AZ { namespace Render { + void AcesParameterOverrides::Reflect(ReflectContext* context) + { + if (auto serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(0) + ->Field("OverrideDefaults", &AcesParameterOverrides::m_overrideDefaults) + ->Field("AlterSurround", &AcesParameterOverrides::m_alterSurround) + ->Field("ApplyDesaturation", &AcesParameterOverrides::m_applyDesaturation) + ->Field("ApplyCATD60toD65", &AcesParameterOverrides::m_applyCATD60toD65) + ->Field("PresetODT", &AcesParameterOverrides::m_preset) + ->Field("CinemaLimitsBlack", &AcesParameterOverrides::m_cinemaLimitsBlack) + ->Field("CinemaLimitsWhite", &AcesParameterOverrides::m_cinemaLimitsWhite) + ->Field("MinPoint", &AcesParameterOverrides::m_minPoint) + ->Field("MidPoint", &AcesParameterOverrides::m_midPoint) + ->Field("MaxPoint", &AcesParameterOverrides::m_maxPoint) + ->Field("SurroundGamma", &AcesParameterOverrides::m_surroundGamma) + ->Field("Gamma", &AcesParameterOverrides::m_gamma); + } + } + + void AcesParameterOverrides::LoadPreset() + { + DisplayMapperParameters displayMapperParameters; + AcesDisplayMapperFeatureProcessor::GetAcesDisplayMapperParameters(&displayMapperParameters, m_preset); + + m_alterSurround = (displayMapperParameters.m_OutputDisplayTransformFlags & AcesDisplayMapperFeatureProcessor::AlterSurround) != 0; + m_applyDesaturation = (displayMapperParameters.m_OutputDisplayTransformFlags & AcesDisplayMapperFeatureProcessor::ApplyDesaturation) != 0; + m_applyCATD60toD65 = (displayMapperParameters.m_OutputDisplayTransformFlags & AcesDisplayMapperFeatureProcessor::ApplyCATD60toD65) != 0; + m_cinemaLimitsBlack = displayMapperParameters.m_cinemaLimits[0]; + m_cinemaLimitsWhite = displayMapperParameters.m_cinemaLimits[1]; + m_minPoint = displayMapperParameters.m_acesSplineParams.minPoint[0]; + m_midPoint = displayMapperParameters.m_acesSplineParams.midPoint[0]; + m_maxPoint = displayMapperParameters.m_acesSplineParams.maxPoint[0]; + m_surroundGamma = displayMapperParameters.m_surroundGamma; + m_gamma = displayMapperParameters.m_gamma; + } + void DisplayMapperConfigurationDescriptor::Reflect(AZ::ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) diff --git a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperPass.cpp b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperPass.cpp index 1de92c42f6..8ae790e12c 100644 --- a/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/DisplayMapper/DisplayMapperPass.cpp @@ -106,6 +106,7 @@ namespace AZ { if (m_acesOutputTransformPass) { + m_acesOutputTransformPass->SetAcesParameterOverrides(m_displayMapperConfigurationDescriptor.m_acesParameterOverrides); m_acesOutputTransformPass->SetDisplayBufferFormat(m_displayBufferFormat); } if (m_bakeAcesOutputTransformLutPass) @@ -509,7 +510,8 @@ namespace AZ if (desc.m_operationType != m_displayMapperConfigurationDescriptor.m_operationType || desc.m_ldrGradingLutEnabled != m_displayMapperConfigurationDescriptor.m_ldrGradingLutEnabled || - desc.m_ldrColorGradingLut != m_displayMapperConfigurationDescriptor.m_ldrColorGradingLut) + desc.m_ldrColorGradingLut != m_displayMapperConfigurationDescriptor.m_ldrColorGradingLut || + desc.m_acesParameterOverrides.m_overrideDefaults != m_displayMapperConfigurationDescriptor.m_acesParameterOverrides.m_overrideDefaults) { m_needToRebuildChildren = true; } diff --git a/Gems/Atom/Feature/Common/Code/Source/EditorCommonSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/EditorCommonSystemComponent.cpp index 32a29cf4d3..2373d0cb00 100644 --- a/Gems/Atom/Feature/Common/Code/Source/EditorCommonSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/EditorCommonSystemComponent.cpp @@ -12,11 +12,9 @@ #include #include -#include #include #include #include -#include #include #include @@ -58,11 +56,9 @@ namespace AZ } AZ::Render::UseTextureFunctorSourceData::Reflect(context); - AZ::Render::PropertyVisibilityFunctorSourceData::Reflect(context); AZ::Render::DrawListFunctorSourceData::Reflect(context); AZ::Render::Transform2DFunctorSourceData::Reflect(context); AZ::Render::ConvertEmissiveUnitFunctorSourceData::Reflect(context); - AZ::Render::ShaderEnableFunctorSourceData::Reflect(context); AZ::Render::SubsurfaceTransmissionParameterFunctorSourceData::Reflect(context); AZ::Render::EditorLightingPreset::Reflect(context); @@ -104,11 +100,9 @@ namespace AZ } materialFunctorRegistration->RegisterMaterialFunctor("UseTexture", azrtti_typeid()); - materialFunctorRegistration->RegisterMaterialFunctor("UpdatePropertyVisibility", azrtti_typeid()); materialFunctorRegistration->RegisterMaterialFunctor("OverrideDrawList", azrtti_typeid()); materialFunctorRegistration->RegisterMaterialFunctor("Transform2D", azrtti_typeid()); materialFunctorRegistration->RegisterMaterialFunctor("ConvertEmissiveUnit", azrtti_typeid()); - materialFunctorRegistration->RegisterMaterialFunctor("ShaderEnable", azrtti_typeid()); materialFunctorRegistration->RegisterMaterialFunctor("HandleSubsurfaceScatteringParameters", azrtti_typeid()); materialFunctorRegistration->RegisterMaterialFunctor("Lua", azrtti_typeid()); diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp index dbbf666967..8397dcf9b3 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Material/MaterialConverterSystemComponent.cpp @@ -77,12 +77,16 @@ namespace AZ } }; + // If PBR material properties aren't in use, fall back to legacy properties. Don't do that if some PBR material properties are set, though. + bool anyPBRInUse = false; + handleTexture("specularF0", SceneAPI::DataTypes::IMaterialData::TextureMapType::Specular); handleTexture("normal", SceneAPI::DataTypes::IMaterialData::TextureMapType::Normal); AZStd::optional useColorMap = materialData.GetUseColorMap(); // If the useColorMap property exists, this is a PBR material and the color should be set to baseColor. if (useColorMap.has_value()) { + anyPBRInUse = true; handleTexture("baseColor", SceneAPI::DataTypes::IMaterialData::TextureMapType::BaseColor); } else @@ -97,17 +101,19 @@ namespace AZ AZStd::optional baseColor = materialData.GetBaseColor(); if (baseColor.has_value()) { + anyPBRInUse = true; sourceData.m_properties["baseColor"]["color"].m_value = toColor(baseColor.value()); } sourceData.m_properties["opacity"]["factor"].m_value = materialData.GetOpacity(); - auto applyOptionalPropertiesFunc = [&sourceData](const auto& propertyGroup, const auto& propertyName, const auto& propertyOptional) + auto applyOptionalPropertiesFunc = [&sourceData, &anyPBRInUse](const auto& propertyGroup, const auto& propertyName, const auto& propertyOptional) { // Only set PBR settings if they were specifically set in the scene's data. // Otherwise, leave them unset so the data driven default properties are used. if (propertyOptional.has_value()) { + anyPBRInUse = true; sourceData.m_properties[propertyGroup][propertyName].m_value = propertyOptional.value(); } }; @@ -127,6 +133,13 @@ namespace AZ handleTexture("ambientOcclusion", SceneAPI::DataTypes::IMaterialData::TextureMapType::AmbientOcclusion); applyOptionalPropertiesFunc("ambientOcclusion", "useTexture", materialData.GetUseAOMap()); + + if (!anyPBRInUse) + { + // If it doesn't have the useColorMap property, then it's a non-PBR material and the baseColor + // texture needs to be set to the diffuse color. + sourceData.m_properties["baseColor"]["color"].m_value = toColor(materialData.GetDiffuseColor()); + } return true; } diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.cpp deleted file mode 100644 index da8730f1ed..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include "PropertyVisibilityFunctor.h" - -namespace AZ -{ - namespace Render - { - void PropertyVisibilityFunctor::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("triggerProperty", &Action::m_triggerPropertyIndex) - ->Field("triggerValue", &Action::m_triggerValue) - ->Field("visibility", &Action::m_visibility) - ; - serializeContext->Class() - ->Version(1) - ->Field("actions", &PropertyVisibilityFunctor::m_actions) - ->Field("affectedProperties", &PropertyVisibilityFunctor::m_affectedProperties) - ; - } - } - - void PropertyVisibilityFunctor::Process(EditorContext& context) - { - bool visibilityApplied = false; - RPI::MaterialPropertyVisibility lastAppliedVisibility; - - for (const auto& action : m_actions) - { - bool willSetVisibility = false; - if (action.m_triggerValue.Is() || action.m_triggerValue.Is() || action.m_triggerValue.Is()) - { - willSetVisibility = action.m_triggerValue == context.GetMaterialPropertyValue(action.m_triggerPropertyIndex); - } - else if (action.m_triggerValue.Is()) - { - willSetVisibility = AZ::IsClose(action.m_triggerValue.GetValue(), - context.GetMaterialPropertyValue(action.m_triggerPropertyIndex), - std::numeric_limits::epsilon()); - } - else // for types Vector2, Vector3, Vector4, Color, Image - { - AZ_Error("PropertyVisibilityFunctor", false, "Unsupported property data type as an enable property."); - } - - if (willSetVisibility) - { - visibilityApplied = true; - lastAppliedVisibility = action.m_visibility; - } - } - - if (visibilityApplied) - { - for (const auto& propertyIndex : m_affectedProperties) - { - context.SetMaterialPropertyVisibility(propertyIndex, lastAppliedVisibility); - } - } - } - - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.h deleted file mode 100644 index d1a7772fc8..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctor.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include - -namespace AZ -{ - namespace Render - { - //! Materials can use this functor to control when and how to set the visibility of a group of properties. - class PropertyVisibilityFunctor final - : public RPI::MaterialFunctor - { - friend class PropertyVisibilityFunctorSourceData; - public: - AZ_RTTI(AZ::Render::PropertyVisibilityFunctor, "{2582B36F-FA7C-450F-B46A-39AAE18356A0}", RPI::MaterialFunctor); - - static void Reflect(ReflectContext* context); - - void Process(EditorContext& context) override; - - private: - struct Action - { - AZ_TYPE_INFO(AZ::Render::PropertyVisibilityFunctor::Action, "{5DF4D981-9D0C-4040-A6C5-52E1D0BD876B}"); - - RPI::MaterialPropertyIndex m_triggerPropertyIndex; //! The control property for affected properties. - RPI::MaterialPropertyValue m_triggerValue; //! The trigger value of the control property. - RPI::MaterialPropertyVisibility m_visibility; //! The visibility of affected properties when the trigger value is hit. - }; - // Material property inputs... - AZStd::vector m_actions; //! The actions that describes when and what to do with visibilities. - AZStd::vector m_affectedProperties; //! The properties that are affected by actions. - }; - - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.cpp deleted file mode 100644 index 3baf27de60..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include "PropertyVisibilityFunctorSourceData.h" -#include -#include - -#include - -namespace AZ -{ - namespace Render - { - void PropertyVisibilityFunctorSourceData::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("triggerProperty", &ActionSourceData::m_triggerPropertyName) - ->Field("triggerValue", &ActionSourceData::m_triggerValue) - ->Field("visibility", &ActionSourceData::m_visibility) - ; - serializeContext->Class() - ->Version(2) - ->Field("actions", &PropertyVisibilityFunctorSourceData::m_actions) - ->Field("affectedProperties", &PropertyVisibilityFunctorSourceData::m_affectedPropertyNames) - ; - } - } - - RPI::MaterialFunctorSourceData::FunctorResult PropertyVisibilityFunctorSourceData::CreateFunctor(const EditorContext& context) const - { - using namespace RPI; - - RPI::Ptr functor = aznew PropertyVisibilityFunctor; - - functor->m_actions.reserve(m_actions.size()); - - for (const auto& actionSource : m_actions) - { - functor->m_actions.emplace_back(); - PropertyVisibilityFunctor::Action& action = functor->m_actions.back(); - action.m_triggerPropertyIndex = context.FindMaterialPropertyIndex(AZ::Name{ actionSource.m_triggerPropertyName }); - if (action.m_triggerPropertyIndex.IsNull()) - { - return Failure(); - } - AddMaterialPropertyDependency(functor, action.m_triggerPropertyIndex); - - if (!actionSource.m_triggerValue.Resolve(*context.GetMaterialPropertiesLayout(), Name{ actionSource.m_triggerPropertyName })) - { - // Error is reported in Resolve(). - return Failure(); - } - - const MaterialPropertyDescriptor* propertyDescriptor = context.GetMaterialPropertiesLayout()->GetPropertyDescriptor(action.m_triggerPropertyIndex); - // Enum type should resolve further to a unit32_t from the string source. - if (propertyDescriptor->GetDataType() == RPI::MaterialPropertyDataType::Enum) - { - if (!RPI::MaterialUtils::ResolveMaterialPropertyEnumValue( - propertyDescriptor, - Name(actionSource.m_triggerValue.GetValue().GetValue()), - action.m_triggerValue)) - { - return Failure(); - } - } - else - { - action.m_triggerValue = actionSource.m_triggerValue.GetValue(); - } - - action.m_visibility = actionSource.m_visibility; - } - - functor->m_affectedProperties.reserve(m_affectedPropertyNames.size()); - for (const AZStd::string& name : m_affectedPropertyNames) - { - RPI::MaterialPropertyIndex index = context.FindMaterialPropertyIndex(AZ::Name{ name }); - if (index.IsNull()) - { - return Failure(); - } - functor->m_affectedProperties.push_back(index); - } - - return Success(RPI::Ptr(functor)); - } - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.h deleted file mode 100644 index 6b212f78a0..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/PropertyVisibilityFunctorSourceData.h +++ /dev/null @@ -1,48 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include "PropertyVisibilityFunctor.h" -#include -#include - -namespace AZ -{ - namespace Render - { - //! Builds a PropertyVisibilityFunctor. - //! Materials can use this functor to control whether a specific property group will be enabled. - class PropertyVisibilityFunctorSourceData final - : public RPI::MaterialFunctorSourceData - { - public: - AZ_RTTI(AZ::Render::PropertyVisibilityFunctorSourceData, "{B44E6929-8FFF-405F-9056-B9B811F97676}", RPI::MaterialFunctorSourceData); - - static void Reflect(ReflectContext* context); - - FunctorResult CreateFunctor(const EditorContext& context) const override; - private: - struct ActionSourceData - { - AZ_TYPE_INFO(AZ::Render::PropertyVisibilityFunctorSourceData::ActionSourceData, "{70E01DA6-0B42-4CCB-AAD0-51980DB43F62}"); - AZStd::string m_triggerPropertyName; //! The control property for affected properties. - RPI::MaterialPropertyValueSourceData m_triggerValue; //! The trigger value of the control property. - RPI::MaterialPropertyVisibility m_visibility; //! The visibility of affected properties when the trigger value is hit. - }; - // Material property inputs... - AZStd::vector m_actions; //! The actions that describes when and what to do with visibilities. - AZStd::vector m_affectedPropertyNames; //! The properties that are affected by actions. - }; - - } // namespace Render -} // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.cpp deleted file mode 100644 index dd602cc4ba..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include "./ShaderEnableFunctor.h" -#include -#include -#include - -namespace AZ -{ - namespace Render - { - void ShaderEnableFunctor::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(4) - ->Field("opacityModeIndex", &ShaderEnableFunctor::m_opacityModeIndex) - ->Field("parallaxEnableIndex", &ShaderEnableFunctor::m_parallaxEnableIndex) - ->Field("parallaxPdoEnableIndex", &ShaderEnableFunctor::m_parallaxPdoEnableIndex) - ->Field("shadowShaderNoPSIndex", &ShaderEnableFunctor::m_shadowShaderNoPSIndex) - ->Field("shadowShaderWithPSIndex", &ShaderEnableFunctor::m_shadowShaderWithPSIndex) - ->Field("depthShaderNoPSIndex", &ShaderEnableFunctor::m_depthShaderNoPSIndex) - ->Field("depthShaderWithPSIndex", &ShaderEnableFunctor::m_depthShaderWithPSIndex) - ->Field("pbrShaderNoEdsIndex", &ShaderEnableFunctor::m_pbrShaderNoEdsIndex) - ->Field("pbrShaderWithEdsIndex", &ShaderEnableFunctor::m_pbrShaderWithEdsIndex) - ->Field("depthShaderTransparentMin", &ShaderEnableFunctor::m_depthShaderTransparentMin) - ->Field("depthShaderTransparentMax", &ShaderEnableFunctor::m_depthShaderTransparentMax) - ; - } - } - - void ShaderEnableFunctor::Process(RuntimeContext& context) - { - unsigned int opacityMode = context.GetMaterialPropertyValue(m_opacityModeIndex); - bool parallaxEnabled = context.GetMaterialPropertyValue(m_parallaxEnableIndex); - bool parallaxPdoEnabled = context.GetMaterialPropertyValue(m_parallaxPdoEnableIndex); - - if (parallaxEnabled && parallaxPdoEnabled) - { - context.SetShaderEnabled(m_depthShaderNoPSIndex, false); - context.SetShaderEnabled(m_shadowShaderNoPSIndex, false); - context.SetShaderEnabled(m_pbrShaderWithEdsIndex, false); - - context.SetShaderEnabled(m_depthShaderWithPSIndex, true); - context.SetShaderEnabled(m_shadowShaderWithPSIndex, true); - context.SetShaderEnabled(m_pbrShaderNoEdsIndex, true); - } - else - { - context.SetShaderEnabled(m_depthShaderNoPSIndex, opacityMode == OpacityMode::Opaque ); - context.SetShaderEnabled(m_shadowShaderNoPSIndex, opacityMode == OpacityMode::Opaque); - context.SetShaderEnabled(m_pbrShaderWithEdsIndex, opacityMode == OpacityMode::Opaque || opacityMode == OpacityMode::Blended || opacityMode == OpacityMode::TintedTransparent); - - context.SetShaderEnabled(m_depthShaderWithPSIndex, opacityMode == OpacityMode::Cutout); - context.SetShaderEnabled(m_shadowShaderWithPSIndex, opacityMode == OpacityMode::Cutout); - context.SetShaderEnabled(m_pbrShaderNoEdsIndex, opacityMode == OpacityMode::Cutout); - } - - context.SetShaderEnabled(m_depthShaderTransparentMin, opacityMode == OpacityMode::Blended || opacityMode == OpacityMode::TintedTransparent); - context.SetShaderEnabled(m_depthShaderTransparentMax, opacityMode == OpacityMode::Blended || opacityMode == OpacityMode::TintedTransparent); - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.h b/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.h deleted file mode 100644 index ac5f31ba30..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctor.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include -#include -#include - -namespace AZ -{ - namespace Render - { - enum OpacityMode - { - Opaque = 0, - Cutout, - Blended, - TintedTransparent, - }; - - //! Select shadow and depth shader based on opacity mode and parallax state - //! Opaque: Enable shader without PS - //! Cutout or Parallax enable: Enable shader with PS - //! Blended: Disable both - //! TintedTransparent: Disable both - class ShaderEnableFunctor final - : public RPI::MaterialFunctor - { - friend class ShaderEnableFunctorSourceData; - public: - AZ_RTTI(ShaderEnableFunctor, "{2079A693-FE4F-46A7-95C0-09D88AC156D0}", RPI::MaterialFunctor); - - static void Reflect(ReflectContext* context); - - void Process(RuntimeContext& context) override; - - private: - RPI::MaterialPropertyIndex m_opacityModeIndex; - RPI::MaterialPropertyIndex m_parallaxEnableIndex; - RPI::MaterialPropertyIndex m_parallaxPdoEnableIndex; - - uint32_t m_shadowShaderNoPSIndex = -1; - uint32_t m_shadowShaderWithPSIndex = -1; - uint32_t m_depthShaderNoPSIndex = -1; - uint32_t m_depthShaderWithPSIndex = -1; - uint32_t m_pbrShaderWithEdsIndex = -1; - uint32_t m_pbrShaderNoEdsIndex = -1; - // The following are used by the light culling system to produce min/max depth bounds - uint32_t m_depthShaderTransparentMin = -1; - uint32_t m_depthShaderTransparentMax = -1; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.cpp b/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.cpp deleted file mode 100644 index 3c16666f82..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#include "./ShaderEnableFunctorSourceData.h" -#include -#include - -namespace AZ -{ - namespace Render - { - void ShaderEnableFunctorSourceData::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(5) - ->Field("opacityMode", &ShaderEnableFunctorSourceData::m_opacityMode) - ->Field("parallaxEnable", &ShaderEnableFunctorSourceData::m_parallaxEnable) - ->Field("parallaxPdoEnable", &ShaderEnableFunctorSourceData::m_parallaxPdoEnable) - ->Field("shadowShaderNoPSIndex", &ShaderEnableFunctorSourceData::m_shadowShaderNoPSIndex) - ->Field("shadowShaderWithPSIndex", &ShaderEnableFunctorSourceData::m_shadowShaderWithPSIndex) - ->Field("depthShaderNoPSIndex", &ShaderEnableFunctorSourceData::m_depthShaderNoPSIndex) - ->Field("depthShaderWithPSIndex", &ShaderEnableFunctorSourceData::m_depthShaderWithPSIndex) - ->Field("pbrShaderNoEdsIndex", &ShaderEnableFunctorSourceData::m_pbrShaderNoEdsIndex) - ->Field("pbrShaderWithEdsIndex", &ShaderEnableFunctorSourceData::m_pbrShaderWithEdsIndex) - ->Field("depthShaderTransparentMin", &ShaderEnableFunctorSourceData::m_depthShaderTransparentMin) - ->Field("depthShaderTransparentMax", &ShaderEnableFunctorSourceData::m_depthShaderTransparentMax) - ; - } - } - - RPI::MaterialFunctorSourceData::FunctorResult ShaderEnableFunctorSourceData::CreateFunctor(const RuntimeContext& context) const - { - RPI::Ptr functor = aznew ShaderEnableFunctor; - - functor->m_opacityModeIndex = context.FindMaterialPropertyIndex(Name{ m_opacityMode }); - if (functor->m_opacityModeIndex.IsNull()) - { - return Failure(); - } - AddMaterialPropertyDependency(functor, functor->m_opacityModeIndex); - - functor->m_parallaxEnableIndex = context.FindMaterialPropertyIndex(Name{ m_parallaxEnable }); - if (functor->m_parallaxEnableIndex.IsNull()) - { - return Failure(); - } - AddMaterialPropertyDependency(functor, functor->m_parallaxEnableIndex); - - functor->m_parallaxPdoEnableIndex = context.FindMaterialPropertyIndex(Name{ m_parallaxPdoEnable }); - if (functor->m_parallaxPdoEnableIndex.IsNull()) - { - return Failure(); - } - AddMaterialPropertyDependency(functor, functor->m_parallaxPdoEnableIndex); - - if (!context.CheckShaderIndexValid(m_shadowShaderWithPSIndex)) - { - return Failure(); - } - functor->m_shadowShaderWithPSIndex = m_shadowShaderWithPSIndex; - - if (!context.CheckShaderIndexValid(m_shadowShaderNoPSIndex)) - { - return Failure(); - } - functor->m_shadowShaderNoPSIndex = m_shadowShaderNoPSIndex; - - if (!context.CheckShaderIndexValid(m_depthShaderWithPSIndex)) - { - return Failure(); - } - functor->m_depthShaderWithPSIndex = m_depthShaderWithPSIndex; - - if (!context.CheckShaderIndexValid(m_depthShaderNoPSIndex)) - { - return Failure(); - } - functor->m_depthShaderNoPSIndex = m_depthShaderNoPSIndex; - - if (!context.CheckShaderIndexValid(m_pbrShaderNoEdsIndex)) - { - return Failure(); - } - functor->m_pbrShaderNoEdsIndex = m_pbrShaderNoEdsIndex; - - if (!context.CheckShaderIndexValid(m_pbrShaderWithEdsIndex)) - { - return Failure(); - } - functor->m_pbrShaderWithEdsIndex = m_pbrShaderWithEdsIndex; - if (!context.CheckShaderIndexValid(m_depthShaderTransparentMin)) - { - return Failure(); - } - functor->m_depthShaderTransparentMin = m_depthShaderTransparentMin; - if (!context.CheckShaderIndexValid(m_depthShaderTransparentMax)) - { - return Failure(); - } - functor->m_depthShaderTransparentMax = m_depthShaderTransparentMax; - - return Success(RPI::Ptr(functor)); - } - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.h b/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.h deleted file mode 100644 index 2d00a4a015..0000000000 --- a/Gems/Atom/Feature/Common/Code/Source/Material/ShaderEnableFunctorSourceData.h +++ /dev/null @@ -1,52 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ - -#pragma once - -#include "./ShaderEnableFunctor.h" -#include - -namespace AZ -{ - namespace Render - { - class ShaderEnableFunctor; - - //! Builds a ShaderEnableFunctor - class ShaderEnableFunctorSourceData final - : public RPI::MaterialFunctorSourceData - { - public: - AZ_RTTI(ShaderEnableFunctorSourceData, "{63775ECB-5C3E-44D3-B175-4537BF76C3A7}", RPI::MaterialFunctorSourceData); - - static void Reflect(ReflectContext* context); - - FunctorResult CreateFunctor(const RuntimeContext& context) const override; - - private: - - AZStd::string m_opacityMode; - AZStd::string m_parallaxEnable; - AZStd::string m_parallaxPdoEnable; - - uint32_t m_shadowShaderNoPSIndex = -1; - uint32_t m_shadowShaderWithPSIndex = -1; - uint32_t m_depthShaderNoPSIndex = -1; - uint32_t m_depthShaderWithPSIndex = -1; - uint32_t m_pbrShaderWithEdsIndex = -1; - uint32_t m_pbrShaderNoEdsIndex = -1; - // The following are used by the light culling system to produce min/max depth bounds - uint32_t m_depthShaderTransparentMin = -1; - uint32_t m_depthShaderTransparentMax = -1; - }; - } -} diff --git a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp index 29f0636e9e..117b177f05 100644 --- a/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/Mesh/MeshFeatureProcessor.cpp @@ -231,6 +231,19 @@ namespace AZ return {}; } + Data::Instance MeshFeatureProcessor::GetObjectSrg(const MeshHandle& meshHandle) const + { + return meshHandle.IsValid() ? meshHandle->m_shaderResourceGroup : nullptr; + } + + void MeshFeatureProcessor::QueueObjectSrgForCompile(const MeshHandle& meshHandle) const + { + if (meshHandle.IsValid()) + { + meshHandle->m_objectSrgNeedsUpdate = true; + } + } + void MeshFeatureProcessor::SetMaterialAssignmentMap(const MeshHandle& meshHandle, const Data::Instance& material) { Render::MaterialAssignmentMap materials; @@ -728,7 +741,7 @@ namespace AZ // retrieve vertex/index buffers RPI::ModelLod::StreamBufferViewList streamBufferViews; - [[maybe_unused]] bool result = modelLod->GetStreamsForMesh(inputStreamLayout, streamBufferViews, shaderInputContract, meshIndex); + [[maybe_unused]] bool result = modelLod->GetStreamsForMesh(inputStreamLayout, streamBufferViews, nullptr, shaderInputContract, meshIndex); AZ_Assert(result, "Failed to retrieve mesh stream buffer views"); // note that the element count is the size of the entire buffer, even though this mesh may only diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.cpp index 35793b82a3..1bb537ecef 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.cpp @@ -12,6 +12,7 @@ #include +#include #include #include @@ -38,6 +39,11 @@ namespace AZ return m_shader; } + void MorphTargetComputePass::SetFeatureProcessor(SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor) + { + m_skinnedMeshFeatureProcessor = skinnedMeshFeatureProcessor; + } + void MorphTargetComputePass::BuildAttachmentsInternal() { // The same buffer that skinning writes to is used to manage the computed vertex deltas that are passed from the @@ -45,30 +51,16 @@ namespace AZ AttachBufferToSlot(Name{ "MorphTargetDeltaOutput" }, SkinnedMeshOutputStreamManagerInterface::Get()->GetBuffer()); } - void MorphTargetComputePass::AddDispatchItem(const RHI::DispatchItem* dispatchItem) - { - AZ_Assert(dispatchItem != nullptr, "invalid dispatchItem"); - - AZStd::lock_guard lock(m_mutex); - //using an unordered_set here to prevent redundantly adding the same dispatchItem to the submission queue - //(i.e. if the same morph target exists in multiple views, it can call AddDispatchItem multiple times with the same item) - m_dispatches.insert(dispatchItem); - } - void MorphTargetComputePass::BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) { - RHI::CommandList* commandList = context.GetCommandList(); - - SetSrgsForDispatch(commandList); - - AZStd::lock_guard lock(m_mutex); - for (const RHI::DispatchItem* dispatchItem : m_dispatches) + if (m_skinnedMeshFeatureProcessor) { - commandList->Submit(*dispatchItem); - } + RHI::CommandList* commandList = context.GetCommandList(); - // Clear the dispatch items. They will need to be re-populated next frame - m_dispatches.clear(); + SetSrgsForDispatch(commandList); + + m_skinnedMeshFeatureProcessor->SubmitMorphTargetDispatchItems(commandList); + } } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.h b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.h index 3967d9190e..61fa485fbc 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetComputePass.h @@ -18,6 +18,8 @@ namespace AZ { namespace Render { + class SkinnedMeshFeatureProcessor; + //! The morph target compute pass submits dispatch items for morph targets. The dispatch items are cleared every frame, so it needs to be re-populated. class MorphTargetComputePass : public RPI::ComputePass @@ -31,16 +33,14 @@ namespace AZ static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - //! Thread-safe function for adding a dispatch item to the current frame. - void AddDispatchItem(const RHI::DispatchItem* dispatchItem); Data::Instance GetShader() const; + void SetFeatureProcessor(SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor); private: void BuildAttachmentsInternal() override; void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; - AZStd::mutex m_mutex; - AZStd::unordered_set m_dispatches; + SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor = nullptr; }; } } diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp index d7bbc315ed..7b3aedd64e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.cpp @@ -11,7 +11,7 @@ */ #include -#include +#include #include #include @@ -30,7 +30,7 @@ namespace AZ MorphTargetDispatchItem::MorphTargetDispatchItem( const AZStd::intrusive_ptr inputBuffers, const MorphTargetMetaData& morphTargetMetaData, - RPI::Ptr morphTargetComputePass, + SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor, MorphTargetInstanceMetaData morphInstanceMetaData, float morphDeltaIntegerEncoding) : m_inputBuffers(inputBuffers) @@ -38,7 +38,7 @@ namespace AZ , m_morphInstanceMetaData(morphInstanceMetaData) , m_accumulatedDeltaIntegerEncoding(morphDeltaIntegerEncoding) { - m_morphTargetShader = morphTargetComputePass->GetShader(); + m_morphTargetShader = skinnedMeshFeatureProcessor->GetMorphTargetShader(); RPI::ShaderReloadNotificationBus::Handler::BusConnect(m_morphTargetShader->GetAssetId()); } diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h index 46680eb465..ad1fd969a5 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetDispatchItem.h @@ -37,7 +37,7 @@ namespace AZ namespace Render { - class MorphTargetComputePass; + class SkinnedMeshFeatureProcessor; //! Holds and manages an RHI DispatchItem for a specific morph target, and the resources that are needed to build and maintain it. class MorphTargetDispatchItem @@ -51,7 +51,7 @@ namespace AZ explicit MorphTargetDispatchItem( const AZStd::intrusive_ptr inputBuffers, const MorphTargetMetaData& morphTargetMetaData, - RPI::Ptr morphTargetComputePass, + SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor, MorphTargetInstanceMetaData morphInstanceMetaData, float accumulatedDeltaRange ); diff --git a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetInputBuffers.cpp b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetInputBuffers.cpp index 35437f2b1e..e6fa8bb54e 100644 --- a/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetInputBuffers.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/MorphTargets/MorphTargetInputBuffers.cpp @@ -30,16 +30,18 @@ namespace AZ { MorphTargetInputBuffers::MorphTargetInputBuffers(const RPI::BufferAssetView& bufferAssetView, const AZStd::string& bufferNamePrefix) { - auto buffer = RPI::Buffer::FindOrCreate(bufferAssetView.GetBufferAsset()); - - AZ::RHI::Ptr bufferView = RHI::Factory::Get().CreateBufferView(); + m_vertexDeltaBuffer = RPI::Buffer::FindOrCreate(bufferAssetView.GetBufferAsset()); + if (m_vertexDeltaBuffer) { - bufferView->SetName(Name(bufferNamePrefix + "MorphTargetVertexDeltaView")); - [[maybe_unused]] RHI::ResultCode resultCode = bufferView->Init(*buffer->GetRHIBuffer(), bufferAssetView.GetBufferViewDescriptor()); - AZ_Error("MorphTargetInputBuffers", resultCode == RHI::ResultCode::Success, "Failed to initialize buffer view for morph target."); - } + AZ::RHI::Ptr bufferView = RHI::Factory::Get().CreateBufferView(); + { + bufferView->SetName(Name(bufferNamePrefix + "MorphTargetVertexDeltaView")); + [[maybe_unused]] RHI::ResultCode resultCode = bufferView->Init(*m_vertexDeltaBuffer->GetRHIBuffer(), bufferAssetView.GetBufferViewDescriptor()); + AZ_Error("MorphTargetInputBuffers", resultCode == RHI::ResultCode::Success, "Failed to initialize buffer view for morph target."); + } - m_vertexDeltaBufferView = bufferView; + m_vertexDeltaBufferView = bufferView; + } } void MorphTargetInputBuffers::SetBufferViewsOnShaderResourceGroup(const Data::Instance& perInstanceSRG) diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.cpp index b22f4b5861..056f7b7da4 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.cpp @@ -69,7 +69,6 @@ namespace AZ if (m_shouldUpdatePassParameters) { - UpdateEyeAdaptationPass(); UpdateLuminanceHeatmap(); m_shouldUpdatePassParameters = false; @@ -198,30 +197,6 @@ namespace AZ } } - void ExposureControlSettings::UpdateEyeAdaptationPass() - { - auto* passSystem = AZ::RPI::PassSystemInterface::Get(); - - // [GFX-TODO][ATOM-13224] Remove UpdateLuminanceHeatmap and UpdateEyeAdaptationPass - auto passTemplateName = m_eyeAdaptationPassTemplateNameId; - - if (passSystem->HasPassesForTemplateName(passTemplateName)) - { - const AZStd::vector& eyeAdaptationPasses = passSystem->GetPassesForTemplateName(passTemplateName); - for (RPI::Pass* pass : eyeAdaptationPasses) - { - auto* eyeAdaptationPass = azrtti_cast(pass); - auto* renderPipeline = eyeAdaptationPass->GetRenderPipeline(); - - if (renderPipeline && renderPipeline->GetScene() == GetParentScene()) - { - // update eye adaptation pass's enable state - eyeAdaptationPass->UpdateEnable(); - } - } - } - } - void ExposureControlSettings::UpdateLuminanceHeatmap() { auto* passSystem = AZ::RPI::PassSystemInterface::Get(); diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.h b/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.h index 566f60dd28..8344d6aa09 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.h +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcess/ExposureControl/ExposureControlSettings.h @@ -85,7 +85,6 @@ namespace AZ void UpdateExposureControlRelatedPassParameters(); void UpdateLuminanceHeatmap(); - void UpdateEyeAdaptationPass(); PostProcessSettings* m_parentSettings = nullptr; bool m_shouldUpdatePassParameters = true; diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp index 97c11a9d89..e7d4c47f02 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.cpp @@ -62,17 +62,24 @@ namespace AZ m_buffer = RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(desc); } - void EyeAdaptationPass::UpdateEnable() + void EyeAdaptationPass::BuildAttachmentsInternal() { - if (m_pipeline == nullptr) + if (!m_buffer) { - SetEnabled(false); - return; + InitBuffer(); } - AZ_Assert(m_pipeline->GetScene(), "Scene shouldn't nullptr"); + AttachBufferToSlot(EyeAdaptationDataInputOutputSlotName, m_buffer); + } - UpdateInputBufferIndices(); + bool EyeAdaptationPass::IsEnabled() const + { + if (!ComputePass::IsEnabled() || m_pipeline == nullptr) + { + return false; + } + + AZ_Assert(m_pipeline->GetScene(), "EyeAdaptationPass's Pipeline does not have a valid scene pointer"); AZ::RPI::Scene* scene = GetScene(); bool enabled = false; @@ -95,38 +102,9 @@ namespace AZ } } - const bool lastEnabled = IsEnabled(); - SetEnabled(enabled); - - if (IsEnabled() && !lastEnabled) - { - // Need rebuilt this pass's attachment as any connections. So queue parent pass. - GetParent()->QueueForBuildAttachments(); - } + return enabled; } - void EyeAdaptationPass::UpdateInputBufferIndices() - { - if (m_exposureControlBufferInputIndex.IsNull()) - { - m_exposureControlBufferInputIndex = GetView()->GetShaderResourceGroup()->FindShaderInputBufferIndex(Name("m_exposureControl")); - } - } - - void EyeAdaptationPass::BuildAttachmentsInternal() - { - if (m_pipeline == nullptr) - { - return; - } - - if (!m_buffer) - { - InitBuffer(); - } - - AttachBufferToSlot(EyeAdaptationDataInputOutputSlotName, m_buffer); - } void EyeAdaptationPass::FrameBeginInternal(FramePrepareParams params) { diff --git a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.h b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.h index b87d9db86f..cef168a122 100644 --- a/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.h +++ b/Gems/Atom/Feature/Common/Code/Source/PostProcessing/EyeAdaptationPass.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -45,12 +46,11 @@ namespace AZ static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); // Check if we should enable of disable this pass - void UpdateEnable(); + bool IsEnabled() const override; protected: EyeAdaptationPass(const RPI::PassDescriptor& descriptor); void InitBuffer(); - void UpdateInputBufferIndices(); // A StructuredBuffer for exposure calculation on the GPU. struct ExposureCalculationData @@ -65,7 +65,7 @@ namespace AZ AZ::Data::Instance m_buffer; // SRG binding indices... - AZ::RHI::ShaderInputBufferIndex m_exposureControlBufferInputIndex; + AZ::RHI::ShaderInputNameIndex m_exposureControlBufferInputIndex = "m_exposureControl"; }; } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp index c4e9306dc9..7c13daea3b 100644 --- a/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/RayTracing/RayTracingFeatureProcessor.cpp @@ -318,7 +318,7 @@ namespace AZ { AZ::Transform meshTransform = transformFeatureProcessor->GetTransformForId(TransformServiceFeatureProcessorInterface::ObjectId(mesh.first)); AZ::Transform noScaleTransform = meshTransform; - noScaleTransform.ExtractScale(); + noScaleTransform.ExtractUniformScale(); AZ::Matrix3x3 rotationMatrix = Matrix3x3::CreateFromTransform(noScaleTransform); rotationMatrix = rotationMatrix.GetInverseFull().GetTranspose(); diff --git a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp index 3497855c07..3e9e316a5a 100644 --- a/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/ReflectionProbe/ReflectionProbe.cpp @@ -209,7 +209,7 @@ namespace AZ void ReflectionProbe::SetTransform(const AZ::Transform& transform) { // retrieve previous scale and revert the scale on the inner/outer extents - AZ::Vector3 previousScale = m_transform.GetScale(); + float previousScale = m_transform.GetUniformScale(); m_outerExtents /= previousScale; m_innerExtents /= previousScale; @@ -218,12 +218,12 @@ namespace AZ // avoid scaling the visualization sphere AZ::Transform visualizationTransform = m_transform; - visualizationTransform.ExtractScale(); + visualizationTransform.ExtractUniformScale(); m_meshFeatureProcessor->SetTransform(m_visualizationMeshHandle, visualizationTransform); // update the inner/outer extents with the new scale - m_outerExtents *= m_transform.GetScale(); - m_innerExtents *= m_transform.GetScale(); + m_outerExtents *= m_transform.GetUniformScale(); + m_innerExtents *= m_transform.GetUniformScale(); m_outerAabbWs = Aabb::CreateCenterHalfExtents(m_transform.GetTranslation(), m_outerExtents / 2.0f); m_innerAabbWs = Aabb::CreateCenterHalfExtents(m_transform.GetTranslation(), m_innerExtents / 2.0f); @@ -232,14 +232,14 @@ namespace AZ void ReflectionProbe::SetOuterExtents(const AZ::Vector3& outerExtents) { - m_outerExtents = outerExtents * m_transform.GetScale(); + m_outerExtents = outerExtents * m_transform.GetUniformScale(); m_outerAabbWs = Aabb::CreateCenterHalfExtents(m_transform.GetTranslation(), m_outerExtents / 2.0f); m_updateSrg = true; } void ReflectionProbe::SetInnerExtents(const AZ::Vector3& innerExtents) { - m_innerExtents = innerExtents * m_transform.GetScale(); + m_innerExtents = innerExtents * m_transform.GetUniformScale(); m_innerAabbWs = Aabb::CreateCenterHalfExtents(m_transform.GetTranslation(), m_innerExtents / 2.0f); m_updateSrg = true; } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.cpp index d7b2c605b4..a3feddb0b6 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.cpp @@ -12,6 +12,7 @@ #include +#include #include #include @@ -22,11 +23,9 @@ namespace AZ { namespace Render { - SkinnedMeshComputePass::SkinnedMeshComputePass(const RPI::PassDescriptor& descriptor) : RPI::ComputePass(descriptor) { - m_cachedShaderOptions.SetShader(m_shader); } RPI::Ptr SkinnedMeshComputePass::Create(const RPI::PassDescriptor& descriptor) @@ -40,42 +39,30 @@ namespace AZ return m_shader; } - RPI::ShaderOptionGroup SkinnedMeshComputePass::CreateShaderOptionGroup(const SkinnedMeshShaderOptions shaderOptions, SkinnedMeshShaderOptionNotificationBus::Handler& shaderReinitializedHandler) + void SkinnedMeshComputePass::SetFeatureProcessor(SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor) { - m_cachedShaderOptions.ConnectToShaderReinitializedEvent(shaderReinitializedHandler); - return m_cachedShaderOptions.CreateShaderOptionGroup(shaderOptions); - } - - void SkinnedMeshComputePass::AddDispatchItem(const RHI::DispatchItem* dispatchItem) - { - AZ_Assert(dispatchItem != nullptr, "invalid dispatchItem"); - - AZStd::lock_guard lock(m_mutex); - //using an unordered_set here to prevent redundantly adding the same dispatchItem to the submission queue - //(i.e. if the same skinnedMesh exists in multiple views, it can call AddDispatchItem multiple times with the same item) - m_dispatches.insert(dispatchItem); + m_skinnedMeshFeatureProcessor = skinnedMeshFeatureProcessor; } void SkinnedMeshComputePass::BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) { - RHI::CommandList* commandList = context.GetCommandList(); - - SetSrgsForDispatch(commandList); - - AZStd::lock_guard lock(m_mutex); - for (const RHI::DispatchItem* dispatchItem : m_dispatches) + if (m_skinnedMeshFeatureProcessor) { - commandList->Submit(*dispatchItem); - } + RHI::CommandList* commandList = context.GetCommandList(); - // Clear the dispatch items. They will need to be re-populated next frame - m_dispatches.clear(); + SetSrgsForDispatch(commandList); + + m_skinnedMeshFeatureProcessor->SubmitSkinningDispatchItems(commandList); + } } void SkinnedMeshComputePass::OnShaderReinitialized(const RPI::Shader& shader) { ComputePass::OnShaderReinitialized(shader); - m_cachedShaderOptions.SetShader(m_shader); + if (m_skinnedMeshFeatureProcessor) + { + m_skinnedMeshFeatureProcessor->OnSkinningShaderReinitialized(m_shader); + } } void SkinnedMeshComputePass::OnShaderVariantReinitialized(const RPI::Shader& shader, const RPI::ShaderVariantId&, RPI::ShaderVariantStableId) diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.h index d2e0fb77dc..5f7ff08e47 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshComputePass.h @@ -20,6 +20,8 @@ namespace AZ { namespace Render { + class SkinnedMeshFeatureProcessor; + //! The skinned mesh compute pass submits dispatch items for skinning. The dispatch items are cleared every frame, so it needs to be re-populated. class SkinnedMeshComputePass : public RPI::ComputePass @@ -33,10 +35,9 @@ namespace AZ static RPI::Ptr Create(const RPI::PassDescriptor& descriptor); - //! Thread-safe function for adding a dispatch item to the current frame. - void AddDispatchItem(const RHI::DispatchItem* dispatchItem); Data::Instance GetShader() const; - RPI::ShaderOptionGroup CreateShaderOptionGroup(const SkinnedMeshShaderOptions shaderOptions, SkinnedMeshShaderOptionNotificationBus::Handler& shaderReinitializedHandler); + + void SetFeatureProcessor(SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor); private: void BuildCommandListInternal(const RHI::FrameGraphExecuteContext& context) override; @@ -45,9 +46,7 @@ namespace AZ void OnShaderReinitialized(const RPI::Shader& shader) override; void OnShaderVariantReinitialized(const RPI::Shader& shader, const RPI::ShaderVariantId& shaderVariantId, RPI::ShaderVariantStableId shaderVariantStableId) override; - AZStd::mutex m_mutex; - AZStd::unordered_set m_dispatches; - CachedSkinnedMeshShaderOptions m_cachedShaderOptions; + SkinnedMeshFeatureProcessor* m_skinnedMeshFeatureProcessor = nullptr; }; } } diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp index c9054fc6c8..647a87a788 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -34,7 +34,7 @@ namespace AZ size_t lodIndex, Data::Instance boneTransforms, const SkinnedMeshShaderOptions& shaderOptions, - RPI::Ptr skinnedMeshComputePass, + SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor, MorphTargetInstanceMetaData morphTargetInstanceMetaData, float morphTargetDeltaIntegerEncoding) : m_inputBuffers(inputBuffers) @@ -45,7 +45,7 @@ namespace AZ , m_morphTargetInstanceMetaData(morphTargetInstanceMetaData) , m_morphTargetDeltaIntegerEncoding(morphTargetDeltaIntegerEncoding) { - m_skinningShader = skinnedMeshComputePass->GetShader(); + m_skinningShader = skinnedMeshFeatureProcessor->GetSkinningShader(); // Shader options are generally set per-skinned mesh instance, but morph targets may only exist on some lods. Override the option for applying morph targets here if (m_morphTargetInstanceMetaData.m_accumulatedPositionDeltaOffsetInBytes != MorphTargetConstants::s_invalidDeltaOffset) @@ -58,7 +58,7 @@ namespace AZ } // CreateShaderOptionGroup will also connect to the SkinnedMeshShaderOptionNotificationBus - m_shaderOptionGroup = skinnedMeshComputePass->CreateShaderOptionGroup(m_shaderOptions, *this); + m_shaderOptionGroup = skinnedMeshFeatureProcessor->CreateSkinningShaderOptionGroup(m_shaderOptions, *this); } SkinnedMeshDispatchItem::~SkinnedMeshDispatchItem() diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h index c80b002106..33bec89afd 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshDispatchItem.h @@ -38,7 +38,7 @@ namespace AZ namespace Render { - class SkinnedMeshComputePass; + class SkinnedMeshFeatureProcessor; //! Holds and manages an RHI DispatchItem for a specific skinned mesh, and the resources that are needed to build and maintain it. class SkinnedMeshDispatchItem @@ -55,7 +55,7 @@ namespace AZ size_t lodIndex, Data::Instance skinningMatrices, const SkinnedMeshShaderOptions& shaderOptions, - RPI::Ptr skinnedMeshComputePass, + SkinnedMeshFeatureProcessor* skinnedMeshFeatureProcessor, MorphTargetInstanceMetaData morphTargetInstanceMetaData, float morphTargetDeltaIntegerEncoding ); diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp index 193a36e588..cb2d6a69ef 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.cpp @@ -24,8 +24,10 @@ #include #include #include +#include #include +#include #include #include @@ -69,26 +71,11 @@ namespace AZ } - void SkinnedMeshFeatureProcessor::Simulate(const FeatureProcessor::SimulatePacket& packet) - { - AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); - AZ_ATOM_PROFILE_FUNCTION("SkinnedMesh", "SkinnedMeshFeatureProcessor: Simulate"); - AZ_UNUSED(packet); - - SkinnedMeshFeatureProcessorNotificationBus::Broadcast(&SkinnedMeshFeatureProcessorNotificationBus::Events::OnUpdateSkinningMatrices); - - } - void SkinnedMeshFeatureProcessor::Render(const FeatureProcessor::RenderPacket& packet) { AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); AZ_ATOM_PROFILE_FUNCTION("SkinnedMesh", "SkinnedMeshFeatureProcessor: Render"); - if (!m_skinningPass) - { - return; - } - #if 0 //[GFX_TODO][ATOM-13564] Temporarily disable skinning culling until we figure out how to hook up visibility & lod selection with skinning: //Setup the culling workgroup (it will be re-used for each view) { @@ -132,7 +119,7 @@ namespace AZ //Dispatch the workgroup to each view for (const RPI::ViewPtr& viewPtr : packet.m_views) { - Job *processWorkgroupJob = AZ::CreateJobFunction( + Job* processWorkgroupJob = AZ::CreateJobFunction( [this, cullingSystem, viewPtr](AZ::Job& thisJob) { AZ_PROFILE_SCOPE_DYNAMIC(Debug::ProfileCategory::AzRender, "skinningMeshFP processWorkgroupJob - View: %s", viewPtr->GetName().GetCStr()); @@ -167,7 +154,16 @@ namespace AZ float maxScreenPercentage(lod.m_range.m_max); if (approxScreenPercentage >= minScreenPercentage && approxScreenPercentage <= maxScreenPercentage) { - m_skinningPass->AddDispatchItem(&renderProxy->m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + AZStd::lock_guard lock(m_dispatchItemMutex); + m_skinningDispatches.insert(&renderProxy->m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy->m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) + { + const MorphTargetDispatchItem* dispatchItem = renderProxy->m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); + if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) + { + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); + } + } } } } @@ -232,13 +228,14 @@ namespace AZ //Note that this supports overlapping lod ranges (to support cross-fading lods, for example) if (approxScreenPercentage >= lod.m_screenCoverageMin && approxScreenPercentage <= lod.m_screenCoverageMax) { - m_skinningPass->AddDispatchItem(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); + AZStd::lock_guard lock(m_dispatchItemMutex); + m_skinningDispatches.insert(&renderProxy.m_dispatchItemsByLod[lodIndex]->GetRHIDispatchItem()); for (size_t morphTargetIndex = 0; morphTargetIndex < renderProxy.m_morphTargetDispatchItemsByLod[lodIndex].size(); morphTargetIndex++) { const MorphTargetDispatchItem* dispatchItem = renderProxy.m_morphTargetDispatchItemsByLod[lodIndex][morphTargetIndex].get(); if (dispatchItem && dispatchItem->GetWeight() > AZ::Constants::FloatEpsilon) { - m_morphTargetPass->AddDispatchItem(&dispatchItem->GetRHIDispatchItem()); + m_morphTargetDispatches.insert(&dispatchItem->GetRHIDispatchItem()); } } } @@ -248,29 +245,32 @@ namespace AZ #endif } - void SkinnedMeshFeatureProcessor::OnRenderPipelineAdded([[maybe_unused]] RPI::RenderPipelinePtr pipeline) + void SkinnedMeshFeatureProcessor::OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) { - InitSkinningAndMorphPass(); + InitSkinningAndMorphPass(pipeline->GetRootPass()); } - void SkinnedMeshFeatureProcessor::OnRenderPipelineRemoved([[maybe_unused]] RPI::RenderPipeline* pipeline) + void SkinnedMeshFeatureProcessor::OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) { - InitSkinningAndMorphPass(); - } - - void SkinnedMeshFeatureProcessor::OnRenderPipelinePassesChanged([[maybe_unused]] RPI::RenderPipeline* renderPipeline) - { - InitSkinningAndMorphPass(); + InitSkinningAndMorphPass(renderPipeline->GetRootPass()); } void SkinnedMeshFeatureProcessor::OnBeginPrepareRender() { m_renderProxiesChecker.soft_lock(); + + SkinnedMeshFeatureProcessorNotificationBus::Broadcast(&SkinnedMeshFeatureProcessorNotificationBus::Events::OnUpdateSkinningMatrices); } - void SkinnedMeshFeatureProcessor::OnEndPrepareRender() + void SkinnedMeshFeatureProcessor::OnRenderEnd() { m_renderProxiesChecker.soft_unlock(); + + // Clear any dispatch items that were added but never submitted + // in case there were no passes that submitted this frame + // because they execute at a lower frequency + m_skinningDispatches.clear(); + m_morphTargetDispatches.clear(); } SkinnedMeshRenderProxyHandle SkinnedMeshFeatureProcessor::AcquireRenderProxy(const SkinnedMeshRenderProxyDesc& desc) @@ -295,61 +295,73 @@ namespace AZ return false; } - void SkinnedMeshFeatureProcessor::InitSkinningAndMorphPass() + void SkinnedMeshFeatureProcessor::InitSkinningAndMorphPass(const RPI::Ptr pipelineRootPass) { - m_skinningPass = nullptr; //reset it to null, just in case it fails to load the assets properly - m_morphTargetPass = nullptr; - - RPI::PassSystemInterface* passSystem = RPI::PassSystemInterface::Get(); - if (passSystem->HasPassesForTemplateName(AZ::Name{ "SkinningPassTemplate" })) + RPI::Ptr skinningPass = pipelineRootPass->FindPassByNameRecursive(AZ::Name{ "SkinningPass" }); + if (skinningPass) { - auto& skinningPasses = passSystem->GetPassesForTemplateName(AZ::Name{ "SkinningPassTemplate" }); + SkinnedMeshComputePass* skinnedMeshComputePass = azdynamic_cast(skinningPass.get()); + skinnedMeshComputePass->SetFeatureProcessor(this); - // For now, assume one skinning pass - if (!skinningPasses.empty() && skinningPasses[0]) + // There may be multiple skinning passes in the scene due to multiple pipelines, but there is only one skinning shader + m_skinningShader = skinnedMeshComputePass->GetShader(); + + if (!m_skinningShader) { - m_skinningPass = static_cast(skinningPasses[0]); - const Data::Instance shader = m_skinningPass->GetShader(); - - if (!shader) - { - AZ_Error(s_featureProcessorName, false, "Failed to get skinning pass shader. It may need to finish processing."); - } + AZ_Error(s_featureProcessorName, false, "Failed to get skinning pass shader. It may need to finish processing."); } else { - AZ_Error(s_featureProcessorName, false, "\"SkinningPassTemplate\" does not have any valid passes. Check your game project's .pass assets."); + m_cachedSkinningShaderOptions.SetShader(m_skinningShader); } } - else - { - AZ_Error(s_featureProcessorName, false, "Failed to find passes for \"SkinningPassTemplate\". Check your game project's .pass assets."); - } - if (passSystem->HasPassesForTemplateName(AZ::Name{ "MorphTargetPassTemplate" })) + RPI::Ptr morphTargetPass = pipelineRootPass->FindPassByNameRecursive(AZ::Name{ "MorphTargetPass" }); + if (morphTargetPass) { - auto& morphTargetPasses = passSystem->GetPassesForTemplateName(AZ::Name{ "MorphTargetPassTemplate" }); + MorphTargetComputePass* morphTargetComputePass = azdynamic_cast(morphTargetPass.get()); + morphTargetComputePass->SetFeatureProcessor(this); - // For now, assume one skinning pass - if (!morphTargetPasses.empty() && morphTargetPasses[0]) + // There may be multiple morph target passes in the scene due to multiple pipelines, but there is only one morph target shader + m_morphTargetShader = morphTargetComputePass->GetShader(); + + if (!m_morphTargetShader) { - m_morphTargetPass = static_cast(morphTargetPasses[0]); - const Data::Instance shader = m_morphTargetPass->GetShader(); + AZ_Error(s_featureProcessorName, false, "Failed to get morph target pass shader. It may need to finish processing."); + } + } + } - if (!shader) - { - AZ_Error(s_featureProcessorName, false, "Failed to get morph target pass shader. It may need to finish processing."); - } - } - else - { - AZ_Error(s_featureProcessorName, false, "\"MorphTargetPassTemplate\" does not have any valid passes. Check your game project's .pass assets."); - } - } - else + RPI::ShaderOptionGroup SkinnedMeshFeatureProcessor::CreateSkinningShaderOptionGroup(const SkinnedMeshShaderOptions shaderOptions, SkinnedMeshShaderOptionNotificationBus::Handler& shaderReinitializedHandler) + { + m_cachedSkinningShaderOptions.ConnectToShaderReinitializedEvent(shaderReinitializedHandler); + return m_cachedSkinningShaderOptions.CreateShaderOptionGroup(shaderOptions); + } + + void SkinnedMeshFeatureProcessor::OnSkinningShaderReinitialized(const Data::Instance skinningShader) + { + m_skinningShader = skinningShader; + m_cachedSkinningShaderOptions.SetShader(m_skinningShader); + } + + void SkinnedMeshFeatureProcessor::SubmitSkinningDispatchItems(RHI::CommandList* commandList) + { + AZStd::lock_guard lock(m_dispatchItemMutex); + for (const RHI::DispatchItem* dispatchItem : m_skinningDispatches) { - AZ_Error(s_featureProcessorName, false, "Failed to find passes for \"MorphTargetPassTemplate\". Check your game project's .pass assets."); + commandList->Submit(*dispatchItem); } + m_skinningDispatches.clear(); + } + + void SkinnedMeshFeatureProcessor::SubmitMorphTargetDispatchItems(RHI::CommandList* commandList) + { + AZStd::lock_guard lock(m_dispatchItemMutex); + for (const RHI::DispatchItem* dispatchItem : m_morphTargetDispatches) + { + commandList->Submit(*dispatchItem); + } + m_morphTargetDispatches.clear(); } SkinnedMeshRenderProxyInterfaceHandle SkinnedMeshFeatureProcessor::AcquireRenderProxyInterface(const SkinnedMeshRenderProxyDesc& desc) @@ -363,14 +375,14 @@ namespace AZ return ReleaseRenderProxy(handle); } - RPI::Ptr SkinnedMeshFeatureProcessor::GetSkinningPass() const + Data::Instance SkinnedMeshFeatureProcessor::GetSkinningShader() const { - return m_skinningPass; + return m_skinningShader; } - RPI::Ptr SkinnedMeshFeatureProcessor::GetMorphTargetPass() const + Data::Instance SkinnedMeshFeatureProcessor::GetMorphTargetShader() const { - return m_morphTargetPass; + return m_morphTargetShader; } } // namespace Render } // namespace AZ diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.h b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.h index 86dedfa161..75d41742b2 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.h +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshFeatureProcessor.h @@ -49,37 +49,47 @@ namespace AZ // FeatureProcessor overrides ... void Activate() override; void Deactivate() override; - void Simulate(const FeatureProcessor::SimulatePacket& packet) override; void Render(const FeatureProcessor::RenderPacket& packet) override; + void OnRenderEnd() override; // RPI::SceneNotificationBus overrides ... void OnRenderPipelineAdded(RPI::RenderPipelinePtr pipeline) override; - void OnRenderPipelineRemoved(RPI::RenderPipeline* pipeline) override; void OnRenderPipelinePassesChanged(RPI::RenderPipeline* renderPipeline) override; void OnBeginPrepareRender() override; - void OnEndPrepareRender() override; SkinnedMeshRenderProxyHandle AcquireRenderProxy(const SkinnedMeshRenderProxyDesc& desc); bool ReleaseRenderProxy(SkinnedMeshRenderProxyHandle& handle); - RPI::Ptr GetSkinningPass() const; - RPI::Ptr GetMorphTargetPass() const; + Data::Instance GetSkinningShader() const; + RPI::ShaderOptionGroup CreateSkinningShaderOptionGroup(const SkinnedMeshShaderOptions shaderOptions, SkinnedMeshShaderOptionNotificationBus::Handler& shaderReinitializedHandler); + void OnSkinningShaderReinitialized(const Data::Instance skinningShader); + void SubmitSkinningDispatchItems(RHI::CommandList* commandList); + + Data::Instance GetMorphTargetShader() const; + void SubmitMorphTargetDispatchItems(RHI::CommandList* commandList); private: AZ_DISABLE_COPY_MOVE(SkinnedMeshFeatureProcessor); - void InitSkinningAndMorphPass(); + void InitSkinningAndMorphPass(const RPI::Ptr pipelineRootPass); SkinnedMeshRenderProxyInterfaceHandle AcquireRenderProxyInterface(const SkinnedMeshRenderProxyDesc& desc) override; bool ReleaseRenderProxyInterface(SkinnedMeshRenderProxyInterfaceHandle& handle) override; static const char* s_featureProcessorName; - RPI::Ptr m_skinningPass; - RPI::Ptr m_morphTargetPass; + + Data::Instance m_skinningShader; + CachedSkinnedMeshShaderOptions m_cachedSkinningShaderOptions; + + Data::Instance m_morphTargetShader; + AZStd::concurrency_checker m_renderProxiesChecker; StableDynamicArray m_renderProxies; AZStd::unique_ptr m_statsCollector; MeshFeatureProcessor* m_meshFeatureProcessor = nullptr; + AZStd::unordered_set m_skinningDispatches; + AZStd::unordered_set m_morphTargetDispatches; + AZStd::mutex m_dispatchItemMutex; }; } // namespace Render diff --git a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp index 90c54dfc10..090b720406 100644 --- a/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/SkinnedMesh/SkinnedMeshRenderProxy.cpp @@ -60,13 +60,7 @@ namespace AZ bool SkinnedMeshRenderProxy::BuildDispatchItem([[maybe_unused]] const RPI::Scene& scene, size_t modelLodIndex, [[maybe_unused]] const SkinnedMeshShaderOptions& shaderOptions) { - if (!m_featureProcessor->GetSkinningPass()) - { - AZ_Error("Skinned Mesh Feature Processor", false, "Failed to get Skinning Pass. Make sure the project has a skinning pass."); - return false; - } - - Data::Instance skinningShader = m_featureProcessor->GetSkinningPass()->GetShader(); + Data::Instance skinningShader = m_featureProcessor->GetSkinningShader(); if (!skinningShader) { AZ_Error("Skinned Mesh Feature Processor", false, "Failed to get skinning shader from skinning pass"); @@ -89,7 +83,7 @@ namespace AZ m_instance->m_outputStreamOffsetsInBytes[modelLodIndex], modelLodIndex, m_boneTransforms, m_shaderOptions, - m_featureProcessor->GetSkinningPass(), + m_featureProcessor, m_instance->m_morphTargetInstanceMetaData[modelLodIndex], morphDeltaIntegerEncoding }); @@ -100,7 +94,7 @@ namespace AZ } // Get the data needed to create a morph target dispatch item - Data::Instance morphTargetShader = m_featureProcessor->GetMorphTargetPass()->GetShader(); + Data::Instance morphTargetShader = m_featureProcessor->GetMorphTargetShader(); const AZStd::vector>& morphTargetInputBuffersVector = m_inputBuffers->GetMorphTargetInputBuffers(modelLodIndex); AZ_Assert(morphTargetMetaDatas.size() == morphTargetInputBuffersVector.size(), "Skinned Mesh Feature Processor - Mismatch in morph target metadata count and morph target input buffer count"); @@ -118,7 +112,7 @@ namespace AZ aznew MorphTargetDispatchItem{ morphTargetInputBuffersVector[morphTargetIndex], morphTargetMetaDatas[morphTargetIndex], - m_featureProcessor->GetMorphTargetPass(), + m_featureProcessor, m_instance->m_morphTargetInstanceMetaData[modelLodIndex], morphDeltaIntegerEncoding }); diff --git a/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp b/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp index acb6e4a287..fb73d0f416 100644 --- a/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp +++ b/Gems/Atom/Feature/Common/Code/Source/TransformService/TransformServiceFeatureProcessor.cpp @@ -231,7 +231,7 @@ namespace AZ AZ_Error("TransformServiceFeatureProcessor", id.IsValid(), "Attempting to get the transform for an invalid handle."); AZ::Matrix3x4 matrix3x4 = AZ::Matrix3x4::CreateFromRowMajorFloat12(m_objectToWorldTransforms.at(id.GetIndex()).m_transform); AZ::Transform transform = AZ::Transform::CreateFromMatrix3x4(matrix3x4); - transform.ExtractScale(); + transform.ExtractUniformScale(); return transform; } diff --git a/Gems/Atom/Feature/Common/Code/atom_feature_common_editor_files.cmake b/Gems/Atom/Feature/Common/Code/atom_feature_common_editor_files.cmake index 3a749a4b67..4e7cc9dab3 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_editor_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_editor_files.cmake @@ -24,16 +24,12 @@ set(FILES Source/Material/ConvertEmissiveUnitFunctorSourceData.h Source/Material/MaterialConverterSystemComponent.cpp Source/Material/MaterialConverterSystemComponent.h - Source/Material/ShaderEnableFunctorSourceData.cpp - Source/Material/ShaderEnableFunctorSourceData.h Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.cpp Source/Material/SubsurfaceTransmissionParameterFunctorSourceData.h Source/Material/Transform2DFunctorSourceData.cpp Source/Material/Transform2DFunctorSourceData.h Source/Material/UseTextureFunctorSourceData.cpp Source/Material/UseTextureFunctorSourceData.h - Source/Material/PropertyVisibilityFunctorSourceData.cpp - Source/Material/PropertyVisibilityFunctorSourceData.h Source/Material/DrawListFunctorSourceData.cpp Source/Material/DrawListFunctorSourceData.h ) 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 8926b0c19f..4f98046adb 100644 --- a/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake +++ b/Gems/Atom/Feature/Common/Code/atom_feature_common_files.cmake @@ -135,6 +135,8 @@ set(FILES Source/DiffuseProbeGrid/DiffuseProbeGridRenderPass.h Source/DiffuseProbeGrid/DiffuseProbeGrid.cpp Source/DiffuseProbeGrid/DiffuseProbeGrid.h + Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.cpp + Source/DiffuseProbeGrid/DiffuseProbeGridTextureReadback.h Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.h Source/DiffuseProbeGrid/DiffuseProbeGridFeatureProcessor.cpp Source/DisplayMapper/AcesOutputTransformPass.cpp @@ -153,16 +155,12 @@ set(FILES Source/LookupTable/LookupTableAsset.cpp Source/Material/ConvertEmissiveUnitFunctor.cpp Source/Material/ConvertEmissiveUnitFunctor.h - Source/Material/ShaderEnableFunctor.cpp - Source/Material/ShaderEnableFunctor.h Source/Material/SubsurfaceTransmissionParameterFunctor.cpp Source/Material/SubsurfaceTransmissionParameterFunctor.h Source/Material/Transform2DFunctor.cpp Source/Material/Transform2DFunctor.h Source/Material/UseTextureFunctor.cpp Source/Material/UseTextureFunctor.h - Source/Material/PropertyVisibilityFunctor.cpp - Source/Material/PropertyVisibilityFunctor.h Source/Material/DrawListFunctor.cpp Source/Material/DrawListFunctor.h Source/Math/GaussianMathFilter.h diff --git a/Gems/Atom/Feature/Common/gem.json b/Gems/Atom/Feature/Common/gem.json new file mode 100644 index 0000000000..6980863b4c --- /dev/null +++ b/Gems/Atom/Feature/Common/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_Feature_Common", + "display_name": "Atom Feature Common", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h index 2073c48d25..a5d8f53573 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/ShaderCompilerArguments.h @@ -13,6 +13,8 @@ #include #include +#include +#include namespace AZ { @@ -30,9 +32,16 @@ namespace AZ static void Reflect(ReflectContext* context); + //! Returns true if either @m_azslcAdditionalFreeArguments or @m_dxcAdditionalFreeArguments contain + //! macro definitions, e.g. "-D MACRO" or "-D MACRO=VALUE" or "-DMACRO", "-DMACRO=VALUE". + //! It is used for validation to forbid macro definitions, because the idea is that this struct + //! is used inside GlobalBuildOptions which has a dedicated variable for macro definitions. + bool HasMacroDefinitionsInCommandLineArguments(); + //! Mix two instances of arguments, by or-ing bools, or by "if different, right hand side wins" void Merge(const ShaderCompilerArguments& right); + //! [GFX TODO] [ATOM-15472] Remove this function. //! Determine whether there is a rebuild-worthy difference in arguments for AZSLc bool HasDifferentAzslcArguments(const ShaderCompilerArguments& right) const; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h index 3e593794af..6f884eb358 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Edit/Utils.h @@ -110,6 +110,46 @@ namespace AZ AZStd::string BuildFileNameWithExtension(const AZStd::string& shaderSourceFile, const AZStd::string& tempFolder, const char* outputExtension); + + namespace CommandLineArgumentUtils + { + //! @param commandLineString: A string with command line arguments of the form: + //! "- -- --[=] ..." + //! Example: "--use-spaces --namespace=vk -W1" + //! Returns: A list with just the [-|--]: + //! ["-", "--", "--arg3"] + //! For the example shown above it will return this vector: + //! ["--use-spaces", "--namespace", "-W1] + AZStd::vector GetListOfArgumentNames(AZStd::string_view commandLineString); + + //! Takes a list of names of command line arguments and removes those arguments from @commandLineString. + //! The core functionality of this function is that it searches by name in @commandLineString and removes + //! name and value if the name is found. + //! @param listOfArguments: This is a list of strings, usually generated by the helper function + //! ShaderCompilerArguments::GetListOfArgumentNames() + //! @param commandLineString: A single string made of several command line arguments + //! @returns A new string based on @commandLineString but with the matching arguments and their values + //! removed from it. + AZStd::string RemoveArgumentsFromCommandLineString( + AZStd::array_view listOfArguments, AZStd::string_view commandLineString); + + //! @param commandLineString: " --arg1 -arg2 --arg3=foo --arg4=bar " + //! @returns "--arg1 -arg2 --arg3=foo --arg4=bar" + AZStd::string RemoveExtraSpaces(AZStd::string_view commandLineString); + + //! Accepts two arbitrary strings that contain typical command line arguments and returns + //! a new string that combines the arguments were the arguments on the @right have precedence. + //! Example: + //! @param left: "--arg1 -arg2 --arg3=foo" + //! @param right: "--arg3=bar --arg4" + //! @returns: "--arg1 -arg2 --arg3=bar --arg4" + AZStd::string MergeCommandLineArguments(AZStd::string_view left, AZStd::string_view right); + + //! @param commandLineString: A string that contains a series of command line arguments. + //! @returns: true if @commandLineString contains macro definitions, e.g: + //! "-D MACRO" or "-D MACRO=VALUE" or "-DMACRO", "-DMACRO=VALUE". + bool HasMacroDefinitions(AZStd::string_view commandLineString); + } } } diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h index c1d4fb49f0..fd14cadde8 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/ShaderResourceGroupLayout.h @@ -75,6 +75,8 @@ namespace AZ */ bool Finalize(); + void SetName(const Name& name) { m_name = name; } + const Name& GetName() const { return m_name; } /** * Designates this SRG as ShaderVariantKey fallback by providing the generated @@ -272,6 +274,9 @@ namespace AZ AZ_SERIALIZE_FRIEND(); + //! Name of the ShaderResourceGroup as specified in the original *.azsl/*.azsli file. + Name m_name; + AZStd::vector m_staticSamplers; AZStd::vector m_inputsForBuffers; diff --git a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Viewport.h b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Viewport.h index 8b95df52a1..4a4559c382 100644 --- a/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Viewport.h +++ b/Gems/Atom/RHI/Code/Include/Atom/RHI.Reflect/Viewport.h @@ -51,6 +51,25 @@ namespace AZ float m_maxY = 0.0f; float m_minZ = 0.0f; float m_maxZ = 1.0f; + + float GetWidth() const; + float GetHeight() const; + float GetDepth() const; }; } // namespace RHI } // namespace AZ + +inline float AZ::RHI::Viewport::GetWidth() const +{ + return m_maxX - m_minX; +} + +inline float AZ::RHI::Viewport::GetHeight() const +{ + return m_maxY - m_minY; +} + +inline float AZ::RHI::Viewport::GetDepth() const +{ + return m_maxZ - m_minZ; +} diff --git a/Gems/Atom/RHI/Code/Source/RHI.Edit/ShaderCompilerArguments.cpp b/Gems/Atom/RHI/Code/Source/RHI.Edit/ShaderCompilerArguments.cpp index 7304a351d4..09cd1c125e 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Edit/ShaderCompilerArguments.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Edit/ShaderCompilerArguments.cpp @@ -12,6 +12,9 @@ #include #include +#include + +#include namespace AZ { @@ -49,6 +52,12 @@ namespace AZ } } + bool ShaderCompilerArguments::HasMacroDefinitionsInCommandLineArguments() + { + return CommandLineArgumentUtils::HasMacroDefinitions(m_azslcAdditionalFreeArguments) || + CommandLineArgumentUtils::HasMacroDefinitions(m_dxcAdditionalFreeArguments); + } + void ShaderCompilerArguments::Merge(const ShaderCompilerArguments& right) { if (right.m_azslcWarningLevel != LevelUnset) @@ -56,7 +65,7 @@ namespace AZ m_azslcWarningLevel = right.m_azslcWarningLevel; } m_azslcWarningAsError = m_azslcWarningAsError || right.m_azslcWarningAsError; - m_azslcAdditionalFreeArguments += " " + right.m_azslcAdditionalFreeArguments; + m_azslcAdditionalFreeArguments = CommandLineArgumentUtils::MergeCommandLineArguments(m_azslcAdditionalFreeArguments, right.m_azslcAdditionalFreeArguments); m_dxcDisableWarnings = m_dxcDisableWarnings || right.m_dxcDisableWarnings; m_dxcWarningAsError = m_dxcWarningAsError || right.m_dxcWarningAsError; m_dxcDisableOptimizations = m_dxcDisableOptimizations || right.m_dxcDisableOptimizations; @@ -65,13 +74,14 @@ namespace AZ { m_dxcOptimizationLevel = right.m_dxcOptimizationLevel; } - m_dxcAdditionalFreeArguments += " " + right.m_dxcAdditionalFreeArguments; + m_dxcAdditionalFreeArguments = CommandLineArgumentUtils::MergeCommandLineArguments(m_dxcAdditionalFreeArguments, right.m_dxcAdditionalFreeArguments); if (right.m_defaultMatrixOrder != MatrixOrder::Default) { m_defaultMatrixOrder = right.m_defaultMatrixOrder; } } + //! [GFX TODO] [ATOM-15472] Remove this function. bool ShaderCompilerArguments::HasDifferentAzslcArguments(const ShaderCompilerArguments& right) const { auto isSet = +[](uint8_t level) { return level != LevelUnset; }; @@ -154,7 +164,7 @@ namespace AZ arguments += " -Zi"; // Generate debug information arguments += " -Zss"; // Compute Shader Hash considering source information } - arguments += m_dxcAdditionalFreeArguments; + arguments += " " + m_dxcAdditionalFreeArguments; return arguments; } } diff --git a/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp b/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp index 00b5dada69..dc0efb7e9a 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Edit/Utils.cpp @@ -494,5 +494,64 @@ namespace AZ AzFramework::StringFunc::Path::ReplaceExtension(outputFile, outputExtension); return outputFile; } + + namespace CommandLineArgumentUtils + { + AZStd::vector GetListOfArgumentNames(AZStd::string_view commandLineString) + { + AZStd::vector listOfTokens; + AzFramework::StringFunc::Tokenize(commandLineString, listOfTokens, " \t\n"); + AZStd::vector listOfArguments; + for (const AZStd::string& token : listOfTokens) + { + AZStd::vector splitArguments; + AzFramework::StringFunc::Tokenize(token, splitArguments, "="); + listOfArguments.push_back(splitArguments[0]); + } + return listOfArguments; + } + + AZStd::string RemoveArgumentsFromCommandLineString( + AZStd::array_view listOfArgumentsToRemove, AZStd::string_view commandLineString) + { + AZStd::string customizedArguments = commandLineString; + for (const AZStd::string& azslcArgumentName : listOfArgumentsToRemove) + { + AZStd::string regexStr = AZStd::string::format("%s(=\\S+)?", azslcArgumentName.c_str()); + AZStd::regex replaceRegex(regexStr, AZStd::regex::ECMAScript); + customizedArguments = AZStd::regex_replace(customizedArguments, replaceRegex, ""); + } + return customizedArguments; + } + + AZStd::string RemoveExtraSpaces(AZStd::string_view commandLineString) + { + AZStd::vector argumentList; + AzFramework::StringFunc::Tokenize(commandLineString, argumentList, " \t\n"); + AZStd::string cleanStringWithArguments; + AzFramework::StringFunc::Join(cleanStringWithArguments, argumentList.begin(), argumentList.end(), " "); + return cleanStringWithArguments; + } + + AZStd::string MergeCommandLineArguments(AZStd::string_view left, AZStd::string_view right) + { + auto listOfArgumentNamesFromRight = GetListOfArgumentNames(right); + auto leftWithRightArgumentsRemoved = RemoveArgumentsFromCommandLineString(listOfArgumentNamesFromRight, left); + AZStd::string combinedArguments = AZStd::string::format("%s %s", leftWithRightArgumentsRemoved.c_str(), right.data()); + return RemoveExtraSpaces(combinedArguments); + } + + bool HasMacroDefinitions(AZStd::string_view commandLineString) + { + const AZStd::regex macroRegex(R"((^-D\s*(\w+))|(\s+-D\s*(\w+)))", AZStd::regex::ECMAScript); + + AZStd::smatch match; + if (AZStd::regex_search(commandLineString.data(), match, macroRegex)) + { + return (match.size() >= 1); + } + return false; + } + } //namespace CommandLineArgumentUtils } // namespace RHI } // namespace AZ diff --git a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp index 210fe7ad45..2c552d7c56 100644 --- a/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp +++ b/Gems/Atom/RHI/Code/Source/RHI.Reflect/ShaderResourceGroupLayout.cpp @@ -22,7 +22,8 @@ namespace AZ if (SerializeContext* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(6) + ->Version(7) + ->Field("m_name", &ShaderResourceGroupLayout::m_name) ->Field("m_staticSamplers", &ShaderResourceGroupLayout::m_staticSamplers) ->Field("m_inputsForBuffers", &ShaderResourceGroupLayout::m_inputsForBuffers) ->Field("m_inputsForImages", &ShaderResourceGroupLayout::m_inputsForImages) diff --git a/Gems/Atom/RHI/Code/Tests/UtilsTests.cpp b/Gems/Atom/RHI/Code/Tests/UtilsTests.cpp index 506edc0d1e..afeca6e617 100644 --- a/Gems/Atom/RHI/Code/Tests/UtilsTests.cpp +++ b/Gems/Atom/RHI/Code/Tests/UtilsTests.cpp @@ -60,7 +60,9 @@ namespace UnitTest TEST_F(UtilsTests, LoadFileString_Error_DoesNotExist) { + AZ_TEST_START_TRACE_SUPPRESSION; auto outcome = AZ::RHI::LoadFileString("FileDoesNotExist"); + AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; EXPECT_FALSE(outcome.IsSuccess()); EXPECT_TRUE(outcome.GetError().find("Could not open file") != AZStd::string::npos); EXPECT_TRUE(outcome.GetError().find("FileDoesNotExist") != AZStd::string::npos); @@ -68,7 +70,9 @@ namespace UnitTest TEST_F(UtilsTests, LoadFileBytes_Error_DoesNotExist) { + AZ_TEST_START_TRACE_SUPPRESSION; auto outcome = AZ::RHI::LoadFileBytes("FileDoesNotExist"); + AZ_TEST_STOP_TRACE_SUPPRESSION_NO_COUNT; EXPECT_FALSE(outcome.IsSuccess()); EXPECT_TRUE(outcome.GetError().find("Could not open file") != AZStd::string::npos); EXPECT_TRUE(outcome.GetError().find("FileDoesNotExist") != AZStd::string::npos); diff --git a/Gems/Atom/RHI/DX12/gem.json b/Gems/Atom/RHI/DX12/gem.json new file mode 100644 index 0000000000..683ccfb43a --- /dev/null +++ b/Gems/Atom/RHI/DX12/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RHI_DX12", + "display_name": "Atom RHI DX12", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} 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 841c71126a..c4666578a7 100644 --- a/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp +++ b/Gems/Atom/RHI/Metal/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp @@ -251,7 +251,7 @@ namespace AZ ByProducts& byProducts) const { // Shader compiler executable - static const char* dxcRelativePath = "Builders/DirectXShaderCompilerAz/bin/dxc"; + static const char* dxcRelativePath = "Builders/DirectXShaderCompiler/bin/dxc"; // Output file AZStd::string shaderMSLOutputFile = RHI::BuildFileNameWithExtension(shaderSourceFile, tempFolder, "metal"); diff --git a/Gems/Atom/RHI/Metal/gem.json b/Gems/Atom/RHI/Metal/gem.json new file mode 100644 index 0000000000..3e1726e8fa --- /dev/null +++ b/Gems/Atom/RHI/Metal/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RHI_Metal", + "display_name": "Atom RHI Metal", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/RHI/Null/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp b/Gems/Atom/RHI/Null/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp index 35ee5a7ec0..0be84dba15 100644 --- a/Gems/Atom/RHI/Null/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp +++ b/Gems/Atom/RHI/Null/Code/Source/RHI.Builders/ShaderPlatformInterface.cpp @@ -104,7 +104,7 @@ namespace AZ { return WindowsAzslShaderHeader; } - else if (platform.m_identifier == "osx_gl") + else if (platform.m_identifier == "mac") { return MacAzslShaderHeader; } diff --git a/Gems/Atom/RHI/Null/gem.json b/Gems/Atom/RHI/Null/gem.json new file mode 100644 index 0000000000..4fa5f1e480 --- /dev/null +++ b/Gems/Atom/RHI/Null/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RHI_Null", + "display_name": "Atom RHI Null", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/Platform/Windows/Vulkan_Traits_Windows.h b/Gems/Atom/RHI/Vulkan/Code/Source/Platform/Windows/Vulkan_Traits_Windows.h index c7c9902115..c1314aaf66 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/Platform/Windows/Vulkan_Traits_Windows.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/Platform/Windows/Vulkan_Traits_Windows.h @@ -11,7 +11,7 @@ */ #pragma once -#define AZ_TRAIT_ATOM_SHADERBUILDER_DXC "Builders/DirectXShaderCompilerAz/dxc.exe" +#define AZ_TRAIT_ATOM_SHADERBUILDER_DXC "Builders/DirectXShaderCompiler/dxc.exe" #define AZ_TRAIT_ATOM_VULKAN_DISABLE_DUAL_SOURCE_BLENDING 0 #define AZ_TRAIT_ATOM_VULKAN_DLL "vulkan.dll" #define AZ_TRAIT_ATOM_VULKAN_DLL_1 "vulkan-1.dll" diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp index cdacd2578f..791fa006b0 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/NullDescriptorManager.cpp @@ -180,6 +180,7 @@ namespace AZ for (uint32_t imageIndex = static_cast(NullDescriptorManager::ImageTypes::General2D); imageIndex < static_cast(NullDescriptorManager::ImageTypes::Count); imageIndex++) { // different options for the images + imageCreateInfo.imageType = (imageIndex >= static_cast(NullDescriptorManager::ImageTypes::General3D)) ? VK_IMAGE_TYPE_3D : VK_IMAGE_TYPE_2D; imageCreateInfo.extent = { m_imageNullDescriptor.m_images[imageIndex].m_dimension, m_imageNullDescriptor.m_images[imageIndex].m_dimension, 1 }; imageCreateInfo.samples = m_imageNullDescriptor.m_images[imageIndex].m_sampleCountFlag; imageCreateInfo.format = m_imageNullDescriptor.m_images[imageIndex].m_format; diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp index 457768b357..9e6c38e7ac 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.cpp @@ -66,21 +66,21 @@ namespace AZ } } - RHI::ConstPtr PipelineLayout::MergeShaderResourceGroupLayouts(const AZStd::vector& srgLayouts) const + RHI::ConstPtr PipelineLayout::MergeShaderResourceGroupLayouts(const AZStd::vector& srgLayoutList) const { - if (srgLayouts.empty()) + if (srgLayoutList.empty()) { return nullptr; } - if (srgLayouts.size() == 1) + if (srgLayoutList.size() == 1) { - return srgLayouts.front(); + return srgLayoutList.front(); } RHI::Ptr mergedLayout = RHI::ShaderResourceGroupLayout::Create(); - mergedLayout->SetBindingSlot(srgLayouts.front()->GetBindingSlot()); - for (const RHI::ShaderResourceGroupLayout* srgLayout : srgLayouts) + mergedLayout->SetBindingSlot(srgLayoutList.front()->GetBindingSlot()); + for (const RHI::ShaderResourceGroupLayout* srgLayout : srgLayoutList) { const uint32_t bindingSlot = srgLayout->GetBindingSlot(); const auto& srgBindingInfo = m_layoutDescriptor->GetShaderResourceGroupBindingInfo(m_layoutDescriptor->GetShaderResourceGroupIndexFromBindingSlot(bindingSlot)); diff --git a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.h b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.h index 8af703fefb..4b7b344074 100644 --- a/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.h +++ b/Gems/Atom/RHI/Vulkan/Code/Source/RHI/PipelineLayout.h @@ -85,7 +85,7 @@ namespace AZ RHI::ResultCode BuildMergedShaderResourceGroupPools(); // Creates a merged SRG layout from a list of SRG layouts. - RHI::ConstPtr MergeShaderResourceGroupLayouts(const AZStd::vector& srgLayouts) const; + RHI::ConstPtr MergeShaderResourceGroupLayouts(const AZStd::vector& srgLayoutList) const; VkPipelineLayout m_nativePipelineLayout = VK_NULL_HANDLE; diff --git a/Gems/Atom/RHI/Vulkan/gem.json b/Gems/Atom/RHI/Vulkan/gem.json new file mode 100644 index 0000000000..1f2fcd7f30 --- /dev/null +++ b/Gems/Atom/RHI/Vulkan/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RHI_Vulkan", + "display_name": "Atom RHI Vulkan", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/RHI/gem.json b/Gems/Atom/RHI/gem.json new file mode 100644 index 0000000000..eb67e40a4a --- /dev/null +++ b/Gems/Atom/RHI/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RHI", + "display_name": "Atom RHI", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/Math.azsli b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/Math.azsli index 2381febed0..9b90c40ab9 100644 --- a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/Math.azsli +++ b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/Math.azsli @@ -225,3 +225,16 @@ float NextRandomFloatUniform(inout uint seed) seed = Xorshift(seed); return (float)seed / 4294967295.0f; } + +//! Returns the inverse of lerp, 't', such that value = lerp(a, b, t), or returns 0 when a == b. +float LerpInverse(float a, float b, float value) +{ + if(abs(a - b) <= EPSILON) + { + return 0.0; + } + else + { + return (value - a) / (b - a); + } +} diff --git a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli index 69381ca0fc..e12736dfec 100644 --- a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli +++ b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/ShaderResourceGroups/DefaultDrawSrg.azsli @@ -16,7 +16,12 @@ ShaderResourceGroup DrawSrg : SRG_PerDraw { - float4 m_placeholder; // [GFX-TODO] [Atom-1727] Bug in AZSLc, empty SRGs cannot be shader variant fallbacks! // This SRG is unique per draw packet + uint m_uvStreamTangentBitmask; + + uint GetTangentAtUv(uint uvIndex) + { + return (m_uvStreamTangentBitmask >> (4 * uvIndex)) & 0xF; + } } diff --git a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/TangentSpace.azsli b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/TangentSpace.azsli index 13e3c652db..62111b3e80 100644 --- a/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/TangentSpace.azsli +++ b/Gems/Atom/RPI/Assets/ShaderLib/Atom/RPI/TangentSpace.azsli @@ -52,6 +52,12 @@ float3 GetTangentSpaceNormal_Unnormalized(float2 normalMapSample, float normalSt // The image build pipeline drops the B channel so we have to reconstruct it here. surfaceNormal.z = sqrt(1 - dot(surfaceNormal.xy, surfaceNormal.xy)); + // Don't allow z to be zero just in case normalStrength approaches 0, to avoid a 0-length normal. + // It doesn't make sense anyway to have a surface with a normal map completely tangential. + // This also addresses the possibility of z being NaN, in the case where x^2+y^2 > 1, so we don't need to call saturate in the sqrt operation above. + // (Note this edge case would be particularly evident in multilayer material types, where the normal map is masked out using normalStrength). + surfaceNormal.z = max(surfaceNormal.z, 0.01); + surfaceNormal.xy *= normalStrength; return surfaceNormal; @@ -190,12 +196,22 @@ void SurfaceGradientNormalMapping_GenerateTB(float2 uv, out float3 tangentWS, ou } //! Utility macro to nest SGBNM setup processes. -#define PrepareGeneratedTangent(normal, worldPos, isFrontFace, uvSets, uvSetCount, outTangents, outBitangents, startIndex) \ +//! We support two UV streams, but only a single stream of tangent/bitangent. +//! By default, the first UV stream is applied and the default tangent/bitangent are used. +//! If anything uses the second UV stream, and it is not a duplication of the first stream, +//! generated tangent/bitangent will be applied. +//! (As it implies, cases may occur where all/none of the UV steams use the default TB.) +//! What tangent/bitangent a UV stream uses is encoded in DrawSrg. +#define PrepareGeneratedTangent(normal, worldPos, isFrontFace, uvSets, uvSetCount, outTangents, outBitangents) \ { \ SurfaceGradientNormalMapping_Init(normal, worldPos, !isFrontFace); \ [unroll] \ - for (int i = startIndex; i < uvSetCount; ++i) \ + for (uint i = 0; i < uvSetCount; ++i) \ { \ + if (DrawSrg::GetTangentAtUv(i) == 0) \ + { \ + continue; \ + } \ SurfaceGradientNormalMapping_GenerateTB(uvSets[i], outTangents[i], outBitangents[i]); \ } \ } diff --git a/Gems/Atom/RPI/Code/CMakeLists.txt b/Gems/Atom/RPI/Code/CMakeLists.txt index f92213d9d7..d2b7fba071 100644 --- a/Gems/Atom/RPI/Code/CMakeLists.txt +++ b/Gems/Atom/RPI/Code/CMakeLists.txt @@ -69,6 +69,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE AZ::AtomCore AZ::AzToolsFramework + Gem::Atom_RHI.Edit Gem::Atom_RPI.Public ) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h index 8184f8b5e6..428898a17e 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderSourceData.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -38,12 +38,13 @@ namespace AZ AZ_TYPE_INFO(AZ::RPI::ShaderSourceData, "{B7F00402-872B-4F82-A210-E1A79A366686}"); AZ_CLASS_ALLOCATOR(ShaderSourceData, AZ::SystemAllocator, 0); - static const char* Extension; + static constexpr char Extension[] = "shader"; + static constexpr char Extension2[] = "shader2"; static void Reflect(ReflectContext* context); //! Helper function. Returns true if @rhiName is present in m_disabledRhiBackends - bool IsRhiBackendDisabled(const AZ::Name& rhiName); + bool IsRhiBackendDisabled(const AZ::Name& rhiName) const; struct EntryPoint { @@ -71,12 +72,49 @@ namespace AZ RHI::DepthStencilState m_depthStencilState; RHI::RasterState m_rasterState; RHI::TargetBlendState m_blendState; - - // Hints for building the shader option group layout - RPI::ShaderOptionGroupHints m_shaderOptionGroupHints; //! List of RHI Backends (aka ShaderPlatformInterface) for which this shader should not be compiled. AZStd::vector m_disabledRhiBackends; + + struct SupervariantInfo + { + AZ_TYPE_INFO(AZ::RPI::ShaderSourceData::SupervariantInfo, "{1132CF2A-C8AB-4DD2-AA90-3021D49AB955}"); + + //! Unique name of the supervariant. + //! If left empty, the data refers to the default supervariant. + AZ::Name m_name; + + //! + MCPP Macro definition arguments + AZSLc arguments. + //! These arguments are added after shader_global_build_options.json & m_compiler.m_azslcAdditionalFreeArguments. + //! Arguments that start with "-D" are given to MCPP. + //! Example: "-DMACRO1 -DMACRO2=3". + //! all other arguments are given to AZSLc. + //! Note the arguments are added in addition to the arguments + //! in /Config/shader_global_build_options.json + AZStd::string m_plusArguments; + + //! Opposite to @m_plusArguments. + //! - MCPP Macro definition arguments - AZSLc arguments. + //! Because there are global compilation arguments, this one is useful to remove some of those arguments + //! in order to customize the compilation of a particular supervariant. + AZStd::string m_minusArguments; + + //! Helper function. Parses @m_minusArguments and @m_plusArguments, looks for arguments of type -D[=] and returns + //! a list of to remove. + AZStd::vector GetCombinedListOfMacroDefinitionNamesToRemove() const; + + //! Helper function. Parses @m_plusArguments, looks for arguments of type "-D[=]" and returns + //! a list of "[=]". + AZStd::vector GetMacroDefinitionsToAdd() const; + + //! Helper function. Takes AZSLc arguments from @m_minusArguments and @m_plusArguments, removes them from @initialAzslcCompilerArguments. + //! Takes AZSLc arguments from @m_plusArguments and appends them to @initialAzslcCompilerArguments. + //! Returns a new string with customized arguments. + AZStd::string GetCustomizedArgumentsForAzslc(const AZStd::string& initialAzslcCompilerArguments) const; + }; + + //! Optional list of supervariants. + AZStd::vector m_supervariants; }; } // namespace RPI diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantAssetCreator2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantAssetCreator2.h new file mode 100644 index 0000000000..07cec9a01f --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantAssetCreator2.h @@ -0,0 +1,54 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + //! The "builder" pattern class that creates a ShaderVariantAsset2. + class ShaderVariantAssetCreator2 final + : public AssetCreator + { + public: + //! Begins construction of the shader variant asset. + //! @param assetId The "initial" assetId that the resulting ShaderVariantAsset will get. + //! "initial" was quoted because in the end the asset processor will assign another assetId + //! because on the UUID of the source asset (a *.shadervariantlist file) and the product subid + //! that gets assign when returning the Job Response. + //! It is still useful, because when creating the Root Variant for the ShaderAsset this assetId should + //! match the value that will be assigned by the asset processor because the Root Variant is serialized + //! as a Data::Asset inside the ShaderAsset. + void Begin(const AZ::Data::AssetId& assetId, const ShaderVariantId& shaderVariantId, RPI::ShaderVariantStableId stableId, bool isFullyBaked); + + //! Finalizes and assigns ownership of the asset to result, if successful. + //! Otherwise false is returned and result is left untouched. + bool End(Data::Asset& result); + + ///////////////////////////////////////////////////////////////////// + // Methods for all shader variant types + + //! Set the timestamp value when the ProcessJob() started. + //! This is needed to synchronize between the ShaderAsset and ShaderVariantAsset when hot-reloading shaders. + //! The idea is that this timestamp must be greater or equal than the ShaderAsset. + void SetBuildTimestamp(AZStd::sys_time_t buildTimestamp); + + //! Assigns a shaderStageFunction, which contains the byte code, to the slot dictated by the shader stage. + void SetShaderFunction(RHI::ShaderStage shaderStage, RHI::Ptr shaderStageFunction); + + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h index eaef4e093b..c284627cc5 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h @@ -30,6 +30,7 @@ namespace AZ AZ_CLASS_ALLOCATOR(ShaderVariantListSourceData, AZ::SystemAllocator, 0); static constexpr const char* Extension = "shadervariantlist"; + static constexpr const char* Extension2 = "shadervariantlist2"; static void Reflect(ReflectContext* context); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h index e4b9b91e81..2dd0865688 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/DynamicDraw/DynamicDrawContext.h @@ -87,6 +87,14 @@ namespace AZ //! Finalize and validate initialization. Any initialization functions should be called before EndInit is called. void EndInit(); + //! Set up the DynamicDrawContext for the input Scene. + //! This should be called after the last frame is done and before any draw calls. + void SetScene(Scene* scene); + + //! Set up the DynamicDrawContext for the input RenderPipeline. + //! This should be called after the last frame is done and before any draw calls. + void SetRenderPipeline(RenderPipeline* pipeline); + //! Return if this DynamicDrawContext is ready to add draw calls bool IsReady(); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/MeshDrawPacket.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/MeshDrawPacket.h index 0aa979d611..70cabca371 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/MeshDrawPacket.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/MeshDrawPacket.h @@ -98,7 +98,7 @@ namespace AZ //! List of shader options set for this specific draw packet typedef AZStd::pair ShaderOptionPair; typedef AZStd::vector ShaderOptionVector; - ShaderOptionVector m_shaderOptions; + ShaderOptionVector m_shaderOptions; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h index 285cf80aca..5a1c571a26 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/ModelLod.h @@ -14,6 +14,7 @@ #include #include +#include #include @@ -108,6 +109,7 @@ namespace AZ const MaterialUvNameMap& materialUvNameMap = {}) const; //! Fills a InputStreamLayout and StreamBufferViewList for the set of streams that satisfy a ShaderInputContract. + // @param uvStreamTangentBitmaskOut a mask processed during UV stream matching, and later to determine which tangent/bitangent stream to use. // @param contract the contract that defines the expected inputs for a shader, used to determine which streams are optional. // @param meshIndex the index of the mesh to search in. // @param materialModelUvMap a map of UV name overrides, which can be supplied to bind a specific mesh stream name to a different material shader stream name. @@ -115,6 +117,7 @@ namespace AZ bool GetStreamsForMesh( RHI::InputStreamLayout& layoutOut, ModelLod::StreamBufferViewList& streamBufferViewsOut, + UvStreamTangentBitmask* uvStreamTangentBitmaskOut, const ShaderInputContract& contract, size_t meshIndex, const MaterialModelUvOverrideMap& materialModelUvMap = {}, @@ -130,6 +133,8 @@ namespace AZ const ModelLodAsset::Mesh::StreamBufferInfo& streamBufferInfo, Mesh& meshInstance); + StreamInfoList::const_iterator FindFirstUvStreamFromMesh(size_t meshIndex) const; + StreamInfoList::const_iterator FindDefaultUvStream(size_t meshIndex, const MaterialUvNameMap& materialUvNameMap) const; // Finds a mesh vertex input stream that is the best match for a contracted stream channel. @@ -137,12 +142,16 @@ namespace AZ // @param materialModelUvMap a map of UV name overrides, which can be supplied to bind a specific mesh stream name to a different material shader stream name. // @param materialUvNameMap the UV name map that came from a MaterialTypeAsset, which defines the default set of material shader stream names. // @param defaultUv the default UV stream to use if a matching UV stream could not be found. Use FindDefaultUvStream() to populate this. + // @param firstUv the first UV stream from the mesh, which, by design, the tangent/bitangent stream belongs to. + // @param uvStreamTangentIndex a bitset indicating which tangent/bitangent stream (including generated ones) a UV stream will be using. StreamInfoList::const_iterator FindMatchingStream( size_t meshIndex, const MaterialModelUvOverrideMap& materialModelUvMap, const MaterialUvNameMap& materialUvNameMap, const ShaderInputContract::StreamChannelInfo& contractStreamChannel, - StreamInfoList::const_iterator defaultUv) const; + StreamInfoList::const_iterator defaultUv, + StreamInfoList::const_iterator firstUv, + UvStreamTangentBitmask* uvStreamTangentBitmaskOut) const; // Meshes may share index/stream buffers in an LOD or they may have // unique buffers. Often the asset builder will prioritize shared buffers diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h new file mode 100644 index 0000000000..aa599bc27c --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h @@ -0,0 +1,72 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +#include + +namespace AZ +{ + namespace RPI + { + //! An encoded bitmask for tangent used by UV streams. + //! It contains the information about number of UV streams and which tangent/bitangent is used by each UV stream. + //! See m_mask for more details. + //! The mask will be passed through per draw SRG. + class UvStreamTangentBitmask + { + public: + //! Get the full mask including number of UVs and tangent/bitangent assignment to each UV. + uint32_t GetFullTangentBitmask() const; + + //! Get number of UVs that have tangent/bitangent assigned. + uint32_t GetUvStreamCount() const; + + //! Get tangent/bitangent assignment to the specified UV in the material. + //! @param uvIndex the index of the UV from the material, in default order as in the shader code. + uint32_t GetTangentAtUv(uint32_t uvIndex) const; + + //! Apply the tangent to the next UV, whose index is the same as GetUvStreamCount. + //! @param tangent the tangent/bitangent to be assigned. Ranged in [0, 0xF) + //! It comes from the model in order, e.g. 0 means the first available tangent stream from the model. + //! Specially, value 0xF(=UnassignedTangent) means generated tangent/bitangent will be used in shader. + //! If ranged out of definition, unassigned tangent will be applied. + void ApplyTangent(uint32_t tangent); + + //! Reset the bitmask to clear state. + void Reset(); + + //! The bit mask indicating generated tangent/bitangent will be used. + static constexpr uint32_t UnassignedTangent = 0b1111u; + + //! The variable name defined in the SRG shader code. + static constexpr const char* SrgName = "m_uvStreamTangentBitmask"; + private: + //! Mask composition: + //! The number of UV slots (highest 4 bits) + tangent mask (4 bits each) * 7 + //! e.g. 0x200000F0 means there are 2 UV streams, + //! the first UV stream uses 0th tangent stream (0x0), + //! the second UV stream uses the generated tangent stream (0xF). + uint32_t m_mask = 0; + + //! Bit size in the mask composition. + static constexpr uint32_t BitsPerTangent = 4; + static constexpr uint32_t BitsForUvIndex = 4; + + public: + //! Max UV slots available in this bit mask. + static constexpr uint32_t MaxUvSlots = (sizeof(m_mask) * CHAR_BIT - BitsForUvIndex) / BitsPerTangent; + }; + } +} diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h index b0d6bd4117..1cba71ae7e 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/Pass.h @@ -381,6 +381,7 @@ namespace AZ uint64_t m_createdByPassRequest : 1; uint64_t m_initialized : 1; uint64_t m_enabled : 1; + uint64_t m_parentEnabled : 1; uint64_t m_alreadyCreated : 1; uint64_t m_alreadyReset : 1; uint64_t m_alreadyPrepared : 1; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h index 84ccb57e06..5cd917e841 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Pass/RenderPass.h @@ -72,7 +72,7 @@ namespace AZ //! Return the View if this pass is associated with a pipeline view via PipelineViewTag. //! It may return nullptr if this pass is independent with any views. - ViewPtr GetView(); + ViewPtr GetView() const; protected: explicit RenderPass(const PassDescriptor& descriptor); diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader2.h new file mode 100644 index 0000000000..eb82c2d31a --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/Shader2.h @@ -0,0 +1,194 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +namespace AZ +{ + namespace RHI + { + class PipelineStateCache; + } + + namespace RPI + { + /** + * Shader2 is effectively an 'uber-shader' containing a collection of 'variants'. Variants are + * designed to be 'variations' on the same core shader technique. To enforce this, every variant + * in the shader shares the same pipeline layout (i.e. set of shader resource groups). + * + * A shader owns a library of pipeline states. When a variant is resolved to a pipeline state, its + * lifetime is determined by the lifetime of the Shader2 (unless an explicit reference is taken). If + * an asset reload event occurs, the pipeline state cache is reset. + * + * To use Shader2: + * 1) Construct a ShaderOptionGroup instance using CreateShaderOptionGroup. + * 2) Configure the group by setting values on shader options. + * 3) Find the ShaderVariantStableId using the ShaderVariantId generated from the configured ShaderOptionGroup. + * 4) Acquire the ShaderVariant2 instance using the ShaderVariantStableId. + * 5) Configure a pipeline state descriptor on the variant; make local overrides as necessary (e.g. to configure runtime render state). + * 6) Acquire a RHI::PipelineState instance from the shader using the configured pipeline state descriptor. + * + * Remember that the returned RHI::PipelineState instance lifetime is tied to the Shader2 lifetime. + * If you need guarantee lifetime, it is safe to take a reference on the returned pipeline state. + */ + class Shader2 final + : public Data::InstanceData + , public Data::AssetBus::Handler + , public ShaderVariantFinderNotificationBus2::Handler + { + friend class ShaderSystem; + public: + AZ_INSTANCE_DATA(Shader2, "{232D8BD6-3BD4-4842-ABD2-F380BD5B0863}"); + AZ_CLASS_ALLOCATOR(Shader2, SystemAllocator, 0); + + /// Returns the shader instance associated with the provided asset. + static Data::Instance FindOrCreate(const Data::Asset& shaderAsset, const Name& supervariantName); + + ~Shader2(); + AZ_DISABLE_COPY_MOVE(Shader2); + + /// Constructs a shader option group suitable to generate a shader variant key for this shader. + ShaderOptionGroup CreateShaderOptionGroup() const; + + /// Finds the best matching ShaderVariant2 for the given shaderVariantId, + /// If the variant is loaded and ready it will return the corresponding ShaderVariant2. + /// If the variant is not yet available it will return the root ShaderVariant2. + /// Callers should listen to ShaderReloadNotificationBus to get notified whenever the exact + /// variant is loaded and available or if a variant changes, etc. + /// This function should be your one stop shop to get a ShaderVariant2 from a ShaderVariantId. + /// Alternatively: You can call FindVariantStableId() followed by GetVariant(shaderVariantStableId). + const ShaderVariant2& GetVariant(const ShaderVariantId& shaderVariantId); + + /// Finds the best matching shader variant asset and returns its StableId. + /// In cases where you can't cache the ShaderVariant2, and recurrently you may need + /// the same ShaderVariant2 at different times, then it can be convenient (and more performant) to call + /// this method to cache the ShaderVariantStableId and call GetVariant(ShaderVariantStableId) + /// when needed. + /// If the asset is not immediately found in the file system, it will return the StableId + /// of the root variant. + /// Callers should listen to ShaderReloadNotificationBus to get notified whenever the exact + /// variant is loaded and available or if a variant changes, etc. + ShaderVariantSearchResult FindVariantStableId(const ShaderVariantId& shaderVariantId) const; + + /// Returns the variant associated with the provided StableId. + /// You should call FindVariantStableId() which caches the variant, later + /// when this function is called the variant is fetched from a local map. + /// If the variant is not found, the root variant is returned. + /// "Alternatively: a more convenient approach is to call GetVariant(ShaderVariantId) which does both, the find and the get." + const ShaderVariant2& GetVariant(ShaderVariantStableId shaderVariantStableId); + + /// Convenient function that returns the root variant. + const ShaderVariant2& GetRootVariant(); + + /// Returns the pipeline state type generated by variants of this shader. + RHI::PipelineStateType GetPipelineStateType() const; + + //! Returns the ShaderInputContract which describes which inputs the shader requires + const ShaderInputContract& GetInputContract() const; + + //! Returns the ShaderOutputContract which describes which outputs the shader requires + const ShaderOutputContract& GetOutputContract() const; + + /// Acquires a pipeline state directly from a descriptor. + const RHI::PipelineState* AcquirePipelineState(const RHI::PipelineStateDescriptor& descriptor) const; + + /// Finds and returns the shader resource group asset with the requested name. Returns an empty handle if no matching group was found. + const RHI::Ptr FindShaderResourceGroupLayout(const Name& shaderResourceGroupName) const; + + /// Finds and returns the shader resource group asset associated with the requested binding slot. Returns an empty handle if no matching group was found. + const RHI::Ptr FindShaderResourceGroupLayout(uint32_t bindingSlot) const; + + /// Finds and returns the shader resource group asset designated as a ShaderVariantKey fallback. + const RHI::Ptr FindFallbackShaderResourceGroupLayout() const; + + /// Returns the set of shader resource groups referenced by all variants in the shader asset. + AZStd::array_view> GetShaderResourceGroupLayouts() const; + + /// Returns a reference to the asset used to initialize this shader. + const Data::Asset& GetAsset() const; + + //! Returns the DrawListTag that identifies which Pass and View objects will process this shader. + //! This tag corresponds to the ShaderAsset2 object's DrawListName. + RHI::DrawListTag GetDrawListTag() const; + + private: + Shader2() = default; + + static Data::Instance CreateInternal(ShaderAsset2& shaderAsset); + + bool SelectSupervariant(const Name& supervariantName); + + RHI::ResultCode Init(ShaderAsset2& shaderAsset); + + void Shutdown(); + + ConstPtr LoadPipelineLibrary() const; + void SavePipelineLibrary() const; + + /////////////////////////////////////////////////////////////////// + /// AssetBus overrides + void OnAssetReloaded(Data::Asset asset) override; + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + /// ShaderVariantFinderNotificationBus overrides + void OnShaderVariantTreeAssetReady(Data::Asset /*shaderVariantTreeAsset*/, bool /*isError*/) override {}; + void OnShaderVariantAssetReady(Data::Asset shaderVariantAsset, bool IsError) override; + /////////////////////////////////////////////////////////////////// + + //! Returns the path to the pipeline library cache file. + AZStd::string GetPipelineLibraryPath() const; + + //! A strong reference to the shader asset. + Data::Asset m_asset; + + //! Selects current supervariant to be used. + //! This value is defined at instantiation. + SupervariantIndex m_supervariantIndex; + + //! The pipeline state type required by this shader. + RHI::PipelineStateType m_pipelineStateType = RHI::PipelineStateType::Draw; + + //! A cached pointer to the pipeline state cache owned by RHISystem. + RHI::PipelineStateCache* m_pipelineStateCache = nullptr; + + //! A handle to the pipeline library in the pipeline state cache. + RHI::PipelineLibraryHandle m_pipelineLibraryHandle; + + //! Used for thread safety for FindVariantStableId() and GetVariant(). + AZStd::shared_mutex m_variantCacheMutex; + + //! The root variant always exist. + ShaderVariant2 m_rootVariant; + + //! Local cache of ShaderVariants (except for the root variant), searchable by StableId. + //! Gets populated when GetVariant() is called. + AZStd::unordered_map m_shaderVariants; + + //! DrawListTag associated with this shader. + RHI::DrawListTag m_drawListTag; + }; + } +} diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderReloadNotificationBus2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderReloadNotificationBus2.h new file mode 100644 index 0000000000..0822336ffa --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderReloadNotificationBus2.h @@ -0,0 +1,58 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include + +//#include +#include + +namespace AZ +{ + namespace RPI + { + class Shader2; + class ShaderAsset2; + + /** + * Connect to this EBus to get notifications whenever a Data::Instance reloads its ShaderAsset. + * The bus address is the AssetId of the ShaderAsset. + */ + class ShaderReloadNotifications2 + : public EBusTraits + { + + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; + typedef Data::AssetId BusIdType; + ////////////////////////////////////////////////////////////////////////// + + virtual ~ShaderReloadNotifications2() {} + + //! Called when the ShaderAsset reinitializes itself in response to another asset being reloaded. + virtual void OnShaderAssetReinitialized(const Data::Asset& shaderAsset) { AZ_UNUSED(shaderAsset); } + + //! Called when the Shader instance reinitializes itself in response to the ShaderAsset being reloaded. + virtual void OnShaderReinitialized(const Shader2& shader) { AZ_UNUSED(shader); } + + //! Called when a particular shader variant is reinitialized. + virtual void OnShaderVariantReinitialized(const Shader2& shader, const ShaderVariantId& shaderVariantId, ShaderVariantStableId shaderVariantStableId) + { AZ_UNUSED(shader); AZ_UNUSED(shaderVariantId); AZ_UNUSED(shaderVariantStableId) } + }; + + typedef EBus ShaderReloadNotificationBus2; + + } // namespace RPI +} //namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h index 6d99d287f3..d99b8f51b5 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h @@ -13,6 +13,8 @@ #include #include +#include +#include #include #include @@ -63,6 +65,10 @@ namespace AZ /// Instantiates a unique shader resource group instance using its paired asset. static Data::Instance Create(const Data::Asset& srgAsset); + /// [GFX TODO] [ATOM-15472] Shader Build Pipeline: Remove Deprecated Files And Functions That Predate The Shader Supervariants + /// This is a temporary hack to enable integration of the new supervariant system. + bool ReplaceSrgLayoutUsingShaderAsset(Data::Asset shaderAsset, const Name& supervariantName, const Name& srgName); + /// Queues a request that the underlying hardware shader resource group be compiled. void Compile(); @@ -278,6 +284,7 @@ namespace AZ ShaderResourceGroup() = default; RHI::ResultCode Init(ShaderResourceGroupAsset& shaderResourceGroupAsset); + static AZ::Data::Instance CreateInternal(ShaderResourceGroupAsset& srgAsset); /// A name to be used in error messages @@ -298,9 +305,12 @@ namespace AZ /// The shader resource group that can be submitted to the renderer RHI::Ptr m_shaderResourceGroup; - /// A reference to the parent template asset used to initialize and manipulate this group. + /// A reference to the SRG asset used to initialize and manipulate this group. AZ::Data::Asset m_asset; + /// A reference to the shader asset used to initialize and manipulate this group. + AZ::Data::Asset m_shaderAsset; + /// A pointer to the layout inside of m_srgAsset const RHI::ShaderResourceGroupLayout* m_layout = nullptr; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant.h index 30c1a6b18d..d189d26b13 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant.h @@ -61,9 +61,6 @@ namespace AZ const ShaderAsset& shaderAsset, Data::Asset shaderVariantAsset); - // Returns a shader stage function associated with the provided enum value, or null if no function exists. - const RHI::ShaderStageFunction* GetShaderStageFunction(RHI::ShaderStage shaderStage) const; - // Cached state from the asset to avoid an indirection. RHI::PipelineStateType m_pipelineStateType = RHI::PipelineStateType::Count; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant2.h new file mode 100644 index 0000000000..524ebf6a3c --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/Shader/ShaderVariant2.h @@ -0,0 +1,71 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include + +#include + +namespace AZ +{ + namespace RPI + { + //! Represents the concrete state to configure a PipelineStateDescriptor. ShaderVariant2's match + //! the RHI::PipelineStateType of the parent Shader instance. For shaders on the raster + //! pipeline, the RHI::DrawFilterTag is also provided. + class ShaderVariant2 final + { + friend class Shader2; + public: + ShaderVariant2() = default; + AZ_DEFAULT_COPY_MOVE(ShaderVariant2); + + //! Fills a pipeline state descriptor with settings provided by the ShaderVariant2. (Note that + //! this does not fill the InputStreamLayout or OutputAttachmentLayout as that also requires + //! information from the mesh data and pass system and must be done as a separate step). + void ConfigurePipelineState(RHI::PipelineStateDescriptor& descriptor) const; + + const ShaderVariantId& GetShaderVariantId() const { return m_shaderVariantAsset->GetShaderVariantId(); } + + //! Returns whether the variant is fully baked variant (all options are static branches), or false if the + //! variant uses dynamic branches for some shader options. + //! If the shader variant is not fully baked, the ShaderVariantKeyFallbackValue must be correctly set when drawing. + bool IsFullyBaked() const { return m_shaderVariantAsset->IsFullyBaked(); } + + //! Return the timestamp when this asset was built. + //! This is used to synchronize versions of the ShaderAsset and ShaderVariantAsset, especially during hot-reload. + //! This timestamp must be >= than the ShaderAsset timestamp. + AZStd::sys_time_t GetBuildTimestamp() const { return m_shaderVariantAsset->GetBuildTimestamp(); } + + bool IsRootVariant() const { return m_shaderVariantAsset->IsRootVariant(); } + + ShaderVariantStableId GetStableId() const { return m_shaderVariantAsset->GetStableId(); } + + private: + // Called by Shader. Initializes runtime data from asset data. Returns whether the call succeeded. + bool Init( + const ShaderAsset2& shaderAsset, + Data::Asset shaderVariantAsset, + SupervariantIndex supervariantIndex); + + // Cached state from the asset to avoid an indirection. + RHI::PipelineStateType m_pipelineStateType = RHI::PipelineStateType::Count; + + // State assigned to the pipeline state descriptor. + RHI::ConstPtr m_pipelineLayoutDescriptor; + + Data::Asset m_shaderVariantAsset; + + const RHI::RenderStates* m_renderStates = nullptr; // Cached from ShaderAsset2. + }; + } +} diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h index 4f24a20f35..8075c6fc5d 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Public/ViewportContext.h @@ -26,9 +26,9 @@ namespace AZ class ViewportContextManager; //! ViewportContext wraps a native window and represents a minimal viewport - //! in which a scene is rendered on-screen + //! in which a scene is rendered on-screen. //! ViewportContexts are registered on creation to allow consumers to listen to notifications - //! and manage the view stack for a given viewport + //! and manage the view stack for a given viewport. class ViewportContext : public SceneNotificationBus::Handler , public AzFramework::WindowNotificationBus::Handler @@ -61,11 +61,11 @@ namespace AZ //! Gets the current name of this ViewportContext. //! This name is used to tie this ViewportContext to its View stack, and ViewportContexts may be - //! renamed via AZ::Interface::Get()->RenameViewportContext. + //! renamed via AZ::RPI::ViewportContextRequests::Get()->RenameViewportContext(...). AZ::Name GetName() const; //! Gets the default view associated with this ViewportContext. - //! Alternatively, use AZ::Interface::Get()->GetCurrentView. + //! Alternatively, use AZ::RPI::ViewportContextRequests::Get()->GetCurrentView(). ViewPtr GetDefaultView(); ConstViewPtr GetDefaultView() const; @@ -99,6 +99,18 @@ namespace AZ //! Notifies consumers when the render scene has changed. void ConnectSceneChangedHandler(SceneChangedEvent::Handler& handler); + using PipelineChangedEvent = AZ::Event; + //! Notifies consumers when the current pipeline associated with our window has changed. + void ConnectCurrentPipelineChangedHandler(PipelineChangedEvent::Handler& handler); + + using ViewChangedEvent = AZ::Event; + //! Notifies consumers when the default view has changed. + void ConnectDefaultViewChangedHandler(ViewChangedEvent::Handler& handler); + + using ViewportIdEvent = AZ::Event; + //! Notifies consumers when this ViewportContext is about to be destroyed. + void ConnectAboutToBeDestroyedHandler(ViewportIdEvent::Handler& handler); + // ViewportRequestBus interface //! Gets the current camera's view matrix. const AZ::Matrix4x4& GetCameraViewMatrix() const override; @@ -123,12 +135,17 @@ namespace AZ WindowContextSharedPtr m_windowContext; ViewPtr m_defaultView; AzFramework::WindowSize m_viewportSize; + SizeChangedEvent m_sizeChangedEvent; MatrixChangedEvent m_viewMatrixChangedEvent; MatrixChangedEvent::Handler m_onViewMatrixChangedHandler; MatrixChangedEvent m_projectionMatrixChangedEvent; MatrixChangedEvent::Handler m_onProjectionMatrixChangedHandler; SceneChangedEvent m_sceneChangedEvent; + PipelineChangedEvent m_currentPipelineChangedEvent; + ViewChangedEvent m_defaultViewChangedEvent; + ViewportIdEvent m_aboutToBeDestroyedEvent; + ViewportContextManager* m_manager; RenderPipelinePtr m_currentPipeline; Name m_name; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/LuaMaterialFunctor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/LuaMaterialFunctor.h index 44de79ff22..f372f40981 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/LuaMaterialFunctor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/LuaMaterialFunctor.h @@ -288,6 +288,7 @@ namespace AZ AZStd::size_t GetShaderCount() const; LuaMaterialFunctorShaderItem GetShader(AZStd::size_t index); LuaMaterialFunctorShaderItem GetShaderByTag(const char* shaderTag); + bool HasShaderWithTag(const char* shaderTag); private: @@ -329,6 +330,8 @@ namespace AZ bool SetMaterialPropertySoftMaxValue(const char* name, Type value); bool SetMaterialPropertyDescription(const char* name, const char* description); + + bool SetMaterialPropertyGroupVisibility(const char* name, MaterialPropertyGroupVisibility visibility); private: diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialDynamicMetadata.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialDynamicMetadata.h new file mode 100644 index 0000000000..b74e330665 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialDynamicMetadata.h @@ -0,0 +1,100 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + // Normally we wouldn't want editor-related code mixed in with runtime code, but + // since this data can be modified dynamically, keeping it in the runtime makes + // the overall material functor design simpler and more user-friendly. + + + //! Visibility for each material property. + //! If the data field is empty, use default as editable. + enum class MaterialPropertyVisibility : uint32_t + { + Enabled, //!< The property is visible and editable + Disabled, //!< The property is visible but non-editable + Hidden, //!< The property is invisible + + Default = Enabled + }; + + struct MaterialPropertyRange + { + MaterialPropertyRange() = default; + MaterialPropertyRange( + const MaterialPropertyValue& max, + const MaterialPropertyValue& min, + const MaterialPropertyValue& softMax, + const MaterialPropertyValue& softMin + ) + : m_max(max) + , m_min(min) + , m_softMax(softMax) + , m_softMin(softMin) + {} + + MaterialPropertyValue m_max; + MaterialPropertyValue m_min; + MaterialPropertyValue m_softMax; + MaterialPropertyValue m_softMin; + }; + + //! Used by material functors to dynamically control property metadata in tools. + //! For example, show/hide a property based on some other 'enable' flag property. + struct MaterialPropertyDynamicMetadata + { + AZ_TYPE_INFO(MaterialPropertyDynamicMetadata, "{A89F215F-3235-499F-896C-9E63ACC1D657}"); + + AZ::RPI::MaterialPropertyVisibility m_visibility; + AZStd::string m_description; + AZ::RPI::MaterialPropertyRange m_propertyRange; + }; + + //! Visibility for each material property group. + enum class MaterialPropertyGroupVisibility : uint32_t + { + // Note it's helpful to keep these values aligned with MaterialPropertyVisibility in part because in lua it would be easy to accidentally use + // MaterialPropertyVisibility instead of MaterialPropertyGroupVisibility resulting in sneaky bugs. Also, if the enums end up being the same in + // the future, we could just merge them into one. + + Enabled, //!< The property is visible and editable + //Disabled, //!< The property is visible but non-editable (reserved for possible future use, to match MaterialPropertyVisibility) + Hidden=2, //!< The property is invisible + + Default = Enabled + }; + + //! Used by material functors to dynamically control property group metadata in tools. + //! For example, show/hide an entire property group based on some 'enable' flag property. + struct MaterialPropertyGroupDynamicMetadata + { + AZ_TYPE_INFO(MaterialPropertyGroupDynamicMetadata, "{F94009F7-48A3-4CE0-AF64-D5A86890ACD4}"); + + AZ::RPI::MaterialPropertyGroupVisibility m_visibility; + }; + + void ReflectMaterialDynamicMetadata(ReflectContext* context); + + } // namespace RPI + + AZ_TYPE_INFO_SPECIALIZE(RPI::MaterialPropertyVisibility, "{318B43A2-79E3-4502-8FD0-5815209EA123}"); + AZ_TYPE_INFO_SPECIALIZE(RPI::MaterialPropertyGroupVisibility, "{B803958B-DE64-4FBF-AC00-CF781611BE37}"); +} // namespace AZ + diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialFunctor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialFunctor.h index d17c7634a2..83472ade77 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialFunctor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialFunctor.h @@ -18,6 +18,7 @@ #include #include #include +#include namespace AZ { @@ -147,6 +148,8 @@ namespace AZ public: const MaterialPropertyDynamicMetadata* GetMaterialPropertyMetadata(const Name& propertyName) const; const MaterialPropertyDynamicMetadata* GetMaterialPropertyMetadata(const MaterialPropertyIndex& index) const; + + const MaterialPropertyGroupDynamicMetadata* GetMaterialPropertyGroupMetadata(const Name& propertyName) const; //! Get the property value. The type must be one of those in MaterialPropertyValue. //! Otherwise, a compile error will be reported. @@ -178,6 +181,8 @@ namespace AZ bool SetMaterialPropertySoftMaxValue(const Name& propertyName, const MaterialPropertyValue& max); bool SetMaterialPropertySoftMaxValue(const MaterialPropertyIndex& index, const MaterialPropertyValue& max); + + bool SetMaterialPropertyGroupVisibility(const Name& propertyGroupName, MaterialPropertyGroupVisibility visibility); // [GFX TODO][ATOM-4168] Replace the workaround for unlink-able RPI.Public classes in MaterialFunctor // const AZStd::vector&, AZStd::unordered_map&, RHI::ConstPtr @@ -185,18 +190,23 @@ namespace AZ EditorContext( const AZStd::vector& propertyValues, RHI::ConstPtr materialPropertiesLayout, - AZStd::unordered_map& metadata, - AZStd::unordered_set& outChangedProperties, + AZStd::unordered_map& propertyMetadata, + AZStd::unordered_map& propertyGroupMetadata, + AZStd::unordered_set& updatedPropertiesOut, + AZStd::unordered_set& updatedPropertyGroupsOut, const MaterialPropertyFlags* materialPropertyDependencies ); private: - AZStd::list_iterator> QueryMaterialMetadata(const Name& propertyName) const; + MaterialPropertyDynamicMetadata* QueryMaterialPropertyMetadata(const Name& propertyName) const; + MaterialPropertyGroupDynamicMetadata* QueryMaterialPropertyGroupMetadata(const Name& propertyGroupName) const; const AZStd::vector& m_materialPropertyValues; RHI::ConstPtr m_materialPropertiesLayout; - AZStd::unordered_map& m_metadata; - AZStd::unordered_set& m_outChangedProperties; + AZStd::unordered_map& m_propertyMetadata; + AZStd::unordered_map& m_propertyGroupMetadata; + AZStd::unordered_set& m_updatedPropertiesOut; + AZStd::unordered_set& m_updatedPropertyGroupsOut; const MaterialPropertyFlags* m_materialPropertyDependencies = nullptr; }; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h index d73ce2334b..fab72d5f96 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h @@ -81,52 +81,6 @@ namespace AZ AZStd::string GetMaterialPropertyDataTypeString(AZ::TypeId typeId); - //! Visibility for each material property. - //! If the data field is empty, use default as editable. - enum class MaterialPropertyVisibility : uint32_t - { - Enabled, //< The property is visible and editable - Disabled, //< The property is visible but non-editable - Hidden, //< The property is invisible - - Default = Enabled - }; - - struct MaterialPropertyRange - { - MaterialPropertyRange() = default; - MaterialPropertyRange( - const MaterialPropertyValue& max, - const MaterialPropertyValue& min, - const MaterialPropertyValue& softMax, - const MaterialPropertyValue& softMin - ) - : m_max(max) - , m_min(min) - , m_softMax(softMax) - , m_softMin(softMin) - {} - - MaterialPropertyValue m_max; - MaterialPropertyValue m_min; - MaterialPropertyValue m_softMax; - MaterialPropertyValue m_softMin; - }; - - //! Used by material functors to dynamically control property metadata in tools. - //! For example, show/hide a property based on some other 'enable' flag property. - //! Normally we wouldn't want editor-related code mixed in with runtime code, but - //! since this data can be modified dynamically, keeping it in the runtime makes - //! the overall material functor design simpler and more user-friendly. - struct MaterialPropertyDynamicMetadata - { - AZ_TYPE_INFO(MaterialPropertyDynamicMetadata, "{A89F215F-3235-499F-896C-9E63ACC1D657}"); - - AZ::RPI::MaterialPropertyVisibility m_visibility; - AZStd::string m_description; - AZ::RPI::MaterialPropertyRange m_propertyRange; - }; - //! A material property is any data input to a material, like a bool, float, Vector, Image, Buffer, etc. //! This descriptor defines a single input property, including it's name ID, and how it maps //! to the shader system. @@ -171,7 +125,6 @@ namespace AZ } // namespace RPI AZ_TYPE_INFO_SPECIALIZE(RPI::MaterialPropertyOutputType, "{42A6E5E8-0FE6-4D7B-884A-1F478E4ADD97}"); - AZ_TYPE_INFO_SPECIALIZE(RPI::MaterialPropertyVisibility, "{318B43A2-79E3-4502-8FD0-5815209EA123}"); AZ_TYPE_INFO_SPECIALIZE(RPI::MaterialPropertyDataType, "{3D903D5C-C6AA-452E-A2F8-8948D30833FF}"); } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h index 5b92047226..4aa3faa6c9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Model/MorphTargetMetaAsset.h @@ -15,6 +15,7 @@ #include #include #include +#include namespace AZ::RPI { @@ -56,6 +57,9 @@ namespace AZ::RPI float m_minPositionDelta; float m_maxPositionDelta; + //! Reference to the wrinkle mask, if it exists + AZ::Data::Asset m_wrinkleMask; + //! Boolean to indicate the presence or absence of color deltas bool m_hasColorDeltas = false; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/IShaderVariantFinder2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/IShaderVariantFinder2.h new file mode 100644 index 0000000000..e09169c9a0 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/IShaderVariantFinder2.h @@ -0,0 +1,113 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include + +#include +#include + +namespace AZ +{ + namespace RPI + { + class ShaderAsset2; + class ShaderVariantTreeAsset; + class ShaderVariantAsset2; + + //! This is the AZ::Interface<> declaration for the singleton responsible + //! for finding the best ShaderVariantAsset a shader can use. + //! This interface is public only to the ShaderAsset class. + //! The expectation is that when in need of shader variants the developer + //! should use AZ::RPI::Shader::GetVariant(). + class IShaderVariantFinder2 + { + public: + AZ_TYPE_INFO(IShaderVariantFinder2, "{4E041C2C-F158-412E-8961-76987EC75692}"); + + static constexpr const char* LogName = "IShaderVariantFinder2"; + + virtual ~IShaderVariantFinder2() = default; + + //! This function should be your one stop shop. + //! It simply queues the request to load a shader variant asset. + //! This function will automatically queue the ShaderVariantTreeAsset for loading if not available. + //! Afther the ShaderVariantTreeAsset is loaded and ready, it is used to find the best matching ShaderVariantStableId + //! from the given ShaderVariantId. If a valid ShaderVariantStableId is found, it will be queued for loading. + //! Eventually the caller will be notified via ShaderVariantFinderNotificationBus::OnShaderVariantAssetReady() + //! The notification will occur on the Main Thread. + virtual bool QueueLoadShaderVariantAssetByVariantId( + Data::Asset shaderAsset, const ShaderVariantId& shaderVariantId, SupervariantIndex supervariantIndex) = 0; + + //! This function does the first half of the work. It simply queues the loading of the ShaderVariantTreeAsset. + //! Given the AssetId of a ShaderAsset it will try to find and load its corresponding ShaderVariantTreeAsset from + //! the asset cache. If found, the asset will be loaded asynchronously and the caller will be notified via + //! ShaderVariantFinderNotificationBus on main thread when the ShaderVariantTreeAsset is fully loaded. + //! It is possible the requested ShaderVariantTreeAsset will never come into existence and in such + //! case the caller will NEVER be notified. + //! Returns true if the request was queued successfully. + virtual bool QueueLoadShaderVariantTreeAsset(const Data::AssetId& shaderAssetId) = 0; + + //! This function does the second half of the work. + //! Given the AssetId of a ShaderVariantTreeAsset and the stable id of a ShaderVariantAsset it will try to + //! find its corresponding ShaderVariantAsset from the asset cache. If found, the asset will be loaded + //! asynchronously and the caller will be notified via ShaderVariantFinderNotificationBus on main thread when the + //! ShaderVariantAsset is fully loaded. + //! Returns true if the request was queued successfully. + virtual bool QueueLoadShaderVariantAsset( + const Data::AssetId& shaderVariantTreeAssetId, ShaderVariantStableId variantStableId, + SupervariantIndex supervariantIndex) = 0; + + //! This is a quick blocking call that will return a valid asset only if it's been fully loaded already, + //! Otherwise it returns an invalid asset and the caller is supposed to call QueueLoadShaderVariantAssetByVariantId(). + virtual Data::Asset GetShaderVariantAssetByVariantId( + Data::Asset shaderAsset, const ShaderVariantId& shaderVariantId, SupervariantIndex supervariantIndex) = 0; + + virtual Data::Asset GetShaderVariantAssetByStableId( + Data::Asset shaderAsset, ShaderVariantStableId shaderVariantStableId, SupervariantIndex supervariantIndex) = 0; + + //! This is a quick blocking call that will return a valid asset only if it's been fully loaded already, + //! Otherwise it returns an invalid asset and the caller is supposed to call QueueLoadShaderVariantTreeAsset(). + virtual Data::Asset GetShaderVariantTreeAsset(const Data::AssetId& shaderAssetId) = 0; + + //! This is a quick blocking call that will return a valid asset only if i's been fully loaded already, + //! Otherwise it returns an invalid asset and the caller is supposed to call QueueLoadShaderVariantAsset(). + virtual Data::Asset GetShaderVariantAsset( + const Data::AssetId& shaderVariantTreeAssetId, ShaderVariantStableId variantStableId, + SupervariantIndex supervariantIndex) = 0; + + //! Clears the cache of loaded ShaderVariantTreeAsset and ShaderVariantAsset objects. + //! This is intended for testing. + virtual void Reset() = 0; + }; + + //! IShaderVariantFinder2 will call on this notification bus on the main thread. + //! Only the following classes are supposed to register to this notification bus: + //! AZ::RPI::ShaderAsset & AZ::RPI::Shader + class ShaderVariantFinderNotification2 + : public EBusTraits + { + public: + ////////////////////////////////////////////////////////////////////////// + // EBusTraits overrides + static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById; + using MutexType = AZStd::recursive_mutex; + typedef Data::AssetId BusIdType; // The AssetId of the shader asset. + ////////////////////////////////////////////////////////////////////////// + + virtual void OnShaderVariantTreeAssetReady(Data::Asset shaderVariantTreeAsset, bool isError) = 0; + virtual void OnShaderVariantAssetReady(Data::Asset shaderVariantAsset, bool isError) = 0; + }; + using ShaderVariantFinderNotificationBus2 = AZ::EBus; + + } // namespace RPI +}// namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h index 4afc3a1a46..cc31b0735a 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -54,6 +55,8 @@ namespace AZ //! The default shader variant (i.e. the one without any options set). static const ShaderVariantStableId RootShaderVariantStableId; + // @subProductType is one of ShaderAssetSubId, or (ShaderAssetSubId::GeneratedHlslSource + 1)+ + static uint32_t MakeAssetProductSubId(uint32_t rhiApiUniqueIndex, uint32_t subProductType); ShaderAsset() = default; ~ShaderAsset(); @@ -218,83 +221,21 @@ namespace AZ ////////////////////////////////////////////////////////////////////////// // Deprecated System - enum class ShaderStageType : uint32_t - { - Vertex, - Geometry, - TessellationControl, - TessellationEvaluation, - Fragment, - Compute, - RayTracing - }; - - const char* ToString(ShaderStageType shaderStageType); - - void ReflectShaderStageType(ReflectContext* context); - enum class ShaderAssetSubId : uint32_t { ShaderAsset = 0, - StreamLayout, - GraphicsPipelineState, - OutputMergerState, RootShaderVariantAsset, - //[GFX TODO][LY-82895] (arsentuf) These shader stages are going to get reworked when virtual stages are implemented - AzVertexShader, - AzGeometryShader, - AzTessellationControlShader, - AzTessellationEvaluationShader, - AzFragmentShader, - AzComputeShader, - AzRayTracingShader, - DebugByProduct, PostPreprocessingPureAzsl, // .azslin IaJson, OmJson, SrgJson, OptionsJson, BindingdepJson, - GeneratedSource // This must be last because we use this as a base for adding the RHI::APIType when generating shadersource for multiple RHI APIs. + GeneratedHlslSource // This must be last because we use this as a base for adding the RHI::APIType when generating shadersource for multiple RHI APIs. }; - ShaderAssetSubId ShaderStageToSubId(ShaderStageType stageType); - - class ShaderStageDescriptor final - { - public: - AZ_TYPE_INFO(ShaderStageDescriptor, "{3E7822F7-B952-4379-B0A0-48507681845A}"); - AZ_CLASS_ALLOCATOR(ShaderStageDescriptor, AZ::SystemAllocator, 0); - - static void Reflect(ReflectContext* context); - - ShaderStageType m_stageType; - AZStd::vector m_byteCode; - AZStd::vector m_sourceCode; - AZStd::string m_entryFunctionName; - }; - - //[GFX TODO][LY-82803] (arsentuf) Remove this when we've fleshed out Virtual Shader stages - class ShaderStageAsset final - : public AZ::Data::AssetData - { - public: - AZ_RTTI(ShaderStageAsset, "{975F48B5-1577-41C9-B8F5-A1024E2D01F1}", AZ::Data::AssetData); - AZ_CLASS_ALLOCATOR(ShaderStageAsset, AZ::SystemAllocator, 0); - - static void Reflect(ReflectContext* context); - - ShaderStageAsset() = default; - ShaderStageAsset(const ShaderStageAsset&); - ShaderStageAsset& operator= (const ShaderStageAsset&); - ShaderStageAsset(ShaderStageAsset&& rhs); - - AZStd::shared_ptr m_descriptor; - AZStd::vector m_srgLayouts; - }; ////////////////////////////////////////////////////////////////////////// } // namespace RPI - AZ_TYPE_INFO_SPECIALIZE(RPI::ShaderStageType, "{A6408508-748B-4963-B618-E1E6ECA3629A}"); } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset2.h new file mode 100644 index 0000000000..632c35bb82 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAsset2.h @@ -0,0 +1,339 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include + +namespace AZ +{ + namespace RPI + { + using ShaderResourceGroupLayoutList = AZStd::fixed_vector, RHI::Limits::Pipeline::ShaderResourceGroupCountMax>; + + enum class ShaderAsset2ProductSubId : uint32_t + { + ShaderAsset2 = 0, //!< for .azshader file, One per .shader. + RootShaderVariantAsset, //!< for .azshadervariant, one per supervariant and referenced inside the .azshader. + AzslFlat, //!< .azslin, this file contains the result of preprocessing an azsl file with MCPP, along with prepending the per-RHI azsli header. + IaJson, //!< .ia.json, Input Assembly reflection data. + OmJson, //!< .om.json, Output Merger reflection data. + SrgJson, //!< .srg.json, Shader Resource Group reflection data. + OptionsJson, //!< .options.json, Shader Options reflection data. + BindingdepJson, //!<.bindingdep.json, Binding dependencies. + GeneratedHlslSource, //!<.hlsl code generated with AZSLc. + FirstByProduct, //!< This must be last because we use this as a base for adding all the debug byProducts generated + //!< with dxc, or spirv-cross, etc. + }; + + class ShaderAsset2 final + : public Data::AssetData + , public ShaderVariantFinderNotificationBus2::Handler + , public Data::AssetBus::Handler + { + friend class ShaderAssetCreator2; + friend class ShaderAssetHandler2; + friend class ShaderAssetTester2; + public: + AZ_RTTI(ShaderAsset2, "{823395A3-D570-49F4-99A9-D820CD1DEF98}", Data::AssetData); + static void Reflect(ReflectContext* context); + + static constexpr char DisplayName[] = "Shader"; + static constexpr char Extension[] = "azshader2"; + static constexpr char Group[] = "Shader"; + + //! The default shader variant (i.e. the one without any options set). + static const ShaderVariantStableId RootShaderVariantStableId; + + // @subProductType is one of ShaderAsset2ProductSubId, or ShaderAsset2ProductSubId::FirstByProduct+ + static uint32_t MakeProductAssetSubId(uint32_t rhiApiUniqueIndex, uint32_t supervariantIndex, uint32_t subProductType); + static SupervariantIndex GetSupervariantIndexFromProductAssetSubId(uint32_t assetProducSubId); + static SupervariantIndex GetSupervariantIndexFromAssetId(const Data::AssetId& assetId); + + + ShaderAsset2() = default; + ~ShaderAsset2(); + + AZ_DISABLE_COPY_MOVE(ShaderAsset2); + + + //! Returns the name of the shader. + const Name& GetName() const; + + //! Returns the pipeline state type generated by variants of this shader. + RHI::PipelineStateType GetPipelineStateType() const; + + //! Returns the draw list tag name. + //! To get the corresponding DrawListTag use DrawListTagRegistry's FindTag() or AcquireTag() (see + //! RHISystemInterface::GetDrawListTagRegistry()). The DrawListTag is also available in the Shader that corresponds to this + //! ShaderAsset2. + const Name& GetDrawListName() const; + + //! Return the timestamp when the shader asset was built. + //! This is used to synchronize versions of the ShaderAsset2 and ShaderVariantTreeAsset, especially during hot-reload. + AZStd::sys_time_t GetShaderAssetBuildTimestamp() const; + + //! Returns the shader option group layout. + const ShaderOptionGroupLayout* GetShaderOptionGroupLayout() const; + + SupervariantIndex GetSupervariantIndex(const AZ::Name& supervariantName) const; + + //! This function should be your one stop shop to get a ShaderVariantAsset. + //! Finds and returns the best matching ShaderVariantAsset given a ShaderVariantId. + //! If the ShaderVariantAsset is not fully loaded and ready at the moment, this function + //! will QueueLoad the ShaderVariantTreeAsset and subsequently will QueueLoad the ShaderVariantAsset. + //! The called will be notified via the ShaderVariantFinderNotificationBus when the + //! ShaderVariantAsset is loaded and ready. + //! In the mean time, if the required variant is not available this function + //! returns the Root Variant. + Data::Asset GetVariant( + const ShaderVariantId& shaderVariantId, SupervariantIndex supervariantIndex); + Data::Asset GetVariant(const ShaderVariantId& shaderVariantId) { return GetVariant(shaderVariantId, DefaultSupervariantIndex); } + + //! Finds the best matching shader variant and returns its StableId. + //! This function first loads and caches the ShaderVariantTreeAsset (if not done before). + //! If the ShaderVariantTreeAsset is not found (either the AssetProcessor has not generated it yet, or it simply doesn't exist), then + //! it returns a search result that identifies the root variant. + //! This function is thread safe. + ShaderVariantSearchResult FindVariantStableId(const ShaderVariantId& shaderVariantId); + + //! Returns the variant asset associated with the provided StableId. + //! The user should call FindVariantStableId() first to get a ShaderVariantStableId from a ShaderVariantId, + //! Or better yet, call GetVariant(ShaderVariantId) for maximum convenience. + //! If the requested variant is not found, the root variant will be returned AND the requested variant will be queued for loading. + //! Next time around if the variant has been loaded this function will return it. Alternatively + //! the caller can register with the ShaderVariantFinderNotificationBus to get the asset as soon as is available. + //! This function is thread safe. + Data::Asset GetVariant( + ShaderVariantStableId shaderVariantStableId, SupervariantIndex supervariantIndex) const; + Data::Asset GetVariant(ShaderVariantStableId shaderVariantStableId) const { return GetVariant(shaderVariantStableId, DefaultSupervariantIndex); } + + Data::Asset GetRootVariant(SupervariantIndex supervariantIndex) const; + Data::Asset GetRootVariant() const { return GetRootVariant(DefaultSupervariantIndex); } + + + //! Finds and returns the shader resource group asset with the requested name. Returns an empty handle if no matching group was + //! found. + const RHI::Ptr FindShaderResourceGroupLayout( + const Name& shaderResourceGroupName, SupervariantIndex supervariantIndex) const; + const RHI::Ptr FindShaderResourceGroupLayout(const Name& shaderResourceGroupName) const + { + return FindShaderResourceGroupLayout(shaderResourceGroupName, DefaultSupervariantIndex); + } + + //! Finds and returns the shader resource group layout associated with the requested binding slot. Returns an empty handle if no matching srg was found. + const RHI::Ptr FindShaderResourceGroupLayout( + uint32_t bindingSlot, SupervariantIndex supervariantIndex) const; + const RHI::Ptr FindShaderResourceGroupLayout(uint32_t bindingSlot) const + { + return FindShaderResourceGroupLayout(bindingSlot, DefaultSupervariantIndex); + } + + //! Finds and returns the shader resource group layout designated as a ShaderVariantKey fallback. + const RHI::Ptr FindFallbackShaderResourceGroupLayout( SupervariantIndex supervariantIndex) const; + const RHI::Ptr FindFallbackShaderResourceGroupLayout() const + { + return FindFallbackShaderResourceGroupLayout(DefaultSupervariantIndex); + } + + + //! Returns the set of shader resource group layouts owned by a given supervariant. + AZStd::array_view> GetShaderResourceGroupLayouts( SupervariantIndex supervariantIndex) const; + AZStd::array_view> GetShaderResourceGroupLayouts() const + { + return GetShaderResourceGroupLayouts(DefaultSupervariantIndex); + } + + //! Returns the pipeline layout descriptor shared by all variants in the asset. + const RHI::PipelineLayoutDescriptor* GetPipelineLayoutDescriptor(SupervariantIndex supervariantIndex) const; + const RHI::PipelineLayoutDescriptor* GetPipelineLayoutDescriptor() const + { + return GetPipelineLayoutDescriptor(DefaultSupervariantIndex); + } + + //! Returns the shader resource group asset that has per-draw frequency, which is added to every draw packet. + const RHI::Ptr GetDrawSrgLayout(SupervariantIndex supervariantIndex) const; + const RHI::Ptr GetDrawSrgLayout() const + { + return GetDrawSrgLayout(DefaultSupervariantIndex); + } + + + //! Returns the ShaderInputContract which describes which inputs the shader requires + const ShaderInputContract& GetInputContract(SupervariantIndex supervariantIndex) const; + const ShaderInputContract& GetInputContract() const + { + return GetInputContract(DefaultSupervariantIndex); + } + + + //! Returns the ShaderOuputContract which describes which outputs the shader requires + const ShaderOutputContract& GetOutputContract(SupervariantIndex supervariantIndex) const; + const ShaderOutputContract& GetOutputContract() const + { + return GetOutputContract(DefaultSupervariantIndex); + } + + + //! Returns the render states for the draw pipeline. Only used for draw pipelines. + const RHI::RenderStates& GetRenderStates(SupervariantIndex supervariantIndex) const; + const RHI::RenderStates& GetRenderStates() const + { + return GetRenderStates(DefaultSupervariantIndex); + } + + + //! Returns a list of arguments for the specified attribute, or nullopt_t if the attribute is not found. The list can be empty which is still valid. + AZStd::optional GetAttribute( + const RHI::ShaderStage& shaderStage, const Name& attributeName, SupervariantIndex supervariantIndex) const; + AZStd::optional GetAttribute( + const RHI::ShaderStage& shaderStage, const Name& attributeName) const + { + return GetAttribute(shaderStage, attributeName, DefaultSupervariantIndex); + } + + + private: + /////////////////////////////////////////////////////////////////// + /// AssetBus overrides + void OnAssetReloaded(Data::Asset asset) override; + /////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + /// ShaderVariantFinderNotificationBus2 overrides + void OnShaderVariantTreeAssetReady(Data::Asset shaderVariantTreeAsset, bool isError) override; + void OnShaderVariantAssetReady(Data::Asset /*shaderVariantAsset*/, bool /*isError*/) override {}; + /////////////////////////////////////////////////////////////////// + + //! A Supervariant represents a set of static shader compilation parameters. + //! Those parameters can be predefined c-preprocessor macros or specific arguments + //! for AZSLc. + //! For each Supervariant there's a unique Root ShaderVariantAsset, and possibly an N amount + //! of ShaderVariantAssets. The 'N' amount is the same across all Supervariants because all Supervariants + //! share the same ShaderVariantTreeAsset. + struct Supervariant + { + AZ_TYPE_INFO(Supervariant, "{850826EF-B267-4752-92F6-A85E4175CAB8}"); + static void Reflect(AZ::ReflectContext* context); + + AZ::Name m_name; + ShaderResourceGroupLayoutList m_srgLayoutList; + RHI::Ptr m_pipelineLayoutDescriptor; + ShaderInputContract m_inputContract; + ShaderOutputContract m_outputContract; + RHI::RenderStates m_renderStates; + RHI::ShaderStageAttributeMapList m_attributeMaps; + Data::Asset m_rootShaderVariantAsset; + }; + + //! Container of shader data that is specific to an RHI API. + //! A ShaderAsset2 can contain shader data for multiple RHI APIs if + //! the platform support multiple RHIs. + struct ShaderApiDataContainer + { + AZ_TYPE_INFO(ShaderApiDataContainer, "{C636722C-60B9-421C-ACAD-9750BF634A27}"); + static void Reflect(AZ::ReflectContext* context); + + //! RHI API Type for this shader data. + RHI::APIType m_APIType; + // Index 0, will always be the default Supervariant. (see DefaultSupervariantIndex) + AZStd::vector m_supervariants; + }; + + bool FinalizeAfterLoad(); + void SetReady(); + ShaderApiDataContainer& GetCurrentShaderApiData(); + const ShaderApiDataContainer& GetCurrentShaderApiData() const; + + //! Returning pointers instead of references to allow for error checking + //! and not having to assert. + Supervariant* GetSupervariant(SupervariantIndex supervariantIndex); + const Supervariant* GetSupervariant(SupervariantIndex supervariantIndex) const; + + + //! The name is the stem of the source .shader file. + Name m_name; + + //! Dictates the type of pipeline state generated by this asset (Draw / Dispatch / etc.). + //! All shader variants, across all supervariants, in the asset adhere to this type. + RHI::PipelineStateType m_pipelineStateType = RHI::PipelineStateType::Count; + + //! Defines the layout of the shader options in the asset. + Ptr m_shaderOptionGroupLayout; + + //! List with shader data per RHI backend. + AZStd::vector m_perAPIShaderData; + + Name m_drawListName; + + //! Use to synchronize versions of the ShaderAsset2 and ShaderVariantTreeAsset, especially during hot-reload. + AZStd::sys_time_t m_shaderAssetBuildTimestamp = 0; + + + /////////////////////////////////////////////////////////////////// + //! Do Not Serialize! + + static constexpr size_t InvalidAPITypeIndex = std::numeric_limits::max(); + + //! Index that indicates which ShaderDataContainer to use. + //! At runtime, the asset checks the current active RHI Backend + //! and based on the results this variable gets set on asset load. + //! The vector @m_perAPIShaderData will be indexed with this variable. + size_t m_currentAPITypeIndex = InvalidAPITypeIndex; + + //! We can not know the ShaderVariantTreeAsset by the time this asset is being created. + //! This is a value that is discovered at run time. It becomes valid when FindVariantStableId is called at least once. + Data::Asset m_shaderVariantTree; + + //! Used for thread safety for FindVariantStableId(). + mutable AZStd::shared_mutex m_variantTreeMutex; + + bool m_shaderVariantTreeLoadWasRequested = false; + }; + + class ShaderAssetHandler2 final + : public AssetHandler + { + using Base = AssetHandler; + public: + ShaderAssetHandler2() = default; + + private: + Data::AssetHandler::LoadResult LoadAssetData( + const Data::Asset& asset, + AZStd::shared_ptr stream, + const Data::AssetFilterCB& assetLoadFilterCB) override; + Data::AssetHandler::LoadResult PostLoadInit(const Data::Asset& asset); + }; + + ////////////////////////////////////////////////////////////////////////// + } // namespace RPI + +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator2.h new file mode 100644 index 0000000000..263d2e5107 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator2.h @@ -0,0 +1,97 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include + +#include + +namespace AZ +{ + namespace RPI + { + class ShaderAssetCreator2 + : public AssetCreator + { + public: + //! Begins creation of a shader asset. + void Begin(const Data::AssetId& assetId); + + //! [Optional] Set the timestamp for when the ShaderAsset build process began. + //! This is needed to synchronize between the ShaderAsset and ShaderVariantTreeAsset when hot-reloading shaders. + void SetShaderAssetBuildTimestamp(AZStd::sys_time_t shaderAssetBuildTimestamp); + + //! [Optional] Sets the name of the shader asset from content. + void SetName(const Name& name); + + //! [Optional] Sets the DrawListTag name associated with this shader. + void SetDrawListName(const Name& name); + + //! [Required] Assigns the layout used to construct and parse shader options packed into shader variant keys. + //! Requires that the keys assigned to shader variants were constructed using the same layout. + void SetShaderOptionGroupLayout(const Ptr& shaderOptionGroupLayout); + + //! Begins the shader creation for a specific RHI API. + //! Begin must be called before the BeginAPI function is called. + //! @param type The target RHI API type. + void BeginAPI(RHI::APIType type); + + //! Begins the creation of a Supervariant for the current RHI::APIType. + //! If this is the first supervariant its name must be empty. The first + //! supervariant is always the default, nameless, supervariant. + void BeginSupervariant(const Name& name); + + void SetSrgLayoutList(const ShaderResourceGroupLayoutList& srgLayoutList); + + //! [Required] Assigns the pipeline layout descriptor shared by all variants in the shader. Shader variants + //! embedded in a single shader asset are required to use the same pipeline layout. It is not necessary to call + //! Finalize() on the pipeline layout prior to assignment, but still permitted. + void SetPipelineLayout(RHI::Ptr m_pipelineLayoutDescriptor); + + //! Assigns the contract for inputs required by the shader. + void SetInputContract(const ShaderInputContract& contract); + + //! Assigns the contract for outputs required by the shader. + void SetOutputContract(const ShaderOutputContract& contract); + + //! Assigns the render states for the draw pipeline. Ignored for non-draw pipelines. + void SetRenderStates(const RHI::RenderStates& renderStates); + + //! [Optional] Not all shaders have attributes before functions. Some attributes do not exist for all RHI::APIType either. + void SetShaderStageAttributeMapList(const RHI::ShaderStageAttributeMapList& shaderStageAttributeMapList); + + //! [Required] There's always a root variant for each supervariant. + void SetRootShaderVariantAsset(Data::Asset shaderVariantAsset); + + bool EndSupervariant(); + + bool EndAPI(); + + bool End(Data::Asset& shaderAsset); + + //! Clones an existing ShaderAsset. + void Clone(const Data::AssetId& assetId, + const ShaderAsset2& sourceShaderAsset); + + private: + + // Shader variants will use this draw list when they don't specify one. + Name m_defaultDrawList; + + // The current supervariant is cached here to facilitate asset + // construction. Additionally, prevents BeginSupervariant to be called more than once before calling EndSupervariant. + ShaderAsset2::Supervariant* m_currentSupervariant = nullptr; + + }; + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h new file mode 100644 index 0000000000..35a12fbf45 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h @@ -0,0 +1,56 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include +#include + +namespace AZ +{ + namespace RPI + { + // Common bit positions for ShaderAsset2 and ShaderVariantAsset2 product SubIds. + static constexpr uint32_t RhiIndexBitPosition = 30; + static constexpr uint32_t RhiIndexNumBits = 32 - RhiIndexBitPosition; + static constexpr uint32_t RhiIndexMaxValue = (1 << RhiIndexNumBits) - 1; + + static constexpr uint32_t SupervariantIndexBitPosition = 22; + static constexpr uint32_t SupervariantIndexNumBits = RhiIndexBitPosition - SupervariantIndexBitPosition; + static constexpr uint32_t SupervariantIndexMaxValue = (1 << SupervariantIndexNumBits) - 1; + + //! A wrapper around a supervariant index for type conformity. + //! A supervariant index is required to find shader data from + //! Shader2 and ShaderAsset2 related APIs. + using SupervariantIndex = RHI::Handle; + static const SupervariantIndex DefaultSupervariantIndex(0); + static const SupervariantIndex InvalidSupervariantIndex; + + enum class ShaderStageType : uint32_t + { + Vertex, + Geometry, + TessellationControl, + TessellationEvaluation, + Fragment, + Compute, + RayTracing + }; + + const char* ToString(ShaderStageType shaderStageType); + + void ReflectShaderStageType(ReflectContext* context); + + } // namespace RPI + + AZ_TYPE_INFO_SPECIALIZE(RPI::ShaderStageType, "{A6408508-748B-4963-B618-E1E6ECA3629A}"); + +} // namespace AZ 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 6a1f2af651..22ce16b9f8 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 @@ -43,8 +43,13 @@ namespace AZ static constexpr const char* DisplayName = "ShaderVariant"; static constexpr const char* Group = "Shader"; + static constexpr uint32_t ShaderVariantAssetSubProductType = 0; //! @rhiApiUniqueIndex comes from RHI::Factory::GetAPIUniqueIndex() - static uint32_t GetAssetSubId(uint32_t rhiApiUniqueIndex, ShaderVariantStableId variantStableId); + //! @subProductType is always 0 for a regular ShaderVariantAsset, for all other debug subProducts created + //! by ShaderVariantAssetBuilder this is 1+. + static uint32_t MakeAssetProductSubId( + uint32_t rhiApiUniqueIndex, ShaderVariantStableId variantStableId, + uint32_t subProductType = ShaderVariantAssetSubProductType); ShaderVariantAsset() = default; ~ShaderVariantAsset() = default; diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset2.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset2.h new file mode 100644 index 0000000000..82e868fda8 --- /dev/null +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset2.h @@ -0,0 +1,104 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#pragma once + +#include + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + //! A ShaderVariantAsset2 contains the shader byte code for each shader stage (Vertex, Fragment, Tessellation, etc) for a given RHI::APIType (dx12, vulkan, metal, etc). + //! One independent file per RHI::APIType. + class ShaderVariantAsset2 final + : public Data::AssetData + { + friend class ShaderVariantAssetHandler2; + friend class ShaderVariantAssetCreator2; + + public: + AZ_RTTI(ShaderVariantAsset2, "{51BED815-36D8-410E-90F0-1FA9FF765FBA}", Data::AssetData); + + static void Reflect(ReflectContext* context); + + static constexpr const char* Extension = "azshadervariant2"; + static constexpr const char* DisplayName = "ShaderVariant"; + static constexpr const char* Group = "Shader"; + + static constexpr uint32_t ShaderVariantAsset2SubProductType = 1; + //! @rhiApiUniqueIndex comes from RHI::Factory::GetAPIUniqueIndex() + //! @subProductType is always 0 for a regular ShaderVariantAsset2, for all other debug subProducts created + //! by ShaderVariantAssetBuilder2 this is 1+. + static uint32_t MakeAssetProductSubId( + uint32_t rhiApiUniqueIndex, uint32_t supervariantIndex, ShaderVariantStableId variantStableId, + uint32_t subProductType = ShaderVariantAsset2SubProductType); + + ShaderVariantAsset2() = default; + ~ShaderVariantAsset2() = default; + + AZ_DISABLE_COPY_MOVE(ShaderVariantAsset2); + + RPI::ShaderVariantStableId GetStableId() const { return m_stableId; } + + const ShaderVariantId& GetShaderVariantId() const { return m_shaderVariantId; } + + //! Returns the shader stage function associated with the provided stage enum value. + const RHI::ShaderStageFunction* GetShaderStageFunction(RHI::ShaderStage shaderStage) const; + + //! Returns whether the variant is fully baked variant (all options are static branches), or false if the + //! variant uses dynamic branches for some shader options. + //! If the shader variant is not fully baked, the ShaderVariantKeyFallbackValue must be correctly set when drawing. + bool IsFullyBaked() const; + + //! Return the timestamp when this asset was built, and it must be >= than the timestamp of the main ShaderAsset. + //! This is used to synchronize versions of the ShaderAsset and ShaderVariantAsset2, especially during hot-reload. + AZStd::sys_time_t GetBuildTimestamp() const; + + bool IsRootVariant() const { return m_stableId == RPI::RootShaderVariantStableId; } + + private: + //! Called by asset creators to assign the asset to a ready state. + void SetReady(); + bool FinalizeAfterLoad(); + + //! See AZ::RPI::ShaderVariantListSourceData::VariantInfo::m_stableId for details. + RPI::ShaderVariantStableId m_stableId; + + ShaderVariantId m_shaderVariantId; + + bool m_isFullyBaked = false; + + AZStd::array, RHI::ShaderStageCount> m_functionsByStage; + + //! Used to synchronize versions of the ShaderAsset and ShaderVariantAsset2, especially during hot-reload. + AZStd::sys_time_t m_buildTimestamp = 0; + }; + + class ShaderVariantAssetHandler2 final + : public AssetHandler + { + using Base = AssetHandler; + public: + ShaderVariantAssetHandler2() = default; + + private: + LoadResult LoadAssetData(const Data::Asset& asset, AZStd::shared_ptr stream, const AZ::Data::AssetFilterCB& assetLoadFilterCB) override; + bool PostLoadInit(const Data::Asset& asset); + }; + + } // namespace RPI + +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/BuilderComponent.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/BuilderComponent.cpp index e3386ebb5c..70752bf02b 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/BuilderComponent.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/BuilderComponent.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#include #include #include @@ -88,6 +90,7 @@ namespace AZ m_assetWorkers.emplace_back(MakeAssetBuilder()); m_assetHandlers.emplace_back(MakeAssetHandler()); + m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); @@ -98,6 +101,7 @@ namespace AZ m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); + m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); m_assetHandlers.emplace_back(MakeAssetHandler()); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp index 7aace50760..3d0cbca8e6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.cpp @@ -18,6 +18,9 @@ #include #include +#include +#include + namespace AZ::RPI { using namespace AZ::SceneAPI; @@ -114,7 +117,7 @@ namespace AZ::RPI meshNodeName, sourceMesh.m_name.GetCStr()); const DataTypes::MatrixType globalTransform = Utilities::BuildWorldTransform(sceneGraph, sceneNodeIndex); - BuildMorphTargetMesh(vertexOffset, sourceMesh, productMesh, metaAssetCreator, blendShapeName, blendShapeData, globalTransform, coordSysConverter); + BuildMorphTargetMesh(vertexOffset, sourceMesh, productMesh, metaAssetCreator, blendShapeName, blendShapeData, globalTransform, coordSysConverter, scene.GetSourceFilename()); } } } @@ -157,7 +160,8 @@ namespace AZ::RPI const AZStd::string& blendShapeName, const AZStd::shared_ptr& blendShapeData, const DataTypes::MatrixType& globalTransform, - const AZ::SceneAPI::CoordinateSystemConverter& coordSysConverter) + const AZ::SceneAPI::CoordinateSystemConverter& coordSysConverter, + const AZStd::string& sourceSceneFilename) { const float tolerance = CalcPositionDeltaTolerance(sourceMesh); AZ::Aabb deltaPositionAabb = AZ::Aabb::CreateNull(); @@ -288,6 +292,8 @@ namespace AZ::RPI metaData.m_maxPositionDelta = maxValue; } + metaData.m_wrinkleMask = GetWrinkleMask(sourceSceneFilename, blendShapeName); + metaAssetCreator.AddMorphTarget(metaData); AZ_Assert(uncompressedPositionDeltas.size() == compressedDeltas.size(), "Number of uncompressed (%d) and compressed position delta components (%d) do not match.", @@ -312,4 +318,47 @@ namespace AZ::RPI AZ_Assert((packedCompressedMorphTargetVertexData.size() - metaData.m_startIndex) == numMorphedVertices, "Vertex index range (%d) in morph target meta data does not match number of morphed vertices (%d).", packedCompressedMorphTargetVertexData.size() - metaData.m_startIndex, numMorphedVertices); } + + Data::Asset MorphTargetExporter::GetWrinkleMask(const AZStd::string& sourceSceneFullFilePath, const AZStd::string& blendShapeName) const + { + AZ::Data::Asset imageAsset; + + // See if there is a wrinkle map mask for this mesh + AZStd::string sceneRelativeFilePath; + bool relativePathFound = true; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(relativePathFound, &AzToolsFramework::AssetSystemRequestBus::Events::GetRelativeProductPathFromFullSourceOrProductPath, sourceSceneFullFilePath, sceneRelativeFilePath); + + if (relativePathFound) + { + AZ::StringFunc::Path::StripFullName(sceneRelativeFilePath); + + // Get the folder the masks are supposed to be in + AZStd::string folderName; + AZ::StringFunc::Path::GetFileName(sourceSceneFullFilePath.c_str(), folderName); + folderName += "_wrinklemasks"; + + // Note: for now, we're assuming the mask is always authored as a .tif + AZStd::string blendMaskFileName = blendShapeName + "_wrinklemask.tif.streamingimage"; + + AZStd::string maskFolderAndFile; + AZ::StringFunc::Path::Join(folderName.c_str(), blendMaskFileName.c_str(), maskFolderAndFile); + + AZStd::string maskRelativePath; + AZ::StringFunc::Path::Join(sceneRelativeFilePath.c_str(), maskFolderAndFile.c_str(), maskRelativePath); + AZ::StringFunc::Path::Normalize(maskRelativePath); + + // Now see if the file exists + AZ::Data::AssetId maskAssetId; + Data::AssetCatalogRequestBus::BroadcastResult(maskAssetId, &Data::AssetCatalogRequests::GetAssetIdByPath, maskRelativePath.c_str(), AZ::Data::s_invalidAssetType, false); + + if (maskAssetId.IsValid()) + { + // Flush asset manager events to ensure no asset references are held by closures queued on Ebuses. + AZ::Data::AssetManager::Instance().DispatchEvents(); + + imageAsset.Create(maskAssetId, AZ::Data::AssetLoadBehavior::PreLoad, false); + } + } + return imageAsset; + } } // namespace AZ::RPI diff --git a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.h b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.h index d968a803d6..4845d7d1da 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.h +++ b/Gems/Atom/RPI/Code/Source/RPI.Builders/Model/MorphTargetExporter.h @@ -64,7 +64,11 @@ namespace AZ const AZStd::string& blendShapeName, const AZStd::shared_ptr& blendShapeData, const AZ::SceneAPI::DataTypes::MatrixType& globalTransform, - const AZ::SceneAPI::CoordinateSystemConverter& coordSysConverter); + const AZ::SceneAPI::CoordinateSystemConverter& coordSysConverter, + const AZStd::string& sourceSceneFilename); + + // Find a wrinkle mask for this morph target, if it exists + Data::Asset GetWrinkleMask(const AZStd::string& sourceSceneFullFilePath, const AZStd::string& blendShapeName) const; }; } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp index 2ab6ee92e9..109af70166 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -422,7 +422,7 @@ namespace AZ const MaterialPropertyDescriptor* propertyDescriptor = materialTypeAssetCreator.GetMaterialPropertiesLayout()->GetPropertyDescriptor(propertyIndex); AZ::Name enumName = AZ::Name(property.m_value.GetValue()); - uint32_t enumValue = propertyDescriptor->GetEnumValue(enumName); + uint32_t enumValue = propertyDescriptor ? propertyDescriptor->GetEnumValue(enumName) : MaterialPropertyDescriptor::InvalidEnumValue; if (enumValue == MaterialPropertyDescriptor::InvalidEnumValue) { materialTypeAssetCreator.ReportError("Enum value '%s' couldn't be found in the 'enumValues' list", enumName.GetCStr()); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp index e67480e6f9..376399ff84 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderSourceData.cpp @@ -11,19 +11,21 @@ */ #include +#include +#include +#include +#include namespace AZ { namespace RPI { - const char* ShaderSourceData::Extension = "shader"; - void ShaderSourceData::Reflect(ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(3) + ->Version(4) ->Field("Source", &ShaderSourceData::m_source) ->Field("DrawList", &ShaderSourceData::m_drawListName) ->Field("DepthStencilState", &ShaderSourceData::m_depthStencilState) @@ -31,8 +33,8 @@ namespace AZ ->Field("BlendState", &ShaderSourceData::m_blendState) ->Field("ProgramSettings", &ShaderSourceData::m_programSettings) ->Field("CompilerHints", &ShaderSourceData::m_compiler) - ->Field("ShaderVariantHints", &ShaderSourceData::m_shaderOptionGroupHints) ->Field("DisabledRHIBackends", &ShaderSourceData::m_disabledRhiBackends) + ->Field("Supervariants", &ShaderSourceData::m_supervariants) ; serializeContext->Class() @@ -45,15 +47,126 @@ namespace AZ ->Field("Name", &EntryPoint::m_name) ->Field("Type", &EntryPoint::m_type) ; + + serializeContext->Class() + ->Version(1) + ->Field("Name", &SupervariantInfo::m_name) + ->Field("PlusArguments", &SupervariantInfo::m_plusArguments) + ->Field("MinusArguments", &SupervariantInfo::m_minusArguments); + } } - bool ShaderSourceData::IsRhiBackendDisabled(const AZ::Name& rhiName) + bool ShaderSourceData::IsRhiBackendDisabled(const AZ::Name& rhiName) const { - return AZStd::any_of(m_disabledRhiBackends.begin(), m_disabledRhiBackends.end(), [&](const AZStd::string& currentRhiName) + return AZStd::any_of(AZ_BEGIN_END(m_disabledRhiBackends), [&](const AZStd::string& currentRhiName) { return currentRhiName == rhiName.GetStringView(); }); } + + + //! Helper function. + //! Parses a string of command line arguments looking for c-preprocessor macro definitions and appends the name of macro definition arguments. + //! Example: + //! Input string: "--switch1 -DMACRO1 -v -DMACRO2=23" + //! append the following items: ["MACRO1", "MACRO2"] + static void GetListOfMacroDefinitionNames( + const AZStd::string& stringWithArguments, AZStd::vector& macroDefinitionNames) + { + const AZStd::regex macroRegex(R"(-D\s*(\w+))", AZStd::regex::ECMAScript); + + AZStd::string hayStack(stringWithArguments); + AZStd::smatch match; + while (AZStd::regex_search(hayStack.c_str(), match, macroRegex)) + { + // First pattern is always the entire string + for (unsigned i = 1; i < match.size(); ++i) + { + if (match[i].matched) + { + AZStd::string macroToAdd(match[i].str().c_str()); + const bool isPresent = AZStd::any_of(AZ_BEGIN_END(macroDefinitionNames), + [&](AZStd::string_view macroName) -> bool + { + return macroToAdd == macroName; + } + ); + if (isPresent) + { + continue; + } + macroDefinitionNames.push_back(macroToAdd); + } + } + hayStack = match.suffix(); + } + } + + AZStd::vector ShaderSourceData::SupervariantInfo::GetCombinedListOfMacroDefinitionNamesToRemove() const + { + AZStd::vector macroDefinitionNames; + GetListOfMacroDefinitionNames(m_minusArguments, macroDefinitionNames); + GetListOfMacroDefinitionNames(m_plusArguments, macroDefinitionNames); + return macroDefinitionNames; + } + + + //! Helper function. + //! Parses a string of command line arguments looking for c-preprocessor macro definitions and appends macro definition + //! arguments. Example: Input string: "--switch1 -DMACRO1 -v -DMACRO2=23" append the following items: ["MACRO1", "MACRO2=23"] + static void GetListOfMacroDefinitions( + const AZStd::string& stringWithArguments, AZStd::vector& macroDefinitions) + { + const AZStd::regex macroRegex(R"(-D\s*(\w+)(=\w+)?)", AZStd::regex::ECMAScript); + + AZStd::string hayStack(stringWithArguments); + AZStd::smatch match; + while (AZStd::regex_search(hayStack.c_str(), match, macroRegex)) + { + if (match.size() > 1) + { + AZStd::string macro(match[1].str().c_str()); + if (match.size() > 2) + { + macro += match[2].str().c_str(); + } + macroDefinitions.push_back(macro); + } + hayStack = match.suffix(); + } + } + + AZStd::vector ShaderSourceData::SupervariantInfo::GetMacroDefinitionsToAdd() const + { + AZStd::vector parsedMacroDefinitions; + GetListOfMacroDefinitions(m_plusArguments, parsedMacroDefinitions); + return parsedMacroDefinitions; + } + + AZStd::string ShaderSourceData::SupervariantInfo::GetCustomizedArgumentsForAzslc( + const AZStd::string& initialAzslcCompilerArguments) const + { + const AZStd::regex macroRegex(R"(-D\s*(\w+(=\S+)?))", AZStd::regex::ECMAScript); + + // We are only concerned with AZSLc arguments. Let's remove the C-Preprocessor macro definitions + // from @minusArguments. + const AZStd::string minusArguments = AZStd::regex_replace(m_minusArguments, macroRegex, ""); + const AZStd::string plusArguments = AZStd::regex_replace(m_plusArguments, macroRegex, ""); + AZStd::string azslcArgumentsToRemove = minusArguments + " " + plusArguments; + AZStd::vector azslcArgumentNamesToRemove = RHI::CommandLineArgumentUtils::GetListOfArgumentNames(azslcArgumentsToRemove); + + // At this moment @azslcArgumentsToRemove contains arguments for AZSLc that can be of the form: + // - + // --[=] + // We need to remove those from @initialAzslcCompilerArguments. + AZStd::string customizedArguments = RHI::CommandLineArgumentUtils::RemoveArgumentsFromCommandLineString( + azslcArgumentNamesToRemove, initialAzslcCompilerArguments); + customizedArguments += " " + plusArguments; + + return RHI::CommandLineArgumentUtils::RemoveExtraSpaces(customizedArguments); + } + + } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderVariantAssetCreator2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderVariantAssetCreator2.cpp new file mode 100644 index 0000000000..2936ed50f9 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Edit/Shader/ShaderVariantAssetCreator2.cpp @@ -0,0 +1,112 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include + +#include + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + void ShaderVariantAssetCreator2::Begin(const AZ::Data::AssetId& assetId, const ShaderVariantId& shaderVariantId, RPI::ShaderVariantStableId stableId, bool isFullyBaked) + { + BeginCommon(assetId); + + if (ValidateIsReady()) + { + m_asset->m_stableId = stableId; + m_asset->m_shaderVariantId = shaderVariantId; + m_asset->m_isFullyBaked = isFullyBaked; + } + } + + bool ShaderVariantAssetCreator2::End(Data::Asset& result) + { + if (!ValidateIsReady()) + { + return false; + } + + if (!m_asset->FinalizeAfterLoad()) + { + ReportError("Failed to finalize the ShaderResourceGroupAsset."); + return false; + } + + bool foundDrawFunctions = false; + bool foundDispatchFunctions = false; + + if (m_asset->GetShaderStageFunction(RHI::ShaderStage::Vertex) || + m_asset->GetShaderStageFunction(RHI::ShaderStage::Tessellation) || + m_asset->GetShaderStageFunction(RHI::ShaderStage::Fragment)) + { + foundDrawFunctions = true; + } + + if (m_asset->GetShaderStageFunction(RHI::ShaderStage::Compute)) + { + foundDispatchFunctions = true; + } + + + if (foundDrawFunctions && foundDispatchFunctions) + { + ReportError("ShaderVariant contains both Draw functions and Dispatch functions."); + return false; + } + + if (m_asset->GetShaderStageFunction(RHI::ShaderStage::Fragment) && + !m_asset->GetShaderStageFunction(RHI::ShaderStage::Vertex)) + { + ReportError("Shader Variant with StableId '%u' has a fragment function but no vertex function.", m_asset->m_stableId); + return false; + } + + if (m_asset->GetShaderStageFunction(RHI::ShaderStage::Tessellation) && + !m_asset->GetShaderStageFunction(RHI::ShaderStage::Vertex)) + { + ReportError("Shader Variant with StableId '%u' has a tessellation function but no vertex function.", m_asset->m_stableId); + return false; + } + + + + m_asset->SetReady(); + return EndCommon(result); + } + + + ///////////////////////////////////////////////////////////////////// + // Methods for all shader variant types + + void ShaderVariantAssetCreator2::SetBuildTimestamp(AZStd::sys_time_t buildTimestamp) + { + if (ValidateIsReady()) + { + m_asset->m_buildTimestamp = buildTimestamp; + } + } + + void ShaderVariantAssetCreator2::SetShaderFunction(RHI::ShaderStage shaderStage, RHI::Ptr shaderStageFunction) + { + if (ValidateIsReady()) + { + m_asset->m_functionsByStage[static_cast(shaderStage)] = shaderStageFunction; + } + } + + } // namespace RPI +} // namespace AZ 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 b7ba7d4a32..4e4a7a5e71 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/DynamicDraw/DynamicDrawContext.cpp @@ -211,6 +211,42 @@ namespace AZ m_rhiPipelineState = m_pipelineState->GetRHIPipelineState(); } + void DynamicDrawContext::SetScene(Scene* scene) + { + AZ_Assert(scene, "SetScene called with an invalid scene"); + if (!scene || m_scene == scene) + { + return; + } + m_scene = scene; + m_drawFilter = RHI::DrawFilterMaskDefaultValue; + // Reinitialize if it was initialized + if (m_initialized) + { + // Report warning if there were some draw data + AZ_Warning( + "DynamicDrawContext", m_cachedDrawItems.size() == 0, + "DynamicDrawContext::SetForScene should be called" + " when there is no cached draw data"); + // Clear some cached data + FrameEnd(); + m_cachedRhiPipelineStates.clear(); + // Reinitialize + EndInit(); + } + } + + void DynamicDrawContext::SetRenderPipeline(RenderPipeline* pipeline) + { + AZ_Assert(pipeline, "SetRenderPipeline called with an invalid pipeline"); + if (!pipeline) + { + return; + } + SetScene(pipeline->GetScene()); + m_drawFilter = pipeline->GetDrawFilterMask(); + } + bool DynamicDrawContext::IsReady() { return m_initialized; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/Query.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/Query.cpp index 227e096594..1d6e8cdc65 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/Query.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/GpuQuery/Query.cpp @@ -96,12 +96,6 @@ namespace AZ return QueryResultCode::Fail; } - // Limit calling BeginQuery() to the first CommandList in the array. - if (context.GetCommandListIndex() != 0) - { - return QueryResultCode::Success; - } - const auto rhiQueryIndices = GetRhiQueryIndicesFromCurrentFrame(); if (!rhiQueryIndices) { @@ -124,12 +118,6 @@ namespace AZ return QueryResultCode::Fail; } - // Limit calling EndQuery() to the last CommandList in the array. - if (context.GetCommandListIndex() != context.GetCommandListCount() - 1) - { - return QueryResultCode::Success; - } - // Validate that the queries are recorded for the same scope. if (m_cachedScopeId != context.GetScopeId()) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/MaterialSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/MaterialSystem.cpp index e7e04b271d..f1751a02e2 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Material/MaterialSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Material/MaterialSystem.cpp @@ -32,6 +32,7 @@ namespace AZ MaterialPropertiesLayout::Reflect(context); MaterialFunctor::Reflect(context); LuaMaterialFunctor::Reflect(context); + ReflectMaterialDynamicMetadata(context); } void MaterialSystem::GetAssetHandlers(AssetHandlerPtrList& assetHandlers) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp index d0a277304e..b1265b1228 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/MeshDrawPacket.cpp @@ -169,7 +169,7 @@ namespace AZ const AZ::Data::Asset& drawSrgAsset = shader->GetAsset()->GetDrawSrgAsset(); // Set all unspecified shader options to default values, so that we get the most specialized variant possible. - // (because FindVariantStableId treats unspecified options as a request specificlly for a variant that doesn't specify those options) + // (because FindVariantStableId treats unspecified options as a request specifically for a variant that doesn't specify those options) // [GFX TODO][ATOM-3883] We should consider updating the FindVariantStableId algorithm to handle default values for us, and remove this step here. RPI::ShaderOptionGroup shaderOptions = *shaderItem.GetShaderOptions(); shaderOptions.SetUnspecifiedToDefaultValues(); @@ -198,6 +198,31 @@ namespace AZ const ShaderVariantId finalVariantId = shaderOptions.GetShaderVariantId(); const ShaderVariant& variant = r_forceRootShaderVariantUsage ? shader->GetRootVariant() : shader->GetVariant(finalVariantId); + RHI::PipelineStateDescriptorForDraw pipelineStateDescriptor; + variant.ConfigurePipelineState(pipelineStateDescriptor); + + // Render states need to merge the runtime variation. + // This allows materials to customize the render states that the shader uses. + const RHI::RenderStates& renderStatesOverlay = *shaderItem.GetRenderStatesOverlay(); + RHI::MergeStateInto(renderStatesOverlay, pipelineStateDescriptor.m_renderStates); + + streamBufferViewsPerShader.push_back(); + auto& streamBufferViews = streamBufferViewsPerShader.back(); + + UvStreamTangentBitmask uvStreamTangentBitmask; + + if (!m_modelLod->GetStreamsForMesh( + pipelineStateDescriptor.m_inputStreamLayout, + streamBufferViews, + &uvStreamTangentBitmask, + variant.GetInputContract(), + m_modelLodMeshIndex, + m_materialModelUvMap, + m_material->GetAsset()->GetMaterialTypeAsset()->GetUvNameMap())) + { + return false; + } + Data::Instance drawSrg; if (drawSrgAsset) { @@ -210,31 +235,20 @@ namespace AZ drawSrg->SetShaderVariantKeyFallbackValue(shaderOptions.GetShaderVariantKeyFallbackValue()); } + // Pass UvStreamTangentBitmask to the shader if the draw SRG has it. + { + AZ::Name shaderUvStreamTangentBitmask = AZ::Name(UvStreamTangentBitmask::SrgName); + auto index = drawSrg->FindShaderInputConstantIndex(shaderUvStreamTangentBitmask); + + if (index.IsValid()) + { + drawSrg->SetConstant(index, uvStreamTangentBitmask.GetFullTangentBitmask()); + } + } + drawSrg->Compile(); } - RHI::PipelineStateDescriptorForDraw pipelineStateDescriptor; - variant.ConfigurePipelineState(pipelineStateDescriptor); - - // Render states need to merge the runtime variation. - // This allows materials to customize the render states that the shader uses. - const RHI::RenderStates& renderStatesOverlay = *shaderItem.GetRenderStatesOverlay(); - RHI::MergeStateInto(renderStatesOverlay, pipelineStateDescriptor.m_renderStates); - - streamBufferViewsPerShader.push_back(); - auto& streamBufferViews = streamBufferViewsPerShader.back(); - - if (!m_modelLod->GetStreamsForMesh( - pipelineStateDescriptor.m_inputStreamLayout, - streamBufferViews, - variant.GetInputContract(), - m_modelLodMeshIndex, - m_materialModelUvMap, - m_material->GetAsset()->GetMaterialTypeAsset()->GetUvNameMap())) - { - return false; - } - // Use the default draw list tag from the shader variant. RHI::DrawListTag drawListTag = shader->GetDrawListTag(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp index 8747dac663..c6a1a51f39 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/ModelLod.cpp @@ -117,6 +117,17 @@ namespace AZ return RHI::ResultCode::Success; } + ModelLod::StreamInfoList::const_iterator ModelLod::FindFirstUvStreamFromMesh(size_t meshIndex) const + { + const Mesh& mesh = m_meshes[meshIndex]; + + auto firstUv = AZStd::find_if(mesh.m_streamInfo.begin(), mesh.m_streamInfo.end(), [](const StreamBufferInfo& info) { + return info.m_semantic.m_name.GetStringView().starts_with(RHI::ShaderSemantic::UvStreamSemantic); + }); + + return firstUv; + } + ModelLod::StreamInfoList::const_iterator ModelLod::FindDefaultUvStream(size_t meshIndex, const MaterialUvNameMap& materialUvNameMap) const { const Mesh& mesh = m_meshes[meshIndex]; @@ -160,7 +171,9 @@ namespace AZ const MaterialModelUvOverrideMap& materialModelUvMap, const MaterialUvNameMap& materialUvNameMap, const ShaderInputContract::StreamChannelInfo& contractStreamChannel, - StreamInfoList::const_iterator defaultUv) const + StreamInfoList::const_iterator defaultUv, + StreamInfoList::const_iterator firstUv, + UvStreamTangentBitmask* uvStreamTangentBitmaskOut) const { const Mesh& mesh = m_meshes[meshIndex]; auto iter = mesh.m_streamInfo.end(); @@ -184,8 +197,8 @@ namespace AZ // Cost of linear search UV names is low because the size is extremely limited. return uvNamePair.m_shaderInput == contractStreamChannel.m_semantic; }); - const bool IsUv = materialUvIter != materialUvNameMap.end(); - if (IsUv) + const bool isUv = materialUvIter != materialUvNameMap.end(); + if (isUv) { const AZ::Name& materialUvName = materialUvIter->m_uvName; auto modelUvMapIter = materialModelUvMap.find(materialUvIter->m_shaderInput); @@ -224,17 +237,23 @@ namespace AZ }); } - if (iter == mesh.m_streamInfo.end() && IsUv) + if (iter == mesh.m_streamInfo.end() && isUv) { iter = defaultUv; } + if (isUv && uvStreamTangentBitmaskOut) + { + uvStreamTangentBitmaskOut->ApplyTangent(iter == firstUv ? 0 : UvStreamTangentBitmask::UnassignedTangent); + } + return iter; } bool ModelLod::GetStreamsForMesh( RHI::InputStreamLayout& layoutOut, StreamBufferViewList& streamBufferViewsOut, + UvStreamTangentBitmask* uvStreamTangentBitmaskOut, const ShaderInputContract& contract, size_t meshIndex, const MaterialModelUvOverrideMap& materialModelUvMap, @@ -250,11 +269,17 @@ namespace AZ bool success = true; + // Searching for the first UV in the mesh, so it can be used to paired with tangent/bitangent stream + auto firstUv = FindFirstUvStreamFromMesh(meshIndex); auto defaultUv = FindDefaultUvStream(meshIndex, materialUvNameMap); + if (uvStreamTangentBitmaskOut) + { + uvStreamTangentBitmaskOut->Reset(); + } for (auto& contractStreamChannel : contract.m_streamChannels) { - auto iter = FindMatchingStream(meshIndex, materialModelUvMap, materialUvNameMap, contractStreamChannel, defaultUv); + auto iter = FindMatchingStream(meshIndex, materialModelUvMap, materialUvNameMap, contractStreamChannel, defaultUv, firstUv, uvStreamTangentBitmaskOut); if (iter == mesh.m_streamInfo.end()) { @@ -340,6 +365,7 @@ namespace AZ const Mesh& mesh = m_meshes[meshIndex]; auto defaultUv = FindDefaultUvStream(meshIndex, materialUvNameMap); + auto firstUv = FindFirstUvStreamFromMesh(meshIndex); for (auto& contractStreamChannel : contract.m_streamChannels) { @@ -350,7 +376,7 @@ namespace AZ AZ_Assert(contractStreamChannel.m_streamBoundIndicatorIndex.IsValid(), "m_streamBoundIndicatorIndex was invalid for an optional shader input stream"); - auto iter = FindMatchingStream(meshIndex, materialModelUvMap, materialUvNameMap, contractStreamChannel, defaultUv); + auto iter = FindMatchingStream(meshIndex, materialModelUvMap, materialUvNameMap, contractStreamChannel, defaultUv, firstUv, nullptr); ShaderOptionValue isStreamBound = (iter == mesh.m_streamInfo.end()) ? ShaderOptionValue{0} : ShaderOptionValue{1}; shaderOptions.SetValue(contractStreamChannel.m_streamBoundIndicatorIndex, isStreamBound); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Model/UvStreamTangentBitmask.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/UvStreamTangentBitmask.cpp new file mode 100644 index 0000000000..829207e406 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Model/UvStreamTangentBitmask.cpp @@ -0,0 +1,71 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace AZ +{ + namespace RPI + { + uint32_t UvStreamTangentBitmask::GetFullTangentBitmask() const + { + return m_mask; + } + + uint32_t UvStreamTangentBitmask::GetUvStreamCount() const + { + return m_mask >> (sizeof(m_mask) * CHAR_BIT - BitsForUvIndex); + } + + uint32_t UvStreamTangentBitmask::GetTangentAtUv(uint32_t uvIndex) const + { + return (m_mask >> (BitsPerTangent * uvIndex)) & 0b1111u; + } + + void UvStreamTangentBitmask::ApplyTangent(uint32_t tangentIndex) + { + uint32_t currentSlot = GetUvStreamCount(); + if (currentSlot >= MaxUvSlots) + { + AZ_Error("UV Stream", false, "Reaching the max of avaiblable stream slots."); + return; + } + + if (tangentIndex > UnassignedTangent) + { + AZ_Warning( + "UV Stream", false, + "Tangent index must use %d bits as defined in UvStreamTangentIndex::m_flag. Unassigned index will be applied.", + BitsPerTangent); + tangentIndex = UnassignedTangent; + } + + uint32_t clearMask = 0b1111u << (BitsPerTangent * currentSlot); + clearMask = ~clearMask; + + // Clear the writing bits in case + m_mask &= clearMask; + + // Write the bits to the slot + m_mask |= (tangentIndex << (BitsPerTangent * currentSlot)); + + // Increase the index + m_mask += (1u << (sizeof(m_mask) * CHAR_BIT - BitsForUvIndex)); + } + + void UvStreamTangentBitmask::Reset() + { + m_mask = 0; + } + } +} diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp index 9401d1a9e0..8d613eb2bb 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/Pass.cpp @@ -93,6 +93,7 @@ namespace AZ void Pass::SetEnabled(bool enabled) { m_flags.m_enabled = enabled; + OnHierarchyChange(); } bool Pass::IsEnabled() const @@ -140,6 +141,7 @@ namespace AZ } // Set new tree depth and path + m_flags.m_parentEnabled = m_parent->m_flags.m_enabled && (m_parent->m_flags.m_parentEnabled || m_parent->m_parent == nullptr); m_treeDepth = m_parent->m_treeDepth + 1; m_path = ConcatPassName(m_parent->m_path, m_name); m_flags.m_partOfHierarchy = m_parent->m_flags.m_partOfHierarchy; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp index 1fad385fa6..3a2a556429 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Pass/RenderPass.cpp @@ -163,6 +163,11 @@ namespace AZ binding.m_shaderInputIndex = idx.IsValid() ? static_cast(idx.GetIndex()) : PassAttachmentBinding::ShaderInputNoBind; } } + else + { + AZ_Error("Pass System", false, "[Pass %s] Could not bind shader buffer index '%s' because it has no attachment.", GetName().GetCStr(), shaderName.GetCStr()); + binding.m_shaderInputIndex = PassAttachmentBinding::ShaderInputNoBind; + } } } @@ -337,7 +342,7 @@ namespace AZ } } - ViewPtr RenderPass::GetView() + ViewPtr RenderPass::GetView() const { if (m_flags.m_hasPipelineViewTag && m_pipeline) { @@ -517,8 +522,11 @@ namespace AZ } }; - ExecuteOnTimestampQuery(beginQuery); - ExecuteOnPipelineStatisticsQuery(beginQuery); + if (context.GetCommandListIndex() == 0) + { + ExecuteOnTimestampQuery(beginQuery); + ExecuteOnPipelineStatisticsQuery(beginQuery); + } } void RenderPass::EndScopeQuery(const RHI::FrameGraphExecuteContext& context) @@ -528,8 +536,23 @@ namespace AZ query->EndQuery(context); }; - ExecuteOnTimestampQuery(endQuery); - ExecuteOnPipelineStatisticsQuery(endQuery); + // This scopy query implmentation should be replaced by + // [ATOM-5407] [RHI][Core] - Add GPU timestamp and pipeline statistic support for scopes + + // For timestamp query, it's okay to execute across different command lists + if (context.GetCommandListIndex() == context.GetCommandListCount() - 1) + { + ExecuteOnTimestampQuery(endQuery); + } + // For all the other types of queries except timestamp, the query start and end has to be in the same command list + // Here only tracks the PipelineStatistics for the first command list due to that we don't know how many queries are + // needed when AddScopeQueryToFrameGraph is called. + // This implementation leads to an issue that we may not get accurate pipeline statistic data + // for passes which were executed with more than one command list + if (context.GetCommandListIndex() == 0) + { + ExecuteOnPipelineStatisticsQuery(endQuery); + } } void RenderPass::ReadbackScopeQueryResults() diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader2.cpp new file mode 100644 index 0000000000..f56a18e2b9 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/Shader2.cpp @@ -0,0 +1,413 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include + +#include + +#include + +#include +#include + +#include + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + Data::Instance Shader2::FindOrCreate(const Data::Asset& shaderAsset, const Name& supervariantName) + { + Data::Instance shaderInstance = Data::InstanceDatabase::Instance().FindOrCreate( + Data::InstanceId::CreateFromAssetId(shaderAsset.GetId()), + shaderAsset); + if (!shaderInstance) + { + return nullptr; + } + + if (!shaderInstance->SelectSupervariant(supervariantName)) + { + return nullptr; + } + + const RHI::ResultCode resultCode = shaderInstance->Init(*shaderAsset.Get()); + if (resultCode != RHI::ResultCode::Success) + { + return nullptr; + } + return shaderInstance; + } + + Data::Instance Shader2::CreateInternal([[maybe_unused]] ShaderAsset2& shaderAsset) + { + Data::Instance shader = aznew Shader2(); + return shader; + } + + Shader2::~Shader2() + { + Shutdown(); + } + + bool Shader2::SelectSupervariant(const Name& supervariantName) + { + if (supervariantName.IsEmpty()) + { + m_supervariantIndex = DefaultSupervariantIndex; + return true; + } + + auto supervariantIndex = m_asset->GetSupervariantIndex(supervariantName); + if (supervariantIndex == InvalidSupervariantIndex) + { + return false; + } + + m_supervariantIndex = supervariantIndex; + return true; + } + + RHI::ResultCode Shader2::Init(ShaderAsset2& shaderAsset) + { + AZ_Assert(m_supervariantIndex != InvalidSupervariantIndex, "Invalid supervariant index"); + + ShaderVariantFinderNotificationBus2::Handler::BusDisconnect(); + ShaderVariantFinderNotificationBus2::Handler::BusConnect(shaderAsset.GetId()); + + RHI::RHISystemInterface* rhiSystem = RHI::RHISystemInterface::Get(); + RHI::DrawListTagRegistry* drawListTagRegistry = rhiSystem->GetDrawListTagRegistry(); + + m_asset = { &shaderAsset, AZ::Data::AssetLoadBehavior::PreLoad }; + m_pipelineStateType = shaderAsset.GetPipelineStateType(); + + { + AZStd::unique_lock lock(m_variantCacheMutex); + m_shaderVariants.clear(); + } + m_rootVariant.Init(shaderAsset, shaderAsset.GetRootVariant(m_supervariantIndex), m_supervariantIndex); + + if (m_pipelineLibraryHandle.IsNull()) + { + // We set up a pipeline library only once for the lifetime of the Shader2 instance. + // This should allow the Shader2 to be reloaded at runtime many times, and cache and reuse PipelineState objects rather than rebuild them. + // It also fixes a particular TDR crash that occurred on some hardware when hot-reloading shaders and building pipeline states + // in a new pipeline library every time. + + RHI::PipelineStateCache* pipelineStateCache = rhiSystem->GetPipelineStateCache(); + ConstPtr serializedData = LoadPipelineLibrary(); + RHI::PipelineLibraryHandle pipelineLibraryHandle = pipelineStateCache->CreateLibrary(serializedData.get()); + + if (pipelineLibraryHandle.IsNull()) + { + AZ_Error("Shader2", false, "Failed to create pipeline library from pipeline state cache."); + return RHI::ResultCode::Fail; + } + + m_pipelineLibraryHandle = pipelineLibraryHandle; + m_pipelineStateCache = pipelineStateCache; + } + + const Name& drawListName = shaderAsset.GetDrawListName(); + if (!drawListName.IsEmpty()) + { + m_drawListTag = drawListTagRegistry->AcquireTag(drawListName); + if (!m_drawListTag.IsValid()) + { + AZ_Error("Shader2", false, "Failed to acquire a DrawListTag. Entries are full."); + } + } + + Data::AssetBus::Handler::BusConnect(m_asset.GetId()); + + return RHI::ResultCode::Success; + } + + void Shader2::Shutdown() + { + ShaderVariantFinderNotificationBus2::Handler::BusDisconnect(); + Data::AssetBus::Handler::BusDisconnect(); + + if (m_pipelineLibraryHandle.IsValid()) + { + SavePipelineLibrary(); + + m_pipelineStateCache->ReleaseLibrary(m_pipelineLibraryHandle); + m_pipelineStateCache = nullptr; + m_pipelineLibraryHandle = {}; + } + + if (m_drawListTag.IsValid()) + { + RHI::DrawListTagRegistry* drawListTagRegistry = RHI::RHISystemInterface::Get()->GetDrawListTagRegistry(); + drawListTagRegistry->ReleaseTag(m_drawListTag); + m_drawListTag.Reset(); + } + } + + /////////////////////////////////////////////////////////////////////// + // AssetBus overrides + void Shader2::OnAssetReloaded(Data::Asset asset) + { + ShaderReloadDebugTracker::ScopedSection reloadSection("Shader2::OnAssetReloaded %s", asset.GetHint().c_str()); + + if (asset->GetId() == m_asset->GetId()) + { + Data::Asset newAsset = { asset.GetAs(), AZ::Data::AssetLoadBehavior::PreLoad }; + AZ_Assert(newAsset, "Reloaded ShaderAsset2 is null"); + + Data::AssetBus::Handler::BusDisconnect(); + Init(*newAsset.Get()); + ShaderReloadNotificationBus2::Event(asset.GetId(), &ShaderReloadNotificationBus2::Events::OnShaderReinitialized, *this); + } + } + /////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + /// ShaderVariantFinderNotificationBus2 overrides + void Shader2::OnShaderVariantAssetReady(Data::Asset shaderVariantAsset, bool isError) + { + AZ_Assert(shaderVariantAsset, "Reloaded ShaderVariantAsset is null"); + const ShaderVariantStableId stableId = shaderVariantAsset->GetStableId(); + const ShaderVariantId& shaderVariantId = shaderVariantAsset->GetShaderVariantId(); + + if (isError) + { + //Remark: We do not assert if the stableId == RootShaderVariantStableId, because we can not trust in the asset data + //on error. so it is possible that on error the stbleId == RootShaderVariantStableId; + if (stableId == RootShaderVariantStableId) + { + return; + } + AZStd::unique_lock lock(m_variantCacheMutex); + m_shaderVariants.erase(stableId); + } + else + { + AZ_Assert(stableId != RootShaderVariantStableId, + "The root variant is expected to be updated by the ShaderAsset2."); + AZStd::unique_lock lock(m_variantCacheMutex); + + auto iter = m_shaderVariants.find(stableId); + if (iter != m_shaderVariants.end()) + { + ShaderVariant2& shaderVariant = iter->second; + + if (!shaderVariant.Init(*m_asset.Get(), shaderVariantAsset, m_supervariantIndex)) + { + AZ_Error("Shader2", false, "Failed to init shaderVariant with StableId=%u", shaderVariantAsset->GetStableId()); + m_shaderVariants.erase(stableId); + } + } + else + { + //This is the first time the shader variant asset comes to life. + ShaderVariant2 newVariant; + newVariant.Init(*m_asset, shaderVariantAsset, m_supervariantIndex); + m_shaderVariants.emplace(stableId, newVariant); + } + } + + //Even if there was an error, the interested parties should be notified. + ShaderReloadNotificationBus2::Event(m_asset.GetId(), &ShaderReloadNotificationBus2::Events::OnShaderVariantReinitialized, *this, shaderVariantId, stableId); + } + /////////////////////////////////////////////////////////////////// + + ConstPtr Shader2::LoadPipelineLibrary() const + { + if (IO::FileIOBase::GetInstance()) + { + return Utils::LoadObjectFromFile(GetPipelineLibraryPath()); + } + return nullptr; + } + + void Shader2::SavePipelineLibrary() const + { + if (auto* fileIOBase = IO::FileIOBase::GetInstance()) + { + RHI::ConstPtr serializedData = m_pipelineStateCache->GetLibrarySerializedData(m_pipelineLibraryHandle); + if (serializedData) + { + const AZStd::string pipelineLibraryPath = GetPipelineLibraryPath(); + + char pipelineLibraryPathResolved[AZ_MAX_PATH_LEN] = { 0 }; + fileIOBase->ResolvePath(pipelineLibraryPath.c_str(), pipelineLibraryPathResolved, AZ_MAX_PATH_LEN); + Utils::SaveObjectToFile(pipelineLibraryPathResolved, DataStream::ST_BINARY, serializedData.get()); + } + } + else + { + AZ_Error("Shader2", false, "FileIOBase is not initialized"); + } + } + + AZStd::string Shader2::GetPipelineLibraryPath() const + { + const Data::InstanceId& instanceId = GetId(); + Name platformName = RHI::Factory::Get().GetName(); + Name shaderName = m_asset->GetName(); + + AZStd::string uuidString; + instanceId.m_guid.ToString(uuidString, false, false); + + return AZStd::string::format("@user@/Atom/PipelineStateCache/%s/%s_%s_%d.bin", platformName.GetCStr(), shaderName.GetCStr(), uuidString.data(), instanceId.m_subId); + } + + ShaderOptionGroup Shader2::CreateShaderOptionGroup() const + { + return ShaderOptionGroup(m_asset->GetShaderOptionGroupLayout()); + } + + const ShaderVariant2& Shader2::GetVariant(const ShaderVariantId& shaderVariantId) + { + AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + Data::Asset shaderVariantAsset = m_asset->GetVariant(shaderVariantId, m_supervariantIndex); + if (!shaderVariantAsset || shaderVariantAsset->IsRootVariant()) + { + return m_rootVariant; + } + + return GetVariant(shaderVariantAsset->GetStableId()); + } + + const ShaderVariant2& Shader2::GetRootVariant() + { + return m_rootVariant; + } + + ShaderVariantSearchResult Shader2::FindVariantStableId(const ShaderVariantId& shaderVariantId) const + { + AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + ShaderVariantSearchResult variantSearchResult = m_asset->FindVariantStableId(shaderVariantId); + return variantSearchResult; + } + + const ShaderVariant2& Shader2::GetVariant(ShaderVariantStableId shaderVariantStableId) + { + AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + + if (!shaderVariantStableId.IsValid() || shaderVariantStableId == ShaderAsset2::RootShaderVariantStableId) + { + return m_rootVariant; + } + + { + AZStd::shared_lock lock(m_variantCacheMutex); + + auto findIt = m_shaderVariants.find(shaderVariantStableId); + if (findIt != m_shaderVariants.end()) + { + // When rebuilding shaders we may be in a state where the ShaderAsset2 and root ShaderVariantAsset have been rebuilt and + // reloaded, but some (or all) shader variants haven't been built yet. Since we want to use the latest version of the + // shader code, ignore the old variants and fall back to the newer root variant instead. There's no need to report a + // warning here because m_asset->GetVariant below will report one. + if (findIt->second.GetBuildTimestamp() >= m_asset->GetShaderAssetBuildTimestamp()) + { + return findIt->second; + } + } + } + + // By calling GetVariant, an asynchronous asset load request is enqueued if the variant + // is not fully ready. + Data::Asset shaderVariantAsset = m_asset->GetVariant(shaderVariantStableId, m_supervariantIndex); + if (!shaderVariantAsset || shaderVariantAsset == m_asset->GetRootVariant()) + { + // Return the root variant when the requested variant is not ready. + return m_rootVariant; + } + + AZStd::unique_lock lock(m_variantCacheMutex); + + // For performance reasons We are breaking this function into two locking steps. + // which means We must check again if the variant is already in the cache. + auto findIt = m_shaderVariants.find(shaderVariantStableId); + if (findIt != m_shaderVariants.end()) + { + if (findIt->second.GetBuildTimestamp() >= m_asset->GetShaderAssetBuildTimestamp()) + { + return findIt->second; + } + else + { + // This is probably very rare, but if the variant was loaded on another thread and it's out of date + // we just return the root variant. Otherwise we could end up replacing the variant in the map below while + // it's being used for rendering. + AZ_Warning( + "Shader2", false, + "Detected an uncommon state during shader reload. Returning the root variant instead of replacing the old one."); + return m_rootVariant; + } + } + + ShaderVariant2 newVariant; + newVariant.Init(*m_asset, shaderVariantAsset, m_supervariantIndex); + m_shaderVariants.emplace(shaderVariantStableId, newVariant); + + return m_shaderVariants.at(shaderVariantStableId); + } + + RHI::PipelineStateType Shader2::GetPipelineStateType() const + { + return m_pipelineStateType; + } + + const ShaderInputContract& Shader2::GetInputContract() const + { + return m_asset->GetInputContract(m_supervariantIndex); + } + + const ShaderOutputContract& Shader2::GetOutputContract() const + { + return m_asset->GetOutputContract(m_supervariantIndex); + } + + const RHI::PipelineState* Shader2::AcquirePipelineState(const RHI::PipelineStateDescriptor& descriptor) const + { + return m_pipelineStateCache->AcquirePipelineState(m_pipelineLibraryHandle, descriptor); + } + + const RHI::Ptr Shader2::FindShaderResourceGroupLayout(const Name& shaderResourceGroupName) const + { + return m_asset->FindShaderResourceGroupLayout(shaderResourceGroupName, m_supervariantIndex); + } + + const RHI::Ptr Shader2::FindShaderResourceGroupLayout(uint32_t bindingSlot) const + { + return m_asset->FindShaderResourceGroupLayout(bindingSlot, m_supervariantIndex); + } + + const RHI::Ptr Shader2::FindFallbackShaderResourceGroupLayout() const + { + return m_asset->FindFallbackShaderResourceGroupLayout(m_supervariantIndex); + } + + AZStd::array_view> Shader2::GetShaderResourceGroupLayouts() const + { + return m_asset->GetShaderResourceGroupLayouts(m_supervariantIndex); + } + + const Data::Asset& Shader2::GetAsset() const + { + return m_asset; + } + + RHI::DrawListTag Shader2::GetDrawListTag() const + { + return m_drawListTag; + } + } // namespace RPI +} // namespace AZ 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 77ea0b9494..86cb3cd0a4 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderResourceGroup.cpp @@ -88,6 +88,41 @@ namespace AZ return RHI::ResultCode::Success; } + bool ShaderResourceGroup::ReplaceSrgLayoutUsingShaderAsset( + Data::Asset shaderAsset, const Name& supervariantName, const Name& srgName) + { + AZ_TRACE_METHOD(); + + SupervariantIndex supervariantIndex = shaderAsset->GetSupervariantIndex(supervariantName); + if (supervariantIndex == InvalidSupervariantIndex) + { + AZ_Assert( + false, "Supervariant with name [%s] not found in shader asset [%s]", supervariantName.GetCStr(), + shaderAsset->GetName().GetCStr()); + return false; + } + + m_layout = shaderAsset->FindShaderResourceGroupLayout(srgName, supervariantIndex).get(); + + if (!m_layout) + { + AZ_Assert(false, "ShaderResourceGroup cannot be initialized due to invalid ShaderResourceGroupLayout"); + return false; + } + + m_shaderResourceGroup->SetName(m_layout->GetName()); + m_data = RHI::ShaderResourceGroupData(m_layout); + m_shaderAsset = shaderAsset; + + // The RPI groups match the same dimensions as the RHI group. + m_imageGroup.clear(); + m_imageGroup.resize(m_layout->GetGroupSizeForImages()); + m_bufferGroup.clear(); + m_bufferGroup.resize(m_layout->GetGroupSizeForBuffers()); + + return true; + } + void ShaderResourceGroup::Compile() { m_shaderResourceGroup->Compile(m_data); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderSystem.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderSystem.cpp index 1527e81744..b5125ba964 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderSystem.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderSystem.cpp @@ -12,15 +12,18 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include +#include #include #include @@ -42,9 +45,11 @@ namespace AZ ShaderVariantId::Reflect(context); ShaderVariantStableId::Reflect(context); ShaderAsset::Reflect(context); + ShaderAsset2::Reflect(context); ShaderInputContract::Reflect(context); ShaderOutputContract::Reflect(context); ShaderVariantAsset::Reflect(context); + ShaderVariantAsset2::Reflect(context); ShaderVariantTreeAsset::Reflect(context); ReflectShaderStageType(context); PrecompiledShaderAssetSourceData::Reflect(context); @@ -58,8 +63,10 @@ namespace AZ void ShaderSystem::GetAssetHandlers(AssetHandlerPtrList& assetHandlers) { assetHandlers.emplace_back(MakeAssetHandler()); + assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); + assetHandlers.emplace_back(MakeAssetHandler()); assetHandlers.emplace_back(MakeAssetHandler()); } @@ -78,6 +85,14 @@ namespace AZ Data::InstanceDatabase::Create(azrtti_typeid(), handler); } + { + Data::InstanceHandler handler; + handler.m_createFunction = [](Data::AssetData* shaderAsset) { + return Shader2::CreateInternal(*(azrtti_cast(shaderAsset))); + }; + Data::InstanceDatabase::Create(azrtti_typeid(), handler); + } + { Data::InstanceHandler handler; handler.m_createFunction = [](Data::AssetData* srgAsset) @@ -100,6 +115,7 @@ namespace AZ void ShaderSystem::Shutdown() { Data::InstanceDatabase::Destroy(); + Data::InstanceDatabase::Destroy(); Data::InstanceDatabase::Destroy(); Data::InstanceDatabase::Destroy(); Interface::Unregister(this); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariant2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariant2.cpp new file mode 100644 index 0000000000..d25b87fab3 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariant2.cpp @@ -0,0 +1,76 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include + +#include +#include + +#include + +namespace AZ +{ + namespace RPI + { + bool ShaderVariant2::Init( + const ShaderAsset2& shaderAsset, + Data::Asset shaderVariantAsset, + SupervariantIndex supervariantIndex) + { + m_pipelineStateType = shaderAsset.GetPipelineStateType(); + m_pipelineLayoutDescriptor = shaderAsset.GetPipelineLayoutDescriptor(supervariantIndex); + m_shaderVariantAsset = shaderVariantAsset; + m_renderStates = &shaderAsset.GetRenderStates(supervariantIndex); + return true; + } + + void ShaderVariant2::ConfigurePipelineState(RHI::PipelineStateDescriptor& descriptor) const + { + descriptor.m_pipelineLayoutDescriptor = m_pipelineLayoutDescriptor; + + switch (descriptor.GetType()) + { + case RHI::PipelineStateType::Draw: + { + AZ_Assert(m_pipelineStateType == RHI::PipelineStateType::Draw, "ShaderVariant2 is not intended for the raster pipeline."); + AZ_Assert(m_renderStates, "Invalid RenderStates"); + RHI::PipelineStateDescriptorForDraw& descriptorForDraw = static_cast(descriptor); + descriptorForDraw.m_vertexFunction = m_shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Vertex); + descriptorForDraw.m_tessellationFunction = m_shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Tessellation); + descriptorForDraw.m_fragmentFunction = m_shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Fragment); + descriptorForDraw.m_renderStates = *m_renderStates; + break; + } + + case RHI::PipelineStateType::Dispatch: + { + AZ_Assert(m_pipelineStateType == RHI::PipelineStateType::Dispatch, "ShaderVariant2 is not intended for the compute pipeline."); + RHI::PipelineStateDescriptorForDispatch& descriptorForDispatch = static_cast(descriptor); + descriptorForDispatch.m_computeFunction = m_shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Compute); + break; + } + + case RHI::PipelineStateType::RayTracing: + { + AZ_Assert(m_pipelineStateType == RHI::PipelineStateType::RayTracing, "ShaderVariant2 is not intended for the ray tracing pipeline."); + RHI::PipelineStateDescriptorForRayTracing& descriptorForRayTracing = static_cast(descriptor); + descriptorForRayTracing.m_rayTracingFunction = m_shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::RayTracing); + break; + } + + default: + AZ_Assert(false, "Unexpected PipelineStateType"); + break; + } + } + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp index 53bad2f05c..3fc2bbd197 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/Shader/ShaderVariantAsyncLoader.cpp @@ -111,7 +111,7 @@ namespace AZ ShaderMetricsSystem::Get()->RequestShaderVariant(pairItor->m_shaderAsset.Get(), pairItor->m_shaderVariantId, searchResult); uint32_t shaderVariantProductSubId = - ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), searchResult.GetStableId()); + ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), searchResult.GetStableId()); Data::AssetId shaderVariantAssetId(shaderVariantTreeAsset.GetId().m_guid, shaderVariantProductSubId); shaderVariantPendingRequests.insert(shaderVariantAssetId); pairItor = newShaderVariantPendingRequests.erase(pairItor); @@ -150,10 +150,7 @@ namespace AZ } } - if (!shaderVariantTreePendingRequests.empty() || !shaderVariantPendingRequests.empty()) - { - AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(1000)); - } + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(1000)); } } @@ -211,7 +208,7 @@ namespace AZ AZ_Assert(variantStableId != RootShaderVariantStableId, "Root Variants Are Found inside ShaderAssets"); uint32_t shaderVariantProductSubId = - ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId); + ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId); Data::AssetId shaderVariantAssetId(shaderVariantTreeAssetId.m_guid, shaderVariantProductSubId); { AZStd::unique_lock lock(m_mutex); @@ -299,7 +296,7 @@ namespace AZ { AZ_Assert(variantStableId != RootShaderVariantStableId, "Root Variants Are Found inside ShaderAssets"); - uint32_t shaderVariantProductSubId = ShaderVariantAsset::GetAssetSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId); + uint32_t shaderVariantProductSubId = ShaderVariantAsset::MakeAssetProductSubId(RHI::Factory::Get().GetAPIUniqueIndex(), variantStableId); Data::AssetId shaderVariantAssetId(shaderVariantTreeAssetId.m_guid, shaderVariantProductSubId); AZStd::unique_lock lock(m_mutex); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp index 22287238e9..08f8ff0c5e 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Public/ViewportContext.cpp @@ -51,6 +51,8 @@ namespace AZ ViewportContext::~ViewportContext() { + m_aboutToBeDestroyedEvent.Signal(m_id); + AzFramework::WindowNotificationBus::Handler::BusDisconnect(); AzFramework::ViewportRequestBus::Handler::BusDisconnect(); @@ -171,6 +173,21 @@ namespace AZ handler.Connect(m_sceneChangedEvent); } + void ViewportContext::ConnectCurrentPipelineChangedHandler(PipelineChangedEvent::Handler& handler) + { + handler.Connect(m_currentPipelineChangedEvent); + } + + void ViewportContext::ConnectDefaultViewChangedHandler(ViewChangedEvent::Handler& handler) + { + handler.Connect(m_defaultViewChangedEvent); + } + + void ViewportContext::ConnectAboutToBeDestroyedHandler(ViewportIdEvent::Handler& handler) + { + handler.Connect(m_aboutToBeDestroyedEvent); + } + const AZ::Matrix4x4& ViewportContext::GetCameraViewMatrix() const { return GetDefaultView()->GetWorldToViewMatrix(); @@ -214,6 +231,7 @@ namespace AZ m_defaultView = view; UpdatePipelineView(); + m_defaultViewChangedEvent.Signal(view); m_viewMatrixChangedEvent.Signal(view->GetWorldToViewMatrix()); m_projectionMatrixChangedEvent.Signal(view->GetViewToClipMatrix()); @@ -232,6 +250,7 @@ namespace AZ if (!m_currentPipeline) { m_currentPipeline = m_rootScene ? m_rootScene->FindRenderPipelineForWindow(m_windowContext->GetWindowHandle()) : nullptr; + m_currentPipelineChangedEvent.Signal(m_currentPipeline); } if (auto pipeline = GetCurrentPipeline()) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp index 7ab3489666..d6421e1337 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp @@ -63,6 +63,7 @@ namespace AZ behaviorContext->Class(); MaterialPropertyDescriptor::Reflect(behaviorContext); + ReflectMaterialDynamicMetadata(behaviorContext); LuaMaterialFunctorRenderStates::Reflect(behaviorContext); LuaMaterialFunctorShaderItem::Reflect(behaviorContext); @@ -255,7 +256,7 @@ namespace AZ // Specialize for type Image* because that will be more intuitive within Lua. // The script can then check the result for nil without calling "get()". - // For example, "GetMaterialPropertyValue_image(name) == nil" rather than "GetMaterialPropertyValue_image(name):get() == nil" + // For example, "GetMaterialPropertyValue_Image(name) == nil" rather than "GetMaterialPropertyValue_Image(name):get() == nil" template<> Image* LuaMaterialFunctorCommonContext::GetMaterialPropertyValue(const char* name) const { @@ -278,7 +279,7 @@ namespace AZ ->Method("GetMaterialPropertyValue_Vector3", &LuaMaterialFunctorRuntimeContext::GetMaterialPropertyValue) ->Method("GetMaterialPropertyValue_Vector4", &LuaMaterialFunctorRuntimeContext::GetMaterialPropertyValue) ->Method("GetMaterialPropertyValue_Color", &LuaMaterialFunctorRuntimeContext::GetMaterialPropertyValue) - ->Method("GetMaterialPropertyValue_image", &LuaMaterialFunctorRuntimeContext::GetMaterialPropertyValue) + ->Method("GetMaterialPropertyValue_Image", &LuaMaterialFunctorRuntimeContext::GetMaterialPropertyValue) ->Method("SetShaderConstant_bool", &LuaMaterialFunctorRuntimeContext::SetShaderConstant) ->Method("SetShaderConstant_int", &LuaMaterialFunctorRuntimeContext::SetShaderConstant) ->Method("SetShaderConstant_uint", &LuaMaterialFunctorRuntimeContext::SetShaderConstant) @@ -295,6 +296,7 @@ namespace AZ ->Method("GetShaderCount", &LuaMaterialFunctorRuntimeContext::GetShaderCount) ->Method("GetShader", &LuaMaterialFunctorRuntimeContext::GetShader) ->Method("GetShaderByTag", &LuaMaterialFunctorRuntimeContext::GetShaderByTag) + ->Method("HasShaderWithTag", &LuaMaterialFunctorRuntimeContext::HasShaderWithTag) ; } @@ -423,6 +425,11 @@ namespace AZ return LuaMaterialFunctorShaderItem{nullptr}; } } + + bool LuaMaterialFunctorRuntimeContext::HasShaderWithTag(const char* shaderTag) + { + return m_runtimeContextImpl->m_shaderCollection->HasShaderTag(AZ::Name{shaderTag}); + } void LuaMaterialFunctorEditorContext::LuaMaterialFunctorEditorContext::Reflect(BehaviorContext* behaviorContext) { @@ -436,7 +443,7 @@ namespace AZ ->Method("GetMaterialPropertyValue_Vector3", &LuaMaterialFunctorEditorContext::GetMaterialPropertyValue) ->Method("GetMaterialPropertyValue_Vector4", &LuaMaterialFunctorEditorContext::GetMaterialPropertyValue) ->Method("GetMaterialPropertyValue_Color", &LuaMaterialFunctorEditorContext::GetMaterialPropertyValue) - ->Method("GetMaterialPropertyValue_image", &LuaMaterialFunctorEditorContext::GetMaterialPropertyValue) + ->Method("GetMaterialPropertyValue_Image", &LuaMaterialFunctorEditorContext::GetMaterialPropertyValue) ->Method("SetMaterialPropertyVisibility", &LuaMaterialFunctorEditorContext::SetMaterialPropertyVisibility) ->Method("SetMaterialPropertyDescription", &LuaMaterialFunctorEditorContext::SetMaterialPropertyDescription) ->Method("SetMaterialPropertyMinValue_int", &LuaMaterialFunctorEditorContext::SetMaterialPropertyMinValue) @@ -451,6 +458,7 @@ namespace AZ ->Method("SetMaterialPropertySoftMaxValue_int", &LuaMaterialFunctorEditorContext::SetMaterialPropertySoftMaxValue) ->Method("SetMaterialPropertySoftMaxValue_uint", &LuaMaterialFunctorEditorContext::SetMaterialPropertySoftMaxValue) ->Method("SetMaterialPropertySoftMaxValue_float", &LuaMaterialFunctorEditorContext::SetMaterialPropertySoftMaxValue) + ->Method("SetMaterialPropertyGroupVisibility", &LuaMaterialFunctorEditorContext::SetMaterialPropertyGroupVisibility) ; } @@ -524,6 +532,15 @@ namespace AZ return m_editorContextImpl->SetMaterialPropertySoftMaxValue(index, value); } + + bool LuaMaterialFunctorEditorContext::SetMaterialPropertyGroupVisibility(const char* name, MaterialPropertyGroupVisibility visibility) + { + if (m_editorContextImpl) + { + return m_editorContextImpl->SetMaterialPropertyGroupVisibility(Name{m_propertyNamePrefix + name}, visibility); + } + return false; + } bool LuaMaterialFunctorEditorContext::SetMaterialPropertyVisibility(const char* name, MaterialPropertyVisibility visibility) { diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialDynamicMetadata.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialDynamicMetadata.cpp new file mode 100644 index 0000000000..5c8f4ccc02 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialDynamicMetadata.cpp @@ -0,0 +1,50 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace AZ +{ + namespace RPI + { + void ReflectMaterialDynamicMetadata(ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Enum() + ->Value("Enabled", MaterialPropertyVisibility::Enabled) + ->Value("Disabled", MaterialPropertyVisibility::Disabled) + ->Value("Hidden", MaterialPropertyVisibility::Hidden) + ; + + serializeContext->Enum() + ->Value("Enabled", MaterialPropertyGroupVisibility::Enabled) + ->Value("Hidden", MaterialPropertyGroupVisibility::Hidden) + ; + } + + if (auto* behaviorContext = azrtti_cast(context)) + { + behaviorContext + ->Enum<(int)MaterialPropertyVisibility::Enabled>("MaterialPropertyVisibility_Enabled") + ->Enum<(int)MaterialPropertyVisibility::Disabled>("MaterialPropertyVisibility_Disabled") + ->Enum<(int)MaterialPropertyVisibility::Hidden>("MaterialPropertyVisibility_Hidden"); + + behaviorContext + ->Enum<(int)MaterialPropertyGroupVisibility::Enabled>("MaterialPropertyGroupVisibility_Enabled") + ->Enum<(int)MaterialPropertyGroupVisibility::Hidden>("MaterialPropertyGroupVisibility_Hidden"); + } + } + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp index 32772e9dd5..2979819aa6 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialFunctor.cpp @@ -142,25 +142,24 @@ namespace AZ MaterialFunctor::EditorContext::EditorContext( const AZStd::vector& propertyValues, RHI::ConstPtr materialPropertiesLayout, - AZStd::unordered_map& metadata, - AZStd::unordered_set& outChangedProperties, + AZStd::unordered_map& propertyMetadata, + AZStd::unordered_map& propertyGroupMetadata, + AZStd::unordered_set& updatedPropertiesOut, + AZStd::unordered_set& updatedPropertyGroupsOut, const MaterialPropertyFlags* materialPropertyDependencies ) : m_materialPropertyValues(propertyValues) , m_materialPropertiesLayout(materialPropertiesLayout) - , m_metadata(metadata) - , m_outChangedProperties(outChangedProperties) + , m_propertyMetadata(propertyMetadata) + , m_propertyGroupMetadata(propertyGroupMetadata) + , m_updatedPropertiesOut(updatedPropertiesOut) + , m_updatedPropertyGroupsOut(updatedPropertyGroupsOut) , m_materialPropertyDependencies(materialPropertyDependencies) {} const MaterialPropertyDynamicMetadata* MaterialFunctor::EditorContext::GetMaterialPropertyMetadata(const Name& propertyName) const { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) - { - return nullptr; - } - return &(it->second); + return QueryMaterialPropertyMetadata(propertyName); } const MaterialPropertyDynamicMetadata* MaterialFunctor::EditorContext::GetMaterialPropertyMetadata(const MaterialPropertyIndex& index) const @@ -168,19 +167,41 @@ namespace AZ const Name& name = m_materialPropertiesLayout->GetPropertyDescriptor(index)->GetName(); return GetMaterialPropertyMetadata(name); } - - bool MaterialFunctor::EditorContext::SetMaterialPropertyVisibility(const Name& propertyName, MaterialPropertyVisibility visibility) + + const MaterialPropertyGroupDynamicMetadata* MaterialFunctor::EditorContext::GetMaterialPropertyGroupMetadata(const Name& propertyName) const { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + return QueryMaterialPropertyGroupMetadata(propertyName); + } + + bool MaterialFunctor::EditorContext::SetMaterialPropertyGroupVisibility(const Name& propertyGroupName, MaterialPropertyGroupVisibility visibility) + { + MaterialPropertyGroupDynamicMetadata* metadata = QueryMaterialPropertyGroupMetadata(propertyGroupName); + if (!metadata) { return false; } - MaterialPropertyVisibility originValue = it->second.m_visibility; - it->second.m_visibility = visibility; - if (originValue != visibility) + + if (metadata->m_visibility != visibility) { - m_outChangedProperties.insert(propertyName); + metadata->m_visibility = visibility; + m_updatedPropertyGroupsOut.insert(propertyGroupName); + } + + return true; + } + + bool MaterialFunctor::EditorContext::SetMaterialPropertyVisibility(const Name& propertyName, MaterialPropertyVisibility visibility) + { + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) + { + return false; + } + + if (metadata->m_visibility != visibility) + { + metadata->m_visibility = visibility; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -194,17 +215,16 @@ namespace AZ bool MaterialFunctor::EditorContext::SetMaterialPropertyDescription(const Name& propertyName, AZStd::string description) { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) { return false; } - AZStd::string origin = it->second.m_description; - it->second.m_description = description; - if (origin != description) + if (metadata->m_description != description) { - m_outChangedProperties.insert(propertyName); + metadata->m_description = description; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -218,18 +238,16 @@ namespace AZ bool MaterialFunctor::EditorContext::SetMaterialPropertyMinValue(const Name& propertyName, const MaterialPropertyValue& min) { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) { return false; } - MaterialPropertyValue origin = it->second.m_propertyRange.m_min; - it->second.m_propertyRange.m_min = min; - - if(origin != min) + if(metadata->m_propertyRange.m_min != min) { - m_outChangedProperties.insert(propertyName); + metadata->m_propertyRange.m_min = min; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -243,18 +261,16 @@ namespace AZ bool MaterialFunctor::EditorContext::SetMaterialPropertyMaxValue(const Name& propertyName, const MaterialPropertyValue& max) { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) { return false; } - MaterialPropertyValue origin = it->second.m_propertyRange.m_max; - it->second.m_propertyRange.m_max = max; - - if (origin != max) + if (metadata->m_propertyRange.m_max != max) { - m_outChangedProperties.insert(propertyName); + metadata->m_propertyRange.m_max = max; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -268,18 +284,16 @@ namespace AZ bool MaterialFunctor::EditorContext::SetMaterialPropertySoftMinValue(const Name& propertyName, const MaterialPropertyValue& min) { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) { return false; } - MaterialPropertyValue origin = it->second.m_propertyRange.m_softMin; - it->second.m_propertyRange.m_softMin = min; - - if (origin != min) + if (metadata->m_propertyRange.m_softMin != min) { - m_outChangedProperties.insert(propertyName); + metadata->m_propertyRange.m_softMin = min; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -293,18 +307,16 @@ namespace AZ bool MaterialFunctor::EditorContext::SetMaterialPropertySoftMaxValue(const Name& propertyName, const MaterialPropertyValue& max) { - auto it = QueryMaterialMetadata(propertyName); - if (it == m_metadata.end()) + MaterialPropertyDynamicMetadata* metadata = QueryMaterialPropertyMetadata(propertyName); + if (!metadata) { return false; } - MaterialPropertyValue origin = it->second.m_propertyRange.m_softMax; - it->second.m_propertyRange.m_softMax = max; - - if (origin != max) + if (metadata->m_propertyRange.m_softMax != max) { - m_outChangedProperties.insert(propertyName); + metadata->m_propertyRange.m_softMax = max; + m_updatedPropertiesOut.insert(propertyName); } return true; @@ -316,15 +328,28 @@ namespace AZ return SetMaterialPropertySoftMaxValue(name, max); } - AZStd::list_iterator> MaterialFunctor::EditorContext::QueryMaterialMetadata(const Name& propertyName) const + MaterialPropertyDynamicMetadata* MaterialFunctor::EditorContext::QueryMaterialPropertyMetadata(const Name& propertyName) const { - auto it = m_metadata.find(propertyName); - if (it == m_metadata.end()) + auto it = m_propertyMetadata.find(propertyName); + if (it == m_propertyMetadata.end()) { AZ_Error("MaterialFunctor", false, "Couldn't find metadata for material property: %s.", propertyName.GetCStr()); + return nullptr; } - return it; + return &it->second; + } + + MaterialPropertyGroupDynamicMetadata* MaterialFunctor::EditorContext::QueryMaterialPropertyGroupMetadata(const Name& propertyGroupName) const + { + auto it = m_propertyGroupMetadata.find(propertyGroupName); + if (it == m_propertyGroupMetadata.end()) + { + AZ_Error("MaterialFunctor", false, "Couldn't find metadata for material property group: %s.", propertyGroupName.GetCStr()); + return nullptr; + } + + return &it->second; } template diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp index 367d95357b..72d658db63 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp @@ -124,12 +124,6 @@ namespace AZ ->Value(ToString(MaterialPropertyOutputType::ShaderOption), MaterialPropertyOutputType::ShaderOption) ; - serializeContext->Enum() - ->Value("Enabled", MaterialPropertyVisibility::Enabled) - ->Value("Disabled", MaterialPropertyVisibility::Disabled) - ->Value("Hidden", MaterialPropertyVisibility::Hidden) - ; - serializeContext->Enum() ->Value(ToString(MaterialPropertyDataType::Invalid), MaterialPropertyDataType::Invalid) ->Value(ToString(MaterialPropertyDataType::Bool), MaterialPropertyDataType::Bool) @@ -153,14 +147,6 @@ namespace AZ ; } - if (auto* behaviorContext = azrtti_cast(context)) - { - behaviorContext - ->Enum<(int)MaterialPropertyVisibility::Enabled>("MaterialPropertyVisibility_Enabled") - ->Enum<(int)MaterialPropertyVisibility::Disabled>("MaterialPropertyVisibility_Disabled") - ->Enum<(int)MaterialPropertyVisibility::Hidden>("MaterialPropertyVisibility_Hidden"); - } - MaterialPropertyIndex::Reflect(context); } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp index 313e0bea31..3c0f832807 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Model/MorphTargetMetaAsset.cpp @@ -28,6 +28,7 @@ namespace AZ::RPI ->Field("numVertices", &MorphTargetMetaAsset::MorphTarget::m_numVertices) ->Field("minPositionDelta", &MorphTargetMetaAsset::MorphTarget::m_minPositionDelta) ->Field("maxPositionDelta", &MorphTargetMetaAsset::MorphTarget::m_maxPositionDelta) + ->Field("wrinkleMask", &MorphTargetMetaAsset::MorphTarget::m_wrinkleMask) ->Field("hasColorDeltas", &MorphTargetMetaAsset::MorphTarget::m_hasColorDeltas) ; } diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp index fa791537e7..0a59772d6c 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset.cpp @@ -32,6 +32,25 @@ namespace AZ const ShaderVariantStableId ShaderAsset::RootShaderVariantStableId{ 0 }; + uint32_t ShaderAsset::MakeAssetProductSubId(uint32_t rhiApiUniqueIndex, uint32_t subProductType) + { + static constexpr uint32_t RhiIndexBitPosition = 30; + static constexpr uint32_t RhiIndexNumBits = 32 - RhiIndexBitPosition; + static constexpr uint32_t RhiIndexMaxValue = (1 << RhiIndexNumBits) - 1; + + static constexpr uint32_t SubProductTypeBitPosition = 0; + static constexpr uint32_t SubProductTypeNumBits = RhiIndexBitPosition - SubProductTypeBitPosition; + static constexpr uint32_t SubProductTypeMaxValue = (1 << SubProductTypeNumBits) - 1; + + static_assert(RhiIndexMaxValue == RHI::Limits::APIType::PerPlatformApiUniqueIndexMax); + AZ_Assert(rhiApiUniqueIndex <= RhiIndexMaxValue, "Invalid rhiApiUniqueIndex [%u]", rhiApiUniqueIndex); + AZ_Assert(subProductType <= SubProductTypeMaxValue, "Invalid subProductType [%u]", subProductType); + + const uint32_t assetProductSubId = (rhiApiUniqueIndex << RhiIndexBitPosition) | + (subProductType << SubProductTypeBitPosition); + return assetProductSubId; + } + void ShaderAsset::ShaderApiDataContainer::Reflect(AZ::ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) @@ -430,115 +449,5 @@ namespace AZ /////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////// - // Deprecated System - ////////////////////////////////////////////////////////////////////////// - - const char* ToString(ShaderStageType shaderStageType) - { - switch (shaderStageType) - { - case ShaderStageType::Vertex: return "Vertex"; - case ShaderStageType::Geometry: return "Geometry"; - case ShaderStageType::TessellationControl: return "TessellationControl"; - case ShaderStageType::TessellationEvaluation: return "TessellationEvaluation"; - case ShaderStageType::Fragment: return "Fragment"; - case ShaderStageType::Compute: return "Compute"; - case ShaderStageType::RayTracing: return "RayTracing"; - default: - AZ_Assert(false, "Unhandled type"); - return ""; - } - } - - void ReflectShaderStageType(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Enum() - ->Value(ToString(ShaderStageType::Vertex), ShaderStageType::Vertex) - ->Value(ToString(ShaderStageType::Geometry), ShaderStageType::Geometry) - ->Value(ToString(ShaderStageType::TessellationControl), ShaderStageType::TessellationControl) - ->Value(ToString(ShaderStageType::TessellationEvaluation), ShaderStageType::TessellationEvaluation) - ->Value(ToString(ShaderStageType::Fragment), ShaderStageType::Fragment) - ->Value(ToString(ShaderStageType::Compute), ShaderStageType::Compute) - ->Value(ToString(ShaderStageType::RayTracing), ShaderStageType::RayTracing) - ; - } - } - - ShaderAssetSubId ShaderStageToSubId(ShaderStageType stageType) - { - switch (stageType) - { - case RPI::ShaderStageType::Vertex: - return ShaderAssetSubId::AzVertexShader; - case RPI::ShaderStageType::Geometry: - return ShaderAssetSubId::AzGeometryShader; - case RPI::ShaderStageType::TessellationControl: - return ShaderAssetSubId::AzTessellationControlShader; - case RPI::ShaderStageType::TessellationEvaluation: - return ShaderAssetSubId::AzTessellationEvaluationShader; - case RPI::ShaderStageType::Fragment: - return ShaderAssetSubId::AzFragmentShader; - case RPI::ShaderStageType::Compute: - return ShaderAssetSubId::AzComputeShader; - case RPI::ShaderStageType::RayTracing: - return ShaderAssetSubId::AzRayTracingShader; - default: - AZ_Assert(false, "Trying to get a ShaderAssetSubId from an unknown ShaderStageType. Defaulting to a vertex shader."); - break; - } - - return ShaderAssetSubId::AzVertexShader; - } - void ShaderStageDescriptor::Reflect(ReflectContext* context) - { - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("m_stageType", &ShaderStageDescriptor::m_stageType) - ->Field("m_byteCode", &ShaderStageDescriptor::m_byteCode) - ; - } - } - - - /////////////////////////////////////////////////////////////////////// - // ShaderStageAsset - - void ShaderStageAsset::Reflect(ReflectContext* context) - { - ShaderStageDescriptor::Reflect(context); - - if (auto* serializeContext = azrtti_cast(context)) - { - serializeContext->Class() - ->Version(1) - ->Field("m_descriptor", &ShaderStageAsset::m_descriptor) - ->Field("m_srgLayouts", &ShaderStageAsset::m_srgLayouts) - ; - } - } - - ShaderStageAsset::ShaderStageAsset(const ShaderStageAsset& rhs) - { - *this = rhs; - } - - ShaderStageAsset::ShaderStageAsset(ShaderStageAsset&& rhs) - : m_descriptor(AZStd::move(rhs.m_descriptor)) - , m_srgLayouts(AZStd::move(rhs.m_srgLayouts)) - {} - - ShaderStageAsset& ShaderStageAsset::operator= (const ShaderStageAsset& rhs) - { - m_descriptor = rhs.m_descriptor; - m_srgLayouts = rhs.m_srgLayouts; - return *this; - } - /////////////////////////////////////////////////////////////////////// - } // namespace RPI } // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset2.cpp new file mode 100644 index 0000000000..749f53aae7 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAsset2.cpp @@ -0,0 +1,589 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + const ShaderVariantStableId ShaderAsset2::RootShaderVariantStableId{0}; + + static constexpr uint32_t SubProductTypeBitPosition = 0; + static constexpr uint32_t SubProductTypeNumBits = SupervariantIndexBitPosition - SubProductTypeBitPosition; + static constexpr uint32_t SubProductTypeMaxValue = (1 << SubProductTypeNumBits) - 1; + + static_assert(RhiIndexMaxValue == RHI::Limits::APIType::PerPlatformApiUniqueIndexMax); + + uint32_t ShaderAsset2::MakeProductAssetSubId( + uint32_t rhiApiUniqueIndex, uint32_t supervariantIndex, uint32_t subProductType) + { + AZ_Assert(rhiApiUniqueIndex <= RhiIndexMaxValue, "Invalid rhiApiUniqueIndex [%u]", rhiApiUniqueIndex); + AZ_Assert(supervariantIndex <= SupervariantIndexMaxValue, "Invalid supervariantIndex [%u]", supervariantIndex); + AZ_Assert(subProductType <= SubProductTypeMaxValue, "Invalid subProductType [%u]", subProductType); + + const uint32_t assetProductSubId = (rhiApiUniqueIndex << RhiIndexBitPosition) | + (supervariantIndex << SupervariantIndexBitPosition) | (subProductType << SubProductTypeBitPosition); + return assetProductSubId; + } + + SupervariantIndex ShaderAsset2::GetSupervariantIndexFromProductAssetSubId(uint32_t assetProducSubId) + { + const uint32_t supervariantIndex = assetProducSubId >> SupervariantIndexBitPosition; + return SupervariantIndex{supervariantIndex & SupervariantIndexMaxValue}; + } + + SupervariantIndex ShaderAsset2::GetSupervariantIndexFromAssetId(const Data::AssetId& assetId) + { + return GetSupervariantIndexFromProductAssetSubId(assetId.m_subId); + } + + void ShaderAsset2::Supervariant::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("Name", &Supervariant::m_name) + ->Field("SrgLayoutList", &Supervariant::m_srgLayoutList) + ->Field("PipelineLayout", &Supervariant::m_pipelineLayoutDescriptor) + ->Field("InputContract", &Supervariant::m_inputContract) + ->Field("OutputContract", &Supervariant::m_outputContract) + ->Field("RenderStates", &Supervariant::m_renderStates) + ->Field("AttributeMapList", &Supervariant::m_attributeMaps) + ->Field("RootVariantAsset", &Supervariant::m_rootShaderVariantAsset) + ; + } + } + + void ShaderAsset2::ShaderApiDataContainer::Reflect(AZ::ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("APIType", &ShaderApiDataContainer::m_APIType) + ->Field("Supervariants", &ShaderApiDataContainer::m_supervariants) + ; + } + } + + void ShaderAsset2::Reflect(ReflectContext* context) + { + Supervariant::Reflect(context); + + ShaderApiDataContainer::Reflect(context); + + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("name", &ShaderAsset2::m_name) + ->Field("pipelineStateType", &ShaderAsset2::m_pipelineStateType) + ->Field("shaderOptionGroupLayout", &ShaderAsset2::m_shaderOptionGroupLayout) + ->Field("drawListName", &ShaderAsset2::m_drawListName) + ->Field("shaderAssetBuildTimestamp", &ShaderAsset2::m_shaderAssetBuildTimestamp) + ->Field("perAPIShaderData", &ShaderAsset2::m_perAPIShaderData) + ; + } + } + + ShaderAsset2::~ShaderAsset2() + { + Data::AssetBus::Handler::BusDisconnect(); + ShaderVariantFinderNotificationBus2::Handler::BusDisconnect(); + } + + const Name& ShaderAsset2::GetName() const + { + return m_name; + } + + RHI::PipelineStateType ShaderAsset2::GetPipelineStateType() const + { + return m_pipelineStateType; + } + + const ShaderOptionGroupLayout* ShaderAsset2::GetShaderOptionGroupLayout() const + { + AZ_Assert(m_shaderOptionGroupLayout, "m_shaderOptionGroupLayout is null"); + return m_shaderOptionGroupLayout.get(); + } + + const Name& ShaderAsset2::GetDrawListName() const + { + return m_drawListName; + } + + AZStd::sys_time_t ShaderAsset2::GetShaderAssetBuildTimestamp() const + { + return m_shaderAssetBuildTimestamp; + } + + void ShaderAsset2::SetReady() + { + m_status = AssetStatus::Ready; + } + + + SupervariantIndex ShaderAsset2::GetSupervariantIndex(const AZ::Name& supervariantName) const + { + const auto& supervariants = GetCurrentShaderApiData().m_supervariants; + const uint32_t supervariantCount = supervariants.size(); + for (uint32_t index = 0; index < supervariantCount; ++index) + { + if (supervariants[index].m_name == supervariantName) + { + return SupervariantIndex{index}; + } + } + return InvalidSupervariantIndex; + } + + + Data::Asset ShaderAsset2::GetVariant( + const ShaderVariantId& shaderVariantId, SupervariantIndex supervariantIndex) + { + AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + + auto variantFinder = AZ::Interface::Get(); + AZ_Assert(variantFinder, "The IShaderVariantFinder doesn't exist"); + + Data::Asset thisAsset(this, Data::AssetLoadBehavior::Default); + Data::Asset shaderVariantAsset = + variantFinder->GetShaderVariantAssetByVariantId(thisAsset, shaderVariantId, supervariantIndex); + if (!shaderVariantAsset) + { + variantFinder->QueueLoadShaderVariantAssetByVariantId(thisAsset, shaderVariantId, supervariantIndex); + } + return shaderVariantAsset; + } + + ShaderVariantSearchResult ShaderAsset2::FindVariantStableId(const ShaderVariantId& shaderVariantId) + { + AZ_PROFILE_FUNCTION(Debug::ProfileCategory::AzRender); + + uint32_t dynamicOptionCount = aznumeric_cast(GetShaderOptionGroupLayout()->GetShaderOptions().size()); + ShaderVariantSearchResult variantSearchResult{RootShaderVariantStableId, dynamicOptionCount }; + + if (!dynamicOptionCount) + { + // The shader has no options at all. There's nothing to search. + return variantSearchResult; + } + + auto variantFinder = AZ::Interface::Get(); + AZ_Assert(variantFinder, "The IShaderVariantFinder doesn't exist"); + + { + AZStd::shared_lock lock(m_variantTreeMutex); + if (m_shaderVariantTree) + { + return m_shaderVariantTree->FindVariantStableId(GetShaderOptionGroupLayout(), shaderVariantId); + } + } + + AZStd::unique_lock lock(m_variantTreeMutex); + if (!m_shaderVariantTree) + { + m_shaderVariantTree = variantFinder->GetShaderVariantTreeAsset(GetId()); + if (!m_shaderVariantTree) + { + if (!m_shaderVariantTreeLoadWasRequested) + { + variantFinder->QueueLoadShaderVariantTreeAsset(GetId()); + m_shaderVariantTreeLoadWasRequested = true; + } + + // The variant tree could be under construction or simply doesn't exist at all. + return variantSearchResult; + } + } + return m_shaderVariantTree->FindVariantStableId(GetShaderOptionGroupLayout(), shaderVariantId); + } + + Data::Asset ShaderAsset2::GetVariant( + ShaderVariantStableId shaderVariantStableId, SupervariantIndex supervariantIndex) const + { + if (!shaderVariantStableId.IsValid() || shaderVariantStableId == RootShaderVariantStableId) + { + return GetRootVariant(supervariantIndex); + } + + auto variantFinder = AZ::Interface::Get(); + AZ_Assert(variantFinder, "No Variant Finder For shaderAsset with name [%s] and stableId [%u]", GetName().GetCStr(), shaderVariantStableId.GetIndex()); + Data::Asset variant = + variantFinder->GetShaderVariantAsset(m_shaderVariantTree.GetId(), shaderVariantStableId, supervariantIndex); + if (!variant.IsReady()) + { + // Enqueue a request to load the variant, next time around the caller will get the asset. + Data::AssetId variantTreeAssetId; + { + AZStd::shared_lock lock(m_variantTreeMutex); + if (m_shaderVariantTree) + { + variantTreeAssetId = m_shaderVariantTree.GetId(); + } + } + if (variantTreeAssetId.IsValid()) + { + variantFinder->QueueLoadShaderVariantAsset(variantTreeAssetId, shaderVariantStableId, supervariantIndex); + } + return GetRootVariant(supervariantIndex); + } + else if (variant->GetBuildTimestamp() >= m_shaderAssetBuildTimestamp) + { + return variant; + } + else + { + // When rebuilding shaders we may be in a state where the ShaderAsset2 and root ShaderVariantAsset have been rebuilt and reloaded, but some (or all) + // shader variants haven't been built yet. Since we want to use the latest version of the shader code, ignore the old variants and fall back to the newer root variant instead. + AZ_Warning("ShaderAsset2", false, "ShaderAsset2 and ShaderVariantAsset are out of sync; defaulting to root shader variant. (This is common while reloading shaders)."); + return GetRootVariant(supervariantIndex); + } + } + + Data::Asset ShaderAsset2::GetRootVariant(SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return Data::Asset(); + } + return supervariant->m_rootShaderVariantAsset; + } + + const RHI::Ptr ShaderAsset2::FindShaderResourceGroupLayout( + const Name& shaderResourceGroupName, SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return nullptr; + } + const auto& srgLayoutList = supervariant->m_srgLayoutList; + const auto findIt = AZStd::find_if(srgLayoutList.begin(), srgLayoutList.end(), [&](const RHI::Ptr& layout) + { + return layout->GetName() == shaderResourceGroupName; + }); + + if (findIt != srgLayoutList.end()) + { + return *findIt; + } + + return nullptr; + } + + const RHI::Ptr ShaderAsset2::FindShaderResourceGroupLayout( + uint32_t bindingSlot, SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return nullptr; + } + const auto& srgLayoutList = supervariant->m_srgLayoutList; + const auto findIt = + AZStd::find_if(srgLayoutList.begin(), srgLayoutList.end(), [&](const RHI::Ptr& layout) + { + return layout && layout->GetBindingSlot() == bindingSlot; + }); + + if (findIt != srgLayoutList.end()) + { + return *findIt; + } + + return nullptr; + } + + const RHI::Ptr ShaderAsset2::FindFallbackShaderResourceGroupLayout( + SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return nullptr; + } + const auto& srgLayoutList = supervariant->m_srgLayoutList; + const auto findIt = + AZStd::find_if(srgLayoutList.begin(), srgLayoutList.end(), [&](const RHI::Ptr& layout) + { + return layout && layout->HasShaderVariantKeyFallbackEntry(); + }); + + if (findIt != srgLayoutList.end()) + { + return *findIt; + } + + return nullptr; + } + + AZStd::array_view> ShaderAsset2::GetShaderResourceGroupLayouts( + SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return {}; + } + return supervariant->m_srgLayoutList; + } + + + const RHI::Ptr ShaderAsset2::GetDrawSrgLayout(SupervariantIndex supervariantIndex) const + { + return FindShaderResourceGroupLayout(SrgBindingSlot::Draw, supervariantIndex); + } + + const ShaderInputContract& ShaderAsset2::GetInputContract(SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + return supervariant->m_inputContract; + } + + const ShaderOutputContract& ShaderAsset2::GetOutputContract(SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + return supervariant->m_outputContract; + } + + const RHI::RenderStates& ShaderAsset2::GetRenderStates(SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + return supervariant->m_renderStates; + } + + const RHI::PipelineLayoutDescriptor* ShaderAsset2::GetPipelineLayoutDescriptor(SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return nullptr; + } + AZ_Assert(supervariant->m_pipelineLayoutDescriptor, "m_pipelineLayoutDescriptor is null"); + return supervariant->m_pipelineLayoutDescriptor.get(); + } + + AZStd::optional ShaderAsset2::GetAttribute(const RHI::ShaderStage& shaderStage, const Name& attributeName, + SupervariantIndex supervariantIndex) const + { + auto supervariant = GetSupervariant(supervariantIndex); + if (!supervariant) + { + return AZStd::nullopt; + } + const auto stageIndex = static_cast(shaderStage); + AZ_Assert(stageIndex < RHI::ShaderStageCount, "Invalid shader stage specified!"); + + const auto& attributeMaps = supervariant->m_attributeMaps; + const auto& attrPair = attributeMaps[stageIndex].find(attributeName); + if (attrPair == attributeMaps[stageIndex].end()) + { + return AZStd::nullopt; + } + + return attrPair->second; + } + + ShaderAsset2::ShaderApiDataContainer& ShaderAsset2::GetCurrentShaderApiData() + { + const size_t perApiShaderDataCount = m_perAPIShaderData.size(); + AZ_Assert(perApiShaderDataCount > 0, "Invalid m_perAPIShaderData"); + + if (m_currentAPITypeIndex < perApiShaderDataCount) + { + return m_perAPIShaderData[m_currentAPITypeIndex]; + } + + // We may only endup here when running in a Builder context. + return m_perAPIShaderData[0]; + } + + const ShaderAsset2::ShaderApiDataContainer& ShaderAsset2::GetCurrentShaderApiData() const + { + const size_t perApiShaderDataCount = m_perAPIShaderData.size(); + AZ_Assert(perApiShaderDataCount > 0, "Invalid m_perAPIShaderData"); + + if (m_currentAPITypeIndex < perApiShaderDataCount) + { + return m_perAPIShaderData[m_currentAPITypeIndex]; + } + + // We may only endup here when running in a Builder context. + return m_perAPIShaderData[0]; + } + + ShaderAsset2::Supervariant* ShaderAsset2::GetSupervariant(SupervariantIndex supervariantIndex) + { + auto& supervariants = GetCurrentShaderApiData().m_supervariants; + auto index = supervariantIndex.GetIndex(); + if (index >= supervariants.size()) + { + AZ_Error( + "ShaderAsset2", false, "Supervariant index = %u is invalid because there are only %zu supervariants", index, + supervariants.size()); + return nullptr; + } + + return &supervariants[index]; + } + + const ShaderAsset2::Supervariant* ShaderAsset2::GetSupervariant(SupervariantIndex supervariantIndex) const + { + const auto& supervariants = GetCurrentShaderApiData().m_supervariants; + auto index = supervariantIndex.GetIndex(); + if (index >= supervariants.size()) + { + AZ_Error( + "ShaderAsset2", false, "Supervariant index = %u is invalid because there are only %zu supervariants", index, + supervariants.size()); + return nullptr; + } + + return &supervariants[index]; + } + + bool ShaderAsset2::FinalizeAfterLoad() + { + // Use the current RHI that is active to select which shader data to use. + // We don't assert if the Factory is not available because this method could be called during build time, + // when no Factory is available. Some assets (like the material asset) need to load the ShaderAsset2 + // in order to get some non API specific data (like a ShaderResourceGroup) during their build + // process. If they try to access any RHI API specific data, an assert will be trigger because the + // correct API index will not set. + if (RHI::Factory::IsReady()) + { + auto rhiType = RHI::Factory::Get().GetType(); + auto findIt = AZStd::find_if(m_perAPIShaderData.begin(), m_perAPIShaderData.end(), [&rhiType](const auto& shaderData) + { + return shaderData.m_APIType == rhiType; + }); + + if (findIt != m_perAPIShaderData.end()) + { + m_currentAPITypeIndex = AZStd::distance(m_perAPIShaderData.begin(), findIt); + } + else + { + AZ_Error("ShaderAsset2", false, "Could not find shader for API %s in shader %s", RHI::Factory::Get().GetName().GetCStr(), GetName().GetCStr()); + return false; + } + } + + // Common finalize check + for (const auto& shaderApiData : m_perAPIShaderData) + { + const auto& supervariants = shaderApiData.m_supervariants; + for (const auto& supervariant : supervariants) + { + bool beTrue = supervariant.m_attributeMaps.size() == RHI::ShaderStageCount; + if (!beTrue) + { + AZ_Error("ShaderAsset2", false, "Unexpected number of shader stages at supervariant with name [%s]!", supervariant.m_name.GetCStr()); + return false; + } + } + } + + // Once the ShaderAsset2 is loaded, it is necessary to listen for changes in the Root Variant Asset. + Data::AssetBus::Handler::BusConnect(GetRootVariant().GetId()); + ShaderVariantFinderNotificationBus2::Handler::BusConnect(GetId()); + + return true; + } + + /////////////////////////////////////////////////////////////////////// + // AssetBus overrides... + void ShaderAsset2::OnAssetReloaded(Data::Asset asset) + { + ShaderReloadDebugTracker::ScopedSection reloadSection("ShaderAsset2::OnAssetReloaded %s", asset.GetHint().c_str()); + + Data::Asset shaderVariantAsset = { asset.GetAs(), AZ::Data::AssetLoadBehavior::PreLoad }; + AZ_Assert(shaderVariantAsset->GetStableId() == RootShaderVariantStableId, + "Was expecting to update the root variant"); + SupervariantIndex supervariantIndex = GetSupervariantIndexFromAssetId(asset.GetId()); + GetCurrentShaderApiData().m_supervariants[supervariantIndex.GetIndex()].m_rootShaderVariantAsset = asset; + + ShaderReloadNotificationBus2::Event(GetId(), &ShaderReloadNotificationBus2::Events::OnShaderAssetReinitialized, Data::Asset{ this, AZ::Data::AssetLoadBehavior::PreLoad } ); + } + /////////////////////////////////////////////////////////////////////// + + /////////////////////////////////////////////////////////////////// + /// ShaderVariantFinderNotificationBus2 overrides + void ShaderAsset2::OnShaderVariantTreeAssetReady(Data::Asset shaderVariantTreeAsset, bool isError) + { + ShaderReloadDebugTracker::ScopedSection reloadSection("ShaderAsset2::OnShaderVariantTreeAssetReady %s", shaderVariantTreeAsset.GetHint().c_str()); + + AZStd::unique_lock lock(m_variantTreeMutex); + if (isError) + { + m_shaderVariantTree = {}; //This will force to attempt to reload later. + m_shaderVariantTreeLoadWasRequested = false; + } + else + { + m_shaderVariantTree = shaderVariantTreeAsset; + } + lock.unlock(); + ShaderReloadNotificationBus2::Event(GetId(), &ShaderReloadNotificationBus2::Events::OnShaderAssetReinitialized, Data::Asset{ this, AZ::Data::AssetLoadBehavior::PreLoad }); + } + + /////////////////////////////////////////////////////////////////// + + + /////////////////////////////////////////////////////////////////////// + // ShaderAssetHandler + + Data::AssetHandler::LoadResult ShaderAssetHandler2::LoadAssetData( + const Data::Asset& asset, + AZStd::shared_ptr stream, + const Data::AssetFilterCB& assetLoadFilterCB) + { + if (Base::LoadAssetData(asset, stream, assetLoadFilterCB) == Data::AssetHandler::LoadResult::LoadComplete) + { + return PostLoadInit(asset); + } + return Data::AssetHandler::LoadResult::Error; + } + + Data::AssetHandler::LoadResult ShaderAssetHandler2::PostLoadInit(const Data::Asset& asset) + { + if (ShaderAsset2* shaderAsset = asset.GetAs()) + { + if (!shaderAsset->FinalizeAfterLoad()) + { + AZ_Error("ShaderAssetHandler", false, "Shader asset failed to finalize."); + return Data::AssetHandler::LoadResult::Error; + } + return Data::AssetHandler::LoadResult::LoadComplete; + } + return Data::AssetHandler::LoadResult::Error; + } + + /////////////////////////////////////////////////////////////////////// + + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator2.cpp new file mode 100644 index 0000000000..af8340a343 --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderAssetCreator2.cpp @@ -0,0 +1,404 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +namespace AZ +{ + namespace RPI + { + void ShaderAssetCreator2::Begin(const Data::AssetId& assetId) + { + BeginCommon(assetId); + } + + void ShaderAssetCreator2::SetShaderAssetBuildTimestamp(AZStd::sys_time_t shaderAssetBuildTimestamp) + { + if (ValidateIsReady()) + { + m_asset->m_shaderAssetBuildTimestamp = shaderAssetBuildTimestamp; + } + } + + void ShaderAssetCreator2::SetName(const Name& name) + { + if (ValidateIsReady()) + { + m_asset->m_name = name; + } + } + + void ShaderAssetCreator2::SetDrawListName(const Name& name) + { + if (ValidateIsReady()) + { + m_asset->m_drawListName = name; + } + } + + void ShaderAssetCreator2::SetShaderOptionGroupLayout(const Ptr& shaderOptionGroupLayout) + { + if (ValidateIsReady()) + { + m_asset->m_shaderOptionGroupLayout = shaderOptionGroupLayout; + } + } + + void ShaderAssetCreator2::BeginAPI(RHI::APIType type) + { + if (ValidateIsReady()) + { + ShaderAsset2::ShaderApiDataContainer shaderData; + shaderData.m_APIType = type; + m_asset->m_currentAPITypeIndex = m_asset->m_perAPIShaderData.size(); + m_asset->m_perAPIShaderData.push_back(shaderData); + } + } + + void ShaderAssetCreator2::BeginSupervariant(const Name& name) + { + if (!ValidateIsReady()) + { + return; + } + + if (m_currentSupervariant) + { + ReportError("Call EndSupervariant() before calling BeginSupervariant again."); + return; + } + + if (m_asset->m_currentAPITypeIndex == ShaderAsset2::InvalidAPITypeIndex) + { + ReportError("Can not begin supervariant with name [%s] because this function must be called between BeginAPI()/EndAPI()", name.GetCStr()); + return; + } + + if (m_asset->m_perAPIShaderData.empty()) + { + ReportError("Can not add supervariant with name [%s] because there's no per API shader data", name.GetCStr()); + return; + } + + ShaderAsset2::ShaderApiDataContainer& perAPIShaderData = m_asset->m_perAPIShaderData[m_asset->m_perAPIShaderData.size() - 1]; + if (perAPIShaderData.m_supervariants.empty()) + { + if (!name.IsEmpty()) + { + ReportError("The first supervariant must be nameless. Name [%s] is invalid", name.GetCStr()); + return; + } + } + else + { + if (name.IsEmpty()) + { + ReportError( + "Only the first supervariant can be nameless. So far there are %zu supervariants", + perAPIShaderData.m_supervariants.size()); + return; + } + } + + perAPIShaderData.m_supervariants.push_back({}); + m_currentSupervariant = &perAPIShaderData.m_supervariants[perAPIShaderData.m_supervariants.size() - 1]; + m_currentSupervariant->m_name = name; + } + + void ShaderAssetCreator2::SetSrgLayoutList(const ShaderResourceGroupLayoutList& srgLayoutList) + { + if (!ValidateIsReady()) + { + return; + } + + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + + m_currentSupervariant->m_srgLayoutList = srgLayoutList; + for (auto srgLayout : m_currentSupervariant->m_srgLayoutList) + { + if (!srgLayout->Finalize()) + { + ReportError( + "The current supervariant [%s], failed to finalize SRG Layout [%s]", m_currentSupervariant->m_name.GetCStr(), + srgLayout->GetName().GetCStr()); + return; + } + } + } + + //! [Required] Assigns the pipeline layout descriptor shared by all variants in the shader. Shader variants + //! embedded in a single shader asset are required to use the same pipeline layout. It is not necessary to call + //! Finalize() on the pipeline layout prior to assignment, but still permitted. + void ShaderAssetCreator2::SetPipelineLayout(RHI::Ptr pipelineLayoutDescriptor) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + if (m_currentSupervariant->m_srgLayoutList.empty()) + { + ReportError( + "Before setting the pipeline layout, the supervariant [%s] needs the SRG layouts", + m_currentSupervariant->m_name.GetCStr()); + return; + } + m_currentSupervariant->m_pipelineLayoutDescriptor = pipelineLayoutDescriptor; + } + + //! Assigns the contract for inputs required by the shader. + void ShaderAssetCreator2::SetInputContract(const ShaderInputContract& contract) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + m_currentSupervariant->m_inputContract = contract; + } + + //! Assigns the contract for outputs required by the shader. + void ShaderAssetCreator2::SetOutputContract(const ShaderOutputContract& contract) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + m_currentSupervariant->m_outputContract = contract; + } + + //! Assigns the render states for the draw pipeline. Ignored for non-draw pipelines. + void ShaderAssetCreator2::SetRenderStates(const RHI::RenderStates& renderStates) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + m_currentSupervariant->m_renderStates = renderStates; + } + + //! [Optional] Not all shaders have attributes before functions. Some attributes do not exist for all RHI::APIType either. + void ShaderAssetCreator2::SetShaderStageAttributeMapList(const RHI::ShaderStageAttributeMapList& shaderStageAttributeMapList) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + m_currentSupervariant->m_attributeMaps = shaderStageAttributeMapList; + } + + //! [Required] There's always a root variant for each supervariant. + void ShaderAssetCreator2::SetRootShaderVariantAsset(Data::Asset shaderVariantAsset) + { + if (!ValidateIsReady()) + { + return; + } + if (!m_currentSupervariant) + { + ReportError("BeginSupervariant() should be called first before calling %s", __FUNCTION__); + return; + } + m_currentSupervariant->m_rootShaderVariantAsset = shaderVariantAsset; + } + + static RHI::PipelineStateType GetPipelineStateType(const Data::Asset& shaderVariantAsset) + { + if (shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Vertex) || + shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Tessellation) || + shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Fragment)) + { + return RHI::PipelineStateType::Draw; + } + + if (shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::Compute)) + { + return RHI::PipelineStateType::Dispatch; + } + + if (shaderVariantAsset->GetShaderStageFunction(RHI::ShaderStage::RayTracing)) + { + return RHI::PipelineStateType::RayTracing; + } + + return RHI::PipelineStateType::Count; + } + + bool ShaderAssetCreator2::EndSupervariant() + { + if (!ValidateIsReady()) + { + return false; + } + + if (!m_currentSupervariant) + { + ReportError("Can not end a supervariant that has not started"); + return false; + } + + if (!m_currentSupervariant->m_rootShaderVariantAsset.IsReady()) + { + ReportError( + "The current supervariant [%s], is missing the root ShaderVariantAsset", m_currentSupervariant->m_name.GetCStr()); + return false; + } + + // Supervariant specific resources + if (m_currentSupervariant->m_pipelineLayoutDescriptor) + { + if (!m_currentSupervariant->m_pipelineLayoutDescriptor->IsFinalized()) + { + if (m_currentSupervariant->m_pipelineLayoutDescriptor->Finalize() != RHI::ResultCode::Success) + { + ReportError("Failed to finalize pipeline layout descriptor."); + return false; + } + } + } + else + { + ReportError("PipelineLayoutDescriptor not specified."); + return false; + } + + const ShaderInputContract& shaderInputContract = m_currentSupervariant->m_inputContract; + // Validate that each stream ID appears only once. + for (const auto& channel : shaderInputContract.m_streamChannels) + { + int count = 0; + + for (const auto& searchChannel : shaderInputContract.m_streamChannels) + { + if (channel.m_semantic == searchChannel.m_semantic) + { + ++count; + } + } + + if (count > 1) + { + ReportError( + "Input stream channel [%s] appears multiple times. For supervariant with name [%s]", + channel.m_semantic.ToString().c_str(), m_currentSupervariant->m_name.GetCStr()); + return false; + } + } + + auto pipelineStateType = GetPipelineStateType(m_currentSupervariant->m_rootShaderVariantAsset); + if (pipelineStateType == RHI::PipelineStateType::Count) + { + ReportError("Invalid pipelineStateType for supervariant [%s]", m_currentSupervariant->m_name.GetCStr()); + return false; + } + + + if (m_currentSupervariant->m_name.IsEmpty()) + { + m_asset->m_pipelineStateType = pipelineStateType; + } + else + { + if (m_asset->m_pipelineStateType != pipelineStateType) + { + ReportError("All supervariants must be of the same pipelineStateType. Current pipelineStateType is [%d], but for supervariant [%s] the pipelineStateType is [%d]", + m_asset->m_pipelineStateType, m_currentSupervariant->m_name.GetCStr(), pipelineStateType); + return false; + } + } + + m_currentSupervariant = nullptr; + return true; + } + + bool ShaderAssetCreator2::EndAPI() + { + if (!ValidateIsReady()) + { + return false; + } + if (m_currentSupervariant) + { + ReportError("EndSupervariant() must be called before calling EndAPI()"); + return false; + } + + m_asset->m_currentAPITypeIndex = ShaderAsset2::InvalidAPITypeIndex; + return true; + } + + bool ShaderAssetCreator2::End(Data::Asset& shaderAsset) + { + if (!ValidateIsReady()) + { + return false; + } + + if (m_asset->m_perAPIShaderData.empty()) + { + ReportError("Empty shader data. Check that a valid RHI is enabled for this platform."); + return false; + } + + if (!m_asset->FinalizeAfterLoad()) + { + ReportError("Failed to finalize the ShaderAsset2."); + return false; + } + + m_asset->SetReady(); + + return EndCommon(shaderAsset); + } + + void ShaderAssetCreator2::Clone(const Data::AssetId& assetId, const ShaderAsset2& sourceShaderAsset) + { + BeginCommon(assetId); + + m_asset->m_name = sourceShaderAsset.m_name; + m_asset->m_pipelineStateType = sourceShaderAsset.m_pipelineStateType; + m_asset->m_drawListName = sourceShaderAsset.m_drawListName; + m_asset->m_shaderOptionGroupLayout = sourceShaderAsset.m_shaderOptionGroupLayout; + m_asset->m_shaderAssetBuildTimestamp = sourceShaderAsset.m_shaderAssetBuildTimestamp; + m_asset->m_perAPIShaderData = sourceShaderAsset.m_perAPIShaderData; + + } + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderStageType.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderStageType.cpp new file mode 100644 index 0000000000..845966708a --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderStageType.cpp @@ -0,0 +1,54 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace AZ +{ + namespace RPI + { + const char* ToString(ShaderStageType shaderStageType) + { + switch (shaderStageType) + { + case ShaderStageType::Vertex: return "Vertex"; + case ShaderStageType::Geometry: return "Geometry"; + case ShaderStageType::TessellationControl: return "TessellationControl"; + case ShaderStageType::TessellationEvaluation: return "TessellationEvaluation"; + case ShaderStageType::Fragment: return "Fragment"; + case ShaderStageType::Compute: return "Compute"; + case ShaderStageType::RayTracing: return "RayTracing"; + default: + AZ_Assert(false, "Unhandled type"); + return ""; + } + } + + void ReflectShaderStageType(ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Enum() + ->Value(ToString(ShaderStageType::Vertex), ShaderStageType::Vertex) + ->Value(ToString(ShaderStageType::Geometry), ShaderStageType::Geometry) + ->Value(ToString(ShaderStageType::TessellationControl), ShaderStageType::TessellationControl) + ->Value(ToString(ShaderStageType::TessellationEvaluation), ShaderStageType::TessellationEvaluation) + ->Value(ToString(ShaderStageType::Fragment), ShaderStageType::Fragment) + ->Value(ToString(ShaderStageType::Compute), ShaderStageType::Compute) + ->Value(ToString(ShaderStageType::RayTracing), ShaderStageType::RayTracing) + ; + } + } + + } // namespace RPI +} // namespace AZ 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 3b52dda326..7864768351 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp @@ -21,6 +21,34 @@ namespace AZ { namespace RPI { + uint32_t ShaderVariantAsset::MakeAssetProductSubId( + uint32_t rhiApiUniqueIndex, ShaderVariantStableId variantStableId, uint32_t subProductType) + { + static constexpr uint32_t RhiIndexBitPosition = 30; + static constexpr uint32_t RhiIndexNumBits = 32 - RhiIndexBitPosition; + static constexpr uint32_t RhiIndexMaxValue = (1 << RhiIndexNumBits) - 1; + + static constexpr uint32_t SubProductTypeBitPosition = 17; + static constexpr uint32_t SubProductTypeNumBits = RhiIndexBitPosition - SubProductTypeBitPosition; + static constexpr uint32_t SubProductTypeMaxValue = (1 << SubProductTypeNumBits) - 1; + + static constexpr uint32_t StableIdBitPosition = 0; + static constexpr uint32_t StableIdNumBits = SubProductTypeBitPosition - StableIdBitPosition; + static constexpr uint32_t StableIdMaxValue = (1 << StableIdNumBits) - 1; + + static_assert(RhiIndexMaxValue == RHI::Limits::APIType::PerPlatformApiUniqueIndexMax); + + // The 2 Most significant bits encode the the RHI::API unique index. + AZ_Assert(rhiApiUniqueIndex <= RhiIndexMaxValue, "Invalid rhiApiUniqueIndex [%u]", rhiApiUniqueIndex); + AZ_Assert(subProductType <= SubProductTypeMaxValue, "Invalid subProductType [%u]", subProductType); + AZ_Assert(variantStableId.GetIndex() <= StableIdMaxValue, "Invalid variantStableId [%u]", variantStableId.GetIndex()); + + const uint32_t assetProductSubId = (rhiApiUniqueIndex << RhiIndexBitPosition) | + (subProductType << SubProductTypeBitPosition) | + (variantStableId.GetIndex() << StableIdBitPosition); + return assetProductSubId; + } + void ShaderVariantAsset::Reflect(ReflectContext* context) { if (auto* serializeContext = azrtti_cast(context)) @@ -44,16 +72,6 @@ namespace AZ return m_shaderAssetBuildTimestamp; } - uint32_t ShaderVariantAsset::GetAssetSubId(uint32_t rhiApiUniqueIndex, ShaderVariantStableId variantStableId) - { - //The 2 Most significant bits encode the the RHI::API unique index. - AZ_Assert(rhiApiUniqueIndex <= RHI::Limits::APIType::PerPlatformApiUniqueIndexMax, "Invalid rhiApiUniqueIndex [%u]", rhiApiUniqueIndex); - AZ_Assert(variantStableId != RootShaderVariantStableId, "The product subId for the root variant is built differently."); - const uint32_t rhiApiSubId = rhiApiUniqueIndex << 30; - const uint32_t productSubId = rhiApiSubId | variantStableId.GetIndex(); - return productSubId; - } - const RHI::ShaderStageFunction* ShaderVariantAsset::GetShaderStageFunction(RHI::ShaderStage shaderStage) const { return m_functionsByStage[static_cast(shaderStage)].get(); diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset2.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset2.cpp new file mode 100644 index 0000000000..34daff560a --- /dev/null +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Shader/ShaderVariantAsset2.cpp @@ -0,0 +1,114 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ +#include + +#include +#include +#include + +#include +#include +#include + +namespace AZ +{ + namespace RPI + { + uint32_t ShaderVariantAsset2::MakeAssetProductSubId( + uint32_t rhiApiUniqueIndex, uint32_t supervariantIndex, ShaderVariantStableId variantStableId, uint32_t subProductType) + { + static constexpr uint32_t SubProductTypeBitPosition = 17; + static constexpr uint32_t SubProductTypeNumBits = SupervariantIndexBitPosition - SubProductTypeBitPosition; + static constexpr uint32_t SubProductTypeMaxValue = (1 << SubProductTypeNumBits) - 1; + + static constexpr uint32_t StableIdBitPosition = 0; + static constexpr uint32_t StableIdNumBits = SubProductTypeBitPosition - StableIdBitPosition; + static constexpr uint32_t StableIdMaxValue = (1 << StableIdNumBits) - 1; + + static_assert(RhiIndexMaxValue == RHI::Limits::APIType::PerPlatformApiUniqueIndexMax); + + // The 2 Most significant bits encode the the RHI::API unique index. + AZ_Assert(rhiApiUniqueIndex <= RhiIndexMaxValue, "Invalid rhiApiUniqueIndex [%u]", rhiApiUniqueIndex); + AZ_Assert(supervariantIndex <= SupervariantIndexMaxValue, "Invalid supervariantIndex [%u]", supervariantIndex); + AZ_Assert(subProductType <= SubProductTypeMaxValue, "Invalid subProductType [%u]", subProductType); + AZ_Assert(variantStableId.GetIndex() <= StableIdMaxValue, "Invalid variantStableId [%u]", variantStableId.GetIndex()); + + const uint32_t assetProductSubId = (rhiApiUniqueIndex << RhiIndexBitPosition) | + (supervariantIndex << SupervariantIndexBitPosition) | (subProductType << SubProductTypeBitPosition) | + (variantStableId.GetIndex() << StableIdBitPosition); + return assetProductSubId; + } + + void ShaderVariantAsset2::Reflect(ReflectContext* context) + { + if (auto* serializeContext = azrtti_cast(context)) + { + serializeContext->Class() + ->Version(1) + ->Field("StableId", &ShaderVariantAsset2::m_stableId) + ->Field("ShaderVariantId", &ShaderVariantAsset2::m_shaderVariantId) + ->Field("IsFullyBaked", &ShaderVariantAsset2::m_isFullyBaked) + ->Field("FunctionsByStage", &ShaderVariantAsset2::m_functionsByStage) + ->Field("BuildTimestamp", &ShaderVariantAsset2::m_buildTimestamp) + ; + } + } + + AZStd::sys_time_t ShaderVariantAsset2::GetBuildTimestamp() const + { + return m_buildTimestamp; + } + + const RHI::ShaderStageFunction* ShaderVariantAsset2::GetShaderStageFunction(RHI::ShaderStage shaderStage) const + { + return m_functionsByStage[static_cast(shaderStage)].get(); + } + + bool ShaderVariantAsset2::IsFullyBaked() const + { + return m_isFullyBaked; + } + + void ShaderVariantAsset2::SetReady() + { + m_status = AssetStatus::Ready; + } + + bool ShaderVariantAsset2::FinalizeAfterLoad() + { + return true; + } + + ShaderVariantAssetHandler2::LoadResult ShaderVariantAssetHandler2::LoadAssetData(const Data::Asset& asset, AZStd::shared_ptr stream, const AZ::Data::AssetFilterCB& assetLoadFilterCB) + { + if (Base::LoadAssetData(asset, stream, assetLoadFilterCB) == LoadResult::LoadComplete) + { + return PostLoadInit(asset) ? LoadResult::LoadComplete : LoadResult::Error; + } + return LoadResult::Error; + } + + bool ShaderVariantAssetHandler2::PostLoadInit(const Data::Asset& asset) + { + if (ShaderVariantAsset2* shaderVariantAsset = asset.GetAs()) + { + if (!shaderVariantAsset->FinalizeAfterLoad()) + { + AZ_Error("ShaderVariantAssetHandler", false, "Shader asset failed to finalize."); + return false; + } + return true; + } + return false; + } + } // namespace RPI +} // namespace AZ diff --git a/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.cpp b/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.cpp index 84e8a4ba65..6b9c503ec2 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.cpp +++ b/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.cpp @@ -72,7 +72,15 @@ namespace UnitTest return false; } - bool AssetSystemStub::GetFullSourcePathFromRelativeProductPath([[maybe_unused]] const AZStd::string& relPath, [[maybe_unused]] AZStd::string& fullSourcePath) + bool AssetSystemStub::GenerateRelativeSourcePath( + [[maybe_unused]] const AZStd::string& sourcePath, [[maybe_unused]] AZStd::string& relativePath, + [[maybe_unused]] AZStd::string& watchFolder) + { + return false; + } + + bool AssetSystemStub::GetFullSourcePathFromRelativeProductPath( + [[maybe_unused]] const AZStd::string& relPath, [[maybe_unused]] AZStd::string& fullSourcePath) { return false; } diff --git a/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.h b/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.h index c6f4ac891f..48609ed0cb 100644 --- a/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.h +++ b/Gems/Atom/RPI/Code/Tests/Common/AssetSystemStub.h @@ -63,6 +63,8 @@ namespace UnitTest const char* GetAbsoluteDevGameFolderPath() override; const char* GetAbsoluteDevRootFolderPath() override; bool GetRelativeProductPathFromFullSourceOrProductPath(const AZStd::string& fullPath, AZStd::string& relativeProductPath) override; + bool GenerateRelativeSourcePath( + const AZStd::string& sourcePath, AZStd::string& relativePath, AZStd::string& watchFolder) override; bool GetFullSourcePathFromRelativeProductPath(const AZStd::string& relPath, AZStd::string& fullSourcePath) override; bool GetAssetInfoById(const AZ::Data::AssetId& assetId, const AZ::Data::AssetType& assetType, const AZStd::string& platformName, AZ::Data::AssetInfo& assetInfo, AZStd::string& rootFilePath) override; bool GetSourceInfoBySourceUUID(const AZ::Uuid& sourceUuid, AZ::Data::AssetInfo& assetInfo, AZStd::string& watchFolder) override; diff --git a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp index 76fa6bfb0e..3dcbdfce07 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/LuaMaterialFunctorTests.cpp @@ -748,12 +748,15 @@ namespace UnitTest MaterialPropertyDataType::UInt, "general.mode", MaterialPropertyDataType::Float, "general.value", functorScript); - + AZStd::unordered_set changedPropertyNames; - AZStd::unordered_map propertyDynamicMetadata; propertyDynamicMetadata[Name{"general.mode"}] = {}; propertyDynamicMetadata[Name{"general.value"}] = {}; + + AZStd::unordered_set changedPropertyGroupNames; + AZStd::unordered_map propertyGroupDynamicMetadata; + propertyGroupDynamicMetadata[Name{"general"}] = {}; Ptr functor = testData.GetMaterialTypeAsset()->GetMaterialFunctors()[0]; @@ -761,7 +764,9 @@ namespace UnitTest testData.GetMaterial()->GetPropertyValues(), testData.GetMaterial()->GetMaterialPropertiesLayout(), propertyDynamicMetadata, + propertyGroupDynamicMetadata, changedPropertyNames, + changedPropertyGroupNames, &functor->GetMaterialPropertyDependencies() ); @@ -814,10 +819,13 @@ namespace UnitTest functorScript); AZStd::unordered_set changedPropertyNames; - AZStd::unordered_map propertyDynamicMetadata; propertyDynamicMetadata[Name{"general.units"}] = {}; propertyDynamicMetadata[Name{"general.distance"}] = {}; + + AZStd::unordered_set changedPropertyGroupNames; + AZStd::unordered_map propertyGroupDynamicMetadata; + propertyGroupDynamicMetadata[Name{"general"}] = {}; Ptr functor = testData.GetMaterialTypeAsset()->GetMaterialFunctors()[0]; @@ -825,7 +833,9 @@ namespace UnitTest testData.GetMaterial()->GetPropertyValues(), testData.GetMaterial()->GetMaterialPropertiesLayout(), propertyDynamicMetadata, + propertyGroupDynamicMetadata, changedPropertyNames, + changedPropertyGroupNames, &functor->GetMaterialPropertyDependencies() ); @@ -845,6 +855,66 @@ namespace UnitTest EXPECT_EQ(-100.0f, propertyDynamicMetadata[Name{"general.distance"}].m_propertyRange.m_softMin.GetValue()); EXPECT_EQ(100.0f, propertyDynamicMetadata[Name{"general.distance"}].m_propertyRange.m_softMax.GetValue()); } + + TEST_F(LuaMaterialFunctorTests, LuaMaterialFunctor_EditorContext_SetMaterialPropertyGroupVisibility) + { + using namespace AZ::RPI; + + const char* functorScript = + R"( + function GetMaterialPropertyDependencies() + return { "general.mode" } + end + + function ProcessEditor(context) + local mode = context:GetMaterialPropertyValue_uint("general.mode") + + if (mode == 1) then + context:SetMaterialPropertyGroupVisibility("otherGroup", MaterialPropertyGroupVisibility_Enabled) + else + context:SetMaterialPropertyGroupVisibility("otherGroup", MaterialPropertyGroupVisibility_Hidden) + end + end + )"; + + TestMaterialData testData; + testData.Setup( + MaterialPropertyDataType::UInt, "general.mode", + MaterialPropertyDataType::Float, "otherGroup.value", + functorScript); + + AZStd::unordered_set changedPropertyNames; + AZStd::unordered_map propertyDynamicMetadata; + propertyDynamicMetadata[Name{"general.mode"}] = {}; + propertyDynamicMetadata[Name{"otherGroup.value"}] = {}; + + AZStd::unordered_set changedPropertyGroupNames; + AZStd::unordered_map propertyGroupDynamicMetadata; + propertyGroupDynamicMetadata[Name{"general"}] = {}; + propertyGroupDynamicMetadata[Name{"otherGroup"}] = {}; + + Ptr functor = testData.GetMaterialTypeAsset()->GetMaterialFunctors()[0]; + + AZ::RPI::MaterialFunctor::EditorContext context = AZ::RPI::MaterialFunctor::EditorContext( + testData.GetMaterial()->GetPropertyValues(), + testData.GetMaterial()->GetMaterialPropertiesLayout(), + propertyDynamicMetadata, + propertyGroupDynamicMetadata, + changedPropertyNames, + changedPropertyGroupNames, + &functor->GetMaterialPropertyDependencies() + ); + + testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{0u}); + functor->Process(context); + EXPECT_EQ(MaterialPropertyGroupVisibility::Enabled, propertyGroupDynamicMetadata[Name{"general"}].m_visibility); + EXPECT_EQ(MaterialPropertyGroupVisibility::Hidden, propertyGroupDynamicMetadata[Name{"otherGroup"}].m_visibility); + + testData.GetMaterial()->SetPropertyValue(testData.GetMaterialPropertyIndex(), MaterialPropertyValue{1u}); + functor->Process(context); + EXPECT_EQ(MaterialPropertyGroupVisibility::Enabled, propertyGroupDynamicMetadata[Name{"general"}].m_visibility); + EXPECT_EQ(MaterialPropertyGroupVisibility::Enabled, propertyGroupDynamicMetadata[Name{"otherGroup"}].m_visibility); + } TEST_F(LuaMaterialFunctorTests, LuaMaterialFunctor_RuntimeContext_SetRenderStates) { diff --git a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp index 5a81ebb74d..d32c285780 100644 --- a/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Material/MaterialPropertySerializerTests.cpp @@ -29,6 +29,7 @@ namespace JsonSerializationTests { AZ::RPI::MaterialTypeSourceData::Reflect(context.get()); AZ::RPI::MaterialPropertyDescriptor::Reflect(context.get()); + AZ::RPI::ReflectMaterialDynamicMetadata(context.get()); } void Reflect(AZStd::unique_ptr& context) diff --git a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp index 980a9ac320..1ec14c6169 100644 --- a/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/Model/ModelTests.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -917,6 +918,43 @@ namespace UnitTest } } + TEST_F(ModelTests, UvStream) + { + AZ::RPI::UvStreamTangentBitmask uvStreamTangentBitmask; + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0u); + + uvStreamTangentBitmask.ApplyTangent(1u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(0u), 1u); + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x10000001); + EXPECT_EQ(uvStreamTangentBitmask.GetUvStreamCount(), 1u); + + uvStreamTangentBitmask.ApplyTangent(5u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(0u), 1u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(1u), 5u); + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x20000051); + EXPECT_EQ(uvStreamTangentBitmask.GetUvStreamCount(), 2u); + + uvStreamTangentBitmask.ApplyTangent(100u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(0u), 1u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(1u), 5u); + EXPECT_EQ(uvStreamTangentBitmask.GetTangentAtUv(2u), AZ::RPI::UvStreamTangentBitmask::UnassignedTangent); + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x30000F51); + EXPECT_EQ(uvStreamTangentBitmask.GetUvStreamCount(), 3u); + + for (uint32_t i = 3; i < AZ::RPI::UvStreamTangentBitmask::MaxUvSlots; ++i) + { + uvStreamTangentBitmask.ApplyTangent(0u); + } + + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x70000F51); + + AZ_TEST_START_TRACE_SUPPRESSION; + uvStreamTangentBitmask.ApplyTangent(0u); + AZ_TEST_STOP_TRACE_SUPPRESSION(1); + + EXPECT_EQ(uvStreamTangentBitmask.GetFullTangentBitmask(), 0x70000F51); + } + // This class creates a Model with one LOD, whose mesh contains 2 planes. Plane 1 is in the XY plane at Z=-0.5, and // plane 2 is in the XY plane at Z=0.5. The two planes each have 9 quads which have been triangulated. It only has // a position and index buffer. diff --git a/Gems/Atom/RPI/Code/Tests/System/GpuQueryTests.cpp b/Gems/Atom/RPI/Code/Tests/System/GpuQueryTests.cpp index e55ec8012b..98ff6befdd 100644 --- a/Gems/Atom/RPI/Code/Tests/System/GpuQueryTests.cpp +++ b/Gems/Atom/RPI/Code/Tests/System/GpuQueryTests.cpp @@ -159,7 +159,9 @@ namespace UnitTest const uint32_t ResultSize = sizeof(uint64_t); uint64_t mockData; - const RHI::FrameGraphExecuteContext::Descriptor desc = {}; + RHI::FrameGraphExecuteContext::Descriptor desc = {}; + uint64_t dummyCommandList; + desc.m_commandList = reinterpret_cast(&dummyCommandList); RHI::FrameGraphExecuteContext context(desc); RHI::Scope scope; @@ -209,7 +211,9 @@ namespace UnitTest const uint32_t ResultSize = sizeof(uint64_t) * 4u; uint64_t mockData; - const RHI::FrameGraphExecuteContext::Descriptor desc = {}; + RHI::FrameGraphExecuteContext::Descriptor desc = {}; + uint64_t dummyCommandList; + desc.m_commandList = reinterpret_cast(&dummyCommandList); RHI::FrameGraphExecuteContext context(desc); RHI::Scope scope; @@ -273,7 +277,9 @@ namespace UnitTest const uint32_t ResultSize = sizeof(uint64_t) * 2u; uint64_t mockData; - const RHI::FrameGraphExecuteContext::Descriptor desc = {}; + RHI::FrameGraphExecuteContext::Descriptor desc = {}; + uint64_t dummyCommandList; + desc.m_commandList = reinterpret_cast(&dummyCommandList); RHI::FrameGraphExecuteContext context(desc); RHI::Scope scope; diff --git a/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake index a8d3a0230d..2fcae8be90 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_edit_files.cmake @@ -35,6 +35,7 @@ set(FILES Include/Atom/RPI.Edit/Shader/ShaderSourceData.h Include/Atom/RPI.Edit/Shader/ShaderVariantListSourceData.h Include/Atom/RPI.Edit/Shader/ShaderVariantAssetCreator.h + Include/Atom/RPI.Edit/Shader/ShaderVariantAssetCreator2.h Include/Atom/RPI.Edit/Shader/ShaderVariantTreeAssetCreator.h Source/RPI.Edit/Material/LuaMaterialFunctorSourceData.cpp Source/RPI.Edit/Material/MaterialTypeSourceData.cpp @@ -52,6 +53,7 @@ set(FILES Source/RPI.Edit/Shader/ShaderSourceData.cpp Source/RPI.Edit/Shader/ShaderVariantListSourceData.cpp Source/RPI.Edit/Shader/ShaderVariantAssetCreator.cpp + Source/RPI.Edit/Shader/ShaderVariantAssetCreator2.cpp Source/RPI.Edit/Shader/ShaderVariantTreeAssetCreator.cpp Source/RPI.Edit/Common/AssetUtils.cpp Source/RPI.Edit/Common/AssetAliasesSourceData.cpp diff --git a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake index 71c3190a2e..6242f3f140 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_public_files.cmake @@ -57,6 +57,7 @@ set(FILES Include/Atom/RPI.Public/Model/ModelLod.h Include/Atom/RPI.Public/Model/ModelLodUtils.h Include/Atom/RPI.Public/Model/ModelSystem.h + Include/Atom/RPI.Public/Model/UvStreamTangentBitmask.h Include/Atom/RPI.Public/Pass/AttachmentReadback.h Include/Atom/RPI.Public/Pass/ComputePass.h Include/Atom/RPI.Public/Pass/CopyPass.h @@ -81,8 +82,11 @@ set(FILES Include/Atom/RPI.Public/Pass/Specific/SelectorPass.h Include/Atom/RPI.Public/Pass/Specific/SwapChainPass.h Include/Atom/RPI.Public/Shader/Shader.h + Include/Atom/RPI.Public/Shader/Shader2.h Include/Atom/RPI.Public/Shader/ShaderReloadNotificationBus.h + Include/Atom/RPI.Public/Shader/ShaderReloadNotificationBus2.h Include/Atom/RPI.Public/Shader/ShaderVariant.h + Include/Atom/RPI.Public/Shader/ShaderVariant2.h Include/Atom/RPI.Public/Shader/ShaderReloadDebugTracker.h Include/Atom/RPI.Public/Shader/ShaderResourceGroup.h Include/Atom/RPI.Public/Shader/ShaderResourceGroupPool.h @@ -133,6 +137,7 @@ set(FILES Source/RPI.Public/Model/ModelLod.cpp Source/RPI.Public/Model/ModelLodUtils.cpp Source/RPI.Public/Model/ModelSystem.cpp + Source/RPI.Public/Model/UvStreamTangentBitmask.cpp Source/RPI.Public/Pass/AttachmentReadback.cpp Source/RPI.Public/Pass/ComputePass.cpp Source/RPI.Public/Pass/CopyPass.cpp @@ -155,7 +160,9 @@ set(FILES Source/RPI.Public/Pass/Specific/SelectorPass.cpp Source/RPI.Public/Pass/Specific/SwapChainPass.cpp Source/RPI.Public/Shader/Shader.cpp + Source/RPI.Public/Shader/Shader2.cpp Source/RPI.Public/Shader/ShaderVariant.cpp + Source/RPI.Public/Shader/ShaderVariant2.cpp Source/RPI.Public/Shader/ShaderReloadDebugTracker.cpp Source/RPI.Public/Shader/ShaderResourceGroup.cpp Source/RPI.Public/Shader/ShaderResourceGroupPool.cpp diff --git a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake index d1db00aa34..3a4e1cacc6 100644 --- a/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake +++ b/Gems/Atom/RPI/Code/atom_rpi_reflect_files.cmake @@ -55,6 +55,7 @@ set(FILES Include/Atom/RPI.Reflect/Material/MaterialAsset.h Include/Atom/RPI.Reflect/Material/MaterialAssetCreatorCommon.h Include/Atom/RPI.Reflect/Material/MaterialAssetCreator.h + Include/Atom/RPI.Reflect/Material/MaterialDynamicMetadata.h Include/Atom/RPI.Reflect/Material/MaterialPropertyDescriptor.h Include/Atom/RPI.Reflect/Material/MaterialPropertiesLayout.h Include/Atom/RPI.Reflect/Material/MaterialPropertyValue.h @@ -75,8 +76,11 @@ set(FILES Include/Atom/RPI.Reflect/Pass/PassTemplate.h Include/Atom/RPI.Reflect/Pass/RasterPassData.h Include/Atom/RPI.Reflect/Pass/RenderPassData.h + Include/Atom/RPI.Reflect/Shader/ShaderCommonTypes.h Include/Atom/RPI.Reflect/Shader/ShaderAsset.h Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator.h + Include/Atom/RPI.Reflect/Shader/ShaderAsset2.h + Include/Atom/RPI.Reflect/Shader/ShaderAssetCreator2.h Include/Atom/RPI.Reflect/Shader/ShaderInputContract.h Include/Atom/RPI.Reflect/Shader/ShaderOptionGroup.h Include/Atom/RPI.Reflect/Shader/ShaderOptionGroupLayout.h @@ -87,7 +91,9 @@ set(FILES Include/Atom/RPI.Reflect/Shader/ShaderVariantKey.h Include/Atom/RPI.Reflect/Shader/ShaderVariantTreeAsset.h Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset.h + Include/Atom/RPI.Reflect/Shader/ShaderVariantAsset2.h Include/Atom/RPI.Reflect/Shader/IShaderVariantFinder.h + Include/Atom/RPI.Reflect/Shader/IShaderVariantFinder2.h Include/Atom/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.h Include/Atom/RPI.Reflect/System/AnyAsset.h Include/Atom/RPI.Reflect/System/AssetAliases.h @@ -135,6 +141,7 @@ set(FILES Source/RPI.Reflect/Material/MaterialAssetCreatorCommon.cpp Source/RPI.Reflect/Material/MaterialAssetCreator.cpp Source/RPI.Reflect/Material/LuaMaterialFunctor.cpp + Source/RPI.Reflect/Material/MaterialDynamicMetadata.cpp Source/RPI.Reflect/Material/MaterialPropertyDescriptor.cpp Source/RPI.Reflect/Material/MaterialPropertiesLayout.cpp Source/RPI.Reflect/Material/MaterialTypeAsset.cpp @@ -145,8 +152,11 @@ set(FILES Source/RPI.Reflect/Pass/PassAttachmentReflect.cpp Source/RPI.Reflect/Pass/PassRequest.cpp Source/RPI.Reflect/Pass/PassTemplate.cpp + Source/RPI.Reflect/Shader/ShaderStageType.cpp Source/RPI.Reflect/Shader/ShaderAsset.cpp Source/RPI.Reflect/Shader/ShaderAssetCreator.cpp + Source/RPI.Reflect/Shader/ShaderAsset2.cpp + Source/RPI.Reflect/Shader/ShaderAssetCreator2.cpp Source/RPI.Reflect/Shader/ShaderInputContract.cpp Source/RPI.Reflect/Shader/ShaderOptionGroup.cpp Source/RPI.Reflect/Shader/ShaderOptionGroupLayout.cpp @@ -156,6 +166,7 @@ set(FILES Source/RPI.Reflect/Shader/ShaderVariantKey.cpp Source/RPI.Reflect/Shader/ShaderVariantTreeAsset.cpp Source/RPI.Reflect/Shader/ShaderVariantAsset.cpp + Source/RPI.Reflect/Shader/ShaderVariantAsset2.cpp Source/RPI.Reflect/Shader/PrecompiledShaderAssetSourceData.cpp Source/RPI.Reflect/System/AnyAsset.cpp Source/RPI.Reflect/System/AssetAliases.cpp diff --git a/Gems/Atom/RPI/gem.json b/Gems/Atom/RPI/gem.json new file mode 100644 index 0000000000..7e822611a9 --- /dev/null +++ b/Gems/Atom/RPI/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_RPI", + "display_name": "Atom API", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material b/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material index 4c3a925e52..c9276216eb 100644 --- a/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material +++ b/Gems/Atom/TestData/TestData/Materials/ParallaxRock.material @@ -17,7 +17,6 @@ "textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg" }, "parallax": { - "enable": true, "algorithm": "POM", "factor": 0.03, "quality": "High", 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 f43f6d0808..c359fea3b5 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_brass_baseColor.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", "useTexture": false }, "detailLayerGroup": { @@ -30,7 +30,7 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_normal.tif" + "textureMap": "Objects/Lucy/Lucy_normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, 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 c611b992b6..ce42f32b67 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,7 +29,7 @@ }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_normal.tif" + "textureMap": "Objects/Lucy/Lucy_normal.png" }, "subsurfaceScattering": { "enableSubsurfaceScattering": true, diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material index b2a3eac890..415bd36dcf 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material @@ -4,6 +4,10 @@ "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { + "blend": { + "enableLayer2": true, + "enableLayer3": true + }, "layer1_baseColor": { "color": [ 0.3495536744594574, @@ -32,7 +36,6 @@ "diffuseTextureMap": "TestData/Textures/cc0/bark1_disp.jpg" }, "layer1_parallax": { - "enable": true, "factor": 0.02500000037252903, "textureMap": "TestData/Textures/cc0/bark1_disp.jpg" }, @@ -76,7 +79,6 @@ "specularTextureMap": "TestData/Textures/cc0/Tiles009_1K_Displacement.jpg" }, "layer2_parallax": { - "enable": true, "factor": 0.01600000075995922, "textureMap": "TestData/Textures/cc0/Lava004_1K_Displacement.jpg" }, @@ -84,6 +86,10 @@ "textureMap": "TestData/Textures/cc0/Lava004_1K_Roughness.jpg" }, "layer2_uv": { + "center": [ + 0.0, + 0.0 + ], "offsetU": 0.5, "offsetV": 0.25 }, @@ -114,7 +120,6 @@ "diffuseTextureMap": "TestData/Textures/cc0/PaintedMetal003_1K_Displacement.jpg" }, "layer3_parallax": { - "enable": true, "factor": 0.004999999888241291, "textureMap": "TestData/Textures/cc0/PaintedMetal003_1K_Displacement.jpg" }, @@ -127,15 +132,25 @@ "factor": 0.47474750876426699 }, "layer3_uv": { + "center": [ + 0.0, + 0.0 + ], "offsetU": 0.11999999731779099, "rotateDegrees": -57.599998474121097 }, "parallax": { - "enable": true + "quality": "Medium" }, "uv": { - "offsetU": -0.2800000011920929, - "rotateDegrees": 39.599998474121097 + "center": [ + 0.10000000149011612, + 0.20000000298023225 + ], + "offsetU": 0.23000000417232514, + "offsetV": -0.23999999463558198, + "rotateDegrees": 39.599998474121097, + "scale": 1.100000023841858 } } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material new file mode 100644 index 0000000000..d91cfb34eb --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer2Off.material @@ -0,0 +1,11 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "enableLayer2": false + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material new file mode 100644 index 0000000000..3ee48df612 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures_Layer3Off.material @@ -0,0 +1,11 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/001_ManyFeatures.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "enableLayer3": false + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material index e7903a8c91..64adf317a9 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material @@ -4,6 +4,10 @@ "parentMaterial": "", "propertyLayoutVersion": 3, "properties": { + "blend": { + "enableLayer2": true, + "enableLayer3": true + }, "layer1_baseColor": { "textureMap": "TestData/Textures/cc0/bark1_col.jpg" }, @@ -11,7 +15,6 @@ "textureMap": "TestData/Textures/cc0/bark1_norm.jpg" }, "layer1_parallax": { - "enable": true, "factor": 0.03999999910593033, "textureMap": "TestData/Textures/cc0/bark1_disp.jpg" }, @@ -28,8 +31,8 @@ "textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg" }, "layer2_parallax": { - "enable": true, "factor": 0.05299999937415123, + "offset": -0.024000000208616258, "textureMap": "TestData/Textures/cc0/Rock030_2K_Displacement.jpg" }, "layer2_roughness": { @@ -45,8 +48,8 @@ "textureMap": "TestData/Textures/cc0/Concrete019_1K_Color.jpg" }, "parallax": { - "enable": true, - "pdo": true + "pdo": true, + "quality": "Medium" } } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_DepthMaps.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material similarity index 81% rename from Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_DepthMaps.material rename to Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material index d41e116067..ffcbf3ce7e 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_DepthMaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMask.material @@ -4,8 +4,8 @@ "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", "propertyLayoutVersion": 3, "properties": { - "general": { - "debugDrawMode": "DepthMaps" + "blend": { + "debugDrawMode": "BlendMask" } } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMaskValues.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material similarity index 79% rename from Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMaskValues.material rename to Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material index 94a1ec6a30..8d13ac781f 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendMaskValues.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_BlendWeights.material @@ -4,8 +4,8 @@ "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", "propertyLayoutVersion": 3, "properties": { - "general": { - "debugDrawMode": "BlendMaskValues" + "blend": { + "debugDrawMode": "FinalBlendWeights" } } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material new file mode 100644 index 0000000000..7aff50cb56 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/003_Debug_Displacement.material @@ -0,0 +1,11 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/002_ParallaxPdo.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "debugDrawMode": "Displacement" + } + } +} diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material index ea3ffab467..ea3ea8b519 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/004_UseVertexColors.material @@ -5,7 +5,10 @@ "propertyLayoutVersion": 3, "properties": { "blend": { - "blendSource": "VertexColors" + "blendSource": "BlendMaskVertexColors" + }, + "parallax": { + "quality": "Medium" } } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material new file mode 100644 index 0000000000..9163fe0a0c --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material @@ -0,0 +1,81 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "blendSource": "Displacement", + "displacementBlendDistance": 0.008999999612569809, + "enableLayer2": true, + "enableLayer3": true + }, + "layer1_baseColor": { + "textureMap": "TestData/Textures/cc0/Ground033_1K_Color.jpg" + }, + "layer1_normal": { + "textureMap": "TestData/Textures/cc0/Ground033_1K_Normal.jpg" + }, + "layer1_occlusion": { + "diffuseTextureMap": "TestData/Textures/cc0/Ground033_1K_AmbientOcclusion.jpg" + }, + "layer1_parallax": { + "factor": 0.017000000923871995, + "offset": -0.006000000052154064, + "textureMap": "TestData/Textures/cc0/Ground033_1K_Displacement.jpg" + }, + "layer1_roughness": { + "textureMap": "TestData/Textures/cc0/Ground033_1K_Roughness.jpg" + }, + "layer2_baseColor": { + "textureMap": "TestData/Textures/cc0/Rock030_2K_Color.jpg" + }, + "layer2_normal": { + "textureMap": "TestData/Textures/cc0/Rock030_2K_Normal.jpg" + }, + "layer2_occlusion": { + "diffuseTextureMap": "TestData/Textures/cc0/Rocks002_1K_AmbientOcclusion.jpg" + }, + "layer2_parallax": { + "factor": 0.03099999949336052, + "offset": 0.0020000000949949028, + "textureMap": "TestData/Textures/cc0/Rock030_2K_Displacement.jpg" + }, + "layer2_roughness": { + "textureMap": "TestData/Textures/cc0/Rock030_2K_Roughness.jpg" + }, + "layer2_uv": { + "center": [ + 0.0, + 0.0 + ], + "offsetU": 0.1599999964237213, + "offsetV": 0.07999999821186066, + "rotateDegrees": 90.0 + }, + "layer3_baseColor": { + "textureMap": "TestData/Textures/cc0/Rocks002_1K_Color.jpg" + }, + "layer3_normal": { + "textureMap": "TestData/Textures/cc0/Rocks002_1K_Normal.jpg" + }, + "layer3_parallax": { + "factor": 0.027000000700354577, + "textureMap": "TestData/Textures/cc0/Rocks002_1K_Displacement.jpg" + }, + "layer3_roughness": { + "textureMap": "TestData/Textures/cc0/Rocks002_1K_Roughness.jpg" + }, + "layer3_uv": { + "center": [ + 0.0, + 0.0 + ], + "scale": 3.4999988079071047 + }, + "parallax": { + "algorithm": "Relief", + "pdo": true + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material new file mode 100644 index 0000000000..9413e35128 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer2Off.material @@ -0,0 +1,11 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "enableLayer2": false + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material new file mode 100644 index 0000000000..93e0b21780 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_Layer3Off.material @@ -0,0 +1,11 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "enableLayer3": false + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material new file mode 100644 index 0000000000..6b062f6d1e --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material @@ -0,0 +1,14 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "blendSource": "Displacement_With_BlendMaskTexture" + }, + "layer1_parallax": { + "offset": -0.004000000189989805 + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material new file mode 100644 index 0000000000..0e6519afd4 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_AllSameHeight.material @@ -0,0 +1,23 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "displacementBlendDistance": 0.0010000000474974514 + }, + "layer1_parallax": { + "offset": -0.00800000037997961, + "textureMap": "" + }, + "layer2_parallax": { + "offset": -0.00800000037997961, + "textureMap": "" + }, + "layer3_parallax": { + "offset": -0.00800000037997961, + "textureMap": "" + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material new file mode 100644 index 0000000000..b5b5656084 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture_NoHeightmaps.material @@ -0,0 +1,20 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskTexture.material", + "propertyLayoutVersion": 3, + "properties": { + "layer1_parallax": { + "offset": -0.03200000151991844, + "textureMap": "" + }, + "layer2_parallax": { + "offset": -0.00800000037997961, + "textureMap": "" + }, + "layer3_parallax": { + "offset": -0.00800000037997961, + "textureMap": "" + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material new file mode 100644 index 0000000000..8461ea429c --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement_With_BlendMaskVertexColors.material @@ -0,0 +1,15 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardMultilayerPBR.materialtype", + "parentMaterial": "TestData/Materials/StandardMultilayerPbrTestCases/005_UseDisplacement.material", + "propertyLayoutVersion": 3, + "properties": { + "blend": { + "blendSource": "Displacement_With_BlendMaskVertexColors", + "displacementBlendDistance": 0.02387000061571598 + }, + "parallax": { + "enable": false + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material new file mode 100644 index 0000000000..1716792af1 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/009_Opacity_TintedTransparent.material @@ -0,0 +1,23 @@ +{ + "description": "", + "materialType": "Materials/Types/StandardPBR.materialtype", + "parentMaterial": "", + "propertyLayoutVersion": 3, + "properties": { + "baseColor": { + "color": [ + 0.5906767249107361, + 1.0, + 0.11703670024871826, + 1.0 + ], + "textureMap": "Textures/Default/default_basecolor.tif" + }, + "opacity": { + "alphaSource": "Split", + "factor": 0.75, + "mode": "TintedTransparent", + "textureMap": "TestData/Textures/checker8x8_gray_512.png" + } + } +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material index a94d90d04d..ed070d5de2 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM.material @@ -8,7 +8,6 @@ }, "parallax": { "algorithm": "POM", - "enable": true, "factor": 0.02500000037252903, "quality": "High", "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material index fb862dc5d3..f5ec0e8287 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/012_Parallax_POM_Cutout.material @@ -13,13 +13,15 @@ "textureMap": "TestData/Textures/checker8x8_512.png" }, "parallax": { - "algorithm": "POM", - "enable": true, "factor": 0.10000000149011612, "quality": "High", "textureMap": "TestData/Textures/TextureHaven/4k_castle_brick_02_red/4k_castle_brick_02_red_disp.png" }, "uv": { + "center": [ + 0.0, + 0.0 + ], "scale": 0.5 } } diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material index dbaf6cb587..38adbc70cd 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/015_SubsurfaceScattering_Transmission.material @@ -6,7 +6,6 @@ "properties": { "subsurfaceScattering": { "enableSubsurfaceScattering": true, - "enableTransmission": true, "scatterDistance": 64.6464614868164, "subsurfaceScatterFactor": 1.0, "thicknessMap": "TestData/Textures/checker8x8_512.png", diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material index 7bf12e5358..b3e69212db 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_A.material @@ -13,7 +13,6 @@ }, "parallax": { "algorithm": "POM", - "enable": true, "factor": 0.10000000149011612, "quality": "High", "textureMap": "TestData/Objects/cube/cube_diff.tif" diff --git a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material index 4b9f233a85..3d52f3b9e6 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/100_UvTiling_Parallax_B.material @@ -13,7 +13,6 @@ }, "parallax": { "algorithm": "POM", - "enable": true, "factor": 0.05000000074505806, "quality": "High", "textureMap": "TestData/Objects/cube/cube_diff.tif" 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 2c711a3bf3..6d77be5a49 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/101_DetailMaps_LucyBaseNoDetailMaps.material @@ -5,21 +5,27 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_brass_baseColor.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, + "detailUV": { + "center": [ + 0.0, + 0.0 + ] + }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_brass_metalness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_normal.tif", + "textureMap": "Objects/Lucy/Lucy_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_brass_roughness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } -} +} \ No newline at end of file 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 7a94386a18..1a29f392c8 100644 --- a/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material +++ b/Gems/Atom/TestData/TestData/Materials/StandardPbrTestCases/102_DetailMaps_All.material @@ -5,7 +5,7 @@ "propertyLayoutVersion": 3, "properties": { "baseColor": { - "textureMap": "Objects/Lucy/Lucy_brass_baseColor.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { @@ -19,20 +19,24 @@ "normalDetailStrength": 1.5 }, "detailUV": { + "center": [ + 0.0, + 0.0 + ], "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_brass_metalness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_normal.tif", + "textureMap": "Objects/Lucy/Lucy_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_brass_roughness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } -} +} \ No newline at end of file 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 ddeace43da..a69b72b623 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_brass_baseColor.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_BaseColor.png", "textureMapUv": "Unwrapped" }, "detailLayerGroup": { @@ -18,20 +18,24 @@ "normalDetailStrength": 1.5 }, "detailUV": { + "center": [ + 0.0, + 0.0 + ], "scale": 10.0 }, "metallic": { - "textureMap": "Objects/Lucy/Lucy_brass_metalness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Metallic.png", "textureMapUv": "Unwrapped" }, "normal": { "flipY": true, - "textureMap": "Objects/Lucy/Lucy_normal.tif", + "textureMap": "Objects/Lucy/Lucy_Normal.png", "textureMapUv": "Unwrapped" }, "roughness": { - "textureMap": "Objects/Lucy/Lucy_brass_roughness.tif", + "textureMap": "Objects/Lucy/Lucy_bronze_Roughness.png", "textureMapUv": "Unwrapped" } } -} +} \ No newline at end of file diff --git a/Gems/Atom/TestData/TestData/Objects/PaintedPlane.fbx b/Gems/Atom/TestData/TestData/Objects/PaintedPlane.fbx new file mode 100644 index 0000000000..be30ca4639 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Objects/PaintedPlane.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:053a7cd73b37c815900f87abd524830e6f23eee75d3b72fb866e86498d528159 +size 36156 diff --git a/Gems/Atom/TestData/TestData/Textures/Foliage_Leaves_0_BaseColor.dds.assetinfo b/Gems/Atom/TestData/TestData/Textures/Foliage_Leaves_0_BaseColor.dds.assetinfo index 2ec31e38ce..1aa896a8d7 100644 --- a/Gems/Atom/TestData/TestData/Textures/Foliage_Leaves_0_BaseColor.dds.assetinfo +++ b/Gems/Atom/TestData/TestData/Textures/Foliage_Leaves_0_BaseColor.dds.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_AmbientOcclusion.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_AmbientOcclusion.jpg new file mode 100644 index 0000000000..04d871dd2b --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_AmbientOcclusion.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9ec269d03a9552c0ecf24778912fa6190c412b006433db8b7c40e1c0c83e6f7 +size 516915 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Color.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Color.jpg new file mode 100644 index 0000000000..d41658d177 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Color.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b53c4aca020d5833618a5b73b6578c8693dd14e603eb32681e2c7ecc90f59047 +size 1020622 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Displacement.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Displacement.jpg new file mode 100644 index 0000000000..913b35875c --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Displacement.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46ea8a9406ce6df21ce3a6045aac5b1421ce119919ff050951277dd76464ee2c +size 258716 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Normal.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Normal.jpg new file mode 100644 index 0000000000..7c216001a9 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Normal.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac1ad9bea240374bfc6aaaacc42e24eadfbf93c7185617fc1c52e610cb45cb69 +size 1292910 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Roughness.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Roughness.jpg new file mode 100644 index 0000000000..5ac9e78409 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Ground033_1K_Roughness.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fce266a7445a4d4b5bb3fbf7cb3330e0580b058aeaf2ef7f265a01641dbbdc4 +size 637326 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_AmbientOcclusion.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_AmbientOcclusion.jpg new file mode 100644 index 0000000000..772529329e --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_AmbientOcclusion.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca54f762bcddc10ab2d609f10864328cb5a567c43efb8c9bcfe9cb2955db9577 +size 433887 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Color.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Color.jpg new file mode 100644 index 0000000000..8d1d23451d --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Color.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b5f5ff297aef6470045d087cf0c3341f7782e36a750965a052d49d03dd37426 +size 1595449 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Displacement.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Displacement.jpg new file mode 100644 index 0000000000..22304c19dd --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Displacement.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8753448320e0916a70036ef77a06bce746bfa45c14e62b2fbda0987a13bfbb3 +size 277114 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Normal.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Normal.jpg new file mode 100644 index 0000000000..129ecbb1b7 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Normal.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ea23ea8d85d1fffa119e481e6ac85ad3a3096470a5e12f252d37e1b293e5e37 +size 2119669 diff --git a/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Roughness.jpg b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Roughness.jpg new file mode 100644 index 0000000000..dc5f8c20a9 --- /dev/null +++ b/Gems/Atom/TestData/TestData/Textures/cc0/Rocks002_1K_Roughness.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:caa6e94f904135461da4d200fc6c21c86dc99cc7d413ea740e678f7758b2b156 +size 555680 diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h index b17a25a675..17ca1c8d04 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/DynamicProperty/DynamicProperty.h @@ -38,8 +38,8 @@ namespace AtomToolsFramework Count }; - // Configures the initial state, data type, attributes, and values that describe - // the dynamic property and how it is presented + //! Configures the initial state, data type, attributes, and values that describe + //! the dynamic property and how it is presented struct DynamicPropertyConfig { AZ_TYPE_INFO(DynamicPropertyConfig, "{9CA40E92-7F03-42BE-B6AA-51F30EE5796C}"); @@ -98,7 +98,7 @@ namespace AtomToolsFramework //! Returns true if the property has a valid value. bool IsValid() const; - //! Returns the ID of the property. + //! Returns the ID of the property. const AZ::Name GetId() const; //! Returns the current property visibility. diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorRequestBus.h index e76837137a..d9b626f631 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorRequestBus.h @@ -44,6 +44,17 @@ namespace AtomToolsFramework const AZStd::string& groupDescription, QWidget* groupWidget) = 0; + //! Sets the visibility of a specific property group. This impacts both the header and the widget. + virtual void SetGroupVisible(const AZStd::string& groupNameId, bool visible) = 0; + + //! Returns whether a specific property is visible. + //! Note this follows the same rules as QWidget::isVisible(), meaning a group could be not visible due to the widget's parents being not visible. + virtual bool IsGroupVisible(const AZStd::string& groupNameId) const = 0; + + //! Returns whether a specific property is explicitly hidden. + //! Note this follows the same rules as QWidget::isHidden(), meaning a group that is hidden will not become visible automatically when the parent becomes visible. + virtual bool IsGroupHidden(const AZStd::string& groupNameId) const = 0; + //! Calls Refresh for a specific InspectorGroupWidget, allowing for non-destructive UI changes virtual void RefreshGroup(const AZStd::string& groupNameId) = 0; diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorWidget.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorWidget.h index 5fb0b731d6..5e41121b37 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorWidget.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Inspector/InspectorWidget.h @@ -57,6 +57,10 @@ namespace AtomToolsFramework const AZStd::string& groupDescription, QWidget* groupWidget) override; + void SetGroupVisible(const AZStd::string& groupNameId, bool visible) override; + bool IsGroupVisible(const AZStd::string& groupNameId) const override; + bool IsGroupHidden(const AZStd::string& groupNameId) const override; + void RefreshGroup(const AZStd::string& groupNameId) override; void RebuildGroup(const AZStd::string& groupNameId) override; @@ -79,6 +83,13 @@ namespace AtomToolsFramework private: QVBoxLayout* m_layout = nullptr; QScopedPointer m_ui; - AZStd::unordered_map> m_groups; + + struct GroupWidgetPair + { + InspectorGroupHeaderWidget* m_header; + QWidget* m_panel; + }; + + AZStd::unordered_map m_groups; }; } // namespace AtomToolsFramework diff --git a/Code/Sandbox/Editor/ModernViewportCameraController.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraController.h similarity index 82% rename from Code/Sandbox/Editor/ModernViewportCameraController.h rename to Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraController.h index 066c8efaa8..1318deb355 100644 --- a/Code/Sandbox/Editor/ModernViewportCameraController.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraController.h @@ -12,17 +12,18 @@ #pragma once -#include - #include +#include #include #include #include -namespace SandboxEditor +namespace AtomToolsFramework { class ModernViewportCameraControllerInstance; - class ModernViewportCameraController : public AzFramework::MultiViewportController + class ModularViewportCameraController + : public AzFramework::MultiViewportController< + ModernViewportCameraControllerInstance, AzFramework::ViewportControllerPriority::DispatchToAllPriorities> { public: using CameraListBuilder = AZStd::function; @@ -37,19 +38,19 @@ namespace SandboxEditor }; class ModernViewportCameraControllerInstance final - : public AzFramework::MultiViewportControllerInstanceInterface, - public ModernViewportCameraControllerRequestBus::Handler, + : public AzFramework::MultiViewportControllerInstanceInterface, + public ModularViewportCameraControllerRequestBus::Handler, private AzFramework::ViewportDebugDisplayEventBus::Handler { public: - explicit ModernViewportCameraControllerInstance(AzFramework::ViewportId viewportId, ModernViewportCameraController* controller); + explicit ModernViewportCameraControllerInstance(AzFramework::ViewportId viewportId, ModularViewportCameraController* controller); ~ModernViewportCameraControllerInstance() override; // MultiViewportControllerInstanceInterface overrides ... bool HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) override; void UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) override; - // ModernViewportCameraControllerRequestBus overrides ... + // ModularViewportCameraControllerRequestBus overrides ... void InterpolateToTransform(const AZ::Transform& worldFromLocal) override; private: @@ -74,4 +75,4 @@ namespace SandboxEditor AZ::RPI::ViewportContext::MatrixChangedEvent::Handler m_cameraViewMatrixChangeHandler; }; -} // namespace SandboxEditor +} // namespace AtomToolsFramework diff --git a/Code/Sandbox/Editor/ModernViewportCameraControllerRequestBus.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h similarity index 78% rename from Code/Sandbox/Editor/ModernViewportCameraControllerRequestBus.h rename to Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h index 966facc8e9..5b90119372 100644 --- a/Code/Sandbox/Editor/ModernViewportCameraControllerRequestBus.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h @@ -20,11 +20,11 @@ namespace AZ class Transform; } -namespace SandboxEditor +namespace AtomToolsFramework { //! Provides an interface to control the modern viewport camera controller from the Editor. //! @note The bus is addressed by viewport id. - class ModernViewportCameraControllerRequests : public AZ::EBusTraits + class ModularViewportCameraControllerRequests : public AZ::EBusTraits { public: using BusIdType = AzFramework::ViewportId; @@ -35,8 +35,8 @@ namespace SandboxEditor virtual void InterpolateToTransform(const AZ::Transform& worldFromLocal) = 0; protected: - ~ModernViewportCameraControllerRequests() = default; + ~ModularViewportCameraControllerRequests() = default; }; - using ModernViewportCameraControllerRequestBus = AZ::EBus; -} // namespace SandboxEditor + using ModularViewportCameraControllerRequestBus = AZ::EBus; +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h index a41c8221f0..f2c120dbcd 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Include/AtomToolsFramework/Viewport/RenderViewportWidget.h @@ -98,6 +98,7 @@ namespace AtomToolsFramework AZStd::optional ViewportScreenToWorld(const AzFramework::ScreenPoint& screenPosition, float depth) override; AZStd::optional ViewportScreenToWorldRay( const AzFramework::ScreenPoint& screenPosition) override; + float DeviceScalingFactor() override; //! Set interface for providing viewport specific settings (e.g. snapping properties). void SetViewportSettings(const AzToolsFramework::ViewportInteraction::ViewportSettings* viewportSettings); diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp index 0259120d9b..097a819e49 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Inspector/InspectorWidget.cpp @@ -74,7 +74,7 @@ namespace AtomToolsFramework groupWidget->setParent(m_ui->m_propertyContent); m_layout->addWidget(groupWidget); - m_groups[groupNameId] = AZStd::make_pair(groupHeader, groupWidget); + m_groups[groupNameId] = {groupHeader, groupWidget}; connect(groupHeader, &InspectorGroupHeaderWidget::clicked, this, [this, groupNameId](QMouseEvent* event) { OnHeaderClicked(groupNameId, event); @@ -91,6 +91,38 @@ namespace AtomToolsFramework CollapseGroup(groupNameId); } } + + void InspectorWidget::SetGroupVisible(const AZStd::string& groupNameId, bool visible) + { + auto groupItr = m_groups.find(groupNameId); + if (groupItr != m_groups.end()) + { + groupItr->second.m_header->setVisible(visible); + groupItr->second.m_panel->setVisible(visible && groupItr->second.m_header->IsExpanded()); + } + } + + bool InspectorWidget::IsGroupVisible(const AZStd::string& groupNameId) const + { + auto groupItr = m_groups.find(groupNameId); + if (groupItr != m_groups.end()) + { + return groupItr->second.m_header->isVisible(); + } + + return false; + } + + bool InspectorWidget::IsGroupHidden(const AZStd::string& groupNameId) const + { + auto groupItr = m_groups.find(groupNameId); + if (groupItr != m_groups.end()) + { + return groupItr->second.m_header->isHidden(); + } + + return false; + } void InspectorWidget::RefreshGroup(const AZStd::string& groupNameId) { @@ -129,8 +161,8 @@ namespace AtomToolsFramework auto groupItr = m_groups.find(groupNameId); if (groupItr != m_groups.end()) { - groupItr->second.first->SetExpanded(true); - groupItr->second.second->setVisible(true); + groupItr->second.m_header->SetExpanded(true); + groupItr->second.m_panel->setVisible(true); } } @@ -139,23 +171,23 @@ namespace AtomToolsFramework auto groupItr = m_groups.find(groupNameId); if (groupItr != m_groups.end()) { - groupItr->second.first->SetExpanded(false); - groupItr->second.second->setVisible(false); + groupItr->second.m_header->SetExpanded(false); + groupItr->second.m_panel->setVisible(false); } } bool InspectorWidget::IsGroupExpanded(const AZStd::string& groupNameId) const { auto groupItr = m_groups.find(groupNameId); - return groupItr != m_groups.end() ? groupItr->second.first->IsExpanded() : false; + return groupItr != m_groups.end() ? groupItr->second.m_header->IsExpanded() : false; } void InspectorWidget::ExpandAll() { for (auto& groupPair : m_groups) { - groupPair.second.first->SetExpanded(true); - groupPair.second.second->setVisible(true); + groupPair.second.m_header->SetExpanded(true); + groupPair.second.m_panel->setVisible(true); } } @@ -163,8 +195,8 @@ namespace AtomToolsFramework { for (auto& groupPair : m_groups) { - groupPair.second.first->SetExpanded(false); - groupPair.second.second->setVisible(false); + groupPair.second.m_header->SetExpanded(false); + groupPair.second.m_panel->setVisible(false); } } diff --git a/Code/Sandbox/Editor/ModernViewportCameraController.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/ModularViewportCameraController.cpp similarity index 78% rename from Code/Sandbox/Editor/ModernViewportCameraController.cpp rename to Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/ModularViewportCameraController.cpp index af161af493..6fb3edfa22 100644 --- a/Code/Sandbox/Editor/ModernViewportCameraController.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/ModularViewportCameraController.cpp @@ -10,10 +10,9 @@ * */ -#include "ModernViewportCameraController.h" - #include #include +#include #include #include #include @@ -23,7 +22,7 @@ #include #include -namespace SandboxEditor +namespace AtomToolsFramework { // debug void DrawPreviewAxis(AzFramework::DebugDisplayRequests& display, const AZ::Transform& transform, const float axisLength) @@ -53,12 +52,12 @@ namespace SandboxEditor return viewportContext; } - void ModernViewportCameraController::SetCameraListBuilderCallback(const CameraListBuilder& builder) + void ModularViewportCameraController::SetCameraListBuilderCallback(const CameraListBuilder& builder) { m_cameraListBuilder = builder; } - void ModernViewportCameraController::SetupCameras(AzFramework::Cameras& cameras) + void ModularViewportCameraController::SetupCameras(AzFramework::Cameras& cameras) { if (m_cameraListBuilder) { @@ -67,8 +66,8 @@ namespace SandboxEditor } ModernViewportCameraControllerInstance::ModernViewportCameraControllerInstance( - const AzFramework::ViewportId viewportId, ModernViewportCameraController* controller) - : MultiViewportControllerInstanceInterface(viewportId, controller) + const AzFramework::ViewportId viewportId, ModularViewportCameraController* controller) + : MultiViewportControllerInstanceInterface(viewportId, controller) { controller->SetupCameras(m_cameraSystem.m_cameras); @@ -88,26 +87,43 @@ namespace SandboxEditor } AzFramework::ViewportDebugDisplayEventBus::Handler::BusConnect(AzToolsFramework::GetEntityContextId()); - ModernViewportCameraControllerRequestBus::Handler::BusConnect(viewportId); + ModularViewportCameraControllerRequestBus::Handler::BusConnect(viewportId); } ModernViewportCameraControllerInstance::~ModernViewportCameraControllerInstance() { - ModernViewportCameraControllerRequestBus::Handler::BusDisconnect(); + ModularViewportCameraControllerRequestBus::Handler::BusDisconnect(); AzFramework::ViewportDebugDisplayEventBus::Handler::BusDisconnect(); } + // should the camera system respond to this particular event + static bool ShouldHandle(const AzFramework::ViewportControllerPriority priority, const bool exclusive) + { + // ModernViewportCameraControllerInstance receives events at all priorities, it should only respond + // to normal priority events if it is not in 'exclusive' mode and when in 'exclusive' mode it should + // only respond to the highest priority events + return !exclusive && priority == AzFramework::ViewportControllerPriority::Normal || + exclusive && priority == AzFramework::ViewportControllerPriority::Highest; + } + bool ModernViewportCameraControllerInstance::HandleInputChannelEvent(const AzFramework::ViewportControllerInputEvent& event) { - AzFramework::WindowSize windowSize; - AzFramework::WindowRequestBus::EventResult( - windowSize, event.m_windowHandle, &AzFramework::WindowRequestBus::Events::GetClientAreaSize); + if (ShouldHandle(event.m_priority, m_cameraSystem.m_cameras.Exclusive())) + { + return m_cameraSystem.HandleEvents(AzFramework::BuildInputEvent(event.m_inputChannel)); + } - return m_cameraSystem.HandleEvents(AzFramework::BuildInputEvent(event.m_inputChannel, windowSize)); + return false; } void ModernViewportCameraControllerInstance::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) { + // only update for a single priority (normal is the default) + if (event.m_priority != AzFramework::ViewportControllerPriority::Normal) + { + return; + } + if (auto viewportContext = RetrieveViewportContext(GetViewportId())) { m_updatingTransform = true; @@ -165,4 +181,4 @@ namespace SandboxEditor m_transformStart = m_camera.Transform(); m_transformEnd = worldFromLocal; } -} // namespace SandboxEditor +} // namespace AtomToolsFramework diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp index cee178c724..35edb3af5b 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/Source/Viewport/RenderViewportWidget.cpp @@ -313,8 +313,7 @@ namespace AtomToolsFramework // Scale the size by the DPI of the platform to // get the proper size in pixels. const QSize uiWindowSize = size(); - const qreal deficePixelRatio = devicePixelRatioF(); - const QSize windowSize = uiWindowSize * deficePixelRatio; + const QSize windowSize = uiWindowSize * devicePixelRatioF(); const AzFramework::NativeWindowHandle windowId = reinterpret_cast(winId()); AzFramework::WindowNotificationBus::Event(windowId, &AzFramework::WindowNotifications::OnWindowResized, windowSize.width(), windowSize.height()); @@ -465,6 +464,11 @@ namespace AtomToolsFramework return AzToolsFramework::ViewportInteraction::ProjectedViewportRay{rayOrigin, rayDirection}; } + float RenderViewportWidget::DeviceScalingFactor() + { + return aznumeric_cast(devicePixelRatioF()); + } + AzFramework::ScreenPoint RenderViewportWidget::ViewportCursorScreenPosition() { return AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(m_mousePosition.toPoint()); diff --git a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake index d8ceccc724..f28ba89b92 100644 --- a/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake +++ b/Gems/Atom/Tools/AtomToolsFramework/Code/atomtoolsframework_files.cmake @@ -24,6 +24,8 @@ set(FILES Include/AtomToolsFramework/Util/MaterialPropertyUtil.h Include/AtomToolsFramework/Util/Util.h Include/AtomToolsFramework/Viewport/RenderViewportWidget.h + Include/AtomToolsFramework/Viewport/ModularViewportCameraController.h + Include/AtomToolsFramework/Viewport/ModularViewportCameraControllerRequestBus.h Source/Communication/LocalServer.cpp Source/Communication/LocalSocket.cpp Source/Debug/TraceRecorder.cpp @@ -38,4 +40,5 @@ set(FILES Source/Util/MaterialPropertyUtil.cpp Source/Util/Util.cpp Source/Viewport/RenderViewportWidget.cpp + Source/Viewport/ModularViewportCameraController.cpp ) diff --git a/Gems/Atom/Tools/AtomToolsFramework/gem.json b/Gems/Atom/Tools/AtomToolsFramework/gem.json new file mode 100644 index 0000000000..3060d3f51a --- /dev/null +++ b/Gems/Atom/Tools/AtomToolsFramework/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "AtomToolsFramework", + "display_name": "Atom Tools Framework", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentNotificationBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentNotificationBus.h index 3c3c77a628..80e8054ec5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentNotificationBus.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentNotificationBus.h @@ -18,6 +18,7 @@ #include #include +#include namespace MaterialEditor { @@ -77,6 +78,12 @@ namespace MaterialEditor //! @param documentId unique id of material document for which the notification is sent //! @param property object containing the property value and configuration that was modified virtual void OnDocumentPropertyConfigModified([[maybe_unused]] const AZ::Uuid& documentId, [[maybe_unused]] const AtomToolsFramework::DynamicProperty& property) {} + + //! Signal that the property group visibility has been changed. + //! @param documentId unique id of material document for which the notification is sent + //! @param groupId id of the group that changed + //! @param visible whether the property group is visible + virtual void OnDocumentPropertyGroupVisibilityChanged([[maybe_unused]] const AZ::Uuid& documentId, [[maybe_unused]] const AZ::Name& groupId, [[maybe_unused]] bool visible) {} }; using MaterialDocumentNotificationBus = AZ::EBus; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h index dad21a6348..c71d500d8c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Document/MaterialDocumentRequestBus.h @@ -19,6 +19,7 @@ #include #include +#include namespace AZ { @@ -67,6 +68,10 @@ namespace MaterialEditor //! Returns a property object //! If the document is not open or the id can't be found, an invalid property is returned. virtual const AtomToolsFramework::DynamicProperty& GetProperty(const AZ::Name& propertyFullName) const = 0; + + //! Returns whether a property group is visible + //! If the document is not open or the id can't be found, returns false. + virtual bool IsPropertyGroupVisible(const AZ::Name& propertyGroupFullName) const = 0; //! Modify material property value virtual void SetPropertyValue(const AZ::Name& propertyFullName, const AZStd::any& value) = 0; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h index 2acdc79286..837762b49c 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Include/Atom/Viewport/InputController/MaterialEditorViewportInputControllerBus.h @@ -47,6 +47,9 @@ namespace MaterialEditor //! @param distanceMax furthest camera can be from the target virtual void GetExtents(float& distanceMin, float& distanceMax) const = 0; + //! Get bounding sphere radius of the active model + virtual float GetRadius() const = 0; + //! Reset camera to default position and rotation virtual void Reset() = 0; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp index 288530a4e4..301fd69025 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.cpp @@ -117,6 +117,24 @@ namespace MaterialEditor const AtomToolsFramework::DynamicProperty& property = it->second; return property; } + + bool MaterialDocument::IsPropertyGroupVisible(const AZ::Name& propertyGroupFullName) const + { + if (!IsOpen()) + { + AZ_Error("MaterialDocument", false, "Material document is not open."); + return false; + } + + const auto it = m_propertyGroupVisibility.find(propertyGroupFullName); + if (it == m_propertyGroupVisibility.end()) + { + AZ_Error("MaterialDocument", false, "Material document property group could not be found: '%s'.", propertyGroupFullName.GetCStr()); + return false; + } + + return it->second; + } void MaterialDocument::SetPropertyValue(const AZ::Name& propertyFullName, const AZStd::any& value) { @@ -153,8 +171,12 @@ namespace MaterialEditor Recompile(); - AZStd::unordered_set changedPropertyNames = RunEditorMaterialFunctors(dirtyFlags); - for (const Name& changedPropertyName : changedPropertyNames) + EditorMaterialFunctorResult result = RunEditorMaterialFunctors(dirtyFlags); + for (const Name& changedPropertyGroupName : result.m_updatedPropertyGroups) + { + MaterialDocumentNotificationBus::Broadcast(&MaterialDocumentNotificationBus::Events::OnDocumentPropertyGroupVisibilityChanged, m_id, changedPropertyGroupName, IsPropertyGroupVisible(changedPropertyGroupName)); + } + for (const Name& changedPropertyName : result.m_updatedProperties) { MaterialDocumentNotificationBus::Broadcast(&MaterialDocumentNotificationBus::Events::OnDocumentPropertyConfigModified, m_id, GetProperty(changedPropertyName)); } @@ -776,12 +798,19 @@ namespace MaterialEditor propertyConfig.m_showThumbnail = true; propertyConfig.m_originalValue = AtomToolsFramework::ConvertToEditableType(m_materialAsset->GetPropertyValues()[propertyIndex.GetIndex()]); propertyConfig.m_parentValue = AtomToolsFramework::ConvertToEditableType(parentPropertyValues[propertyIndex.GetIndex()]); - propertyConfig.m_groupName = m_materialTypeSourceData.FindGroup(groupNameId)->m_displayName; + auto groupDefinition = m_materialTypeSourceData.FindGroup(groupNameId); + propertyConfig.m_groupName = groupDefinition ? groupDefinition->m_displayName : groupNameId; m_properties[propertyConfig.m_id] = AtomToolsFramework::DynamicProperty(propertyConfig); } return true; }); + // Populate the property group visibility map + for (MaterialTypeSourceData::GroupDefinition& group : m_materialTypeSourceData.GetGroupDefinitionsInDisplayOrder()) + { + m_propertyGroupVisibility[AZ::Name{group.m_nameId}] = true; + } + // Adding properties for material type and parent as part of making dynamic // properties and the inspector more general purpose. // This allows the read only properties to appear in the inspector like any @@ -914,16 +943,26 @@ namespace MaterialEditor } } - AZStd::unordered_set MaterialDocument::RunEditorMaterialFunctors(AZ::RPI::MaterialPropertyFlags dirtyFlags) + MaterialDocument::EditorMaterialFunctorResult MaterialDocument::RunEditorMaterialFunctors(AZ::RPI::MaterialPropertyFlags dirtyFlags) { - AZStd::unordered_set changedPropertyNames; + EditorMaterialFunctorResult result; + AZStd::unordered_map propertyDynamicMetadata; + AZStd::unordered_map propertyGroupDynamicMetadata; for (auto& propertyPair : m_properties) { AtomToolsFramework::DynamicProperty& property = propertyPair.second; AtomToolsFramework::ConvertToPropertyMetaData(propertyDynamicMetadata[property.GetId()], property.GetConfig()); } + for (auto& groupPair : m_propertyGroupVisibility) + { + AZ::RPI::MaterialPropertyGroupDynamicMetadata& metadata = propertyGroupDynamicMetadata[AZ::Name{groupPair.first}]; + bool visible = groupPair.second; + metadata.m_visibility = visible ? + AZ::RPI::MaterialPropertyGroupVisibility::Enabled : AZ::RPI::MaterialPropertyGroupVisibility::Hidden; + } + for (AZ::RPI::Ptr& functor : m_editorFunctors) { const AZ::RPI::MaterialPropertyFlags& materialPropertyDependencies = functor->GetMaterialPropertyDependencies(); @@ -935,7 +974,9 @@ namespace MaterialEditor m_materialInstance->GetPropertyValues(), m_materialInstance->GetMaterialPropertiesLayout(), propertyDynamicMetadata, - changedPropertyNames, + propertyGroupDynamicMetadata, + result.m_updatedProperties, + result.m_updatedPropertyGroups, &materialPropertyDependencies ); functor->Process(context); @@ -950,7 +991,13 @@ namespace MaterialEditor property.SetConfig(propertyConfig); } - return changedPropertyNames; + for (auto& updatedPropertyGroup : result.m_updatedPropertyGroups) + { + bool visible = propertyGroupDynamicMetadata[updatedPropertyGroup].m_visibility == AZ::RPI::MaterialPropertyGroupVisibility::Enabled; + m_propertyGroupVisibility[updatedPropertyGroup] = visible; + } + + return result; } } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h index 3959e45ad7..42f48c95cd 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Document/MaterialDocument.h @@ -56,6 +56,7 @@ namespace MaterialEditor const AZ::RPI::MaterialTypeSourceData* GetMaterialTypeSourceData() const override; const AZStd::any& GetPropertyValue(const AZ::Name& propertyFullName) const override; const AtomToolsFramework::DynamicProperty& GetProperty(const AZ::Name& propertyFullName) const override; + bool IsPropertyGroupVisible(const AZ::Name& propertyGroupFullName) const override; void SetPropertyValue(const AZ::Name& propertyFullName, const AZStd::any& value) override; bool Open(AZStd::string_view loadPath) override; bool Rebuild() override; @@ -79,11 +80,14 @@ namespace MaterialEditor // Predicate for evaluating properties using PropertyFilterFunction = AZStd::function; - // Map of documenmt's property + // Map of document's properties using PropertyMap = AZStd::unordered_map; // Map of raw property values for undo/redo comparison and storage using PropertyValueMap = AZStd::unordered_map; + + // Map of document's property group visibility flags + using PropertyGroupVisibilityMap = AZStd::unordered_map; // Function to be bound for undo and redo using UndoRedoFunction = AZStd::function; @@ -119,10 +123,16 @@ namespace MaterialEditor void RestorePropertyValues(const PropertyValueMap& propertyValues); + struct EditorMaterialFunctorResult + { + AZStd::unordered_set m_updatedProperties; + AZStd::unordered_set m_updatedPropertyGroups; + }; + // Run editor material functor to update editor metadata. // @param dirtyFlags indicates which properties have changed, and thus which MaterialFunctors need to be run. - // @return names for the set of properties that have been changed or need update. - AZStd::unordered_set RunEditorMaterialFunctors(AZ::RPI::MaterialPropertyFlags dirtyFlags); + // @return names for the set of properties and groups that have been changed or need update. + EditorMaterialFunctorResult RunEditorMaterialFunctors(AZ::RPI::MaterialPropertyFlags dirtyFlags); // Unique id of this material document AZ::Uuid m_id = AZ::Uuid::CreateRandom(); @@ -153,6 +163,9 @@ namespace MaterialEditor // Collection of all material's properties PropertyMap m_properties; + + // Collection of all material's property groups + PropertyGroupVisibilityMap m_propertyGroupVisibility; // Material functors that run in editor. See MaterialFunctor.h for details. AZStd::vector> m_editorFunctors; @@ -175,7 +188,7 @@ namespace MaterialEditor int m_undoHistoryIndex = 0; AZStd::any m_invalidValue; - + AtomToolsFramework::DynamicProperty m_invalidProperty; }; } // namespace MaterialEditor diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp index 159d3339be..877a3affb1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.cpp @@ -44,6 +44,8 @@ namespace MaterialEditor MaterialEditorViewportInputControllerRequestBus::BroadcastResult( m_targetPosition, &MaterialEditorViewportInputControllerRequestBus::Handler::GetTargetPosition); + MaterialEditorViewportInputControllerRequestBus::BroadcastResult( + m_radius, &MaterialEditorViewportInputControllerRequestBus::Handler::GetRadius); } void Behavior::End() @@ -119,7 +121,8 @@ namespace MaterialEditor float Behavior::GetSensitivityZ() { - return 0.001f; + // adjust zooming sensitivity by model size, so that large models zoom at the same speed as smaller ones + return 0.001f * AZ::GetMax(0.5f, m_radius); } AZ::Quaternion Behavior::LookRotation(AZ::Vector3 forward) diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.h index 7c32ed33a0..205301c90e 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/Behavior.h @@ -54,6 +54,8 @@ namespace MaterialEditor float m_y = 0; //! delta scroll wheel accumulated during current frame float m_z = 0; + //! Model radius + float m_radius = 1.0f; AZ::EntityId m_cameraEntityId; AZ::Vector3 m_targetPosition = AZ::Vector3::CreateZero(); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp index 36e4b76cec..420e2732d0 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.cpp @@ -114,6 +114,11 @@ namespace MaterialEditor distanceMax = m_distanceMax; } + float MaterialEditorViewportInputController::GetRadius() const + { + return m_radius; + } + void MaterialEditorViewportInputController::UpdateViewport(const AzFramework::ViewportControllerUpdateEvent& event) { if (m_keysChanged) @@ -306,11 +311,10 @@ namespace MaterialEditor if (modelAsset.IsReady()) { const AZ::Aabb& aabb = modelAsset->GetAabb(); - float radius; - aabb.GetAsSphere(m_modelCenter, radius); + aabb.GetAsSphere(m_modelCenter, m_radius); m_distanceMin = 0.5f * AZ::GetMin(AZ::GetMin(aabb.GetExtents().GetX(), aabb.GetExtents().GetY()), aabb.GetExtents().GetZ()) + DepthNear; - m_distanceMax = radius * MaxDistanceMultiplier; + m_distanceMax = m_radius * MaxDistanceMultiplier; } } } diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h index ee40b5c259..7308ce4ea1 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/InputController/MaterialEditorViewportInputController.h @@ -43,6 +43,7 @@ namespace MaterialEditor void SetTargetPosition(const AZ::Vector3& targetPosition) override; float GetDistanceToTarget() const override; void GetExtents(float& distanceMin, float& distanceMax) const override; + float GetRadius() const override; void Reset() override; void SetFieldOfView(float value) override; bool IsCameraCentered() const override; @@ -96,6 +97,8 @@ namespace MaterialEditor float m_distanceMin = 1.0f; //! Maximum distance from camera to target float m_distanceMax = 10.0f; + //! Model radius + float m_radius = 1.0f; //! True if camera is centered on a model bool m_isCameraCentered = true; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp index c7265e0039..b08f5b1165 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Viewport/MaterialViewportRenderer.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -182,9 +183,10 @@ namespace MaterialEditor m_shadowCatcherEntity->CreateComponent(AZ::Render::MeshComponentTypeId); m_shadowCatcherEntity->CreateComponent(AZ::Render::MaterialComponentTypeId); m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); + m_shadowCatcherEntity->CreateComponent(azrtti_typeid()); m_shadowCatcherEntity->Activate(); - AZ::TransformBus::Event(m_shadowCatcherEntity->GetId(), &AZ::TransformBus::Events::SetLocalScale, AZ::Vector3{ 100, 100, 1.0 }); + AZ::NonUniformScaleRequestBus::Event(m_shadowCatcherEntity->GetId(), &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3{ 100, 100, 1.0 }); AZ::Data::AssetId shadowCatcherModelAssetId = RPI::AssetUtils::GetAssetIdForProductPath("materialeditor/viewportmodels/plane_1x1.azmodel", RPI::AssetUtils::TraceLevel::Error); AZ::Render::MeshComponentRequestBus::Event(m_shadowCatcherEntity->GetId(), diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp index 6a4bb8c0f4..887019787b 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/CreateMaterialDialog/CreateMaterialDialog.cpp @@ -71,6 +71,8 @@ namespace MaterialEditor QObject::connect(m_ui->m_materialTypeComboBox, static_cast(&QComboBox::currentIndexChanged), this, [this]() { UpdateMaterialTypeSelection(); }); QObject::connect(m_ui->m_materialTypeComboBox, &QComboBox::currentTextChanged, this, [this]() { UpdateMaterialTypeSelection(); }); + m_ui->m_materialTypeComboBox->model()->sort(0, Qt::AscendingOrder); + // Select the default material type from settings auto settings = AZ::UserSettings::CreateFind(AZ::Crc32("MaterialDocumentSettings"), AZ::UserSettings::CT_GLOBAL); diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp index 55e098962a..706d365027 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.cpp @@ -198,6 +198,11 @@ namespace MaterialEditor &group, &group, group.TYPEINFO_Uuid(), this, this, GetGroupSaveStateKey(groupNameId), [this](const auto source, const auto target) { return CompareInstanceNodeProperties(source, target); }); AddGroup(groupNameId, groupDisplayName, groupDescription, propertyGroupWidget); + + bool isGroupVisible = false; + MaterialDocumentRequestBus::EventResult( + isGroupVisible, m_documentId, &MaterialDocumentRequestBus::Events::IsPropertyGroupVisible, AZ::Name{groupNameId}); + SetGroupVisible(groupNameId, isGroupVisible); } } @@ -221,8 +226,7 @@ namespace MaterialEditor } } - void MaterialInspector::OnDocumentPropertyConfigModified( - const AZ::Uuid& documentId, const AtomToolsFramework::DynamicProperty& property) + void MaterialInspector::OnDocumentPropertyConfigModified(const AZ::Uuid&, const AtomToolsFramework::DynamicProperty& property) { for (auto& groupPair : m_groups) { @@ -234,20 +238,23 @@ namespace MaterialEditor if (reflectedProperty.GetVisibility() != property.GetVisibility()) { reflectedProperty.SetConfig(property.GetConfig()); - AtomToolsFramework::InspectorRequestBus::Event( - documentId, &AtomToolsFramework::InspectorRequestBus::Events::RebuildGroup, groupPair.first); + RebuildGroup(groupPair.first); } else { reflectedProperty.SetConfig(property.GetConfig()); - AtomToolsFramework::InspectorRequestBus::Event( - documentId, &AtomToolsFramework::InspectorRequestBus::Events::RefreshGroup, groupPair.first); + RefreshGroup(groupPair.first); } return; } } } } + + void MaterialInspector::OnDocumentPropertyGroupVisibilityChanged(const AZ::Uuid&, const AZ::Name& groupId, bool visible) + { + SetGroupVisible(groupId.GetStringView(), visible); + } void MaterialInspector::BeforePropertyModified(AzToolsFramework::InstanceDataNode* pNode) { diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h index f53e93a2f9..4080430ff5 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/MaterialInspector/MaterialInspector.h @@ -60,6 +60,7 @@ namespace MaterialEditor void OnDocumentOpened(const AZ::Uuid& documentId) override; void OnDocumentPropertyValueModified(const AZ::Uuid& documentId, const AtomToolsFramework::DynamicProperty& property) override; void OnDocumentPropertyConfigModified(const AZ::Uuid& documentId, const AtomToolsFramework::DynamicProperty& property) override; + void OnDocumentPropertyGroupVisibilityChanged(const AZ::Uuid& documentId, const AZ::Name& groupId, bool visible) override; // AzToolsFramework::IPropertyEditorNotify overrides... void BeforePropertyModified(AzToolsFramework::InstanceDataNode* pNode) override; diff --git a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp index 8da7c903a2..004d600e62 100644 --- a/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp +++ b/Gems/Atom/Tools/MaterialEditor/Code/Source/Window/ToolBar/MaterialEditorToolBar.cpp @@ -24,6 +24,7 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin #include #include #include +#include AZ_POP_DISABLE_WARNING namespace MaterialEditor @@ -86,11 +87,13 @@ namespace MaterialEditor // Add model combo box auto modelPresetComboBox = new ModelPresetComboBox(this); modelPresetComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); + modelPresetComboBox->view()->setMinimumWidth(200); addWidget(modelPresetComboBox); // Add lighting preset combo box auto lightingPresetComboBox = new LightingPresetComboBox(this); lightingPresetComboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); + lightingPresetComboBox->view()->setMinimumWidth(200); addWidget(lightingPresetComboBox); MaterialViewportNotificationBus::Handler::BusConnect(); diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h index 06b8f13f65..d575049b23 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Include/Atom/Document/ShaderManagementConsoleDocumentRequestBus.h @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h index f0570841f3..6c3a2f55bf 100644 --- a/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h +++ b/Gems/Atom/Tools/ShaderManagementConsole/Code/Source/Document/ShaderManagementConsoleDocument.h @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl index fa9395dffc..b3cdb591f4 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiGpuProfiler.inl @@ -727,7 +727,7 @@ namespace AZ ImGui::BeginTooltip(); ImGui::Text("Name: %s", passEntry->m_name.GetCStr()); ImGui::Text("Path: %s", passEntry->m_path.GetCStr()); - ImGui::Text("Duration in ticks: %" PRIu64, passEntry->m_timestampResult.GetDurationInTicks()); + ImGui::Text("Duration in ticks: %llu", static_cast(passEntry->m_timestampResult.GetDurationInTicks())); ImGui::Text("Duration in microsecond: %.3f us", passEntry->m_timestampResult.GetDurationInNanoseconds()/1000.f); ImGui::EndTooltip(); } diff --git a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiTransientAttachmentProfiler.inl b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiTransientAttachmentProfiler.inl index e7e743adda..23eb79650a 100644 --- a/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiTransientAttachmentProfiler.inl +++ b/Gems/Atom/Utils/Code/Include/Atom/Utils/ImGuiTransientAttachmentProfiler.inl @@ -269,13 +269,13 @@ namespace AZ { ImGui::BeginChild(heapMemoryId.c_str()); ImGui::SetScrollY(scrollingY); - ImGui::End(); + ImGui::EndChild(); } { ImGui::BeginChild(scopesId.c_str()); ImGui::SetScrollX(scrollingX); - ImGui::End(); + ImGui::EndChild(); } ImGui::PopStyleVar(3); diff --git a/Gems/Atom/gem.json b/Gems/Atom/gem.json index c74a9013f3..91bc9bcf53 100644 --- a/Gems/Atom/gem.json +++ b/Gems/Atom/gem.json @@ -1,3 +1,5 @@ { - "gem_name": "Atom" + "gem_name": "Atom", + "display_name": "Atom", + "summary": "Next-Gen Rendering Package for the O3DE engine" } diff --git a/AutomatedTesting/Gem/Code/Platform/Android/runtime_dependencies.cmake b/Gems/AtomContent/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/Android/runtime_dependencies.cmake rename to Gems/AtomContent/CMakeLists.txt diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Bricks038_8K/bricks038.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Bricks038_8K/bricks038.material index 25e29b55e5..82b1cdb590 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Bricks038_8K/bricks038.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Bricks038_8K/bricks038.material @@ -26,7 +26,6 @@ }, "parallax": { "algorithm": "POM", - "enable": true, "factor": 0.02500000037252903, "pdo": true, "quality": "Ultra", diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Concrete016_8K/Concrete016.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Concrete016_8K/Concrete016.material index 336d479b30..03fb0ea5be 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Concrete016_8K/Concrete016.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Concrete016_8K/Concrete016.material @@ -31,7 +31,8 @@ "algorithm": "ContactRefinement", "factor": 0.019999999552965165, "quality": "Ultra", - "textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png" + "textureMap": "Materials/Concrete016_8K/Concrete016_8K_Displacement.png", + "useTexture": false }, "roughness": { "textureMap": "Materials/Concrete016_8K/Concrete016_8K_Roughness.png" diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric001_8K/Fabric001.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric001_8K/Fabric001.material index 72610e8bb6..7d8c3d5142 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric001_8K/Fabric001.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric001_8K/Fabric001.material @@ -20,7 +20,6 @@ }, "parallax": { "algorithm": "ContactRefinement", - "enable": true, "factor": 0.004999999888241291, "quality": "Ultra", "textureMap": "Materials/Fabric001_8K/Fabric001_8K_Displacement.png" diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric030_4K/Fabric030.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric030_4K/Fabric030.material index 458ab811b6..493bfab455 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric030_4K/Fabric030.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/Fabric030_4K/Fabric030.material @@ -20,7 +20,6 @@ }, "parallax": { "algorithm": "ContactRefinement", - "enable": true, "factor": 0.0020000000949949028, "pdo": true, "quality": "Medium", diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/PaintedPlaster015_8K/PaintedPlaster015.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/PaintedPlaster015_8K/PaintedPlaster015.material index 57163f520d..a2bb2c7704 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/PaintedPlaster015_8K/PaintedPlaster015.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/PaintedPlaster015_8K/PaintedPlaster015.material @@ -19,7 +19,6 @@ }, "parallax": { "algorithm": "ContactRefinement", - "enable": true, "factor": 0.009999999776482582, "pdo": true, "quality": "Ultra", diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/baseboards.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/baseboards.material index 625d872475..f75490c2ad 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/baseboards.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/baseboards.material @@ -30,7 +30,8 @@ "factor": 0.02500000037252903, "pdo": true, "quality": "Ultra", - "textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png" + "textureMap": "Materials/Bricks038_8K/Bricks038_8K_Displacement.png", + "useTexture": false }, "roughness": { "factor": 0.4343433976173401, diff --git a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/crown.material b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/crown.material index e3c6d9eae6..d7e2050dbd 100644 --- a/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/crown.material +++ b/Gems/AtomContent/LookDevelopmentStudioPixar/Assets/Materials/crown.material @@ -22,7 +22,6 @@ }, "parallax": { "algorithm": "POM", - "enable": true, "factor": 0.02500000037252903, "pdo": true, "quality": "Ultra", diff --git a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material index ab9f366ff6..d4e2016022 100644 --- a/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material +++ b/Gems/AtomContent/ReferenceMaterials/Assets/Materials/ConcreteStucco/concrete_stucco.material @@ -19,7 +19,8 @@ }, "parallax": { "factor": 0.0010101000079885126, - "textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg" + "textureMap": "Materials/ConcreteStucco/concrete_stucco_height.jpg", + "useTexture": false }, "specularF0": { "factor": 0.5050504803657532 diff --git a/Gems/AtomContent/Sponza/Assets/license.txt b/Gems/AtomContent/Sponza/Assets/license.txt new file mode 100644 index 0000000000..e303d8c767 --- /dev/null +++ b/Gems/AtomContent/Sponza/Assets/license.txt @@ -0,0 +1,8 @@ +The content in this gem "O3DE\Gems\AtomContent\Sponza" is ported +from the original source, and modified for the O3DE Engine and Atom Renderer. + +The original "Crytek Sponza" scene data can be downloaded from the +"McGuire Computer Graphics Archive": https://casual-effects.com/data/ + +The original content is under the "CC BY 3.0" License: +https://creativecommons.org/licenses/by/3.0/ \ No newline at end of file diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_arch.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_arch.material index 1102fb150a..d95e84121c 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_arch.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_arch.material @@ -41,7 +41,8 @@ "factor": 0.050999999046325687, "pdo": true, "quality": "High", - "textureMap": "Textures/arch_1k_height.png" + "textureMap": "Textures/arch_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/arch_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_background.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_background.material index c1853250d7..710f790419 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_background.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_background.material @@ -47,7 +47,8 @@ "factor": 0.03099999949336052, "pdo": true, "quality": "High", - "textureMap": "Textures/background_1k_height.png" + "textureMap": "Textures/background_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/background_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_bricks.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_bricks.material index a269098b4d..26d64c7db9 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_bricks.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_bricks.material @@ -46,7 +46,8 @@ "algorithm": "ContactRefinement", "factor": 0.03500000014901161, "quality": "Medium", - "textureMap": "Textures/bricks_1k_height.png" + "textureMap": "Textures/bricks_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/bricks_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_ceiling.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_ceiling.material index 94225cd00e..95d08d398b 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_ceiling.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_ceiling.material @@ -48,7 +48,8 @@ "factor": 0.019999999552965165, "pdo": true, "quality": "Medium", - "textureMap": "Textures/ceiling_1k_height.png" + "textureMap": "Textures/ceiling_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/ceiling_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columna.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columna.material index 8f1cea8649..cc1f685c7c 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columna.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columna.material @@ -47,7 +47,8 @@ "factor": 0.017000000923871995, "pdo": true, "quality": "High", - "textureMap": "Textures/columnA_1k_height.png" + "textureMap": "Textures/columnA_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/columnA_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnb.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnb.material index ac474d7e76..a1e8747f65 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnb.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnb.material @@ -46,7 +46,8 @@ "factor": 0.020999999716877939, "pdo": true, "quality": "High", - "textureMap": "Textures/columnB_1k_height.png" + "textureMap": "Textures/columnB_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/columnB_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnc.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnc.material index 81fd03fc4a..6edbfde47c 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnc.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_columnc.material @@ -47,7 +47,8 @@ "factor": 0.014000000432133675, "pdo": true, "quality": "High", - "textureMap": "Textures/columnC_1k_height.png" + "textureMap": "Textures/columnC_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/columnC_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_details.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_details.material index fde599fd4c..1b66a51ec0 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_details.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_details.material @@ -38,7 +38,8 @@ "algorithm": "POM", "factor": 0.02500000037252903, "pdo": true, - "textureMap": "Textures/details_1k_height.png" + "textureMap": "Textures/details_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/details_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_flagpole.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_flagpole.material index e50e8a0ed2..19010d66e5 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_flagpole.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_flagpole.material @@ -41,7 +41,8 @@ "factor": 0.014000000432133675, "pdo": true, "quality": "High", - "textureMap": "Textures/flagpole_1k_height.png" + "textureMap": "Textures/flagpole_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/flagpole_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_floor.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_floor.material index 064a2b24a6..bee92e0edb 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_floor.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_floor.material @@ -43,7 +43,8 @@ "algorithm": "POM", "factor": 0.012000000104308129, "pdo": true, - "textureMap": "Textures/floor_1k_height.png" + "textureMap": "Textures/floor_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/floor_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_leaf.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_leaf.material index 269e1e5684..ac326ae935 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_leaf.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_leaf.material @@ -42,7 +42,8 @@ "mode": "Cutout" }, "parallax": { - "textureMap": "Textures/thorn_height.png" + "textureMap": "Textures/thorn_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/thorn_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_lion.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_lion.material index 8dc4852b03..b1f78aa33f 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_lion.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_lion.material @@ -38,7 +38,6 @@ }, "parallax": { "algorithm": "ContactRefinement", - "enable": true, "factor": 0.009999999776482582, "pdo": true, "quality": "Ultra", diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_roof.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_roof.material index 0a7246703c..a3e066a438 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_roof.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_roof.material @@ -35,7 +35,8 @@ "algorithm": "ContactRefinement", "factor": 0.019999999552965165, "quality": "Medium", - "textureMap": "Textures/roof_1k_height.png" + "textureMap": "Textures/roof_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/roof_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vase.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vase.material index 77adc798a0..dea9aa2a8a 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vase.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vase.material @@ -41,7 +41,8 @@ "factor": 0.027000000700354577, "pdo": true, "quality": "High", - "textureMap": "Textures/vase_1k_height.png" + "textureMap": "Textures/vase_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/vase_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vasehanging.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vasehanging.material index 22e78f03ae..b2a342dd76 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vasehanging.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vasehanging.material @@ -41,7 +41,8 @@ "factor": 0.04600000008940697, "pdo": true, "quality": "High", - "textureMap": "Textures/vaseHanging_1k_height.png" + "textureMap": "Textures/vaseHanging_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/vaseHanging_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vaseround.material b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vaseround.material index c773146b51..fba07379c0 100644 --- a/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vaseround.material +++ b/Gems/AtomContent/Sponza/Assets/objects/sponza_mat_vaseround.material @@ -45,7 +45,8 @@ "factor": 0.019999999552965165, "pdo": true, "quality": "High", - "textureMap": "Textures/vaseRound_1k_height.png" + "textureMap": "Textures/vaseRound_1k_height.png", + "useTexture": false }, "roughness": { "textureMap": "Textures/vaseRound_1k_roughness.png" diff --git a/Gems/AtomContent/Sponza/Assets/stub b/Gems/AtomContent/Sponza/Assets/stub deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/Gems/AtomContent/gem.json b/Gems/AtomContent/gem.json new file mode 100644 index 0000000000..941e7dea20 --- /dev/null +++ b/Gems/AtomContent/gem.json @@ -0,0 +1,14 @@ +{ + "gem_name": "AtomContent", + "origin": "The primary repo for Atom goes here: i.e. http://www.mydomain.com", + "license": "What license Atom uses goes here: i.e. https://opensource.org/licenses/MIT", + "display_name": "Atom Content", + "summary": "ontains multiple packages containing source Assets that can be used with Atom", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "AtomConent" + ], + "icon_path": "preview.png" +} diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt index c431746b40..4df40e3d13 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomBridge/Code/CMakeLists.txt @@ -66,6 +66,10 @@ ly_add_target( Gem::AtomViewportDisplayInfo ) +# Any 'runtime-like' applications should use Gem::Atom_AtomBridge: +ly_create_alias(NAME Atom_AtomBridge.Clients NAMESPACE Gem TARGETS Gem::Atom_AtomBridge) +ly_create_alias(NAME Atom_AtomBridge.Servers NAMESPACE Gem TARGETS Gem::Atom_AtomBridge) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME Atom_AtomBridge.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} @@ -106,5 +110,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AtomFont Gem::AtomToolsFramework.Editor Gem::AtomViewportDisplayInfo + Gem::AtomViewportDisplayIcons.Editor ) + + + # Any 'tool' and 'builder' type applications should use Gem::Atom_AtomBridge.Editor: + ly_create_alias(NAME Atom_AtomBridge.Builders NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Editor) + ly_create_alias(NAME Atom_AtomBridge.Tools NAMESPACE Gem TARGETS Gem::Atom_AtomBridge.Editor) endif() diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Include/AtomBridge/PerViewportDynamicDrawInterface.h b/Gems/AtomLyIntegration/AtomBridge/Code/Include/AtomBridge/PerViewportDynamicDrawInterface.h new file mode 100644 index 0000000000..f77e0b0b88 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Include/AtomBridge/PerViewportDynamicDrawInterface.h @@ -0,0 +1,44 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +namespace AZ::AtomBridge +{ + //! A simple interface for allocating a DynamicDrawContext on-demand for every viewport, based on + //! a registered initialization function. + class PerViewportDynamicDrawInterface + { + public: + AZ_RTTI(PerViewportDynamicDrawInterface, "{1FF054F5-55FF-4ADB-A86D-640B15FA0395}"); + + using DrawContextFactory = AZStd::function)>; + //! Register a named dynamic draw context that can be retrieved on a per-viewport basis. + //! GetNamedDynamicDraw context can be called on a registered context name to retrieve a + //! valid DynamicDrawContext for a given viewport. + virtual void RegisterDynamicDrawContext(AZ::Name name, DrawContextFactory contextInitializer) = 0; + + //! Unregister a previously registered named per-viewport dynamic draw context. + //! This will dispose of all dynamic draw contexts currently associated with this name. + virtual void UnregisterDynamicDrawContext(AZ::Name name) = 0; + + //! Get a dynamic draw context associated with the specified viewport based on a factory registered with + //! RegisterNamedDynamicDrawContext. This dynamic draw context will be created if it does not already exist. + virtual RHI::Ptr GetDynamicDrawContextForViewport(AZ::Name name, AzFramework::ViewportId viewportId) = 0; + }; + + using PerViewportDynamicDraw = AZ::Interface; +} // namespace AZ::AtomBridge diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.cpp index 9148cdba6f..5116d8a228 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -104,10 +105,12 @@ namespace AZ AzFramework::GameEntityContextRequestBus::BroadcastResult(m_entityContextId, &AzFramework::GameEntityContextRequestBus::Events::GetGameEntityContextId); AZ::Render::Bootstrap::NotificationBus::Handler::BusConnect(); + m_dynamicDrawManager = AZStd::make_unique(); } void AtomBridgeSystemComponent::Deactivate() { + m_dynamicDrawManager.reset(); AZ::RPI::ViewportContextManagerNotificationsBus::Handler::BusDisconnect(); RPI::Scene* scene = RPI::RPISystemInterface::Get()->GetDefaultScene().get(); // Check if scene is emptry since scene might be released already when running AtomSampleViewer @@ -158,47 +161,8 @@ namespace AZ void AtomBridgeSystemComponent::OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) { - AZStd::shared_ptr windowContext; - AZ::Render::Bootstrap::DefaultWindowBus::BroadcastResult(windowContext, &AZ::Render::Bootstrap::DefaultWindowInterface::GetDefaultWindowContext); - - if (!windowContext) - { - AZ_Warning("Atom", false, "Cannot initialize Atom because no window context is available"); - return; - } - - AZ::RPI::RenderPipelinePtr renderPipeline = bootstrapScene->GetDefaultRenderPipeline(); - - // If RenderPipeline doesn't have a default view, create a view and make it the default view. - // These settings will be overridden by the editor or game camera. - if (renderPipeline->GetDefaultView() == nullptr) - { - auto viewContextManager = AZ::Interface::Get(); - m_view = AZ::RPI::View::CreateView(AZ::Name("AtomSystem Default View"), RPI::View::UsageCamera); - viewContextManager->PushView(viewContextManager->GetDefaultViewportContextName(), m_view); - const auto& viewport = windowContext->GetViewport(); - const float aspectRatio = viewport.m_maxX / viewport.m_maxY; - - // Note: This is projection assumes a setup for reversed depth - AZ::Matrix4x4 viewToClipMatrix; - AZ::MakePerspectiveFovMatrixRH(viewToClipMatrix, AZ::Constants::HalfPi, aspectRatio, 0.1f, 100.f, true); - - m_view->SetViewToClipMatrix(viewToClipMatrix); - - renderPipeline = bootstrapScene->GetDefaultRenderPipeline(); - renderPipeline->SetDefaultView(m_view); - } - else - { - m_view = renderPipeline->GetDefaultView(); - } - auto auxGeomFP = bootstrapScene->GetFeatureProcessor(); - if (auxGeomFP) - { - auxGeomFP->GetOrCreateDrawQueueForView(m_view.get()); - } - - // Make default AtomDebugDisplayViewportInterface for the scene + AZ_UNUSED(bootstrapScene); + // Make default AtomDebugDisplayViewportInterface AZStd::shared_ptr mainEntityDebugDisplay = AZStd::make_shared(AzFramework::g_defaultSceneEntityDebugDisplayId); m_activeViewportsList[AzFramework::g_defaultSceneEntityDebugDisplayId] = mainEntityDebugDisplay; } diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.h b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.h index da75d3c35c..4d05ba9285 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.h +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomBridgeSystemComponent.h @@ -33,6 +33,7 @@ namespace AZ { // forward declares class AtomDebugDisplayViewportInterface; + class PerViewportDynamicDrawManager; class AtomBridgeSystemComponent : public Component @@ -82,6 +83,7 @@ namespace AZ RPI::ViewPtr m_view = nullptr; AZStd::unordered_map > m_activeViewportsList; + AZStd::unique_ptr m_dynamicDrawManager; }; } } // namespace AZ diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp index 482bd21972..6c68618f78 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.cpp @@ -576,6 +576,29 @@ namespace AZ::AtomBridge } } + void AtomDebugDisplayViewportInterface::DrawWireOBB( + const AZ::Vector3& center, + const AZ::Vector3& axisX, + const AZ::Vector3& axisY, + const AZ::Vector3& axisZ, + const AZ::Vector3& halfExtents) + { + if (m_auxGeomPtr) + { + AZ::Quaternion rotation = AZ::Quaternion::CreateFromMatrix3x3(AZ::Matrix3x3::CreateFromColumns(axisX, axisY, axisZ)); + AZ::Obb obb = AZ::Obb::CreateFromPositionRotationAndHalfLengths(center, rotation, halfExtents); + m_auxGeomPtr->DrawObb( + obb, + AZ::Vector3::CreateZero(), + m_rendState.m_color, + AZ::RPI::AuxGeomDraw::DrawStyle::Line, + m_rendState.m_depthTest, + m_rendState.m_depthWrite, + m_rendState.m_faceCullMode, + m_rendState.m_viewProjOverrideIndex); + } + } + void AtomDebugDisplayViewportInterface::DrawSolidOBB( const AZ::Vector3& center, const AZ::Vector3& axisX, @@ -906,7 +929,28 @@ namespace AZ::AtomBridge } } - void AtomDebugDisplayViewportInterface::DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded) + void AtomDebugDisplayViewportInterface::DrawWireCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height) + { + if (m_auxGeomPtr) + { + const AZ::Vector3 worldPos = ToWorldSpacePosition(pos); + const AZ::Vector3 worldDir = ToWorldSpaceVector(dir); + m_auxGeomPtr->DrawCone( + worldPos, + worldDir, + radius, + height, + m_rendState.m_color, + AZ::RPI::AuxGeomDraw::DrawStyle::Line, + m_rendState.m_depthTest, + m_rendState.m_depthWrite, + m_rendState.m_faceCullMode, + m_rendState.m_viewProjOverrideIndex + ); + } + } + + void AtomDebugDisplayViewportInterface::DrawSolidCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded) { if (m_auxGeomPtr) { @@ -1336,8 +1380,6 @@ namespace AZ::AtomBridge { AZ_Assert(false, "Unexpected use of legacy api, please file a feature request with the rendering team to get this implemented!"); } - // unhandledled on Atom - virtual void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; - // void AtomDebugDisplayViewportInterface::DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; void AtomDebugDisplayViewportInterface::SetLineWidth(float width) { diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.h b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.h index 18d280ef88..69d0fc6d96 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.h +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/AtomDebugDisplayViewportInterface.h @@ -153,6 +153,7 @@ namespace AZ::AtomBridge void DrawTrianglesIndexed(const AZStd::vector& vertices, const AZStd::vector& indices, const AZ::Color& color) override; void DrawWireBox(const AZ::Vector3& min, const AZ::Vector3& max) override; void DrawSolidBox(const AZ::Vector3& min, const AZ::Vector3& max) override; + void DrawWireOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) override; void DrawSolidOBB(const AZ::Vector3& center, const AZ::Vector3& axisX, const AZ::Vector3& axisY, const AZ::Vector3& axisZ, const AZ::Vector3& halfExtents) override; void DrawPoint(const AZ::Vector3& p, int nSize = 1) override; void DrawLine(const AZ::Vector3& p1, const AZ::Vector3& p2) override; @@ -167,7 +168,8 @@ namespace AZ::AtomBridge void DrawArc(const AZ::Vector3& pos, float radius, float startAngleDegrees, float sweepAngleDegrees, float angularStepDegrees, const AZ::Vector3& fixedAxis) override; void DrawCircle(const AZ::Vector3& pos, float radius, int nUnchangedAxis = 2 /*z axis*/) override; void DrawHalfDottedCircle(const AZ::Vector3& pos, float radius, const AZ::Vector3& viewPos, int nUnchangedAxis = 2 /*z axis*/) override; - void DrawCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded) override; + void DrawWireCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height) override; + void DrawSolidCone(const AZ::Vector3& pos, const AZ::Vector3& dir, float radius, float height, bool drawShaded) override; void DrawWireCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height) override; void DrawSolidCylinder(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float height, bool drawShaded) override; void DrawWireCapsule(const AZ::Vector3& center, const AZ::Vector3& axis, float radius, float heightStraightSection) override; @@ -180,11 +182,8 @@ namespace AZ::AtomBridge void DrawTextLabel(const AZ::Vector3& pos, float size, const char* text, const bool bCenter = false, int srcOffsetX = 0, int srcOffsetY = 0) override; void Draw2dTextLabel(float x, float y, float size, const char* text, bool bCenter = false) override; void DrawTextOn2DBox(const AZ::Vector3& pos, const char* text, float textScale, const AZ::Vector4& TextColor, const AZ::Vector4& TextBackColor) override; - // unhandled on Atom - virtual void DrawTextureLabel(ITexture* texture, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; - // void DrawTextureLabel(int textureId, const AZ::Vector3& pos, float sizeX, float sizeY, int texIconFlags) override; void SetLineWidth(float width) override; bool IsVisible(const AZ::Aabb& bounds) override; - // int SetFillMode(int nFillMode) override; float GetLineWidth() override; float GetAspectRatio() override; void DepthTestOff() override; diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.cpp new file mode 100644 index 0000000000..b6ff116a86 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.cpp @@ -0,0 +1,119 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include "PerViewportDynamicDrawManager.h" + +#include +#include + +namespace AZ::AtomBridge +{ + PerViewportDynamicDrawManager::PerViewportDynamicDrawManager() + { + PerViewportDynamicDraw::Register(this); + } + + PerViewportDynamicDrawManager::~PerViewportDynamicDrawManager() + { + PerViewportDynamicDraw::Unregister(this); + } + + void PerViewportDynamicDrawManager::RegisterDynamicDrawContext(AZ::Name name, DrawContextFactory contextInitializer) + { + AZStd::lock_guard lock(m_mutexDrawContexts); + + const bool alreadyRegistered = m_registeredDrawContexts.find(name) != m_registeredDrawContexts.end(); + AZ_Error("AtomBridge", !alreadyRegistered, "Attempted to call RegisterDynamicDrawContext for already registered name: \"%s\"", name.GetCStr()); + if (alreadyRegistered) + { + return; + } + m_registeredDrawContexts[name] = contextInitializer; + } + + void PerViewportDynamicDrawManager::UnregisterDynamicDrawContext(AZ::Name name) + { + AZStd::lock_guard lock(m_mutexDrawContexts); + + auto drawContextFactoryIt = m_registeredDrawContexts.find(name); + const bool registered = drawContextFactoryIt != m_registeredDrawContexts.end(); + AZ_Error("AtomBridge", registered, "Attempted to call UnregisterDynamicDrawContext for unregistered name: \"%s\"", name.GetCStr()); + if (!registered) + { + return; + } + m_registeredDrawContexts.erase(drawContextFactoryIt); + + for (auto& viewportData : m_viewportData) + { + viewportData.second.m_dynamicDrawContexts.erase(name); + } + } + + RHI::Ptr PerViewportDynamicDrawManager::GetDynamicDrawContextForViewport( + AZ::Name name, AzFramework::ViewportId viewportId) + { + AZStd::lock_guard lock(m_mutexDrawContexts); + + auto contextFactoryIt = m_registeredDrawContexts.find(name); + if (contextFactoryIt == m_registeredDrawContexts.end()) + { + return nullptr; + } + + auto viewportContextManager = RPI::ViewportContextRequests::Get(); + RPI::ViewportContextPtr viewportContext = viewportContextManager->GetViewportContextById(viewportId); + if (viewportContext == nullptr) + { + return nullptr; + } + + // Get or create a ViewportData if one doesn't already exist + ViewportData& viewportData = m_viewportData[viewportId]; + if (!viewportData.m_initialized) + { + viewportData.m_pipelineChangedHandler = AZ::Event::Handler([this, viewportId](RPI::RenderPipelinePtr pipeline) + { + AZStd::lock_guard lock(m_mutexDrawContexts); + ViewportData& viewportData = m_viewportData[viewportId]; + for (auto& context : viewportData.m_dynamicDrawContexts) + { + context.second->SetRenderPipeline(pipeline.get()); + } + }); + viewportData.m_viewportDestroyedHandler = AZ::Event::Handler([this, viewportId](AzFramework::ViewportId id) + { + AZStd::lock_guard lock(m_mutexDrawContexts); + m_viewportData.erase(id); + }); + + viewportContext->ConnectCurrentPipelineChangedHandler(viewportData.m_pipelineChangedHandler); + viewportContext->ConnectAboutToBeDestroyedHandler(viewportData.m_viewportDestroyedHandler); + + viewportData.m_initialized = true; + } + + RHI::Ptr& context = viewportData.m_dynamicDrawContexts[name]; + if (context == nullptr) + { + auto pipeline = viewportContext->GetCurrentPipeline().get(); + if (pipeline == nullptr) + { + return nullptr; + } + context = RPI::DynamicDrawInterface::Get()->CreateDynamicDrawContext(pipeline); + contextFactoryIt->second(context); + } + + return context; + } +} //namespace AZ::AtomBridge diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.h b/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.h new file mode 100644 index 0000000000..e2b442915c --- /dev/null +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/PerViewportDynamicDrawManager.h @@ -0,0 +1,48 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +namespace AZ::AtomBridge +{ + class PerViewportDynamicDrawManager final : public PerViewportDynamicDrawInterface + { + public: + AZ_TYPE_INFO(PerViewportDynamicDrawManager, "{BED66185-00A7-43F7-BD28-C56BC8E4C535}"); + + PerViewportDynamicDrawManager(); + ~PerViewportDynamicDrawManager(); + + // PerViewportDynamicDrawInterface overrides... + void RegisterDynamicDrawContext(AZ::Name name, DrawContextFactory contextInitializer) override; + void UnregisterDynamicDrawContext(AZ::Name name) override; + RHI::Ptr GetDynamicDrawContextForViewport(AZ::Name name, AzFramework::ViewportId viewportId) override; + + private: + struct ViewportData + { + AZStd::unordered_map> m_dynamicDrawContexts; + + // Event handlers + AZ::Event::Handler m_pipelineChangedHandler; + AZ::Event::Handler m_viewportDestroyedHandler; + + // Cached state + bool m_initialized = false; + }; + AZStd::map m_viewportData; + AZStd::unordered_map m_registeredDrawContexts; + AZStd::mutex m_mutexDrawContexts; + }; +} //namespace AZ::AtomBridge diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/atombridge_files.cmake b/Gems/AtomLyIntegration/AtomBridge/Code/atombridge_files.cmake index f272d323ae..969030f922 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/atombridge_files.cmake +++ b/Gems/AtomLyIntegration/AtomBridge/Code/atombridge_files.cmake @@ -12,10 +12,13 @@ set(FILES Include/AtomBridge/AtomBridgeBus.h Include/AtomBridge/FlyCameraInputBus.h + Include/AtomBridge/PerViewportDynamicDrawInterface.h Source/AtomBridgeSystemComponent.cpp Source/AtomBridgeSystemComponent.h - Source/FlyCameraInputComponent.cpp - Source/FlyCameraInputComponent.h Source/AtomDebugDisplayViewportInterface.cpp Source/AtomDebugDisplayViewportInterface.h + Source/FlyCameraInputComponent.cpp + Source/FlyCameraInputComponent.h + Source/PerViewportDynamicDrawManager.cpp + Source/PerViewportDynamicDrawManager.h ) diff --git a/Gems/AtomLyIntegration/AtomBridge/gem.json b/Gems/AtomLyIntegration/AtomBridge/gem.json new file mode 100644 index 0000000000..329741bb8e --- /dev/null +++ b/Gems/AtomLyIntegration/AtomBridge/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "Atom_AtomBridge", + "display_name": "Atom Bridge", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt index 1066cc33e8..d3b8c8cde7 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomFont/Code/CMakeLists.txt @@ -12,7 +12,7 @@ ly_get_list_relative_pal_filename(pal_dir ${CMAKE_CURRENT_LIST_DIR}/Platform/${PAL_PLATFORM_NAME}) ly_add_target( - NAME AtomFont ${PAL_TRAIT_MONOLITHIC_DRIVEN_LIBRARY_TYPE} + NAME AtomFont ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} NAMESPACE Gem FILES_CMAKE atomfont_files.cmake diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp index 3c76a9c788..623a931ac9 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/AtomFont.cpp @@ -896,7 +896,7 @@ AZ::RHI::Ptr AZ::AtomFont::GetOrCreateDynamicDrawFo shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_useColorChannels"), AZ::Name("false"))); shaderOptions.push_back(AZ::RPI::ShaderOption(AZ::Name("o_clamp"), AZ::Name("true"))); dynamicDraw->InitShaderWithVariant(shader, &shaderOptions); - dynamicDraw->InitVertexFormat({{"POSITION", RHI::Format::R32G32B32_FLOAT}, {"COLOR", RHI::Format::R8G8B8A8_UNORM}, {"TEXCOORD0", RHI::Format::R32G32_FLOAT}}); + dynamicDraw->InitVertexFormat({{"POSITION", RHI::Format::R32G32B32_FLOAT}, {"COLOR", RHI::Format::B8G8R8A8_UNORM}, {"TEXCOORD0", RHI::Format::R32G32_FLOAT}}); dynamicDraw->EndInit(); // exclusive lock while writing diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp index 21b57e0908..31eb089803 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp @@ -54,7 +54,6 @@ #include -static const AZ::Vector2 UiDraw_TextSizeFactor = AZ::Vector2(12.0f, 12.0f); static const int TabCharCount = 4; // set buffer sizes to hold max characters that can be drawn in 1 DrawString call static const size_t MaxVerts = 8 * 1024; // 2048 quads @@ -864,7 +863,7 @@ int AZ::FFont::CreateQuadsForText(const RHI::Viewport& viewport, float x, float if (drawFrame) { ColorB tempColor(255, 255, 255, 255); - uint32_t frameColor = tempColor.pack_abgr8888(); //note: this ends up in r,g,b,a order on little-endian machines + uint32_t frameColor = tempColor.pack_argb8888(); //note: this ends up in r,g,b,a order on little-endian machines Vec2 textSize = GetTextSizeUInternal(viewport, str, asciiMultiLine, ctx); @@ -1122,7 +1121,7 @@ int AZ::FFont::CreateQuadsForText(const RHI::Viewport& viewport, float x, float { ColorB tempColor = color; tempColor.a = ((uint32_t) tempColor.a * alphaBlend) >> 8; - packedColor = tempColor.pack_abgr8888(); //note: this ends up in r,g,b,a order on little-endian machines + packedColor = tempColor.pack_argb8888(); //note: this ends up in r,g,b,a order on little-endian machines } if (ctx.m_drawTextFlags & eDrawText_UseTransform) @@ -1673,6 +1672,12 @@ static void SetCommonContextFlags(AZ::TextDrawContext& ctx, const AzFramework::T { ctx.m_drawTextFlags |= eDrawText_FixedSize; } + + if (params.m_useTransform) + { + ctx.m_drawTextFlags |= eDrawText_UseTransform; + ctx.SetTransform(AZMatrix3x4ToLYMatrix3x4(params.m_transform)); + } } AZ::FFont::DrawParameters AZ::FFont::ExtractDrawParameters(const AzFramework::TextDrawParameters& params, AZStd::string_view text, bool forceCalculateSize) @@ -1696,22 +1701,25 @@ AZ::FFont::DrawParameters AZ::FFont::ExtractDrawParameters(const AzFramework::Te } internalParams.m_ctx.SetBaseState(GS_NODEPTHTEST); internalParams.m_ctx.SetColor(AZColorToLYColorF(params.m_color)); + internalParams.m_ctx.SetEffect(params.m_effectIndex); internalParams.m_ctx.SetCharWidthScale((params.m_monospace || params.m_scaleWithWindow) ? 0.5f : 1.0f); internalParams.m_ctx.EnableFrame(false); internalParams.m_ctx.SetProportional(!params.m_monospace && params.m_scaleWithWindow); internalParams.m_ctx.SetSizeIn800x600(params.m_scaleWithWindow && params.m_virtual800x600ScreenSize); - internalParams.m_ctx.SetSize(AZVec2ToLYVec2(UiDraw_TextSizeFactor * params.m_scale)); + internalParams.m_ctx.SetSize(AZVec2ToLYVec2(AZ::Vector2(params.m_textSizeFactor, params.m_textSizeFactor) * params.m_scale)); internalParams.m_ctx.SetLineSpacing(params.m_lineSpacing); - if (params.m_monospace || !params.m_scaleWithWindow) - { - ScaleCoord(viewport, posX, posY); - } if (params.m_hAlign != AzFramework::TextHorizontalAlignment::Left || params.m_vAlign != AzFramework::TextVerticalAlignment::Top || forceCalculateSize) { + // We align based on the size of the default font effect because we do not want the + // text to move when the font effect is changed + unsigned int effectIndex = internalParams.m_ctx.m_fxIdx; + internalParams.m_ctx.SetEffect(0); Vec2 textSize = GetTextSizeUInternal(viewport, text.data(), params.m_multiline, internalParams.m_ctx); + internalParams.m_ctx.SetEffect(effectIndex); + // If we're using virtual 800x600 coordinates, convert the text size from // pixels to that before using it as an offset. if (internalParams.m_ctx.m_sizeIn800x600) @@ -1786,18 +1794,17 @@ void AZ::FFont::DrawScreenAlignedText3d( } AZ::Vector3 positionNDC = AzFramework::WorldToScreenNDC( params.m_position, - currentView->GetViewToWorldMatrix(), + currentView->GetWorldToViewMatrix(), currentView->GetViewToClipMatrix() ); - AzFramework::TextDrawParameters param2d = params; - param2d.m_position = positionNDC; + internalParams.m_ctx.m_sizeIn800x600 = false; DrawStringUInternal( *internalParams.m_viewport, internalParams.m_viewportContext, - internalParams.m_position.GetX(), - internalParams.m_position.GetY(), - params.m_position.GetZ(), // Z + positionNDC.GetX() * internalParams.m_viewport->GetWidth(), + (1.0f - positionNDC.GetY()) * internalParams.m_viewport->GetHeight(), + positionNDC.GetZ(), // Z text.data(), params.m_multiline, internalParams.m_ctx diff --git a/Gems/AtomLyIntegration/AtomFont/gem.json b/Gems/AtomLyIntegration/AtomFont/gem.json new file mode 100644 index 0000000000..a609061ea3 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomFont/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "AtomFont", + "display_name": "Atom Font", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/AtomImGuiTools/gem.json b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json new file mode 100644 index 0000000000..5cee62f7bb --- /dev/null +++ b/Gems/AtomLyIntegration/AtomImGuiTools/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "AtomImGuiTools", + "display_name": "Atom ImGui", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.azsl b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.azsl new file mode 100644 index 0000000000..c4367efe6b --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.azsl @@ -0,0 +1,77 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + + #include + +ShaderResourceGroup InstanceSrg : SRG_PerDraw +{ + float2 m_viewportSize; + Texture2D m_texture; + + Sampler m_sampler + { + MaxAnisotropy = 16; + AddressU = Clamp; + AddressV = Clamp; + AddressW = Clamp; + }; +}; + +struct VSInput +{ + float3 m_position : POSITION; + float4 m_color : COLOR0; + float2 m_uv : TEXCOORD0; +}; + +struct VSOutput +{ + float4 m_position : SV_Position; + float4 m_color : COLOR0; + float2 m_uv : TEXCOORD0; +}; + +VSOutput MainVS(VSInput IN) +{ + // Convert from screen space to clip space + float2 posXY = float2(IN.m_position.xy) / InstanceSrg::m_viewportSize * 2.0f - float2(1.0f, 1.0f); + posXY.y *= -1.0f; + float4 posPS = float4(posXY, IN.m_position.z, 1.0f); + + VSOutput OUT; + OUT.m_position = posPS; + OUT.m_color = IN.m_color; + OUT.m_uv = IN.m_uv; + return OUT; +}; + +struct PSOutput +{ + float4 m_color : SV_Target0; +}; + +PSOutput MainPS(VSOutput IN) +{ + PSOutput OUT; + + float4 tex; + + tex = InstanceSrg::m_texture.Sample(InstanceSrg::m_sampler, IN.m_uv); + float opacity = IN.m_color.a * tex.a; + + // We use pre-multiplied alpha here since it is more flexible. For example, it enables alpha-blended rendering to + // a render target and then alpha blending that render target into another render target + OUT.m_color.rgb = IN.m_color.rgb * tex.rgb * opacity; + + OUT.m_color.a = opacity; + return OUT; +}; diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.shader b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.shader new file mode 100644 index 0000000000..601a2664b5 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Assets/Shaders/TexturedIcon.shader @@ -0,0 +1,39 @@ +{ + "Source" : "TexturedIcon", + + "DepthStencilState" : { + "Depth" : { + "Enable" : false, + "CompareFunc" : "Always" + } + }, + + "RasterState" : { + "DepthClipEnable" : false, + "CullMode" : "None" + }, + + "BlendState" : { + "Enable" : true, + "BlendSource" : "One", + "BlendDest" : "AlphaSourceInverse", + "BlendOp" : "Add" + }, + + "DrawList" : "2dpass", + + "ProgramSettings": + { + "EntryPoints": + [ + { + "name": "MainVS", + "type": "Vertex" + }, + { + "name": "MainPS", + "type": "Fragment" + } + ] + } +} diff --git a/AutomatedTesting/Gem/Code/Platform/Windows/runtime_dependencies.cmake b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/CMakeLists.txt similarity index 95% rename from AutomatedTesting/Gem/Code/Platform/Windows/runtime_dependencies.cmake rename to Gems/AtomLyIntegration/AtomViewportDisplayIcons/CMakeLists.txt index ffcaf7293a..20a680bce9 100644 --- a/AutomatedTesting/Gem/Code/Platform/Windows/runtime_dependencies.cmake +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/CMakeLists.txt @@ -9,5 +9,4 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -set(GEM_DEPENDENCIES -) \ No newline at end of file +add_subdirectory(Code) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/CMakeLists.txt new file mode 100644 index 0000000000..b3e176c7a3 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/CMakeLists.txt @@ -0,0 +1,35 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME AtomViewportDisplayIcons.Editor ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} + NAMESPACE Gem + FILES_CMAKE + atomviewportdisplayicons_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + BUILD_DEPENDENCIES + PRIVATE + AZ::AzCore + AZ::AzFramework + AZ::AzToolsFramework + AZ::AtomCore + 3rdParty::Qt::Core + 3rdParty::Qt::Gui + 3rdParty::Qt::Svg + Gem::Atom_RHI.Reflect + Gem::Atom_RPI.Public + Gem::Atom_Bootstrap.Headers + Gem::Atom_AtomBridge.Static + ) +endif() diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp new file mode 100644 index 0000000000..5fe8c50350 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp @@ -0,0 +1,357 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include "AtomViewportDisplayIconsSystemComponent.h" + +#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 AZ::Render +{ + void AtomViewportDisplayIconsSystemComponent::Reflect(AZ::ReflectContext* context) + { + if (AZ::SerializeContext* serialize = azrtti_cast(context)) + { + serialize->Class() + ->Version(0) + ; + + if (AZ::EditContext* ec = serialize->GetEditContext()) + { + ec->Class("Viewport Display Icons", "Provides an interface for drawing simple icons to the Editor viewport") + ->ClassElement(Edit::ClassElements::EditorData, "") + ->Attribute(Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("System", 0xc94d118b)) + ->Attribute(Edit::Attributes::AutoExpand, true) + ; + } + } + } + + void AtomViewportDisplayIconsSystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC("ViewportDisplayIconsService")); + } + + void AtomViewportDisplayIconsSystemComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC("ViewportDisplayIconsService")); + } + + void AtomViewportDisplayIconsSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) + { + required.push_back(AZ_CRC("RPISystem", 0xf2add773)); + required.push_back(AZ_CRC("AtomBridgeService", 0xdb816a99)); + } + + void AtomViewportDisplayIconsSystemComponent::GetDependentServices([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType& dependent) + { + } + + void AtomViewportDisplayIconsSystemComponent::Activate() + { + AzToolsFramework::EditorViewportIconDisplay::Register(this); + + Bootstrap::NotificationBus::Handler::BusConnect(); + } + + void AtomViewportDisplayIconsSystemComponent::Deactivate() + { + Bootstrap::NotificationBus::Handler::BusDisconnect(); + + auto perViewportDynamicDrawInterface = AtomBridge::PerViewportDynamicDraw::Get(); + if (!perViewportDynamicDrawInterface) + { + return; + } + if (perViewportDynamicDrawInterface) + { + perViewportDynamicDrawInterface->UnregisterDynamicDrawContext(m_drawContextName); + } + + AzToolsFramework::EditorViewportIconDisplay::Unregister(this); + } + + void AtomViewportDisplayIconsSystemComponent::DrawIcon(const DrawParameters& drawParameters) + { + // Ensure we have a valid viewport context & dynamic draw interface + auto viewportContext = RPI::ViewportContextRequests::Get()->GetViewportContextById(drawParameters.m_viewport); + if (viewportContext == nullptr) + { + return; + } + + auto perViewportDynamicDrawInterface = + AtomBridge::PerViewportDynamicDraw::Get(); + if (!perViewportDynamicDrawInterface) + { + return; + } + + RHI::Ptr dynamicDraw = + perViewportDynamicDrawInterface->GetDynamicDrawContextForViewport(m_drawContextName, drawParameters.m_viewport); + if (dynamicDraw == nullptr) + { + return; + } + + // Find our icon, falling back on a grey placeholder if its image is unavailable + AZ::Data::Instance image = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Grey); + if (auto iconIt = m_iconData.find(drawParameters.m_icon); iconIt != m_iconData.end()) + { + auto& iconData = iconIt->second; + if (iconData.m_image) + { + image = iconData.m_image; + } + } + else + { + return; + } + + // Initialize our shader + AZ::Vector2 viewportSize; + { + AzFramework::WindowSize viewportWindowSize = viewportContext->GetViewportSize(); + viewportSize = AZ::Vector2{aznumeric_cast(viewportWindowSize.m_width), aznumeric_cast(viewportWindowSize.m_height)}; + } + AZ::Data::Instance drawSrg = dynamicDraw->NewDrawSrg(); + drawSrg->SetConstant(m_viewportSizeIndex,viewportSize); + drawSrg->SetImageView(m_textureParameterIndex, image->GetImageView()); + drawSrg->Compile(); + + // Scale icons by screen DPI + float scalingFactor = 1.0f; + { + using ViewportRequestBus = AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus; + ViewportRequestBus::EventResult( + scalingFactor, drawParameters.m_viewport, &ViewportRequestBus::Events::DeviceScalingFactor); + } + + AZ::Vector3 screenPosition; + if (drawParameters.m_positionSpace == CoordinateSpace::ScreenSpace) + { + screenPosition = drawParameters.m_position; + } + else if (drawParameters.m_positionSpace == CoordinateSpace::WorldSpace) + { + // Calculate our screen space position using the viewport size + // We want this instead of RenderViewportWidget::WorldToScreen which works in QWidget virtual coordinate space + AzFramework::ScreenPoint position = AzFramework::WorldToScreen( + drawParameters.m_position, viewportContext->GetCameraViewMatrix(), viewportContext->GetCameraProjectionMatrix(), + viewportSize); + screenPosition.SetX(aznumeric_cast(position.m_x)); + screenPosition.SetY(aznumeric_cast(position.m_y)); + } + + struct Vertex + { + float m_position[3]; + AZ::u32 m_color; + float m_uv[2]; + }; + using Indice = AZ::u16; + + // Create a vertex offset from the position to draw from based on the icon size + // Vertex positions are in screen space coordinates + auto createVertex = [&](float offsetX, float offsetY, float u, float v) -> Vertex + { + Vertex vertex; + screenPosition.StoreToFloat3(vertex.m_position); + vertex.m_position[0] += offsetX * drawParameters.m_size.GetX() * scalingFactor; + vertex.m_position[1] += offsetY * drawParameters.m_size.GetY() * scalingFactor; + vertex.m_color = drawParameters.m_color.ToU32(); + vertex.m_uv[0] = u; + vertex.m_uv[1] = v; + return vertex; + }; + + AZStd::array vertices = { + createVertex(-0.5f, -0.5f, 0.f, 0.f), + createVertex(0.5f, -0.5f, 1.f, 0.f), + createVertex(0.5f, 0.5f, 1.f, 1.f), + createVertex(-0.5f, 0.5f, 0.f, 1.f) + }; + AZStd::array indices = {0, 1, 2, 0, 2, 3}; + dynamicDraw->DrawIndexed(&vertices, vertices.size(), &indices, indices.size(), RHI::IndexFormat::Uint16, drawSrg); + } + + QString AtomViewportDisplayIconsSystemComponent::FindAssetPath(const QString& path) const + { + // If we get an absolute path, just use it. + QFileInfo pathInfo(path); + if (pathInfo.isAbsolute()) + { + return path; + } + + bool found = false; + AZStd::vector scanFolders; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult( + found, &AzToolsFramework::AssetSystemRequestBus::Events::GetScanFolders, scanFolders); + if (!found) + { + AZ_Error("AtomViewportDisplayIconSystemComponent", false, "Failed to load asset scan folders"); + return QString(); + } + + for (const auto& folder : scanFolders) + { + QDir dir(folder.data()); + if (dir.exists(path)) + { + return dir.absoluteFilePath(path); + } + } + + return QString(); + } + + QImage AtomViewportDisplayIconsSystemComponent::RenderSvgToImage(const QString& svgPath) const + { + // Set up our SVG renderer + QSvgRenderer renderer(svgPath); + renderer.setAspectRatioMode(Qt::KeepAspectRatio); + + // Set up our target image + QSize size = renderer.defaultSize().expandedTo(MinimumRenderedSvgSize); + QImage image(size, QtImageFormat); + image.fill(0x00000000); + + // Render the SVG + QPainter painter(&image); + renderer.render(&painter); + return image; + } + + AZ::Data::Instance AtomViewportDisplayIconsSystemComponent::ConvertToAtomImage(AZ::Uuid assetId, QImage image) const + { + // Ensure our image is in the correct pixel format so we can memcpy it to our renderer image + image.convertTo(QtImageFormat); + Data::Instance streamingImagePool = RPI::ImageSystemInterface::Get()->GetSystemStreamingPool(); + return RPI::StreamingImage::CreateFromCpuData( + *streamingImagePool.get(), + RHI::ImageDimension::Image2D, + RHI::Size(image.width(), image.height(), 1), + RHI::Format::R8G8B8A8_UNORM_SRGB, + image.bits(), + image.sizeInBytes(), + assetId); + } + + AzToolsFramework::EditorViewportIconDisplayInterface::IconId AtomViewportDisplayIconsSystemComponent::GetOrLoadIconForPath( + AZStd::string_view path) + { + // Check our cache to see if the image is already loaded + auto existingEntryIt = AZStd::find_if(m_iconData.begin(), m_iconData.end(), [&path](const auto& iconData) + { + return iconData.second.m_path == path; + }); + if (existingEntryIt != m_iconData.end()) + { + return existingEntryIt->first; + } + + AZ::Uuid assetId = AZ::Uuid::CreateName(path.data()); + + // Find the asset to load on disk + QString assetPath = FindAssetPath(path.data()); + if (assetPath.isEmpty()) + { + AZ_Error("AtomViewportDisplayIconSystemComponent", false, "Failed to locate icon on disk: \"%s\"", path.data()); + return InvalidIconId; + } + + QImage loadedImage; + + AZStd::string extension; + AzFramework::StringFunc::Path::GetExtension(path.data(), extension, false); + // For SVGs, we need to actually rasterize to an image + if (extension == "svg") + { + loadedImage = RenderSvgToImage(assetPath); + } + // For everything else, we can just load it through QImage via its image plugins + else + { + const bool loaded = loadedImage.load(assetPath); + if (!loaded) + { + AZ_Error("AtomViewportDisplayIconSystemComponent", false, "Failed to load icon: \"%s\"", assetPath.toUtf8().constData()); + return InvalidIconId; + } + } + + // Cache our loaded icon + IconId id = m_currentId++; + IconData& iconData = m_iconData[id]; + iconData.m_path = path; + iconData.m_image = ConvertToAtomImage(assetId, loadedImage); + return id; + } + + AzToolsFramework::EditorViewportIconDisplayInterface::IconLoadStatus AtomViewportDisplayIconsSystemComponent::GetIconLoadStatus( + IconId icon) + { + auto iconIt = m_iconData.find(icon); + if (iconIt == m_iconData.end()) + { + return IconLoadStatus::Unloaded; + } + if (iconIt->second.m_image) + { + return IconLoadStatus::Loaded; + } + return IconLoadStatus::Error; + } + + void AtomViewportDisplayIconsSystemComponent::OnBootstrapSceneReady([[maybe_unused]]AZ::RPI::Scene* bootstrapScene) + { + AtomBridge::PerViewportDynamicDraw::Get()->RegisterDynamicDrawContext(m_drawContextName, [](RPI::Ptr drawContext) + { + auto shader = RPI::LoadShader(DrawContextShaderPath); + drawContext->InitShader(shader); + drawContext->InitVertexFormat( + {{"POSITION", RHI::Format::R32G32B32_FLOAT}, + {"COLOR", RHI::Format::R8G8B8A8_UNORM}, + {"TEXCOORD", RHI::Format::R32G32_FLOAT}}); + drawContext->EndInit(); + }); + } +} // namespace AZ::Render diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h new file mode 100644 index 0000000000..b44957b51d --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.h @@ -0,0 +1,82 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ +#pragma once + +#include + +#include + +#include +#include + +#include +#include +#include + +namespace AZ +{ + class TickRequests; + + namespace Render + { + class AtomViewportDisplayIconsSystemComponent + : public AZ::Component + , public AzToolsFramework::EditorViewportIconDisplayInterface + , public AZ::Render::Bootstrap::NotificationBus::Handler + { + public: + AZ_COMPONENT(AtomViewportDisplayIconsSystemComponent, "{AEC1D3E1-1D9A-437A-B4C6-CFAEE620C160}"); + + static void Reflect(AZ::ReflectContext* context); + + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); + + protected: + // AZ::Component overrides... + void Activate() override; + void Deactivate() override; + + // AzToolsFramework::EditorViewportIconDisplayInterface overrides... + void DrawIcon(const DrawParameters& drawParameters) override; + IconId GetOrLoadIconForPath(AZStd::string_view path) override; + IconLoadStatus GetIconLoadStatus(IconId icon) override; + + // AZ::Render::Bootstrap::NotificationBus::Handler overrides... + void OnBootstrapSceneReady(AZ::RPI::Scene* bootstrapScene) override; + + private: + static constexpr const char* DrawContextShaderPath = "Shaders/TexturedIcon.azshader"; + static constexpr QSize MinimumRenderedSvgSize = QSize(128, 128); + static constexpr QImage::Format QtImageFormat = QImage::Format_RGBA8888; + + QString FindAssetPath(const QString& path) const; + QImage RenderSvgToImage(const QString& svgPath) const; + AZ::Data::Instance ConvertToAtomImage(AZ::Uuid assetId, QImage image) const; + + Name m_drawContextName = Name("ViewportIconDisplay"); + bool m_shaderIndexesInitialized = false; + RHI::ShaderInputNameIndex m_textureParameterIndex = "m_texture"; + RHI::ShaderInputNameIndex m_viewportSizeIndex = "m_viewportSize"; + + struct IconData + { + AZStd::string m_path; + AZ::Data::Instance m_image = nullptr; + }; + AZStd::unordered_map m_iconData; + IconId m_currentId = 0; + }; + } // namespace Render +} // namespace AZ diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/Module.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/Module.cpp new file mode 100644 index 0000000000..db7672186a --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/Module.cpp @@ -0,0 +1,51 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include + +#include "AtomViewportDisplayIconsSystemComponent.h" + +namespace AZ +{ + namespace Render + { + class AtomViewportDisplayInfoModule + : public AZ::Module + { + public: + AZ_RTTI(AtomViewportDisplayInfoModule, "{8D72F14E-958D-4225-B3BC-C5C87BDDD426}", AZ::Module); + AZ_CLASS_ALLOCATOR(AtomViewportDisplayInfoModule, AZ::SystemAllocator, 0); + + AtomViewportDisplayInfoModule() + : AZ::Module() + { + m_descriptors.insert(m_descriptors.end(), { + AtomViewportDisplayIconsSystemComponent::CreateDescriptor(), + }); + } + + AZ::ComponentTypeList GetRequiredSystemComponents() const override + { + return AZ::ComponentTypeList{ + azrtti_typeid(), + }; + } + }; + } // namespace Render +} // namespace AZ + +// DO NOT MODIFY THIS LINE UNLESS YOU RENAME THE GEM +// The first parameter should be GemName_GemIdLower +// The second should be the fully qualified name of the class above +AZ_DECLARE_MODULE_CLASS(Gem_AtomViewportDisplayInfo, AZ::Render::AtomViewportDisplayInfoModule) diff --git a/Gems/Multiplayer/Code/multiplayer_editor_files.cmake b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/atomviewportdisplayicons_files.cmake similarity index 80% rename from Gems/Multiplayer/Code/multiplayer_editor_files.cmake rename to Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/atomviewportdisplayicons_files.cmake index ce3e3227e0..f02aed0856 100644 --- a/Gems/Multiplayer/Code/multiplayer_editor_files.cmake +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/atomviewportdisplayicons_files.cmake @@ -10,6 +10,7 @@ # set(FILES - Source/Editor/MultiplayerEditorDispatcher.cpp - Source/Editor/MultiplayerEditorDispatcher.h + Source/AtomViewportDisplayIconsSystemComponent.cpp + Source/AtomViewportDisplayIconsSystemComponent.h + Source/Module.cpp ) diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json new file mode 100644 index 0000000000..41f69e33a0 --- /dev/null +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "AtomViewportDisplayIcons", + "display_name": "Atom Viewport Display Icons", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt index de4ee9b4b5..0f134d4218 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/CMakeLists.txt @@ -10,7 +10,7 @@ # ly_add_target( - NAME AtomViewportDisplayInfo GEM_MODULE + NAME AtomViewportDisplayInfo ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} NAMESPACE Gem FILES_CMAKE atomviewportdisplayinfo_files.cmake diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 672c26a9ab..146c0c67d0 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -18,10 +18,11 @@ #include #include +#include +#include #include #include #include -#include #include #include @@ -146,7 +147,7 @@ namespace AZ::Render if (m_updateRootPassQuery) { - if (auto rootPass = AZ::RPI::PassSystemInterface::Get()->GetRootPass()) + if (auto rootPass = viewportContext->GetCurrentPipeline()->GetRootPass()) { rootPass->SetPipelineStatisticsQueryEnabled(displayLevel != AtomBridge::ViewportInfoDisplayState::CompactInfo); m_updateRootPassQuery = false; @@ -226,7 +227,8 @@ namespace AZ::Render void AtomViewportDisplayInfoSystemComponent::DrawPassInfo() { - auto rootPass = AZ::RPI::PassSystemInterface::Get()->GetRootPass(); + AZ::RPI::ViewportContextPtr viewportContext = GetViewportContext(); + auto rootPass = viewportContext->GetCurrentPipeline()->GetRootPass(); const RPI::PipelineStatisticsResult stats = rootPass->GetLatestPipelineStatisticsResult(); AZStd::function)> containingPassCount = [&containingPassCount](const AZ::RPI::Ptr pass) { @@ -301,7 +303,10 @@ namespace AZ::Render lastTime = time; } - const double averageFPS = aznumeric_cast(m_fpsHistory.size()) / actualInterval.count(); + const double averageFPS = (actualInterval.count() != 0.0) + ? aznumeric_cast(m_fpsHistory.size()) / actualInterval.count() + : 0.0; + const double frameIntervalSeconds = m_fpsInterval.count(); DrawLine( diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json index dd92a99ea9..04e2464a26 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/gem.json @@ -1,12 +1,10 @@ { - "gem_name": "AtomLyIntegration_AtomViewportDisplayInfo", - "display_name": "Atom Viewport Display Info Overlay", - "summary": "Provides a diagnostic viewport overlay for the default O3DE Atom viewport.", + "gem_name": "AtomViewportDisplayInfo", + "display_name": "Atom Viewport Display Info", + "summary": "", "canonical_tags": [ "Gem" ], "user_tags": [ - "AtomLyIntegration", - "AtomViewportDisplayInfo" ] -} \ No newline at end of file +} diff --git a/Gems/AtomLyIntegration/CMakeLists.txt b/Gems/AtomLyIntegration/CMakeLists.txt index 35022e643b..ff6800a7ff 100644 --- a/Gems/AtomLyIntegration/CMakeLists.txt +++ b/Gems/AtomLyIntegration/CMakeLists.txt @@ -17,3 +17,4 @@ add_subdirectory(AtomFont) add_subdirectory(TechnicalArt) add_subdirectory(AtomBridge) add_subdirectory(AtomViewportDisplayInfo) +add_subdirectory(AtomViewportDisplayIcons) diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h index fe40cabc12..31cdb34ddd 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/AreaLightComponentConfig.h @@ -62,7 +62,7 @@ namespace AZ bool m_enableShadow = false; ShadowmapSize m_shadowmapMaxSize = ShadowmapSize::Size256; ShadowFilterMethod m_shadowFilterMethod = ShadowFilterMethod::None; - PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; + PcfMethod m_pcfMethod = PcfMethod::Bicubic; float m_boundaryWidthInDegrees = 0.25f; uint16_t m_predictionSampleCount = 4; uint16_t m_filteringSampleCount = 12; 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 7de2857541..237c1f3016 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/CoreLights/DirectionalLightComponentConfig.h @@ -61,7 +61,7 @@ namespace AZ float m_shadowFarClipDistance = 100.f; //! Width/Height of shadowmap images. - ShadowmapSize m_shadowmapSize = MaxShadowmapImageSize; + ShadowmapSize m_shadowmapSize = ShadowmapSize::Size1024; //! Number of cascades. uint32_t m_cascadeCount = 4; @@ -117,7 +117,7 @@ namespace AZ //! It is used only when the pixel is predicted as on the boundary. uint16_t m_filteringSampleCount = 32; - PcfMethod m_pcfMethod = PcfMethod::BoundarySearch; + PcfMethod m_pcfMethod = PcfMethod::Bicubic; bool IsSplitManual() const; bool IsSplitAutomatic() const; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h index 81645b25a9..3c5bcbea00 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Include/AtomLyIntegration/CommonFeatures/PostProcess/DisplayMapper/DisplayMapperComponentConfig.h @@ -20,7 +20,6 @@ namespace AZ { namespace Render { - class DisplayMapperComponentConfig final : public ComponentConfig { @@ -33,6 +32,7 @@ namespace AZ DisplayMapperOperationType m_displayMapperOperation = DisplayMapperOperationType::Aces; bool m_ldrColorGradingLutEnabled = false; Data::Asset m_ldrColorGradingLut = {}; + AcesParameterOverrides m_acesParameterOverrides; }; } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp index 138d619d97..4d43d75406 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/AttachmentComponent.cpp @@ -243,14 +243,14 @@ namespace AZ { // apply offset in world-space finalTransform = m_targetEntityTransform * m_targetBoneTransform; - finalTransform.SetScale(AZ::Vector3::CreateOne()); + finalTransform.SetUniformScale(1.0f); finalTransform *= m_targetOffset; } else if (m_scaleSource == AttachmentConfiguration::ScaleSource::TargetEntityScale) { // apply offset in target-entity-space (ignoring bone scale) AZ::Transform boneNoScale = m_targetBoneTransform; - boneNoScale.SetScale(AZ::Vector3::CreateOne()); + boneNoScale.SetUniformScale(1.0f); finalTransform = m_targetEntityTransform * boneNoScale * m_targetOffset; } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.cpp index 3b50c0a48c..f14340b4c9 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.cpp @@ -21,18 +21,42 @@ namespace AZ { namespace Render { + bool EditorAttachmentComponentVersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement) + { + if (classElement.GetVersion() < 2) + { + float uniformScaleOffset = 1.0f; + + int scaleElementIndex = classElement.FindElement(AZ_CRC_CE("Scale Offset")); + if (scaleElementIndex != -1) + { + AZ::Vector3 oldScaleValue = AZ::Vector3::CreateOne(); + AZ::SerializeContext::DataElementNode& dataElementNode = classElement.GetSubElement(scaleElementIndex); + if (dataElementNode.GetData(oldScaleValue)) + { + uniformScaleOffset = oldScaleValue.GetMaxElement(); + } + classElement.RemoveElement(scaleElementIndex); + } + + classElement.AddElementWithData(context, "Uniform Scale Offset", uniformScaleOffset); + } + + return true; + } + void EditorAttachmentComponent::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { serializeContext->Class() - ->Version(1) + ->Version(2, &EditorAttachmentComponentVersionConverter) ->Field("Target ID", &EditorAttachmentComponent::m_targetId) ->Field("Target Bone Name", &EditorAttachmentComponent::m_targetBoneName) ->Field("Position Offset", &EditorAttachmentComponent::m_positionOffset) ->Field("Rotation Offset", &EditorAttachmentComponent::m_rotationOffset) - ->Field("Scale Offset", &EditorAttachmentComponent::m_scaleOffset) + ->Field("Uniform Scale Offset", &EditorAttachmentComponent::m_uniformScaleOffset) ->Field("Attached Initially", &EditorAttachmentComponent::m_attachedInitially) ->Field("Scale Source", &EditorAttachmentComponent::m_scaleSource); @@ -70,7 +94,7 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::Min, -AZ::RadToDeg(AZ::Constants::TwoPi)) ->Attribute(AZ::Edit::Attributes::Max, AZ::RadToDeg(AZ::Constants::TwoPi)) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorAttachmentComponent::OnTargetOffsetChanged) - ->DataElement(0, &EditorAttachmentComponent::m_scaleOffset, "Scale offset", "Local scale offset from target entity") + ->DataElement(0, &EditorAttachmentComponent::m_uniformScaleOffset, "Scale offset", "Local scale offset from target entity") ->Attribute(AZ::Edit::Attributes::Step, 0.1f) ->Attribute(AZ::Edit::Attributes::Min, 0.001f) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorAttachmentComponent::OnTargetOffsetChanged) @@ -128,7 +152,7 @@ namespace AZ { AZ::Transform offset = AZ::ConvertEulerDegreesToTransform(m_rotationOffset); offset.SetTranslation(m_positionOffset); - offset.MultiplyByScale(m_scaleOffset); + offset.MultiplyByUniformScale(m_uniformScaleOffset); return offset; } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.h index cac8a71a94..0f44043344 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Animation/EditorAttachmentComponent.h @@ -88,7 +88,7 @@ namespace AZ AZ::Vector3 m_rotationOffset = AZ::Vector3::CreateZero(); //! Offset from target entity's scale. - AZ::Vector3 m_scaleOffset = AZ::Vector3::CreateOne(); + float m_uniformScaleOffset = 1.0f; //! Observe scale information from the specified source. AttachmentConfiguration::ScaleSource m_scaleSource = AttachmentConfiguration::ScaleSource::WorldScale; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp index 4ffb917f65..4291ce4d97 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/CapsuleLightDelegate.cpp @@ -35,7 +35,7 @@ namespace AZ // This equation is based off of the integration of a line segment against a perpendicular normal pointing at the center of the // line segment from some distance away. - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float h = GetInteriorHeight() * scale; float t2 = lightThreshold * lightThreshold; float h2 = h * h; @@ -54,7 +54,7 @@ namespace AZ const auto endpoints = m_shapeBus->GetCapsulePoints(); GetFeatureProcessor()->SetCapsuleLineSegment(GetLightHandle(), endpoints.m_begin, endpoints.m_end); - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float radius = m_shapeBus->GetRadius(); GetFeatureProcessor()->SetCapsuleRadius(GetLightHandle(), scale * radius); } @@ -62,7 +62,7 @@ namespace AZ float CapsuleLightDelegate::GetSurfaceArea() const { - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float radius = m_shapeBus->GetRadius(); float capsArea = 4.0f * Constants::Pi * radius * radius; // both caps make a sphere float sideArea = 2.0f * Constants::Pi * radius * GetInteriorHeight(); // cylindrical area of capsule @@ -77,7 +77,7 @@ namespace AZ float radius = CalculateAttenuationRadius(AreaLightComponentConfig::CutoffIntensity); // Add on the caps for the attenuation radius - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); float height = m_shapeBus->GetHeight() * scale; debugDisplay.SetColor(color); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp index 7805a92cd1..8abc790ada 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp @@ -48,7 +48,7 @@ namespace AZ::Render float DiskLightDelegate::GetRadius() const { - return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + return m_shapeBus->GetRadius() * GetTransform().GetUniformScale(); } void DiskLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& /*color*/, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp index a77bcfdd12..69bec21a6c 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorAreaLightComponent.cpp @@ -173,10 +173,10 @@ namespace AZ ->DataElement( Edit::UIHandlers::ComboBox, &AreaLightComponentConfig::m_pcfMethod, "Pcf method", "Type of PCF to use.\n" - " Boundary search: do several taps to first determine if we are on a shadow boundary\n" - " Bicubic: a smooth, fixed-size kernel \n") - ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary search") + " Bicubic: a smooth, fixed-size kernel \n" + " Boundary search: do several taps to first determine if we are on a shadow boundary\n") ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") + ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary search") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::Visibility, &AreaLightComponentConfig::SupportsShadows) ->Attribute(Edit::Attributes::ReadOnly, &AreaLightComponentConfig::IsShadowPcfDisabled); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp index 35c5522c4e..308a4ebd11 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/EditorDirectionalLightComponent.cpp @@ -163,10 +163,10 @@ namespace AZ ->DataElement( Edit::UIHandlers::ComboBox, &DirectionalLightComponentConfig::m_pcfMethod, "Pcf Method", "Type of Pcf to use.\n" - " Boundary search: do several taps to first determine if we are on a shadow boundary\n" - " Bicubic: a smooth, fixed-size kernel \n") - ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") + " Bicubic: a smooth, fixed-size kernel \n" + " Boundary search: do several taps to first determine if we are on a shadow boundary\n") ->EnumAttribute(PcfMethod::Bicubic, "Bicubic") + ->EnumAttribute(PcfMethod::BoundarySearch, "Boundary Search") ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) ->Attribute(Edit::Attributes::ReadOnly, &DirectionalLightComponentConfig::IsShadowPcfDisabled); ; @@ -217,7 +217,7 @@ namespace AZ GetEntityId(), &TransformBus::Events::GetWorldTM); - transform.ExtractScale(); + transform.ExtractUniformScale(); const Vector3 origin = transform.GetTranslation(); const Vector3 originOffset = origin - (transform.TransformVector(forward) * arrowOffset); const Vector3 target = origin - (transform.TransformVector(forward) * (arrowLength + arrowOffset)); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp index c2bcc566e0..0cc01f4066 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp @@ -50,7 +50,7 @@ namespace AZ AZStd::vector vertices = m_shapeBus->GetPolygonPrism()->m_vertexContainer.GetVertices(); Transform transform = GetTransform(); - transform.SetScale(Vector3(transform.GetScale().GetMaxElement())); // Poly Prism only supports uniform scale, so use max element. + transform.SetUniformScale(transform.GetUniformScale()); // Poly Prism only supports uniform scale. AZStd::vector transformedVertices; transformedVertices.reserve(vertices.size()); @@ -73,7 +73,7 @@ namespace AZ twiceArea += vertices.at(i).GetX() * vertices.at(j).GetY(); twiceArea -= vertices.at(i).GetY() * vertices.at(j).GetX(); } - float scale = GetTransform().GetScale().GetMaxElement(); + float scale = GetTransform().GetUniformScale(); return GetAbs(twiceArea * 0.5f * scale * scale); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp index 2666be6f75..6caa8f31b3 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/QuadLightDelegate.cpp @@ -76,12 +76,12 @@ namespace AZ float QuadLightDelegate::GetWidth() const { - return m_shapeBus->GetQuadWidth() * GetTransform().GetScale().GetX(); + return m_shapeBus->GetQuadWidth() * GetTransform().GetUniformScale(); } float QuadLightDelegate::GetHeight() const { - return m_shapeBus->GetQuadHeight() * GetTransform().GetScale().GetY(); + return m_shapeBus->GetQuadHeight() * GetTransform().GetUniformScale(); } } // namespace Render diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp index e3cf1fac78..afb63dce9b 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/SphereLightDelegate.cpp @@ -50,7 +50,7 @@ namespace AZ float SphereLightDelegate::GetRadius() const { - return m_shapeBus->GetRadius() * GetTransform().GetScale().GetMaxElement(); + return m_shapeBus->GetRadius() * GetTransform().GetUniformScale(); } void SphereLightDelegate::DrawDebugDisplay(const Transform& transform, const Color& color, AzFramework::DebugDisplayRequests& debugDisplay, bool isSelected) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.cpp index 0ddace1f87..5fb835de15 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.cpp @@ -44,7 +44,17 @@ namespace AZ ->Field("AmbientMultiplier", &DiffuseProbeGridComponentConfig::m_ambientMultiplier) ->Field("ViewBias", &DiffuseProbeGridComponentConfig::m_viewBias) ->Field("NormalBias", &DiffuseProbeGridComponentConfig::m_normalBias) - ; + ->Field("EditorMode", &DiffuseProbeGridComponentConfig::m_editorMode) + ->Field("RuntimeMode", &DiffuseProbeGridComponentConfig::m_runtimeMode) + ->Field("BakedIrradianceTextureRelativePath", &DiffuseProbeGridComponentConfig::m_bakedIrradianceTextureRelativePath) + ->Field("BakedDistanceTextureRelativePath", &DiffuseProbeGridComponentConfig::m_bakedDistanceTextureRelativePath) + ->Field("BakedRelocationTextureRelativePath", &DiffuseProbeGridComponentConfig::m_bakedRelocationTextureRelativePath) + ->Field("BakedClassificationTextureRelativePath", &DiffuseProbeGridComponentConfig::m_bakedClassificationTextureRelativePath) + ->Field("BakedIrradianceTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedIrradianceTextureAsset) + ->Field("BakedDistanceTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedDistanceTextureAsset) + ->Field("BakedRelocationTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedRelocationTextureAsset) + ->Field("BakedClassificationTextureAsset", &DiffuseProbeGridComponentConfig::m_bakedClassificationTextureAsset) + ; } } @@ -110,6 +120,26 @@ namespace AZ m_boxShapeInterface = LmbrCentral::BoxShapeComponentRequestsBus::FindFirstHandler(m_entityId); AZ_Assert(m_boxShapeInterface, "DiffuseProbeGridComponentController was unable to find box shape component"); + // special handling is required if this component is being cloned in the editor: + // check to see if the baked textures are already referenced by another DiffuseProbeGrid + if (m_featureProcessor->AreBakedTexturesReferenced( + m_configuration.m_bakedIrradianceTextureRelativePath, + m_configuration.m_bakedDistanceTextureRelativePath, + m_configuration.m_bakedRelocationTextureRelativePath, + m_configuration.m_bakedClassificationTextureRelativePath)) + { + // clear the baked texture paths and assets, since they belong to the original entity (not the clone) + m_configuration.m_bakedIrradianceTextureRelativePath.clear(); + m_configuration.m_bakedDistanceTextureRelativePath.clear(); + m_configuration.m_bakedRelocationTextureRelativePath.clear(); + m_configuration.m_bakedClassificationTextureRelativePath.clear(); + + m_configuration.m_bakedIrradianceTextureAsset.Reset(); + m_configuration.m_bakedDistanceTextureAsset.Reset(); + m_configuration.m_bakedRelocationTextureAsset.Reset(); + m_configuration.m_bakedClassificationTextureAsset.Reset(); + } + // add this diffuse probe grid to the feature processor const AZ::Transform& transform = m_transformInterface->GetWorldTM(); m_handle = m_featureProcessor->AddProbeGrid(transform, m_configuration.m_extents, m_configuration.m_probeSpacing); @@ -118,11 +148,61 @@ namespace AZ m_featureProcessor->SetViewBias(m_handle, m_configuration.m_viewBias); m_featureProcessor->SetNormalBias(m_handle, m_configuration.m_normalBias); + // load the baked texture assets, but only if they are all valid + if (m_configuration.m_bakedIrradianceTextureAsset.GetId().IsValid() && + m_configuration.m_bakedDistanceTextureAsset.GetId().IsValid() && + m_configuration.m_bakedRelocationTextureAsset.GetId().IsValid() && + m_configuration.m_bakedClassificationTextureAsset.GetId().IsValid()) + { + Data::AssetBus::MultiHandler::BusConnect(m_configuration.m_bakedIrradianceTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusConnect(m_configuration.m_bakedDistanceTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusConnect(m_configuration.m_bakedRelocationTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusConnect(m_configuration.m_bakedClassificationTextureAsset.GetId()); + + m_configuration.m_bakedIrradianceTextureAsset.QueueLoad(); + m_configuration.m_bakedDistanceTextureAsset.QueueLoad(); + m_configuration.m_bakedRelocationTextureAsset.QueueLoad(); + m_configuration.m_bakedClassificationTextureAsset.QueueLoad(); + } + else if (m_configuration.m_runtimeMode == DiffuseProbeGridMode::Baked || + m_configuration.m_runtimeMode == DiffuseProbeGridMode::AutoSelect || + m_configuration.m_editorMode == DiffuseProbeGridMode::Baked || + m_configuration.m_editorMode == DiffuseProbeGridMode::AutoSelect) + { + AZ_Error("DiffuseProbeGrid", false, "DiffuseProbeGrid mdoe is set to Baked or Auto-Select, but it does not have baked texture assets. Please re-bake this DiffuseProbeGrid."); + } + + m_featureProcessor->SetMode(m_handle, m_configuration.m_runtimeMode); + // set box shape component dimensions from the configuration // this will invoke the OnShapeChanged() handler and set the outer extents on the feature processor m_boxShapeInterface->SetBoxDimensions(m_configuration.m_extents); } + void DiffuseProbeGridComponentController::OnAssetReady(Data::Asset asset) + { + // if all assets are ready we can set the baked texture images + if (m_configuration.m_bakedIrradianceTextureAsset.IsReady() && + m_configuration.m_bakedDistanceTextureAsset.IsReady() && + m_configuration.m_bakedRelocationTextureAsset.IsReady() && + m_configuration.m_bakedClassificationTextureAsset.IsReady()) + { + Data::AssetBus::MultiHandler::BusDisconnect(m_configuration.m_bakedIrradianceTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusDisconnect(m_configuration.m_bakedDistanceTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusDisconnect(m_configuration.m_bakedRelocationTextureAsset.GetId()); + Data::AssetBus::MultiHandler::BusDisconnect(m_configuration.m_bakedClassificationTextureAsset.GetId()); + + UpdateBakedTextures(); + } + } + + void DiffuseProbeGridComponentController::OnAssetError(Data::Asset asset) + { + Data::AssetBus::MultiHandler::BusDisconnect(asset.GetId()); + + AZ_Error("DiffuseProbeGrid", false, "Failed to load baked texture [%s], please re-bake this DiffuseProbeGrid.", asset.GetId().ToString().c_str()); + } + void DiffuseProbeGridComponentController::Deactivate() { if (m_featureProcessor) @@ -212,20 +292,96 @@ namespace AZ void DiffuseProbeGridComponentController::SetAmbientMultiplier(float ambientMultiplier) { + if (!m_featureProcessor) + { + return; + } + m_configuration.m_ambientMultiplier = ambientMultiplier; m_featureProcessor->SetAmbientMultiplier(m_handle, m_configuration.m_ambientMultiplier); } void DiffuseProbeGridComponentController::SetViewBias(float viewBias) { + if (!m_featureProcessor) + { + return; + } + m_configuration.m_viewBias = viewBias; m_featureProcessor->SetViewBias(m_handle, m_configuration.m_viewBias); } void DiffuseProbeGridComponentController::SetNormalBias(float normalBias) { + if (!m_featureProcessor) + { + return; + } + m_configuration.m_normalBias = normalBias; m_featureProcessor->SetNormalBias(m_handle, m_configuration.m_normalBias); } + + void DiffuseProbeGridComponentController::SetEditorMode(DiffuseProbeGridMode editorMode) + { + if (!m_featureProcessor) + { + return; + } + + // update the configuration and change the DiffuseProbeGrid mode + m_configuration.m_editorMode = editorMode; + m_featureProcessor->SetMode(m_handle, m_configuration.m_editorMode); + } + + void DiffuseProbeGridComponentController::SetRuntimeMode(DiffuseProbeGridMode runtimeMode) + { + if (!m_featureProcessor) + { + return; + } + + // only update the configuration + m_configuration.m_runtimeMode = runtimeMode; + } + + void DiffuseProbeGridComponentController::BakeTextures(DiffuseProbeGridBakeTexturesCallback callback) + { + if (!m_featureProcessor) + { + return; + } + + m_featureProcessor->BakeTextures( + m_handle, + callback, + m_configuration.m_bakedIrradianceTextureRelativePath, + m_configuration.m_bakedDistanceTextureRelativePath, + m_configuration.m_bakedRelocationTextureRelativePath, + m_configuration.m_bakedClassificationTextureRelativePath); + } + + void DiffuseProbeGridComponentController::UpdateBakedTextures() + { + if (!m_featureProcessor) + { + return; + } + + DiffuseProbeGridBakedTextures bakedTextures; + bakedTextures.m_irradianceImage = RPI::StreamingImage::FindOrCreate(m_configuration.m_bakedIrradianceTextureAsset); + bakedTextures.m_irradianceImageRelativePath = m_configuration.m_bakedIrradianceTextureRelativePath; + bakedTextures.m_distanceImage = RPI::StreamingImage::FindOrCreate(m_configuration.m_bakedDistanceTextureAsset); + bakedTextures.m_distanceImageRelativePath = m_configuration.m_bakedDistanceTextureRelativePath; + bakedTextures.m_relocationImageDescriptor = m_configuration.m_bakedRelocationTextureAsset->GetImageDescriptor(); + bakedTextures.m_relocationImageData = m_configuration.m_bakedRelocationTextureAsset->GetSubImageData(0, 0); + bakedTextures.m_relocationImageRelativePath = m_configuration.m_bakedRelocationTextureRelativePath; + bakedTextures.m_classificationImageDescriptor = m_configuration.m_bakedClassificationTextureAsset->GetImageDescriptor(); + bakedTextures.m_classificationImageData = m_configuration.m_bakedClassificationTextureAsset->GetSubImageData(0, 0); + bakedTextures.m_classificationImageRelativePath = m_configuration.m_bakedClassificationTextureRelativePath; + + m_featureProcessor->SetBakedTextures(m_handle, bakedTextures); + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.h index 2bcb4132e9..4122a07ba2 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/DiffuseProbeGridComponentController.h @@ -39,6 +39,19 @@ namespace AZ float m_ambientMultiplier = DefaultDiffuseProbeGridAmbientMultiplier; float m_viewBias = DefaultDiffuseProbeGridViewBias; float m_normalBias = DefaultDiffuseProbeGridNormalBias; + + DiffuseProbeGridMode m_editorMode = DiffuseProbeGridMode::RealTime; + DiffuseProbeGridMode m_runtimeMode = DiffuseProbeGridMode::RealTime; + + AZStd::string m_bakedIrradianceTextureRelativePath; + AZStd::string m_bakedDistanceTextureRelativePath; + AZStd::string m_bakedRelocationTextureRelativePath; + AZStd::string m_bakedClassificationTextureRelativePath; + + Data::Asset m_bakedIrradianceTextureAsset; + Data::Asset m_bakedDistanceTextureAsset; + Data::Asset m_bakedRelocationTextureAsset; + Data::Asset m_bakedClassificationTextureAsset; }; class DiffuseProbeGridComponentController final @@ -79,12 +92,24 @@ namespace AZ // ShapeComponentNotificationsBus overrides void OnShapeChanged(ShapeChangeReasons changeReason) override; + // AssetBus overrides + void OnAssetReady(Data::Asset asset) override; + void OnAssetError(Data::Asset asset) override; + // Property handlers bool ValidateProbeSpacing(const AZ::Vector3& newSpacing); void SetProbeSpacing(const AZ::Vector3& probeSpacing); void SetAmbientMultiplier(float ambientMultiplier); void SetViewBias(float viewBias); void SetNormalBias(float normalBias); + void SetEditorMode(DiffuseProbeGridMode editorMode); + void SetRuntimeMode(DiffuseProbeGridMode runtimeMode); + + // Bake the diffuse probe grid textures to assets + void BakeTextures(DiffuseProbeGridBakeTexturesCallback callback); + + // Update the baked texture assets from the configuration + void UpdateBakedTextures(); // box shape component, used for defining the outer extents of the probe area LmbrCentral::BoxShapeComponentRequests* m_boxShapeInterface = nullptr; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.cpp index ae22ec06c9..1e5b959803 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.cpp @@ -16,6 +16,14 @@ #include #include #include +#include +#include +#include + +AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT +#include +#include +AZ_POP_DISABLE_WARNING namespace AZ { @@ -35,7 +43,9 @@ namespace AZ ->Field("ambientMultiplier", &EditorDiffuseProbeGridComponent::m_ambientMultiplier) ->Field("viewBias", &EditorDiffuseProbeGridComponent::m_viewBias) ->Field("normalBias", &EditorDiffuseProbeGridComponent::m_normalBias) - ; + ->Field("editorMode", &EditorDiffuseProbeGridComponent::m_editorMode) + ->Field("runtimeMode", &EditorDiffuseProbeGridComponent::m_runtimeMode) + ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) { @@ -48,25 +58,26 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC("Game", 0x232b318c)) ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->Attribute(AZ::Edit::Attributes::PrimaryAssetType, AZ::AzTypeInfo::Uuid()) - ->ClassElement(AZ::Edit::ClassElements::Group, "Probe Spacing") + ->ClassElement(AZ::Edit::ClassElements::Group, "Probe Spacing (meters between probes)") ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingX, "X", "Probe spacing on the X-axis") + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingX, "X", "Probe spacing on the X-axis, in meters") ->Attribute(AZ::Edit::Attributes::Min, 0.0f) ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnProbeSpacingValidateX) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnProbeSpacingChanged) - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingY, "Y", "Probe spacing on the Y-axis") + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingY, "Y", "Probe spacing on the Y-axis, in meters") ->Attribute(AZ::Edit::Attributes::Min, 0.0f) ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnProbeSpacingValidateY) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnProbeSpacingChanged) - ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingZ, "Z", "Probe spacing on the Z-axis") + ->DataElement(AZ::Edit::UIHandlers::Default, &EditorDiffuseProbeGridComponent::m_probeSpacingZ, "Z", "Probe spacing on the Z-axis, in meters") ->Attribute(AZ::Edit::Attributes::Min, 0.0f) ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnProbeSpacingValidateZ) ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnProbeSpacingChanged) ->ClassElement(AZ::Edit::ClassElements::Group, "Grid Settings") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) ->DataElement(AZ::Edit::UIHandlers::Slider, &EditorDiffuseProbeGridComponent::m_ambientMultiplier, "Ambient Multiplier", "Multiplier for the irradiance intensity") ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnAmbientMultiplierChanged) - ->Attribute(Edit::Attributes::Decimals, 0) - ->Attribute(Edit::Attributes::Step, 1.0f) + ->Attribute(Edit::Attributes::Decimals, 1) + ->Attribute(Edit::Attributes::Step, 0.1f) ->Attribute(Edit::Attributes::Min, 0.0f) ->Attribute(Edit::Attributes::Max, 10.0f) ->DataElement(AZ::Edit::UIHandlers::Slider, &EditorDiffuseProbeGridComponent::m_viewBias, "View Bias", "View bias adjustment") @@ -81,6 +92,27 @@ namespace AZ ->Attribute(Edit::Attributes::Step, 0.1f) ->Attribute(Edit::Attributes::Min, 0.0f) ->Attribute(Edit::Attributes::Max, 1.0f) + ->ClassElement(AZ::Edit::ClassElements::EditorData, "Grid mode") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement(Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_editorMode, "Editor Mode", "Controls whether the editor uses RealTime or Baked diffuse GI. RealTime requires a ray-tracing capable GPU. Auto-Select will fallback to Baked if ray-tracing is not available") + ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnModeChangeValidate) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnEditorModeChanged) + ->EnumAttribute(DiffuseProbeGridMode::RealTime, "Real Time (Ray-Traced)") + ->EnumAttribute(DiffuseProbeGridMode::Baked, "Baked") + ->EnumAttribute(DiffuseProbeGridMode::AutoSelect, "Auto Select") + ->DataElement(Edit::UIHandlers::ComboBox, &EditorDiffuseProbeGridComponent::m_runtimeMode, "Runtime Mode", "Controls whether the runtime uses RealTime or Baked diffuse GI. RealTime requires a ray-tracing capable GPU. Auto-Select will fallback to Baked if ray-tracing is not available") + ->Attribute(AZ::Edit::Attributes::ChangeValidate, &EditorDiffuseProbeGridComponent::OnModeChangeValidate) + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::OnRuntimeModeChanged) + ->EnumAttribute(DiffuseProbeGridMode::RealTime, "Real Time (Ray-Traced)") + ->EnumAttribute(DiffuseProbeGridMode::Baked, "Baked") + ->EnumAttribute(DiffuseProbeGridMode::AutoSelect, "Auto Select") + ->ClassElement(AZ::Edit::ClassElements::Group, "Bake Textures") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->UIElement(AZ::Edit::UIHandlers::Button, "Bake Textures", "Bake the Diffuse Probe Grid textures to static assets that will be used when the mode is set to Baked") + ->Attribute(AZ::Edit::Attributes::NameLabelOverride, "") + ->Attribute(AZ::Edit::Attributes::ButtonText, "Bake Textures") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &EditorDiffuseProbeGridComponent::BakeDiffuseProbeGrid) + ->Attribute(AZ::Edit::Attributes::Visibility, &EditorDiffuseProbeGridComponent::GetBakeDiffuseProbeGridVisibilitySetting) ; editContext->Class( @@ -90,12 +122,6 @@ namespace AZ ->DataElement(AZ::Edit::UIHandlers::Default, &DiffuseProbeGridComponentController::m_configuration, "Configuration", "") ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; - - editContext->Class( - "DiffuseProbeGridComponentConfig", "") - ->ClassElement(AZ::Edit::ClassElements::EditorData, "") - ->Attribute(AZ::Edit::Attributes::AutoExpand, true) - ; } } @@ -121,15 +147,73 @@ namespace AZ BaseClass::Activate(); AzFramework::EntityDebugDisplayEventBus::Handler::BusConnect(GetEntityId()); AzToolsFramework::EditorComponentSelectionRequestsBus::Handler::BusConnect(GetEntityId()); + AZ::TickBus::Handler::BusConnect(); + AzToolsFramework::EditorEntityInfoNotificationBus::Handler::BusConnect(); } void EditorDiffuseProbeGridComponent::Deactivate() { + AzToolsFramework::EditorEntityInfoNotificationBus::Handler::BusDisconnect(); + AZ::TickBus::Handler::BusDisconnect(); AzToolsFramework::EditorComponentSelectionRequestsBus::Handler::BusDisconnect(); AzFramework::EntityDebugDisplayEventBus::Handler::BusDisconnect(); BaseClass::Deactivate(); } + void EditorDiffuseProbeGridComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + { + if (!m_controller.m_featureProcessor) + { + return; + } + + DiffuseProbeGridComponentConfig& configuration = m_controller.m_configuration; + + // set the editor mode, which will override the runtime mode set by the controller + if (!m_editorModeSet) + { + m_controller.m_featureProcessor->SetMode(m_controller.m_handle, configuration.m_editorMode); + m_editorModeSet = true; + } + + CheckTextureAssetNotification(configuration.m_bakedIrradianceTextureRelativePath, configuration.m_bakedIrradianceTextureAsset); + CheckTextureAssetNotification(configuration.m_bakedDistanceTextureRelativePath, configuration.m_bakedDistanceTextureAsset); + CheckTextureAssetNotification(configuration.m_bakedRelocationTextureRelativePath, configuration.m_bakedRelocationTextureAsset); + CheckTextureAssetNotification(configuration.m_bakedClassificationTextureRelativePath, configuration.m_bakedClassificationTextureAsset); + } + + void EditorDiffuseProbeGridComponent::CheckTextureAssetNotification(const AZStd::string& relativePath, Data::Asset& configurationAsset) + { + Data::Asset textureAsset; + DiffuseProbeGridTextureNotificationType notificationType = DiffuseProbeGridTextureNotificationType::None; + if (m_controller.m_featureProcessor->CheckTextureAssetNotification(relativePath + ".streamingimage", textureAsset, notificationType)) + { + if (notificationType == DiffuseProbeGridTextureNotificationType::Ready) + { + // bake is complete, update configuration with the new baked texture asset + AzToolsFramework::ScopedUndoBatch undoBatch("DiffuseProbeGrid Texture Bake"); + configurationAsset = { textureAsset.GetAs(), AZ::Data::AssetLoadBehavior::PreLoad }; + SetDirty(); + + if (m_controller.m_configuration.m_bakedIrradianceTextureAsset.IsReady() && + m_controller.m_configuration.m_bakedDistanceTextureAsset.IsReady() && + m_controller.m_configuration.m_bakedClassificationTextureAsset.IsReady() && + m_controller.m_configuration.m_bakedRelocationTextureAsset.IsReady()) + { + m_controller.UpdateBakedTextures(); + } + } + else if (notificationType == DiffuseProbeGridTextureNotificationType::Error) + { + QMessageBox::information( + QApplication::activeWindow(), + "Diffuse Probe Grid", + "Diffuse Probe Grid texture failed to bake, please check the Asset Processor for more information.", + QMessageBox::Ok); + } + } + } + AZ::Aabb EditorDiffuseProbeGridComponent::GetEditorSelectionBoundsViewport([[maybe_unused]] const AzFramework::ViewportInfo& viewportInfo) { return m_controller.GetAabb(); @@ -140,11 +224,19 @@ namespace AZ return false; } + void EditorDiffuseProbeGridComponent::OnEntityInfoUpdatedVisibility(AZ::EntityId entityId, bool visible) + { + if ((GetEntityId() == entityId) && !visible) + { + m_editorModeSet = false; + } + } + AZ::Outcome EditorDiffuseProbeGridComponent::OnProbeSpacingValidateX(void* newValue, [[maybe_unused]] const AZ::Uuid& valueType) { if (!m_controller.m_featureProcessor) { - return AZ::Failure(AZStd::string("Unable to adjust probe spacing, please try again")); + return AZ::Failure(AZStd::string("This Diffuse Probe Grid entity is hidden, it must be visible in order to change the probe spacing.")); } float newProbeSpacingX = *(reinterpret_cast(newValue)); @@ -152,7 +244,7 @@ namespace AZ Vector3 newSpacing(newProbeSpacingX, m_probeSpacingY, m_probeSpacingZ); if (!m_controller.ValidateProbeSpacing(newSpacing)) { - return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents")); + return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents.")); } return AZ::Success(); @@ -162,7 +254,7 @@ namespace AZ { if (!m_controller.m_featureProcessor) { - return AZ::Failure(AZStd::string("Unable to adjust probe spacing, please try again")); + return AZ::Failure(AZStd::string("This Diffuse Probe Grid entity is hidden, it must be visible in order to change the probe spacing.")); } float newProbeSpacingY = *(reinterpret_cast(newValue)); @@ -170,7 +262,7 @@ namespace AZ Vector3 newSpacing(m_probeSpacingX, newProbeSpacingY, m_probeSpacingZ); if (!m_controller.ValidateProbeSpacing(newSpacing)) { - return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents")); + return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents.")); } return AZ::Success(); @@ -180,7 +272,7 @@ namespace AZ { if (!m_controller.m_featureProcessor) { - return AZ::Failure(AZStd::string("Unable to adjust probe spacing, please try again")); + return AZ::Failure(AZStd::string("This Diffuse Probe Grid entity is hidden, it must be visible in order to change the probe spacing.")); } float newProbeSpacingZ = *(reinterpret_cast(newValue)); @@ -188,7 +280,7 @@ namespace AZ Vector3 newSpacing(m_probeSpacingX, m_probeSpacingY, newProbeSpacingZ); if (!m_controller.ValidateProbeSpacing(newSpacing)) { - return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents")); + return AZ::Failure(AZStd::string("Probe spacing exceeds max allowable grid size with current extents.")); } return AZ::Success(); @@ -218,5 +310,226 @@ namespace AZ m_controller.SetNormalBias(m_normalBias); return AZ::Edit::PropertyRefreshLevels::None; } + + AZ::u32 EditorDiffuseProbeGridComponent::OnEditorModeChanged() + { + // this will update the configuration and also change the DiffuseProbeGrid mode + m_controller.SetEditorMode(m_editorMode); + return AZ::Edit::PropertyRefreshLevels::EntireTree; + } + + AZ::u32 EditorDiffuseProbeGridComponent::OnRuntimeModeChanged() + { + // this will only update the configuration + m_controller.SetRuntimeMode(m_runtimeMode); + return AZ::Edit::PropertyRefreshLevels::None; + } + + AZ::Outcome EditorDiffuseProbeGridComponent::OnModeChangeValidate([[maybe_unused]] void* newValue, [[maybe_unused]] const AZ::Uuid& valueType) + { + DiffuseProbeGridMode newMode = (*(reinterpret_cast(newValue))); + + if (newMode == DiffuseProbeGridMode::Baked || newMode == DiffuseProbeGridMode::AutoSelect) + { + if (!m_controller.m_configuration.m_bakedIrradianceTextureAsset.GetId().IsValid() || + !m_controller.m_configuration.m_bakedDistanceTextureAsset.GetId().IsValid() || + !m_controller.m_configuration.m_bakedRelocationTextureAsset.GetId().IsValid() || + !m_controller.m_configuration.m_bakedClassificationTextureAsset.GetId().IsValid()) + { + return AZ::Failure(AZStd::string("Please bake textures before changing the Diffuse Probe Grid to Baked or Auto-Select mode.")); + } + } + + return AZ::Success(); + } + + AZ::u32 EditorDiffuseProbeGridComponent::GetBakeDiffuseProbeGridVisibilitySetting() + { + // the Bake button is visible only when the editor mode is set to RealTime + return m_editorMode == DiffuseProbeGridMode::RealTime ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide; + } + + AZ::u32 EditorDiffuseProbeGridComponent::BakeDiffuseProbeGrid() + { + if (m_bakeInProgress) + { + return AZ::Edit::PropertyRefreshLevels::None; + } + + // retrieve entity visibility + bool isHidden = false; + AzToolsFramework::EditorEntityInfoRequestBus::EventResult( + isHidden, + GetEntityId(), + &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsHidden); + + // the entity must be visible in order to bake + if (isHidden) + { + QMessageBox::information( + QApplication::activeWindow(), + "Diffuse Probe Grid", + "This Diffuse Probe Grid entity is hidden, it must be visible in order to bake textures.", + QMessageBox::Ok); + + return AZ::Edit::PropertyRefreshLevels::None; + } + + DiffuseProbeGridComponentConfig& configuration = m_controller.m_configuration; + + // retrieve the source image paths from the configuration + // Note: we need to make sure to use the same source image for each bake + AZStd::string irradianceTextureRelativePath = ValidateOrCreateNewTexturePath(configuration.m_bakedIrradianceTextureRelativePath, DiffuseProbeGridIrradianceFileName); + AZStd::string distanceTextureRelativePath = ValidateOrCreateNewTexturePath(configuration.m_bakedDistanceTextureRelativePath, DiffuseProbeGridDistanceFileName); + AZStd::string relocationTextureRelativePath = ValidateOrCreateNewTexturePath(configuration.m_bakedRelocationTextureRelativePath, DiffuseProbeGridRelocationFileName); + AZStd::string classificationTextureRelativePath = ValidateOrCreateNewTexturePath(configuration.m_bakedClassificationTextureRelativePath, DiffuseProbeGridClassificationFileName); + + // create the full paths + char projectPath[AZ_MAX_PATH_LEN]; + AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", projectPath, AZ_MAX_PATH_LEN); + + AZStd::string irradianceTextureFullPath; + AzFramework::StringFunc::Path::Join(projectPath, irradianceTextureRelativePath.c_str(), irradianceTextureFullPath, true, true); + AZStd::string distanceTextureFullPath; + AzFramework::StringFunc::Path::Join(projectPath, distanceTextureRelativePath.c_str(), distanceTextureFullPath, true, true); + AZStd::string relocationTextureFullPath; + AzFramework::StringFunc::Path::Join(projectPath, relocationTextureRelativePath.c_str(), relocationTextureFullPath, true, true); + AZStd::string classificationTextureFullPath; + AzFramework::StringFunc::Path::Join(projectPath, classificationTextureRelativePath.c_str(), classificationTextureFullPath, true, true); + + // make sure the folder is created + AZStd::string diffuseProbeGridFolder; + AzFramework::StringFunc::Path::GetFolderPath(irradianceTextureFullPath.data(), diffuseProbeGridFolder); + AZ::IO::SystemFile::CreateDir(diffuseProbeGridFolder.c_str()); + + // check out the files in source control + CheckoutSourceTextureFile(irradianceTextureFullPath); + CheckoutSourceTextureFile(distanceTextureFullPath); + CheckoutSourceTextureFile(relocationTextureFullPath); + CheckoutSourceTextureFile(classificationTextureFullPath); + + // update the configuration + AzToolsFramework::ScopedUndoBatch undoBatch("DiffuseProbeGrid bake"); + configuration.m_bakedIrradianceTextureRelativePath = irradianceTextureRelativePath; + configuration.m_bakedDistanceTextureRelativePath = distanceTextureRelativePath; + configuration.m_bakedRelocationTextureRelativePath = relocationTextureRelativePath; + configuration.m_bakedClassificationTextureRelativePath = classificationTextureRelativePath; + SetDirty(); + + // callback for the texture readback + DiffuseProbeGridBakeTexturesCallback bakeTexturesCallback = [=]( + DiffuseProbeGridTexture irradianceTexture, + DiffuseProbeGridTexture distanceTexture, + DiffuseProbeGridTexture relocationTexture, + DiffuseProbeGridTexture classificationTexture) + { + // irradiance + { + AZ::DdsFile::DdsFileData fileData = { irradianceTexture.m_size, irradianceTexture.m_format, irradianceTexture.m_data.get() }; + [[maybe_unused]] const auto outcome = AZ::DdsFile::WriteFile(irradianceTextureFullPath, fileData); + AZ_Assert(outcome.IsSuccess(), "Failed to write Irradiance texture .dds file [%s]", irradianceTextureFullPath.c_str()); + } + + // distance + { + AZ::DdsFile::DdsFileData fileData = { distanceTexture.m_size, distanceTexture.m_format, distanceTexture.m_data.get() }; + [[maybe_unused]] const auto outcome = AZ::DdsFile::WriteFile(distanceTextureFullPath, fileData); + AZ_Assert(outcome.IsSuccess(), "Failed to write Distance texture .dds file [%s]", distanceTextureFullPath.c_str()); + } + + // relocation + { + AZ::DdsFile::DdsFileData fileData = { relocationTexture.m_size, relocationTexture.m_format, relocationTexture.m_data.get() }; + [[maybe_unused]] const auto outcome = AZ::DdsFile::WriteFile(relocationTextureFullPath, fileData); + AZ_Assert(outcome.IsSuccess(), "Failed to write Relocation texture .dds file [%s]", relocationTextureFullPath.c_str()); + } + + // classification + { + AZ::DdsFile::DdsFileData fileData = { classificationTexture.m_size, classificationTexture.m_format, classificationTexture.m_data.get() }; + [[maybe_unused]] const auto outcome = AZ::DdsFile::WriteFile(classificationTextureFullPath, fileData); + AZ_Assert(outcome.IsSuccess(), "Failed to write Classification texture .dds file [%s]", classificationTextureFullPath.c_str()); + } + + m_bakeInProgress = false; + }; + + m_bakeInProgress = true; + m_controller.BakeTextures(bakeTexturesCallback); + + while (m_bakeInProgress) + { + QApplication::processEvents(); + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(100)); + } + + QMessageBox::information( + QApplication::activeWindow(), + "Diffuse Probe Grid", + "Successfully baked Diffuse Probe Grid textures.", + QMessageBox::Ok); + + return AZ::Edit::PropertyRefreshLevels::None; + } + + AZStd::string EditorDiffuseProbeGridComponent::ValidateOrCreateNewTexturePath(const AZStd::string& configurationRelativePath, const char* fileSuffix) + { + AZStd::string relativePath = configurationRelativePath; + AZStd::string fullPath; + + char projectPath[AZ_MAX_PATH_LEN]; + AZ::IO::FileIOBase::GetInstance()->ResolvePath("@devassets@", projectPath, AZ_MAX_PATH_LEN); + + if (!relativePath.empty()) + { + // test to see if the texture file is actually there, if it was removed we need to + // generate a new filename, otherwise it will cause an error in the asset system + AzFramework::StringFunc::Path::Join(projectPath, configurationRelativePath.c_str(), fullPath, true, true); + + if (!AZ::IO::FileIOBase::GetInstance()->Exists(fullPath.c_str())) + { + // file does not exist, clear the relative path so we generate a new name + relativePath.clear(); + } + } + + // build a new image path if necessary + if (relativePath.empty()) + { + // the file name is a combination of the entity name, a UUID, and the filemask + Entity* entity = GetEntity(); + AZ_Assert(entity, "DiffuseProbeGrid entity is null"); + + AZ::Uuid uuid = AZ::Uuid::CreateRandom(); + AZStd::string uuidString; + uuid.ToString(uuidString); + + relativePath = "DiffuseProbeGrids/" + entity->GetName() + uuidString + fileSuffix; + + // replace any invalid filename characters + auto invalidCharacters = [](char letter) + { + return + letter == ':' || letter == '"' || letter == '\'' || + letter == '{' || letter == '}' || + letter == '<' || letter == '>'; + }; + AZStd::replace_if(relativePath.begin(), relativePath.end(), invalidCharacters, '_'); + } + + return relativePath; + } + + void EditorDiffuseProbeGridComponent::CheckoutSourceTextureFile(const AZStd::string& fullPath) + { + bool checkedOutSuccessfully = false; + using ApplicationBus = AzToolsFramework::ToolsApplicationRequestBus; + ApplicationBus::BroadcastResult( + checkedOutSuccessfully, + &ApplicationBus::Events::RequestEditForFileBlocking, + fullPath.c_str(), + "Checking out for edit...", + ApplicationBus::Events::RequestEditProgressCallback()); + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h index 2a50c47b81..15c46d45ba 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/DiffuseProbeGrid/EditorDiffuseProbeGridComponent.h @@ -12,8 +12,10 @@ #pragma once +#include #include #include +#include #include #include #include @@ -26,6 +28,8 @@ namespace AZ : public EditorRenderComponentAdapter , private AzToolsFramework::EditorComponentSelectionRequestsBus::Handler , private AzFramework::EntityDebugDisplayEventBus::Handler + , private AZ::TickBus::Handler + , private AzToolsFramework::EditorEntityInfoNotificationBus::Handler { public: using BaseClass = EditorRenderComponentAdapter; @@ -41,10 +45,22 @@ namespace AZ void Deactivate() override; private: + + // AZ::TickBus overrides + void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; + // EditorComponentSelectionRequestsBus overrides AZ::Aabb GetEditorSelectionBoundsViewport(const AzFramework::ViewportInfo& viewportInfo) override; bool SupportsEditorRayIntersect() override; + // EditorEntityInfoNotifications overrides + void OnEntityInfoUpdatedVisibility(AZ::EntityId entityId, bool visible) override; + + // helper functions + AZStd::string ValidateOrCreateNewTexturePath(const AZStd::string& relativePath, const char* fileSuffix); + void CheckoutSourceTextureFile(const AZStd::string& fullPath); + void CheckTextureAssetNotification(const AZStd::string& relativePath, Data::Asset& configurationAsset); + // property change notifications AZ::Outcome OnProbeSpacingValidateX(void* newValue, const AZ::Uuid& valueType); AZ::Outcome OnProbeSpacingValidateY(void* newValue, const AZ::Uuid& valueType); @@ -53,6 +69,13 @@ namespace AZ AZ::u32 OnAmbientMultiplierChanged(); AZ::u32 OnViewBiasChanged(); AZ::u32 OnNormalBiasChanged(); + AZ::u32 OnEditorModeChanged(); + AZ::u32 OnRuntimeModeChanged(); + AZ::Outcome OnModeChangeValidate(void* newValue, const AZ::Uuid& valueType); + + // Button handler + AZ::u32 BakeDiffuseProbeGrid(); + AZ::u32 GetBakeDiffuseProbeGridVisibilitySetting(); // properties float m_probeSpacingX = DefaultDiffuseProbeGridSpacing; @@ -61,6 +84,12 @@ namespace AZ float m_ambientMultiplier = DefaultDiffuseProbeGridAmbientMultiplier; float m_viewBias = DefaultDiffuseProbeGridViewBias; float m_normalBias = DefaultDiffuseProbeGridNormalBias; + DiffuseProbeGridMode m_editorMode = DiffuseProbeGridMode::RealTime; + DiffuseProbeGridMode m_runtimeMode = DiffuseProbeGridMode::RealTime; + + // flags + bool m_editorModeSet = false; + AZStd::atomic_bool m_bakeInProgress = false; }; } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp index 7f54e386fc..3192900ca4 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Material/EditorMaterialComponentInspector.cpp @@ -296,15 +296,25 @@ namespace AZ void MaterialPropertyInspector::RunEditorMaterialFunctors() { AZStd::unordered_set changedPropertyNames; + AZStd::unordered_set changedPropertyGroupNames; // Convert editor property configuration data into material property meta data so that it can be used to execute functors AZStd::unordered_map propertyDynamicMetadata; - for (auto& group : m_groups) + AZStd::unordered_map propertyGroupDynamicMetadata; + for (auto& groupPair : m_groups) { - for (auto& property : group.second.m_properties) + AZ::RPI::MaterialPropertyGroupDynamicMetadata& metadata = propertyGroupDynamicMetadata[AZ::Name{groupPair.first}]; + + for (auto& property : groupPair.second.m_properties) { AtomToolsFramework::ConvertToPropertyMetaData(propertyDynamicMetadata[property.GetId()], property.GetConfig()); } + + // It's significant that we check IsGroupHidden rather than IsGroupVisisble, because it follows the same rules as QWidget::isHidden(). + // We don't care whether the widget and all its parents are visible, we only care about whether the group was hidden within the context + // of the material property inspector. + metadata.m_visibility = IsGroupHidden(groupPair.first) ? + AZ::RPI::MaterialPropertyGroupVisibility::Hidden : AZ::RPI::MaterialPropertyGroupVisibility::Enabled; } for (AZ::RPI::Ptr& functor : m_editorFunctors) @@ -318,7 +328,9 @@ namespace AZ m_materialInstance->GetPropertyValues(), m_materialInstance->GetMaterialPropertiesLayout(), propertyDynamicMetadata, + propertyGroupDynamicMetadata, changedPropertyNames, + changedPropertyGroupNames, &materialPropertyDependencies ); functor->Process(context); @@ -327,9 +339,16 @@ namespace AZ m_dirtyPropertyFlags.reset(); // Apply any changes to material property meta data back to the editor property configurations - for (auto& group : m_groups) + for (auto& groupPair : m_groups) { - for (auto& property : group.second.m_properties) + AZ::Name groupName{groupPair.first}; + + if (changedPropertyGroupNames.find(groupName) != changedPropertyGroupNames.end()) + { + SetGroupVisible(groupPair.first, propertyGroupDynamicMetadata[groupName].m_visibility == AZ::RPI::MaterialPropertyGroupVisibility::Enabled); + } + + for (auto& property : groupPair.second.m_properties) { AtomToolsFramework::DynamicPropertyConfig propertyConfig = property.GetConfig(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.h index 1acaa6fdf8..41ea80f8d1 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.h @@ -35,14 +35,13 @@ namespace AZ , private MeshComponentNotificationBus::Handler { public: - using BaseClass = EditorRenderComponentAdapter; AZ_EDITOR_COMPONENT(AZ::Render::EditorMeshComponent, EditorMeshComponentTypeId, BaseClass); static void Reflect(AZ::ReflectContext* context); EditorMeshComponent() = default; - EditorMeshComponent(const MeshComponentConfig& config); + explicit EditorMeshComponent(const MeshComponentConfig& config); // AZ::Component overrides ... void Activate() override; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponent.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponent.h index a57780c384..fe7f45d7d1 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponent.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponent.h @@ -25,12 +25,11 @@ namespace AZ : public AzFramework::Components::ComponentAdapter { public: - using BaseClass = AzFramework::Components::ComponentAdapter; AZ_COMPONENT(AZ::Render::MeshComponent, MeshComponentTypeId, BaseClass); MeshComponent() = default; - MeshComponent(const MeshComponentConfig& config); + explicit MeshComponent(const MeshComponentConfig& config); static void Reflect(AZ::ReflectContext* context); }; diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index a4a91cf708..c089dd01f9 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -177,28 +177,33 @@ namespace AZ FixUpModelAsset(m_configuration.m_modelAsset); } - void MeshComponentController::Activate(AZ::EntityId entityId) + void MeshComponentController::Activate(const AZ::EntityComponentIdPair& entityComponentIdPair) { FixUpModelAsset(m_configuration.m_modelAsset); - m_entityId = entityId; + const AZ::EntityId entityId = entityComponentIdPair.GetEntityId(); + m_entityComponentIdPair = entityComponentIdPair; - m_transformInterface = TransformBus::FindFirstHandler(m_entityId); + m_transformInterface = TransformBus::FindFirstHandler(entityId); AZ_Warning("MeshComponentController", m_transformInterface, "Unable to attach to a TransformBus handler. This mesh will always be rendered at the origin."); - m_meshFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity(m_entityId); + m_meshFeatureProcessor = RPI::Scene::GetFeatureProcessorForEntity(entityId); AZ_Error("MeshComponentController", m_meshFeatureProcessor, "Unable to find a MeshFeatureProcessorInterface on the entityId."); m_cachedNonUniformScale = AZ::Vector3::CreateOne(); - AZ::NonUniformScaleRequestBus::EventResult(m_cachedNonUniformScale, m_entityId, &AZ::NonUniformScaleRequests::GetScale); - AZ::NonUniformScaleRequestBus::Event(m_entityId, &AZ::NonUniformScaleRequests::RegisterScaleChangedEvent, + AZ::NonUniformScaleRequestBus::EventResult(m_cachedNonUniformScale, entityId, &AZ::NonUniformScaleRequests::GetScale); + AZ::NonUniformScaleRequestBus::Event(entityId, &AZ::NonUniformScaleRequests::RegisterScaleChangedEvent, m_nonUniformScaleChangedHandler); - MeshComponentRequestBus::Handler::BusConnect(m_entityId); - TransformNotificationBus::Handler::BusConnect(m_entityId); - MaterialReceiverRequestBus::Handler::BusConnect(m_entityId); - MaterialComponentNotificationBus::Handler::BusConnect(m_entityId); - AzFramework::BoundsRequestBus::Handler::BusConnect(m_entityId); + MeshComponentRequestBus::Handler::BusConnect(entityId); + TransformNotificationBus::Handler::BusConnect(entityId); + MaterialReceiverRequestBus::Handler::BusConnect(entityId); + MaterialComponentNotificationBus::Handler::BusConnect(entityId); + AzFramework::BoundsRequestBus::Handler::BusConnect(entityId); + AzFramework::EntityContextId contextId; + AzFramework::EntityIdContextQueryBus::EventResult( + contextId, entityId, &AzFramework::EntityIdContextQueries::GetOwningContextId); + AzFramework::RenderGeometry::IntersectionRequestBus::Handler::BusConnect({entityId, contextId}); //Buses must be connected before RegisterModel in case requests are made as a result of HandleModelChange RegisterModel(); @@ -209,6 +214,7 @@ namespace AZ // Buses must be disconnected after unregistering the model, otherwise they can't deliver the events during the process. UnregisterModel(); + AzFramework::RenderGeometry::IntersectionRequestBus::Handler::BusDisconnect(); AzFramework::BoundsRequestBus::Handler::BusDisconnect(); MeshComponentRequestBus::Handler::BusDisconnect(); TransformNotificationBus::Handler::BusDisconnect(); @@ -219,7 +225,7 @@ namespace AZ m_meshFeatureProcessor = nullptr; m_transformInterface = nullptr; - m_entityId = AZ::EntityId(AZ::EntityId::InvalidEntityId); + m_entityComponentIdPair = AZ::EntityComponentIdPair(AZ::EntityId(), AZ::InvalidComponentId); m_configuration.m_modelAsset.Release(); } @@ -293,10 +299,11 @@ namespace AZ Data::Asset modelAsset = m_meshFeatureProcessor->GetModelAsset(m_meshHandle); if (model && modelAsset) { + const AZ::EntityId entityId = m_entityComponentIdPair.GetEntityId(); m_configuration.m_modelAsset = modelAsset; - MeshComponentNotificationBus::Event(m_entityId, &MeshComponentNotificationBus::Events::OnModelReady, m_configuration.m_modelAsset, model); - MaterialReceiverNotificationBus::Event(m_entityId, &MaterialReceiverNotificationBus::Events::OnMaterialAssignmentsChanged); - AZ::Interface::Get()->RefreshEntityLocalBoundsUnion(m_entityId); + MeshComponentNotificationBus::Event(entityId, &MeshComponentNotificationBus::Events::OnModelReady, m_configuration.m_modelAsset, model); + MaterialReceiverNotificationBus::Event(entityId, &MaterialReceiverNotificationBus::Events::OnMaterialAssignmentsChanged); + AZ::Interface::Get()->RefreshEntityLocalBoundsUnion(entityId); } } @@ -304,8 +311,10 @@ namespace AZ { if (m_meshFeatureProcessor && m_configuration.m_modelAsset.GetId().IsValid()) { + const AZ::EntityId entityId = m_entityComponentIdPair.GetEntityId(); + MaterialAssignmentMap materials; - MaterialComponentRequestBus::EventResult(materials, m_entityId, &MaterialComponentRequests::GetMaterialOverrides); + MaterialComponentRequestBus::EventResult(materials, entityId, &MaterialComponentRequests::GetMaterialOverrides); m_meshFeatureProcessor->ReleaseMesh(m_meshHandle); m_meshHandle = m_meshFeatureProcessor->AcquireMesh(m_configuration.m_modelAsset, materials, @@ -330,7 +339,8 @@ namespace AZ { if (m_meshFeatureProcessor && m_meshHandle.IsValid()) { - MeshComponentNotificationBus::Event(m_entityId, &MeshComponentNotificationBus::Events::OnModelPreDestroy); + MeshComponentNotificationBus::Event( + m_entityComponentIdPair.GetEntityId(), &MeshComponentNotificationBus::Events::OnModelPreDestroy); m_meshFeatureProcessor->ReleaseMesh(m_meshHandle); } } @@ -462,5 +472,34 @@ namespace AZ return Aabb::CreateNull(); } } + + AzFramework::RenderGeometry::RayResult MeshComponentController::RenderGeometryIntersect( + const AzFramework::RenderGeometry::RayRequest& ray) + { + AzFramework::RenderGeometry::RayResult result; + if (const Data::Instance model = GetModel()) + { + float t; + AZ::Vector3 normal; + if (model->RayIntersection( + m_transformInterface->GetWorldTM(), m_cachedNonUniformScale, ray.m_startWorldPosition, + ray.m_endWorldPosition - ray.m_startWorldPosition, t, normal)) + { + // note: this is a temporary workaround to handle cases where model->RayIntersection + // returns negative distances, follow-up ATOM-15673 + const auto absT = AZStd::abs(t); + + // fill in ray result structure after successful intersection + const auto intersectionLine = (ray.m_endWorldPosition - ray.m_startWorldPosition); + result.m_uv = AZ::Vector2::CreateZero(); + result.m_worldPosition = ray.m_startWorldPosition + intersectionLine * absT; + result.m_worldNormal = normal; + result.m_distance = intersectionLine.GetLength() * absT; + result.m_entityAndComponent = m_entityComponentIdPair; + } + } + + return result; + } } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h index 0cda34ea42..4d63e5e88d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.h @@ -13,11 +13,13 @@ #pragma once #include +#include #include #include #include +#include #include #include @@ -32,9 +34,7 @@ namespace AZ { namespace Render { - /** - * A configuration structure for the MeshComponentController - */ + //! A configuration structure for the MeshComponentController class MeshComponentConfig final : public AZ::ComponentConfig { @@ -57,6 +57,7 @@ namespace AZ class MeshComponentController final : private MeshComponentRequestBus::Handler , public AzFramework::BoundsRequestBus::Handler + , public AzFramework::RenderGeometry::IntersectionRequestBus::Handler , private TransformNotificationBus::Handler , private MaterialReceiverRequestBus::Handler , private MaterialComponentNotificationBus::Handler @@ -77,7 +78,7 @@ namespace AZ MeshComponentController() = default; MeshComponentController(const MeshComponentConfig& config); - void Activate(AZ::EntityId entityId); + void Activate(const AZ::EntityComponentIdPair& entityComponentIdPair); void Deactivate(); void SetConfiguration(const MeshComponentConfig& config); const MeshComponentConfig& GetConfiguration() const; @@ -103,10 +104,13 @@ namespace AZ void SetVisibility(bool visible) override; bool GetVisibility() const override; - // BoundsRequestBus and MeshComponentRequestBus ... + // BoundsRequestBus and MeshComponentRequestBus overrides ... AZ::Aabb GetWorldBounds() override; AZ::Aabb GetLocalBounds() override; + // IntersectionRequestBus overrides ... + AzFramework::RenderGeometry::RayResult RenderGeometryIntersect(const AzFramework::RenderGeometry::RayRequest& ray) override; + // TransformNotificationBus::Handler overrides ... void OnTransformChanged(const AZ::Transform& local, const AZ::Transform& world) override; @@ -134,7 +138,7 @@ namespace AZ Render::MeshFeatureProcessorInterface* m_meshFeatureProcessor = nullptr; Render::MeshFeatureProcessorInterface::MeshHandle m_meshHandle; TransformInterface* m_transformInterface = nullptr; - AZ::EntityId m_entityId; + AZ::EntityComponentIdPair m_entityComponentIdPair; bool m_isVisible = true; MeshComponentConfig m_configuration; AZ::Vector3 m_cachedNonUniformScale = AZ::Vector3::CreateOne(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentConfig.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentConfig.cpp index e6afd4f21f..317fa96450 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentConfig.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentConfig.cpp @@ -20,16 +20,18 @@ namespace AZ { void DisplayMapperComponentConfig::Reflect(ReflectContext* context) { + AcesParameterOverrides::Reflect(context); + if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(0) + ->Version(1) ->Field("DisplayMapperOperationType", &DisplayMapperComponentConfig::m_displayMapperOperation) ->Field("LdrColorGradingLutEnabled", &DisplayMapperComponentConfig::m_ldrColorGradingLutEnabled) ->Field("LdrColorGradingLut", &DisplayMapperComponentConfig::m_ldrColorGradingLut) + ->Field("AcesParameterOverrides", &DisplayMapperComponentConfig::m_acesParameterOverrides) ; } } - } // namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentController.cpp index d90e170322..0e283199e7 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/DisplayMapperComponentController.cpp @@ -85,6 +85,7 @@ namespace AZ desc.m_operationType = m_configuration.m_displayMapperOperation; desc.m_ldrGradingLutEnabled = m_configuration.m_ldrColorGradingLutEnabled; desc.m_ldrColorGradingLut = m_configuration.m_ldrColorGradingLut; + desc.m_acesParameterOverrides = m_configuration.m_acesParameterOverrides; fp->RegisterDisplayMapperConfiguration(desc); } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/EditorDisplayMapperComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/EditorDisplayMapperComponent.cpp index 80aad79218..64cd450940 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/EditorDisplayMapperComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/PostProcess/DisplayMapper/EditorDisplayMapperComponent.cpp @@ -10,6 +10,8 @@ * */ +#include "Atom/Feature/ACES/AcesDisplayMapperFeatureProcessor.h" + #include #include @@ -47,6 +49,76 @@ namespace AZ ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly) ; + editContext->Class( + "AcesParameterOverrides", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_overrideDefaults, "Override Defaults", + "When enabled allows parameter overrides for ACES configuration") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_alterSurround, "Alter Surround", + "Apply gamma adjustment to compensate for dim surround") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyDesaturation, "Alter Desaturation", + "Apply desaturation to compensate for luminance difference") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement( + AZ::Edit::UIHandlers::CheckBox, &AcesParameterOverrides::m_applyCATD60toD65, "Alter CAT D60 to D65", + "Apply Color appearance transform (CAT) from ACES white point to assumed observer adapted white point") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + + ->DataElement( + Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsBlack, + "Cinema Limit (black)", + "Reference black luminance value") + ->DataElement( + Edit::UIHandlers::Default, &AcesParameterOverrides::m_cinemaLimitsWhite, + "Cinema Limit (white)", + "Reference white luminance value") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + + ->DataElement( + Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_minPoint, "Min Point (luminance)", + "Linear extension below this") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement( + Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_midPoint, "Mid Point (luminance)", + "Middle gray") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement( + Edit::UIHandlers::Vector2, &AcesParameterOverrides::m_maxPoint, "Max Point (luminance)", + "Linear extension above this") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + + ->DataElement( + AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_surroundGamma, "Surround Gamma", + "Gamma adjustment to be applied to compensate for the condition of the viewing environment") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + ->DataElement( + AZ::Edit::UIHandlers::Default, &AcesParameterOverrides::m_gamma, "Gamma", + "Optional gamma value that is applied as basic gamma curve OETF") + ->Attribute(Edit::Attributes::ChangeNotify, Edit::PropertyRefreshLevels::ValuesOnly) + + // Load preset group + ->ClassElement(AZ::Edit::ClassElements::Group, "Load Preset") + ->Attribute(AZ::Edit::Attributes::AutoExpand, true) + ->DataElement( + Edit::UIHandlers::ComboBox, &AcesParameterOverrides::m_preset, "Preset Selection", + "Allows specifying default preset for different ODT modes") + ->EnumAttribute(OutputDeviceTransformType::OutputDeviceTransformType_48Nits, "48 Nits") + ->EnumAttribute(OutputDeviceTransformType::OutputDeviceTransformType_1000Nits, "1000 Nits") + ->EnumAttribute(OutputDeviceTransformType::OutputDeviceTransformType_2000Nits, "2000 Nits") + ->EnumAttribute(OutputDeviceTransformType::OutputDeviceTransformType_4000Nits, "4000 Nits") + ->UIElement(AZ::Edit::UIHandlers::Button, "Load", "Load default preset") + ->Attribute(AZ::Edit::Attributes::ChangeNotify, &AcesParameterOverrides::LoadPreset) + ->Attribute(AZ::Edit::Attributes::ButtonText, "Load") + ; + editContext->Class("ToneMapperComponentConfig", "") ->ClassElement(Edit::ClassElements::EditorData, "") ->DataElement(Edit::UIHandlers::ComboBox, @@ -64,7 +136,10 @@ namespace AZ &DisplayMapperComponentConfig::m_ldrColorGradingLutEnabled, "Enable LDR color grading LUT", "Enable LDR color grading LUT.") - ->DataElement(AZ::Edit::UIHandlers::Default, &DisplayMapperComponentConfig::m_ldrColorGradingLut, "LDR color Grading LUT", "LDR color grading LUT"); + ->DataElement(AZ::Edit::UIHandlers::Default, &DisplayMapperComponentConfig::m_ldrColorGradingLut, "LDR color Grading LUT", "LDR color grading LUT") + ->DataElement(AZ::Edit::UIHandlers::Default, &DisplayMapperComponentConfig::m_acesParameterOverrides, "ACES Parameters", "Parameter overrides for ACES.") + ; + } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp index 735eab5368..7880d5e88c 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/ReflectionProbe/EditorReflectionProbeComponent.cpp @@ -209,8 +209,8 @@ namespace AZ AZ::Vector3 position = AZ::Vector3::CreateZero(); AZ::TransformBus::EventResult(position, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation); - AZ::Vector3 scale = AZ::Vector3::CreateOne(); - AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalScale); + float scale = 1.0f; + AZ::TransformBus::EventResult(scale, GetEntityId(), &AZ::TransformBus::Events::GetLocalUniformScale); // draw AABB at probe position using the inner dimensions Color color(0.0f, 0.0f, 1.0f, 1.0f); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp index 2c44124564..72cc765238 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/HDRiSkyboxComponentController.cpp @@ -228,7 +228,7 @@ namespace AZ // remove scale Transform worldNoScale = world; - worldNoScale.ExtractScale(); + worldNoScale.ExtractUniformScale(); AZ::Matrix3x4 transformMatrix = AZ::Matrix3x4::CreateFromTransform(worldNoScale); transformMatrix.StoreToRowMajorFloat12(matrix); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp index 4a6b1608a4..192c1ad509 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/SkyBox/PhysicalSkyComponentController.cpp @@ -218,7 +218,7 @@ namespace AZ SunPosition PhysicalSkyComponentController::GetSunTransform(const AZ::Transform& world) { Transform worldNoScale = world; - worldNoScale.ExtractScale(); + worldNoScale.ExtractUniformScale(); AZ::Vector3 sunPositionAtom = worldNoScale.TransformVector(AZ::Vector3(0, -1, 0)); // transform Sun from default position // Convert sun position to Y-up coordinate diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/ReleaseResourcesStep.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/ReleaseResourcesStep.cpp index bad7c2fe38..ef82792f32 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/ReleaseResourcesStep.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Thumbnails/Rendering/ThumbnailRendererSteps/ReleaseResourcesStep.cpp @@ -32,32 +32,29 @@ namespace AZ void ReleaseResourcesStep::Start() { - m_context->GetData()->m_defaultMaterialAsset.Release(); - m_context->GetData()->m_defaultModelAsset.Release(); - m_context->GetData()->m_materialAsset.Release(); - m_context->GetData()->m_modelAsset.Release(); + auto data = m_context->GetData(); + + data->m_defaultMaterialAsset.Release(); + data->m_defaultModelAsset.Release(); + data->m_materialAsset.Release(); + data->m_modelAsset.Release(); + data->m_lightingPresetAsset.Release(); - if (m_context->GetData()->m_modelEntity) + if (data->m_modelEntity) { - AzFramework::EntityContextRequestBus::Event(m_context->GetData()->m_entityContext->GetContextId(), - &AzFramework::EntityContextRequestBus::Events::DestroyEntity, m_context->GetData()->m_modelEntity); - m_context->GetData()->m_modelEntity = nullptr; + AzFramework::EntityContextRequestBus::Event(data->m_entityContext->GetContextId(), + &AzFramework::EntityContextRequestBus::Events::DestroyEntity, data->m_modelEntity); + data->m_modelEntity = nullptr; } - m_context->GetData()->m_frameworkScene->UnsetSubsystem(); - - m_context->GetData()->m_scene->Deactivate(); - m_context->GetData()->m_scene->RemoveRenderPipeline(m_context->GetData()->m_renderPipeline->GetId()); - RPI::RPISystemInterface::Get()->UnregisterScene(m_context->GetData()->m_scene); - - auto sceneSystem = AzFramework::SceneSystemInterface::Get(); - AZ_Assert(sceneSystem, "Thumbnail system failed to get scene system implementation."); - [[maybe_unused]] bool sceneRemovedSuccessfully = sceneSystem->RemoveScene(m_context->GetData()->m_sceneName); - AZ_Assert( - sceneRemovedSuccessfully, "Thumbnail system was unable to remove scene '%s' from the scene system.", - m_context->GetData()->m_sceneName.c_str()); - m_context->GetData()->m_scene = nullptr; - m_context->GetData()->m_renderPipeline = nullptr; + data->m_scene->Deactivate(); + data->m_scene->RemoveRenderPipeline(data->m_renderPipeline->GetId()); + RPI::RPISystemInterface::Get()->UnregisterScene(data->m_scene); + data->m_frameworkScene->UnsetSubsystem(data->m_scene); + data->m_frameworkScene->UnsetSubsystem(data->m_entityContext.get()); + data->m_scene = nullptr; + data->m_frameworkScene = nullptr; + data->m_renderPipeline = nullptr; } } // namespace Thumbnails } // namespace LyIntegration diff --git a/Gems/AtomLyIntegration/CommonFeatures/gem.json b/Gems/AtomLyIntegration/CommonFeatures/gem.json new file mode 100644 index 0000000000..306c61e6d7 --- /dev/null +++ b/Gems/AtomLyIntegration/CommonFeatures/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "CommonFeaturesAtom", + "display_name": "Common Features Atom", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt index 6492f4f13a..9a9b389227 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/CMakeLists.txt @@ -43,6 +43,8 @@ ly_add_target( PRIVATE AZ::AzCore Gem::EMotionFX_Atom.Static + RUNTIME_DEPENDENCIES + Gem::EMotionFX ) if(PAL_TRAIT_BUILD_HOST_TOOLS) diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp index 3594802dab..8dc7f9387c 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp @@ -500,7 +500,16 @@ namespace AZ skinnedMeshLod.SetIndexBufferAsset(mesh0.GetIndexBufferAssetView().GetBufferAsset()); skinnedMeshLod.SetStaticBufferAsset(mesh0.GetSemanticBufferAssetView(Name{ "UV" })->GetBufferAsset(), SkinnedMeshStaticVertexStreams::UV_0); - const RPI::BufferAssetView* morphBufferAssetView = mesh0.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" }); + const RPI::BufferAssetView* morphBufferAssetView = nullptr; + for (const auto& mesh : modelLodAsset->GetMeshes()) + { + morphBufferAssetView = mesh.GetSemanticBufferAssetView(Name{ "MORPHTARGET_VERTEXDELTAS" }); + if (morphBufferAssetView) + { + break; + } + } + if (morphBufferAssetView) { ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), lodIndex, fullFileName, skinnedMeshLod); diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index d0116452b7..9079f639ba 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -39,6 +40,8 @@ namespace AZ { namespace Render { + static constexpr uint32_t s_maxActiveWrinkleMasks = 16; + AZ_CLASS_ALLOCATOR_IMPL(AtomActorInstance, EMotionFX::Integration::EMotionFXAllocator, 0) AtomActorInstance::AtomActorInstance(AZ::EntityId entityId, @@ -413,6 +416,10 @@ namespace AZ EMotionFX::MorphSetup* morphSetup = m_actorInstance->GetActor()->GetMorphSetup(lodIndex); if (morphSetup) { + // Track all the masks/weights that are currently active + m_wrinkleMasks.clear(); + m_wrinkleMaskWeights.clear(); + uint32_t morphTargetCount = morphSetup->GetNumMorphTargets(); m_morphTargetWeights.clear(); for (uint32_t morphTargetIndex = 0; morphTargetIndex < morphTargetCount; ++morphTargetIndex) @@ -437,11 +444,28 @@ namespace AZ const EMotionFX::MorphTargetStandard::DeformData* deformData = morphTargetStandard->GetDeformData(deformDataIndex); if (deformData->mNumVerts > 0) { - m_morphTargetWeights.push_back(morphTargetSetupInstance->GetWeight()); + float weight = morphTargetSetupInstance->GetWeight(); + m_morphTargetWeights.push_back(weight); + + // If the morph target is active and it has a wrinkle mask + auto wrinkleMaskIter = m_morphTargetWrinkleMaskMapsByLod[lodIndex].find(morphTargetStandard); + if (weight > 0 && wrinkleMaskIter != m_morphTargetWrinkleMaskMapsByLod[lodIndex].end()) + { + // Add the wrinkle mask and weight, to be set on the material + m_wrinkleMasks.push_back(wrinkleMaskIter->second); + m_wrinkleMaskWeights.push_back(weight); + } } } } m_skinnedMeshRenderProxy->SetMorphTargetWeights(lodIndex, m_morphTargetWeights); + + // Until EMotionFX and Atom lods are synchronized [ATOM-13564] we don't know which EMotionFX lod to pull the weights from + // Until that is fixed, just use lod 0 [ATOM-15251] + if (lodIndex == 0) + { + UpdateWrinkleMasks(); + } } } } @@ -453,6 +477,8 @@ namespace AZ MaterialComponentRequestBus::EventResult(materials, m_entityId, &MaterialComponentRequests::GetMaterialOverrides); CreateRenderProxy(materials); + InitWrinkleMasks(); + TransformNotificationBus::Handler::BusConnect(m_entityId); MaterialComponentNotificationBus::Handler::BusConnect(m_entityId); MeshComponentRequestBus::Handler::BusConnect(m_entityId); @@ -573,5 +599,77 @@ namespace AZ { CreateSkinnedMeshInstance(); } + + void AtomActorInstance::InitWrinkleMasks() + { + EMotionFX::Actor* actor = m_actorAsset->GetActor(); + m_morphTargetWrinkleMaskMapsByLod.resize(m_skinnedMeshInputBuffers->GetLodCount()); + m_wrinkleMasks.reserve(s_maxActiveWrinkleMasks); + m_wrinkleMaskWeights.reserve(s_maxActiveWrinkleMasks); + + for (size_t lodIndex = 0; lodIndex < m_skinnedMeshInputBuffers->GetLodCount(); ++lodIndex) + { + EMotionFX::MorphSetup* morphSetup = actor->GetMorphSetup(lodIndex); + if (morphSetup) + { + const AZStd::vector& metaDatas = actor->GetMorphTargetMetaAsset()->GetMorphTargets(); + // Loop over all the EMotionFX morph targets + uint32_t numMorphTargets = morphSetup->GetNumMorphTargets(); + for (uint32_t morphTargetIndex = 0; morphTargetIndex < numMorphTargets; ++morphTargetIndex) + { + EMotionFX::MorphTargetStandard* morphTarget = static_cast(morphSetup->GetMorphTarget(morphTargetIndex)); + for (const RPI::MorphTargetMetaAsset::MorphTarget& metaData : metaDatas) + { + // Find the metaData associated with this morph target + if (metaData.m_morphTargetName == morphTarget->GetNameString() && metaData.m_wrinkleMask && metaData.m_numVertices > 0) + { + // If the metaData has a wrinkle mask, add it to the map + Data::Instance streamingImage = RPI::StreamingImage::FindOrCreate(metaData.m_wrinkleMask); + if (streamingImage) + { + m_morphTargetWrinkleMaskMapsByLod[lodIndex][morphTarget] = streamingImage; + } + } + } + } + } + } + } + + void AtomActorInstance::UpdateWrinkleMasks() + { + if (m_meshHandle) + { + Data::Instance wrinkleMaskObjectSrg = m_meshFeatureProcessor->GetObjectSrg(*m_meshHandle); + if (wrinkleMaskObjectSrg) + { + RHI::ShaderInputImageIndex wrinkleMasksIndex = wrinkleMaskObjectSrg->FindShaderInputImageIndex(Name{ "m_wrinkle_masks" }); + RHI::ShaderInputConstantIndex wrinkleMaskWeightsIndex = wrinkleMaskObjectSrg->FindShaderInputConstantIndex(Name{ "m_wrinkle_mask_weights" }); + RHI::ShaderInputConstantIndex wrinkleMaskCountIndex = wrinkleMaskObjectSrg->FindShaderInputConstantIndex(Name{ "m_wrinkle_mask_count" }); + if (wrinkleMasksIndex.IsValid() || wrinkleMaskWeightsIndex.IsValid() || wrinkleMaskCountIndex.IsValid()) + { + AZ_Error("AtomActorInstance", wrinkleMasksIndex.IsValid(), "m_wrinkle_masks not found on the ObjectSrg, but m_wrinkle_mask_weights and/or m_wrinkle_mask_count are being used."); + AZ_Error("AtomActorInstance", wrinkleMaskWeightsIndex.IsValid(), "m_wrinkle_mask_weights not found on the ObjectSrg, but m_wrinkle_masks and/or m_wrinkle_mask_count are being used."); + AZ_Error("AtomActorInstance", wrinkleMaskCountIndex.IsValid(), "m_wrinkle_mask_count not found on the ObjectSrg, but m_wrinkle_mask_weights and/or m_wrinkle_masks are being used."); + + if (m_wrinkleMasks.size()) + { + wrinkleMaskObjectSrg->SetImageArray(wrinkleMasksIndex, AZStd::array_view>(m_wrinkleMasks.data(), m_wrinkleMasks.size())); + + // Set the weights for any active masks + for (size_t i = 0; i < m_wrinkleMaskWeights.size(); ++i) + { + wrinkleMaskObjectSrg->SetConstant(wrinkleMaskWeightsIndex, m_wrinkleMaskWeights[i], i); + } + AZ_Error("AtomActorInstance", m_wrinkleMaskWeights.size() <= s_maxActiveWrinkleMasks, "The skinning shader supports no more than %d active morph targets with wrinkle masks.", s_maxActiveWrinkleMasks); + } + + wrinkleMaskObjectSrg->SetConstant(wrinkleMaskCountIndex, aznumeric_cast(m_wrinkleMasks.size())); + m_meshFeatureProcessor->QueueObjectSrgForCompile(*m_meshHandle); + } + } + } + } + } //namespace Render } // namespace AZ diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h index 1002fcbde1..e05280e896 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.h @@ -17,6 +17,7 @@ #include #include +#include #include @@ -29,6 +30,8 @@ #include #include #include +#include + #include #include @@ -41,6 +44,7 @@ namespace AZ::RPI { class Model; class Buffer; + class StreamingImage; } namespace AZ @@ -168,6 +172,11 @@ namespace AZ // SkinnedMeshOutputStreamNotificationBus void OnSkinnedMeshOutputStreamMemoryAvailable() override; + // Check to see if the skin material is being used, + // and if there are blend shapes with wrinkle masks that should be applied to it + void InitWrinkleMasks(); + void UpdateWrinkleMasks(); + AZStd::intrusive_ptr m_skinnedMeshInputBuffers = nullptr; AZStd::intrusive_ptr m_skinnedMeshInstance; AZ::Data::Instance m_boneTransforms = nullptr; @@ -179,6 +188,12 @@ namespace AZ AZ::TransformInterface* m_transformInterface = nullptr; AZStd::set m_waitForMaterialLoadIds; AZStd::vector m_morphTargetWeights; + + typedef AZStd::unordered_map> MorphTargetWrinkleMaskMap; + AZStd::vector m_morphTargetWrinkleMaskMapsByLod; + + AZStd::vector> m_wrinkleMasks; + AZStd::vector m_wrinkleMaskWeights; }; } // namespace Render diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/gem.json b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json new file mode 100644 index 0000000000..e2a81d0a5e --- /dev/null +++ b/Gems/AtomLyIntegration/EMotionFXAtom/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "EMotionFX_Atom", + "display_name": "EMotionFX Atom", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/ImguiAtom/gem.json b/Gems/AtomLyIntegration/ImguiAtom/gem.json new file mode 100644 index 0000000000..6d6551b5fa --- /dev/null +++ b/Gems/AtomLyIntegration/ImguiAtom/gem.json @@ -0,0 +1,10 @@ +{ + "gem_name": "ImguiAtom", + "display_name": "Imgui Atom", + "summary": "", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + ] +} diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/3rdParty/Python/.gitignore b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/3rdParty/Python/.gitignore new file mode 100644 index 0000000000..f1a223f90e --- /dev/null +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/3rdParty/Python/.gitignore @@ -0,0 +1 @@ +pyside2-tools \ No newline at end of file diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Editor/Scripts/bootstrap.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Editor/Scripts/bootstrap.py index 6fd8b03e9e..06b00da981 100755 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Editor/Scripts/bootstrap.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Editor/Scripts/bootstrap.py @@ -81,8 +81,8 @@ settings = config.get_config_settings() if __name__ == '__main__': """Run this file as main""" - _G_DEBUG = True - _G_TEST_PYSIDE = True + _G_DEBUG = False + _G_TEST_PYSIDE = False _config = get_dccsi_config() _settings = config.get_config_settings() @@ -121,7 +121,6 @@ if __name__ == '__main__': import PySide2 _LOGGER.info(f'PySide2: {PySide2}') - _LOGGER.info(f'QTFORPYTHON_PATH: {_settings.QTFORPYTHON_PATH}') _LOGGER.info(f'LY_BIN_PATH: {_settings.LY_BIN_PATH}') _LOGGER.info(f'QT_PLUGIN_PATH: {_settings.QT_PLUGIN_PATH}') _LOGGER.info(f'QT_QPA_PLATFORM_PLUGIN_PATH: {_settings.QT_QPA_PLATFORM_PLUGIN_PATH}') diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Launchers/Windows/Env_Core.bat b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Launchers/Windows/Env_Core.bat index 4a64c43029..ab0708defd 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Launchers/Windows/Env_Core.bat +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/Launchers/Windows/Env_Core.bat @@ -68,14 +68,17 @@ IF "%DEV_REL_PATH%"=="" (set DEV_REL_PATH=..\..\..\..) echo DEV_REL_PATH = %DEV_REL_PATH% :: You can define the project name -:: if not defined we just use the DCCsi path as standin -IF "%LY_PROJECT%"=="" ( - for %%a in (%CD%..\..\..) do set LY_PROJECT=%%~na +IF "%LY_PROJECT_NAME%"=="" ( + for %%a in (%CD%..\..\..) do set LY_PROJECT_NAME=%%~na ) +echo LY_PROJECT_NAME = %LY_PROJECT_NAME% + +:: if not defined we just use the DCCsi path as stand-in +IF "%LY_PROJECT%"=="" (set LY_PROJECT=%CD%) echo LY_PROJECT = %LY_PROJECT% :: set up the default project path (dccsi) -:: if not set we lso use the DCCsi path as standin +:: if not set we also use the DCCsi path as stand-in CD /D ..\..\ IF "%LY_PROJECT_PATH%"=="" (set LY_PROJECT_PATH=%CD%) echo LY_PROJECT_PATH = %LY_PROJECT_PATH% @@ -88,7 +91,7 @@ pushd %ABS_PATH% :: Change to root Lumberyard dev dir CD /d %LY_PROJECT_PATH%\%DEV_REL_PATH% -set LY_DEV=%CD% +IF "%LY_DEV%"=="" (set LY_DEV=%CD%) echo LY_DEV = %LY_DEV% :: Restore original directory popd diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/readme.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/readme.txt index cc090d922f..21882f3d96 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/readme.txt +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/readme.txt @@ -29,7 +29,7 @@ A general goal of the DCCsi is be self-maintained, and to not taint the users in So we boostrap additional access to site-packages in our userSetup.py: "C:\Depot\Lumberyard\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\SDK\Maya\Scripts\userSetup.py" -We don't want users to have to install or use Python2.7 although with maya and possibly other dcc tools we don't have that control. Maya still is on Python2.7, so instead of forcing another install of python we can just use mayapy to manage extensions. +We don't want users to have to install or use Python2.7 although with maya and possibly other dcc tools we don't have that control. Maya 2020 and earlier versions are still on Python2.7, so instead of forcing another install of python we can just use mayapy to manage extensions. Pip may already be installed, you can check like so (your maya install path may be different): diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/requirements.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/requirements.txt index 8fd084dac8..ceb5be4dea 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/requirements.txt +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/SDK/Maya/requirements.txt @@ -4,14 +4,14 @@ # # pip-compile --generate-hashes requirements.txt # -cachetools==3.1.1 \ - --hash=sha256:428266a1c0d36dc5aca63a2d7c5942e88c2c898d72139fca0e97fdd2380517ae \ - --hash=sha256:8ea2d3ce97850f31e4a08b0e2b5e6c34997d7216a9d2c98e0f3978630d4da69a - # via -r requirements.txt certifi==2020.6.20 \ --hash=sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3 \ --hash=sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41 # via -r requirements.txt +cachetools==3.1.1 \ + --hash=sha256:428266a1c0d36dc5aca63a2d7c5942e88c2c898d72139fca0e97fdd2380517ae \ + --hash=sha256:8ea2d3ce97850f31e4a08b0e2b5e6c34997d7216a9d2c98e0f3978630d4da69a + # via -r requirements.txt click==7.1.2 \ --hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \ --hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc @@ -68,6 +68,16 @@ unipath==1.1 \ --hash=sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae \ --hash=sha256:e6257e508d8abbfb6ddd8ec357e33589f1f48b1599127f23b017124d90b0fff7 # via -r requirements.txt +qdarkstyle==3.0.2 \ + --hash=sha256:55d149cf5f40ee297397f1818e091118cefb855a4a9c5c38566c47acd2d8c7ae \ + --hash=sha256:7c791535cc20b3cc1e8e1bf6b88dabe53cb0615983df702be83597e73ada2558 + # via -r c:\temp\requirements.txt +qtpy==1.9.0 \ + --hash=sha256:2db72c44b55d0fe1407be8fba35c838ad0d6d3bb81f23007886dc1fc0f459c8d \ + --hash=sha256:fa0b8363b363e89b2a6f49eddc162a04c0699ae95e109a6be3bb145a913190ea + # via + # -r c:\temp\requirements.txt + # qdarkstyle wincertstore==0.2 \ --hash=sha256:22d5eebb52df88a8d4014d5cf6d1b6c3a5d469e6c3b2e2854f3a003e48872356 \ --hash=sha256:780bd1557c9185c15d9f4221ea7f905cb20b93f7151ca8ccaed9714dce4b327a diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/__init__.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/__init__.py index 69e4543a59..ab2d5db480 100755 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/__init__.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/__init__.py @@ -83,13 +83,13 @@ _LY_DEV = os.getenv(constants.ENVAR_LY_DEV, check_stub='engine.json')) # get/set the project name -_LY_PROJECT_TAG = os.getenv(constants.ENVAR_LY_PROJECT, - config_utils.get_current_project(_LY_DEV)) +_LY_PROJECT_NAME = os.getenv(constants.ENVAR_LY_PROJECT, + config_utils.get_current_project().name) # project cache log dir path _DCCSI_LOG_PATH = Path(os.getenv(constants.ENVAR_DCCSI_LOG_PATH, Path(_LY_DEV, - _LY_PROJECT_TAG, + _LY_PROJECT_NAME, 'Cache', 'pc', 'user', 'log', 'logs'))) @@ -223,7 +223,7 @@ if _G_DEBUG: _LOGGER.debug('MODULE_PATH: {}'.format(_MODULE_PATH)) _LOGGER.debug('LY_DEV_PATH: {}'.format(_LY_DEV)) _LOGGER.debug('DCCSI_PATH: {}'.format(_DCCSIG_PATH)) -_LOGGER.debug('LY_PROJECT_TAG: {}'.format(_LY_PROJECT_TAG)) +_LOGGER.debug('LY_PROJECT_TAG: {}'.format(_LY_PROJECT_NAME)) _LOGGER.debug('DCCSI_LOG_PATH: {}'.format(_DCCSI_LOG_PATH)) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/config_utils.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/config_utils.py index 9c920a871d..0a0c6b8337 100755 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/config_utils.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/config_utils.py @@ -137,8 +137,9 @@ def get_dccsi_config(dccsi_dirpath=return_stub_dir()): # ------------------------------------------------------------------------- -def get_current_project(dev_folder=get_stub_check_path()): - """Uses regex in lumberyard Dev\\bootstrap.cfg to retreive project tag str""" +def get_current_project_cfg(dev_folder=get_stub_check_path()): + """Uses regex in lumberyard Dev\\bootstrap.cfg to retreive project tag str + Note: boostrap.cfg will be deprecated. Don't use this method anymore.""" boostrap_filepath = Path(dev_folder, "bootstrap.cfg") if boostrap_filepath.exists(): bootstrap = open(str(boostrap_filepath), "r") @@ -153,6 +154,33 @@ def get_current_project(dev_folder=get_stub_check_path()): # ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- +def get_current_project(): + """Gets o3de project via .o3de data in user directory""" + + from azpy.constants import PATH_USER_O3DE_BOOTSTRAP + from collections import OrderedDict + from box import Box + + bootstrap_box = None + + try: + bootstrap_box = Box.from_json(filename=PATH_USER_O3DE_BOOTSTRAP, + encoding="utf-8", + errors="strict", + object_pairs_hook=OrderedDict) + except FileExistsError as e: + _LOGGER.error('File does not exist: {}'.format(PATH_USER_O3DE_BOOTSTRAP)) + + if bootstrap_box: + # this seems fairly hard coded - what if the data changes? + project_path=Path(bootstrap_box.Amazon.AzCore.Bootstrap.project_path) + return project_path.resolve() + else: + return None +# ------------------------------------------------------------------------- + + # ------------------------------------------------------------------------- def bootstrap_dccsi_py_libs(dccsi_dirpath=return_stub_dir()): """Builds and adds local site dir libs based on py version""" @@ -194,7 +222,11 @@ if __name__ == '__main__': _LOGGER.info('LY_DEV: {}'.format(get_stub_check_path('engine.json'))) - _LOGGER.info('LY_PROJECT: {}'.format(get_current_project(get_stub_check_path('bootstrap.cfg')))) + # this will be deprecated and shouldn't work soon (returns None) + _LOGGER.info('LY_PROJECT: {}'.format(get_current_project_cfg(get_stub_check_path('bootstrap.cfg')))) + + # new o3de version + _LOGGER.info('LY_PROJECT: {}'.format(get_current_project())) _LOGGER.info('DCCSI_PYTHON_LIB_PATH: {}'.format(bootstrap_dccsi_py_libs(return_stub_dir('dccsi_stub')))) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/constants.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/constants.py index 792f0faee6..e10221d324 100755 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/constants.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/constants.py @@ -26,6 +26,7 @@ So we can make an update here once that is used elsewhere. import os import sys import site +from os.path import expanduser import logging as _logging # for this module to perform standalone @@ -91,6 +92,9 @@ TAG_DIR_DCCSI_SDK = str('SDK') TAG_DIR_LY_BUILD = str('build') TAG_QT_PLUGIN_PATH = str('QT_PLUGIN_PATH') +TAG_O3DE_FOLDER = str('.o3de') +TAG_O3DE_BOOTSTRAP = str('bootstrap.setreg') + # filesystem markers, stub file names. STUB_LY_DEV = str('engine.json') STUB_LY_ROOT_PROJECT = str('ly_project_stub') @@ -221,10 +225,17 @@ TAG_DEFAULT_PY = str('Launch_pyBASE.bat') # config file stuff FILENAME_DEFAULT_CONFIG = str('DCCSI_config.json') +# new o3de related paths +PATH_USER_O3DE = str('{home}\\{o3de}').format(home=expanduser("~"), + o3de=TAG_O3DE_FOLDER) +PATH_USER_O3DE_REGISTRY = str('{0}\\Registry').format(PATH_USER_O3DE) +PATH_USER_O3DE_BOOTSTRAP = str('{reg}\\{file}').format(reg=PATH_USER_O3DE_REGISTRY, + file=TAG_O3DE_BOOTSTRAP) + #python and site-dir TAG_DCCSI_PY_VERSION_MAJOR = str(3) TAG_DCCSI_PY_VERSION_MINOR = str(7) -TAG_DCCSI_PY_VERSION_RELEASE = str(5) +TAG_DCCSI_PY_VERSION_RELEASE = str(10) TAG_PYTHON_EXE = str('python.exe') TAG_TOOLS_DIR = str('Tools\\Python') TAG_PLATFORM = str('windows') @@ -314,6 +325,7 @@ if __name__ == '__main__': _stash_dict['QTFORPYTHON_PATH'] = Path(PATH_QTFORPYTHON_PATH) _stash_dict['QT_PLUGIN_PATH'] = Path(PATH_QT_PLUGIN_PATH) _stash_dict['SAT_INSTALL_PATH'] = Path(PATH_SAT_INSTALL_PATH) + _stash_dict['PATH_USER_O3DE_BOOTSTRAP'] = Path(PATH_USER_O3DE_BOOTSTRAP) # --------------------------------------------------------------------- # py 2 and 3 compatible iter diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down.png deleted file mode 100644 index fa98bc39a3..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afe9402162c5b4527f12c863d389ee9d75b53a1069b7e177497beba389d91d35 -size 525 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_disabled.png deleted file mode 100644 index eaedad9b31..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dc1e37e22cb75f616d6ada02cce006bae7fb1da515b15afea0fc98fcc542a092 -size 547 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_focus.png deleted file mode 100644 index 170beb53b4..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c7c9c4c8c5bdc755cc026aa23044f546010c0d1e079ecba34ceb8f0eb9e44bde -size 530 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_pressed.png deleted file mode 100644 index 32b2aac93a..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_down_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6111d15f1dc946742b00317bda789a5c625333f65a362f38931dabc50afb2067 -size 518 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left.png deleted file mode 100644 index e84d285f63..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ac79e7fbd6be51465e0b685dca32c1236f95ad76ab8c5877ec73d20a1de4365 -size 546 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_disabled.png deleted file mode 100644 index d21aea9e87..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a86de88cf4ee32c352776caf46d5512d27679da8b571ea7e791287495fad4514 -size 569 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_focus.png deleted file mode 100644 index 6315e4d488..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5c5b8427bd1497006b8adbcbc445f11b07ec388a3398fe2997f65bdc56f2644f -size 565 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_pressed.png deleted file mode 100644 index c01c95df2b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_left_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95ad920de52fd198f1af6d569917be20dc24a39dabdbe6c555c812d424bd9736 -size 541 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right.png deleted file mode 100644 index 7dc1534e3c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cb5b2d9b40652764f074dcea9856d6748b0efeac57ef58f306efa999f4b411c1 -size 518 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_disabled.png deleted file mode 100644 index 0bdb8963f1..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6a38dcd5b4078df430fa05780844af3e88e0a8e01c1fa910482e4c217354d728 -size 553 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_focus.png deleted file mode 100644 index 9659eeed4d..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f60b2dfce514a6f558134b942f255ddf81ca3dc77b0d899a87f6d4cbac38e26 -size 543 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_pressed.png deleted file mode 100644 index 8e8ae64a87..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_right_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:84379a7bd6ffa75692648c6fce328616e8a009d7ea3a83c2288f82ecce37e729 -size 544 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up.png deleted file mode 100644 index 5137aa3c5f..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d7ee7bfb0c60d4687c8a0dcc38a12ee7cacaa2cbb9eb0ae24faa82b992ade445 -size 512 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_disabled.png deleted file mode 100644 index 7c866337ea..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:571b1afb9c2d7e01f56b75e1526dd0a3ffd49a60a4bcb7981ba34823b44a74c0 -size 538 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_focus.png deleted file mode 100644 index a3eaa49ef3..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:45d805ec94b8144bf121ba74ee96dd27f2f8c0890b2eca5e78df39cb5266f94d -size 530 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_pressed.png deleted file mode 100644 index 168493204d..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/arrow_up_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d49428a947ea424fabedd5a08e1d78e0bc57dc8a2d5a231b5d9ec06977870f5a -size 518 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon.png deleted file mode 100644 index 0af10b0138..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d33b23ed0d8450413a2582d8f00bcb808d39f7e09ff394cee1669a4b7e79207e -size 1256 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_disabled.png deleted file mode 100644 index 0af10b0138..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d33b23ed0d8450413a2582d8f00bcb808d39f7e09ff394cee1669a4b7e79207e -size 1256 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_focus.png deleted file mode 100644 index 0af10b0138..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d33b23ed0d8450413a2582d8f00bcb808d39f7e09ff394cee1669a4b7e79207e -size 1256 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_pressed.png deleted file mode 100644 index 0af10b0138..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/base_icon_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d33b23ed0d8450413a2582d8f00bcb808d39f7e09ff394cee1669a4b7e79207e -size 1256 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed.png deleted file mode 100644 index b964f8985a..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:56776b4655640d46eb1031b9c19c2341fdfe1201c774a84bc5c2801fbcfefc37 -size 350 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_disabled.png deleted file mode 100644 index ad619682e6..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d48862b1c68efdf376551d1c35d5d3a68e2ce9809e7c2723f42ece7c77fca009 -size 373 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_focus.png deleted file mode 100644 index 8ea7431745..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62cc47f4b7751e22ffe4b26289ecc632b4a2c4e5c33ac79864fcfb32398b1139 -size 380 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_pressed.png deleted file mode 100644 index 54a60293b0..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_closed_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ad6e74b57c8876fa28c3a43d1a38369415790507d65d758ea3e77b796c401da2 -size 372 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end.png deleted file mode 100644 index 0fc0630627..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:63324c154ead46027729bcf307ba45fbeb5a8de3ec5e8cef55d315a84a087115 -size 142 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_disabled.png deleted file mode 100644 index 68a6b95488..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8a8b091785c84d37de57aacb7fe5a9b854933cc94b9b6f1f6e0b155879c7d6d0 -size 146 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_focus.png deleted file mode 100644 index 84307b3375..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f89a6b105df07325dcf7bdcea2165bb065dd99b648aa12ae4e0c6693e04d0a2 -size 146 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_pressed.png deleted file mode 100644 index 3f63a24d56..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_end_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:76f44758619badecf11b3b0d9914612e584ad750a695c942811fe215457b25be -size 146 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line.png deleted file mode 100644 index 7aebe0ec54..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:50a35383d40b4e8a646931e4057cd25045f05a48208e2cb9d9935be76b53bf94 -size 130 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_disabled.png deleted file mode 100644 index f1b83a5734..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba7550922e9d244620f8f9ad76fe546d542764eba02378f81b188dec5fd7438a -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_focus.png deleted file mode 100644 index 5daf190e47..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52bec8528e3c8edd583136d90a37f46bcb45e0d406fc0fb680a8b4d75cfeb731 -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_pressed.png deleted file mode 100644 index d533bb82b9..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_line_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b8d2c9a8593a52221c91d2a8c2d3cbd837e408a5f6d1dcad6f79328a13a3bcf -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more.png deleted file mode 100644 index d0eb02b7fb..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5087f4f06a9718230e1aec2ba681f3432ecd2640a135b4e90c7b009188ec4c29 -size 155 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_disabled.png deleted file mode 100644 index a457e2822c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:dec80a2e8439a0787e10aee70a365e30b5d1f43c29e4c33989cc6cd2f5cac478 -size 162 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_focus.png deleted file mode 100644 index 09b9726550..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39930fd3e240c9ad94d748d6cda73b2943682fc4825edd1240e882be18c06198 -size 162 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_pressed.png deleted file mode 100644 index 31a17b26f0..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_more_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0d07da719927b26db1c3087bbfe7203510fce077efe9e121935b3aefbb49b95d -size 162 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open.png deleted file mode 100644 index f0f49a375a..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:05a1980b268f598ebb3520067679a8beb4fa3f00da9c87dd93be2642718ceb44 -size 354 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_disabled.png deleted file mode 100644 index d46e6138bc..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:047c00f910dd279e871a6329ea533816d8b458063539b8efbe9949d7363996bf -size 375 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_focus.png deleted file mode 100644 index d6c73e877c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6bc79f30e3fdc52ec30eb0e9c6b03d1538f7c8c7855033d24d5f993e8ceb9cc1 -size 367 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_pressed.png deleted file mode 100644 index ba1bb5e27b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/branch_open_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aa65cf58b8a02bf5f4142ad80de05aba868245c55a790af6ba0230bfd01a2a06 -size 369 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked.png deleted file mode 100644 index d82af2b4ed..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:95c1c1651a13f0562383087549a35a97bbb7899c7d3717d79d4624485b72bf9f -size 452 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_disabled.png deleted file mode 100644 index e96b6ab274..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80a1d02e6ac7e5d0439b2a077ab8cf82739853ce46ac1556d4035e3bba713242 -size 467 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_focus.png deleted file mode 100644 index abe4bad569..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64d5ed4d01a9778912b98c9147eb67431560acb5805d1d0832a765c441b9ed9b -size 441 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_pressed.png deleted file mode 100644 index 1bab094a68..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_checked_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f0ffa46106a643a71835056acce66ebe09745a9e6d91fac30ff1caf0589a6677 -size 418 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate.png deleted file mode 100644 index 51d0835feb..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8b291eb9180c0e27d1de6ff008ff4259b2c675a65efa94866a66c7c932fc1260 -size 581 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_disabled.png deleted file mode 100644 index 9e13859a93..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8c7d3d64e8cb5e2f8bc6620b0d58492a56800fc78fc0229a5fa495d3a43987a1 -size 614 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_focus.png deleted file mode 100644 index aea72c9cde..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:43d494685f5d2ed740b69f04fefe0e757626db94685ecc8f4411c6c68a626a5a -size 576 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_pressed.png deleted file mode 100644 index d2c86adef3..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_indeterminate_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7af182d82449663ac37955e45ccc3f8fc86d185649fa9bed24c10167351bd5ee -size 563 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked.png deleted file mode 100644 index bf34be7606..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:232451d0bd9cf1d54c777862030b667cd5078f2f4ff387ec03c44d56eb207c03 -size 397 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_disabled.png deleted file mode 100644 index 596e553c14..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7b54771eaad56ee45f8871248ee1c6b18035aa732f9e4e9257d008a73be04c25 -size 386 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_focus.png deleted file mode 100644 index 96cf982f58..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae293d387fda8a89d68fc3f15db07ef084e3537a033d02351ff918cfcc82ea8a -size 394 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_pressed.png deleted file mode 100644 index 0984a1fd5d..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/checkbox_unchecked_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f8ccf5cb638a090f0e64f6d336e4c6312cfaf53971afd0f00cd16d0c0759f1b4 -size 403 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal.png deleted file mode 100644 index 4d069c17b1..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:256f010c3084112888189bcbea2995a37f8acbf12d61a4a261a94aca797cd964 -size 117 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_disabled.png deleted file mode 100644 index 06465a0a29..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:85522a94ec26125f65dcafc6158665f40ea570e4a08cbdfbbdf5f6772b887eb7 -size 121 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_focus.png deleted file mode 100644 index 5f1332e6dd..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae4766527d9e5a2226107ede231878118538e8be89f2dc2ac92b7c5a68ad0fc6 -size 120 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_pressed.png deleted file mode 100644 index f0f11abeb0..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_horizontal_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f4bdbb4d207aa40366ad90d363a95d80e2b4a43574ca1ad3256ee6e0617f25e -size 120 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical.png deleted file mode 100644 index 7aebe0ec54..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:50a35383d40b4e8a646931e4057cd25045f05a48208e2cb9d9935be76b53bf94 -size 130 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_disabled.png deleted file mode 100644 index f1b83a5734..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba7550922e9d244620f8f9ad76fe546d542764eba02378f81b188dec5fd7438a -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_focus.png deleted file mode 100644 index 5daf190e47..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52bec8528e3c8edd583136d90a37f46bcb45e0d406fc0fb680a8b4d75cfeb731 -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_pressed.png deleted file mode 100644 index d533bb82b9..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/line_vertical_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1b8d2c9a8593a52221c91d2a8c2d3cbd837e408a5f6d1dcad6f79328a13a3bcf -size 134 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked.png deleted file mode 100644 index 99c9969237..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:abee85006ecef454df64f65a6aa7dbb85bff9c51f53ed87b47e9f4ef1adefec3 -size 1224 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_disabled.png deleted file mode 100644 index 13daed68f4..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7e22fc4d6bf116cebab4655b6bf81b1c384789b45a96f05d8a4b535e34978cb9 -size 1325 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_focus.png deleted file mode 100644 index e42389445a..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3db59af5ba4caa97ac07834e1a919adafdcd610324dacac68cbd2cde551c2397 -size 1293 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_pressed.png deleted file mode 100644 index 4153bb2ed5..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_checked_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:34bce34b70cf7c24d1e54f87f4225f0c4cf8e7dd8c6fd8a38f81e981bae2a2ce -size 1276 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked.png deleted file mode 100644 index 748ab5998b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f675766febe18edf774b0dd7db11177ca76793c0d2b693b1ffb6a447b79369d2 -size 963 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_disabled.png deleted file mode 100644 index 34230cbb40..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6d5af9296f23e58fc7fde5c9b278a801bd51bb3650d0e5f84dd9eb84434308cc -size 1040 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_focus.png deleted file mode 100644 index 3428ad46be..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c0b650dda797331b8c23ece7e313babb8e6e9118bd3d53e689a7381a33cb5e00 -size 1032 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_pressed.png deleted file mode 100644 index b60ab09f6c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/radio_unchecked_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2dd40885e1d7b1d3f37cfc3afff07fe47db552602bdc46aa9a8ce7a0c8df30db -size 1022 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal.png deleted file mode 100644 index ad5243fcb8..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:054d47979c0879378a6f5e36d9e5b251c31e15610adeed109b8f128115d4b5ec -size 150 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_disabled.png deleted file mode 100644 index 94ef75054c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9eca88a1ebba5d42107da4c3b3af3b52a8de1c76bc1bae8d27190ff5e69f8198 -size 155 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_focus.png deleted file mode 100644 index c4fe22a169..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e11a73fcc79cebd854cbdf3c6539eca99b016440c590b5326f90fa9790e9a69d -size 154 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_pressed.png deleted file mode 100644 index e6d3f5a2c6..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_horizontal_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7371a89813b6f4843dc90b4abe866de943ba670057e0802dcc7f0284d9aa079b -size 154 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical.png deleted file mode 100644 index 6f47c7e52c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8e4d88b8da4d94d4ecaa0eda448d18adcad14c5a62d4e6c9d0ffb2673683d855 -size 137 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_disabled.png deleted file mode 100644 index 43b5911860..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e7422317ab56297babc9025f42dd1f7179588ac4e066cb1b976b1bb56efca656 -size 140 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_focus.png deleted file mode 100644 index 0b918dcdc9..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b9a1520ad62a2b20f53c0709d643af3e8e0d775891597c4bc05e46ed75617bd9 -size 144 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_pressed.png deleted file mode 100644 index 7b104f52b0..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_move_vertical_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:73b0e2dddb1c22848b9b858975cdaae02f0b7b47696922a863358afa30f81dfa -size 143 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal.png deleted file mode 100644 index e7174cd081..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2986d7bca86f3359817f002ecf125afab71281561925a6ecbffe844a2be9699 -size 145 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_disabled.png deleted file mode 100644 index b45f02655c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4f7909f6aa1843cb2382ea0e49afb10967a331e128cc8103ab8082c3e46a90aa -size 151 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_focus.png deleted file mode 100644 index e2898bd5bf..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b4c628767e58d08e929a4bfc3f730e1347b186a44a1b0d4159fa722776a660ea -size 149 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_pressed.png deleted file mode 100644 index 3a71bdc89e..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_horizontal_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c2bcf16dee85252fbf33d3eb05009b988f4c7b3795c01d66e471712d76def3ab -size 149 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical.png deleted file mode 100644 index 02c38086c4..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5db0c6a32f562204a4dc77c8958ef29e016af621f11891ca1795da808a879288 -size 133 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_disabled.png deleted file mode 100644 index f9b739bb93..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c705854e5a7aae10edb4d0cd28d1217a0b6599845031053d502aa05030ce5134 -size 135 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_focus.png deleted file mode 100644 index 08661141b3..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:39bd3c687b5bc56d6a62728d3dbfa522f3e1e74ec4de752987768f60c947adf5 -size 139 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_pressed.png deleted file mode 100644 index 5baf760e59..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/toolbar_separator_vertical_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0966303eb702647e3463ffa644611d817741b1ee0d016ecd56c600e9f04ac114 -size 138 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent.png deleted file mode 100644 index 02ade9b47b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17cedbceacd7ae3a97319a3db9606b40d8ef31428828b08bdbfe73f5642b4ae5 -size 104 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_disabled.png deleted file mode 100644 index 02ade9b47b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17cedbceacd7ae3a97319a3db9606b40d8ef31428828b08bdbfe73f5642b4ae5 -size 104 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_focus.png deleted file mode 100644 index 02ade9b47b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17cedbceacd7ae3a97319a3db9606b40d8ef31428828b08bdbfe73f5642b4ae5 -size 104 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_pressed.png deleted file mode 100644 index 02ade9b47b..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/transparent_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:17cedbceacd7ae3a97319a3db9606b40d8ef31428828b08bdbfe73f5642b4ae5 -size 104 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close.png deleted file mode 100644 index dd99b7b8ed..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f7b31e2fb43e9c3dbd9f0e32680422a7d8c8e7ff7cd600e446103e45b0df0523 -size 766 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_disabled.png deleted file mode 100644 index 1f506f9543..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:528a22b6955681f34373fc72a2dfdd19e6255e18c73f0804c09b34ea01c1f0a0 -size 838 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_focus.png deleted file mode 100644 index 244b91f5b8..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bbc009bf89ac37957e2ff6532a9328f71e63f5edb45bd918048c8a69f61a72e2 -size 756 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_pressed.png deleted file mode 100644 index 4a45bda1b2..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_close_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cd117b3874dec17ebf78f136784eca821f4d916fe34081187c8c28bc2223f545 -size 745 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip.png deleted file mode 100644 index 0f176f5949..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c2ebc9c32505a0489879f7429034143af2ed48e71d2b2eba449a45c7253a2b7 -size 426 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_disabled.png deleted file mode 100644 index f07d5f0de8..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0e7ffdf7643cd2078127953690098b8ea8899428f7906efa778d70422d254f1e -size 447 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_focus.png deleted file mode 100644 index d7271e6e0a..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:055a219ffe9015ed50585caa1cedd31cb99c034c41c17f3ff97cc3c9a1b9b68c -size 435 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_pressed.png deleted file mode 100644 index 000da02699..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_grip_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:776e4b8d509743bb682783085bd139ad8e419a1bbc02a93480b1a4aaffd89041 -size 444 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize.png deleted file mode 100644 index 1846176c40..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ddd70f8069320fb09ee8800cecaa190076baaa4b1c251900220541cc83434bd -size 193 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_disabled.png deleted file mode 100644 index d9df85b122..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4bc0af0fc3119eb066333d3c3e4fbdcc65e23bfdb43b5c5dfd65aae7b6916b3b -size 206 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_focus.png deleted file mode 100644 index 30a7f49ed0..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7575b3458ef002ebfe1fece1427dd3170326d35144b0d03f215d091f625f7286 -size 208 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_pressed.png deleted file mode 100644 index 9cd26589f5..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_minimize_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3dd9475a6db26f45e85d5a688a5e724b7278af4d472caf4b16c1fde346f95db -size 202 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock.png deleted file mode 100644 index 8126d26228..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b07a032c3109f93770c149c4b3199c17cc446e58e50b0d86c4254268a3dc00b0 -size 510 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_disabled.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_disabled.png deleted file mode 100644 index 573cd467ed..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_disabled.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0c97ecbc47699b4ec1189831ae2b8f08eed95e96def84ea48ac63597ecd3d40a -size 541 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_focus.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_focus.png deleted file mode 100644 index 5044d402af..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0ed098cc564cc6c45cdf43103f06a670089149cbc4e81a733becd49d6d115d44 -size 519 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_pressed.png b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_pressed.png deleted file mode 100644 index be8c5637dd..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/rc/window_undock_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef37bb94ebabd4d37ed1c8fcd5a095a5d10e2a20a667861d13c772b903c32bb1 -size 523 diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/readme.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/readme.txt deleted file mode 100644 index e100551564..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/readme.txt +++ /dev/null @@ -1,5 +0,0 @@ -LICENSE -https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/master/LICENSE.rst - -DEPOT -https://github.com/ColinDuquesnoy/QDarkStyleSheet diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qrc b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qrc deleted file mode 100644 index e301854e2c..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qrc +++ /dev/null @@ -1,216 +0,0 @@ - - - - rc/arrow_down.png - rc/arrow_down@2x.png - rc/arrow_down_disabled.png - rc/arrow_down_disabled@2x.png - rc/arrow_down_focus.png - rc/arrow_down_focus@2x.png - rc/arrow_down_pressed.png - rc/arrow_down_pressed@2x.png - rc/arrow_left.png - rc/arrow_left@2x.png - rc/arrow_left_disabled.png - rc/arrow_left_disabled@2x.png - rc/arrow_left_focus.png - rc/arrow_left_focus@2x.png - rc/arrow_left_pressed.png - rc/arrow_left_pressed@2x.png - rc/arrow_right.png - rc/arrow_right@2x.png - rc/arrow_right_disabled.png - rc/arrow_right_disabled@2x.png - rc/arrow_right_focus.png - rc/arrow_right_focus@2x.png - rc/arrow_right_pressed.png - rc/arrow_right_pressed@2x.png - rc/arrow_up.png - rc/arrow_up@2x.png - rc/arrow_up_disabled.png - rc/arrow_up_disabled@2x.png - rc/arrow_up_focus.png - rc/arrow_up_focus@2x.png - rc/arrow_up_pressed.png - rc/arrow_up_pressed@2x.png - rc/base_icon.png - rc/base_icon@2x.png - rc/base_icon_disabled.png - rc/base_icon_disabled@2x.png - rc/base_icon_focus.png - rc/base_icon_focus@2x.png - rc/base_icon_pressed.png - rc/base_icon_pressed@2x.png - rc/branch_closed.png - rc/branch_closed@2x.png - rc/branch_closed_disabled.png - rc/branch_closed_disabled@2x.png - rc/branch_closed_focus.png - rc/branch_closed_focus@2x.png - rc/branch_closed_pressed.png - rc/branch_closed_pressed@2x.png - rc/branch_end.png - rc/branch_end@2x.png - rc/branch_end_disabled.png - rc/branch_end_disabled@2x.png - rc/branch_end_focus.png - rc/branch_end_focus@2x.png - rc/branch_end_pressed.png - rc/branch_end_pressed@2x.png - rc/branch_line.png - rc/branch_line@2x.png - rc/branch_line_disabled.png - rc/branch_line_disabled@2x.png - rc/branch_line_focus.png - rc/branch_line_focus@2x.png - rc/branch_line_pressed.png - rc/branch_line_pressed@2x.png - rc/branch_more.png - rc/branch_more@2x.png - rc/branch_more_disabled.png - rc/branch_more_disabled@2x.png - rc/branch_more_focus.png - rc/branch_more_focus@2x.png - rc/branch_more_pressed.png - rc/branch_more_pressed@2x.png - rc/branch_open.png - rc/branch_open@2x.png - rc/branch_open_disabled.png - rc/branch_open_disabled@2x.png - rc/branch_open_focus.png - rc/branch_open_focus@2x.png - rc/branch_open_pressed.png - rc/branch_open_pressed@2x.png - rc/checkbox_checked.png - rc/checkbox_checked@2x.png - rc/checkbox_checked_disabled.png - rc/checkbox_checked_disabled@2x.png - rc/checkbox_checked_focus.png - rc/checkbox_checked_focus@2x.png - rc/checkbox_checked_pressed.png - rc/checkbox_checked_pressed@2x.png - rc/checkbox_indeterminate.png - rc/checkbox_indeterminate@2x.png - rc/checkbox_indeterminate_disabled.png - rc/checkbox_indeterminate_disabled@2x.png - rc/checkbox_indeterminate_focus.png - rc/checkbox_indeterminate_focus@2x.png - rc/checkbox_indeterminate_pressed.png - rc/checkbox_indeterminate_pressed@2x.png - rc/checkbox_unchecked.png - rc/checkbox_unchecked@2x.png - rc/checkbox_unchecked_disabled.png - rc/checkbox_unchecked_disabled@2x.png - rc/checkbox_unchecked_focus.png - rc/checkbox_unchecked_focus@2x.png - rc/checkbox_unchecked_pressed.png - rc/checkbox_unchecked_pressed@2x.png - rc/line_horizontal.png - rc/line_horizontal@2x.png - rc/line_horizontal_disabled.png - rc/line_horizontal_disabled@2x.png - rc/line_horizontal_focus.png - rc/line_horizontal_focus@2x.png - rc/line_horizontal_pressed.png - rc/line_horizontal_pressed@2x.png - rc/line_vertical.png - rc/line_vertical@2x.png - rc/line_vertical_disabled.png - rc/line_vertical_disabled@2x.png - rc/line_vertical_focus.png - rc/line_vertical_focus@2x.png - rc/line_vertical_pressed.png - rc/line_vertical_pressed@2x.png - rc/radio_checked.png - rc/radio_checked@2x.png - rc/radio_checked_disabled.png - rc/radio_checked_disabled@2x.png - rc/radio_checked_focus.png - rc/radio_checked_focus@2x.png - rc/radio_checked_pressed.png - rc/radio_checked_pressed@2x.png - rc/radio_unchecked.png - rc/radio_unchecked@2x.png - rc/radio_unchecked_disabled.png - rc/radio_unchecked_disabled@2x.png - rc/radio_unchecked_focus.png - rc/radio_unchecked_focus@2x.png - rc/radio_unchecked_pressed.png - rc/radio_unchecked_pressed@2x.png - rc/toolbar_move_horizontal.png - rc/toolbar_move_horizontal@2x.png - rc/toolbar_move_horizontal_disabled.png - rc/toolbar_move_horizontal_disabled@2x.png - rc/toolbar_move_horizontal_focus.png - rc/toolbar_move_horizontal_focus@2x.png - rc/toolbar_move_horizontal_pressed.png - rc/toolbar_move_horizontal_pressed@2x.png - rc/toolbar_move_vertical.png - rc/toolbar_move_vertical@2x.png - rc/toolbar_move_vertical_disabled.png - rc/toolbar_move_vertical_disabled@2x.png - rc/toolbar_move_vertical_focus.png - rc/toolbar_move_vertical_focus@2x.png - rc/toolbar_move_vertical_pressed.png - rc/toolbar_move_vertical_pressed@2x.png - rc/toolbar_separator_horizontal.png - rc/toolbar_separator_horizontal@2x.png - rc/toolbar_separator_horizontal_disabled.png - rc/toolbar_separator_horizontal_disabled@2x.png - rc/toolbar_separator_horizontal_focus.png - rc/toolbar_separator_horizontal_focus@2x.png - rc/toolbar_separator_horizontal_pressed.png - rc/toolbar_separator_horizontal_pressed@2x.png - rc/toolbar_separator_vertical.png - rc/toolbar_separator_vertical@2x.png - rc/toolbar_separator_vertical_disabled.png - rc/toolbar_separator_vertical_disabled@2x.png - rc/toolbar_separator_vertical_focus.png - rc/toolbar_separator_vertical_focus@2x.png - rc/toolbar_separator_vertical_pressed.png - rc/toolbar_separator_vertical_pressed@2x.png - rc/transparent.png - rc/transparent@2x.png - rc/transparent_disabled.png - rc/transparent_disabled@2x.png - rc/transparent_focus.png - rc/transparent_focus@2x.png - rc/transparent_pressed.png - rc/transparent_pressed@2x.png - rc/window_close.png - rc/window_close@2x.png - rc/window_close_disabled.png - rc/window_close_disabled@2x.png - rc/window_close_focus.png - rc/window_close_focus@2x.png - rc/window_close_pressed.png - rc/window_close_pressed@2x.png - rc/window_grip.png - rc/window_grip@2x.png - rc/window_grip_disabled.png - rc/window_grip_disabled@2x.png - rc/window_grip_focus.png - rc/window_grip_focus@2x.png - rc/window_grip_pressed.png - rc/window_grip_pressed@2x.png - rc/window_minimize.png - rc/window_minimize@2x.png - rc/window_minimize_disabled.png - rc/window_minimize_disabled@2x.png - rc/window_minimize_focus.png - rc/window_minimize_focus@2x.png - rc/window_minimize_pressed.png - rc/window_minimize_pressed@2x.png - rc/window_undock.png - rc/window_undock@2x.png - rc/window_undock_disabled.png - rc/window_undock_disabled@2x.png - rc/window_undock_focus.png - rc/window_undock_focus@2x.png - rc/window_undock_pressed.png - rc/window_undock_pressed@2x.png - - - style.qss - - diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qss b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qss deleted file mode 100644 index 55dfe093d9..0000000000 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/shared/ui/resources/qdarkstyle/style.qss +++ /dev/null @@ -1,2165 +0,0 @@ -/* --------------------------------------------------------------------------- - - Created by the qtsass compiler v0.1.1 - - The definitions are in the "qdarkstyle.qss._styles.scss" module - - WARNING! All changes made in this file will be lost! - ---------------------------------------------------------------------------- */ -/* QDarkStyleSheet ----------------------------------------------------------- - -This is the main style sheet, the palette has nine colors. - -It is based on three selecting colors, three greyish (background) colors -plus three whitish (foreground) colors. Each set of widgets of the same -type have a header like this: - - ------------------ - GroupName -------- - ------------------ - -And each widget is separated with a header like this: - - QWidgetName ------ - -This makes more easy to find and change some css field. The basic -configuration is described bellow. - - BACKGROUND ----------- - - Light (unpressed) - Normal (border, disabled, pressed, checked, toolbars, menus) - Dark (background) - - FOREGROUND ----------- - - Light (texts/labels) - Normal (not used yet) - Dark (disabled texts) - - SELECTION ------------ - - Light (selection/hover/active) - Normal (selected) - Dark (selected disabled) - -If a stranger configuration is required because of a bugfix or anything -else, keep the comment on the line above so nobody changes it, including the -issue number. - -*/ -/* - -See Qt documentation: - - - https://doc.qt.io/qt-5/stylesheet.html - - https://doc.qt.io/qt-5/stylesheet-reference.html - - https://doc.qt.io/qt-5/stylesheet-examples.html - ---------------------------------------------------------------------------- */ -/* QWidget ---------------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QWidget { - background-color: #19232D; - border: 0px solid #32414B; - padding: 0px; - color: #F0F0F0; - selection-background-color: #1464A0; - selection-color: #F0F0F0; -} - -QWidget:disabled { - background-color: #19232D; - color: #787878; - selection-background-color: #14506E; - selection-color: #787878; -} - -QWidget::item:selected { - background-color: #1464A0; -} - -QWidget::item:hover { - background-color: #148CD2; - color: #32414B; -} - -/* QMainWindow ------------------------------------------------------------ - -This adjusts the splitter in the dock widget, not qsplitter -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmainwindow - ---------------------------------------------------------------------------- */ -QMainWindow::separator { - background-color: #32414B; - border: 0px solid #19232D; - spacing: 0px; - padding: 2px; -} - -QMainWindow::separator:hover { - background-color: #505F69; - border: 0px solid #148CD2; -} - -QMainWindow::separator:horizontal { - width: 5px; - margin-top: 2px; - margin-bottom: 2px; - image: url(":/qss_icons/rc/toolbar_separator_vertical.png"); -} - -QMainWindow::separator:vertical { - height: 5px; - margin-left: 2px; - margin-right: 2px; - image: url(":/qss_icons/rc/toolbar_separator_horizontal.png"); -} - -/* QToolTip --------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtooltip - ---------------------------------------------------------------------------- */ -QToolTip { - background-color: #148CD2; - border: 1px solid #19232D; - color: #19232D; - /* Remove padding, for fix combo box tooltip */ - padding: 0px; - /* Remove opacity, fix #174 - may need to use RGBA */ -} - -/* QStatusBar ------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qstatusbar - ---------------------------------------------------------------------------- */ -QStatusBar { - border: 1px solid #32414B; - /* Fixes Spyder #9120, #9121 */ - background: #32414B; - /* Fixes #205, white vertical borders separating items */ -} - -QStatusBar::item { - border: none; -} - -QStatusBar QToolTip { - background-color: #148CD2; - border: 1px solid #19232D; - color: #19232D; - /* Remove padding, for fix combo box tooltip */ - padding: 0px; - /* Reducing transparency to read better */ - opacity: 230; -} - -QStatusBar QLabel { - /* Fixes Spyder #9120, #9121 */ - background: transparent; -} - -/* QCheckBox -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcheckbox - ---------------------------------------------------------------------------- */ -QCheckBox { - background-color: #19232D; - color: #F0F0F0; - spacing: 4px; - outline: none; - padding-top: 4px; - padding-bottom: 4px; -} - -QCheckBox:focus { - border: none; -} - -QCheckBox QWidget:disabled { - background-color: #19232D; - color: #787878; -} - -QCheckBox::indicator { - margin-left: 4px; - height: 16px; - width: 16px; -} - -QCheckBox::indicator:unchecked { - image: url(":/qss_icons/rc/checkbox_unchecked.png"); -} - -QCheckBox::indicator:unchecked:hover, QCheckBox::indicator:unchecked:focus, QCheckBox::indicator:unchecked:pressed { - border: none; - image: url(":/qss_icons/rc/checkbox_unchecked_focus.png"); -} - -QCheckBox::indicator:unchecked:disabled { - image: url(":/qss_icons/rc/checkbox_unchecked_disabled.png"); -} - -QCheckBox::indicator:checked { - image: url(":/qss_icons/rc/checkbox_checked.png"); -} - -QCheckBox::indicator:checked:hover, QCheckBox::indicator:checked:focus, QCheckBox::indicator:checked:pressed { - border: none; - image: url(":/qss_icons/rc/checkbox_checked_focus.png"); -} - -QCheckBox::indicator:checked:disabled { - image: url(":/qss_icons/rc/checkbox_checked_disabled.png"); -} - -QCheckBox::indicator:indeterminate { - image: url(":/qss_icons/rc/checkbox_indeterminate.png"); -} - -QCheckBox::indicator:indeterminate:disabled { - image: url(":/qss_icons/rc/checkbox_indeterminate_disabled.png"); -} - -QCheckBox::indicator:indeterminate:focus, QCheckBox::indicator:indeterminate:hover, QCheckBox::indicator:indeterminate:pressed { - image: url(":/qss_icons/rc/checkbox_indeterminate_focus.png"); -} - -/* QGroupBox -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qgroupbox - ---------------------------------------------------------------------------- */ -QGroupBox { - font-weight: bold; - border: 1px solid #32414B; - border-radius: 4px; - padding: 4px; - margin-top: 16px; -} - -QGroupBox::title { - subcontrol-origin: margin; - subcontrol-position: top left; - left: 3px; - padding-left: 3px; - padding-right: 5px; - padding-top: 8px; - padding-bottom: 16px; -} - -QGroupBox::indicator { - margin-left: 2px; - height: 12px; - width: 12px; -} - -QGroupBox::indicator:unchecked:hover, QGroupBox::indicator:unchecked:focus, QGroupBox::indicator:unchecked:pressed { - border: none; - image: url(":/qss_icons/rc/checkbox_unchecked_focus.png"); -} - -QGroupBox::indicator:unchecked:disabled { - image: url(":/qss_icons/rc/checkbox_unchecked_disabled.png"); -} - -QGroupBox::indicator:checked:hover, QGroupBox::indicator:checked:focus, QGroupBox::indicator:checked:pressed { - border: none; - image: url(":/qss_icons/rc/checkbox_checked_focus.png"); -} - -QGroupBox::indicator:checked:disabled { - image: url(":/qss_icons/rc/checkbox_checked_disabled.png"); -} - -/* QRadioButton ----------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qradiobutton - ---------------------------------------------------------------------------- */ -QRadioButton { - background-color: #19232D; - color: #F0F0F0; - spacing: 4px; - padding: 0px; - border: none; - outline: none; -} - -QRadioButton:focus { - border: none; -} - -QRadioButton:disabled { - background-color: #19232D; - color: #787878; - border: none; - outline: none; -} - -QRadioButton QWidget { - background-color: #19232D; - color: #F0F0F0; - spacing: 0px; - padding: 0px; - outline: none; - border: none; -} - -QRadioButton::indicator { - border: none; - outline: none; - margin-left: 4px; - height: 16px; - width: 16px; -} - -QRadioButton::indicator:unchecked { - image: url(":/qss_icons/rc/radio_unchecked.png"); -} - -QRadioButton::indicator:unchecked:hover, QRadioButton::indicator:unchecked:focus, QRadioButton::indicator:unchecked:pressed { - border: none; - outline: none; - image: url(":/qss_icons/rc/radio_unchecked_focus.png"); -} - -QRadioButton::indicator:unchecked:disabled { - image: url(":/qss_icons/rc/radio_unchecked_disabled.png"); -} - -QRadioButton::indicator:checked { - border: none; - outline: none; - image: url(":/qss_icons/rc/radio_checked.png"); -} - -QRadioButton::indicator:checked:hover, QRadioButton::indicator:checked:focus, QRadioButton::indicator:checked:pressed { - border: none; - outline: none; - image: url(":/qss_icons/rc/radio_checked_focus.png"); -} - -QRadioButton::indicator:checked:disabled { - outline: none; - image: url(":/qss_icons/rc/radio_checked_disabled.png"); -} - -/* QMenuBar --------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmenubar - ---------------------------------------------------------------------------- */ -QMenuBar { - background-color: #32414B; - padding: 2px; - border: 1px solid #19232D; - color: #F0F0F0; -} - -QMenuBar:focus { - border: 1px solid #148CD2; -} - -QMenuBar::item { - background: transparent; - padding: 4px; -} - -QMenuBar::item:selected { - padding: 4px; - background: transparent; - border: 0px solid #32414B; -} - -QMenuBar::item:pressed { - padding: 4px; - border: 0px solid #32414B; - background-color: #148CD2; - color: #F0F0F0; - margin-bottom: 0px; - padding-bottom: 0px; -} - -/* QMenu ------------------------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qmenu - ---------------------------------------------------------------------------- */ -QMenu { - border: 0px solid #32414B; - color: #F0F0F0; - margin: 0px; -} - -QMenu::separator { - height: 1px; - background-color: #505F69; - color: #F0F0F0; -} - -QMenu::icon { - margin: 0px; - padding-left: 8px; -} - -QMenu::item { - background-color: #32414B; - padding: 4px 24px 4px 24px; - /* Reserve space for selection border */ - border: 1px transparent #32414B; -} - -QMenu::item:selected { - color: #F0F0F0; -} - -QMenu::indicator { - width: 12px; - height: 12px; - padding-left: 6px; - /* non-exclusive indicator = check box style indicator (see QActionGroup::setExclusive) */ - /* exclusive indicator = radio button style indicator (see QActionGroup::setExclusive) */ -} - -QMenu::indicator:non-exclusive:unchecked { - image: url(":/qss_icons/rc/checkbox_unchecked.png"); -} - -QMenu::indicator:non-exclusive:unchecked:selected { - image: url(":/qss_icons/rc/checkbox_unchecked_disabled.png"); -} - -QMenu::indicator:non-exclusive:checked { - image: url(":/qss_icons/rc/checkbox_checked.png"); -} - -QMenu::indicator:non-exclusive:checked:selected { - image: url(":/qss_icons/rc/checkbox_checked_disabled.png"); -} - -QMenu::indicator:exclusive:unchecked { - image: url(":/qss_icons/rc/radio_unchecked.png"); -} - -QMenu::indicator:exclusive:unchecked:selected { - image: url(":/qss_icons/rc/radio_unchecked_disabled.png"); -} - -QMenu::indicator:exclusive:checked { - image: url(":/qss_icons/rc/radio_checked.png"); -} - -QMenu::indicator:exclusive:checked:selected { - image: url(":/qss_icons/rc/radio_checked_disabled.png"); -} - -QMenu::right-arrow { - margin: 5px; - image: url(":/qss_icons/rc/arrow_right.png"); - height: 12px; - width: 12px; -} - -/* QAbstractItemView ------------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox - ---------------------------------------------------------------------------- */ -QAbstractItemView { - alternate-background-color: #19232D; - color: #F0F0F0; - border: 1px solid #32414B; - border-radius: 4px; -} - -QAbstractItemView QLineEdit { - padding: 2px; -} - -/* QAbstractScrollArea ---------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qabstractscrollarea - ---------------------------------------------------------------------------- */ -QAbstractScrollArea { - background-color: #19232D; - border: 1px solid #32414B; - border-radius: 4px; - padding: 2px; - /* fix #159 */ - min-height: 1.25em; - /* fix #159 */ - color: #F0F0F0; -} - -QAbstractScrollArea:disabled { - color: #787878; -} - -/* QScrollArea ------------------------------------------------------------ - ---------------------------------------------------------------------------- */ -QScrollArea QWidget QWidget:disabled { - background-color: #19232D; -} - -/* QScrollBar ------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qscrollbar - ---------------------------------------------------------------------------- */ -QScrollBar:horizontal { - height: 16px; - margin: 2px 16px 2px 16px; - border: 1px solid #32414B; - border-radius: 4px; - background-color: #19232D; -} - -QScrollBar:vertical { - background-color: #19232D; - width: 16px; - margin: 16px 2px 16px 2px; - border: 1px solid #32414B; - border-radius: 4px; -} - -QScrollBar::handle:horizontal { - background-color: #787878; - border: 1px solid #32414B; - border-radius: 4px; - min-width: 8px; -} - -QScrollBar::handle:horizontal:hover { - background-color: #148CD2; - border: 1px solid #148CD2; - border-radius: 4px; - min-width: 8px; -} - -QScrollBar::handle:horizontal:focus { - border: 1px solid #1464A0; -} - -QScrollBar::handle:vertical { - background-color: #787878; - border: 1px solid #32414B; - min-height: 8px; - border-radius: 4px; -} - -QScrollBar::handle:vertical:hover { - background-color: #148CD2; - border: 1px solid #148CD2; - border-radius: 4px; - min-height: 8px; -} - -QScrollBar::handle:vertical:focus { - border: 1px solid #1464A0; -} - -QScrollBar::add-line:horizontal { - margin: 0px 0px 0px 0px; - border-image: url(":/qss_icons/rc/arrow_right_disabled.png"); - height: 12px; - width: 12px; - subcontrol-position: right; - subcontrol-origin: margin; -} - -QScrollBar::add-line:horizontal:hover, QScrollBar::add-line:horizontal:on { - border-image: url(":/qss_icons/rc/arrow_right.png"); - height: 12px; - width: 12px; - subcontrol-position: right; - subcontrol-origin: margin; -} - -QScrollBar::add-line:vertical { - margin: 3px 0px 3px 0px; - border-image: url(":/qss_icons/rc/arrow_down_disabled.png"); - height: 12px; - width: 12px; - subcontrol-position: bottom; - subcontrol-origin: margin; -} - -QScrollBar::add-line:vertical:hover, QScrollBar::add-line:vertical:on { - border-image: url(":/qss_icons/rc/arrow_down.png"); - height: 12px; - width: 12px; - subcontrol-position: bottom; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:horizontal { - margin: 0px 3px 0px 3px; - border-image: url(":/qss_icons/rc/arrow_left_disabled.png"); - height: 12px; - width: 12px; - subcontrol-position: left; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:horizontal:hover, QScrollBar::sub-line:horizontal:on { - border-image: url(":/qss_icons/rc/arrow_left.png"); - height: 12px; - width: 12px; - subcontrol-position: left; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:vertical { - margin: 3px 0px 3px 0px; - border-image: url(":/qss_icons/rc/arrow_up_disabled.png"); - height: 12px; - width: 12px; - subcontrol-position: top; - subcontrol-origin: margin; -} - -QScrollBar::sub-line:vertical:hover, QScrollBar::sub-line:vertical:on { - border-image: url(":/qss_icons/rc/arrow_up.png"); - height: 12px; - width: 12px; - subcontrol-position: top; - subcontrol-origin: margin; -} - -QScrollBar::up-arrow:horizontal, QScrollBar::down-arrow:horizontal { - background: none; -} - -QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { - background: none; -} - -QScrollBar::add-page:horizontal, QScrollBar::sub-page:horizontal { - background: none; -} - -QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { - background: none; -} - -/* QTextEdit -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-specific-widgets - ---------------------------------------------------------------------------- */ -QTextEdit { - background-color: #19232D; - color: #F0F0F0; - border-radius: 4px; - border: 1px solid #32414B; -} - -QTextEdit:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QTextEdit:focus { - border: 1px solid #1464A0; -} - -QTextEdit:selected { - background: #1464A0; - color: #32414B; -} - -/* QPlainTextEdit --------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QPlainTextEdit { - background-color: #19232D; - color: #F0F0F0; - border-radius: 4px; - border: 1px solid #32414B; -} - -QPlainTextEdit:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QPlainTextEdit:focus { - border: 1px solid #1464A0; -} - -QPlainTextEdit:selected { - background: #1464A0; - color: #32414B; -} - -/* QSizeGrip -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qsizegrip - ---------------------------------------------------------------------------- */ -QSizeGrip { - background: transparent; - width: 12px; - height: 12px; - image: url(":/qss_icons/rc/window_grip.png"); -} - -/* QStackedWidget --------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QStackedWidget { - padding: 2px; - border: 1px solid #32414B; - border: 1px solid #19232D; -} - -/* QToolBar --------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbar - ---------------------------------------------------------------------------- */ -QToolBar { - background-color: #32414B; - border-bottom: 1px solid #19232D; - padding: 2px; - font-weight: bold; - spacing: 2px; -} - -QToolBar QToolButton { - background-color: #32414B; - border: 1px solid #32414B; -} - -QToolBar QToolButton:hover { - border: 1px solid #148CD2; -} - -QToolBar QToolButton:checked { - border: 1px solid #19232D; - background-color: #19232D; -} - -QToolBar QToolButton:checked:hover { - border: 1px solid #148CD2; -} - -QToolBar::handle:horizontal { - width: 16px; - image: url(":/qss_icons/rc/toolbar_move_horizontal.png"); -} - -QToolBar::handle:vertical { - height: 16px; - image: url(":/qss_icons/rc/toolbar_move_vertical.png"); -} - -QToolBar::separator:horizontal { - width: 16px; - image: url(":/qss_icons/rc/toolbar_separator_horizontal.png"); -} - -QToolBar::separator:vertical { - height: 16px; - image: url(":/qss_icons/rc/toolbar_separator_vertical.png"); -} - -QToolButton#qt_toolbar_ext_button { - background: #32414B; - border: 0px; - color: #F0F0F0; - image: url(":/qss_icons/rc/arrow_right.png"); -} - -/* QAbstractSpinBox ------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QAbstractSpinBox { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - /* This fixes 103, 111 */ - padding-top: 2px; - /* This fixes 103, 111 */ - padding-bottom: 2px; - padding-left: 4px; - padding-right: 4px; - border-radius: 4px; - /* min-width: 5px; removed to fix 109 */ -} - -QAbstractSpinBox:up-button { - background-color: transparent #19232D; - subcontrol-origin: border; - subcontrol-position: top right; - border-left: 1px solid #32414B; - border-bottom: 1px solid #32414B; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - margin: 1px; - width: 12px; - margin-bottom: -1px; -} - -QAbstractSpinBox::up-arrow, QAbstractSpinBox::up-arrow:disabled, QAbstractSpinBox::up-arrow:off { - image: url(":/qss_icons/rc/arrow_up_disabled.png"); - height: 8px; - width: 8px; -} - -QAbstractSpinBox::up-arrow:hover { - image: url(":/qss_icons/rc/arrow_up.png"); -} - -QAbstractSpinBox:down-button { - background-color: transparent #19232D; - subcontrol-origin: border; - subcontrol-position: bottom right; - border-left: 1px solid #32414B; - border-top: 1px solid #32414B; - border-top-left-radius: 0; - border-bottom-left-radius: 0; - margin: 1px; - width: 12px; - margin-top: -1px; -} - -QAbstractSpinBox::down-arrow, QAbstractSpinBox::down-arrow:disabled, QAbstractSpinBox::down-arrow:off { - image: url(":/qss_icons/rc/arrow_down_disabled.png"); - height: 8px; - width: 8px; -} - -QAbstractSpinBox::down-arrow:hover { - image: url(":/qss_icons/rc/arrow_down.png"); -} - -QAbstractSpinBox:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QAbstractSpinBox:focus { - border: 1px solid #1464A0; -} - -QAbstractSpinBox:selected { - background: #1464A0; - color: #32414B; -} - -/* ------------------------------------------------------------------------ */ -/* DISPLAYS --------------------------------------------------------------- */ -/* ------------------------------------------------------------------------ */ -/* QLabel ----------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe - ---------------------------------------------------------------------------- */ -QLabel { - background-color: #19232D; - border: 0px solid #32414B; - padding: 2px; - margin: 0px; - color: #F0F0F0; -} - -QLabel:disabled { - background-color: #19232D; - border: 0px solid #32414B; - color: #787878; -} - -/* QTextBrowser ----------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qabstractscrollarea - ---------------------------------------------------------------------------- */ -QTextBrowser { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - border-radius: 4px; -} - -QTextBrowser:disabled { - background-color: #19232D; - border: 1px solid #32414B; - color: #787878; - border-radius: 4px; -} - -QTextBrowser:hover, QTextBrowser:!hover, QTextBrowser:selected, QTextBrowser:pressed { - border: 1px solid #32414B; -} - -/* QGraphicsView ---------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QGraphicsView { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - border-radius: 4px; -} - -QGraphicsView:disabled { - background-color: #19232D; - border: 1px solid #32414B; - color: #787878; - border-radius: 4px; -} - -QGraphicsView:hover, QGraphicsView:!hover, QGraphicsView:selected, QGraphicsView:pressed { - border: 1px solid #32414B; -} - -/* QCalendarWidget -------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QCalendarWidget { - border: 1px solid #32414B; - border-radius: 4px; -} - -QCalendarWidget:disabled { - background-color: #19232D; - color: #787878; -} - -/* QLCDNumber ------------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QLCDNumber { - background-color: #19232D; - color: #F0F0F0; -} - -QLCDNumber:disabled { - background-color: #19232D; - color: #787878; -} - -/* QProgressBar ----------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qprogressbar - ---------------------------------------------------------------------------- */ -QProgressBar { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - border-radius: 4px; - text-align: center; -} - -QProgressBar:disabled { - background-color: #19232D; - border: 1px solid #32414B; - color: #787878; - border-radius: 4px; - text-align: center; -} - -QProgressBar::chunk { - background-color: #1464A0; - color: #19232D; - border-radius: 4px; -} - -QProgressBar::chunk:disabled { - background-color: #14506E; - color: #787878; - border-radius: 4px; -} - -/* ------------------------------------------------------------------------ */ -/* BUTTONS ---------------------------------------------------------------- */ -/* ------------------------------------------------------------------------ */ -/* QPushButton ------------------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qpushbutton - ---------------------------------------------------------------------------- */ -QPushButton { - background-color: #505F69; - border: 1px solid #32414B; - color: #F0F0F0; - border-radius: 4px; - padding: 3px; - outline: none; - /* Issue #194 - Special case of QPushButton inside dialogs, for better UI */ - min-width: 80px; -} - -QPushButton:disabled { - background-color: #32414B; - border: 1px solid #32414B; - color: #787878; - border-radius: 4px; - padding: 3px; -} - -QPushButton:checked { - background-color: #32414B; - border: 1px solid #32414B; - border-radius: 4px; - padding: 3px; - outline: none; -} - -QPushButton:checked:disabled { - background-color: #19232D; - border: 1px solid #32414B; - color: #787878; - border-radius: 4px; - padding: 3px; - outline: none; -} - -QPushButton:checked:selected { - background: #1464A0; - color: #32414B; -} - -QPushButton::menu-indicator { - subcontrol-origin: padding; - subcontrol-position: bottom right; - bottom: 4px; -} - -QPushButton:pressed { - background-color: #19232D; - border: 1px solid #19232D; -} - -QPushButton:pressed:hover { - border: 1px solid #148CD2; -} - -QPushButton:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QPushButton:selected { - background: #1464A0; - color: #32414B; -} - -QPushButton:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QPushButton:focus { - border: 1px solid #1464A0; -} - -/* QToolButton ------------------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbutton - ---------------------------------------------------------------------------- */ -QToolButton { - background-color: transparent; - border: 1px solid transparent; - border-radius: 4px; - margin: 0px; - padding: 2px; - /* The subcontrols below are used only in the DelayedPopup mode */ - /* The subcontrols below are used only in the MenuButtonPopup mode */ - /* The subcontrol below is used only in the InstantPopup or DelayedPopup mode */ -} - -QToolButton:checked { - background-color: transparent; - border: 1px solid #1464A0; -} - -QToolButton:checked:disabled { - border: 1px solid #14506E; -} - -QToolButton:pressed { - margin: 1px; - background-color: transparent; - border: 1px solid #1464A0; -} - -QToolButton:disabled { - border: none; -} - -QToolButton:hover { - border: 1px solid #148CD2; -} - -QToolButton[popupMode="0"] { - /* Only for DelayedPopup */ - padding-right: 2px; -} - -QToolButton[popupMode="1"] { - /* Only for MenuButtonPopup */ - padding-right: 20px; -} - -QToolButton[popupMode="1"]::menu-button { - border: none; -} - -QToolButton[popupMode="1"]::menu-button:hover { - border: none; - border-left: 1px solid #148CD2; - border-radius: 0; -} - -QToolButton[popupMode="2"] { - /* Only for InstantPopup */ - padding-right: 2px; -} - -QToolButton::menu-button { - padding: 2px; - border-radius: 4px; - border: 1px solid #32414B; - width: 12px; - outline: none; -} - -QToolButton::menu-button:hover { - border: 1px solid #148CD2; -} - -QToolButton::menu-button:checked:hover { - border: 1px solid #148CD2; -} - -QToolButton::menu-indicator { - image: url(":/qss_icons/rc/arrow_down.png"); - height: 8px; - width: 8px; - top: 0; - /* Exclude a shift for better image */ - left: -2px; - /* Shift it a bit */ -} - -QToolButton::menu-arrow { - image: url(":/qss_icons/rc/arrow_down.png"); - height: 8px; - width: 8px; -} - -QToolButton::menu-arrow:hover { - image: url(":/qss_icons/rc/arrow_down_focus.png"); -} - -/* QCommandLinkButton ----------------------------------------------------- - ---------------------------------------------------------------------------- */ -QCommandLinkButton { - background-color: transparent; - border: 1px solid #32414B; - color: #F0F0F0; - border-radius: 4px; - padding: 0px; - margin: 0px; -} - -QCommandLinkButton:disabled { - background-color: transparent; - color: #787878; -} - -/* ------------------------------------------------------------------------ */ -/* INPUTS - NO FIELDS ----------------------------------------------------- */ -/* ------------------------------------------------------------------------ */ -/* QComboBox -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox - ---------------------------------------------------------------------------- */ -QComboBox { - border: 1px solid #32414B; - border-radius: 4px; - selection-background-color: #1464A0; - padding-left: 4px; - padding-right: 36px; - /* 4 + 16*2 See scrollbar size */ - /* Fixes #103, #111 */ - min-height: 1.5em; - /* padding-top: 2px; removed to fix #132 */ - /* padding-bottom: 2px; removed to fix #132 */ - /* min-width: 75px; removed to fix #109 */ - /* Needed to remove indicator - fix #132 */ -} - -QComboBox QAbstractItemView { - border: 1px solid #32414B; - border-radius: 0; - background-color: #19232D; - selection-background-color: #1464A0; -} - -QComboBox QAbstractItemView:hover { - background-color: #19232D; - color: #F0F0F0; -} - -QComboBox QAbstractItemView:selected { - background: #1464A0; - color: #32414B; -} - -QComboBox QAbstractItemView:alternate { - background: #19232D; -} - -QComboBox:disabled { - background-color: #19232D; - color: #787878; -} - -QComboBox:hover { - border: 1px solid #148CD2; -} - -QComboBox:focus { - border: 1px solid #1464A0; -} - -QComboBox:on { - selection-background-color: #1464A0; -} - -QComboBox::indicator { - border: none; - border-radius: 0; - background-color: transparent; - selection-background-color: transparent; - color: transparent; - selection-color: transparent; - /* Needed to remove indicator - fix #132 */ -} - -QComboBox::indicator:alternate { - background: #19232D; -} - -QComboBox::item:alternate { - background: #19232D; -} - -QComboBox::item:checked { - font-weight: bold; -} - -QComboBox::item:selected { - border: 0px solid transparent; -} - -QComboBox::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 12px; - border-left: 1px solid #32414B; -} - -QComboBox::down-arrow { - image: url(":/qss_icons/rc/arrow_down_disabled.png"); - height: 8px; - width: 8px; -} - -QComboBox::down-arrow:on, QComboBox::down-arrow:hover, QComboBox::down-arrow:focus { - image: url(":/qss_icons/rc/arrow_down.png"); -} - -/* QSlider ---------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qslider - ---------------------------------------------------------------------------- */ -QSlider:disabled { - background: #19232D; -} - -QSlider:focus { - border: none; -} - -QSlider::groove:horizontal { - background: #32414B; - border: 1px solid #32414B; - height: 4px; - margin: 0px; - border-radius: 4px; -} - -QSlider::groove:vertical { - background: #32414B; - border: 1px solid #32414B; - width: 4px; - margin: 0px; - border-radius: 4px; -} - -QSlider::add-page:vertical { - background: #1464A0; - border: 1px solid #32414B; - width: 4px; - margin: 0px; - border-radius: 4px; -} - -QSlider::add-page:vertical :disabled { - background: #14506E; -} - -QSlider::sub-page:horizontal { - background: #1464A0; - border: 1px solid #32414B; - height: 4px; - margin: 0px; - border-radius: 4px; -} - -QSlider::sub-page:horizontal:disabled { - background: #14506E; -} - -QSlider::handle:horizontal { - background: #787878; - border: 1px solid #32414B; - width: 8px; - height: 8px; - margin: -8px 0px; - border-radius: 4px; -} - -QSlider::handle:horizontal:hover { - background: #148CD2; - border: 1px solid #148CD2; -} - -QSlider::handle:horizontal:focus { - border: 1px solid #1464A0; -} - -QSlider::handle:vertical { - background: #787878; - border: 1px solid #32414B; - width: 8px; - height: 8px; - margin: 0 -8px; - border-radius: 4px; -} - -QSlider::handle:vertical:hover { - background: #148CD2; - border: 1px solid #148CD2; -} - -QSlider::handle:vertical:focus { - border: 1px solid #1464A0; -} - -/* QLineEdit -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlineedit - ---------------------------------------------------------------------------- */ -QLineEdit { - background-color: #19232D; - padding-top: 2px; - /* This QLineEdit fix 103, 111 */ - padding-bottom: 2px; - /* This QLineEdit fix 103, 111 */ - padding-left: 4px; - padding-right: 4px; - border-style: solid; - border: 1px solid #32414B; - border-radius: 4px; - color: #F0F0F0; -} - -QLineEdit:disabled { - background-color: #19232D; - color: #787878; -} - -QLineEdit:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QLineEdit:focus { - border: 1px solid #1464A0; -} - -QLineEdit:selected { - background-color: #1464A0; - color: #32414B; -} - -/* QTabWiget -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar - ---------------------------------------------------------------------------- */ -QTabWidget { - padding: 2px; - selection-background-color: #32414B; -} - -QTabWidget QWidget { - /* Fixes #189 */ - border-radius: 4px; -} - -QTabWidget::pane { - border: 1px solid #32414B; - border-radius: 4px; - margin: 0px; - /* Fixes double border inside pane with pyqt5 */ - padding: 0px; -} - -QTabWidget::pane:selected { - background-color: #32414B; - border: 1px solid #1464A0; -} - -/* QTabBar ---------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar - ---------------------------------------------------------------------------- */ -QTabBar { - qproperty-drawBase: 0; - border-radius: 4px; - margin: 0px; - padding: 2px; - border: 0; - /* left: 5px; move to the right by 5px - removed for fix */ -} - -QTabBar::close-button { - border: 0; - margin: 2px; - padding: 2px; - image: url(":/qss_icons/rc/window_close.png"); -} - -QTabBar::close-button:hover { - image: url(":/qss_icons/rc/window_close_focus.png"); -} - -QTabBar::close-button:pressed { - image: url(":/qss_icons/rc/window_close_pressed.png"); -} - -/* QTabBar::tab - selected ------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtabwidget-and-qtabbar - ---------------------------------------------------------------------------- */ -QTabBar::tab { - /* !selected and disabled ----------------------------------------- */ - /* selected ------------------------------------------------------- */ -} - -QTabBar::tab:top:selected:disabled { - border-bottom: 3px solid #14506E; - color: #787878; - background-color: #32414B; -} - -QTabBar::tab:bottom:selected:disabled { - border-top: 3px solid #14506E; - color: #787878; - background-color: #32414B; -} - -QTabBar::tab:left:selected:disabled { - border-right: 3px solid #14506E; - color: #787878; - background-color: #32414B; -} - -QTabBar::tab:right:selected:disabled { - border-left: 3px solid #14506E; - color: #787878; - background-color: #32414B; -} - -QTabBar::tab:top:!selected:disabled { - border-bottom: 3px solid #19232D; - color: #787878; - background-color: #19232D; -} - -QTabBar::tab:bottom:!selected:disabled { - border-top: 3px solid #19232D; - color: #787878; - background-color: #19232D; -} - -QTabBar::tab:left:!selected:disabled { - border-right: 3px solid #19232D; - color: #787878; - background-color: #19232D; -} - -QTabBar::tab:right:!selected:disabled { - border-left: 3px solid #19232D; - color: #787878; - background-color: #19232D; -} - -QTabBar::tab:top:!selected { - border-bottom: 2px solid #19232D; - margin-top: 2px; -} - -QTabBar::tab:bottom:!selected { - border-top: 2px solid #19232D; - margin-bottom: 3px; -} - -QTabBar::tab:left:!selected { - border-left: 2px solid #19232D; - margin-right: 2px; -} - -QTabBar::tab:right:!selected { - border-right: 2px solid #19232D; - margin-left: 2px; -} - -QTabBar::tab:top { - background-color: #32414B; - color: #F0F0F0; - margin-left: 2px; - padding-left: 4px; - padding-right: 4px; - padding-top: 2px; - padding-bottom: 2px; - min-width: 5px; - border-bottom: 3px solid #32414B; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} - -QTabBar::tab:top:selected { - background-color: #505F69; - color: #F0F0F0; - border-bottom: 3px solid #1464A0; - border-top-left-radius: 3px; - border-top-right-radius: 3px; -} - -QTabBar::tab:top:!selected:hover { - border: 1px solid #148CD2; - border-bottom: 3px solid #148CD2; - /* Fixes spyder-ide/spyder#9766 */ - padding-left: 4px; - padding-right: 4px; -} - -QTabBar::tab:bottom { - color: #F0F0F0; - border-top: 3px solid #32414B; - background-color: #32414B; - margin-left: 2px; - padding-left: 4px; - padding-right: 4px; - padding-top: 2px; - padding-bottom: 2px; - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; - min-width: 5px; -} - -QTabBar::tab:bottom:selected { - color: #F0F0F0; - background-color: #505F69; - border-top: 3px solid #1464A0; - border-bottom-left-radius: 3px; - border-bottom-right-radius: 3px; -} - -QTabBar::tab:bottom:!selected:hover { - border: 1px solid #148CD2; - border-top: 3px solid #148CD2; - /* Fixes spyder-ide/spyder#9766 */ - padding-left: 4px; - padding-right: 4px; -} - -QTabBar::tab:left { - color: #F0F0F0; - background-color: #32414B; - margin-top: 2px; - padding-left: 2px; - padding-right: 2px; - padding-top: 4px; - padding-bottom: 4px; - border-top-left-radius: 3px; - border-bottom-left-radius: 3px; - min-height: 5px; -} - -QTabBar::tab:left:selected { - color: #F0F0F0; - background-color: #505F69; - border-right: 3px solid #1464A0; -} - -QTabBar::tab:left:!selected:hover { - border: 1px solid #148CD2; - border-right: 3px solid #148CD2; - padding: 0px; -} - -QTabBar::tab:right { - color: #F0F0F0; - background-color: #32414B; - margin-top: 2px; - padding-left: 2px; - padding-right: 2px; - padding-top: 4px; - padding-bottom: 4px; - border-top-right-radius: 3px; - border-bottom-right-radius: 3px; - min-height: 5px; -} - -QTabBar::tab:right:selected { - color: #F0F0F0; - background-color: #505F69; - border-left: 3px solid #1464A0; -} - -QTabBar::tab:right:!selected:hover { - border: 1px solid #148CD2; - border-left: 3px solid #148CD2; - padding: 0px; -} - -QTabBar QToolButton { - /* Fixes #136 */ - background-color: #32414B; - height: 12px; - width: 12px; -} - -QTabBar QToolButton:pressed { - background-color: #32414B; -} - -QTabBar QToolButton:pressed:hover { - border: 1px solid #148CD2; -} - -QTabBar QToolButton::left-arrow:enabled { - image: url(":/qss_icons/rc/arrow_left.png"); -} - -QTabBar QToolButton::left-arrow:disabled { - image: url(":/qss_icons/rc/arrow_left_disabled.png"); -} - -QTabBar QToolButton::right-arrow:enabled { - image: url(":/qss_icons/rc/arrow_right.png"); -} - -QTabBar QToolButton::right-arrow:disabled { - image: url(":/qss_icons/rc/arrow_right_disabled.png"); -} - -/* QDockWiget ------------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QDockWidget { - outline: 1px solid #32414B; - background-color: #19232D; - border: 1px solid #32414B; - border-radius: 4px; - titlebar-close-icon: url(":/qss_icons/rc/window_close.png"); - titlebar-normal-icon: url(":/qss_icons/rc/window_undock.png"); -} - -QDockWidget::title { - /* Better size for title bar */ - padding: 6px; - spacing: 4px; - border: none; - background-color: #32414B; -} - -QDockWidget::close-button { - background-color: #32414B; - border-radius: 4px; - border: none; -} - -QDockWidget::close-button:hover { - image: url(":/qss_icons/rc/window_close_focus.png"); -} - -QDockWidget::close-button:pressed { - image: url(":/qss_icons/rc/window_close_pressed.png"); -} - -QDockWidget::float-button { - background-color: #32414B; - border-radius: 4px; - border: none; -} - -QDockWidget::float-button:hover { - image: url(":/qss_icons/rc/window_undock_focus.png"); -} - -QDockWidget::float-button:pressed { - image: url(":/qss_icons/rc/window_undock_pressed.png"); -} - -/* QTreeView QListView QTableView ----------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtreeview -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qlistview -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtableview - ---------------------------------------------------------------------------- */ -QTreeView:branch:selected, QTreeView:branch:hover { - background: url(":/qss_icons/rc/transparent.png"); -} - -QTreeView:branch:has-siblings:!adjoins-item { - border-image: url(":/qss_icons/rc/branch_line.png") 0; -} - -QTreeView:branch:has-siblings:adjoins-item { - border-image: url(":/qss_icons/rc/branch_more.png") 0; -} - -QTreeView:branch:!has-children:!has-siblings:adjoins-item { - border-image: url(":/qss_icons/rc/branch_end.png") 0; -} - -QTreeView:branch:has-children:!has-siblings:closed, QTreeView:branch:closed:has-children:has-siblings { - border-image: none; - image: url(":/qss_icons/rc/branch_closed.png"); -} - -QTreeView:branch:open:has-children:!has-siblings, QTreeView:branch:open:has-children:has-siblings { - border-image: none; - image: url(":/qss_icons/rc/branch_open.png"); -} - -QTreeView:branch:has-children:!has-siblings:closed:hover, QTreeView:branch:closed:has-children:has-siblings:hover { - image: url(":/qss_icons/rc/branch_closed_focus.png"); -} - -QTreeView:branch:open:has-children:!has-siblings:hover, QTreeView:branch:open:has-children:has-siblings:hover { - image: url(":/qss_icons/rc/branch_open_focus.png"); -} - -QTreeView::indicator:checked, -QListView::indicator:checked { - image: url(":/qss_icons/rc/checkbox_checked.png"); -} - -QTreeView::indicator:checked:hover, QTreeView::indicator:checked:focus, QTreeView::indicator:checked:pressed, -QListView::indicator:checked:hover, -QListView::indicator:checked:focus, -QListView::indicator:checked:pressed { - image: url(":/qss_icons/rc/checkbox_checked_focus.png"); -} - -QTreeView::indicator:unchecked, -QListView::indicator:unchecked { - image: url(":/qss_icons/rc/checkbox_unchecked.png"); -} - -QTreeView::indicator:unchecked:hover, QTreeView::indicator:unchecked:focus, QTreeView::indicator:unchecked:pressed, -QListView::indicator:unchecked:hover, -QListView::indicator:unchecked:focus, -QListView::indicator:unchecked:pressed { - image: url(":/qss_icons/rc/checkbox_unchecked_focus.png"); -} - -QTreeView::indicator:indeterminate, -QListView::indicator:indeterminate { - image: url(":/qss_icons/rc/checkbox_indeterminate.png"); -} - -QTreeView::indicator:indeterminate:hover, QTreeView::indicator:indeterminate:focus, QTreeView::indicator:indeterminate:pressed, -QListView::indicator:indeterminate:hover, -QListView::indicator:indeterminate:focus, -QListView::indicator:indeterminate:pressed { - image: url(":/qss_icons/rc/checkbox_indeterminate_focus.png"); -} - -QTreeView, -QListView, -QTableView, -QColumnView { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - gridline-color: #32414B; - border-radius: 4px; -} - -QTreeView:disabled, -QListView:disabled, -QTableView:disabled, -QColumnView:disabled { - background-color: #19232D; - color: #787878; -} - -QTreeView:selected, -QListView:selected, -QTableView:selected, -QColumnView:selected { - background-color: #1464A0; - color: #32414B; -} - -QTreeView:hover, -QListView:hover, -QTableView:hover, -QColumnView:hover { - background-color: #19232D; - border: 1px solid #148CD2; -} - -QTreeView::item:pressed, -QListView::item:pressed, -QTableView::item:pressed, -QColumnView::item:pressed { - background-color: #1464A0; -} - -QTreeView::item:selected:hover, -QListView::item:selected:hover, -QTableView::item:selected:hover, -QColumnView::item:selected:hover { - background: #1464A0; - color: #19232D; -} - -QTreeView::item:selected:active, -QListView::item:selected:active, -QTableView::item:selected:active, -QColumnView::item:selected:active { - background-color: #1464A0; -} - -QTreeView::item:!selected:hover, -QListView::item:!selected:hover, -QTableView::item:!selected:hover, -QColumnView::item:!selected:hover { - outline: 0; - color: #148CD2; - background-color: #32414B; -} - -QTableCornerButton::section { - background-color: #19232D; - border: 1px transparent #32414B; - border-radius: 0px; -} - -/* QHeaderView ------------------------------------------------------------ - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qheaderview - ---------------------------------------------------------------------------- */ -QHeaderView { - background-color: #32414B; - border: 0px transparent #32414B; - padding: 0px; - margin: 0px; - border-radius: 0px; -} - -QHeaderView:disabled { - background-color: #32414B; - border: 1px transparent #32414B; - padding: 2px; -} - -QHeaderView::section { - background-color: #32414B; - color: #F0F0F0; - padding: 2px; - border-radius: 0px; - text-align: left; -} - -QHeaderView::section:checked { - color: #F0F0F0; - background-color: #1464A0; -} - -QHeaderView::section:checked:disabled { - color: #787878; - background-color: #14506E; -} - -QHeaderView::section::horizontal { - padding-left: 4px; - padding-right: 4px; - border-left: 1px solid #19232D; -} - -QHeaderView::section::horizontal::first, QHeaderView::section::horizontal::only-one { - border-left: 1px solid #32414B; -} - -QHeaderView::section::horizontal:disabled { - color: #787878; -} - -QHeaderView::section::vertical { - padding-left: 4px; - padding-right: 4px; - border-top: 1px solid #19232D; -} - -QHeaderView::section::vertical::first, QHeaderView::section::vertical::only-one { - border-top: 1px solid #32414B; -} - -QHeaderView::section::vertical:disabled { - color: #787878; -} - -QHeaderView::down-arrow { - /* Those settings (border/width/height/background-color) solve bug */ - /* transparent arrow background and size */ - background-color: #32414B; - border: none; - height: 12px; - width: 12px; - padding-left: 2px; - padding-right: 2px; - image: url(":/qss_icons/rc/arrow_down.png"); -} - -QHeaderView::up-arrow { - background-color: #32414B; - border: none; - height: 12px; - width: 12px; - padding-left: 2px; - padding-right: 2px; - image: url(":/qss_icons/rc/arrow_up.png"); -} - -/* QToolBox -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qtoolbox - ---------------------------------------------------------------------------- */ -QToolBox { - padding: 0px; - border: 0px; - border: 1px solid #32414B; -} - -QToolBox:selected { - padding: 0px; - border: 2px solid #1464A0; -} - -QToolBox::tab { - background-color: #19232D; - border: 1px solid #32414B; - color: #F0F0F0; - border-top-left-radius: 4px; - border-top-right-radius: 4px; -} - -QToolBox::tab:disabled { - color: #787878; -} - -QToolBox::tab:selected { - background-color: #505F69; - border-bottom: 2px solid #1464A0; -} - -QToolBox::tab:selected:disabled { - background-color: #32414B; - border-bottom: 2px solid #14506E; -} - -QToolBox::tab:!selected { - background-color: #32414B; - border-bottom: 2px solid #32414B; -} - -QToolBox::tab:!selected:disabled { - background-color: #19232D; -} - -QToolBox::tab:hover { - border-color: #148CD2; - border-bottom: 2px solid #148CD2; -} - -QToolBox QScrollArea QWidget QWidget { - padding: 0px; - border: 0px; - background-color: #19232D; -} - -/* QFrame ----------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe -https://doc.qt.io/qt-5/qframe.html#-prop -https://doc.qt.io/qt-5/qframe.html#details -https://stackoverflow.com/questions/14581498/qt-stylesheet-for-hline-vline-color - ---------------------------------------------------------------------------- */ -/* (dot) .QFrame fix #141, #126, #123 */ -.QFrame { - border-radius: 4px; - border: 1px solid #32414B; - /* No frame */ - /* HLine */ - /* HLine */ -} - -.QFrame[frameShape="0"] { - border-radius: 4px; - border: 1px transparent #32414B; -} - -.QFrame[frameShape="4"] { - max-height: 2px; - border: none; - background-color: #32414B; -} - -.QFrame[frameShape="5"] { - max-width: 2px; - border: none; - background-color: #32414B; -} - -/* QSplitter -------------------------------------------------------------- - -https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qsplitter - ---------------------------------------------------------------------------- */ -QSplitter { - background-color: #32414B; - spacing: 0px; - padding: 0px; - margin: 0px; -} - -QSplitter::handle { - background-color: #32414B; - border: 0px solid #19232D; - spacing: 0px; - padding: 1px; - margin: 0px; -} - -QSplitter::handle:hover { - background-color: #787878; -} - -QSplitter::handle:horizontal { - width: 5px; - image: url(":/qss_icons/rc/line_vertical.png"); -} - -QSplitter::handle:vertical { - height: 5px; - image: url(":/qss_icons/rc/line_horizontal.png"); -} - -/* QDateEdit -------------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QDateEdit { - selection-background-color: #1464A0; - border-style: solid; - border: 1px solid #32414B; - border-radius: 4px; - /* This fixes 103, 111 */ - padding-top: 2px; - /* This fixes 103, 111 */ - padding-bottom: 2px; - padding-left: 4px; - padding-right: 4px; - min-width: 10px; -} - -QDateEdit:on { - selection-background-color: #1464A0; -} - -QDateEdit::drop-down { - subcontrol-origin: padding; - subcontrol-position: top right; - width: 12px; - border-left: 1px solid #32414B; -} - -QDateEdit::down-arrow { - image: url(":/qss_icons/rc/arrow_down_disabled.png"); - height: 8px; - width: 8px; -} - -QDateEdit::down-arrow:on, QDateEdit::down-arrow:hover, QDateEdit::down-arrow:focus { - image: url(":/qss_icons/rc/arrow_down.png"); -} - -QDateEdit QAbstractItemView { - background-color: #19232D; - border-radius: 4px; - border: 1px solid #32414B; - selection-background-color: #1464A0; -} - -/* QAbstractView ---------------------------------------------------------- - ---------------------------------------------------------------------------- */ -QAbstractView:hover { - border: 1px solid #148CD2; - color: #F0F0F0; -} - -QAbstractView:selected { - background: #1464A0; - color: #32414B; -} - -/* PlotWidget ------------------------------------------------------------- - ---------------------------------------------------------------------------- */ -PlotWidget { - /* Fix cut labels in plots #134 */ - padding: 0px; -} diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/synthetic_env.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/synthetic_env.py index 86e4b68488..6a3340788b 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/synthetic_env.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/azpy/synthetic_env.py @@ -384,8 +384,7 @@ def stash_env(_SYNTH_ENV_DICT = OrderedDict()): # changed to just make the fallback what is set in boostrap # so now it's less of a fallnack and more correct if not # explicitly set - _LY_PROJECT = os.getenv(ENVAR_LY_PROJECT, - get_current_project(_LY_DEV)) + _LY_PROJECT = os.getenv(ENVAR_LY_PROJECT) _SYNTH_ENV_DICT[ENVAR_LY_PROJECT] = _LY_PROJECT _LY_BUILD_DIR_NAME = os.getenv(ENVAR_LY_BUILD_DIR_NAME, diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/config.py b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/config.py index c62571b2f5..0fa0b6ee67 100755 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/config.py +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/config.py @@ -109,11 +109,11 @@ def init_ly_pyside(LY_DEV=None): 'bin', 'profile').resolve() - # allows to retreive from settings.QTFORPYTHON_PATH - from azpy.constants import STR_QTFORPYTHON_PATH # a path string constructor - QTFORPYTHON_PATH = Path(STR_QTFORPYTHON_PATH.format(LY_DEV)).resolve() - os.environ["DYNACONF_QTFORPYTHON_PATH"] = str(QTFORPYTHON_PATH) - site.addsitedir(str(QTFORPYTHON_PATH)) # PYTHONPATH + # # allows to retreive from settings.QTFORPYTHON_PATH + # from azpy.constants import STR_QTFORPYTHON_PATH # a path string constructor + # QTFORPYTHON_PATH = Path(STR_QTFORPYTHON_PATH.format(LY_DEV)).resolve() + # os.environ["DYNACONF_QTFORPYTHON_PATH"] = str(QTFORPYTHON_PATH) + # site.addsitedir(str(QTFORPYTHON_PATH)) # PYTHONPATH QT_PLUGIN_PATH = Path.joinpath(LY_BIN_PATH, 'EditorPlugins').resolve() @@ -131,15 +131,15 @@ def init_ly_pyside(LY_DEV=None): # add Qt binaries to the Windows path to handle findings DLL file dependencies if sys.platform.startswith('win'): - path = os.environ['PATH'] - newPath = '' - newPath += str(LY_BIN_PATH) + os.pathsep - newPath += str(Path.joinpath(QTFORPYTHON_PATH, - 'shiboken2').resolve()) + os.pathsep - newPath += str(Path.joinpath(QTFORPYTHON_PATH, - 'PySide2').resolve()) + os.pathsep - newPath += path - os.environ['PATH']=newPath + # path = os.environ['PATH'] + # newPath = '' + # newPath += str(LY_BIN_PATH) + os.pathsep + # newPath += str(Path.joinpath(QTFORPYTHON_PATH, + # 'shiboken2').resolve()) + os.pathsep + # newPath += str(Path.joinpath(QTFORPYTHON_PATH, + # 'PySide2').resolve()) + os.pathsep + # newPath += path + # os.environ['PATH']=newPath _LOGGER.debug('PySide2 bootstrapped PATH for Windows.') try: @@ -223,8 +223,8 @@ os.environ["DYNACONF_DCCSI_DEV_MODE"] = str(_DCCSI_DEV_MODE) _LY_DEV = azpy.config_utils.get_stub_check_path(in_path=_DCCSIG_PATH, check_stub='engine.json') os.environ["DYNACONF_LY_DEV"] = str(_LY_DEV.resolve()) -_LY_PROJECT = azpy.config_utils.get_current_project(_LY_DEV) -os.environ["DYNACONF_LY_PROJECT"] = _LY_PROJECT +_LY_PROJECT = azpy.config_utils.get_current_project() +os.environ["DYNACONF_LY_PROJECT"] = str(_LY_PROJECT.resolve()) _LY_PROJECT_PATH = Path(_LY_DEV, _LY_PROJECT) os.environ["DYNACONF_LY_PROJECT_PATH"] = str(_LY_PROJECT_PATH) os.environ["DYNACONF_DCCSIG_PATH"] = str(_DCCSIG_PATH) @@ -319,7 +319,7 @@ if __name__ == '__main__': settings.setenv() # doing this will add/set the additional DYNACONF_ envars - _LOGGER.info('QTFORPYTHON_PATH: {}'.format(settings.QTFORPYTHON_PATH)) + #_LOGGER.info('QTFORPYTHON_PATH: {}'.format(settings.QTFORPYTHON_PATH)) _LOGGER.info('LY_BIN_PATH: {}'.format(settings.LY_BIN_PATH)) _LOGGER.info('QT_PLUGIN_PATH: {}'.format(settings.QT_PLUGIN_PATH)) _LOGGER.info('QT_QPA_PLATFORM_PLUGIN_PATH: {}'.format(settings.QT_QPA_PLATFORM_PLUGIN_PATH)) diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json new file mode 100644 index 0000000000..a867fe0f0f --- /dev/null +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/gem.json @@ -0,0 +1,14 @@ +{ + "gem_name": "DccScriptingInterface", + "display_name": "Atom DccScriptingInterface (DCCsi)", + "summary": "A python framework for working with various DCC tools and workflows.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "DCC", + "Digital", + "Content", + "Creation" + ] +} diff --git a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/requirements.txt b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/requirements.txt index 2f7626addb..1536b79f3d 100644 --- a/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/requirements.txt +++ b/Gems/AtomLyIntegration/TechnicalArt/DccScriptingInterface/requirements.txt @@ -36,6 +36,16 @@ unipath==1.1 \ --hash=sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae \ --hash=sha256:e6257e508d8abbfb6ddd8ec357e33589f1f48b1599127f23b017124d90b0fff7 # via -r requirements.txt +qdarkstyle==3.0.2 \ + --hash=sha256:55d149cf5f40ee297397f1818e091118cefb855a4a9c5c38566c47acd2d8c7ae \ + --hash=sha256:7c791535cc20b3cc1e8e1bf6b88dabe53cb0615983df702be83597e73ada2558 + # via -r c:\temp\requirements.txt +qtpy==1.9.0 \ + --hash=sha256:2db72c44b55d0fe1407be8fba35c838ad0d6d3bb81f23007886dc1fc0f459c8d \ + --hash=sha256:fa0b8363b363e89b2a6f49eddc162a04c0699ae95e109a6be3bb145a913190ea + # via + # -r c:\temp\requirements.txt + # qdarkstyle wincertstore==0.2 \ --hash=sha256:22d5eebb52df88a8d4014d5cf6d1b6c3a5d469e6c3b2e2854f3a003e48872356 \ --hash=sha256:780bd1557c9185c15d9f4221ea7f905cb20b93f7151ca8ccaed9714dce4b327a diff --git a/Gems/AtomLyIntegration/gem.json b/Gems/AtomLyIntegration/gem.json index 0971ad53c2..4f587a8806 100644 --- a/Gems/AtomLyIntegration/gem.json +++ b/Gems/AtomLyIntegration/gem.json @@ -1,3 +1,5 @@ { - "gem_name": "AtomLyIntegration" + "gem_name": "AtomLyIntegration", + "display_name": "Atom O3DE Integration", + "summary": "Collection of module targets for integrating Atom with the O3DE engine" } diff --git a/AutomatedTesting/Gem/Code/Platform/Android/tool_dependencies.cmake b/Gems/AtomTressFX/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/Android/tool_dependencies.cmake rename to Gems/AtomTressFX/CMakeLists.txt diff --git a/Gems/AudioEngineWwise/Code/CMakeLists.txt b/Gems/AudioEngineWwise/Code/CMakeLists.txt index 5ea6a6d461..f90064908a 100644 --- a/Gems/AudioEngineWwise/Code/CMakeLists.txt +++ b/Gems/AudioEngineWwise/Code/CMakeLists.txt @@ -93,6 +93,9 @@ ly_add_target( Gem::AudioEngineWwise.Static ) +# we'll load the above "Gem::AudioEngineWwise" module in clients. +ly_create_alias(NAME AudioEngineWwise.Clients NAMESPACE Gem TARGETS Gem::AudioEngineWwise) + ################################################################################ # Tests ################################################################################ @@ -206,6 +209,8 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AssetBuilderSDK Gem::AudioEngineWwise.Static Gem::AudioSystem.Editor + RUNTIME_DEPENDENCIES + Gem::AudioSystem.Editor ) ly_add_target( @@ -230,6 +235,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AudioSystem.Editor ) + # by default, we'll load the above "Gem::AudioEngineWwise.Editor" module in builders and tools. + ly_create_alias(NAME AudioEngineWwise.Builders NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor) + ly_create_alias(NAME AudioEngineWwise.Tools NAMESPACE Gem TARGETS Gem::AudioEngineWwise.Editor) + if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_target( NAME AudioEngineWwise.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} diff --git a/Gems/AudioEngineWwise/Code/Source/Builder/AudioControlBuilderWorker.cpp b/Gems/AudioEngineWwise/Code/Source/Builder/AudioControlBuilderWorker.cpp index f7b54a44d9..b08aa6fa1d 100644 --- a/Gems/AudioEngineWwise/Code/Source/Builder/AudioControlBuilderWorker.cpp +++ b/Gems/AudioEngineWwise/Code/Source/Builder/AudioControlBuilderWorker.cpp @@ -57,11 +57,11 @@ namespace AudioControlBuilder { atlPlatform = "windows"; } - else if (platform == "es3") + else if (platform == "android") { atlPlatform = "android"; } - else if (platform == "osx_gl") + else if (platform == "mac") { atlPlatform = "mac"; } diff --git a/Gems/AudioEngineWwise/Code/Source/Engine/Config_wwise.h b/Gems/AudioEngineWwise/Code/Source/Engine/Config_wwise.h index ad2ba28269..7fabfb75b3 100644 --- a/Gems/AudioEngineWwise/Code/Source/Engine/Config_wwise.h +++ b/Gems/AudioEngineWwise/Code/Source/Engine/Config_wwise.h @@ -46,7 +46,7 @@ namespace Audio::Wwise ~PlatformMapping() = default; // Serialized Data... - AZStd::string m_assetPlatform; // LY Asset Platform name (i.e. "pc", "osx_gl", "es3", ...) + AZStd::string m_assetPlatform; // LY Asset Platform name (i.e. "pc", "mac", "android", ...) AZStd::string m_altAssetPlatform; // Some platforms can be run using a different asset platform. Useful for builder worker. AZStd::string m_enginePlatform; // LY Engine Platform name (i.e. "Windows", "Mac", "Android", ...) AZStd::string m_wwisePlatform; // Wwise Platform name (i.e. "Windows", "Mac", "Android", ...) diff --git a/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Android/wwise_config_android.json b/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Android/wwise_config_android.json index 22cc632cbd..38f6ff142e 100644 --- a/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Android/wwise_config_android.json +++ b/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Android/wwise_config_android.json @@ -1,5 +1,5 @@ { - "assetPlatform": "es3", + "assetPlatform": "android", "altAssetPlatform": "", "enginePlatform": "Android", "wwisePlatform": "Android", diff --git a/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Mac/wwise_config_mac.json b/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Mac/wwise_config_mac.json index 4069d8add7..a996b85150 100644 --- a/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Mac/wwise_config_mac.json +++ b/Gems/AudioEngineWwise/Tools/WwiseConfig/Platform/Mac/wwise_config_mac.json @@ -1,5 +1,5 @@ { - "assetPlatform": "osx_gl", + "assetPlatform": "mac", "altAssetPlatform": "", "enginePlatform": "Mac", "wwisePlatform": "Mac", diff --git a/Gems/AudioSystem/Code/CMakeLists.txt b/Gems/AudioSystem/Code/CMakeLists.txt index 8a6f2c417e..3963a71ad0 100644 --- a/Gems/AudioSystem/Code/CMakeLists.txt +++ b/Gems/AudioSystem/Code/CMakeLists.txt @@ -61,22 +61,8 @@ ly_add_target( Gem::AudioSystem.Static ) -################################################################################ -# Server -################################################################################ -if (PAL_TRAIT_BUILD_SERVER_SUPPORTED) - # Stub gem for server. Audio system is client only - ly_add_target( - NAME AudioSystem.Server GEM_MODULE - - NAMESPACE Gem - FILES_CMAKE - audiosystem_stub_files.cmake - BUILD_DEPENDENCIES - PRIVATE - AZ::AzCore - ) -endif () +# AudioSystem should use the above target on clients. +ly_create_alias(NAME AudioSystem.Clients NAMESPACE Gem TARGETS Gem::AudioSystem) ################################################################################ # Tests @@ -101,7 +87,8 @@ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzFramework Legacy::CryCommon Gem::AudioSystem.Static - Gem::LmbrCentral + RUNTIME_DEPENDENCIES + Gem::LmbrCentral ) ly_add_googletest( NAME Gem::AudioSystem.Tests @@ -230,6 +217,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::AudioSystem.Editor.Static ) + # use the above "Editor" target in tools and builders: + ly_create_alias(NAME AudioSystem.Tools NAMESPACE Gem TARGETS Gem::AudioSystem.Editor) + ly_create_alias(NAME AudioSystem.Builders NAMESPACE Gem TARGETS Gem::AudioSystem.Editor) + if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_target( NAME AudioSystem.Editor.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} @@ -253,3 +244,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ) endif() endif () + + + diff --git a/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt b/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt index 551f76da02..6215ae7697 100644 --- a/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt +++ b/Gems/AutomatedLauncherTesting/Code/CMakeLists.txt @@ -42,3 +42,7 @@ ly_add_target( RUNTIME_DEPENDENCIES Gem::LmbrCentral ) + +# servers and clients use the above module. +ly_create_alias(NAME AutomatedLauncherTesting.Servers NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting) +ly_create_alias(NAME AutomatedLauncherTesting.Clients NAMESPACE Gem TARGETS Gem::AutomatedLauncherTesting) diff --git a/Gems/Blast/Code/CMakeLists.txt b/Gems/Blast/Code/CMakeLists.txt index 6c90357364..143e3af095 100644 --- a/Gems/Blast/Code/CMakeLists.txt +++ b/Gems/Blast/Code/CMakeLists.txt @@ -59,6 +59,11 @@ ly_add_target( Gem::PhysX ) +# clients and servers use the above Gem module. +ly_create_alias(NAME Blast.Servers NAMESPACE Gem TARGETS Gem::Blast) +ly_create_alias(NAME Blast.Clients NAMESPACE Gem TARGETS Gem::Blast) + + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -110,6 +115,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::PhysX.Editor ) + # tools and builders use the above module. + ly_create_alias(NAME Blast.Tools NAMESPACE Gem TARGETS Gem::Blast.Editor) + ly_create_alias(NAME Blast.Builders NAMESPACE Gem TARGETS Gem::Blast.Editor) endif() ################################################################################ diff --git a/Gems/Blast/Code/Source/Actor/BlastActorDesc.h b/Gems/Blast/Code/Source/Actor/BlastActorDesc.h index a58fbd04df..67a3c8d338 100644 --- a/Gems/Blast/Code/Source/Actor/BlastActorDesc.h +++ b/Gems/Blast/Code/Source/Actor/BlastActorDesc.h @@ -32,10 +32,11 @@ namespace Blast Physics::MaterialId m_physicsMaterialId; AZ::Vector3 m_parentLinearVelocity = AZ::Vector3::CreateZero(); AZ::Vector3 m_parentCenterOfMass = AZ::Vector3::CreateZero(); - AzPhysics::RigidBodyConfiguration m_bodyConfiguration; //! Either rigid dynamic or rigid static - AZStd::vector m_chunkIndices; //! Chunks that are going to simulate this actor. - AZStd::shared_ptr m_entity; //! Entity that the actor should use to simulate rigid body - bool m_isStatic = false; //! Denotes whether actor should be simulated by a static or dynamic rigid body. - bool m_isLeafChunk = false; //! Denotes whether this actor represented by a single leaf chunk. + AzPhysics::RigidBodyConfiguration m_bodyConfiguration; //!< Either rigid dynamic or rigid static + AZStd::vector m_chunkIndices; //!< Chunks that are going to simulate this actor. + AZStd::shared_ptr m_entity; //!< Entity that the actor should use to simulate rigid body + bool m_isStatic = false; //!< Denotes whether actor should be simulated by a static or dynamic rigid body. + bool m_isLeafChunk = false; //!< Denotes whether this actor represented by a single leaf chunk. + float m_scale = 1.0f; //!< Uniform scale applied to the actor. }; } // namespace Blast diff --git a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp index 1f05793b4b..8f82f3366f 100644 --- a/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp +++ b/Gems/Blast/Code/Source/Actor/BlastActorImpl.cpp @@ -45,6 +45,7 @@ namespace Blast , m_parentLinearVelocity(desc.m_parentLinearVelocity) , m_parentCenterOfMass(desc.m_parentCenterOfMass) , m_bodyConfiguration(desc.m_bodyConfiguration) + , m_scale(desc.m_scale) { // Store pointer to ourselves in the blast toolkit actor's userData m_tkActor.userData = this; @@ -67,7 +68,7 @@ namespace Blast auto transform = AZ::Transform::CreateFromQuaternionAndTranslation( m_bodyConfiguration.m_orientation, m_bodyConfiguration.m_position); - transform.MultiplyByScale(m_bodyConfiguration.m_scale); + transform.MultiplyByUniformScale(m_scale); AZ::TransformBus::Event(m_entity->GetId(), &AZ::TransformInterface::SetWorldTM, transform); @@ -130,7 +131,7 @@ namespace Blast Physics::NativeShapeConfiguration shapeConfiguration; shapeConfiguration.m_nativeShapePtr = reinterpret_cast(const_cast(&subchunk.geometry)->convexMesh); - shapeConfiguration.m_nativeShapeScale = m_bodyConfiguration.m_scale; + shapeConfiguration.m_nativeShapeScale = AZ::Vector3(m_scale); AZStd::shared_ptr shape = AZ::Interface::Get()->CreateShape( colliderConfiguration, shapeConfiguration); @@ -150,8 +151,6 @@ namespace Blast colliderConfiguration.m_position = transform.GetTranslation(); colliderConfiguration.m_rotation = transform.GetRotation(); colliderConfiguration.m_isExclusive = true; - colliderConfiguration.m_materialSelection.SetMaterialLibrary( - AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetId()); colliderConfiguration.m_materialSelection.SetMaterialId(material); colliderConfiguration.m_collisionGroupId = actorConfiguration.m_collisionGroupId; colliderConfiguration.m_collisionLayer = actorConfiguration.m_collisionLayer; diff --git a/Gems/Blast/Code/Source/Actor/BlastActorImpl.h b/Gems/Blast/Code/Source/Actor/BlastActorImpl.h index 3b686b3641..e3ba8880be 100644 --- a/Gems/Blast/Code/Source/Actor/BlastActorImpl.h +++ b/Gems/Blast/Code/Source/Actor/BlastActorImpl.h @@ -77,5 +77,6 @@ namespace Blast AZ::Vector3 m_parentLinearVelocity = AZ::Vector3::CreateZero(); AZ::Vector3 m_parentCenterOfMass = AZ::Vector3::CreateZero(); AzPhysics::RigidBodyConfiguration m_bodyConfiguration; + float m_scale = 1.0f; }; } // namespace Blast diff --git a/Gems/Blast/Code/Source/Actor/ShapesProvider.cpp b/Gems/Blast/Code/Source/Actor/ShapesProvider.cpp index 42bdd773f7..a739f25cf9 100644 --- a/Gems/Blast/Code/Source/Actor/ShapesProvider.cpp +++ b/Gems/Blast/Code/Source/Actor/ShapesProvider.cpp @@ -27,7 +27,7 @@ namespace Blast PhysX::ColliderComponentRequestBus::Handler::BusDisconnect(m_entityId); } - Physics::ShapeConfigurationList ShapesProvider::GetShapeConfigurations() + AzPhysics::ShapeColliderPairList ShapesProvider::GetShapeConfigurations() { return {}; } diff --git a/Gems/Blast/Code/Source/Actor/ShapesProvider.h b/Gems/Blast/Code/Source/Actor/ShapesProvider.h index 4e737be080..0b23dc542c 100644 --- a/Gems/Blast/Code/Source/Actor/ShapesProvider.h +++ b/Gems/Blast/Code/Source/Actor/ShapesProvider.h @@ -28,7 +28,7 @@ namespace Blast void AddShape(AZStd::shared_ptr shape); // This class is not supposed to provide shape configurations, only shapes themselves. - Physics::ShapeConfigurationList GetShapeConfigurations() override; + AzPhysics::ShapeColliderPairList GetShapeConfigurations() override; AZStd::vector> GetShapes() override; diff --git a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp index 841163d2ab..1da9663b8f 100644 --- a/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp +++ b/Gems/Blast/Code/Source/Components/BlastFamilyComponent.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -147,6 +148,7 @@ namespace Blast void BlastFamilyComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("BlastFamilyService")); + incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); } void BlastFamilyComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) @@ -264,16 +266,29 @@ namespace Blast auto solverPtr = Nv::Blast::ExtStressSolver::create( const_cast(*m_family->GetTkFamily()->getFamilyLL()), stressSolverSettings); m_solver = physx::unique_ptr(solverPtr); - Physics::MaterialFromAssetConfiguration material; - AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetDataForMaterialId( - m_physicsMaterialId, material); - m_solver->setAllNodesInfoFromLL(material.m_configuration.m_density); + + AZStd::shared_ptr physicsMaterial; + Physics::PhysicsMaterialRequestBus::BroadcastResult( + physicsMaterial, + &Physics::PhysicsMaterialRequestBus::Events::GetMaterialById, + m_physicsMaterialId); + if (!physicsMaterial) + { + AZ_Warning("BlastFamilyComponent", false, "Material Id %s was not found, using default material instead.", + m_physicsMaterialId.GetUuid().ToString().c_str()); + + Physics::PhysicsMaterialRequestBus::BroadcastResult( + physicsMaterial, + &Physics::PhysicsMaterialRequestBus::Events::GetGenericDefaultMaterial); + AZ_Assert(physicsMaterial, "BlastFamilyComponent: Invalid default physics material"); + } + m_solver->setAllNodesInfoFromLL(physicsMaterial->GetDensity()); // Create damage and actor render managers m_damageManager = AZStd::make_unique(blastMaterial, m_family->GetActorTracker()); m_actorRenderManager = AZStd::make_unique( AZ::RPI::Scene::GetFeatureProcessorForEntity(GetEntityId()), - m_meshDataComponent, GetEntityId(), m_blastAsset->GetPxAsset()->getChunkCount(), transform.GetScale()); + m_meshDataComponent, GetEntityId(), m_blastAsset->GetPxAsset()->getChunkCount(), AZ::Vector3(transform.GetUniformScale())); // Spawn the family m_family->Spawn(transform); diff --git a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp index fc6967b96e..873ef7248d 100644 --- a/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp +++ b/Gems/Blast/Code/Source/Editor/EditorBlastFamilyComponent.cpp @@ -85,6 +85,7 @@ namespace Blast void EditorBlastFamilyComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC_CE("BlastFamilyService")); + incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); } void EditorBlastFamilyComponent::OnAssetReady(AZ::Data::Asset asset) @@ -130,6 +131,6 @@ namespace Blast AZ::Data::AssetId EditorBlastFamilyComponent::GetPhysicsMaterialLibraryAssetId() const { - return AZ::Interface::Get()->GetDefaultMaterialLibrary()->GetId(); + return AZ::Interface::Get()->GetConfiguration()->m_materialLibraryAsset.GetId(); } } // namespace Blast diff --git a/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp b/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp index f8fd97dc52..77788b6aee 100644 --- a/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp +++ b/Gems/Blast/Code/Source/Editor/EditorBlastMeshDataComponent.cpp @@ -43,6 +43,7 @@ namespace Blast AZ::ComponentDescriptor::DependencyArrayType& incompatible) { incompatible.push_back(AZ_CRC("BlastMeshDataService")); + incompatible.push_back(AZ_CRC_CE("NonUniformScaleService")); } void EditorBlastMeshDataComponent::Reflect(AZ::ReflectContext* context) diff --git a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp index 87865d0e08..25c0f904e3 100644 --- a/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp +++ b/Gems/Blast/Code/Source/Family/BlastFamilyImpl.cpp @@ -202,7 +202,7 @@ namespace Blast if (parentBody) { parentTransform = parentBody->GetTransform(); - parentTransform.MultiplyByScale(m_initialTransform.GetScale()); + parentTransform.MultiplyByUniformScale(m_initialTransform.GetUniformScale()); } else { @@ -239,7 +239,6 @@ namespace Blast AzPhysics::RigidBodyConfiguration configuration; configuration.m_position = transform.GetTranslation(); configuration.m_orientation = transform.GetRotation(); - configuration.m_scale = transform.GetScale(); configuration.m_ccdEnabled = m_actorConfiguration.m_isCcdEnabled; configuration.m_startSimulationEnabled = m_actorConfiguration.m_isSimulated; configuration.m_initialAngularVelocity = AZ::Vector3::CreateZero(); @@ -255,6 +254,7 @@ namespace Blast actorDesc.m_parentCenterOfMass = transform.GetTranslation(); actorDesc.m_parentLinearVelocity = AZ::Vector3::CreateZero(); actorDesc.m_bodyConfiguration = configuration; + actorDesc.m_scale = transform.GetUniformScale(); return actorDesc; } diff --git a/Gems/Blast/Code/Tests/BlastFamilyTest.cpp b/Gems/Blast/Code/Tests/BlastFamilyTest.cpp index 2e6fd7f2bb..06af890a44 100644 --- a/Gems/Blast/Code/Tests/BlastFamilyTest.cpp +++ b/Gems/Blast/Code/Tests/BlastFamilyTest.cpp @@ -137,7 +137,7 @@ namespace Blast .Times(1) .WillOnce(Return(false)); - AZ::Transform transform = AZ::Transform::CreateScale(AZ::Vector3::CreateOne()); + AZ::Transform transform = AZ::Transform::CreateIdentity(); blastFamily->Spawn(transform); } diff --git a/Gems/Blast/Code/Tests/Mocks/BlastMocks.h b/Gems/Blast/Code/Tests/Mocks/BlastMocks.h index 1ae87e2282..ca78623a8a 100644 --- a/Gems/Blast/Code/Tests/Mocks/BlastMocks.h +++ b/Gems/Blast/Code/Tests/Mocks/BlastMocks.h @@ -644,19 +644,7 @@ namespace Blast MOCK_METHOD0(GetLocalX, float()); MOCK_METHOD0(GetLocalY, float()); MOCK_METHOD0(GetLocalZ, float()); - MOCK_METHOD1(SetRotation, void(const AZ::Vector3&)); - MOCK_METHOD1(SetRotationX, void(float)); - MOCK_METHOD1(SetRotationY, void(float)); - MOCK_METHOD1(SetRotationZ, void(float)); - MOCK_METHOD1(SetRotationQuaternion, void(const AZ::Quaternion&)); - MOCK_METHOD1(RotateByX, void(float)); - MOCK_METHOD1(RotateByY, void(float)); - MOCK_METHOD1(RotateByZ, void(float)); - MOCK_METHOD0(GetRotationEulerRadians, AZ::Vector3()); - MOCK_METHOD0(GetRotationQuaternion, AZ::Quaternion()); - MOCK_METHOD0(GetRotationX, float()); - MOCK_METHOD0(GetRotationY, float()); - MOCK_METHOD0(GetRotationZ, float()); + MOCK_METHOD1(SetWorldRotationQuaternion, void(const AZ::Quaternion&)); MOCK_METHOD0(GetWorldRotation, AZ::Vector3()); MOCK_METHOD0(GetWorldRotationQuaternion, AZ::Quaternion()); MOCK_METHOD1(SetLocalRotation, void(const AZ::Vector3&)); @@ -666,20 +654,10 @@ namespace Blast MOCK_METHOD1(RotateAroundLocalZ, void(float)); MOCK_METHOD0(GetLocalRotation, AZ::Vector3()); MOCK_METHOD0(GetLocalRotationQuaternion, AZ::Quaternion()); - MOCK_METHOD1(SetScale, void(const AZ::Vector3&)); - MOCK_METHOD1(SetScaleX, void(float)); - MOCK_METHOD1(SetScaleY, void(float)); - MOCK_METHOD1(SetScaleZ, void(float)); - MOCK_METHOD0(GetScale, AZ::Vector3()); - MOCK_METHOD0(GetScaleX, float()); - MOCK_METHOD0(GetScaleY, float()); - MOCK_METHOD0(GetScaleZ, float()); - MOCK_METHOD1(SetLocalScale, void(const AZ::Vector3&)); - MOCK_METHOD1(SetLocalScaleX, void(float)); - MOCK_METHOD1(SetLocalScaleY, void(float)); - MOCK_METHOD1(SetLocalScaleZ, void(float)); MOCK_METHOD0(GetLocalScale, AZ::Vector3()); - MOCK_METHOD0(GetWorldScale, AZ::Vector3()); + MOCK_METHOD1(SetLocalUniformScale, void(float)); + MOCK_METHOD0(GetLocalUniformScale, float()); + MOCK_METHOD0(GetWorldUniformScale, float()); MOCK_METHOD0(GetParentId, AZ::EntityId()); MOCK_METHOD0(GetParent, TransformInterface*()); MOCK_METHOD1(SetParent, void(AZ::EntityId)); diff --git a/Gems/Camera/Code/CMakeLists.txt b/Gems/Camera/Code/CMakeLists.txt index 950ff451ff..703424416b 100644 --- a/Gems/Camera/Code/CMakeLists.txt +++ b/Gems/Camera/Code/CMakeLists.txt @@ -39,6 +39,10 @@ ly_add_target( Gem::Camera.Static ) +# clients and servers use the above module: +ly_create_alias(NAME Camera.Clients NAMESPACE Gem TARGETS Gem::Camera) +ly_create_alias(NAME Camera.Servers NAMESPACE Gem TARGETS Gem::Camera) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -62,4 +66,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::Camera.Static ) + # tools and builders use the above module. + ly_create_alias(NAME Camera.Tools NAMESPACE Gem TARGETS Gem::Camera.Editor) + ly_create_alias(NAME Camera.Builders NAMESPACE Gem TARGETS Gem::Camera.Editor) endif() diff --git a/Gems/CameraFramework/Code/CMakeLists.txt b/Gems/CameraFramework/Code/CMakeLists.txt index 1ec9dc0ad9..6b0d084e28 100644 --- a/Gems/CameraFramework/Code/CMakeLists.txt +++ b/Gems/CameraFramework/Code/CMakeLists.txt @@ -38,3 +38,9 @@ ly_add_target( PRIVATE Gem::CameraFramework.Static ) + +# Every kind of application uses the above target module. +ly_create_alias(NAME CameraFramework.Clients NAMESPACE Gem TARGETS Gem::CameraFramework) +ly_create_alias(NAME CameraFramework.Servers NAMESPACE Gem TARGETS Gem::CameraFramework) +ly_create_alias(NAME CameraFramework.Tools NAMESPACE Gem TARGETS Gem::CameraFramework) +ly_create_alias(NAME CameraFramework.Builders NAMESPACE Gem TARGETS Gem::CameraFramework) diff --git a/Gems/CertificateManager/Code/CMakeLists.txt b/Gems/CertificateManager/Code/CMakeLists.txt index 93e78bb86a..2307ebed40 100644 --- a/Gems/CertificateManager/Code/CMakeLists.txt +++ b/Gems/CertificateManager/Code/CMakeLists.txt @@ -41,3 +41,7 @@ ly_add_target( PRIVATE Gem::CertificateManager.Static ) + +# we'll load the above "Gem::CertificateManager" module in Clients and Servers +ly_create_alias(NAME CertificateManager.Clients NAMESPACE Gem TARGETS Gem::CertificateManager) +ly_create_alias(NAME CertificateManager.Servers NAMESPACE Gem TARGETS Gem::CertificateManager) diff --git a/Gems/CrashReporting/Code/CMakeLists.txt b/Gems/CrashReporting/Code/CMakeLists.txt index d52600ea9b..2d77d563d9 100644 --- a/Gems/CrashReporting/Code/CMakeLists.txt +++ b/Gems/CrashReporting/Code/CMakeLists.txt @@ -33,6 +33,11 @@ ly_add_target( AZ::CrashHandler ) +# Load the "Gem::CrashReporting" module in Clients and Servers +ly_create_alias(NAME CrashReporting.Clients NAMESPACE Gem TARGETS Gem::CrashReporting) +ly_create_alias(NAME CrashReporting.Servers NAMESPACE Gem TARGETS Gem::CrashReporting) + + ly_add_target( NAME CrashReporting.Uploader APPLICATION NAMESPACE AZ diff --git a/Gems/CustomAssetExample/Code/CMakeLists.txt b/Gems/CustomAssetExample/Code/CMakeLists.txt index 661b1950ce..3debe27919 100644 --- a/Gems/CustomAssetExample/Code/CMakeLists.txt +++ b/Gems/CustomAssetExample/Code/CMakeLists.txt @@ -22,6 +22,10 @@ ly_add_target( AZ::AzCore ) +# clients and servers use the above module. +ly_create_alias(NAME CustomAssetExample.Clients NAMESPACE Gem TARGETS CustomAssetExample) +ly_create_alias(NAME CustomAssetExample.Servers NAMESPACE Gem TARGETS CustomAssetExample) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME CustomAssetExample.Editor GEM_MODULE @@ -37,4 +41,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzCore AZ::AssetBuilderSDK ) + + # other tools use the above tools module: + ly_create_alias(NAME CustomAssetExample.Builders NAMESPACE Gem TARGETS CustomAssetExample.Editor) + ly_create_alias(NAME CustomAssetExample.Tools NAMESPACE Gem TARGETS CustomAssetExample.Editor) + endif() diff --git a/Gems/DebugDraw/Code/CMakeLists.txt b/Gems/DebugDraw/Code/CMakeLists.txt index 5759cdaff2..69488b1493 100644 --- a/Gems/DebugDraw/Code/CMakeLists.txt +++ b/Gems/DebugDraw/Code/CMakeLists.txt @@ -21,6 +21,9 @@ ly_add_target( Include BUILD_DEPENDENCIES PUBLIC + AZ::AtomCore + Gem::Atom_RPI.Public + Gem::Atom_Bootstrap.Headers Legacy::CryCommon ) @@ -39,6 +42,9 @@ ly_add_target( Gem::DebugDraw.Static ) +# servers do not need debug draw components, only clients +ly_create_alias(NAME DebugDraw.Clients NAMESPACE Gem TARGETS DebugDraw) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME DebugDraw.Editor GEM_MODULE @@ -51,9 +57,17 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Source PUBLIC Include + COMPILE_DEFINITIONS + PRIVATE + DEBUGDRAW_GEM_EDITOR=1 BUILD_DEPENDENCIES PRIVATE Gem::DebugDraw.Static AZ::AzToolsFramework ) + + # builders and tools use DebugDraw.Editor + ly_create_alias(NAME DebugDraw.Builders NAMESPACE Gem TARGETS DebugDraw.Editor) + ly_create_alias(NAME DebugDraw.Tools NAMESPACE Gem TARGETS DebugDraw.Editor) + endif() diff --git a/Gems/DebugDraw/Code/Source/DebugDrawObbComponent.h b/Gems/DebugDraw/Code/Source/DebugDrawObbComponent.h index 781786fc03..07436b577a 100644 --- a/Gems/DebugDraw/Code/Source/DebugDrawObbComponent.h +++ b/Gems/DebugDraw/Code/Source/DebugDrawObbComponent.h @@ -41,9 +41,8 @@ namespace DebugDraw , m_worldLocation(AZ::Vector3::CreateZero()) , m_owningEditorComponent(AZ::InvalidComponentId) , m_scale(AZ::Vector3(1.0f, 1.0f, 1.0f)) - { - m_obb.CreateFromPositionRotationAndHalfLengths(m_worldLocation, AZ::Quaternion::CreateIdentity(), AZ::Vector3::CreateOne()); - } + , m_obb(AZ::Obb::CreateFromPositionRotationAndHalfLengths(m_worldLocation, AZ::Quaternion::CreateIdentity(), AZ::Vector3::CreateOne())) + {} }; class DebugDrawObbComponent diff --git a/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.cpp b/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.cpp index 545dc7d2f9..1304c7b392 100644 --- a/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.cpp +++ b/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.cpp @@ -19,11 +19,6 @@ #include #include -#include - -#include -#include - #include "DebugDrawSystemComponent.h" // Editor specific @@ -37,6 +32,9 @@ #include #endif // DEBUGDRAW_GEM_EDITOR +#include +#include + namespace DebugDraw { void DebugDrawSystemComponent::Reflect(AZ::ReflectContext* context) @@ -96,7 +94,7 @@ namespace DebugDraw void DebugDrawSystemComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) { - (void)required; + required.push_back(AZ_CRC("RPISystem", 0xf2add773)); } void DebugDrawSystemComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) @@ -112,7 +110,7 @@ namespace DebugDraw { DebugDrawInternalRequestBus::Handler::BusConnect(); DebugDrawRequestBus::Handler::BusConnect(); - AZ::TickBus::Handler::BusConnect(); + AZ::Render::Bootstrap::NotificationBus::Handler::BusConnect(); #ifdef DEBUGDRAW_GEM_EDITOR AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusConnect(); @@ -125,7 +123,7 @@ namespace DebugDraw AzToolsFramework::EditorEntityContextNotificationBus::Handler::BusDisconnect(); #endif // DEBUGDRAW_GEM_EDITOR - AZ::TickBus::Handler::BusDisconnect(); + AZ::RPI::SceneNotificationBus::Handler::BusDisconnect(); DebugDrawRequestBus::Handler::BusDisconnect(); DebugDrawInternalRequestBus::Handler::BusDisconnect(); @@ -155,6 +153,13 @@ namespace DebugDraw } } + void DebugDrawSystemComponent::OnBootstrapSceneReady(AZ::RPI::Scene* scene) + { + AZ_Assert(scene, "Invalid scene received in OnBootstrapSceneReady"); + AZ::RPI::SceneNotificationBus::Handler::BusConnect(scene->GetId()); + AZ::Render::Bootstrap::NotificationBus::Handler::BusDisconnect(); + } + #ifdef DEBUGDRAW_GEM_EDITOR void DebugDrawSystemComponent::OnStopPlayInEditor() { @@ -255,16 +260,29 @@ namespace DebugDraw } #endif // DEBUGDRAW_GEM_EDITOR - void DebugDrawSystemComponent::OnTick([[maybe_unused]] float deltaTime, AZ::ScriptTimePoint time) + void DebugDrawSystemComponent::OnBeginPrepareRender() { + AZ::ScriptTimePoint time; + AZ::TickRequestBus::BroadcastResult(time, &AZ::TickRequestBus::Events::GetTimeAtCurrentTick); m_currentTime = time.GetSeconds(); - OnTickAabbs(); - OnTickLines(); - OnTickObbs(); - OnTickRays(); - OnTickSpheres(); - OnTickText(); + AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus; + AzFramework::DebugDisplayRequestBus::Bind( + debugDisplayBus, AzFramework::g_defaultSceneEntityDebugDisplayId); + AZ_Assert(debugDisplayBus, "Invalid DebugDisplayRequestBus."); + + AzFramework::DebugDisplayRequests* debugDisplay = + AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus); + + if (debugDisplay) + { + OnTickAabbs(*debugDisplay); + OnTickLines(*debugDisplay); + OnTickObbs(*debugDisplay); + OnTickRays(*debugDisplay); + OnTickSpheres(*debugDisplay); + OnTickText(*debugDisplay); + } } template @@ -277,7 +295,7 @@ namespace DebugDraw vectorToExpire.erase(removalCondition, std::end(vectorToExpire)); } - void DebugDrawSystemComponent::OnTickAabbs() + void DebugDrawSystemComponent::OnTickAabbs(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeAabbsMutex); @@ -295,17 +313,14 @@ namespace DebugDraw AZ::Vector3 currentCenter = transformedAabb.GetCenter(); transformedAabb.Set(transformedAabb.GetMin() - currentCenter + aabbElement.m_worldLocation, transformedAabb.GetMax() - currentCenter + aabbElement.m_worldLocation); } - - ColorB lyColor(aabbElement.m_color.ToU32()); - Vec3 worldLocation(AZVec3ToLYVec3(aabbElement.m_worldLocation)); - AABB lyAABB(AZAabbToLyAABB(transformedAabb)); - gEnv->pRenderer->GetIRenderAuxGeom()->DrawAABB(lyAABB, false, lyColor, EBoundingBoxDrawStyle::eBBD_Extremes_Color_Encoded); + debugDisplay.SetColor(aabbElement.m_color); + debugDisplay.DrawSolidBox(transformedAabb.GetMin(), transformedAabb.GetMax()); } removeExpiredDebugElementsFromVector(m_activeAabbs); } - void DebugDrawSystemComponent::OnTickLines() + void DebugDrawSystemComponent::OnTickLines(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeLinesMutex); size_t numActiveLines = m_activeLines.size(); @@ -339,26 +354,14 @@ namespace DebugDraw &AZ::TransformBus::Events::GetWorldTranslation); } - Vec3 start(AZVec3ToLYVec3(lineElement.m_startWorldLocation)); - Vec3 end(AZVec3ToLYVec3(lineElement.m_endWorldLocation)); - ColorB lyColor(lineElement.m_color.ToU32()); - - m_batchPoints.push_back(start); - m_batchPoints.push_back(end); - - m_batchColors.push_back(lyColor); - m_batchColors.push_back(lyColor); - } - - if (!m_batchPoints.empty()) - { - gEnv->pRenderer->GetIRenderAuxGeom()->DrawLines(m_batchPoints.begin(), m_batchPoints.size(), m_batchColors.begin(), 1.0f); + debugDisplay.SetColor(lineElement.m_color); + debugDisplay.DrawLine(lineElement.m_startWorldLocation, lineElement.m_endWorldLocation); } removeExpiredDebugElementsFromVector(m_activeLines); } - void DebugDrawSystemComponent::OnTickObbs() + void DebugDrawSystemComponent::OnTickObbs(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeObbsMutex); @@ -382,20 +385,18 @@ namespace DebugDraw transformedObb.SetHalfLength(i, obbElement.m_scale.GetElement(i)); } } - - obbElement.m_worldLocation = transformedObb.GetPosition(); - - ColorB lyColor(obbElement.m_color.ToU32()); - Vec3 worldLocation(AZVec3ToLYVec3(obbElement.m_worldLocation)); - OBB lyOBB(AZObbToLyOBB(transformedObb)); - lyOBB.c = Vec3(0.f); - gEnv->pRenderer->GetIRenderAuxGeom()->DrawOBB(lyOBB, worldLocation, false, lyColor, EBoundingBoxDrawStyle::eBBD_Extremes_Color_Encoded); + else + { + obbElement.m_worldLocation = transformedObb.GetPosition(); + } + debugDisplay.SetColor(obbElement.m_color); + debugDisplay.DrawSolidOBB(obbElement.m_worldLocation, transformedObb.GetAxisX(), transformedObb.GetAxisY(), transformedObb.GetAxisZ(), transformedObb.GetHalfLengths()); } removeExpiredDebugElementsFromVector(m_activeObbs); } - void DebugDrawSystemComponent::OnTickRays() + void DebugDrawSystemComponent::OnTickRays(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeRaysMutex); @@ -415,22 +416,20 @@ namespace DebugDraw rayElement.m_worldDirection = (endWorldLocation - rayElement.m_worldLocation); } - ColorB lyColor(rayElement.m_color.ToU32()); - Vec3 start(AZVec3ToLYVec3(rayElement.m_worldLocation)); - Vec3 end(AZVec3ToLYVec3(endWorldLocation)); - Vec3 direction(AZVec3ToLYVec3(rayElement.m_worldDirection)); float conePercentHeight = 0.5f; - float coneHeight = direction.GetLength() * conePercentHeight; - Vec3 coneBaseLocation = end - direction * conePercentHeight; + float coneHeight = rayElement.m_worldDirection.GetLength() * conePercentHeight; + AZ::Vector3 coneBaseLocation = endWorldLocation - rayElement.m_worldDirection * conePercentHeight; float coneRadius = AZ::GetClamp(coneHeight * 0.07f, 0.05f, 0.2f); - gEnv->pRenderer->GetIRenderAuxGeom()->DrawLine(start, lyColor, coneBaseLocation, lyColor, 5.0f); - gEnv->pRenderer->GetIRenderAuxGeom()->DrawCone(coneBaseLocation, direction, coneRadius, coneHeight, lyColor, false); + debugDisplay.SetColor(rayElement.m_color); + debugDisplay.SetLineWidth(5.0f); + debugDisplay.DrawLine(rayElement.m_worldLocation, coneBaseLocation); + debugDisplay.DrawSolidCone(coneBaseLocation, rayElement.m_worldDirection, coneRadius, coneHeight, false); } removeExpiredDebugElementsFromVector(m_activeRays); } - void DebugDrawSystemComponent::OnTickSpheres() + void DebugDrawSystemComponent::OnTickSpheres(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeSpheresMutex); @@ -442,19 +441,14 @@ namespace DebugDraw { AZ::TransformBus::EventResult(sphereElement.m_worldLocation, sphereElement.m_targetEntityId, &AZ::TransformBus::Events::GetWorldTranslation); } - - if (gEnv->pRenderer) - { - ColorB lyColor(sphereElement.m_color.ToU32()); - Vec3 worldLocation(AZVec3ToLYVec3(sphereElement.m_worldLocation)); - gEnv->pRenderer->GetIRenderAuxGeom()->DrawSphere(worldLocation, sphereElement.m_radius, lyColor, true); - } + debugDisplay.SetColor(sphereElement.m_color); + debugDisplay.DrawBall(sphereElement.m_worldLocation, sphereElement.m_radius, true); } removeExpiredDebugElementsFromVector(m_activeSpheres); } - void DebugDrawSystemComponent::OnTickText() + void DebugDrawSystemComponent::OnTickText(AzFramework::DebugDisplayRequests& debugDisplay) { AZStd::lock_guard locker(m_activeTextsMutex); @@ -471,30 +465,20 @@ namespace DebugDraw #endif // DEBUGDRAW_GEM_EDITOR // Draw text elements and remove any that are expired - AZStd::unordered_map textPerEntityCount; int numScreenTexts = 0; AZ::EntityId lastTargetEntityId; for (auto& textElement : m_activeTexts) { + const AZ::Color textColor = needsGammaConversion ? textElement.m_color.GammaToLinear() : textElement.m_color; + debugDisplay.SetColor(textColor); if (textElement.m_drawMode == DebugDrawTextElement::DrawMode::OnScreen) { - const AZ::Color textColor = needsGammaConversion ? textElement.m_color.GammaToLinear() : textElement.m_color; - gEnv->pRenderer->GetIRenderAuxGeom()->Draw3dLabel(Vec3(20.f, 20.f + ((float)numScreenTexts * 15.0f), 0.5f), 1.4f, AZColorToLYColorF(textColor), textElement.m_text.c_str()); + debugDisplay.Draw2dTextLabel(100.0f, 20.f + ((float)numScreenTexts * 15.0f), 1.4f, textElement.m_text.c_str() ); ++numScreenTexts; } else if (textElement.m_drawMode == DebugDrawTextElement::DrawMode::InWorld) { - SDrawTextInfo ti; - ti.xscale = ti.yscale = 1.4f; - ti.flags = eDrawText_2D | eDrawText_FixedSize | eDrawText_Monospace | eDrawText_Center; - - const AZ::Color textColor = needsGammaConversion ? textElement.m_color.GammaToLinear() : textElement.m_color; - ti.color[0] = textColor.GetR(); - ti.color[1] = textColor.GetG(); - ti.color[2] = textColor.GetB(); - ti.color[3] = textColor.GetA(); - AZ::Vector3 worldLocation; if (textElement.m_targetEntityId.IsValid()) { @@ -507,32 +491,7 @@ namespace DebugDraw worldLocation = textElement.m_worldLocation; } - const CCamera& camera = gEnv->pSystem->GetViewCamera(); - const AZ::Vector3 cameraTranslation = LYVec3ToAZVec3(camera.GetPosition()); - Vec3 lyWorldLoc = AZVec3ToLYVec3(worldLocation); - Vec3 screenPos(0.f); - if (camera.Project(lyWorldLoc, screenPos, Vec2i(0, 0), Vec2i(0, 0))) - { - // Handle spacing for world text so it doesn't draw on top of each other - // This works for text drawing on entities (considered one block), but not for world text. - // World text will get handled when we have screen-aware positioning of text elements - if (textElement.m_targetEntityId.IsValid()) - { - auto iter = textPerEntityCount.find(textElement.m_targetEntityId); - if (iter != textPerEntityCount.end()) - { - AZ::u32 count = iter->second; - screenPos.y += ((float)count * 15.0f); - iter->second = count + 1; - } - else - { - auto newEntry = textPerEntityCount.insert_key(textElement.m_targetEntityId); - newEntry.first->second = 1; - } - } - gEnv->pRenderer->GetIRenderAuxGeom()->Draw3dLabel(Vec3(screenPos.x, screenPos.y, 0.5f), 1.4f, AZColorToLYColorF(textColor), textElement.m_text.c_str()); - } + debugDisplay.DrawTextLabel(worldLocation, 1.4f, textElement.m_text.c_str() ); } } @@ -550,9 +509,9 @@ namespace DebugDraw CreateLineEntryForComponent(lineComponent->GetEntityId(), lineComponent->m_element); } #ifdef DEBUGDRAW_GEM_EDITOR - else if (EditorDebugDrawLineComponent* lineComponent = azrtti_cast(component)) + else if (EditorDebugDrawLineComponent* editorLineComponent = azrtti_cast(component)) { - CreateLineEntryForComponent(lineComponent->GetEntityId(), lineComponent->m_element); + CreateLineEntryForComponent(editorLineComponent->GetEntityId(), editorLineComponent->m_element); } #endif // DEBUGDRAW_GEM_EDITOR else if (DebugDrawRayComponent* rayComponent = azrtti_cast(component)) @@ -560,9 +519,9 @@ namespace DebugDraw CreateRayEntryForComponent(rayComponent->GetEntityId(), rayComponent->m_element); } #ifdef DEBUGDRAW_GEM_EDITOR - else if (EditorDebugDrawRayComponent* rayComponent = azrtti_cast(component)) + else if (EditorDebugDrawRayComponent* editorRayComponent = azrtti_cast(component)) { - CreateRayEntryForComponent(rayComponent->GetEntityId(), rayComponent->m_element); + CreateRayEntryForComponent(editorRayComponent->GetEntityId(), editorRayComponent->m_element); } #endif // DEBUGDRAW_GEM_EDITOR else if (DebugDrawSphereComponent* sphereComponent = azrtti_cast(component)) @@ -570,9 +529,9 @@ namespace DebugDraw CreateSphereEntryForComponent(sphereComponent->GetEntityId(), sphereComponent->m_element); } #ifdef DEBUGDRAW_GEM_EDITOR - else if (EditorDebugDrawSphereComponent* sphereComponent = azrtti_cast(component)) + else if (EditorDebugDrawSphereComponent* editorSphereComponent = azrtti_cast(component)) { - CreateSphereEntryForComponent(sphereComponent->GetEntityId(), sphereComponent->m_element); + CreateSphereEntryForComponent(editorSphereComponent->GetEntityId(), editorSphereComponent->m_element); } #endif // DEBUGDRAW_GEM_EDITOR else if (DebugDrawObbComponent* obbComponent = azrtti_cast(component)) @@ -581,9 +540,9 @@ namespace DebugDraw } #ifdef DEBUGDRAW_GEM_EDITOR - else if (EditorDebugDrawObbComponent* obbComponent = azrtti_cast(component)) + else if (EditorDebugDrawObbComponent* editorObbComponent = azrtti_cast(component)) { - CreateObbEntryForComponent(obbComponent->GetEntityId(), obbComponent->m_element); + CreateObbEntryForComponent(editorObbComponent->GetEntityId(), editorObbComponent->m_element); } #endif // DEBUGDRAW_GEM_EDITOR @@ -593,9 +552,9 @@ namespace DebugDraw } #ifdef DEBUGDRAW_GEM_EDITOR - else if (EditorDebugDrawTextComponent* textComponent = azrtti_cast(component)) + else if (EditorDebugDrawTextComponent* editorTextComponent = azrtti_cast(component)) { - CreateTextEntryForComponent(textComponent->GetEntityId(), textComponent->m_element); + CreateTextEntryForComponent(editorTextComponent->GetEntityId(), editorTextComponent->m_element); } #endif // DEBUGDRAW_GEM_EDITOR } diff --git a/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.h b/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.h index 32efa4cfc2..5ea02d7baa 100644 --- a/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.h +++ b/Gems/DebugDraw/Code/Source/DebugDrawSystemComponent.h @@ -32,6 +32,9 @@ #include #endif // DEBUGDRAW_GEM_EDITOR +#include +#include + namespace DebugDraw { // DebugDraw elements that don't have corresponding component representations yet @@ -61,10 +64,11 @@ namespace DebugDraw class DebugDrawSystemComponent : public AZ::Component - , public AZ::TickBus::Handler , public AZ::EntityBus::MultiHandler , protected DebugDrawRequestBus::Handler , protected DebugDrawInternalRequestBus::Handler + , public AZ::RPI::SceneNotificationBus::Handler + , public AZ::Render::Bootstrap::NotificationBus::Handler #ifdef DEBUGDRAW_GEM_EDITOR , protected AzToolsFramework::EditorEntityContextNotificationBus::Handler @@ -113,20 +117,22 @@ namespace DebugDraw void Activate() override; void Deactivate() override; - // TickBus - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - int GetTickOrder() override { return AZ::ComponentTickBus::TICK_DEFAULT; } + // SceneNotificationBus + void OnBeginPrepareRender() override; + + // AZ::Render::Bootstrap::NotificationBus + void OnBootstrapSceneReady(AZ::RPI::Scene* scene); // EntityBus void OnEntityDeactivated(const AZ::EntityId& entityId) override; // Ticking functions for drawing debug elements - void OnTickAabbs(); - void OnTickLines(); - void OnTickObbs(); - void OnTickRays(); - void OnTickSpheres(); - void OnTickText(); + void OnTickAabbs(AzFramework::DebugDisplayRequests& debugDisplay); + void OnTickLines(AzFramework::DebugDisplayRequests& debugDisplay); + void OnTickObbs(AzFramework::DebugDisplayRequests& debugDisplay); + void OnTickRays(AzFramework::DebugDisplayRequests& debugDisplay); + void OnTickSpheres(AzFramework::DebugDisplayRequests& debugDisplay); + void OnTickText(AzFramework::DebugDisplayRequests& debugDisplay); // Element creation functions, used when DebugDraw components register themselves void CreateAabbEntryForComponent(const AZ::EntityId& componentEntityId, const DebugDrawAabbElement& element); @@ -154,7 +160,7 @@ namespace DebugDraw double m_currentTime; - AZStd::vector m_batchPoints; - AZStd::vector m_batchColors; + AZStd::vector m_batchPoints; + AZStd::vector m_batchColors; }; } diff --git a/Gems/DebugDraw/Code/Source/DebugDraw_precompiled.h b/Gems/DebugDraw/Code/Source/DebugDraw_precompiled.h index 3a14d45520..290082eb65 100644 --- a/Gems/DebugDraw/Code/Source/DebugDraw_precompiled.h +++ b/Gems/DebugDraw/Code/Source/DebugDraw_precompiled.h @@ -11,6 +11,3 @@ */ #pragma once - -#include // Many CryCommon files require that this is included first. -#include diff --git a/AutomatedTesting/Gem/Code/Platform/Linux/runtime_dependencies.cmake b/Gems/DevTextures/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/Linux/runtime_dependencies.cmake rename to Gems/DevTextures/CMakeLists.txt diff --git a/Gems/EMotionFX/Code/CMakeLists.txt b/Gems/EMotionFX/Code/CMakeLists.txt index b90902a948..bc0268cd60 100644 --- a/Gems/EMotionFX/Code/CMakeLists.txt +++ b/Gems/EMotionFX/Code/CMakeLists.txt @@ -36,10 +36,10 @@ ly_add_target( AZ::AzCore AZ::AzFramework Legacy::CryCommon - Gem::LmbrCentral PUBLIC AZ::AtomCore Gem::Atom_RPI.Public + Gem::LmbrCentral COMPILE_DEFINITIONS PUBLIC EMFX_DEVELOPMENT_BUILD @@ -67,6 +67,10 @@ ly_add_target( Gem::LmbrCentral ) +# Clients and servers use the above EMotionFX module +ly_create_alias(NAME EMotionFX.Clients NAMESPACE Gem TARGETS EMotionFX) +ly_create_alias(NAME EMotionFX.Servers NAMESPACE Gem TARGETS EMotionFX) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -129,6 +133,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) + + # builders and tools use the above EMotionFX.Editor module + ly_create_alias(NAME EMotionFX.Builders NAMESPACE Gem TARGETS EMotionFX.Editor) + ly_create_alias(NAME EMotionFX.Tools NAMESPACE Gem TARGETS EMotionFX.Editor) + endif() ################################################################################ diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.cpp b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.cpp index fae3ee742c..bd0d998737 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.cpp @@ -251,7 +251,7 @@ namespace EMotionFX return false; } - Physics::ShapeConfigurationPair newCollider; + AzPhysics::ShapeColliderPair newCollider; // Either in case the contents got specified via a command parameter or in case of redo. if (m_contents) @@ -263,7 +263,7 @@ namespace EMotionFX else if (m_colliderType) { // Create new collider. - AZ::Outcome colliderOutcome = PhysicsSetup::CreateColliderByType(m_colliderType.value(), outResult); + AZ::Outcome colliderOutcome = PhysicsSetup::CreateColliderByType(m_colliderType.value(), outResult); if (!colliderOutcome.IsSuccess()) { return false; @@ -367,7 +367,7 @@ namespace EMotionFX return false; } - const Physics::ShapeConfigurationPair& collider = nodeConfig->m_shapes[m_oldColliderIndex.value()]; + const AzPhysics::ShapeColliderPair& collider = nodeConfig->m_shapes[m_oldColliderIndex.value()]; m_contents = MCore::ReflectionSerializer::Serialize(&collider).GetValue(); CommandColliderHelpers::RemoveCollider(m_actorId, m_jointName, m_configType, m_oldColliderIndex.value(), /*commandGroup*/ nullptr, true); @@ -472,7 +472,7 @@ namespace EMotionFX AZ_UNUSED(parameters); Actor* actor = nullptr; - Physics::ShapeConfigurationPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult); + AzPhysics::ShapeColliderPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult); if (!shapeConfigPair) { return false; @@ -524,7 +524,7 @@ namespace EMotionFX AZ_UNUSED(parameters); Actor* actor = nullptr; - Physics::ShapeConfigurationPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult); + AzPhysics::ShapeColliderPair* shapeConfigPair = GetShapeConfigPair(&actor, outResult); if (!shapeConfigPair) { return false; @@ -606,7 +606,7 @@ namespace EMotionFX return true; } - Physics::ShapeConfigurationPair* CommandAdjustCollider::GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const + AzPhysics::ShapeColliderPair* CommandAdjustCollider::GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const { Actor* actor = GetActor(this, outResult); if (!actor) @@ -647,7 +647,7 @@ namespace EMotionFX return nullptr; } - Physics::ShapeConfigurationPair& shapeConfigPair = nodeConfig->m_shapes[m_index.value()]; + AzPhysics::ShapeColliderPair& shapeConfigPair = nodeConfig->m_shapes[m_index.value()]; return &shapeConfigPair; } diff --git a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.h b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.h index f0d20ce5f3..bb84e955ef 100644 --- a/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.h +++ b/Gems/EMotionFX/Code/EMotionFX/CommandSystem/Source/ColliderCommands.h @@ -159,7 +159,7 @@ namespace EMotionFX static const char* s_commandName; private: - Physics::ShapeConfigurationPair* GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const; + AzPhysics::ShapeColliderPair* GetShapeConfigPair(Actor** outActor, AZStd::string& outResult) const; AZStd::optional m_configType; AZStd::optional m_index; diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp index 0aef3f9d4f..b2389a3086 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.cpp @@ -1157,7 +1157,7 @@ namespace MCommon void RenderUtil::RenderSphere(const AZ::Vector3& position, float radius, const MCore::RGBAColor& color) { // setup the world space matrix of the sphere - AZ::Transform sphereTransform = AZ::Transform::CreateScale(AZ::Vector3(radius, radius, radius)); + AZ::Transform sphereTransform = AZ::Transform::CreateUniformScale(radius); sphereTransform.SetTranslation(position); // render the sphere @@ -1297,18 +1297,6 @@ namespace MCommon } - // render a cube - void RenderUtil::RenderCube(const AZ::Vector3& size, const AZ::Vector3& position, const MCore::RGBAColor& color) - { - // setup the world space matrix of the cube - AZ::Transform cubeTransform = AZ::Transform::CreateScale(size); - cubeTransform.SetTranslation(position); - - // render the cube - RenderCube(color, cubeTransform); - } - - // construct the arrow head mesh used for rendering RenderUtil::UtilMesh* RenderUtil::CreateArrowHead(float height, float radius) { diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.h b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.h index 86e41e56ef..b724c28720 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.h +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/RenderUtil.h @@ -297,14 +297,6 @@ namespace MCommon */ void RenderCylinder(float baseRadius, float topRadius, float length, const AZ::Vector3& position, const AZ::Vector3& direction, const MCore::RGBAColor& color); - /** - * Render a cube. - * @param size The size of the cube. - * @param position The position of the center of the cube. - * @param color The desired cube color. - */ - void RenderCube(const AZ::Vector3& size, const AZ::Vector3& position, const MCore::RGBAColor& color); - /** * Render a triangle (CCW). * @param v1 The first corner of the triangle. diff --git a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/ScaleManipulator.cpp b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/ScaleManipulator.cpp index 32b779f385..54ccd00535 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/ScaleManipulator.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Rendering/Common/ScaleManipulator.cpp @@ -169,7 +169,6 @@ namespace MCommon if (mXAxisVisible) { renderUtil->RenderLine(mPosition, mPosition + mSignX * AZ::Vector3(mScaledSize.GetX() + 0.5f * mBaseRadius, 0.0f, 0.0f), xAxisColor); - //renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignX * Vector3(mScaledSize.x+mBaseRadius, 0, 0), ManipulatorColors::mRed ); AZ::Vector3 quadPos = MCore::Project(mPosition + mSignX * AZ::Vector3(mScaledSize.GetX() + mBaseRadius, 0, 0), camera->GetViewProjMatrix(), screenWidth, screenHeight); renderUtil->RenderBorderedRect(static_cast(quadPos.GetX() - 2.0f), static_cast(quadPos.GetX() + 3.0f), static_cast(quadPos.GetY() - 2.0f), static_cast(quadPos.GetY() + 3.0f), ManipulatorColors::mRed, ManipulatorColors::mRed); @@ -186,7 +185,6 @@ namespace MCommon if (mYAxisVisible) { renderUtil->RenderLine(mPosition, mPosition + mSignY * AZ::Vector3(0.0f, mScaledSize.GetY(), 0.0f), yAxisColor); - //renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignY * Vector3(0, mScaledSize.y+0.5*mBaseRadius, 0), ManipulatorColors::mGreen ); AZ::Vector3 quadPos = MCore::Project(mPosition + mSignY * AZ::Vector3(0, mScaledSize.GetY() + 0.5f * mBaseRadius, 0), camera->GetViewProjMatrix(), screenWidth, screenHeight); renderUtil->RenderBorderedRect(static_cast(quadPos.GetX() - 2.0f), static_cast(quadPos.GetX() + 3.0f), static_cast(quadPos.GetY() - 2.0f), static_cast(quadPos.GetY() + 3.0f), ManipulatorColors::mGreen, ManipulatorColors::mGreen); @@ -203,7 +201,6 @@ namespace MCommon if (mZAxisVisible) { renderUtil->RenderLine(mPosition, mPosition + mSignZ * AZ::Vector3(0.0f, 0.0f, mScaledSize.GetZ()), zAxisColor); - //renderUtil->RenderCube( Vector3(mBaseRadius, mBaseRadius, mBaseRadius), mPosition + mSignZ * Vector3(0, 0, mScaledSize.z+0.5*mBaseRadius), ManipulatorColors::mBlue ); AZ::Vector3 quadPos = MCore::Project(mPosition + mSignZ * AZ::Vector3(0, 0, mScaledSize.GetZ() + 0.5f * mBaseRadius), camera->GetViewProjMatrix(), screenWidth, screenHeight); renderUtil->RenderBorderedRect(static_cast(quadPos.GetX() - 2.0f), static_cast(quadPos.GetX() + 3.0f), static_cast(quadPos.GetY() - 2.0f), static_cast(quadPos.GetY() + 3.0f), ManipulatorColors::mBlue, ManipulatorColors::mBlue); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp index e8e5afb90f..cbe3e73cb3 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp @@ -198,13 +198,13 @@ namespace EMotionFX return m_config.m_simulatedObjectColliderConfig; } - AZ::Outcome PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId) + AZ::Outcome PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId) { AZStd::string outResult; return CreateColliderByType(typeId, outResult); } - AZ::Outcome PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult) + AZ::Outcome PhysicsSetup::CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult) { if (typeId.IsNull()) { @@ -227,14 +227,16 @@ namespace EMotionFX return AZ::Failure(); } - Physics::ShapeConfiguration* shapeConfig = reinterpret_cast(classData->m_factory->Create(classData->m_name)); + AZStd::shared_ptr shapeConfig( + reinterpret_cast(classData->m_factory->Create(classData->m_name))); + if (!shapeConfig) { outResult = AZStd::string::format("Could not create collider with type '%s'.", typeId.ToString().c_str()); return AZ::Failure(); } - Physics::ShapeConfigurationPair pair(AZStd::make_shared(), shapeConfig); + AzPhysics::ShapeColliderPair pair(AZStd::make_shared(), shapeConfig); if (pair.first->m_materialSelection.GetMaterialIdsAssignedToSlots().empty()) { pair.first->m_materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); @@ -242,7 +244,7 @@ namespace EMotionFX return AZ::Success(pair); } - void PhysicsSetup::AutoSizeCollider(Physics::ShapeConfigurationPair& collider, const Actor* actor, const Node* joint) + void PhysicsSetup::AutoSizeCollider(AzPhysics::ShapeColliderPair& collider, const Actor* actor, const Node* joint) { if (!collider.second || !actor || !joint) { @@ -417,7 +419,7 @@ namespace EMotionFX nodeConfig = &hitDetectionConfig.m_nodes.back(); } - Physics::ShapeConfigurationList& collisionShapes = nodeConfig->m_shapes; + AzPhysics::ShapeColliderPairList& collisionShapes = nodeConfig->m_shapes; Physics::ColliderConfiguration* colliderConfig = aznew Physics::ColliderConfiguration(); colliderConfig->m_position = position; diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.h b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.h index 4ff925739a..1da80faa34 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.h @@ -68,9 +68,9 @@ namespace EMotionFX void OptimizeForServer(); - static AZ::Outcome CreateColliderByType(const AZ::TypeId& typeId); - static AZ::Outcome CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult); - static void AutoSizeCollider(Physics::ShapeConfigurationPair& collider, const Actor* actor, const Node* node); + static AZ::Outcome CreateColliderByType(const AZ::TypeId& typeId); + static AZ::Outcome CreateColliderByType(const AZ::TypeId& typeId, AZStd::string& outResult); + static void AutoSizeCollider(AzPhysics::ShapeColliderPair& collider, const Actor* actor, const Node* node); static void Reflect(AZ::ReflectContext* context); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.cpp index 7a219b5ff3..0edc6ebb38 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.cpp @@ -51,7 +51,7 @@ namespace EMotionFX m_collisionObjects.reserve(3); } - void SpringSolver::CreateCollider(AZ::u32 skeletonJointIndex, const Physics::ShapeConfigurationPair& shapePair) + void SpringSolver::CreateCollider(AZ::u32 skeletonJointIndex, const AzPhysics::ShapeColliderPair& shapePair) { const Physics::ShapeConfiguration* shapeConfig = shapePair.second.get(); if (!shapeConfig) @@ -104,7 +104,7 @@ namespace EMotionFX bool colliderFound = false; for (const auto& nodeConfig : colliderSetup.m_nodes) { - for (const Physics::ShapeConfigurationPair& shapePair : nodeConfig.m_shapes) + for (const AzPhysics::ShapeColliderPair& shapePair : nodeConfig.m_shapes) { if (shapePair.first->m_tag == colliderTag) { diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.h b/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.h index 5843ea02be..ca45343a6b 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.h +++ b/Gems/EMotionFX/Code/EMotionFX/Source/SpringSolver.h @@ -87,7 +87,7 @@ namespace EMotionFX AZ::Vector3 m_end = AZ::Vector3::CreateZero(); /**< The end position of the primitive. In case of a sphere this is ignored. */ float m_radius = 1.0f; /**< The radius or thickness. */ float m_scaledRadius = 1.0f; /**< The scaled radius value, scaled by the joint's world space transform. */ - const Physics::ShapeConfigurationPair* m_shapePair = nullptr; + const AzPhysics::ShapeColliderPair* m_shapePair = nullptr; }; struct EMFX_API InitSettings @@ -151,7 +151,7 @@ namespace EMotionFX private: void InitColliders(const InitSettings& initSettings); - void CreateCollider(AZ::u32 skeletonJointIndex, const Physics::ShapeConfigurationPair& shapePair); + void CreateCollider(AZ::u32 skeletonJointIndex, const AzPhysics::ShapeColliderPair& shapePair); void InitColliderFromColliderSetupShape(CollisionObject& collider); void InitCollidersFromColliderSetupShapes(); bool RecursiveAddJoint(const SimulatedJoint* joint, size_t parentParticleIndex); diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/Transform.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/Transform.cpp index b2322b5379..e3195beba9 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/Transform.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/Transform.cpp @@ -183,7 +183,7 @@ namespace EMotionFX { #ifndef EMFX_SCALE_DISABLED mPosition = transform.GetTranslation(); - mScale = transform.GetScale(); + mScale = AZ::Vector3(transform.GetUniformScale()); mRotation = transform.GetRotation(); #else mPosition = transform.GetTranslation(); diff --git a/Gems/EMotionFX/Code/MCore/Source/AzCoreConversions.h b/Gems/EMotionFX/Code/MCore/Source/AzCoreConversions.h index 519d44dace..fdead82491 100644 --- a/Gems/EMotionFX/Code/MCore/Source/AzCoreConversions.h +++ b/Gems/EMotionFX/Code/MCore/Source/AzCoreConversions.h @@ -58,7 +58,7 @@ namespace MCore AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation(emfxTransform.mRotation, emfxTransform.mPosition); EMFX_SCALECODE ( - transform.MultiplyByScale(emfxTransform.mScale); + transform.MultiplyByUniformScale(emfxTransform.mScale.GetMaxElement()); ) return transform; } @@ -386,7 +386,7 @@ namespace MCore AZ::Transform result; result.SetTranslation(translation); result.SetRotation(rotation); - result.SetScale(scale); + result.SetUniformScale(scale.GetMaxElement()); return result; } diff --git a/Gems/EMotionFX/Code/MCore/Source/OBB.cpp b/Gems/EMotionFX/Code/MCore/Source/OBB.cpp index bb73f9413b..e7a0011684 100644 --- a/Gems/EMotionFX/Code/MCore/Source/OBB.cpp +++ b/Gems/EMotionFX/Code/MCore/Source/OBB.cpp @@ -96,9 +96,9 @@ namespace MCore // create the AABB of (box1 in space of box0) const AZ::Transform& mtx = _1in0.mRotation; - AZ::Vector3 transformedAxisX = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisX())); - AZ::Vector3 transformedAxisY = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisY())); - AZ::Vector3 transformedAxisZ = mtx.GetScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisZ())); + AZ::Vector3 transformedAxisX = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisX())); + AZ::Vector3 transformedAxisY = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisY())); + AZ::Vector3 transformedAxisZ = mtx.GetUniformScale() * (mtx.GetRotation().GetConjugate().TransformVector(AZ::Vector3::CreateAxisZ())); float f = transformedAxisX.GetAbs().Dot(mExtents) - box.mExtents.GetX(); if (f > _1in0.mCenter.GetX()) diff --git a/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.cpp b/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.cpp index f6c196b23e..bd013da767 100644 --- a/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.cpp @@ -266,7 +266,7 @@ namespace EMotionFX connect(this, &AzQtComponents::Card::contextMenuRequested, this, &ColliderWidget::OnCardContextMenu); } - void ColliderWidget::Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationPair& collider) + void ColliderWidget::Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPair& collider) { m_actor = actor; m_joint = joint; @@ -276,7 +276,7 @@ namespace EMotionFX if (!collider.first || !collider.second) { m_editor->ClearInstances(true); - m_collider = Physics::ShapeConfigurationPair(); + m_collider = AzPhysics::ShapeColliderPair(); return; } @@ -520,7 +520,7 @@ namespace EMotionFX CommandSystem::GetCommandManager()->RemoveCommandCallback(m_commandCallback, /*delFromMem=*/true); } - void ColliderContainerWidget::Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationList& colliders, AZ::SerializeContext* serializeContext) + void ColliderContainerWidget::Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPairList& colliders, AZ::SerializeContext* serializeContext) { m_actor = actor; m_joint = joint; @@ -557,7 +557,7 @@ namespace EMotionFX for (size_t i = numColliders; i < numAvailableColliderWidgets; ++i) { m_colliderWidgets[i]->hide(); - m_colliderWidgets[i]->Update(nullptr, nullptr, MCORE_INVALIDINDEX32, PhysicsSetup::ColliderConfigType::Unknown, Physics::ShapeConfigurationPair()); + m_colliderWidgets[i]->Update(nullptr, nullptr, MCORE_INVALIDINDEX32, PhysicsSetup::ColliderConfigType::Unknown, AzPhysics::ShapeColliderPair()); } } @@ -571,7 +571,7 @@ namespace EMotionFX void ColliderContainerWidget::Reset() { - Update(nullptr, nullptr, PhysicsSetup::ColliderConfigType::Unknown, Physics::ShapeConfigurationList(), nullptr); + Update(nullptr, nullptr, PhysicsSetup::ColliderConfigType::Unknown, AzPhysics::ShapeColliderPairList(), nullptr); } void ColliderContainerWidget::contextMenuEvent(QContextMenuEvent* event) @@ -614,7 +614,7 @@ namespace EMotionFX return QWidget::sizeHint() + QSize(0, s_layoutSpacing); } - void ColliderContainerWidget::RenderColliders(const Physics::ShapeConfigurationList& colliders, + void ColliderContainerWidget::RenderColliders(const AzPhysics::ShapeColliderPairList& colliders, const ActorInstance* actorInstance, const Node* node, EMStudio::EMStudioPlugin::RenderInfo* renderInfo, @@ -704,7 +704,7 @@ namespace EMotionFX if (joint) { const bool jointSelected = selectedJointIndices.empty() || selectedJointIndices.find(joint->GetNodeIndex()) != selectedJointIndices.end(); - const Physics::ShapeConfigurationList& colliders = nodeConfig.m_shapes; + const AzPhysics::ShapeColliderPairList& colliders = nodeConfig.m_shapes; RenderColliders(colliders, actorInstance, joint, renderInfo, jointSelected ? selectedColor : defaultColor); } } diff --git a/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.h b/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.h index e8cc717e49..31f28ce210 100644 --- a/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.h +++ b/Gems/EMotionFX/Code/Source/Editor/ColliderContainerWidget.h @@ -71,7 +71,7 @@ namespace EMotionFX public: ColliderWidget(QIcon* icon, QWidget* parent, AZ::SerializeContext* serializeContext); - void Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationPair& collider); + void Update(Actor* actor, Node* joint, size_t colliderIndex, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPair& collider); void Update(); void Reset(); @@ -99,7 +99,7 @@ namespace EMotionFX PhysicsSetup::ColliderConfigType m_colliderType = PhysicsSetup::ColliderConfigType::Unknown; Node* m_joint = nullptr; size_t m_colliderIndex = MCORE_INVALIDINDEX32; - Physics::ShapeConfigurationPair m_collider; + AzPhysics::ShapeColliderPair m_collider; QIcon* m_icon; }; @@ -140,7 +140,7 @@ namespace EMotionFX ColliderContainerWidget(const QIcon& colliderIcon, QWidget* parent = nullptr); ~ColliderContainerWidget(); - void Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const Physics::ShapeConfigurationList& colliders, AZ::SerializeContext* serializeContext); + void Update(Actor* actor, Node* joint, PhysicsSetup::ColliderConfigType colliderType, const AzPhysics::ShapeColliderPairList& colliders, AZ::SerializeContext* serializeContext); void Update(); void Reset(); PhysicsSetup::ColliderConfigType ColliderType() { return m_colliderType; } @@ -156,7 +156,7 @@ namespace EMotionFX * @param[in] renderInfo Needed to access the render util. * @param[in] colliderColor The collider color. */ - static void RenderColliders(const Physics::ShapeConfigurationList& colliders, + static void RenderColliders(const AzPhysics::ShapeColliderPairList& colliders, const ActorInstance* actorInstance, const Node* node, EMStudio::EMStudioPlugin::RenderInfo* renderInfo, diff --git a/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.cpp b/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.cpp index b8f6311600..2cab16e2c1 100644 --- a/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.cpp @@ -40,7 +40,7 @@ namespace EMotionFX const Physics::CharacterColliderNodeConfiguration* copyFromNodeConfig = copyFromColliderConfig->FindNodeConfigByName(joint->GetNameString()); if (copyFromNodeConfig) { - for (const Physics::ShapeConfigurationPair& shapeConfigPair : copyFromNodeConfig->m_shapes) + for (const AzPhysics::ShapeColliderPair& shapeConfigPair : copyFromNodeConfig->m_shapes) { const AZStd::string contents = MCore::ReflectionSerializer::Serialize(&shapeConfigPair).GetValue(); CommandColliderHelpers::AddCollider(actor->GetID(), joint->GetNameString(), copyTo, contents, AZStd::nullopt, &commandGroup); @@ -231,7 +231,7 @@ namespace EMotionFX const Physics::CharacterColliderNodeConfiguration* copyFromNodeConfig = copyFromColliderConfig->FindNodeConfigByName(joint->GetNameString()); if (copyFromNodeConfig && shapeIndex < copyFromNodeConfig->m_shapes.size()) { - const Physics::ShapeConfigurationPair* shape = ©FromNodeConfig->m_shapes[shapeIndex]; + const AzPhysics::ShapeColliderPair* shape = ©FromNodeConfig->m_shapes[shapeIndex]; const AZStd::string contents = MCore::ReflectionSerializer::Serialize(shape).GetValue(); QMimeData* mimeData = new QMimeData(); mimeData->setData( diff --git a/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.h b/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.h index 462638e793..a2eba33682 100644 --- a/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.h +++ b/Gems/EMotionFX/Code/Source/Editor/ColliderHelpers.h @@ -28,7 +28,7 @@ namespace EMotionFX public: static QString GetMimeTypeForColliderShape() { - return QString("com.amazon.lumberyard/%1").arg(azrtti_typeid().ToString()); + return QString("com.amazon.lumberyard/%1").arg(azrtti_typeid().ToString()); } static void AddCopyColliderCommandToGroup(const Actor* actor, const Node* joint, PhysicsSetup::ColliderConfigType copyFrom, PhysicsSetup::ColliderConfigType copyTo, MCore::CommandGroup& commandGroup); diff --git a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeInspectorPlugin.cpp b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeInspectorPlugin.cpp index c2e2c5cc1b..e2fde04016 100644 --- a/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeInspectorPlugin.cpp +++ b/Gems/EMotionFX/Code/Source/Editor/Plugins/Ragdoll/RagdollNodeInspectorPlugin.cpp @@ -507,7 +507,7 @@ namespace EMotionFX const Physics::CharacterColliderNodeConfiguration* colliderNodeConfig = colliderConfig.FindNodeConfigByName(joint->GetNameString()); if (colliderNodeConfig) { - const Physics::ShapeConfigurationList& colliders = colliderNodeConfig->m_shapes; + const AzPhysics::ShapeColliderPairList& colliders = colliderNodeConfig->m_shapes; ColliderContainerWidget::RenderColliders(colliders, actorInstance, joint, renderInfo, finalColor); } } diff --git a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp index 0a64c7b408..8e68c8cb44 100644 --- a/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp +++ b/Gems/EMotionFX/Code/Source/Integration/System/SystemComponent.cpp @@ -890,7 +890,7 @@ namespace EMotionFX #if AZ_TRAIT_EMOTIONFX_MAIN_WINDOW_DETACHED emotionFXWindowOptions.detachedWindow = true; #endif - emotionFXWindowOptions.optionalMenuText = "Animation Editor (PREVIEW)"; + emotionFXWindowOptions.optionalMenuText = "Animation Editor"; EditorRequests::Bus::Broadcast(&EditorRequests::RegisterViewPane, EMStudio::MainWindow::GetEMotionFXPaneName(), LyViewPane::CategoryTools, emotionFXWindowOptions, windowCreationFunc); } diff --git a/Gems/EMotionFX/Code/Tests/ColliderCommandTests.cpp b/Gems/EMotionFX/Code/Tests/ColliderCommandTests.cpp index 0d81bc55b9..772ebad295 100644 --- a/Gems/EMotionFX/Code/Tests/ColliderCommandTests.cpp +++ b/Gems/EMotionFX/Code/Tests/ColliderCommandTests.cpp @@ -196,7 +196,7 @@ namespace EMotionFX ASSERT_TRUE(nodeConfig != nullptr); EXPECT_EQ(nodeConfig->m_shapes.size(), 1); - Physics::ShapeConfigurationPair& shapeConfigPair = nodeConfig->m_shapes[0]; + AzPhysics::ShapeColliderPair& shapeConfigPair = nodeConfig->m_shapes[0]; Physics::ColliderConfiguration* colliderConfig = shapeConfigPair.first.get(); Physics::ShapeConfiguration* shapeConfig = shapeConfigPair.second.get(); Physics::BoxShapeConfiguration* boxShapeConfig = azdynamic_cast(shapeConfig); diff --git a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsRagdoll.h b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsRagdoll.h index b3acb73e19..446abbf6af 100644 --- a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsRagdoll.h +++ b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsRagdoll.h @@ -26,7 +26,7 @@ namespace EMotionFX MOCK_METHOD0(DisableSimulation, void()); MOCK_METHOD0(DisableSimulationQueued, void()); - MOCK_METHOD0(IsSimulated, bool()); + MOCK_CONST_METHOD0(IsSimulated, bool()); MOCK_CONST_METHOD1(GetState, void(Physics::RagdollState&)); MOCK_METHOD1(SetState, void(const Physics::RagdollState&)); diff --git a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h index 22102fd38a..3aafdb4e2b 100644 --- a/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h +++ b/Gems/EMotionFX/Code/Tests/Mocks/PhysicsSystem.h @@ -35,9 +35,6 @@ namespace Physics MOCK_METHOD2(CreateShape, AZStd::shared_ptr(const Physics::ColliderConfiguration& colliderConfiguration, const Physics::ShapeConfiguration& configuration)); MOCK_METHOD1(ReleaseNativeMeshObject, void(void* nativeMeshObject)); MOCK_METHOD1(CreateMaterial, AZStd::shared_ptr(const Physics::MaterialConfiguration& materialConfiguration)); - MOCK_METHOD0(GetDefaultMaterial, AZStd::shared_ptr()); - MOCK_METHOD1(CreateMaterialsFromLibrary, AZStd::vector>(const Physics::MaterialSelection& materialSelection)); - MOCK_METHOD2(UpdateMaterialSelection, bool(const Physics::ShapeConfiguration& shapeConfiguration, Physics::ColliderConfiguration& colliderConfiguration)); MOCK_METHOD0(GetSupportedJointTypes, AZStd::vector()); MOCK_METHOD1(CreateJointLimitConfiguration, AZStd::shared_ptr(AZ::TypeId jointType)); MOCK_METHOD3(CreateJoint, AZStd::shared_ptr(const AZStd::shared_ptr& configuration, AzPhysics::SimulatedBody* parentBody, AzPhysics::SimulatedBody* childBody)); @@ -59,7 +56,6 @@ namespace Physics void Shutdown() override {} void Simulate([[maybe_unused]] float deltaTime) override {} void UpdateConfiguration([[maybe_unused]] const AzPhysics::SystemConfiguration* newConfig, [[maybe_unused]] bool forceReinitialization = false) override {} - void UpdateDefaultMaterialLibrary([[maybe_unused]] const AZ::Data::Asset& materialLibrary) override {} void UpdateDefaultSceneConfiguration([[maybe_unused]] const AzPhysics::SceneConfiguration& sceneConfiguration) override {} void RemoveScene([[maybe_unused]] AzPhysics::SceneHandle handle) override {} void RemoveScenes([[maybe_unused]] const AzPhysics::SceneHandleList& handles) override {} @@ -73,7 +69,6 @@ namespace Physics MOCK_METHOD0(GetAllScenes, AzPhysics::SceneList& ()); MOCK_METHOD1(FindAttachedBodyHandleFromEntityId, AZStd::pair(AZ::EntityId entityId)); MOCK_CONST_METHOD0(GetConfiguration, const AzPhysics::SystemConfiguration* ()); - MOCK_CONST_METHOD0(GetDefaultMaterialLibrary, const AZ::Data::Asset& ()); MOCK_CONST_METHOD0(GetDefaultSceneConfiguration, const AzPhysics::SceneConfiguration& ()); }; diff --git a/Gems/EMotionFX/Code/Tests/PhysicsSetupUtils.cpp b/Gems/EMotionFX/Code/Tests/PhysicsSetupUtils.cpp index 9f13e3e34f..c201ae1f48 100644 --- a/Gems/EMotionFX/Code/Tests/PhysicsSetupUtils.cpp +++ b/Gems/EMotionFX/Code/Tests/PhysicsSetupUtils.cpp @@ -37,7 +37,7 @@ namespace EMotionFX else { // Count in only the given collider type. - for (const Physics::ShapeConfigurationPair& shapeConfigPair : nodeConfig.m_shapes) + for (const AzPhysics::ShapeColliderPair& shapeConfigPair : nodeConfig.m_shapes) { if (shapeConfigPair.second->GetShapeType() == shapeTypeToCount) { diff --git a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp index 858980fbe8..eaef6f31ee 100644 --- a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp +++ b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteColliders.cpp @@ -54,14 +54,11 @@ namespace EMotionFX [[maybe_unused]] const AZ::Vector3& axis, [[maybe_unused]] const AZStd::vector& exampleLocalRotations) { return AZStd::make_unique(); }); - EXPECT_CALL(m_physicsInterface, GetDefaultMaterialLibrary) - .WillRepeatedly(testing::ReturnRef(m_materialLibraryAsset)); } private: Physics::MockPhysicsSystem m_physicsSystem; Physics::MockPhysicsInterface m_physicsInterface; - AZ::Data::Asset m_materialLibraryAsset; }; #if AZ_TRAIT_DISABLE_FAILED_EMOTION_FX_EDITOR_TESTS diff --git a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp index b4b4d14d58..6223af3599 100644 --- a/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp +++ b/Gems/EMotionFX/Code/Tests/ProvidesUI/Ragdoll/CanCopyPasteJointLimits.cpp @@ -59,9 +59,6 @@ namespace EMotionFX .WillRepeatedly(testing::Return(AZStd::vector{azrtti_typeid()})); EXPECT_CALL(physicsSystem, ComputeInitialJointLimitConfiguration(azrtti_typeid(), _, _, _, _)) .WillRepeatedly([]([[maybe_unused]] const AZ::TypeId& jointLimitTypeId, [[maybe_unused]] const AZ::Quaternion& parentWorldRotation, [[maybe_unused]] const AZ::Quaternion& childWorldRotation, [[maybe_unused]] const AZ::Vector3& axis, [[maybe_unused]] const AZStd::vector& exampleLocalRotations) { return AZStd::make_unique(); }); - AZ::Data::Asset materialLibraryAsset; - EXPECT_CALL(physicsInterface, GetDefaultMaterialLibrary) - .WillRepeatedly(testing::ReturnRef(materialLibraryAsset)); AutoRegisteredActor actor {ActorFactory::CreateAndInit(4)}; diff --git a/Gems/EMotionFX/Code/Tests/SystemComponentFixture.h b/Gems/EMotionFX/Code/Tests/SystemComponentFixture.h index 04a1ca4f81..f8c70a5fee 100644 --- a/Gems/EMotionFX/Code/Tests/SystemComponentFixture.h +++ b/Gems/EMotionFX/Code/Tests/SystemComponentFixture.h @@ -59,7 +59,16 @@ namespace EMotionFX { public: - ComponentFixtureApp() = default; + ComponentFixtureApp() + { + using FixedValueString = AZ::SettingsRegistryInterface::FixedValueString; + constexpr auto projectPathKey = FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + if(auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr) + { + settingsRegistry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*settingsRegistry); + } + } AZ::ComponentTypeList GetRequiredSystemComponents() const override { diff --git a/Gems/EMotionFX/Code/Tests/UI/CanUseFileMenu.cpp b/Gems/EMotionFX/Code/Tests/UI/CanUseFileMenu.cpp index 8045499b4a..8e3a19c1ca 100644 --- a/Gems/EMotionFX/Code/Tests/UI/CanUseFileMenu.cpp +++ b/Gems/EMotionFX/Code/Tests/UI/CanUseFileMenu.cpp @@ -77,7 +77,6 @@ namespace EMotionFX { auto testAssetsPath = AZ::IO::Path(GetEMotionFX().GetAssetCacheFolder()) / "TmpTestAssets"; QString dataDir = QString::fromUtf8(testAssetsPath.c_str(), aznumeric_cast(testAssetsPath.Native().size())); - dataDir += "TmpTestAssets"; if (!QDir(dataDir).exists()) { diff --git a/Gems/EditorPythonBindings/Code/CMakeLists.txt b/Gems/EditorPythonBindings/Code/CMakeLists.txt index 3a34a8491d..a8d4382b45 100644 --- a/Gems/EditorPythonBindings/Code/CMakeLists.txt +++ b/Gems/EditorPythonBindings/Code/CMakeLists.txt @@ -64,6 +64,10 @@ ly_add_target( Gem::EditorPythonBindings.Static ) +# builders and tools use EditorPythonBindings.Editor +ly_create_alias(NAME EditorPythonBindings.Builders NAMESPACE Gem TARGETS EditorPythonBindings.Editor) +ly_create_alias(NAME EditorPythonBindings.Tools NAMESPACE Gem TARGETS EditorPythonBindings.Editor) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/EditorPythonBindings/Code/Tests/EditorPythonBindingsTest.cpp b/Gems/EditorPythonBindings/Code/Tests/EditorPythonBindingsTest.cpp index 86628d08a1..440638c61f 100644 --- a/Gems/EditorPythonBindings/Code/Tests/EditorPythonBindingsTest.cpp +++ b/Gems/EditorPythonBindings/Code/Tests/EditorPythonBindingsTest.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -322,6 +323,13 @@ sys.version void SetUp() override { PythonTestingFixture::SetUp(); + + auto registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.RegisterComponentDescriptor(EditorPythonBindings::PythonSystemComponent::CreateDescriptor()); } diff --git a/Gems/ExpressionEvaluation/Code/CMakeLists.txt b/Gems/ExpressionEvaluation/Code/CMakeLists.txt index 563e3f3341..456129f05d 100644 --- a/Gems/ExpressionEvaluation/Code/CMakeLists.txt +++ b/Gems/ExpressionEvaluation/Code/CMakeLists.txt @@ -41,6 +41,12 @@ ly_add_target( Gem::ExpressionEvaluation.Static ) +# all types of applications use the above module +ly_create_alias(NAME ExpressionEvaluation.Clients NAMESPACE Gem TARGETS ExpressionEvaluation) +ly_create_alias(NAME ExpressionEvaluation.Servers NAMESPACE Gem TARGETS ExpressionEvaluation) +ly_create_alias(NAME ExpressionEvaluation.Builders NAMESPACE Gem TARGETS ExpressionEvaluation) +ly_create_alias(NAME ExpressionEvaluation.Tools NAMESPACE Gem TARGETS ExpressionEvaluation) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/FastNoise/Code/CMakeLists.txt b/Gems/FastNoise/Code/CMakeLists.txt index a49126303a..ae42af771a 100644 --- a/Gems/FastNoise/Code/CMakeLists.txt +++ b/Gems/FastNoise/Code/CMakeLists.txt @@ -23,6 +23,7 @@ ly_add_target( PUBLIC Legacy::CryCommon Gem::GradientSignal + PRIVATE Gem::LmbrCentral ) @@ -42,6 +43,10 @@ ly_add_target( Gem::GradientSignal ) +# Clients and Servers use the above module +ly_create_alias(NAME FastNoise.Clients NAMESPACE Gem TARGETS FastNoise) +ly_create_alias(NAME FastNoise.Servers NAMESPACE Gem TARGETS FastNoise) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME FastNoise.Editor.Static STATIC @@ -57,6 +62,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC Include BUILD_DEPENDENCIES + PRIVATE + Gem::LmbrCentral.Editor PUBLIC Gem::FastNoise.Static AZ::AzToolsFramework @@ -65,7 +72,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME FastNoise.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE fastnoise_editor_shared_files.cmake @@ -76,11 +82,18 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Include BUILD_DEPENDENCIES PRIVATE - FastNoise.Editor.Static + Gem::FastNoise.Editor.Static + Gem::LmbrCentral.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor Gem::SurfaceData.Editor ) + + # builders and tools load the above tool module. + ly_create_alias(NAME FastNoise.Builders NAMESPACE Gem TARGETS FastNoise.Editor) + ly_create_alias(NAME FastNoise.Tools NAMESPACE Gem TARGETS FastNoise.Editor) + + endif() ################################################################################ @@ -103,6 +116,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest FastNoise.Editor.Static + Gem::LmbrCentral.Editor ) ly_add_googletest( NAME Gem::FastNoise.Editor.Tests @@ -120,6 +134,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest Gem::FastNoise.Static + Gem::LmbrCentral ) ly_add_googletest( NAME Gem::FastNoise.Tests diff --git a/Gems/GameState/Code/CMakeLists.txt b/Gems/GameState/Code/CMakeLists.txt index d57cf8feed..828dfcbb35 100644 --- a/Gems/GameState/Code/CMakeLists.txt +++ b/Gems/GameState/Code/CMakeLists.txt @@ -40,6 +40,10 @@ ly_add_target( Gem::GameState.Static ) +# Clients and Servers use the above module. There is no editor or tools module required. +ly_create_alias(NAME GameState.Clients NAMESPACE Gem TARGETS GameState) +ly_create_alias(NAME GameState.Servers NAMESPACE Gem TARGETS GameState) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index e3ebc25016..abf3ca6121 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -44,4 +44,12 @@ ly_add_target( AZ::AzFramework Gem::LmbrCentral Gem::GameStateSamples.Headers + RUNTIME_DEPENDENCIES + Gem::GameState + Gem::LocalUser + Gem::LmbrCentral ) + +# Clients and Servers use the above module. There is no editor or tools module required. +ly_create_alias(NAME GameStateSamples.Clients NAMESPACE Gem TARGETS GameStateSamples) +ly_create_alias(NAME GameStateSamples.Servers NAMESPACE Gem TARGETS GameStateSamples) diff --git a/Gems/Gestures/Code/CMakeLists.txt b/Gems/Gestures/Code/CMakeLists.txt index 677886c0ed..8c4ec5ad55 100644 --- a/Gems/Gestures/Code/CMakeLists.txt +++ b/Gems/Gestures/Code/CMakeLists.txt @@ -43,6 +43,12 @@ ly_add_target( Gem::Gestures.Static ) +# All types of applications use the same module. +ly_create_alias(NAME Gestures.Clients NAMESPACE Gem TARGETS Gestures) +ly_create_alias(NAME Gestures.Servers NAMESPACE Gem TARGETS Gestures) +ly_create_alias(NAME Gestures.Builders NAMESPACE Gem TARGETS Gestures) +ly_create_alias(NAME Gestures.Tools NAMESPACE Gem TARGETS Gestures) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/GradientSignal/Code/CMakeLists.txt b/Gems/GradientSignal/Code/CMakeLists.txt index 7b8c9813e6..244f7360ea 100644 --- a/Gems/GradientSignal/Code/CMakeLists.txt +++ b/Gems/GradientSignal/Code/CMakeLists.txt @@ -22,9 +22,10 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Legacy::CryCommon - Gem::LmbrCentral Gem::SurfaceData Gem::ImageProcessingAtom.Headers + PRIVATE + Gem::LmbrCentral ) ly_add_target( @@ -40,13 +41,17 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::GradientSignal.Static + Gem::LmbrCentral PUBLIC Gem::ImageProcessingAtom.Headers # Atom/ImageProcessing/PixelFormats.h is part of a header in Includes RUNTIME_DEPENDENCIES Gem::LmbrCentral - Gem::SurfaceData ) +# Load the "Gem::GradientSignal" module in Clients and Servers +ly_create_alias(NAME GradientSignal.Clients NAMESPACE Gem TARGETS Gem::GradientSignal) +ly_create_alias(NAME GradientSignal.Servers NAMESPACE Gem TARGETS Gem::GradientSignal) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -63,19 +68,21 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC GRADIENTSIGNAL_EDITOR BUILD_DEPENDENCIES + PRIVATE + Gem::LmbrCentral.Editor PUBLIC 3rdParty::Qt::Widgets Legacy::CryCommon AZ::AzToolsFramework - Gem::LmbrCentral - Gem::SurfaceData AZ::AssetBuilderSDK Gem::GradientSignal.Static + Gem::SurfaceData + RUNTIME_DEPENDENCIES + Gem::LmbrCentral.Editor ) ly_add_target( NAME GradientSignal.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE gradientsignal_editor_shared_files.cmake @@ -87,11 +94,16 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) BUILD_DEPENDENCIES PRIVATE Gem::GradientSignal.Editor.Static + Gem::LmbrCentral.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor - Gem::SurfaceData.Editor ) + # Load the "Gem::GradientSignal.Editor" module in Builders and Tools + ly_create_alias(NAME GradientSignal.Builders NAMESPACE Gem TARGETS Gem::GradientSignal.Editor) + ly_create_alias(NAME GradientSignal.Tools NAMESPACE Gem TARGETS Gem::GradientSignal.Editor) + + endif() ################################################################################ @@ -112,6 +124,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest Gem::GradientSignal.Static + Gem::LmbrCentral ) ly_add_googletest( NAME Gem::GradientSignal.Tests @@ -132,6 +145,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Gem::GradientSignal.Static Gem::GradientSignal.Editor.Static + Gem::LmbrCentral.Editor ) ly_add_googletest( NAME Gem::GradientSignal.Editor.Tests diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h index 8a8eacc952..9e7823c8d3 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/GradientSampler.h @@ -103,12 +103,12 @@ namespace GradientSignal //apply transform if set if (m_enableTransform && GradientSamplerUtil::AreTransformParamsSet(*this)) { - const AZ::Transform transform = - AZ::Transform::CreateTranslation(m_translate) * - AZ::ConvertEulerDegreesToTransform(m_rotate) * - AZ::Transform::CreateScale(m_scale); + AZ::Matrix3x4 matrix3x4; + matrix3x4.SetFromEulerDegrees(m_rotate); + matrix3x4.MultiplyByScale(m_scale); + matrix3x4.SetTranslation(m_translate); - sampleParamsTransformed.m_position = transform.TransformPoint(sampleParamsTransformed.m_position); + sampleParamsTransformed.m_position = matrix3x4 * sampleParamsTransformed.m_position; } float output = 0.0f; diff --git a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h index 4e15bdc293..1a8bb00eba 100644 --- a/Gems/GradientSignal/Code/Include/GradientSignal/Util.h +++ b/Gems/GradientSignal/Code/Include/GradientSignal/Util.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -64,15 +65,15 @@ namespace GradientSignal AZ::LerpInverse(bounds.GetMin().GetZ(), bounds.GetMax().GetZ(), point.GetZ())); } - inline void GetObbParamsFromShape(const AZ::EntityId& entity, AZ::Aabb& bounds, AZ::Transform& worldToBoundsTransform) + inline void GetObbParamsFromShape(const AZ::EntityId& entity, AZ::Aabb& bounds, AZ::Matrix3x4& worldToBoundsTransform) { //get bound and transform data for associated shape bounds = AZ::Aabb::CreateNull(); - worldToBoundsTransform = AZ::Transform::CreateIdentity(); + AZ::Transform transform = AZ::Transform::CreateIdentity(); if (entity.IsValid()) { - LmbrCentral::ShapeComponentRequestsBus::Event(entity, &LmbrCentral::ShapeComponentRequestsBus::Events::GetTransformAndLocalBounds, worldToBoundsTransform, bounds); - worldToBoundsTransform.Invert(); + LmbrCentral::ShapeComponentRequestsBus::Event(entity, &LmbrCentral::ShapeComponentRequestsBus::Events::GetTransformAndLocalBounds, transform, bounds); + worldToBoundsTransform = AZ::Matrix3x4::CreateFromTransform(transform.GetInverse()); } } diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp index f99a8a8dfb..a2d979313e 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.cpp @@ -334,7 +334,7 @@ namespace GradientSignal AZStd::lock_guard lock(m_cacheMutex); //transforming coordinate into "local" relative space of shape bounds - outUVW = m_shapeTransformInverse.TransformPoint(inPosition); + outUVW = m_shapeTransformInverse * inPosition; if (!m_configuration.m_advancedMode || !m_configuration.m_is3d) { @@ -388,7 +388,7 @@ namespace GradientSignal void GradientTransformComponent::GetGradientEncompassingBounds(AZ::Aabb& bounds) const { bounds = m_shapeBounds; - bounds.ApplyTransform(m_shapeTransformInverse.GetInverse()); + bounds.ApplyMatrix3x4(m_shapeTransformInverse.GetInverseFull()); } void GradientTransformComponent::OnCompositionChanged() @@ -493,7 +493,7 @@ namespace GradientSignal if (!m_configuration.m_advancedMode || !m_configuration.m_overrideScale) { - m_configuration.m_scale = shapeTransform.GetScale(); + m_configuration.m_scale = AZ::Vector3(shapeTransform.GetUniformScale()); } //rebuild bounds from parameters @@ -501,10 +501,11 @@ namespace GradientSignal m_shapeBounds = AZ::Aabb::CreateFromMinMax(-m_configuration.m_bounds * 0.5f, m_configuration.m_bounds * 0.5f); //rebuild transform from parameters - AZ::Quaternion rotation; - rotation.SetFromEulerDegrees(m_configuration.m_rotate); - const AZ::Transform shapeTransformFinal(m_configuration.m_translate, rotation, m_configuration.m_scale); - m_shapeTransformInverse = shapeTransformFinal.GetInverse(); + 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(); } AZ::EntityId GradientTransformComponent::GetShapeEntityId() const diff --git a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h index 8b0bfad672..5955da95c7 100644 --- a/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h +++ b/Gems/GradientSignal/Code/Source/Components/GradientTransformComponent.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -172,7 +173,7 @@ namespace GradientSignal mutable AZStd::recursive_mutex m_cacheMutex; GradientTransformConfig m_configuration; AZ::Aabb m_shapeBounds = AZ::Aabb::CreateNull(); - AZ::Transform m_shapeTransformInverse = AZ::Transform::CreateIdentity(); + AZ::Matrix3x4 m_shapeTransformInverse = AZ::Matrix3x4::CreateIdentity(); LmbrCentral::DependencyMonitor m_dependencyMonitor; AZStd::atomic_bool m_dirty{ false }; }; diff --git a/Gems/GraphCanvas/Code/CMakeLists.txt b/Gems/GraphCanvas/Code/CMakeLists.txt index 683b0e4bdf..fe24686f95 100644 --- a/Gems/GraphCanvas/Code/CMakeLists.txt +++ b/Gems/GraphCanvas/Code/CMakeLists.txt @@ -51,7 +51,6 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME GraphCanvas.Editor GEM_MODULE - NAMESPACE Gem AUTOMOC AUTORCC @@ -75,4 +74,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) 3rdParty::Qt::Xml AZ::AzQtComponents ) + + # Load the "Gem::GraphCanvas" module in Builders and Tools + ly_create_alias(NAME GraphCanvas.Builders NAMESPACE Gem TARGETS Gem::GraphCanvas.Editor) + ly_create_alias(NAME GraphCanvas.Tools NAMESPACE Gem TARGETS Gem::GraphCanvas.Editor) + + endif () diff --git a/Gems/GraphModel/Code/CMakeLists.txt b/Gems/GraphModel/Code/CMakeLists.txt index 2c4fc57252..86141140ee 100644 --- a/Gems/GraphModel/Code/CMakeLists.txt +++ b/Gems/GraphModel/Code/CMakeLists.txt @@ -52,6 +52,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES Gem::GraphCanvas.Editor ) + + # Load the "Gem::GraphModel" module in Builders and Tools + ly_create_alias(NAME GraphModel.Builders NAMESPACE Gem TARGETS Gem::GraphModel.Editor) + ly_create_alias(NAME GraphModel.Tools NAMESPACE Gem TARGETS Gem::GraphModel.Editor) + endif() ################################################################################ diff --git a/Gems/HttpRequestor/Code/CMakeLists.txt b/Gems/HttpRequestor/Code/CMakeLists.txt index 71181f9ff4..bfbc4305b0 100644 --- a/Gems/HttpRequestor/Code/CMakeLists.txt +++ b/Gems/HttpRequestor/Code/CMakeLists.txt @@ -48,6 +48,12 @@ ly_add_target( Gem::HttpRequestor.Static ) +# Load the "Gem::HttpRequestor" module in all types of applicatons. +ly_create_alias(NAME HttpRequestor.Clients NAMESPACE Gem TARGETS Gem::HttpRequestor) +ly_create_alias(NAME HttpRequestor.Servers NAMESPACE Gem TARGETS Gem::HttpRequestor) +ly_create_alias(NAME HttpRequestor.Builders NAMESPACE Gem TARGETS Gem::HttpRequestor) +ly_create_alias(NAME HttpRequestor.Tools NAMESPACE Gem TARGETS Gem::HttpRequestor) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/ImGui/Code/CMakeLists.txt b/Gems/ImGui/Code/CMakeLists.txt index 2f7d6c6ce7..fccdb6fc08 100644 --- a/Gems/ImGui/Code/CMakeLists.txt +++ b/Gems/ImGui/Code/CMakeLists.txt @@ -53,6 +53,8 @@ ly_add_target( PUBLIC Gem::ImGui.imguilib Legacy::CryCommon + RUNTIME_DEPENDENCIES + Gem::ImGui.imguilib ) ly_add_target( @@ -70,6 +72,7 @@ ly_add_target( BUILD_DEPENDENCIES PUBLIC Gem::ImGui.ImGuiLYUtils + PRIVATE Gem::LmbrCentral ) @@ -90,6 +93,10 @@ ly_add_target( Gem::LmbrCentral ) +# Load the above "Gem::ImGui" module in Clients and Servers: +ly_create_alias(NAME ImGui.Clients NAMESPACE Gem TARGETS Gem::ImGui) +ly_create_alias(NAME ImGui.Servers NAMESPACE Gem TARGETS Gem::ImGui) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ImGui.Editor GEM_MODULE @@ -113,4 +120,9 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) + + # Load the above "Gem::ImGui.Editor" module in only tools and builders. + ly_create_alias(NAME ImGui.Builders NAMESPACE Gem TARGETS Gem::ImGui.Editor) + ly_create_alias(NAME ImGui.Tools NAMESPACE Gem TARGETS Gem::ImGui.Editor) + endif() diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp index 251c178035..093c9dad22 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.cpp @@ -163,7 +163,7 @@ namespace ImGui void ImGuiLYAssetExplorer::ImGuiUpdate_DrawMenu() { - // Master on / off Switch + // Primary on / off Switch ImGui::Checkbox("Mesh Debug Enabled", &m_meshDebugEnabled); ImGui::SameLine(); diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h index b5f8ea576c..04d87575fb 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYAssetExplorer.h @@ -103,7 +103,7 @@ namespace ImGui void MeshInstanceList_CheckMeshFilter(); void MeshInstanceList_CheckEntityFilter(); - // The Master list of Meshes and Instances of them + // The Primary list of Meshes and Instances of them AZStd::list m_meshInstanceDisplayList; // Helper functions for the ImGui Update diff --git a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp index 8e3e2663d5..5107a02835 100644 --- a/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp +++ b/Gems/ImGui/Code/Source/LYCommonMenu/ImGuiLYCommonMenu.cpp @@ -15,6 +15,7 @@ #ifdef IMGUI_ENABLED #include +#include #include #include #include @@ -251,15 +252,37 @@ namespace ImGui if (usePrefabSystemForLevels) { - char levelName[256]; - ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "Load Level: "); - bool result = ImGui::InputText("", levelName, sizeof(levelName), ImGuiInputTextFlags_EnterReturnsTrue); - if (result) + // Run through all the assets in the asset catalog and gather up the list of level assets + + AZ::Data::AssetType levelAssetType = lvlSystem->GetLevelAssetType(); + AZStd::vector levelNames; + auto enumerateCB = + [levelAssetType, &levelNames]([[maybe_unused]] const AZ::Data::AssetId id, const AZ::Data::AssetInfo& assetInfo) { - AZ_TracePrintf("Imgui", "Attempting to load level '%s'\n", levelName); - AZ::TickBus::QueueFunction([lvlSystem, levelName]() { - lvlSystem->LoadLevel(levelName); - }); + if (assetInfo.m_assetType == levelAssetType) + { + levelNames.emplace_back(assetInfo.m_relativePath); + } + }; + + AZ::Data::AssetCatalogRequestBus::Broadcast( + &AZ::Data::AssetCatalogRequestBus::Events::EnumerateAssets, nullptr, enumerateCB, nullptr); + + AZStd::sort(levelNames.begin(), levelNames.end()); + + // Create a menu item for each level asset, with an action to load it if selected. + + ImGui::TextColored(ImGui::Colors::s_PlainLabelColor, "Load Level: "); + for (int i = 0; i < levelNames.size(); i++) + { + if (ImGui::MenuItem(AZStd::string::format("%d- %s", i, levelNames[i].c_str()).c_str())) + { + AZ::TickBus::QueueFunction( + [lvlSystem, levelNames, i]() + { + lvlSystem->LoadLevel(levelNames[i].c_str()); + }); + } } } else @@ -269,9 +292,8 @@ namespace ImGui { if (ImGui::MenuItem(AZStd::string::format("%d- %s", i, lvlSystem->GetLevelInfo(i)->GetName()).c_str())) { - AZStd::string mapCommandString = AZStd::string::format("map %s", lvlSystem->GetLevelInfo(i)->GetName()); - AZ::TickBus::QueueFunction([mapCommandString]() { - gEnv->pConsole->ExecuteString(mapCommandString.c_str()); + AZ::TickBus::QueueFunction([lvlSystem, i]() { + lvlSystem->LoadLevel(lvlSystem->GetLevelInfo(i)->GetName()); }); } } diff --git a/Gems/InAppPurchases/Code/CMakeLists.txt b/Gems/InAppPurchases/Code/CMakeLists.txt index 61f9839841..889b651838 100644 --- a/Gems/InAppPurchases/Code/CMakeLists.txt +++ b/Gems/InAppPurchases/Code/CMakeLists.txt @@ -43,3 +43,8 @@ ly_add_target( PRIVATE Gem::InAppPurchases.Static ) +# Load the above "Gem::InAppPurchases" module in all app types +ly_create_alias(NAME InAppPurchases.Clients NAMESPACE Gem TARGETS Gem::InAppPurchases) +ly_create_alias(NAME InAppPurchases.Servers NAMESPACE Gem TARGETS Gem::InAppPurchases) +ly_create_alias(NAME InAppPurchases.Builders NAMESPACE Gem TARGETS Gem::InAppPurchases) +ly_create_alias(NAME InAppPurchases.Tools NAMESPACE Gem TARGETS Gem::InAppPurchases) diff --git a/Gems/LandscapeCanvas/Code/CMakeLists.txt b/Gems/LandscapeCanvas/Code/CMakeLists.txt index e8e2fce689..5288db9cc1 100644 --- a/Gems/LandscapeCanvas/Code/CMakeLists.txt +++ b/Gems/LandscapeCanvas/Code/CMakeLists.txt @@ -35,16 +35,21 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::CryCommon Legacy::Editor.Headers Legacy::EditorCommon - Gem::LmbrCentral - Gem::GraphCanvasWidgets Gem::GraphModel.Editor.Static Gem::GradientSignal.Editor Gem::SurfaceData.Editor Gem::Vegetation.Editor + Gem::LmbrCentral.Editor + PUBLIC + Gem::GraphCanvasWidgets + RUNTIME_DEPENDENCIES + Gem::GradientSignal.Editor + Gem::SurfaceData.Editor + Gem::Vegetation.Editor + Gem::LmbrCentral.Editor ) ly_add_target( NAME LandscapeCanvas.Editor GEM_MODULE - NAMESPACE Gem FILES_CMAKE landscapecanvas_editor_files.cmake @@ -61,7 +66,6 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzCore AZ::AzToolsFramework Legacy::Editor.Headers - Gem::GraphCanvasWidgets Gem::GraphModel.Editor.Static Gem::LandscapeCanvas.Editor.Static RUNTIME_DEPENDENCIES @@ -72,6 +76,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::SurfaceData.Editor Gem::Vegetation.Editor ) + + # by default, load the above "Gem::LandscapeCanvas.Editor" module in dev applications + ly_create_alias(NAME LandscapeCanvas.Builders NAMESPACE Gem TARGETS Gem::LandscapeCanvas.Editor) + ly_create_alias(NAME LandscapeCanvas.Tools NAMESPACE Gem TARGETS Gem::LandscapeCanvas.Editor) + endif() ################################################################################ @@ -97,9 +106,10 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest AZ::AzFramework AZ::AzToolsFramework - Gem::GraphCanvasWidgets Gem::GraphModel.Editor.Static Gem::LandscapeCanvas.Editor.Static + RUNTIME_DEPENDENCIES + Gem::GraphCanvasWidgets ) ly_add_googletest( NAME Gem::LandscapeCanvas.Editor.Tests diff --git a/Gems/LmbrCentral/Code/CMakeLists.txt b/Gems/LmbrCentral/Code/CMakeLists.txt index c1fbd744e6..4d03d30923 100644 --- a/Gems/LmbrCentral/Code/CMakeLists.txt +++ b/Gems/LmbrCentral/Code/CMakeLists.txt @@ -48,6 +48,11 @@ ly_add_target( Gem::LmbrCentral.Static ) +# by default, load the above "Gem::LmbrCentral" module in Client and Server +ly_create_alias(NAME LmbrCentral.Clients NAMESPACE Gem TARGETS Gem::LmbrCentral) +ly_create_alias(NAME LmbrCentral.Servers NAMESPACE Gem TARGETS Gem::LmbrCentral) + + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME LmbrCentral.Editor.Static STATIC @@ -102,6 +107,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) FILES ${QT_LRELEASE_EXECUTABLE} ) + # by default, load the above "Gem::LmbrCentral.Editor" module in dev tools + ly_create_alias(NAME LmbrCentral.Builders NAMESPACE Gem TARGETS Gem::LmbrCentral.Editor) + ly_create_alias(NAME LmbrCentral.Tools NAMESPACE Gem TARGETS Gem::LmbrCentral.Editor) + endif() ################################################################################ diff --git a/Gems/LmbrCentral/Code/Source/Bundling/BundlingSystemComponent.h b/Gems/LmbrCentral/Code/Source/Bundling/BundlingSystemComponent.h index e01268cfe2..7b054b8c00 100644 --- a/Gems/LmbrCentral/Code/Source/Bundling/BundlingSystemComponent.h +++ b/Gems/LmbrCentral/Code/Source/Bundling/BundlingSystemComponent.h @@ -85,10 +85,10 @@ namespace LmbrCentral AZStd::vector GetBundleList(const char* bundlePath, const char* bundleExtension) const; //! Bundles which are split across archives (Usually due to size constraints) have the dependent bundles listed in the manifest - //! of the master bundle. This method manages opening the dependent bundles. + //! of the main bundle. This method manages opening the dependent bundles. void OpenDependentBundles(const char* bundleName, AZStd::shared_ptr bundleManifest); //! Bundles which are split across archives (Usually due to size constraints) have the dependent bundles listed in the manifest - //! of the master bundle. This method manages closing the dependent bundles. + //! of the main bundle. This method manages closing the dependent bundles. void CloseDependentBundles(const char* bundleName, AZStd::shared_ptr bundleManifest); size_t GetOpenedBundleCount() const override; diff --git a/Gems/LmbrCentral/Code/Source/Scripting/EditorLookAtComponent.cpp b/Gems/LmbrCentral/Code/Source/Scripting/EditorLookAtComponent.cpp index 107b94d119..e16260af4d 100644 --- a/Gems/LmbrCentral/Code/Source/Scripting/EditorLookAtComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Scripting/EditorLookAtComponent.cpp @@ -169,22 +169,24 @@ namespace LmbrCentral { AZ::TransformNotificationBus::MultiHandler::BusDisconnect(GetEntityId()); { - AZ::Transform currentTM = AZ::Transform::CreateIdentity(); - EBUS_EVENT_ID_RESULT(currentTM, GetEntityId(), AZ::TransformBus, GetWorldTM); - AZ::Vector3 currentScale = currentTM.ExtractScale(); + AZ::Transform sourceTM = AZ::Transform::CreateIdentity(); + AZ::TransformBus::EventResult(sourceTM, GetEntityId(), &AZ::TransformBus::Events::GetWorldTM); AZ::Transform targetTM = AZ::Transform::CreateIdentity(); - EBUS_EVENT_ID_RESULT(targetTM, m_targetId, AZ::TransformBus, GetWorldTM); + AZ::TransformBus::EventResult(targetTM, m_targetId, &AZ::TransformBus::Events::GetWorldTM); AZ::Transform lookAtTransform = AZ::Transform::CreateLookAt( - currentTM.GetTranslation(), + sourceTM.GetTranslation(), targetTM.GetTranslation(), m_forwardAxis ); - lookAtTransform.MultiplyByScale(currentScale); + // update the rotation and translation for sourceTM based on lookAtTransform, but leave scale unchanged + sourceTM.SetRotation(lookAtTransform.GetRotation()); + sourceTM.SetTranslation(lookAtTransform.GetTranslation()); EBUS_EVENT_ID(GetEntityId(), AZ::TransformBus, SetWorldTM, lookAtTransform); + AZ::TransformBus::Event(GetEntityId(), &AZ::TransformBus::Events::SetWorldTM, sourceTM); } AZ::TransformNotificationBus::MultiHandler::BusConnect(GetEntityId()); } diff --git a/Gems/LmbrCentral/Code/Source/Shape/BoxShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/BoxShape.cpp index 2830f514fe..a2ee4d986f 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/BoxShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/BoxShape.cpp @@ -251,7 +251,7 @@ namespace LmbrCentral const AZ::Transform& currentTransform, const BoxShapeConfig& configuration, const AZ::Vector3& currentNonUniformScale) { AZ::Transform worldFromLocalNormalized = currentTransform; - const float entityScale = worldFromLocalNormalized.ExtractScale().GetMaxElement(); + const float entityScale = worldFromLocalNormalized.ExtractUniformScale(); m_currentPosition = worldFromLocalNormalized.GetTranslation(); m_scaledDimensions = configuration.m_dimensions * currentNonUniformScale * entityScale; diff --git a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp index e935ed4009..1026c8addc 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/CapsuleShape.cpp @@ -203,7 +203,7 @@ namespace LmbrCentral const AZ::Transform& currentTransform, const CapsuleShapeConfig& configuration, [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { - const float entityScale = currentTransform.GetScale().GetMaxElement(); + const float entityScale = currentTransform.GetUniformScale(); m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale; const float internalCylinderHeight = configuration.m_height - configuration.m_radius * 2.0f; diff --git a/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp index 047261862f..a0ba157fc1 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/CylinderShape.cpp @@ -273,7 +273,7 @@ namespace LmbrCentral const AZ::Transform& currentTransform, const CylinderShapeConfig& configuration, [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { - const float entityScale = currentTransform.GetScale().GetMaxElement(); + const float entityScale = currentTransform.GetUniformScale(); m_axisVector = currentTransform.GetBasisZ().GetNormalizedSafe() * entityScale; m_baseCenterPoint = currentTransform.GetTranslation() - m_axisVector * (configuration.m_height * 0.5f); m_axisVector = m_axisVector * configuration.m_height; diff --git a/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp index a302a83316..6aff6ed98c 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/DiskShape.cpp @@ -167,7 +167,7 @@ namespace LmbrCentral { m_position = currentTransform.GetTranslation(); m_normal = currentTransform.GetBasisZ().GetNormalized(); - m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement(); + m_radius = configuration.m_radius * currentTransform.GetUniformScale(); } const DiskShapeConfig& DiskShape::GetDiskConfiguration() const diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp index c0b49b8e55..e323d58c2a 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorBoxShapeComponent.cpp @@ -174,6 +174,6 @@ namespace LmbrCentral AZ::Vector3 EditorBoxShapeComponent::GetBoxScale() { - return AZ::Vector3(m_boxShape.GetCurrentTransform().GetScale().GetMaxElement() * m_boxShape.GetCurrentNonUniformScale()); + return AZ::Vector3(m_boxShape.GetCurrentTransform().GetUniformScale() * m_boxShape.GetCurrentNonUniformScale()); } } // namespace LmbrCentral diff --git a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp index 212ec49c93..44ed73733c 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/EditorSplineComponent.cpp @@ -349,7 +349,7 @@ namespace LmbrCentral const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) { const auto rayIntersectData = IntersectSpline(m_cachedUniformScaleTransform, src, dir, *m_splineCommon.m_spline); - distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetScale().GetMaxElement(); + distance = rayIntersectData.m_rayDistance * m_cachedUniformScaleTransform.GetUniformScale(); AzFramework::CameraState cameraState; AzToolsFramework::ViewportInteraction::ViewportInteractionRequestBus::EventResult( diff --git a/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp index 3ea8f2a3d0..4244199b85 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/PolygonPrismShape.cpp @@ -434,8 +434,7 @@ namespace LmbrCentral const AZ::Vector3& nonUniformScale = polygonPrism.GetNonUniformScale(); AZ::Transform worldFromLocalUniformScale = worldFromLocal; - const float entityScale = worldFromLocalUniformScale.ExtractScale().GetMaxElement(); - worldFromLocalUniformScale *= AZ::Transform::CreateScale(AZ::Vector3(entityScale)); + worldFromLocalUniformScale.SetUniformScale(worldFromLocalUniformScale.GetUniformScale()); AZ::Aabb aabb = AZ::Aabb::CreateNull(); // check base of prism @@ -465,8 +464,7 @@ namespace LmbrCentral const size_t vertexCount = vertices.size(); AZ::Transform worldFromLocalWithUniformScale = worldFromLocal; - const float transformScale = worldFromLocalWithUniformScale.ExtractScale().GetMaxElement(); - worldFromLocalWithUniformScale *= AZ::Transform::CreateScale(AZ::Vector3(transformScale)); + worldFromLocalWithUniformScale.SetUniformScale(worldFromLocalWithUniformScale.GetUniformScale()); // transform point to local space // it's fine to invert the transform including scale here, because it won't affect whether the point is inside the prism @@ -530,7 +528,7 @@ namespace LmbrCentral // but inverting any scale in the transform would mess up the distance, so extract that first and apply scale separately to the // prism AZ::Transform worldFromLocalNoScale = worldFromLocal; - const float transformScale = worldFromLocalNoScale.ExtractScale().GetMaxElement(); + const float transformScale = worldFromLocalNoScale.ExtractUniformScale(); const AZ::Vector3 combinedScale = transformScale * nonUniformScale; const float scaledHeight = height * combinedScale.GetZ(); @@ -606,9 +604,9 @@ namespace LmbrCentral } // transform ray into local space - AZ::Transform worldFromLocalNomalized = worldFromLocal; - const float entityScale = worldFromLocalNomalized.ExtractScale().GetMaxElement(); - const AZ::Transform localFromWorldNormalized = worldFromLocalNomalized.GetInverse(); + AZ::Transform worldFromLocalNormalized = worldFromLocal; + const float entityScale = worldFromLocalNormalized.ExtractUniformScale(); + const AZ::Transform localFromWorldNormalized = worldFromLocalNormalized.GetInverse(); const float rayLength = 1000.0f; const AZ::Vector3 localSrc = localFromWorldNormalized.TransformPoint(src); const AZ::Vector3 localDir = localFromWorldNormalized.TransformVector(dir); diff --git a/Gems/LmbrCentral/Code/Source/Shape/QuadShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/QuadShape.cpp index 052eac47d0..a395dbac2b 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/QuadShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/QuadShape.cpp @@ -205,8 +205,8 @@ namespace LmbrCentral { m_position = currentTransform.GetTranslation(); m_quaternion = currentTransform.GetRotation(); - m_scaledWidth = configuration.m_width * currentTransform.GetScale().GetX() * currentNonUniformScale.GetX(); - m_scaledHeight = configuration.m_height * currentTransform.GetScale().GetY() * currentNonUniformScale.GetY(); + m_scaledWidth = configuration.m_width * currentTransform.GetUniformScale() * currentNonUniformScale.GetX(); + m_scaledHeight = configuration.m_height * currentTransform.GetUniformScale() * currentNonUniformScale.GetY(); } const QuadShapeConfig& QuadShape::GetQuadConfiguration() const diff --git a/Gems/LmbrCentral/Code/Source/Shape/ShapeDisplay.h b/Gems/LmbrCentral/Code/Source/Shape/ShapeDisplay.h index fb3164960e..5b5cc5fb4d 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/ShapeDisplay.h +++ b/Gems/LmbrCentral/Code/Source/Shape/ShapeDisplay.h @@ -44,8 +44,7 @@ namespace LmbrCentral // only uniform scale is supported in physics so the debug visuals reflect this fact AZ::Transform worldFromLocalWithUniformScale = worldFromLocal; - const AZ::Vector3 scale = worldFromLocalWithUniformScale.ExtractScale(); - worldFromLocalWithUniformScale.MultiplyByScale(AZ::Vector3(scale.GetMaxElement())); + worldFromLocalWithUniformScale.SetUniformScale(worldFromLocalWithUniformScale.GetUniformScale()); debugDisplay.PushMatrix(worldFromLocalWithUniformScale); diff --git a/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp index c06d38a612..05472df8be 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/SphereShape.cpp @@ -136,7 +136,7 @@ namespace LmbrCentral [[maybe_unused]] const AZ::Vector3& currentNonUniformScale) { m_position = currentTransform.GetTranslation(); - m_radius = configuration.m_radius * currentTransform.GetScale().GetMaxElement(); + m_radius = configuration.m_radius * currentTransform.GetUniformScale(); } void DrawSphereShape( diff --git a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp index 6ca2e55de8..0db2660e01 100644 --- a/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp +++ b/Gems/LmbrCentral/Code/Source/Shape/TubeShape.cpp @@ -187,7 +187,7 @@ namespace LmbrCentral static AZ::Aabb CalculateTubeBounds(const TubeShape& tubeShape, const AZ::Transform& transform) { - const auto maxScale = transform.GetScale().GetMaxElement(); + const auto maxScale = transform.GetUniformScale(); const auto scaledRadiusFn = [&tubeShape, maxScale](const AZ::SplineAddress& splineAddress) { @@ -217,8 +217,7 @@ namespace LmbrCentral } AZ::Transform worldFromLocalUniformScale = m_currentTransform; - const float maxScale = worldFromLocalUniformScale.ExtractScale().GetMaxElement(); - worldFromLocalUniformScale *= AZ::Transform::CreateScale(AZ::Vector3(maxScale)); + worldFromLocalUniformScale.SetUniformScale(worldFromLocalUniformScale.GetUniformScale()); return CalculateTubeBounds(*this, worldFromLocalUniformScale); } @@ -237,45 +236,43 @@ namespace LmbrCentral } AZ::Transform worldFromLocalNormalized = m_currentTransform; - const AZ::Vector3 scale = AZ::Vector3(worldFromLocalNormalized.ExtractScale().GetMaxElement()); + const float scale = worldFromLocalNormalized.ExtractUniformScale(); const AZ::Transform localFromWorldNormalized = worldFromLocalNormalized.GetInverse(); - const AZ::Vector3 localPoint = localFromWorldNormalized.TransformPoint(point) * scale.GetReciprocal(); + const AZ::Vector3 localPoint = localFromWorldNormalized.TransformPoint(point) / scale; const auto address = m_spline->GetNearestAddressPosition(localPoint).m_splineAddress; const float radiusSq = powf(m_radius, 2.0f); const float variableRadiusSq = powf(m_variableRadius.GetElementInterpolated(address, Lerpf), 2.0f); - return (m_spline->GetPosition(address) - localPoint).GetLengthSq() < (radiusSq + variableRadiusSq) * - scale.GetMaxElement(); + return (m_spline->GetPosition(address) - localPoint).GetLengthSq() < (radiusSq + variableRadiusSq) * scale; } float TubeShape::DistanceSquaredFromPoint(const AZ::Vector3& point) { AZ::Transform worldFromLocalNormalized = m_currentTransform; - const AZ::Vector3 maxScale = AZ::Vector3(worldFromLocalNormalized.ExtractScale().GetMaxElement()); + const float uniformScale = worldFromLocalNormalized.ExtractUniformScale(); const AZ::Transform localFromWorldNormalized = worldFromLocalNormalized.GetInverse(); - const AZ::Vector3 localPoint = localFromWorldNormalized.TransformPoint(point) * maxScale.GetReciprocal(); + const AZ::Vector3 localPoint = localFromWorldNormalized.TransformPoint(point) / uniformScale; const auto splineQueryResult = m_spline->GetNearestAddressPosition(localPoint); const float variableRadius = m_variableRadius.GetElementInterpolated(splineQueryResult.m_splineAddress, Lerpf); - return powf((sqrtf(splineQueryResult.m_distanceSq) - (m_radius + variableRadius)) * maxScale.GetMaxElement(), 2.0f); + return powf((sqrtf(splineQueryResult.m_distanceSq) - (m_radius + variableRadius)) * uniformScale, 2.0f); } bool TubeShape::IntersectRay(const AZ::Vector3& src, const AZ::Vector3& dir, float& distance) { AZ::Transform transformUniformScale = m_currentTransform; - const float maxScale = transformUniformScale.ExtractScale().GetMaxElement(); - transformUniformScale *= AZ::Transform::CreateScale(AZ::Vector3(maxScale)); + transformUniformScale.SetUniformScale(transformUniformScale.GetUniformScale()); const auto splineQueryResult = IntersectSpline(transformUniformScale, src, dir, *m_spline); const float variableRadius = m_variableRadius.GetElementInterpolated( splineQueryResult.m_splineAddress, Lerpf); const float totalRadius = m_radius + variableRadius; - distance = (splineQueryResult.m_rayDistance - totalRadius) * m_currentTransform.GetScale().GetMaxElement(); + distance = (splineQueryResult.m_rayDistance - totalRadius) * m_currentTransform.GetUniformScale(); return static_cast(sqrtf(splineQueryResult.m_distanceSq)) < totalRadius; } diff --git a/Gems/LmbrCentral/Code/Tests/BoxShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/BoxShapeTest.cpp index fd1e4ae4f1..5df486d9a2 100644 --- a/Gems/LmbrCentral/Code/Tests/BoxShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/BoxShapeTest.cpp @@ -262,7 +262,7 @@ namespace UnitTest AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisY(), AZ::Constants::QuarterPi), AZ::Vector3(0.0f, 0.0f, 5.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f)), + AZ::Transform::CreateUniformScale(3.0f), AZ::Vector3(2.0f, 4.0f, 1.0f), entity); bool rayHit = false; @@ -295,7 +295,7 @@ namespace UnitTest { AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateTranslation(AZ::Vector3(2.0f, -5.0f, 3.0f)); - transform.MultiplyByScale(AZ::Vector3(0.5f)); + transform.MultiplyByUniformScale(0.5f); const AZ::Vector3 dimensions(2.2f, 1.8f, 0.4f); const AZ::Vector3 nonUniformScale(0.2f, 2.6f, 1.2f); CreateBoxWithNonUniformScale(transform, dimensions, nonUniformScale, entity); @@ -340,7 +340,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.50f, 0.10f, 0.02f, 0.86f), AZ::Vector3(4.0f, 1.0f, -2.0f)); - transform.MultiplyByScale(AZ::Vector3(1.5f)); + transform.MultiplyByUniformScale(1.5f); const AZ::Vector3 dimensions(1.2f, 0.7f, 2.1f); const AZ::Vector3 nonUniformScale(0.8f, 0.6f, 0.7f); CreateBoxWithNonUniformScale(transform, dimensions, nonUniformScale, entity); @@ -433,7 +433,7 @@ namespace UnitTest AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisY(), AZ::Constants::QuarterPi), AZ::Vector3::CreateZero()) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f)), + AZ::Transform::CreateUniformScale(3.0f), AZ::Vector3(2.0f, 4.0f, 1.0f), entity); AZ::Aabb aabb; @@ -483,7 +483,7 @@ namespace UnitTest AZ::Transform transformIn = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisX(), AZ::Constants::QuarterPi) * AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisY(), AZ::Constants::QuarterPi), AZ::Vector3(9.0f, 11.0f, 13.0f)); - transformIn.MultiplyByScale(AZ::Vector3(3.0f)); + transformIn.MultiplyByUniformScale(3.0f); CreateBox(transformIn, AZ::Vector3(1.5f, 3.5f, 5.5f), entity); AZ::Transform transformOut; @@ -500,7 +500,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transformIn = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.62f, 0.62f, 0.14f, 0.46f), AZ::Vector3(0.8f, -1.2f, 2.7f)); - transformIn.MultiplyByScale(AZ::Vector3(2.0f)); + transformIn.MultiplyByUniformScale(2.0f); const AZ::Vector3 nonUniformScale(1.5f, 2.0f, 0.4f); const AZ::Vector3 boxDimensions(2.0f, 1.7f, 0.5f); CreateBoxWithNonUniformScale(transformIn, nonUniformScale, boxDimensions, entity); @@ -531,7 +531,7 @@ namespace UnitTest AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisZ(), AZ::Constants::QuarterPi), AZ::Vector3(23.0f, 12.0f, 40.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f)), + AZ::Transform::CreateUniformScale(3.0f), AZ::Vector3(2.0f, 6.0f, 3.5f), entity); // test some pairs of nearby points which should be just either side of the surface of the box @@ -551,7 +551,7 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(23.0f, 12.0f, 40.0f)) * AZ::Transform::CreateRotationX(-AZ::Constants::QuarterPi) * AZ::Transform::CreateRotationZ(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), AZ::Vector3(4.0f, 7.0f, 3.5f), entity); // test some pairs of nearby points which should be just either side of the surface of the box @@ -588,14 +588,14 @@ namespace UnitTest CreateBox( AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 37.0f, 32.0f)) * AZ::Transform::CreateRotationZ(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f, 1.0f, 1.0f)), - AZ::Vector3(4.0f, 2.0f, 10.0f), entity); + AZ::Transform::CreateUniformScale(2.0f), + AZ::Vector3(6.0f, 1.0f, 5.0f), entity); float distance; LmbrCentral::ShapeComponentRequestsBus::EventResult( - distance, entity.GetId(), &LmbrCentral::ShapeComponentRequests::DistanceFromPoint, AZ::Vector3(3.6356f, 30.636f, 40.0f)); + distance, entity.GetId(), &LmbrCentral::ShapeComponentRequests::DistanceFromPoint, AZ::Vector3(4.0f, 33.5f, 38.0f)); - EXPECT_NEAR(distance, 3.0f, 1e-2f); + EXPECT_NEAR(distance, 1.45f, 1e-2f); } // distance scaled @@ -606,14 +606,14 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(10.0f, 37.0f, 32.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::HalfPi) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f, 1.0f, 1.0f)), - AZ::Vector3(4.0f, 2.0f, 10.0f), entity); + AZ::Transform::CreateUniformScale(0.5f), + AZ::Vector3(24.0f, 4.0f, 20.0f), entity); float distance; LmbrCentral::ShapeComponentRequestsBus::EventResult( distance, entity.GetId(), &LmbrCentral::ShapeComponentRequests::DistanceFromPoint, AZ::Vector3(10.0f, 37.0f, 48.0f)); - EXPECT_NEAR(distance, 13.0f, 1e-2f); + EXPECT_NEAR(distance, 15.0f, 1e-2f); } TEST_F(BoxShapeTest, DistanceFromPointNonUniformScale) @@ -621,7 +621,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateRotationY(AZ::DegToRad(30.0f)), AZ::Vector3(3.0f, 4.0f, 5.0f)); - transform.MultiplyByScale(AZ::Vector3(2.0f)); + transform.MultiplyByUniformScale(2.0f); const AZ::Vector3 dimensions(2.0f, 3.0f, 1.5f); const AZ::Vector3 nonUniformScale(1.4f, 2.2f, 0.8f); CreateBoxWithNonUniformScale(transform, nonUniformScale, dimensions, entity); @@ -638,7 +638,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.70f, 0.10f, 0.34f, 0.62f), AZ::Vector3(3.0f, -1.0f, 2.0f)); - transform.MultiplyByScale(AZ::Vector3(2.0f)); + transform.MultiplyByUniformScale(2.0f); const AZ::Vector3 dimensions(1.2f, 0.8f, 1.7f); const AZ::Vector3 nonUniformScale(2.4f, 1.3f, 1.8f); CreateBoxWithNonUniformScale(transform, nonUniformScale, dimensions, entity); diff --git a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp index f082ef74f9..44fe70af80 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/CopyDependencyBuilderTest.cpp @@ -217,6 +217,9 @@ protected: const char* GetAbsoluteDevGameFolderPath() override { return ""; } const char* GetAbsoluteDevRootFolderPath() override { return ""; } bool GetRelativeProductPathFromFullSourceOrProductPath([[maybe_unused]] const AZStd::string& fullPath, [[maybe_unused]] AZStd::string& relativeProductPath) { return true; } + bool GenerateRelativeSourcePath( + [[maybe_unused]] const AZStd::string& sourcePath, [[maybe_unused]] AZStd::string& relativePath, + [[maybe_unused]] AZStd::string& watchFolder) { return true; } bool GetFullSourcePathFromRelativeProductPath([[maybe_unused]] const AZStd::string& relPath, [[maybe_unused]] AZStd::string& fullSourcePath) { return true; } bool GetAssetInfoById([[maybe_unused]] const AZ::Data::AssetId& assetId, [[maybe_unused]] const AZ::Data::AssetType& assetType, [[maybe_unused]] const AZStd::string& platformName, [[maybe_unused]] AZ::Data::AssetInfo& assetInfo, [[maybe_unused]] AZStd::string& rootFilePath) { return true; } bool GetSourceInfoBySourcePath([[maybe_unused]] const char* sourcePath, [[maybe_unused]] AZ::Data::AssetInfo& assetInfo, [[maybe_unused]] AZStd::string& watchFolder) { return true; } diff --git a/Gems/LmbrCentral/Code/Tests/Builders/LevelBuilderTest.cpp b/Gems/LmbrCentral/Code/Tests/Builders/LevelBuilderTest.cpp index 58e7e9e093..470a2abff6 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/LevelBuilderTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/LevelBuilderTest.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -98,6 +99,12 @@ class LevelBuilderTest protected: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(m_descriptor); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash diff --git a/Gems/LmbrCentral/Code/Tests/Builders/LuaBuilderTests.cpp b/Gems/LmbrCentral/Code/Tests/Builders/LuaBuilderTests.cpp index b8911738f7..99213484fc 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/LuaBuilderTests.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/LuaBuilderTests.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -32,6 +33,12 @@ namespace UnitTest { void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(m_descriptor); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash diff --git a/Gems/LmbrCentral/Code/Tests/Builders/SeedBuilderTests.cpp b/Gems/LmbrCentral/Code/Tests/Builders/SeedBuilderTests.cpp index 20dd3db446..49fc06c160 100644 --- a/Gems/LmbrCentral/Code/Tests/Builders/SeedBuilderTests.cpp +++ b/Gems/LmbrCentral/Code/Tests/Builders/SeedBuilderTests.cpp @@ -12,6 +12,7 @@ #include "LmbrCentral_precompiled.h" #include +#include #include #include #include @@ -22,6 +23,12 @@ class SeedBuilderTests { void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AZ::ComponentApplication::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Gems/LmbrCentral/Code/Tests/CapsuleShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/CapsuleShapeTest.cpp index 9b57cd46c7..3274585e63 100644 --- a/Gems/LmbrCentral/Code/Tests/CapsuleShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/CapsuleShapeTest.cpp @@ -144,7 +144,7 @@ namespace UnitTest CreateCapsule( AZ::Transform::CreateTranslation(AZ::Vector3(-4.0f, -12.0f, -3.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * - AZ::Transform::CreateScale(AZ::Vector3(6.0f)), + AZ::Transform::CreateUniformScale(6.0f), 0.25f, 1.5f, entity); bool rayHit = false; @@ -208,7 +208,7 @@ namespace UnitTest TEST_F(CapsuleShapeTest, GetAabb3) { AZ::Entity entity; - CreateCapsule(AZ::Transform::CreateScale(AZ::Vector3(3.5f)), 2.0f, 4.0f, entity); + CreateCapsule(AZ::Transform::CreateUniformScale(3.5f), 2.0f, 4.0f, entity); AZ::Aabb aabb; LmbrCentral::ShapeComponentRequestsBus::EventResult( @@ -224,7 +224,7 @@ namespace UnitTest AZ::Entity entity; CreateCapsule( AZ::Transform::CreateTranslation(AZ::Vector3(5.0f, 20.0f, 0.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f)), 1.0f, 5.0f, entity); + AZ::Transform::CreateUniformScale(2.5f), 1.0f, 5.0f, entity); AZ::Aabb aabb; LmbrCentral::ShapeComponentRequestsBus::EventResult( @@ -255,7 +255,7 @@ namespace UnitTest AZ::Transform transformIn = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisX(), AZ::Constants::HalfPi) * AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisY(), AZ::Constants::QuarterPi), AZ::Vector3(-10.0f, -10.0f, 0.0f)); - transformIn.MultiplyByScale(AZ::Vector3(3.0f)); + transformIn.MultiplyByUniformScale(3.0f); CreateCapsule(transformIn, 5.0f, 2.0f, entity); AZ::Transform transformOut; @@ -273,7 +273,7 @@ namespace UnitTest AZ::Transform transformIn = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisX(), AZ::Constants::HalfPi) * AZ::Quaternion::CreateFromAxisAngle(AZ::Vector3::CreateAxisY(), AZ::Constants::QuarterPi), AZ::Vector3(-10.0f, -10.0f, 0.0f)); - transformIn.MultiplyByScale(AZ::Vector3(3.0f)); + transformIn.MultiplyByUniformScale(3.0f); CreateCapsule(transformIn, 2.0f, 5.0f, entity); AZ::Transform transformOut; @@ -291,7 +291,7 @@ namespace UnitTest AZ::Entity entity; CreateCapsule( AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f, 1.0f, 1.0f)), // test max scale + AZ::Transform::CreateUniformScale(2.5f), 0.5f, 2.0f, entity); bool inside; @@ -309,7 +309,7 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(0.5f)), + AZ::Transform::CreateUniformScale(0.5f), 0.5f, 2.0f, entity); bool inside; @@ -327,7 +327,7 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 0.5f, 4.0f, entity); float distance; @@ -345,7 +345,7 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 0.5f, 4.0f, entity); float distance; diff --git a/Gems/LmbrCentral/Code/Tests/CylinderShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/CylinderShapeTest.cpp index 893ed3fcac..115abcf5ff 100644 --- a/Gems/LmbrCentral/Code/Tests/CylinderShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/CylinderShapeTest.cpp @@ -138,7 +138,7 @@ namespace UnitTest { AZ::Transform::CreateTranslation(AZ::Vector3(-14.0f, -14.0f, -1.0f)) * AZ::Transform::CreateRotationY(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationZ(AZ::Constants::HalfPi) * - AZ::Transform::CreateScale(AZ::Vector3(4.0f)), + AZ::Transform::CreateUniformScale(4.0f), 1.0f, 1.25f }, // Result: hit, distance, epsilon { true, 2.5f, 1e-2f } @@ -203,7 +203,7 @@ namespace UnitTest // Test case 2 { // Cylinder: transform, radius, height { AZ::Transform::CreateTranslation(AZ::Vector3(-10.0f, -10.0f, 10.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(3.5f)), + AZ::Transform::CreateUniformScale(3.5f), 1.0f, 5.0f }, // AABB: min, max { AZ::Vector3(-13.5f, -13.5f, 1.25f), AZ::Vector3(-6.5f, -6.5f, 18.75f) } }, @@ -236,7 +236,7 @@ namespace UnitTest { AZ::Vector3(-5.0f, -5.0f, -0.5f), AZ::Vector3(5.0f, 5.0f, 0.5f) } }, // Test case 1 { // Cylinder: transform, radius, height - { AZ::Transform::CreateTranslation(AZ::Vector3(-10.0f, -10.0f, 10.0f)) * AZ::Transform::CreateScale(AZ::Vector3(3.5f)), + { AZ::Transform::CreateTranslation(AZ::Vector3(-10.0f, -10.0f, 10.0f)) * AZ::Transform::CreateUniformScale(3.5f), 5.0f, 5.0f }, // Local bounds: min, max { AZ::Vector3(-5.0f, -5.0f, -2.5f), AZ::Vector3(5.0f, 5.0f, 2.5f) } }, @@ -264,7 +264,7 @@ namespace UnitTest // Test case 0 { // Cylinder: transform, radius, height {AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f, 1.0f, 1.0f)), // test max scale + AZ::Transform::CreateUniformScale(2.5f), 0.5f, 2.0f}, // Point AZ::Vector3(27.0f, 28.5f, 40.0f), @@ -275,7 +275,7 @@ namespace UnitTest {AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(0.5f)), + AZ::Transform::CreateUniformScale(0.5f), 0.5f, 2.0f}, // Point AZ::Vector3(27.0f, 28.155f, 37.82f), @@ -316,7 +316,7 @@ namespace UnitTest { AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 0.5f, 4.0f }, // Point AZ::Vector3(27.0f, 28.0f, 41.0f), @@ -327,7 +327,7 @@ namespace UnitTest { AZ::Transform::CreateTranslation(AZ::Vector3(27.0f, 28.0f, 38.0f)) * AZ::Transform::CreateRotationX(AZ::Constants::HalfPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 0.5f, 4.0f }, // Point AZ::Vector3(22.757f, 32.243f, 38.0f), diff --git a/Gems/LmbrCentral/Code/Tests/DiskShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/DiskShapeTest.cpp index 4a39cd966e..c3683cc33b 100644 --- a/Gems/LmbrCentral/Code/Tests/DiskShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/DiskShapeTest.cpp @@ -307,7 +307,7 @@ namespace UnitTest AZ::Entity entity; CreateDisk( AZ::Transform::CreateTranslation(AZ::Vector3(100.0f, 200.0f, 300.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f)), + AZ::Transform::CreateUniformScale(2.5f), 0.5f, entity); AZ::Aabb aabb; diff --git a/Gems/LmbrCentral/Code/Tests/PolygonPrismShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/PolygonPrismShapeTest.cpp index 46c3da90ab..f12ca69425 100644 --- a/Gems/LmbrCentral/Code/Tests/PolygonPrismShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/PolygonPrismShapeTest.cpp @@ -329,7 +329,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateRotationY(AZ::DegToRad(45.0f)), AZ::Vector3(3.0f, 4.0f, 5.0f)); - transform.MultiplyByScale(AZ::Vector3(1.5f, 1.5f, 1.5f)); + transform.MultiplyByUniformScale(1.5f); const float height = 1.2f; const AZ::Vector3 nonUniformScale(2.0f, 1.2f, 0.5f); const AZStd::vector vertices = @@ -447,7 +447,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateRotationY(AZ::DegToRad(45.0f)), AZ::Vector3(3.0f, 4.0f, 5.0f)); - transform.MultiplyByScale(AZ::Vector3(1.5f, 1.5f, 1.5f)); + transform.MultiplyByUniformScale(1.5f); const float height = 1.2f; const AZ::Vector3 nonUniformScale(2.0f, 1.2f, 0.5f); const AZStd::vector vertices = @@ -608,7 +608,7 @@ namespace UnitTest AZ::Entity entity; CreatePolygonPrism( AZ::Transform::CreateTranslation(AZ::Vector3(5.0f, 15.0f, 40.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f)), 2.0f, + AZ::Transform::CreateUniformScale(3.0f), 2.0f, AZStd::vector( { AZ::Vector2(-2.0f, -2.0f), @@ -669,7 +669,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateRotationY(AZ::DegToRad(60.0f)), AZ::Vector3(1.0f, 2.5f, -1.0f)); - transform.MultiplyByScale(AZ::Vector3(2.0f, 2.0f, 2.0f)); + transform.MultiplyByUniformScale(2.0f); const float height = 1.5f; const AZ::Vector3 nonUniformScale(0.5f, 1.5f, 2.0f); @@ -772,7 +772,7 @@ namespace UnitTest AZ::Entity entity; CreatePolygonPrism( AZ::Transform::CreateTranslation(AZ::Vector3(5.0f, 15.0f, 40.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(3.0f)), 1.5f, + AZ::Transform::CreateUniformScale(3.0f), 1.5f, AZStd::vector( { AZ::Vector2(-2.0f, -2.0f), @@ -795,7 +795,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion::CreateRotationX(AZ::DegToRad(30.0f)), AZ::Vector3(2.0f, -5.0f, 3.0f)); - transform.MultiplyByScale(AZ::Vector3(2.0f, 2.0f, 2.0f)); + transform.MultiplyByUniformScale(2.0f); const float height = 1.2f; const AZ::Vector3 nonUniformScale(1.5f, 0.8f, 2.0f); const AZStd::vector vertices = diff --git a/Gems/LmbrCentral/Code/Tests/QuadShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/QuadShapeTest.cpp index d70a9344a4..4b6eae4bb8 100644 --- a/Gems/LmbrCentral/Code/Tests/QuadShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/QuadShapeTest.cpp @@ -188,7 +188,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transformIn = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.46f, 0.34f, 0.02f, 0.82f), AZ::Vector3(1.7f, -0.4f, 2.3f)); - transformIn.MultiplyByScale(AZ::Vector3(2.2f)); + transformIn.MultiplyByUniformScale(2.2f); const AZ::Vector3 nonUniformScale(0.8f, 0.6f, 1.3f); const float width = 0.7f; const float height = 1.3f; @@ -327,7 +327,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.64f, 0.16f, 0.68f, 0.32f), AZ::Vector3(0.4f, -2.3f, -0.9f)); - transform.MultiplyByScale(AZ::Vector3(1.3f)); + transform.MultiplyByUniformScale(1.3f); const AZ::Vector3 nonUniformScale(0.7f, 0.5f, 1.3f); const float width = 0.9f; const float height = 1.3f; @@ -384,7 +384,7 @@ namespace UnitTest AZ::Entity entity; CreateQuad( AZ::Transform::CreateTranslation(AZ::Vector3(100.0f, 200.0f, 300.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f)), + AZ::Transform::CreateUniformScale(2.5f), 1.0f, 2.0f, entity); AZ::Aabb aabb; @@ -425,7 +425,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.44f, 0.24f, 0.48f, 0.72f), AZ::Vector3(3.4f, 1.2f, -2.8f)); - transform.MultiplyByScale(AZ::Vector3(1.5f)); + transform.MultiplyByUniformScale(1.5f); const AZ::Vector3 nonUniformScale(1.2f, 1.1f, 0.8f); const float width = 1.2f; const float height = 1.7f; @@ -518,7 +518,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.24f, 0.72f, 0.44f, 0.48f), AZ::Vector3(2.7f, 2.3f, -1.8f)); - transform.MultiplyByScale(AZ::Vector3(1.2f)); + transform.MultiplyByUniformScale(1.2f); const AZ::Vector3 nonUniformScale(0.4f, 2.2f, 1.3f); const float width = 1.6f; const float height = 0.7f; @@ -546,7 +546,7 @@ namespace UnitTest AZ::Entity entity; AZ::Transform transform = AZ::Transform::CreateFromQuaternionAndTranslation( AZ::Quaternion(0.70f, 0.10f, 0.34f, 0.62f), AZ::Vector3(3.0f, -1.0f, 2.0f)); - transform.MultiplyByScale(AZ::Vector3(2.0f)); + transform.MultiplyByUniformScale(2.0f); const AZ::Vector3 nonUniformScale(2.4f, 1.3f, 1.8f); const float width = 0.8f; const float height = 1.4f; diff --git a/Gems/LmbrCentral/Code/Tests/SphereShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/SphereShapeTest.cpp index 563bb16caa..b5e45f2cda 100644 --- a/Gems/LmbrCentral/Code/Tests/SphereShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/SphereShapeTest.cpp @@ -179,7 +179,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(-8.0f, -15.0f, 5.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(5.0f)), + AZ::Transform::CreateUniformScale(5.0f), 0.25f, entity); bool rayHit = false; @@ -240,7 +240,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(100.0f, 200.0f, 300.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f)), + AZ::Transform::CreateUniformScale(2.5f), 0.5f, entity); AZ::Aabb aabb; @@ -269,7 +269,7 @@ namespace UnitTest TEST_F(SphereShapeTest, GetTransformAndLocalBounds2) { AZ::Entity entity; - AZ::Transform transformIn = AZ::Transform::CreateTranslation(AZ::Vector3(100.0f, 200.0f, 300.0f)) * AZ::Transform::CreateScale(AZ::Vector3(2.5f)); + AZ::Transform transformIn = AZ::Transform::CreateTranslation(AZ::Vector3(100.0f, 200.0f, 300.0f)) * AZ::Transform::CreateUniformScale(2.5f); CreateSphere(transformIn, 2.0f, entity); AZ::Transform transformOut; @@ -287,7 +287,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(-30.0f, -30.0f, 22.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 1.2f, entity); bool inside; @@ -303,7 +303,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(-30.0f, -30.0f, 22.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(1.5f)), + AZ::Transform::CreateUniformScale(1.5f), 1.6f, entity); bool inside; @@ -319,7 +319,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(19.0f, 34.0f, 37.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f)), + AZ::Transform::CreateUniformScale(2.0f), 1.0f, entity); float distance; @@ -335,7 +335,7 @@ namespace UnitTest AZ::Entity entity; CreateSphere( AZ::Transform::CreateTranslation(AZ::Vector3(19.0f, 34.0f, 37.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(0.5f)), + AZ::Transform::CreateUniformScale(0.5f), 1.0f, entity); float distance; diff --git a/Gems/LmbrCentral/Code/Tests/TubeShapeTest.cpp b/Gems/LmbrCentral/Code/Tests/TubeShapeTest.cpp index 65388d1fe5..e9d9c40433 100644 --- a/Gems/LmbrCentral/Code/Tests/TubeShapeTest.cpp +++ b/Gems/LmbrCentral/Code/Tests/TubeShapeTest.cpp @@ -139,7 +139,7 @@ namespace UnitTest AZ::Entity entity; CreateTube( AZ::Transform::CreateTranslation(AZ::Vector3(-40.0f, 6.0f, 1.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.5f, 1.0f, 1.0f)), // test max scale + AZ::Transform::CreateUniformScale(2.5f), 1.0f, entity); @@ -232,7 +232,7 @@ namespace UnitTest TEST_F(TubeShapeTest, GetAabb4) { AZ::Entity entity; - CreateTube(AZ::Transform::CreateScale(AZ::Vector3(1.0f, 1.0f, 2.0f)), 1.0f, entity); + CreateTube(AZ::Transform::CreateUniformScale(2.0f), 1.0f, entity); // set variable radius LmbrCentral::TubeShapeComponentRequestsBus::Event( @@ -254,7 +254,7 @@ namespace UnitTest AZ::Entity entity; CreateTube( AZ::Transform::CreateTranslation(AZ::Vector3(37.0f, 36.0f, 32.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(1.0f, 2.0f, 1.0f)), 1.5f, entity); + AZ::Transform::CreateUniformScale(2.0f), 1.5f, entity); // set variable radius LmbrCentral::TubeShapeComponentRequestsBus::Event( @@ -277,7 +277,7 @@ namespace UnitTest AZ::Transform::CreateTranslation(AZ::Vector3(37.0f, 36.0f, 32.0f)) * AZ::Transform::CreateRotationZ(AZ::Constants::QuarterPi) * AZ::Transform::CreateRotationY(AZ::Constants::QuarterPi) * - AZ::Transform::CreateScale(AZ::Vector3(0.8f, 1.5f, 1.5f)), 1.5f, entity); + AZ::Transform::CreateUniformScale(1.5f), 1.5f, entity); // set variable radius LmbrCentral::TubeShapeComponentRequestsBus::Event( @@ -302,7 +302,7 @@ namespace UnitTest AZ::Entity entity; CreateTube( AZ::Transform::CreateTranslation(AZ::Vector3(37.0f, 36.0f, 39.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f, 1.5f, 1.5f)), 1.5f, entity); + AZ::Transform::CreateUniformScale(2.0f), 1.5f, entity); LmbrCentral::TubeShapeComponentRequestsBus::Event( entity.GetId(), &LmbrCentral::TubeShapeComponentRequestsBus::Events::SetVariableRadius, 0, 1.0f); @@ -326,7 +326,7 @@ namespace UnitTest AZ::Entity entity; CreateTube( AZ::Transform::CreateTranslation(AZ::Vector3(37.0f, 36.0f, 39.0f)) * - AZ::Transform::CreateScale(AZ::Vector3(2.0f, 1.5f, 1.5f)), 1.5f, entity); + AZ::Transform::CreateUniformScale(2.0f), 1.5f, entity); LmbrCentral::TubeShapeComponentRequestsBus::Event( entity.GetId(), &LmbrCentral::TubeShapeComponentRequestsBus::Events::SetVariableRadius, 0, 1.0f); diff --git a/Gems/LocalUser/Code/CMakeLists.txt b/Gems/LocalUser/Code/CMakeLists.txt index 6198d88e15..3f2b513282 100644 --- a/Gems/LocalUser/Code/CMakeLists.txt +++ b/Gems/LocalUser/Code/CMakeLists.txt @@ -43,6 +43,9 @@ ly_add_target( Gem::LocalUser.Static ) +# by default, load the above "Gem::LocalUser" module in client applications +ly_create_alias(NAME LocalUser.Clients NAMESPACE Gem TARGETS Gem::LocalUser) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/LyShine/Assets/Editor/Icons/Viewport/Canvas_Background.tif.assetinfo b/Gems/LyShine/Assets/Editor/Icons/Viewport/Canvas_Background.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShine/Assets/Editor/Icons/Viewport/Canvas_Background.tif.assetinfo +++ b/Gems/LyShine/Assets/Editor/Icons/Viewport/Canvas_Background.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShine/Code/CMakeLists.txt b/Gems/LyShine/Code/CMakeLists.txt index 732bd1cfd4..4dede1c6ac 100644 --- a/Gems/LyShine/Code/CMakeLists.txt +++ b/Gems/LyShine/Code/CMakeLists.txt @@ -27,12 +27,12 @@ ly_add_target( PRIVATE Legacy::CryCommon Gem::LmbrCentral - Gem::TextureAtlas PUBLIC Gem::Atom_RPI.Public Gem::Atom_Utils.Static Gem::Atom_Bootstrap.Headers Gem::AtomFont + Gem::TextureAtlas ) ly_add_target( @@ -50,12 +50,14 @@ ly_add_target( Gem::LyShine.Static Legacy::CryCommon Gem::LmbrCentral - Gem::TextureAtlas RUNTIME_DEPENDENCIES Gem::LmbrCentral Gem::TextureAtlas ) +# by default, load the above "Gem::LyShine" module in Client applications: +ly_create_alias(NAME LyShine.Clients NAMESPACE Gem TARGETS Gem::LyShine) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME LyShine.Editor.Static STATIC @@ -85,8 +87,8 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::EditorCore Gem::LyShine.Static Legacy::CryCommon - Gem::LmbrCentral - Gem::TextureAtlas + Gem::LmbrCentral.Editor + Gem::TextureAtlas.Editor Gem::AtomToolsFramework.Static Gem::AtomToolsFramework.Editor ${additional_dependencies} @@ -94,6 +96,8 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Gem::Atom_RPI.Public Gem::Atom_Utils.Static Gem::Atom_Bootstrap.Headers + RUNTIME_DEPENDENCIES + Gem::TextureAtlas.Editor ) ly_add_target( @@ -117,12 +121,16 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::CryCommon AZ::AssetBuilderSDK Gem::LyShine.Editor.Static - Gem::LmbrCentral - Gem::TextureAtlas + Gem::LmbrCentral.Editor + Gem::TextureAtlas.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor - Gem::TextureAtlas + Gem::TextureAtlas.Editor ) + + # by default, load the above "Gem::LyShine.Editor" module in dev tools: + ly_create_alias(NAME LyShine.Builders NAMESPACE Gem TARGETS Gem::LyShine.Editor) + ly_create_alias(NAME LyShine.Tools NAMESPACE Gem TARGETS Gem::LyShine.Editor) endif() ################################################################################ @@ -146,7 +154,9 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) Gem::LyShine.Static Legacy::CryCommon Gem::LmbrCentral - Gem::TextureAtlas + RUNTIME_DEPENDENCIES + Gem::LmbrCentral + Gem::TextureAtlas ) ly_add_googletest( NAME Gem::LyShine.Tests @@ -175,9 +185,12 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Legacy::CryCommon AZ::AssetBuilderSDK - Gem::LmbrCentral - Gem::TextureAtlas Gem::LyShine.Editor.Static + Gem::LmbrCentral.Editor + Gem::TextureAtlas + RUNTIME_DEPENDENCIES + Gem::LmbrCentral.Editor + Gem::TextureAtlas.Editor ) ly_add_googletest( NAME Gem::LyShine.Editor.Tests diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp index 61f6e0f3dc..893790d0f5 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp @@ -158,7 +158,10 @@ bool PropertyHandlerDirectory::ReadValuesIntoGUI(size_t index, PropertyDirectory ctrl->blockSignals(true); { + // Set currently selected folder path + // Note: this must be done before setting asset type below which updates the GUI display ctrl->SetCurrentAssetHint(instance); + ctrl->SetFolderSelection(instance); // We need to set the asset type so the property panel labels get // populated properly (via SetCurrentAssetType). To avoid defining @@ -166,8 +169,6 @@ bool PropertyHandlerDirectory::ReadValuesIntoGUI(size_t index, PropertyDirectory // logic to run (otherwise it will early-out due to invalid asset type). const char* throwAwayAssetType = "{43EDD212-F589-43C8-BC02-A8F9243271CB}"; ctrl->SetCurrentAssetType(AZ::Data::AssetType(throwAwayAssetType)); - - ctrl->SetFolderSelection(instance); } ctrl->blockSignals(false); diff --git a/Gems/LyShine/Code/Editor/ViewportHelpers.cpp b/Gems/LyShine/Code/Editor/ViewportHelpers.cpp index 428554a461..2195d2c9d4 100644 --- a/Gems/LyShine/Code/Editor/ViewportHelpers.cpp +++ b/Gems/LyShine/Code/Editor/ViewportHelpers.cpp @@ -30,6 +30,11 @@ namespace ViewportHelpers return isControlledByParent; } + float GetDpiScaledSize(float size) + { + return size * ViewportIcon::GetDpiScaleFactor(); + } + bool IsHorizontallyFit(const AZ::Entity* element) { bool isHorizontallyFit = false; @@ -332,11 +337,12 @@ namespace ViewportHelpers AZ::Vector2 pivotPos; EBUS_EVENT_ID_RESULT(pivotPos, element->GetId(), UiTransformBus, GetViewportSpacePivot); - AZ::Vector2 rotationStringPos(pivotPos.GetX(), pivotPos.GetY() - ((viewportPivot->GetSize().GetY() * 0.5f) + 4.0f)); + float offset = (viewportPivot->GetSize().GetY() * 0.5f) + (GetDpiScaledSize(4.0f)); + AZ::Vector2 rotationStringPos(pivotPos.GetX(), pivotPos.GetY() - offset); draw2d.SetTextAlignment(IDraw2d::HAlign::Center, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(0.0f); - draw2d.DrawText(rotationString.toUtf8().data(), rotationStringPos, 16.0f, 1.0f); + draw2d.DrawText(rotationString.toUtf8().data(), rotationStringPos, GetDpiScaledSize(16.0f), 1.0f); } } @@ -350,6 +356,6 @@ namespace ViewportHelpers draw2d.SetTextAlignment(IDraw2d::HAlign::Left, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(0.0f); - draw2d.DrawText(textLabel.c_str(), textPos, 16.0f, 1.0f); + draw2d.DrawText(textLabel.c_str(), textPos, GetDpiScaledSize(16.0f), 1.0f); } } // namespace ViewportHelpers diff --git a/Gems/LyShine/Code/Editor/ViewportIcon.cpp b/Gems/LyShine/Code/Editor/ViewportIcon.cpp index b1866efb00..4be06b2543 100644 --- a/Gems/LyShine/Code/Editor/ViewportIcon.cpp +++ b/Gems/LyShine/Code/Editor/ViewportIcon.cpp @@ -303,7 +303,7 @@ void ViewportIcon::DrawDistanceLine(Draw2dHelper& draw2d, AZ::Vector2 start, AZ: draw2d.SetTextAlignment(IDraw2d::HAlign::Center, IDraw2d::VAlign::Bottom); draw2d.SetTextRotation(rotation); - draw2d.DrawText(textBuf, textPos, 16.0f, 1.0f); + draw2d.DrawText(textBuf, textPos, 16.0f * ViewportIcon::GetDpiScaleFactor(), 1.0f); } void ViewportIcon::DrawAnchorLinesSplit(Draw2dHelper& draw2d, AZ::Vector2 anchorPos1, AZ::Vector2 anchorPos2, diff --git a/Gems/LyShine/Code/Include/LyShine/Draw2d.h b/Gems/LyShine/Code/Include/LyShine/Draw2d.h index 8270461e73..b83ec4794b 100644 --- a/Gems/LyShine/Code/Include/LyShine/Draw2d.h +++ b/Gems/LyShine/Code/Include/LyShine/Draw2d.h @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -256,9 +257,8 @@ protected: // types and constants const Draw2dShaderData& shaderData, AZ::RPI::ViewportContextPtr viewportContext) const override; - STextDrawContext m_fontContext; - IFFont* m_font; - AZ::Vector2 m_position; + AzFramework::TextDrawParameters m_drawParameters; + AzFramework::FontId m_fontId; std::string m_string; }; @@ -288,7 +288,7 @@ protected: // member functions void RotatePointsAboutPivot(AZ::Vector2* points, int numPoints, AZ::Vector2 pivot, float angle) const; //! Helper function to render a text string - void DrawTextInternal(const char* textString, IFFont* font, unsigned int effectIndex, + void DrawTextInternal(const char* textString, AzFramework::FontId fontId, unsigned int effectIndex, AZ::Vector2 position, float pointSize, AZ::Color color, float rotation, HAlign horizontalAlignment, VAlign verticalAlignment, int baseState); @@ -298,6 +298,9 @@ protected: // member functions //! Draw or defer a line void DrawOrDeferLine(const DeferredLine* line); + //! Draw or defer a text string + void DrawOrDeferTextString(const DeferredText* text); + //! Draw or defer a rect outline void DrawOrDeferRectOutline(const DeferredRectOutline* outlineRect); @@ -491,7 +494,7 @@ public: // member functions void SetImageBaseState(int state) { m_imageOptions.baseState = state; } //! Set the text font. - void SetTextFont(IFFont* font) { m_textOptions.font = 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; } diff --git a/Gems/LyShine/Code/Source/Draw2d.cpp b/Gems/LyShine/Code/Source/Draw2d.cpp index 1a639ea299..6feb47419d 100644 --- a/Gems/LyShine/Code/Source/Draw2d.cpp +++ b/Gems/LyShine/Code/Source/Draw2d.cpp @@ -11,11 +11,13 @@ */ #include "LyShine_precompiled.h" #include "IFont.h" +#include // for SVF_P3F_C4B_T2F which will be removed in a coming PR #include #include #include +#include #include #include @@ -55,7 +57,7 @@ CDraw2d::CDraw2d(AZ::RPI::ViewportContextPtr viewportContext) m_defaultImageOptions.pixelRounding = Rounding::Nearest; m_defaultImageOptions.baseState = g_defaultBaseState; - m_defaultTextOptions.font = (gEnv && gEnv->pCryFont != nullptr) ? gEnv->pCryFont->GetFont("default") : nullptr; + m_defaultTextOptions.fontName = "default"; m_defaultTextOptions.effectIndex = 0; m_defaultTextOptions.color.Set(1.0f, 1.0f, 1.0f); m_defaultTextOptions.horizontalAlignment = HAlign::Left; @@ -283,13 +285,20 @@ void CDraw2d::DrawText(const char* textString, AZ::Vector2 position, float point { TextOptions* actualTextOptions = (textOptions) ? textOptions : &m_defaultTextOptions; + AzFramework::FontId fontId = AzFramework::InvalidFontId; + AzFramework::FontQueryInterface* fontQueryInterface = AZ::Interface::Get(); + if (fontQueryInterface) + { + fontId = fontQueryInterface->GetFontId(actualTextOptions->fontName); + } + // render the drop shadow, if needed if ((actualTextOptions->dropShadowColor.GetA() > 0.0f) && (actualTextOptions->dropShadowOffset.GetX() || actualTextOptions->dropShadowOffset.GetY())) { // calculate the drop shadow pos and render it AZ::Vector2 dropShadowPosition(position + actualTextOptions->dropShadowOffset); - DrawTextInternal(textString, actualTextOptions->font, actualTextOptions->effectIndex, + DrawTextInternal(textString, fontId, actualTextOptions->effectIndex, dropShadowPosition, pointSize, actualTextOptions->dropShadowColor, actualTextOptions->rotation, actualTextOptions->horizontalAlignment, actualTextOptions->verticalAlignment, @@ -298,7 +307,7 @@ void CDraw2d::DrawText(const char* textString, AZ::Vector2 position, float point // draw the text string AZ::Color textColor = AZ::Color::CreateFromVector3AndFloat(actualTextOptions->color, opacity); - DrawTextInternal(textString, actualTextOptions->font, actualTextOptions->effectIndex, + DrawTextInternal(textString, fontId, actualTextOptions->effectIndex, position, pointSize, textColor, actualTextOptions->rotation, actualTextOptions->horizontalAlignment, actualTextOptions->verticalAlignment, @@ -398,20 +407,35 @@ void CDraw2d::DrawRectOutlineTextured(AZ::Data::Instance image, //////////////////////////////////////////////////////////////////////////////////////////////////// AZ::Vector2 CDraw2d::GetTextSize(const char* textString, float pointSize, TextOptions* textOptions) { - TextOptions* actualTextOptions = (textOptions) ? textOptions : &m_defaultTextOptions; - - if (!actualTextOptions->font) + AzFramework::FontDrawInterface* fontDrawInterface = nullptr; + AzFramework::FontQueryInterface* fontQueryInterface = AZ::Interface::Get(); + if (fontQueryInterface) + { + TextOptions* actualTextOptions = (textOptions) ? textOptions : &m_defaultTextOptions; + AzFramework::FontId fontId = fontQueryInterface->GetFontId(actualTextOptions->fontName); + fontDrawInterface = fontQueryInterface->GetFontDrawInterface(fontId); + } + if (!fontDrawInterface) { return AZ::Vector2(0.0f, 0.0f); } - STextDrawContext fontContext; - fontContext.SetEffect(actualTextOptions->effectIndex); - fontContext.SetSizeIn800x600(false); - fontContext.SetSize(vector2f(pointSize, pointSize)); + // Set up draw parameters + AzFramework::TextDrawParameters drawParams; + drawParams.m_drawViewportId = GetViewportContext()->GetId(); + drawParams.m_position = AZ::Vector3(0.0f, 0.0f, 1.0f); + drawParams.m_effectIndex = 0; + drawParams.m_textSizeFactor = pointSize; + drawParams.m_scale = AZ::Vector2(1.0f, 1.0f); + drawParams.m_lineSpacing = 1.0f; + drawParams.m_monospace = false; + drawParams.m_depthTest = false; + drawParams.m_virtual800x600ScreenSize = false; + drawParams.m_scaleWithWindow = false; + drawParams.m_multiline = true; - Vec2 textSize = actualTextOptions->font->GetTextSize(textString, true, fontContext); - return AZ::Vector2(textSize.x, textSize.y); + AZ::Vector2 textSize = fontDrawInterface->GetTextSize(drawParams, textString); + return textSize; } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -559,100 +583,89 @@ void CDraw2d::RotatePointsAboutPivot(AZ::Vector2* points, [[maybe_unused]] int n } //////////////////////////////////////////////////////////////////////////////////////////////////// -void CDraw2d::DrawTextInternal(const char* textString, IFFont* font, unsigned int effectIndex, +void CDraw2d::DrawTextInternal(const char* textString, AzFramework::FontId fontId, unsigned int effectIndex, AZ::Vector2 position, float pointSize, AZ::Color color, float rotation, - HAlign horizontalAlignment, VAlign verticalAlignment, int baseState) + HAlign horizontalAlignment, VAlign verticalAlignment, [[maybe_unused]] int baseState) { - if (!font) - { - return; - } - - STextDrawContext fontContext; - fontContext.SetEffect(effectIndex); - fontContext.SetSizeIn800x600(false); - fontContext.SetSize(vector2f(pointSize, pointSize)); - fontContext.SetColor(ColorF(color.GetR(), color.GetG(), color.GetB(), color.GetA())); - fontContext.m_baseState = baseState; - fontContext.SetOverrideViewProjMatrices(false); - // FFont.cpp uses the alpha value of the color to decide whether to use the color, if the alpha value is zero // (in a ColorB format) then the color set via SetColor is ignored and it usually ends up drawing with an alpha of 1. // This is not what we want so in this case do not draw at all. - if (!fontContext.IsColorOverridden()) + if (AZ::IsClose(color.GetA(), 0.0f)) { return; } - AZ::Vector2 alignedPosition; - if (horizontalAlignment == HAlign::Left && verticalAlignment == VAlign::Top) + // Convert Draw2d alignment to text alignment + AzFramework::TextHorizontalAlignment hAlignment = AzFramework::TextHorizontalAlignment::Left; + switch (horizontalAlignment) { - alignedPosition = position; - } - else - { - // we align based on the size of the default font effect, because we do not want the - // text to move when the font effect is changed - unsigned int fontEffectIndex = fontContext.m_fxIdx; - fontContext.SetEffect(0); - Vec2 textSize = font->GetTextSize(textString, true, fontContext); - fontContext.SetEffect(fontEffectIndex); - - alignedPosition = Align(position, AZ::Vector2(textSize.x, textSize.y), horizontalAlignment, verticalAlignment); + case HAlign::Left: + hAlignment = AzFramework::TextHorizontalAlignment::Left; + break; + case HAlign::Center: + hAlignment = AzFramework::TextHorizontalAlignment::Center; + break; + case HAlign::Right: + hAlignment = AzFramework::TextHorizontalAlignment::Right; + break; + default: + AZ_Assert(false, "Attempting to draw text with unsupported horizontal alignment."); + break; } - int flags = 0; + AzFramework::TextVerticalAlignment vAlignment = AzFramework::TextVerticalAlignment::Top; + switch (verticalAlignment) + { + case VAlign::Top: + vAlignment = AzFramework::TextVerticalAlignment::Top; + break; + case VAlign::Center: + vAlignment = AzFramework::TextVerticalAlignment::Center; + break; + case VAlign::Bottom: + vAlignment = AzFramework::TextVerticalAlignment::Bottom; + break; + default: + AZ_Assert(false, "Attempting to draw text with unsupported vertical alignment."); + break; + } + + // Set up draw parameters for font interface + AzFramework::TextDrawParameters drawParams; + drawParams.m_drawViewportId = GetViewportContext()->GetId(); + drawParams.m_position = AZ::Vector3(position.GetX(), position.GetY(), 1.0f); + drawParams.m_color = color; + drawParams.m_effectIndex = effectIndex; + drawParams.m_textSizeFactor = pointSize; + drawParams.m_scale = AZ::Vector2(1.0f, 1.0f); + drawParams.m_lineSpacing = 1.0f; //!< Spacing between new lines, as a percentage of m_scale. + drawParams.m_hAlign = hAlignment; + drawParams.m_vAlign = vAlignment; + drawParams.m_monospace = false; + drawParams.m_depthTest = false; + drawParams.m_virtual800x600ScreenSize = false; + drawParams.m_scaleWithWindow = false; + drawParams.m_multiline = true; + if (rotation != 0.0f) { // rotate around the position (if aligned to center will rotate about center etc) float rotRad = DEG2RAD(rotation); - Vec3 pivot(position.GetX(), position.GetY(), 0.0f); - Matrix34A moveToPivotSpaceMat = Matrix34A::CreateTranslationMat(-pivot); - Matrix34A rotMat = Matrix34A::CreateRotationZ(rotRad); - Matrix34A moveFromPivotSpaceMat = Matrix34A::CreateTranslationMat(pivot); + AZ::Vector3 pivot(position.GetX(), position.GetY(), 0.0f); + AZ::Matrix3x4 moveToPivotSpaceMat = AZ::Matrix3x4::CreateTranslation(-pivot); + AZ::Matrix3x4 rotMat = AZ::Matrix3x4::CreateRotationZ(rotRad); + AZ::Matrix3x4 moveFromPivotSpaceMat = AZ::Matrix3x4::CreateTranslation(pivot); - Matrix34A transform = moveFromPivotSpaceMat * rotMat * moveToPivotSpaceMat; - fontContext.SetTransform(transform); - flags |= eDrawText_UseTransform; + drawParams.m_transform = moveFromPivotSpaceMat * rotMat * moveToPivotSpaceMat; + drawParams.m_useTransform = true; } - // The font system uses these alignment flags to force text to be in the safe zone - // depending on overscan etc - if (horizontalAlignment == HAlign::Center) - { - flags |= eDrawText_Center; - } - else if (horizontalAlignment == HAlign::Right) - { - flags |= eDrawText_Right; - } + DeferredText newText; + newText.m_drawParameters = drawParams; + newText.m_fontId = fontId; + newText.m_string = textString; - if (verticalAlignment == VAlign::Center) - { - flags |= eDrawText_CenterV; - } - else if (verticalAlignment == VAlign::Bottom) - { - flags |= eDrawText_Bottom; - } - - fontContext.SetFlags(flags); - - if (m_deferCalls) - { - DeferredText* newText = new DeferredText; - - newText->m_fontContext = fontContext; - newText->m_font = font; - newText->m_position = alignedPosition; - newText->m_string = textString; - - m_deferredPrimitives.push_back(newText); - } - else - { - font->DrawString(alignedPosition.GetX(), alignedPosition.GetY(), textString, true, fontContext); - } + DrawOrDeferTextString(&newText); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -685,6 +698,20 @@ void CDraw2d::DrawOrDeferLine(const DeferredLine* line) } } +void CDraw2d::DrawOrDeferTextString(const DeferredText* text) +{ + if (m_deferCalls) + { + DeferredText* newText = new DeferredText; + *newText = *text; + m_deferredPrimitives.push_back(newText); + } + else + { + text->Draw(m_dynamicDraw, m_shaderData, GetViewportContext()); + } +} + void CDraw2d::DrawOrDeferRectOutline(const DeferredRectOutline* rectOutline) { if (m_deferCalls) @@ -919,6 +946,15 @@ void CDraw2d::DeferredText::Draw([[maybe_unused]] AZ::RHI::PtrDrawString(m_position.GetX(), m_position.GetY(), m_string.c_str(), true, m_fontContext); + AzFramework::FontDrawInterface* fontDrawInterface = nullptr; + AzFramework::FontQueryInterface* fontQueryInterface = AZ::Interface::Get(); + if (fontQueryInterface) + { + fontDrawInterface = fontQueryInterface->GetFontDrawInterface(m_fontId); + if (fontDrawInterface) + { + fontDrawInterface->DrawScreenAlignedText2d(m_drawParameters, m_string.c_str()); + } + } } diff --git a/Gems/LyShine/Code/Source/LyShine.cpp b/Gems/LyShine/Code/Source/LyShine.cpp index 679cae3421..fb6dcb2628 100644 --- a/Gems/LyShine/Code/Source/LyShine.cpp +++ b/Gems/LyShine/Code/Source/LyShine.cpp @@ -454,7 +454,6 @@ void CLyShine::Render() GetUiRenderer()->EndUiFrameRender(); -#ifdef LYSHINE_ATOM_TODO // convert debug info to Atom #ifndef _RELEASE if (CV_ui_DisplayElemBounds) { @@ -474,7 +473,6 @@ void CLyShine::Render() m_uiCanvasManager->DebugDisplayDrawCallData(); } #endif -#endif } //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Gems/LyShine/Code/Source/LyShineDebug.cpp b/Gems/LyShine/Code/Source/LyShineDebug.cpp index 76b4030106..44e0e187ec 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.cpp +++ b/Gems/LyShine/Code/Source/LyShineDebug.cpp @@ -12,6 +12,7 @@ #include "LyShine_precompiled.h" #include "LyShineDebug.h" #include "IConsole.h" +#include "IRenderer.h" #include #include @@ -392,15 +393,15 @@ static void DebugDrawColoredBox(AZ::Vector2 pos, AZ::Vector2 size, AZ::Color col //////////////////////////////////////////////////////////////////////////////////////////////////// #if !defined(_RELEASE) -static void DebugDrawStringWithSizeBox(IFFont* font, unsigned int effectIndex, const char* sizeString, +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::TextOptions textOptions = draw2d->GetDefaultTextOptions(); - if (font) + if (!font.empty()) { - textOptions.font = font; + textOptions.fontName = font; } textOptions.effectIndex = effectIndex; @@ -427,7 +428,7 @@ static void DebugDrawStringWithSizeBox(IFFont* font, unsigned int effectIndex, c //////////////////////////////////////////////////////////////////////////////////////////////////// #if !defined(_RELEASE) -static void DebugDraw2dFontSizes(IFFont* font, unsigned int effectIndex, const char* fontName) +static void DebugDraw2dFontSizes(AZStd::string_view font, unsigned int effectIndex) { CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); @@ -436,7 +437,7 @@ static void DebugDraw2dFontSizes(IFFont* font, unsigned int effectIndex, const c float xSpacing = 20.0f; char buffer[32]; - sprintf_s(buffer, "Font = %s, effect = %d", fontName, effectIndex); + sprintf_s(buffer, "Font = %s, effect = %d", font.data(), effectIndex); draw2d->DrawText(buffer, AZ::Vector2(xOffset, yOffset), 32); yOffset += 40.0f; draw2d->DrawText("NOTE: if the effect includes a drop shadow baked into font then the pixel size", @@ -1441,10 +1442,10 @@ void LyShineDebug::RenderDebug() switch (CV_r_DebugUIDraw2dFont) { case 1: // test font sizes (default font, effect 0) - DebugDraw2dFontSizes(0, 0, "default"); + DebugDraw2dFontSizes("default", 0); break; case 2: // test font sizes (default font, effect 1) - DebugDraw2dFontSizes(0, 1, "default"); + DebugDraw2dFontSizes("default", 1); break; case 3: // test font alignment DebugDraw2dFontAlignment(); diff --git a/Gems/LyShine/Code/Source/LyShineDebug.h b/Gems/LyShine/Code/Source/LyShineDebug.h index ed03fd10b2..e50689710a 100644 --- a/Gems/LyShine/Code/Source/LyShineDebug.h +++ b/Gems/LyShine/Code/Source/LyShineDebug.h @@ -14,7 +14,9 @@ #ifndef _RELEASE #include -class ITexture; +#include +#include + #endif //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -66,7 +68,7 @@ public: // static member functions struct DebugInfoTextureUsage { - ITexture* m_texture; + AZ::Data::Instance m_texture; bool m_isClampTextureUsage; int m_numCanvasesUsed; int m_numDrawCallsUsed; diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp index f55c8c5957..902752a03c 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.cpp @@ -208,8 +208,6 @@ namespace LyShine //////////////////////////////////////////////////////////////////////////////////////////////////// void LyShineSystemComponent::InitializeSystem() { - m_pLyShine = new CLyShine(gEnv->pSystem); - gEnv->pLyShine = m_pLyShine; BroadcastCursorImagePathname(); } @@ -374,6 +372,25 @@ namespace LyShine } } + /////////////////////////////////////////////////////////////////////////////////////////////// + void LyShineSystemComponent::OnCrySystemInitialized(ISystem& system, [[maybe_unused]] const SSystemInitParams& startupParams) + { +#if !defined(AZ_MONOLITHIC_BUILD) + // When module is linked dynamically, we must set our gEnv pointer. + // When module is linked statically, we'll share the application's gEnv pointer. + gEnv = system.GetGlobalEnvironment(); +#endif + m_pLyShine = new CLyShine(gEnv->pSystem); + gEnv->pLyShine = m_pLyShine; + } + + void LyShineSystemComponent::OnCrySystemShutdown([[maybe_unused]] ISystem& system) + { + gEnv->pLyShine = nullptr; + delete m_pLyShine; + m_pLyShine = nullptr; + } + //////////////////////////////////////////////////////////////////////////////////////////////////// void LyShineSystemComponent::BroadcastCursorImagePathname() { diff --git a/Gems/LyShine/Code/Source/LyShineSystemComponent.h b/Gems/LyShine/Code/Source/LyShineSystemComponent.h index 5f45f22823..f65dc75463 100644 --- a/Gems/LyShine/Code/Source/LyShineSystemComponent.h +++ b/Gems/LyShine/Code/Source/LyShineSystemComponent.h @@ -38,6 +38,7 @@ namespace LyShine , protected UiSystemToolsBus::Handler , protected LyShineAllocatorScope , protected UiFrameworkBus::Handler + , protected CrySystemEventBus::Handler { public: AZ_COMPONENT(LyShineSystemComponent, lyShineSystemComponentUuid); @@ -89,6 +90,11 @@ namespace LyShine void HandleEditorOnlyEntities(const EntityList& exportSliceEntities, const EntityIdSet& editorOnlyEntityIds) override; //////////////////////////////////////////////////////////////////////// + // CrySystemEventBus /////////////////////////////////////////////////////// + void OnCrySystemInitialized(ISystem& system, const SSystemInitParams&) override; + virtual void OnCrySystemShutdown(ISystem&) override; + //////////////////////////////////////////////////////////////////////////// + void BroadcastCursorImagePathname(); protected: // data diff --git a/Gems/LyShine/Code/Source/RenderGraph.cpp b/Gems/LyShine/Code/Source/RenderGraph.cpp index e5ac6c7b8f..d5a1df7b15 100644 --- a/Gems/LyShine/Code/Source/RenderGraph.cpp +++ b/Gems/LyShine/Code/Source/RenderGraph.cpp @@ -18,6 +18,7 @@ #include #ifndef _RELEASE +#include #include #endif @@ -1115,7 +1116,7 @@ namespace LyShine m_wasBuiltThisFrame = false; - AZStd::set uniqueTextures; + AZStd::set> uniqueTextures; // If we are rendering to the render targets this frame then record the stats for doing that if (m_renderToRenderTargetCount < 2) @@ -1144,13 +1145,11 @@ namespace LyShine } //////////////////////////////////////////////////////////////////////////////////////////////////// - void RenderGraph::GetDebugInfoRenderNodeList(const AZStd::vector& renderNodeList, LyShineDebug::DebugInfoRenderGraph& info, AZStd::set& uniqueTextures) const + void RenderGraph::GetDebugInfoRenderNodeList( + const AZStd::vector& renderNodeList, + LyShineDebug::DebugInfoRenderGraph& info, + AZStd::set>& uniqueTextures) const { - AZ_UNUSED(renderNodeList); - AZ_UNUSED(info); - AZ_UNUSED(uniqueTextures); - -#ifdef LYSHINE_ATOM_TODO // keeping this code for future phase (convert debug info to use Atom) const PrimitiveListRenderNode* prevPrimListNode = nullptr; bool isFirstNode = true; bool wasLastNodeAMask = false; @@ -1235,7 +1234,6 @@ namespace LyShine isFirstNode = false; } -#endif } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1290,13 +1288,6 @@ namespace LyShine void* context, const AZStd::string& indent) const { - AZ_UNUSED(renderNodeList); - AZ_UNUSED(fileHandle); - AZ_UNUSED(reportInfo); - AZ_UNUSED(context); - AZ_UNUSED(indent); - -#ifdef LYSHINE_ATOM_TODO // keeping this code for future phase (convert debug info to use Atom) AZStd::string logLine; bool previousNodeAlreadyCounted = false; @@ -1355,10 +1346,10 @@ namespace LyShine { for (int i = 0; i < prevPrimListNode->GetNumTextures(); ++i) { - ITexture* texture = prevPrimListNode->GetTexture(i); + AZ::Data::Instance texture = prevPrimListNode->GetTexture(i); if (!texture) { - texture = gEnv->pRenderer->GetWhiteTexture(); + texture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); } bool isClampTextureUsage = prevPrimListNode->GetTextureIsClampMode(i); @@ -1405,17 +1396,19 @@ namespace LyShine for (int i = 0; i < primListRenderNode->GetNumTextures(); ++i) { - ITexture* texture = primListRenderNode->GetTexture(i); + AZ::Data::Instance texture = primListRenderNode->GetTexture(i); if (!texture) { - texture = gEnv->pRenderer->GetWhiteTexture(); + texture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); } bool isClampTextureUsage = primListRenderNode->GetTextureIsClampMode(i); LyShineDebug::DebugInfoTextureUsage* matchingTextureUsage = nullptr; // Write line to logfile for this texture - logLine = AZStd::string::format("%s %s\r\n", indent.c_str(), texture->GetName()); + AZStd::string textureName; + AZ::Data::AssetCatalogRequestBus::BroadcastResult(textureName, &AZ::Data::AssetCatalogRequests::GetAssetPathById, texture->GetAssetId()); + logLine = AZStd::string::format("%s %s\r\n", indent.c_str(), textureName.c_str()); AZ::IO::LocalFileIO::GetInstance()->Write(fileHandle, logLine.c_str(), logLine.size()); // see if texture is in reportInfo @@ -1459,7 +1452,6 @@ namespace LyShine prevPrimListNode = primListRenderNode; } } -#endif } #endif diff --git a/Gems/LyShine/Code/Source/RenderGraph.h b/Gems/LyShine/Code/Source/RenderGraph.h index f9d16cf8b7..2f1586e857 100644 --- a/Gems/LyShine/Code/Source/RenderGraph.h +++ b/Gems/LyShine/Code/Source/RenderGraph.h @@ -13,7 +13,6 @@ #pragma once #include -#include #include #include #include @@ -294,7 +293,10 @@ namespace LyShine void ValidateGraph(); void GetDebugInfoRenderGraph(LyShineDebug::DebugInfoRenderGraph& info) const; - void GetDebugInfoRenderNodeList(const AZStd::vector& renderNodeList, LyShineDebug::DebugInfoRenderGraph& info, AZStd::set& uniqueTextures) const; + void GetDebugInfoRenderNodeList( + const AZStd::vector& renderNodeList, + LyShineDebug::DebugInfoRenderGraph& info, + AZStd::set>& uniqueTextures) const; void DebugReportDrawCalls(AZ::IO::HandleType fileHandle, LyShineDebug::DebugInfoDrawCallReport& reportInfo, void* context) const; void DebugReportDrawCallsRenderNodeList(const AZStd::vector& renderNodeList, AZ::IO::HandleType fileHandle, diff --git a/Gems/LyShine/Code/Source/UiCanvasManager.cpp b/Gems/LyShine/Code/Source/UiCanvasManager.cpp index 4115feaf22..b64a13280f 100644 --- a/Gems/LyShine/Code/Source/UiCanvasManager.cpp +++ b/Gems/LyShine/Code/Source/UiCanvasManager.cpp @@ -1425,7 +1425,8 @@ void UiCanvasManager::DebugReportDrawCalls(const AZStd::string& name) const if (reportTextureUsage.m_numCanvasesUsed > 1 && reportTextureUsage.m_numDrawCallsWhereExceedingMaxTextures) { - AZStd::string textureName = reportTextureUsage.m_texture->GetName(); + AZStd::string textureName; + AZ::Data::AssetCatalogRequestBus::BroadcastResult(textureName, &AZ::Data::AssetCatalogRequests::GetAssetPathById, reportTextureUsage.m_texture->GetAssetId()); if (textureName.compare(0, fontTexturePrefix.length(), fontTexturePrefix) != 0) { logLine = AZStd::string::format("%s\r\n", textureName.c_str()); @@ -1457,7 +1458,8 @@ void UiCanvasManager::DebugReportDrawCalls(const AZStd::string& name) const reportTextureUsage.m_lastContextUsed == canvas && reportTextureUsage.m_numDrawCallsWhereExceedingMaxTextures) { - AZStd::string textureName = reportTextureUsage.m_texture->GetName(); + AZStd::string textureName; + AZ::Data::AssetCatalogRequestBus::BroadcastResult(textureName, &AZ::Data::AssetCatalogRequests::GetAssetPathById, reportTextureUsage.m_texture->GetAssetId()); // exclude font textures if (textureName.compare(0, fontTexturePrefix.length(), fontTexturePrefix) != 0) diff --git a/Gems/LyShine/Code/Source/UiRenderer.cpp b/Gems/LyShine/Code/Source/UiRenderer.cpp index 2a2c950e82..57acbed5d5 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.cpp +++ b/Gems/LyShine/Code/Source/UiRenderer.cpp @@ -12,6 +12,7 @@ #include "LyShine_precompiled.h" #include "UiRenderer.h" +#include #include #include #include @@ -24,7 +25,7 @@ #include #include -#include +#include //////////////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC MEMBER FUNCTIONS @@ -353,7 +354,6 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) { if (recordingOption > 0) { -#ifdef LYSHINE_ATOM_TODO // compute the total area of all the textures, also create a vector that we can sort by area AZStd::vector textures; int totalArea = 0; @@ -374,15 +374,14 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) return lhs->GetDataSize() > rhs->GetDataSize(); }); - IDraw2d* draw2d = Draw2dHelper::GetDraw2d(); + CDraw2d* draw2d = Draw2dHelper::GetDefaultDraw2d(); // setup to render lines of text for the debug display - draw2d->BeginDraw2d(false); float xOffset = 20.0f; float yOffset = 20.0f; - int blackTexture = gEnv->pRenderer->GetBlackTextureId(); + auto blackTexture = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::Black); float textOpacity = 1.0f; float backgroundRectOpacity = 0.75f; const float lineSpacing = 20.0f; @@ -432,9 +431,6 @@ void UiRenderer::DebugDisplayTextureData(int recordingOption) texture->GetWidth(), texture->GetHeight(), texture->GetDataSize(), texture->GetFormatName(), texture->GetName()); WriteLine(buffer, white); } - - draw2d->EndDraw2d(); -#endif } } diff --git a/Gems/LyShine/Code/Source/UiRenderer.h b/Gems/LyShine/Code/Source/UiRenderer.h index 260bd8278c..888c88586a 100644 --- a/Gems/LyShine/Code/Source/UiRenderer.h +++ b/Gems/LyShine/Code/Source/UiRenderer.h @@ -20,6 +20,8 @@ #include #endif +class ITexture; + //////////////////////////////////////////////////////////////////////////////////////////////////// //! UI render interface // @@ -136,8 +138,6 @@ protected: // attributes #ifndef _RELEASE int m_debugTextureDataRecordLevel = 0; -#ifdef LYSHINE_ATOM_TODO // Convert debug code to Atom - AZStd::unordered_set m_texturesUsedInFrame; -#endif + AZStd::unordered_set m_texturesUsedInFrame; // LYSHINE_ATOM_TODO - convert to RPI::Image #endif }; diff --git a/Gems/LyShine/Code/Source/UiTextComponent.cpp b/Gems/LyShine/Code/Source/UiTextComponent.cpp index 937f323b01..72c36ed66d 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextComponent.cpp @@ -40,6 +40,7 @@ #include "RenderGraph.h" #include +#include namespace { @@ -1076,7 +1077,7 @@ UiTextComponent::InlineImage::InlineImage(const AZStd::string& texturePathname, { m_filepath = texturePathname; AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePath, m_filepath); - m_texture = nullptr; + m_texture.reset(); m_size = AZ::Vector2(0.0f, 0.0f); m_vAlign = vAlign; m_yOffset = yOffset; @@ -1094,24 +1095,11 @@ UiTextComponent::InlineImage::InlineImage(const AZStd::string& texturePathname, else { // Load the texture - uint32 loadTextureFlags = (FT_USAGE_ALLOWREADSRGB | FT_DONT_STREAM); - ITexture* texture = gEnv->pRenderer->EF_LoadTexture(texturePathname.c_str(), loadTextureFlags); - - if (!texture || !texture->IsTextureLoaded()) + m_texture = CDraw2d::LoadTexture(m_filepath); + if (m_texture) { - gEnv->pSystem->Warning( - VALIDATOR_MODULE_SHINE, - VALIDATOR_WARNING, - VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_TEXTURE, - texturePathname.c_str(), - "No texture file found for image: %s. " - "NOTE: File must be in current project or a gem.", - texturePathname.c_str()); - } - else - { - m_texture = texture; - m_size = AZ::Vector2(static_cast(m_texture->GetWidth()), static_cast(m_texture->GetHeight())); + AZ::RHI::Size size = m_texture->GetDescriptor().m_size; + m_size = AZ::Vector2(size.m_width, size.m_height); } } @@ -1127,17 +1115,6 @@ UiTextComponent::InlineImage::InlineImage(const AZStd::string& texturePathname, //////////////////////////////////////////////////////////////////////////////////////////////////// UiTextComponent::InlineImage::~InlineImage() { - // In order to avoid the texture being deleted while there are still commands on the render - // thread command queue that use it, we queue a command to delete the texture onto the - // command queue. - - if (m_texture && !m_atlas) - { - SResourceAsync* pInfo = new SResourceAsync(); - pInfo->eClassName = eRCN_Texture; - pInfo->pResource = m_texture; - gEnv->pRenderer->ReleaseResourceAsync(pInfo); - } } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1148,13 +1125,6 @@ bool UiTextComponent::InlineImage::OnAtlasLoaded(const TextureAtlasNamespace::Te m_coordinates = atlas->GetAtlasCoordinates(m_filepath); if (m_coordinates.GetWidth() > 0) { - if (m_texture) - { - SResourceAsync* pInfo = new SResourceAsync(); - pInfo->eClassName = eRCN_Texture; - pInfo->pResource = m_texture; - gEnv->pRenderer->ReleaseResourceAsync(pInfo); - } m_atlas = atlas; m_texture = m_atlas->GetTexture(); return true; @@ -1177,25 +1147,7 @@ bool UiTextComponent::InlineImage::OnAtlasUnloaded(const TextureAtlasNamespace:: else { // Load the texture - uint32 loadTextureFlags = (FT_USAGE_ALLOWREADSRGB | FT_DONT_STREAM); - ITexture* texture = gEnv->pRenderer->EF_LoadTexture(m_filepath.c_str(), loadTextureFlags); - - if (!texture || !texture->IsTextureLoaded()) - { - gEnv->pSystem->Warning( - VALIDATOR_MODULE_SHINE, - VALIDATOR_WARNING, - VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_TEXTURE, - m_filepath.c_str(), - "No texture file found for image: %s. " - "NOTE: File must be in current project or a gem.", - m_filepath.c_str()); - m_texture = nullptr; - } - else - { - m_texture = texture; - } + m_texture = CDraw2d::LoadTexture(m_filepath); } return true; } @@ -1869,7 +1821,7 @@ void UiTextComponent::Render(LyShine::IRenderGraph* renderGraph) UiTransformInterface::RectPointsArray rectPoints; GetTextBoundingBoxPrivate(GetDrawBatchLines(), m_selectionStart, m_selectionEnd, rectPoints); - ITexture* whiteTexture = gEnv->pRenderer->GetWhiteTexture(); + auto systemImage = AZ::RPI::ImageSystemInterface::Get()->GetSystemImage(AZ::RPI::SystemImage::White); bool isClampTextureMode = true; uint32 packedColor = (m_textSelectionColor.GetA8() << 24) | (m_textSelectionColor.GetR8() << 16) | (m_textSelectionColor.GetG8() << 8) | m_textSelectionColor.GetB8(); @@ -1878,7 +1830,12 @@ void UiTextComponent::Render(LyShine::IRenderGraph* renderGraph) { IRenderer::DynUiPrimitive* primitive = renderGraph->GetDynamicQuadPrimitive(rect.pt, packedColor); primitive->m_next = nullptr; - renderGraph->AddPrimitive(primitive, whiteTexture, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); + + LyShine::RenderGraph* lyRenderGraph = dynamic_cast(renderGraph); + if (lyRenderGraph) + { + lyRenderGraph->AddPrimitiveAtom(primitive, systemImage, isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); + } } } @@ -1887,21 +1844,25 @@ void UiTextComponent::Render(LyShine::IRenderGraph* renderGraph) { for (auto batch : m_renderCache.m_imageBatches) { - ITexture* texture = batch->m_texture; + AZ::Data::Instance texture = batch->m_texture; // If the fade value has changed we need to update the alpha values in the vertex colors but we do // not want to touch or recompute the RGB values if (batch->m_cachedPrimitive.m_vertices[0].color.a != finalAlphaByte) { - for (int i=0; i < 4; ++i) + for (int i = 0; i < 4; ++i) { batch->m_cachedPrimitive.m_vertices[i].color.a = finalAlphaByte; } } bool isClampTextureMode = true; - renderGraph->AddPrimitive(&batch->m_cachedPrimitive, texture, - isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); + LyShine::RenderGraph* lyRenderGraph = dynamic_cast(renderGraph); + if (lyRenderGraph) + { + lyRenderGraph->AddPrimitiveAtom(&batch->m_cachedPrimitive, texture, + isClampTextureMode, isTextureSRGB, isTexturePremultipliedAlpha, blendMode); + } } } @@ -3568,13 +3529,14 @@ UiTextComponent::FontEffectComboBoxVec UiTextComponent::PopulateFontEffectList() FontEffectComboBoxVec result; AZStd::vector entityIdList; - // there is always a valid font since we default to "default-ui" - // so just get the effects from the font and add their names to the result list - unsigned int numEffects = m_font->GetNumEffects(); - for (int i = 0; i < numEffects; ++i) + if (m_font) { - const char* name = m_font->GetEffectName(i); - result.push_back(AZStd::make_pair(i, name)); + unsigned int numEffects = m_font->GetNumEffects(); + for (int i = 0; i < numEffects; ++i) + { + const char* name = m_font->GetEffectName(i); + result.push_back(AZStd::make_pair(i, name)); + } } return result; diff --git a/Gems/LyShine/Code/Source/UiTextComponent.h b/Gems/LyShine/Code/Source/UiTextComponent.h index c3983c5454..b23f2a2886 100644 --- a/Gems/LyShine/Code/Source/UiTextComponent.h +++ b/Gems/LyShine/Code/Source/UiTextComponent.h @@ -21,13 +21,14 @@ #include #include #include +#include +#include #include #include #include -#include -#include +#include // Only needed for internal unit-testing #include @@ -91,7 +92,7 @@ public: //types bool OnAtlasLoaded(const TextureAtlasNamespace::TextureAtlas* atlas); bool OnAtlasUnloaded(const TextureAtlasNamespace::TextureAtlas* atlas); - ITexture* m_texture; + AZ::Data::Instance m_texture; AZ::Vector2 m_size; VAlign m_vAlign; float m_yOffset; @@ -616,8 +617,8 @@ private: // types struct RenderCacheImageBatch { - ITexture* m_texture; - IRenderer::DynUiPrimitive m_cachedPrimitive; + AZ::Data::Instance m_texture; + IRenderer::DynUiPrimitive m_cachedPrimitive; }; struct RenderCacheData diff --git a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp index ca0d3fab02..6cfa2c911b 100644 --- a/Gems/LyShine/Code/Source/UiTextInputComponent.cpp +++ b/Gems/LyShine/Code/Source/UiTextInputComponent.cpp @@ -1450,13 +1450,17 @@ void UiTextInputComponent::CheckStartTextInput() EBUS_EVENT_ID_RESULT(textString, m_textEntity, UiTextBus, GetText); options.m_initialText = Utf8SubString(textString, m_textCursorPos, m_textSelectionStartPos); + AZ::EntityId canvasEntityId; + EBUS_EVENT_ID_RESULT(canvasEntityId, GetEntityId(), UiElementBus, GetCanvasEntityId); + + // Calculate height available for virtual keyboard. In game mode, canvas size is the same as viewport size + AZ::Vector2 canvasSize; + EBUS_EVENT_ID_RESULT(canvasSize, canvasEntityId, UiCanvasBus, GetCanvasSize); UiTransformInterface::RectPoints rectPoints; EBUS_EVENT_ID(GetEntityId(), UiTransformBus, GetViewportSpacePoints, rectPoints); const AZ::Vector2 bottomRight = rectPoints.GetAxisAlignedBottomRight(); - options.m_normalizedMinY = bottomRight.GetY() / static_cast(gEnv->pRenderer->GetHeight()); + options.m_normalizedMinY = (canvasSize.GetY() > 0.0f) ? bottomRight.GetY() / canvasSize.GetY() : 0.0f; - AZ::EntityId canvasEntityId; - EBUS_EVENT_ID_RESULT(canvasEntityId, GetEntityId(), UiElementBus, GetCanvasEntityId); EBUS_EVENT_ID_RESULT(options.m_localUserId, canvasEntityId, UiCanvasBus, GetLocalUserIdInputFilter); AzFramework::InputTextEntryRequestBus::Broadcast(&AzFramework::InputTextEntryRequests::TextEntryStart, options); diff --git a/Gems/LyShine/Code/Tests/LyShineEditorTest.cpp b/Gems/LyShine/Code/Tests/LyShineEditorTest.cpp index 9e57ac26fd..68da6e6009 100644 --- a/Gems/LyShine/Code/Tests/LyShineEditorTest.cpp +++ b/Gems/LyShine/Code/Tests/LyShineEditorTest.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -88,6 +89,12 @@ protected: m_data->m_stubEnv.pSystem = &m_data->m_mockSystem; gEnv = &m_data->m_stubEnv; + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(m_descriptor); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleFrame.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleFrame.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleFrame.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleFrame.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleGradient.png.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleGradient.png.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleGradient.png.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/CircleGradient.png.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/Circle_Shadow.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/Circle_Shadow.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/Circle_Shadow.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/Circle_Shadow.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTest.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTest.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTest.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTest.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTestPow2.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTestPow2.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTestPow2.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ColorTestPow2.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ParticleGlow.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ParticleGlow.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ParticleGlow.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/ParticleGlow.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/button.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/button.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/button.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/button.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonPressed.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonPressed.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonPressed.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonPressed.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonSlider.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonSlider.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonSlider.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/buttonSlider.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkbox_spritesheet.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkbox_spritesheet.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkbox_spritesheet.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkbox_spritesheet.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkered3.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkered3.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkered3.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/checkered3.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/empty_icon.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/empty_icon.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/empty_icon.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/empty_icon.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/fixed_image.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/fixed_image.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/fixed_image.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/fixed_image.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/flipbook_walking.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/flipbook_walking.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/flipbook_walking.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/flipbook_walking.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/mask.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/mask.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/mask.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/mask.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outline.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outline.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outline.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outline.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outlineRounded.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outlineRounded.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outlineRounded.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/outlineRounded.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/panelBkgd.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/panelBkgd.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/panelBkgd.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/panelBkgd.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02_big.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02_big.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02_big.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02_big.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical_big.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical_big.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical_big.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern02vertical_big.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03_big.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03_big.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03_big.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/pattern03_big.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_1.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_1.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_1.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_1.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_10.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_10.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_10.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_10.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_2.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_2.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_2.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_2.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_3.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_3.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_3.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_3.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_4.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_4.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_4.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_4.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_5.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_5.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_5.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_5.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_6.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_6.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_6.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_6.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_7.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_7.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_7.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_7.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_8.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_8.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_8.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_8.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_9.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_9.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_9.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_icon_9.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_map.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_map.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_map.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/scroll_box_map.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/selected.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/selected.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/selected.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/selected.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInside2.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInside2.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInside2.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInside2.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInsideSquare.tif.assetinfo b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInsideSquare.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInsideSquare.tif.assetinfo +++ b/Gems/LyShineExamples/Assets/UI/Textures/LyShineExamples/shadowInsideSquare.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/LyShineExamples/Code/CMakeLists.txt b/Gems/LyShineExamples/Code/CMakeLists.txt index 372bfa948b..96c41bbb64 100644 --- a/Gems/LyShineExamples/Code/CMakeLists.txt +++ b/Gems/LyShineExamples/Code/CMakeLists.txt @@ -20,9 +20,10 @@ ly_add_target( PUBLIC Include BUILD_DEPENDENCIES + PRIVATE + Gem::LmbrCentral PUBLIC Legacy::CryCommon - Gem::LmbrCentral Gem::LyShine.Static ) @@ -39,4 +40,13 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::LyShineExamples.Static + Gem::LmbrCentral ) + +# 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.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/Maestro/Code/CMakeLists.txt b/Gems/Maestro/Code/CMakeLists.txt index fe58ba03a6..01b22b1abf 100644 --- a/Gems/Maestro/Code/CMakeLists.txt +++ b/Gems/Maestro/Code/CMakeLists.txt @@ -22,7 +22,6 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Legacy::CryCommon - Gem::LmbrCentral ) ly_add_target( @@ -39,11 +38,14 @@ ly_add_target( PRIVATE Legacy::CryCommon Gem::Maestro.Static - Gem::LmbrCentral RUNTIME_DEPENDENCIES Gem::LmbrCentral ) +# if enabled, "Maestro" module is used for Clients and Servers: +ly_create_alias(NAME Maestro.Clients NAMESPACE Gem TARGETS Gem::Maestro) +ly_create_alias(NAME Maestro.Servers NAMESPACE Gem TARGETS Gem::Maestro) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME Maestro.Editor GEM_MODULE @@ -69,10 +71,13 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzToolsFramework AZ::AssetBuilderSDK Gem::Maestro.Static - Gem::LmbrCentral RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) + # the .Editor variant is used in dev tools: + ly_create_alias(NAME Maestro.Tools NAMESPACE Gem TARGETS Gem::Maestro.Editor) + ly_create_alias(NAME Maestro.Builders NAMESPACE Gem TARGETS Gem::Maestro.Editor) + endif() ################################################################################ diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimComponentNode.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimComponentNode.cpp index ea7322014c..324b712f40 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimComponentNode.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/AnimComponentNode.cpp @@ -324,11 +324,11 @@ void CAnimComponentNode::ConvertBetweenWorldAndLocalRotation(Quat& rotation, ETr { AZ::Quaternion rot(rotation.v.x, rotation.v.y, rotation.v.z, rotation.w); AZ::Transform rotTransform = AZ::Transform::CreateFromQuaternion(rot); - rotTransform.ExtractScale(); + rotTransform.ExtractUniformScale(); AZ::Transform parentTransform = AZ::Transform::Identity(); GetParentWorldTransform(parentTransform); - parentTransform.ExtractScale(); + parentTransform.ExtractUniformScale(); if (conversionDirection == eTransformConverstionDirection_toLocalSpace) { parentTransform.Invert(); @@ -344,7 +344,7 @@ void CAnimComponentNode::ConvertBetweenWorldAndLocalRotation(Quat& rotation, ETr void CAnimComponentNode::ConvertBetweenWorldAndLocalScale(Vec3& scale, ETransformSpaceConversionDirection conversionDirection) const { AZ::Transform parentTransform = AZ::Transform::Identity(); - AZ::Transform scaleTransform = AZ::Transform::CreateScale(AZ::Vector3(scale.x, scale.y, scale.z)); + AZ::Transform scaleTransform = AZ::Transform::CreateUniformScale(AZ::Vector3(scale.x, scale.y, scale.z).GetMaxElement()); GetParentWorldTransform(parentTransform); if (conversionDirection == eTransformConverstionDirection_toLocalSpace) @@ -353,8 +353,8 @@ void CAnimComponentNode::ConvertBetweenWorldAndLocalScale(Vec3& scale, ETransfor } scaleTransform = parentTransform * scaleTransform; - AZ::Vector3 vScale = scaleTransform.GetScale(); - scale.Set(vScale.GetX(), vScale.GetY(), vScale.GetZ()); + const float uniformScale = scaleTransform.GetUniformScale(); + scale.Set(uniformScale, uniformScale, uniformScale); } ////////////////////////////////////////////////////////////////////////// diff --git a/Gems/Maestro/Code/Source/Cinematics/AnimNode.cpp b/Gems/Maestro/Code/Source/Cinematics/AnimNode.cpp index ec6bf4258a..7fea8097ed 100644 --- a/Gems/Maestro/Code/Source/Cinematics/AnimNode.cpp +++ b/Gems/Maestro/Code/Source/Cinematics/AnimNode.cpp @@ -280,6 +280,45 @@ static bool AnimNodeVersionConverter( rootElement.AddElement(serializeContext, "BaseClass1", azrtti_typeid()); } + if (rootElement.GetVersion() < 4) + { + // remove vector scale tracks from transform anim nodes + AZStd::string name; + if (rootElement.FindSubElementAndGetData(AZ_CRC_CE("Name"), name) && name == "Transform") + { + auto tracksElement = rootElement.FindSubElement(AZ_CRC_CE("Tracks")); + if (tracksElement) + { + for (int trackIndex = tracksElement->GetNumSubElements() - 1; trackIndex >= 0; trackIndex--) + { + auto trackElement = tracksElement->GetSubElement(trackIndex); + bool isScale = false; + + // trackElement should be an intrusive_ptr with one child + if (trackElement.GetNumSubElements() == 1) + { + auto ptrElement = trackElement.GetSubElement(0); + auto paramTypeElement = ptrElement.FindSubElement(AZ_CRC_CE("ParamType")); + if (paramTypeElement) + { + AZStd::string paramName; + if (paramTypeElement->FindSubElementAndGetData(AZ_CRC_CE("Name"), paramName) && paramName == "Scale") + { + isScale = true; + } + } + } + + if (isScale) + { + tracksElement->RemoveElement(trackIndex); + } + } + } + } + + } + return true; } @@ -288,7 +327,7 @@ void CAnimNode::Reflect(AZ::ReflectContext* context) if (auto serializeContext = azrtti_cast(context)) { serializeContext->Class() - ->Version(3, &AnimNodeVersionConverter) + ->Version(4, &AnimNodeVersionConverter) ->Field("ID", &CAnimNode::m_id) ->Field("Name", &CAnimNode::m_name) ->Field("Flags", &CAnimNode::m_flags) diff --git a/Gems/MessagePopup/Code/CMakeLists.txt b/Gems/MessagePopup/Code/CMakeLists.txt index 2d0ad1ebcc..fa89b61f21 100644 --- a/Gems/MessagePopup/Code/CMakeLists.txt +++ b/Gems/MessagePopup/Code/CMakeLists.txt @@ -38,3 +38,7 @@ ly_add_target( PRIVATE Gem::MessagePopup.Static ) + +# MessagePopup is used only in client applications +ly_create_alias(NAME MessagePopup.Clients NAMESPACE Gem TARGETS Gem::MessagePopup) + diff --git a/Gems/Metastream/Code/CMakeLists.txt b/Gems/Metastream/Code/CMakeLists.txt index 326c21c5a9..95f7746b91 100644 --- a/Gems/Metastream/Code/CMakeLists.txt +++ b/Gems/Metastream/Code/CMakeLists.txt @@ -50,6 +50,11 @@ ly_add_target( Legacy::CryCommon ) +# The above "Metastream" target is used by all types of applications, including dev tools. +ly_create_alias(NAME Metastream.Clients NAMESPACE Gem TARGETS Gem::Metastream) +ly_create_alias(NAME Metastream.Servers NAMESPACE Gem TARGETS Gem::Metastream) +ly_create_alias(NAME Metastream.Builders NAMESPACE Gem TARGETS Gem::Metastream) +ly_create_alias(NAME Metastream.Tools NAMESPACE Gem TARGETS Gem::Metastream) ################################################################################ # Tests diff --git a/Gems/Microphone/Code/CMakeLists.txt b/Gems/Microphone/Code/CMakeLists.txt index 942899735c..17d492d786 100644 --- a/Gems/Microphone/Code/CMakeLists.txt +++ b/Gems/Microphone/Code/CMakeLists.txt @@ -46,3 +46,7 @@ ly_add_target( RUNTIME_DEPENDENCIES Gem::AudioSystem ) + +# The above "Microphone" target is used by all interactive applications +ly_create_alias(NAME Microphone.Clients NAMESPACE Gem TARGETS Gem::Microphone) +ly_create_alias(NAME Microphone.Tools NAMESPACE Gem TARGETS Gem::Microphone) diff --git a/Gems/Multiplayer/Code/CMakeLists.txt b/Gems/Multiplayer/Code/CMakeLists.txt index 4eeee15c47..430fe5ca4b 100644 --- a/Gems/Multiplayer/Code/CMakeLists.txt +++ b/Gems/Multiplayer/Code/CMakeLists.txt @@ -58,12 +58,60 @@ ly_add_target( Gem::CertificateManager ) -if (PAL_TRAIT_BUILD_HOST_TOOLS) +ly_add_target( + NAME Multiplayer.Debug ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} + NAMESPACE Gem + FILES_CMAKE + multiplayer_debug_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Source + . + PUBLIC + Include + BUILD_DEPENDENCIES + PRIVATE + AZ::AzCore + AZ::AtomCore + AZ::AzFramework + AZ::AzNetworking + Gem::Atom_Feature_Common.Static + Gem::Multiplayer.Static + Gem::ImGui.Static +) +# The "Multiplayer" target is used by clients and servers, Debug is used only on clients. +ly_create_alias(NAME Multiplayer.Clients NAMESPACE Gem TARGETS Gem::Multiplayer Gem::Multiplayer.Debug) +ly_create_alias(NAME Multiplayer.Servers NAMESPACE Gem TARGETS Gem::Multiplayer) + +if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( - NAME Multiplayer.Tools MODULE + NAME Multiplayer.Builders.Static STATIC NAMESPACE Gem - OUTPUT_NAME Gem.Multiplayer.Tools + FILES_CMAKE + multiplayer_tools_files.cmake + COMPILE_DEFINITIONS + PUBLIC + MULTIPLAYER_TOOLS + INCLUDE_DIRECTORIES + PRIVATE + . + Source + ${pal_source_dir} + PUBLIC + Include + BUILD_DEPENDENCIES + PUBLIC + AZ::AzToolsFramework + Gem::Multiplayer.Static + ) + + # by naming this target Multiplayer.Builders it ensures that it is loaded + # in any pipeline tools (Like Asset Processor, AssetBuilder, etc) + ly_add_target( + NAME Multiplayer.Builders GEM_MODULE + NAMESPACE Gem + OUTPUT_NAME Gem.Multiplayer.Builders FILES_CMAKE multiplayer_tools_files.cmake INCLUDE_DIRECTORIES @@ -74,15 +122,14 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Include BUILD_DEPENDENCIES PRIVATE - AZ::AzToolsFramework - Gem::Multiplayer.Static + Gem::Multiplayer.Builders.Static ) - + ly_add_target( - NAME Multiplayer.Editor.Static STATIC + NAME Multiplayer.Editor GEM_MODULE NAMESPACE Gem FILES_CMAKE - multiplayer_editor_files.cmake + multiplayer_editor_shared_files.cmake COMPILE_DEFINITIONS PUBLIC MULTIPLAYER_EDITOR @@ -94,7 +141,7 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC Include BUILD_DEPENDENCIES - PUBLIC + PRIVATE Legacy::CryCommon Legacy::Editor.Headers AZ::AzCore @@ -102,25 +149,11 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzNetworking AZ::AzToolsFramework Gem::Multiplayer.Static + Gem::Multiplayer.Builders ) - ly_add_target( - NAME Multiplayer.Editor GEM_MODULE - NAMESPACE Gem - FILES_CMAKE - multiplayer_editor_shared_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - . - Source - ${pal_source_dir} - PUBLIC - Include - BUILD_DEPENDENCIES - PRIVATE - Gem::Multiplayer.Editor.Static - ) - + # use the Multiplayer.Editor module in tools like the Editor: Such tools also get the visual debug view: + ly_create_alias(NAME Multiplayer.Tools NAMESPACE Gem TARGETS Gem::Multiplayer.Editor Gem::Multiplayer.Debug) endif() if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) @@ -145,26 +178,28 @@ if (PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_googletest( NAME Gem::Multiplayer.Tests ) -endif() + + if (PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME Multiplayer.Builders.Tests ${PAL_TRAIT_TEST_TARGET_TYPE} + NAMESPACE Gem + FILES_CMAKE + multiplayer_tools_tests_files.cmake + INCLUDE_DIRECTORIES + PRIVATE + Tests + Source + . + BUILD_DEPENDENCIES + PRIVATE + AZ::AzTest + AZ::AzTestShared + AZ::AzToolsFrameworkTestCommon + Gem::Multiplayer.Builders.Static + ) + ly_add_googletest( + NAME Gem::Multiplayer.Builders.Tests + ) + endif() -ly_add_target( - NAME Multiplayer.Debug ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} - NAMESPACE Gem - FILES_CMAKE - multiplayer_debug_files.cmake - INCLUDE_DIRECTORIES - PRIVATE - Source - . - PUBLIC - Include - BUILD_DEPENDENCIES - PRIVATE - AZ::AzCore - AZ::AtomCore - AZ::AzFramework - AZ::AzNetworking - Gem::Atom_Feature_Common.Static - Gem::Multiplayer.Static - Gem::ImGui.Static -) +endif() diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetBindComponent.h b/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetBindComponent.h index 41503396fb..4fe60f14a3 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetBindComponent.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetBindComponent.h @@ -35,6 +35,7 @@ namespace Multiplayer using EntityStopEvent = AZ::Event; using EntityDirtiedEvent = AZ::Event<>; + using EntitySyncRewindEvent = AZ::Event<>; using EntityMigrationStartEvent = AZ::Event; using EntityMigrationEndEvent = AZ::Event<>; using EntityServerMigrationEvent = AZ::Event; @@ -73,6 +74,7 @@ namespace Multiplayer NetworkEntityHandle GetEntityHandle(); void SetOwningConnectionId(AzNetworking::ConnectionId connectionId); + AzNetworking::ConnectionId GetOwningConnectionId() const; void SetAllowAutonomy(bool value); MultiplayerComponentInputVector AllocateComponentInputs(); bool IsProcessingInput() const; @@ -91,12 +93,14 @@ namespace Multiplayer void MarkDirty(); void NotifyLocalChanges(); + void NotifySyncRewindState(); void NotifyMigrationStart(ClientInputId migratedInputId); void NotifyMigrationEnd(); void NotifyServerMigration(HostId hostId, AzNetworking::ConnectionId connectionId); void AddEntityStopEventHandler(EntityStopEvent::Handler& eventHandler); void AddEntityDirtiedEventHandler(EntityDirtiedEvent::Handler& eventHandler); + void AddEntitySyncRewindEventHandler(EntitySyncRewindEvent::Handler& eventHandler); void AddEntityMigrationStartEventHandler(EntityMigrationStartEvent::Handler& eventHandler); void AddEntityMigrationEndEventHandler(EntityMigrationEndEvent::Handler& eventHandler); void AddEntityServerMigrationEventHandler(EntityServerMigrationEvent::Handler& eventHandler); @@ -144,6 +148,7 @@ namespace Multiplayer EntityStopEvent m_entityStopEvent; EntityDirtiedEvent m_dirtiedEvent; + EntitySyncRewindEvent m_syncRewindEvent; EntityMigrationStartEvent m_entityMigrationStartEvent; EntityMigrationEndEvent m_entityMigrationEndEvent; EntityServerMigrationEvent m_entityServerMigrationEvent; @@ -157,6 +162,8 @@ namespace Multiplayer NetEntityRole m_netEntityRole = NetEntityRole::InvalidRole; NetEntityId m_netEntityId = InvalidNetEntityId; + AzNetworking::ConnectionId m_owningConnectionId = AzNetworking::InvalidConnectionId; + bool m_isProcessingInput = false; bool m_isMigrationDataValid = false; bool m_needsToBeStopped = false; diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetworkTransformComponent.h b/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetworkTransformComponent.h index 2a3b5fb3cc..f3eb1922fd 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetworkTransformComponent.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Components/NetworkTransformComponent.h @@ -34,11 +34,11 @@ namespace Multiplayer private: void OnRotationChangedEvent(const AZ::Quaternion& rotation); void OnTranslationChangedEvent(const AZ::Vector3& translation); - void OnScaleChangedEvent(const AZ::Vector3& scale); + void OnScaleChangedEvent(float scale); AZ::Event::Handler m_rotationEventHandler; AZ::Event::Handler m_translationEventHandler; - AZ::Event::Handler m_scaleEventHandler; + AZ::Event::Handler m_scaleEventHandler; }; class NetworkTransformComponentController diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayer.h b/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayer.h index 6a615465c2..579ca195e5 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayer.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayer.h @@ -48,7 +48,6 @@ namespace Multiplayer using ConnectionAcquiredEvent = AZ::Event; using SessionInitEvent = AZ::Event; using SessionShutdownEvent = AZ::Event; - using OnConnectFunctor = AZStd::function; //! IMultiplayer provides insight into the Multiplayer session and its Agents class IMultiplayer @@ -78,10 +77,6 @@ namespace Multiplayer //! @param handler The SessionShutdownEvent handler to add virtual void AddSessionShutdownHandler(SessionShutdownEvent::Handler& handler) = 0; - //! Overrides the default connect behaviour with the provided functor. - //! @param functor the function to invoke during a new connection event - virtual void SetOnConnectFunctor(const OnConnectFunctor& functor) = 0; - //! Sends a packet telling if entity update messages can be sent //! @param readyForEntityUpdates Ready for entity updates or not virtual void SendReadyForEntityUpdates(bool readyForEntityUpdates) = 0; diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayerTools.h b/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayerTools.h new file mode 100644 index 0000000000..c621808f7a --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/IMultiplayerTools.h @@ -0,0 +1,39 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +namespace Multiplayer +{ + //! IMultiplayer provides insight into the Multiplayer session and its Agents + class IMultiplayerTools + { + public: + // NetworkPrefabProcessor is the only class that should be setting process network prefab status + friend class NetworkPrefabProcessor; + + AZ_RTTI(IMultiplayerTools, "{E8A80EAB-29CB-4E3B-A0B2-FFCB37060FB0}"); + + virtual ~IMultiplayerTools() = default; + + //! Returns if network prefab processing has created currently active or pending spawnables + //! @return If network prefab processing has created currently active or pending spawnables + virtual bool DidProcessNetworkPrefabs() = 0; + + private: + //! Sets if network prefab processing has created currently active or pending spawnables + //! @param didProcessNetPrefabs if network prefab processing has created currently active or pending spawnables + virtual void SetDidProcessNetworkPrefabs(bool didProcessNetPrefabs) = 0; + }; +} diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/INetworkSpawnableLibrary.h b/Gems/Multiplayer/Code/Include/Multiplayer/INetworkSpawnableLibrary.h new file mode 100644 index 0000000000..422f7f4be3 --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/INetworkSpawnableLibrary.h @@ -0,0 +1,34 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +namespace Multiplayer +{ + //! @class INetworkSpawnableLibrary + //! @brief The interface for managing network spawnables. + class INetworkSpawnableLibrary + { + public: + AZ_RTTI(INetworkSpawnableLibrary, "{A3CF809C-6C1D-4B43-B2C4-3901B5DE1ABE}"); + + virtual ~INetworkSpawnableLibrary() = default; + virtual void BuildSpawnablesList() = 0; + virtual void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) = 0; + virtual AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) = 0; + virtual AZ::Data::AssetId GetAssetIdByName(AZ::Name name) = 0; + }; +} diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h new file mode 100644 index 0000000000..b82fab91be --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerConstants.h @@ -0,0 +1,32 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace Multiplayer +{ + constexpr AZStd::string_view MPNetworkInterfaceName("MultiplayerNetworkInterface"); + constexpr AZStd::string_view MPEditorInterfaceName("MultiplayerEditorNetworkInterface"); + + constexpr AZStd::string_view LocalHost("127.0.0.1"); + constexpr uint16_t DefaultServerPort = 30090; + constexpr uint16_t DefaultServerEditorPort = 30091; + +} + diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerTypes.h b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerTypes.h index e9f3865563..85c7e85c0a 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerTypes.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/MultiplayerTypes.h @@ -16,8 +16,10 @@ #include #include #include +#include #include #include +#include namespace Multiplayer { @@ -40,7 +42,7 @@ namespace Multiplayer //! This is a strong typedef for representing the number of application frames since application start. AZ_TYPE_SAFE_INTEGRAL(HostFrameId, uint32_t); - static constexpr HostFrameId InvalidHostFrameId = HostFrameId{ 0xFFFFFFFF }; + static constexpr HostFrameId InvalidHostFrameId = HostFrameId{ AzPhysics::SimulatedBody::UndefinedFrameId }; using LongNetworkString = AZ::CVarFixedString; using ReliabilityType = AzNetworking::ReliabilityType; @@ -85,8 +87,7 @@ namespace Multiplayer Activate }; - // This is just a placeholder - // The level/prefab cooking will devise the actual solution for identifying a dynamically spawnable entity within a prefab + // Structure for identifying a specific entity within a spawnable struct PrefabEntityId { AZ_TYPE_INFO(PrefabEntityId, "{EFD37465-CCAC-4E87-A825-41B4010A2C75}"); @@ -121,6 +122,13 @@ namespace Multiplayer return serializer.IsValid(); } }; + + struct EntityMigrationMessage + { + NetEntityId m_entityId; + PrefabEntityId m_prefabEntityId; + AzNetworking::PacketEncodingBuffer m_propertyUpdateData; + }; } AZ_TYPE_SAFE_INTEGRAL_SERIALIZEBINDING(Multiplayer::HostId); diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/EntityReplication/ReplicationRecord.h b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/EntityReplication/ReplicationRecord.h index f6eb93c4ba..3dfc4b8016 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/EntityReplication/ReplicationRecord.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/EntityReplication/ReplicationRecord.h @@ -24,14 +24,12 @@ namespace Multiplayer ReplicationRecordStats() = default; ReplicationRecordStats ( - uint32_t authorityToAuthorityCount, uint32_t authorityToClientCount, uint32_t authorityToServerCount, uint32_t authorityToAutonomousCount, uint32_t autonomousToAuthorityCount ); - uint32_t m_authorityToAuthorityCount = 0; uint32_t m_authorityToClientCount = 0; uint32_t m_authorityToServerCount = 0; uint32_t m_authorityToAutonomousCount = 0; @@ -63,19 +61,16 @@ namespace Multiplayer bool Serialize(AzNetworking::ISerializer& serializer); - void ConsumeAuthorityToAuthorityBits(uint32_t consumedBits); void ConsumeAuthorityToClientBits(uint32_t consumedBits); void ConsumeAuthorityToServerBits(uint32_t consumedBits); void ConsumeAuthorityToAutonomousBits(uint32_t consumedBits); void ConsumeAutonomousToAuthorityBits(uint32_t consumedBits); - bool ContainsAuthorityToAuthorityBits() const; bool ContainsAuthorityToClientBits() const; bool ContainsAuthorityToServerBits() const; bool ContainsAuthorityToAutonomousBits() const; bool ContainsAutonomousToAuthorityBits() const; - uint32_t GetRemainingAuthorityToAuthorityBits() const; uint32_t GetRemainingAuthorityToClientBits() const; uint32_t GetRemainingAuthorityToServerBits() const; uint32_t GetRemainingAuthorityToAutonomousBits() const; @@ -84,13 +79,11 @@ namespace Multiplayer ReplicationRecordStats GetStats() const; using RecordBitset = AzNetworking::FixedSizeVectorBitset; - RecordBitset m_authorityToAuthority; RecordBitset m_authorityToClient; RecordBitset m_authorityToServer; RecordBitset m_authorityToAutonomous; RecordBitset m_autonomousToAuthority; - uint32_t m_authorityToAuthorityConsumedBits = 0; uint32_t m_authorityToClientConsumedBits = 0; uint32_t m_authorityToServerConsumedBits = 0; uint32_t m_authorityToAutonomousConsumedBits = 0; diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/INetworkEntityManager.h b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/INetworkEntityManager.h index 72dbe201e5..4fc063333f 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/INetworkEntityManager.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkEntity/INetworkEntityManager.h @@ -78,6 +78,12 @@ namespace Multiplayer const AZ::Transform& transform ) = 0; + //! Configures new networked entity + //! @param netEntity the entity to setup + //! @param prefabEntryId the name of the spawnable the entity originated from + //! @param netEntityRole the net role the entity should be setup for + virtual void SetupNetEntity(AZ::Entity* netEntity, PrefabEntityId prefabEntityId, NetEntityRole netEntityRole) = 0; + //! Returns an ConstEntityPtr for the provided entityId. //! @param netEntityId the netEntityId to get an ConstEntityPtr for //! @return the requested ConstEntityPtr diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.h b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.h new file mode 100644 index 0000000000..01ae7b1207 --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.h @@ -0,0 +1,43 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +#include + +namespace Multiplayer +{ + //! @class RewindableArray + //! @brief Data structure that has a compile-time upper bound, provides array semantics and supports network serialization + template + class RewindableArray + : public AZStd::array, SIZE> + { + public: + //! Serialization method for array contained rewindable objects + //! @param serializer ISerializer instance to use for serialization + //! @return bool true for success, false for serialization failure + bool Serialize(AzNetworking::ISerializer& serializer); + + //! Serialization method for array contained rewindable objects + //! @param serializer ISerializer instance to use for serialization + //! @param deltaRecord Bitset delta record used to detect state change during reconciliation + //! @return bool true for success, false for serialization failure + bool Serialize(AzNetworking::ISerializer& serializer, AzNetworking::IBitset &deltaRecord); + }; +} + +#include diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.inl b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.inl new file mode 100644 index 0000000000..6e496ae4ea --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableArray.inl @@ -0,0 +1,53 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +namespace Multiplayer +{ + template + bool RewindableArray::Serialize(AzNetworking::ISerializer& serializer) + { + for (uint32_t i = 0; i < SIZE; ++i) + { + if(!this[i].Serialize(serializer)) + { + return false; + } + } + + return serializer.IsValid(); + } + + template + bool RewindableArray::Serialize(AzNetworking::ISerializer& serializer, AzNetworking::IBitset& deltaRecord) + { + for (uint32_t i = 0; i < SIZE; ++i) + { + if (deltaRecord.GetBit(i)) + { + serializer.ClearTrackedChangesFlag(); + if(!this[i].Serialize(serializer)) + { + return false; + } + + if ((serializer.GetSerializerMode() == AzNetworking::SerializerMode::WriteToObject) && !serializer.GetTrackedChangesFlag()) + { + deltaRecord.SetBit(i, false); + } + } + } + + return serializer.IsValid(); + } +} diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.h b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.h new file mode 100644 index 0000000000..c05fb98f72 --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.h @@ -0,0 +1,127 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include + +#include + +namespace Multiplayer +{ + //! @class RewindableFixedVector + //! @brief Data structure that has a compile-time upper bound, provides vector semantics and supports network serialization + template + class RewindableFixedVector + { + public: + //! Default constructor + constexpr RewindableFixedVector() = default; + + //! Construct and initialize buffer to the provided value + //! @param initialValue initial value to set the internal buffer to + //! @param count initial value to reserve in the vector + constexpr RewindableFixedVector(const TYPE& initialValue, uint32_t count); + + //! Destructor + ~RewindableFixedVector(); + + //! Serialization method for fixed vector contained rewindable objects + //! @param serializer ISerializer instance to use for serialization + //! @return bool true for success, false for serialization failure + bool Serialize(AzNetworking::ISerializer& serializer); + + //! Serialization method for fixed vector contained rewindable objects + //! @param serializer ISerializer instance to use for serialization + //! @param deltaRecord Bitset delta record used to detect state change during reconciliation + //! @return bool true for success, false for serialization failure + bool Serialize(AzNetworking::ISerializer& serializer, AzNetworking::IBitset &deltaRecord); + + //! Copies elements from the buffer pointed to by Buffer to this FixedSizeVector instance, vector size will be set to BufferSize + //! @param buffer pointer to the buffer to copy + //! @param bufferSize number of elements in the buffer to copy + //! @return bool true on success, false if the input data was too large to fit in the vector + constexpr bool copy_values(const TYPE* buffer, uint32_t bufferSize); + + //! Copy buffer from the provided vector + //! @param RHS instance to copy from + constexpr RewindableFixedVector& operator=(const RewindableFixedVector& rhs); + + //! Equality operator, returns true if the current instance is equal to RHS + //! @param rhs the FixedSizeVector instance to test for equality against + //! @return bool true if equal, false if not + constexpr bool operator ==(const RewindableFixedVector& rhs) const; + + //! Inequality operator, returns true if the current instance is not equal to RHS + //! @param rhs the FixedSizeVector instance to test for inequality against + //! @return bool false if equal, true if not equal + constexpr bool operator !=(const RewindableFixedVector& rhs) const; + + //! Resizes the vector to the requested number of elements, initializing new elements if necessary + //! @param count the number of elements to size the vector to + //! @return bool true on success + constexpr bool resize(uint32_t count); + + //! Resizes the vector to the requested number of elements, without initialization + //! @param count the number of elements to size the vector to + //! @return bool true on success + constexpr bool resize_no_construct(uint32_t count); + + //! Resets the vector, returning it to size 0 + constexpr void clear(); + + //! Const element access + //! @param Index index of the element to return + //! @return const reference to the requested element + constexpr const TYPE& operator[](uint32_t index) const; + + //! Non-const element access + //! @param Index index of the element to return + //! @return non-const reference to the requested element + constexpr TYPE& operator[](uint32_t index); + + //! Pushes a new element to the back of the vector + //! @param Value value to append to the back of this vector + //! @return boolean true on success, false if the vector was full + constexpr bool push_back(const TYPE& value); + + //! Pops the last element off the vector, decreasing the vector's size by one + //! @return bool true on success, false if the vector was empty + constexpr bool pop_back(); + + //! Returns if the vector is empty + //! @return bool true on empty, false if the vector contains valid elements + constexpr bool empty() const; + + //! Gets the last element of the vector + constexpr const TYPE& back() const; + + //! Gets the size of the vector + constexpr uint32_t size() const; + + typedef const RewindableObject* const_iterator; + const_iterator begin() const { return m_container.cbegin(); } + const_iterator end() const { return m_container.cbegin() + aznumeric_cast(size()); } + typedef RewindableObject* iterator; + constexpr iterator begin() { return m_container.begin(); } + constexpr iterator end() { return m_container.begin() + aznumeric_cast(size()); } + + private: + AZStd::array, SIZE> m_container; + // Synchronized value for vector size, prefer using size() locally which checks m_container.size() + RewindableObject m_rewindableSize; + }; +} + +#include diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.inl b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.inl new file mode 100644 index 0000000000..5690e51c35 --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableFixedVector.inl @@ -0,0 +1,230 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +namespace Multiplayer +{ + template + constexpr RewindableFixedVector::RewindableFixedVector(const TYPE& initialValue, uint32_t count) + { + m_container.fill(initialValue); + m_rewindableSize = count; + } + + template + RewindableFixedVector::~RewindableFixedVector() + { + ; + } + + template + bool RewindableFixedVector::Serialize(AzNetworking::ISerializer& serializer) + { + if(!m_rewindableSize.Serialize(serializer)) + { + return false; + } + + for (uint32_t idx = 0; idx < size(); ++idx) + { + if(!m_container[idx].Serialize(serializer)) + { + return false; + } + } + + return serializer.IsValid(); + } + + template + bool RewindableFixedVector::Serialize(AzNetworking::ISerializer& serializer, AzNetworking::IBitset& deltaRecord) + { + if (deltaRecord.GetBit(SIZE)) + { + const uint32_t origSize = m_rewindableSize; + if(!m_rewindableSize.Serialize(serializer)) + { + return false; + } + + if ((serializer.GetSerializerMode() == AzNetworking::SerializerMode::WriteToObject) && origSize == m_rewindableSize) + { + deltaRecord.SetBit(SIZE, false); + } + } + for (uint32_t idx = 0; idx < size(); ++idx) + { + if (deltaRecord.GetBit(idx)) + { + serializer.ClearTrackedChangesFlag(); + if(!m_container[idx].Serialize(serializer)) + { + return false; + } + + if ((serializer.GetSerializerMode() == AzNetworking::SerializerMode::WriteToObject) && !serializer.GetTrackedChangesFlag()) + { + deltaRecord.SetBit(idx, false); + } + } + } + + return serializer.IsValid(); + } + + template + constexpr bool RewindableFixedVector::copy_values(const TYPE* buffer, uint32_t bufferSize) + { + if (!resize(bufferSize)) + { + return false; + } + + for (uint32_t idx = 0; idx < bufferSize; ++idx) + { + m_container[idx] = buffer[idx]; + } + + return true; + } + + template + constexpr RewindableFixedVector& RewindableFixedVector::operator=(const RewindableFixedVector& rhs) + { + resize(rhs.size()); + for (uint32_t idx = 0; idx < size(); ++idx) + { + m_container[idx] = rhs.m_container[idx].Get(); + } + return *this; + } + + template + constexpr bool RewindableFixedVector::operator ==(const RewindableFixedVector& rhs) const + { + return m_container == rhs.m_container && m_rewindableSize == rhs.m_rewindableSize; + } + + template + constexpr bool RewindableFixedVector::operator !=(const RewindableFixedVector& rhs) const + { + return !(*this == rhs); + } + + template + constexpr bool RewindableFixedVector::resize(uint32_t count) + { + if (count > SIZE) + { + return false; + } + + if (count == size()) + { + return true; + } + + if (count > size()) + { + for (uint32_t idx = size(); idx < count; ++idx) + { + m_container[idx] = TYPE(); + } + } + m_rewindableSize = count; + + return true; + } + + template + constexpr bool RewindableFixedVector::resize_no_construct(uint32_t count) + { + if (count > SIZE) + { + return false; + } + + m_rewindableSize = count; + + return true; + } + + template + constexpr void RewindableFixedVector::clear() + { + for (uint32_t idx = 0; idx < SIZE; ++idx) + { + m_container[idx] = TYPE(); + } + m_rewindableSize = 0; + } + + template + constexpr const TYPE& RewindableFixedVector::operator[](uint32_t index) const + { + AZ_Assert(index < size(), "Out of bounds access (requested %u, reserved %u)", index, size()); + return m_container[index].Get(); + } + + template + constexpr TYPE& RewindableFixedVector::operator[](uint32_t index) + { + AZ_Assert(index < size(), "Out of bounds access (requested %u, reserved %u)", index, size()); + return m_container[index].Modify(); + } + + template + constexpr bool RewindableFixedVector::push_back(const TYPE& value) + { + if (size() < SIZE) + { + m_container[m_rewindableSize] = value; + m_rewindableSize = m_rewindableSize + 1; + return true; + } + + return false; + } + + template + constexpr bool RewindableFixedVector::pop_back() + { + if (size() > 0) + { + m_rewindableSize = m_rewindableSize - 1; + m_container[m_rewindableSize] = TYPE(); + return true; + } + + return false; + } + + template + constexpr bool RewindableFixedVector::empty() const + { + return m_rewindableSize.Get() == 0; + } + + template + constexpr const TYPE& RewindableFixedVector::back() const + { + AZ_Assert(size() > 0, "Attempted to get back element of an empty RewindableFixedVector"); + return m_container[m_rewindableSize - 1].Get(); + } + + template + constexpr uint32_t RewindableFixedVector::size() const + { + return m_rewindableSize; + } +} diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableObject.h b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableObject.h index d5b7d563ab..f7e92bbe26 100644 --- a/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableObject.h +++ b/Gems/Multiplayer/Code/Include/Multiplayer/NetworkTime/RewindableObject.h @@ -32,7 +32,7 @@ namespace Multiplayer RewindableObject() = default; //! Constructor. - //! @param connectionId the connectionId of the connection that owns the object. + //! @param value base type value to construct from RewindableObject(const BASE_TYPE& value); //! Copy construct from underlying base type. diff --git a/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h b/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h new file mode 100644 index 0000000000..4013e20a1e --- /dev/null +++ b/Gems/Multiplayer/Code/Include/Multiplayer/Physics/PhysicsUtils.h @@ -0,0 +1,37 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#include + +namespace Multiplayer +{ + namespace Physics + { + //! Performs rewind-aware ray cast in the default physics world. + //! @param request The ray cast request to make. + //! @return Returns a structure that contains a list of Hits. + AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request); + + //! Performs rewind-aware shape cast in the default physics world. + //! @param request The shape cast request to make. + //! @return Returns a structure that contains a list of Hits. + AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request); + + //! Performs rewind-aware overlap in the default physics world. + //! @param request The overlap request to make. + //! @return Returns a structure that contains a list of Hits. + AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request); + + } // namespace Physics +} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Common.jinja b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Common.jinja index 4279c26cf2..61dcacaa94 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Common.jinja +++ b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Common.jinja @@ -188,6 +188,69 @@ virtual void Handle{{ PropertyName }}(AzNetworking::IConnection* invokingConnect {% endmacro %} {# +#} +{% macro DeclareRpcEventGetter(Property, HandleOn) %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{% set PropertyName = UpperFirst(Property.attrib['Name']) %} +{{ ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} +AZ::Event<{{ ', '.join(paramTypes) }}>& Get{{ PropertyName }}Event() { return m_{{ PropertyName }}Event; } +{% endmacro %} +{# + +#} +{% macro DeclareRpcEventGetters(Component, InvokeFrom, HandleOn) %} +{% call(Property) ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{{- DeclareRpcEventGetter(Property, HandleOn) -}} +{% endif %} +{% endcall %} +{% endmacro %} +{# + +#} +{% macro DeclareRpcEvent(Property, HandleOn) %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{% set PropertyName = UpperFirst(Property.attrib['Name']) %} +{{ ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} +AZ::Event<{{ ', '.join(paramTypes) }}> m_{{ PropertyName }}Event; +{% endmacro %} +{# + +#} +{% macro DeclareRpcEvents(Component, InvokeFrom, HandleOn) %} +{% call(Property) ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{{- DeclareRpcEvent(Property, HandleOn) -}} +{% endif %} +{% endcall %} +{% endmacro %} +{# + +#} +{% macro DeclareRpcSignal(Property, HandleOn) %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{% set PropertyName = UpperFirst(Property.attrib['Name']) %} +{{ ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} +void Signal{{ PropertyName }}({{ ', '.join(paramDefines) }}); +{% endmacro %} +{# + +#} +{% macro DeclareRpcSignals(Component, InvokeFrom, HandleOn) %} +{% call(Property) ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{{- DeclareRpcSignal(Property, HandleOn) -}} +{% endif %} +{% endcall %} +{% endmacro %} +{# + #} {%- macro EmitDerivedClassesComment(dataFileNames, Component, ComponentName, ComponentNameBase, ComponentDerived, ControllerName, ControllerNameBase, ControllerDerived, NetworkInputCount) -%} {% if ComponentDerived or ControllerDerived %} @@ -214,6 +277,10 @@ namespace {{ Component.attrib['Namespace'] }} void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override; {{ DeclareRpcHandlers(Component, 'Authority', 'Client', true)|indent(8) }} + {{ DeclareRpcSignals(Component, 'Authority', 'Client')|indent(8) }} + {{ DeclareRpcEventGetters(Component, 'Authority', 'Client')|indent(8) }} + protected: + {{ DeclareRpcEvents(Component, 'Authority', 'Client')|indent(8) }} }; {% endif %} @@ -236,6 +303,20 @@ namespace {{ Component.attrib['Namespace'] }} {{ DeclareRpcHandlers(Component, 'Client', 'Authority', true)|indent(8) }} {{ DeclareRpcHandlers(Component, 'Autonomous', 'Authority', true)|indent(8) }} {{ DeclareRpcHandlers(Component, 'Authority', 'Autonomous', true)|indent(8) }} + {{ DeclareRpcSignals(Component, 'Server', 'Authority')|indent(8) }} + {{ DeclareRpcSignals(Component, 'Client', 'Authority')|indent(8) }} + {{ DeclareRpcSignals(Component, 'Autonomous', 'Authority')|indent(8) }} + {{ DeclareRpcSignals(Component, 'Authority', 'Autonomous')|indent(8) }} + {{ DeclareRpcEventGetters(Component, 'Server', 'Authority')|indent(8) }} + {{ DeclareRpcEventGetters(Component, 'Client', 'Authority')|indent(8) }} + {{ DeclareRpcEventGetters(Component, 'Autonomous', 'Authority')|indent(8) }} + {{ DeclareRpcEventGetters(Component, 'Authority', 'Autonomous')|indent(8) }} + + protected: + {{ DeclareRpcEvents(Component, 'Server', 'Authority')|indent(8) }} + {{ DeclareRpcEvents(Component, 'Client', 'Authority')|indent(8) }} + {{ DeclareRpcEvents(Component, 'Autonomous', 'Authority')|indent(8) }} + {{ DeclareRpcEvents(Component, 'Authority', 'Autonomous')|indent(8) }} }; {% endif %} } diff --git a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja index 8ae8fee618..8cf1eeeb58 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja +++ b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Header.jinja @@ -7,13 +7,21 @@ {% macro DeclareNetworkPropertyGetter(Property) %} {% set PropertyName = UpperFirst(Property.attrib['Name']) %} {% if Property.attrib['Container'] == 'Array' %} -const AZStd::array<{% if Property.attrib['IsRewindable']|booleanTrue %}Multiplayer::RewindableObject<{% endif %}{{ Property.attrib['Type'] }}{% if Property.attrib['IsRewindable']|booleanTrue %}, Multiplayer::k_RewindHistorySize>{% endif %}, {{ Property.attrib['Count'] }}> &Get{{ PropertyName }}Array() const; +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableArray<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> &Get{{ PropertyName }}Array() const; +{% else %} +const AZStd::array<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> &Get{{ PropertyName }}Array() const; +{% endif %} const {{ Property.attrib['Type'] }} &Get{{ PropertyName }}(int32_t index) const; {% if Property.attrib['GenerateEventBindings']|booleanTrue %} void {{ PropertyName }}AddEvent(AZ::Event::Handler& handler); {% endif %} {% elif Property.attrib['Container'] == 'Vector' %} +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableFixedVector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> &Get{{ PropertyName }}Vector() const; +{% else %} const AZStd::fixed_vector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> &Get{{ PropertyName }}Vector() const; +{% endif %} const {{ Property.attrib['Type'] }} &Get{{ PropertyName }}(int32_t index) const; const {{ Property.attrib['Type'] }} &{{ PropertyName }}GetBack() const; uint32_t {{ PropertyName }}GetSize() const; @@ -125,7 +133,7 @@ void {{ PropertyName }}({{ ', '.join(paramDefines) }}); {% macro DeclareRpcInvocations(Component, Section, HandleOn, ProctectedSection) %} {% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, Section, HandleOn) %} {% if Property.attrib['IsPublic']|booleanTrue == ProctectedSection %} -{{- DeclareRpcInvocation(Property, HandleOn) -}} +{{ DeclareRpcInvocation(Property, HandleOn) -}} {% endif %} {% endcall %} {% endmacro %} @@ -156,9 +164,17 @@ AZ::Event<{{ Property.attrib['Type'] }}> m_{{ LowerFirst(Property.attrib['Name'] {% macro DeclareNetworkPropertyVars(Component, ReplicateFrom, ReplicateTo) %} {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, ReplicateFrom, ReplicateTo) %} {% if Property.attrib['Container'] == 'Array' %} -AZStd::array<{% if Property.attrib['IsRewindable']|booleanTrue %}Multiplayer::RewindableObject<{% endif %}{{ Property.attrib['Type'] }}{% if Property.attrib['IsRewindable']|booleanTrue %}, Multiplayer::RewindHistorySize>{% endif %}, {{ Property.attrib['Count'] }}> m_{{ LowerFirst(Property.attrib['Name']) }}; +{% if Property.attrib['IsRewindable']|booleanTrue %} +RewindableArray<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> m_{{ LowerFirst(Property.attrib['Name']) }}; +{% else %} +AZStd::array<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> m_{{ LowerFirst(Property.attrib['Name']) }}; +{% endif %} {% elif Property.attrib['Container'] == 'Vector' %} +{% if Property.attrib['IsRewindable']|booleanTrue %} +RewindableFixedVector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> m_{{ LowerFirst(Property.attrib['Name']) }}; +{% else %} AZStd::fixed_vector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> m_{{ LowerFirst(Property.attrib['Name']) }}; +{% endif %} {% elif Property.attrib['IsRewindable']|booleanTrue %} Multiplayer::RewindableObject<{{ Property.attrib['Type'] }}, Multiplayer::RewindHistorySize> m_{{ LowerFirst(Property.attrib['Name']) }} = {{ Property.attrib['Init'] }}; {% else %} @@ -228,6 +244,8 @@ AZStd::fixed_vector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] } #include #include #include +#include +#include #include {% call(Include) AutoComponentMacros.ParseIncludes(Component) %} #include <{{ Include.attrib['File'] }}> @@ -274,13 +292,6 @@ namespace {{ Component.attrib['Namespace'] }} //! Sets the bits in the attached record that correspond to predictable network properties. void SetPredictableBits(); -{% set networkPropertyCount = {'value' : 0} %} -{% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Authority') %} -{%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} -{% endcall %} -{% if networkPropertyCount.value > 0 %} - AzNetworking::FixedSizeBitsetView m_authorityToAuthority; -{% endif %} {% set networkPropertyCount = {'value' : 0} %} {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Client') %} {%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} @@ -293,7 +304,7 @@ namespace {{ Component.attrib['Namespace'] }} {%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} {% endcall %} {% if networkPropertyCount.value > 0 %} - AzNetworking::FixedSizeBitsetView m_authorityToServer}; + AzNetworking::FixedSizeBitsetView m_authorityToServer; {% endif %} {% set networkPropertyCount = {'value' : 0} %} {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Autonomous') %} @@ -314,7 +325,6 @@ namespace {{ Component.attrib['Namespace'] }} {{ RecordName }} ( Multiplayer::ReplicationRecord& replicationRecord, - uint32_t authorityToAuthoritySimluationStartOffset, uint32_t authorityToClientSimluationStartOffset, uint32_t authorityToServerSimluationStartOffset, uint32_t authorityToAutonomousStartOffset, @@ -367,14 +377,12 @@ namespace {{ Component.attrib['Namespace'] }} void ProcessInput([[maybe_unused]] Multiplayer::NetworkInput& input, [[maybe_unused]] float deltaTime) override {} //! @} - {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Authority', false)|indent(8) -}} - {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Authority', true)|indent(8) -}} {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Server', false)|indent(8) -}} {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Server', true)|indent(8) -}} {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Client', false)|indent(8) -}} {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Client', true)|indent(8) -}} - {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', false)|indent(8) }} - {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', true)|indent(8) }} + {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', false)|indent(8) -}} + {{ DeclareNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', true)|indent(8) -}} {{ DeclareArchetypePropertyGetters(Component)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Server', 'Authority', false)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Server', 'Authority', true)|indent(8) -}} @@ -384,17 +392,31 @@ namespace {{ Component.attrib['Namespace'] }} {{ DeclareRpcInvocations(Component, 'Autonomous', 'Authority', true)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Authority', 'Autonomous', false)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Authority', 'Autonomous', true)|indent(8) -}} - {{ DeclareRpcInvocations(Component, 'Authority', 'Client', false)|indent(8) }} - {{ DeclareRpcInvocations(Component, 'Authority', 'Client', true)|indent(8) }} - {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Server', 'Authority', false)|indent(8) }} - {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Client', 'Authority', false)|indent(8) }} - {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Autonomous', 'Authority', false)|indent(8) }} - {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Authority', 'Autonomous', false)|indent(8) }} + {{ DeclareRpcInvocations(Component, 'Authority', 'Client', false)|indent(8) -}} + {{ DeclareRpcInvocations(Component, 'Authority', 'Client', true)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Server', 'Authority', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Client', 'Authority', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Autonomous', 'Authority', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Authority', 'Autonomous', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Server', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Client', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Autonomous', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Authority', 'Autonomous')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Server', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Client', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Autonomous', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Authority', 'Autonomous')|indent(8) }} {% for Service in Component.iter('ComponentRelation') %} {% if (Service.attrib['HasController']|booleanTrue) and (Service.attrib['Constraint'] != 'Incompatible') %} {{ Service.attrib['Namespace'] }}::{{ Service.attrib['Name'] }}Controller* Get{{ Service.attrib['Name'] }}Controller(); {% endif %} {% endfor %} + + protected: + {{ AutoComponentMacros.DeclareRpcEvents(Component, 'Server', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEvents(Component, 'Client', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEvents(Component, 'Autonomous', 'Authority')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEvents(Component, 'Authority', 'Autonomous')|indent(8) }} }; static const AZ::Uuid s_{{ LowerFirst(ComponentName) }}ConcreteUuid = "{{ (ComponentName) | createHashGuid }}"; @@ -435,9 +457,10 @@ namespace {{ Component.attrib['Namespace'] }} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Server', false)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Autonomous', false)|indent(8) -}} - {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Client', false)|indent(8) }} + {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Client', false)|indent(8) -}} {{ DeclareArchetypePropertyGetters(Component)|indent(8) -}} - {{ DeclareRpcInvocations(Component, 'Server', 'Authority', false)|indent(8) }} + {{ DeclareRpcInvocations(Component, 'Server', 'Authority', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEventGetters(Component, 'Authority', 'Client')|indent(8) -}} //! MultiplayerComponent interface //! @{ @@ -457,13 +480,14 @@ namespace {{ Component.attrib['Namespace'] }} void NetworkAttach(Multiplayer::NetBindComponent* netBindComponent, Multiplayer::ReplicationRecord& currentEntityRecord, Multiplayer::ReplicationRecord& predictableEntityRecord) override; //! @} - {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Authority', true)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Server', true)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Autonomous', true)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Autonomous', 'Authority', true)|indent(8) -}} {{ DeclareNetworkPropertyGetters(Component, 'Authority', 'Client', true)|indent(8) -}} {{ DeclareRpcInvocations(Component, 'Server', 'Authority', true)|indent(8) -}} - {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Authority', 'Client', false)|indent(8) }} + {{ AutoComponentMacros.DeclareRpcHandlers(Component, 'Authority', 'Client', false)|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcSignals(Component, 'Authority', 'Client')|indent(8) -}} + {{ AutoComponentMacros.DeclareRpcEvents(Component, 'Authority', 'Client')|indent(8) }} {% for Service in Component.iter('ComponentRelation') %} {% if Service.attrib['Constraint'] != 'Incompatible' %} const {{ Service.attrib['Namespace'] }}::{{ Service.attrib['Name'] }}* Get{{ Service.attrib['Name'] }}() const; @@ -471,10 +495,6 @@ namespace {{ Component.attrib['Namespace'] }} {% endif %} {% endfor %} private: - //! Authority To Authority serializers (hot backup in case of server failure) - bool SerializeAuthorityToAuthorityProperties({{ RecordName }}& replicationRecord, AzNetworking::ISerializer& serializer); - void NotifyChangesAuthorityToAuthorityProperties(const {{ RecordName }}& replicationRecord) const; - //! Authority to Client serializers bool SerializeAuthorityToClientProperties({{ RecordName }}& replicationRecord, AzNetworking::ISerializer& serializer); void NotifyChangesAuthorityToClientProperties(const {{ RecordName }}& replicationRecord) const; @@ -499,21 +519,18 @@ namespace {{ Component.attrib['Namespace'] }} AZStd::unique_ptr<{{ ControllerName }}> m_controller; //! Network Properties - {{ DeclareNetworkPropertyVars(Component, 'Authority', 'Authority')|indent(8) -}} {{ DeclareNetworkPropertyVars(Component, 'Authority', 'Server')|indent(8) -}} {{ DeclareNetworkPropertyVars(Component, 'Authority', 'Client')|indent(8) -}} {{ DeclareNetworkPropertyVars(Component, 'Authority', 'Autonomous')|indent(8) -}} {{ DeclareNetworkPropertyVars(Component, 'Autonomous', 'Authority')|indent(8) }} //! Network Properties for reflection and editor support - {{ DeclareNetworkPropertyReflectVars(Component, 'Authority', 'Authority')|indent(8) -}} {{ DeclareNetworkPropertyReflectVars(Component, 'Authority', 'Server')|indent(8) -}} {{ DeclareNetworkPropertyReflectVars(Component, 'Authority', 'Client')|indent(8) -}} {{ DeclareNetworkPropertyReflectVars(Component, 'Authority', 'Autonomous')|indent(8) -}} {{ DeclareNetworkPropertyReflectVars(Component, 'Autonomous', 'Authority')|indent(8) }} //! NetworkProperty Events - {{ DeclareNetworkPropertyEvents(Component, 'Authority', 'Authority')|indent(8) -}} {{ DeclareNetworkPropertyEvents(Component, 'Authority', 'Server')|indent(8) -}} {{ DeclareNetworkPropertyEvents(Component, 'Authority', 'Client')|indent(8) -}} {{ DeclareNetworkPropertyEvents(Component, 'Authority', 'Autonomous')|indent(8) -}} diff --git a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja index ffb09cf8f5..0feff5c07c 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja +++ b/Gems/Multiplayer/Code/Source/AutoGen/AutoComponent_Source.jinja @@ -3,7 +3,11 @@ {% macro LowerFirst(text) %}{{ text[0] | lower}}{{ text[1:] }}{% endmacro %} {% macro DefineNetworkPropertyGet(ClassName, Property, Prefix = '') %} {% if Property.attrib['Container'] == 'Array' %} -const AZStd::array<{% if Property.attrib['IsRewindable']|booleanTrue %}Multiplayer::RewindableObject<{% endif %}{{ Property.attrib['Type'] }}{% if Property.attrib['IsRewindable']|booleanTrue %}, Multiplayer::RewindHistorySize>{% endif %}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Array() const +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableArray<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Array() const +{% else %} +const AZStd::array<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Array() const +{% endif %} { return {{ Prefix }}m_{{ LowerFirst(Property.attrib['Name']) }}; } @@ -21,7 +25,11 @@ void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}AddEvent(AZ::Even {% endif %} {% elif Property.attrib['Container'] == 'Vector' %} +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableFixedVector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Vector() const +{% else %} const AZStd::fixed_vector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Vector() const +{% endif %} { return {{ Prefix }}m_{{ LowerFirst(Property.attrib['Name']) }}; } @@ -111,24 +119,28 @@ void {{ ClassName }}::Set{{ UpperFirst(Property.attrib['Name']) }}(int32_t index bool {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}PushBack(const {{ Property.attrib['Type'] }} &value) { int32_t indexToSet = GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.size(); - GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.push_back(value); - int32_t bitIndex = indexToSet + static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}); - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(bitIndex, true); - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); - GetParent().MarkDirty(); - return true; + if (indexToSet < {{ Property.attrib['Count'] }}) + { + GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.push_back(value); + int32_t bitIndex = indexToSet + static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(bitIndex, true); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); + GetParent().MarkDirty(); + return true; + } + return false; } bool {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}PopBack(const Multiplayer::NetworkInput&) { - if (GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.empty()) + if (!GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.empty()) { - return false; + GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.pop_back(); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); + GetParent().MarkDirty(); + return true; } - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); - GetParent().MarkDirty(); - GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.pop_back(); - return true; + return false; } void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}Clear(const Multiplayer::NetworkInput&) @@ -207,30 +219,34 @@ void {{ ClassName }}::Set{{ UpperFirst(Property.attrib['Name']) }}(int32_t index bool {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}PushBack(const {{ Property.attrib['Type'] }} &value) { - uint32_t indexToSet = aznumeric_cast(GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.size()); - GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.push_back(value); - uint32_t bitIndex = indexToSet + aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}); - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(bitIndex, true); - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); - GetParent().MarkDirty(); - return true; + int32_t indexToSet = GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.size(); + if (indexToSet < {{ Property.attrib['Count'] }}) + { + GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.push_back(value); + int32_t bitIndex = indexToSet + static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(bitIndex, true); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); + GetParent().MarkDirty(); + return true; + } + return false; } bool {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}PopBack() { - if (GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.empty()) + if (!GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.empty()) { - return false; + GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.pop_back(); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); + GetParent().MarkDirty(); + return true; } - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); - GetParent().MarkDirty(); - GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.pop_back(); - return true; + return false; } void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}Clear() { - GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); + GetParent().m_currentRecord->m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.SetBit(aznumeric_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}), true); GetParent().m_{{ LowerFirst(Property.attrib['Name']) }}.clear(); GetParent().MarkDirty(); } @@ -315,16 +331,86 @@ void {{ ClassName }}::{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(par {% endmacro %} {# +#} +{% macro DefineRpcSignal(Component, ClassName, Property, InvokeFrom) %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} +void {{ ClassName }}::Signal{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramDefines) }}) +{ + m_{{ UpperFirst(Property.attrib['Name']) }}Event.Signal({{ ', '.join(paramNames) }}); +} +{% endmacro %} +{# + #} {% macro DefineRpcInvocations(Component, ClassName, InvokeFrom, HandleOn, ProctectedSection) %} {% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} {% if Property.attrib['IsPublic']|booleanTrue == ProctectedSection %} -{{ DefineRpcInvocation(Component, ClassName, Property, InvokeFrom, HandleOn) }} +{{ DefineRpcInvocation(Component, ClassName, Property, InvokeFrom, HandleOn) -}} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{{ DefineRpcSignal(Component, ClassName, Property, InvokeFrom) -}} +{% endif %} {% endif %} {% endcall %} {% endmacro %} {# +#} +{% macro ReflectRpcInvocations(Component, ClassName, InvokeFrom, HandleOn) %} +{% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} + ->Method("{{ UpperFirst(Property.attrib['Name']) }}", [](const {{ ClassName }}* self, {{ ', '.join(paramDefines) }}) { + self->m_controller->{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(paramNames) }}); + }) +{% endif %} +{% endcall %} +{% endmacro %} +{# + +#} +{% macro ReflectRpcEventDescs(Component, ClassName, InvokeFrom, HandleOn) %} +{% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} + // Create the BehaviorAZEventDescription needed to reflect the + // Get{{ UpperFirst(Property.attrib['Name']) }}Event method to the BehaviorContext without errors + AZ::BehaviorAzEventDescription {{ LowerFirst(Property.attrib['Name']) }}EventDesc; + {{ LowerFirst(Property.attrib['Name']) }}EventDesc.m_eventName = "{{ UpperFirst(Property.attrib['Name']) }} Notify Event"; +{% for Param in Property.iter('Param') %} + {{ LowerFirst(Property.attrib['Name']) }}EventDesc.m_parameterNames.push_back("{{ LowerFirst(Param.attrib['Name']) }}"); +{% endfor %} +{% endif %} +{% endcall %} +{% endmacro %} +{# + +#} +{% macro ReflectRpcEvents(Component, ClassName, InvokeFrom, HandleOn) %} +{% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} +{% set paramNames = [] %} +{% set paramTypes = [] %} +{% set paramDefines = [] %} +{{ AutoComponentMacros.ParseRpcParams(Property, paramNames, paramTypes, paramDefines) }} + ->Method("Get{{ UpperFirst(Property.attrib['Name']) }}Event", [](const {{ ClassName }}* self) -> AZ::Event<{{ ', '.join(paramTypes) }}>& + { + return self->m_controller->Get{{ UpperFirst(Property.attrib['Name']) }}Event(); + }) + ->Attribute(AZ::Script::Attributes::AzEventDescription, AZStd::move({{ LowerFirst(Property.attrib['Name']) }}EventDesc)) +{% endif %} +{% endcall %} +{% endmacro %} +{# + #} {% macro DeclareRpcHandleCases(Component, ComponentDerived, InvokeFrom, HandleOn, ValidationFunction) %} {% call(Property) AutoComponentMacros.ParseRemoteProcedures(Component, InvokeFrom, HandleOn) %} @@ -347,6 +433,9 @@ case {{ UpperFirst(Component.attrib['Name']) }}Internal::RemoteProcedure::{{ Upp { AZ_Assert(GetNetBindComponent()->GetNetEntityRole() == Multiplayer::NetEntityRole::Authority, "Entity proxy does not have authority"); m_controller->Handle{{ UpperFirst(Property.attrib['Name']) }}(invokingConnection, {{ ', '.join(rpcParamList) }}); +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} + m_controller->Signal{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(rpcParamList) }}); +{% endif %} } {% if Property.attrib['IsReliable']|booleanTrue %} {# if the rpc is not reliable we can simply drop it, also note message reliability type is default reliable in EntityRpcMessage #} @@ -361,6 +450,9 @@ case {{ UpperFirst(Component.attrib['Name']) }}Internal::RemoteProcedure::{{ Upp { AZ_Assert(GetNetBindComponent()->GetNetEntityRole() == Multiplayer::NetEntityRole::Autonomous, "Entity proxy does not have autonomy"); m_controller->Handle{{ UpperFirst(Property.attrib['Name']) }}(invokingConnection, {{ ', '.join(rpcParamList) }}); +{% if Property.attrib['GenerateEventBindings']|booleanTrue == true %} + m_controller->Signal{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(rpcParamList) }}); +{% endif %} } {% else %} Handle{{ UpperFirst(Property.attrib['Name']) }}({{ ', '.join(rpcParamList) }}); @@ -486,12 +578,12 @@ bool {{ ClassName }}::Serialize{{ AutoComponentMacros.GetNetPropertiesSetName(Re {%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} {% endcall %} {% if networkPropertyCount.value > 0 %} - Multiplayer::MultiplayerStats& stats = Multiplayer::GetMultiplayer()->GetStats(); + [[maybe_unused]] Multiplayer::MultiplayerStats& stats = Multiplayer::GetMultiplayer()->GetStats(); // We modify the record if we are writing an update so that we don't notify for a change that really didn't change the value (just a duplicated send from the server) [[maybe_unused]] bool modifyRecord = serializer.GetSerializerMode() == AzNetworking::SerializerMode::WriteToObject; {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, ReplicateFrom, ReplicateTo) %} {% if Property.attrib['Container'] != 'None' and Property.attrib['Container'] != 'Object' %} - { /* @todo Implement serialization for Vector and Array Network Properties + { // Serialization for Vector and Array Network Properties const uint32_t firstBit = static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}); {% if Property.attrib['Container'] == 'Vector' %} const uint32_t lastBit = static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}); @@ -499,17 +591,16 @@ bool {{ ClassName }}::Serialize{{ AutoComponentMacros.GetNetPropertiesSetName(Re const uint32_t lastBit = static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'End') }}); {% endif %} - AzNetworking::BitsetView deltaRecord(replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}, firstBit, lastBit - firstBit + 1); - if (deltaRecord.AnySet()) - { -{% if Property.attrib['Container'] == 'Vector' %} - Multiplayer::SerializableFixedSizeVectorDeltaStruct<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}> deltaStruct(m_{{ LowerFirst(Property.attrib['Name']) }}, deltaRecord); -{% else %} - Multiplayer::SerializableFixedSizeArrayDeltaStruct<{% if Property.attrib['IsRewindable']|booleanTrue %}Multiplayer::RewindableObject<{% endif %}{{ Property.attrib['Type'] }}{% if Property.attrib['IsRewindable']|booleanTrue %}, Multiplayer::RewindHistorySize>{% endif %}, {{ Property.attrib['Count'] }}> deltaStruct(m_{{ Property.attrib['Name'] }}, deltaRecord); -{% endif %} - serializer.Serialize(deltaStruct, "{{ UpperFirst(Property.attrib['Name']) }}"); - } - */ +{% if Property.attrib['IsRewindable']|booleanTrue %} + AzNetworking::FixedSizeBitsetView deltaRecord(replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}, firstBit, lastBit - firstBit + 1); + m_{{ LowerFirst(Property.attrib['Name']) }}.Serialize(serializer, deltaRecord); +{% else %} +{% if Property.attrib['Container'] == 'Vector' %} + serializer.Serialize>(m_{{ LowerFirst(Property.attrib['Name']) }}, "{{ LowerFirst(Property.attrib['Name']) }}"); +{% elif Property.attrib['Container'] == 'Array' %} + serializer.Serialize>(m_{{ LowerFirst(Property.attrib['Name']) }}, "{{ LowerFirst(Property.attrib['Name']) }}"); +{% endif %} +{% endif %} } {% else %} Multiplayer::SerializeNetworkPropertyHelper @@ -539,19 +630,19 @@ void {{ ClassName }}::NotifyChanges{{ AutoComponentMacros.GetNetPropertiesSetNam {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, ReplicateFrom, ReplicateTo) %} {% if (Property.attrib['GenerateEventBindings']|booleanTrue) %} {% if Property.attrib['Container'] != 'None' and Property.attrib['Container'] != 'Object' %} - /* todo Implement NotifyChangesAuthorityToClientProperties for Arrays and Vectors - for (uint32_t bitIndex = static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}), elementIndex = 0; bitIndex <= static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component, ReplicateFrom, ReplicateTo, Property, 'End') }}); ++bitIndex, ++elementIndex) + // NotifyChangesAuthorityToClientProperties for Arrays and Vectors + for (uint32_t bitIndex = static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Start') }}), elementIndex = 0; bitIndex <= static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'End') }}); ++bitIndex, ++elementIndex) { - if (replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.GetBit(bitIndex){% if Property.attrib['Container'] == 'Vector' %} && elementIndex < m_{{ Property.attrib['Name'] }}.GetSize(){% endif %}) + if (replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.GetBit(bitIndex){% if Property.attrib['Container'] == 'Vector' %} && elementIndex < m_{{ LowerFirst(Property.attrib['Name']) }}.size(){% endif %}) { - m_LowerFirst( Property.attrib['Name']) }}Event.Signal(elementIndex, m_{{ LowerFirst(Property.attrib['Name']) }}[elementIndex]); + m_{{ LowerFirst(Property.attrib['Name']) }}Event.Signal(elementIndex, m_{{ LowerFirst(Property.attrib['Name']) }}[elementIndex]); } } {% if Property.attrib['Container'] == 'Vector' %} if (replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.GetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property, 'Size') }}))) { m_{{ LowerFirst(Property.attrib['Name']) }}SizeChangedEvent.Signal(m_{{ LowerFirst(Property.attrib['Name']) }}.size()); - } */ + } {% endif %} {% else %} if (replicationRecord.m_{{ LowerFirst(AutoComponentMacros.GetNetPropertiesSetName(ReplicateFrom, ReplicateTo)) }}.GetBit(static_cast({{ AutoComponentMacros.GetNetPropertiesQualifiedPropertyDirtyEnum(Component.attrib['Name'], ReplicateFrom, ReplicateTo, Property) }}))) @@ -569,7 +660,11 @@ void {{ ClassName }}::NotifyChanges{{ AutoComponentMacros.GetNetPropertiesSetNam {% macro DefineArchetypePropertyGet(Property, ClassType, ClassName, Prefix = '') %} {% if ClassType == '' or Property.attrib['ExportTo'] == ClassType or Property.attrib['ExportTo'] == "Common" %} {% if Property.attrib['Container'] == 'Array' %} +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableArray<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Array() const +{% else %} const AZStd::array<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Array() const +{% endif %} { return {{ Prefix }}m_{{ LowerFirst(Property.attrib['Name']) }}; } @@ -580,7 +675,11 @@ const {{ Property.attrib['Type'] }}& {{ ClassName }}::Get{{ UpperFirst(Property. } {% elif Property.attrib['Container'] == 'Vector' %} +{% if Property.attrib['IsRewindable']|booleanTrue %} +const RewindableFixedVector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Vector() const +{% else %} const AZStd::fixed_vector<{{ Property.attrib['Type'] }}, {{ Property.attrib['Count'] }}>& {{ ClassName }}::Get{{ UpperFirst(Property.attrib['Name']) }}Vector() const +{% endif %} { return {{ Prefix }}m_{{ LowerFirst(Property.attrib['Name']) }}; } @@ -1017,7 +1116,6 @@ namespace {{ Component.attrib['Namespace'] }} { {{ DeclareRemoteProcedureEnumerations(Component)|indent(8) }} {{ DeclareNetworkPropertyEnumerations(Component)|indent(8) }} - {{ DefineNetworkPropertyDirtyEnumeration(Component, ClassType, 'Authority', 'Authority')|indent(8) }} {{ DefineNetworkPropertyDirtyEnumeration(Component, ClassType, 'Authority', 'Client')|indent(8) }} {{ DefineNetworkPropertyDirtyEnumeration(Component, ClassType, 'Authority', 'Server')|indent(8) }} {{ DefineNetworkPropertyDirtyEnumeration(Component, ClassType, 'Authority', 'Autonomous')|indent(8) }} @@ -1032,7 +1130,6 @@ namespace {{ Component.attrib['Namespace'] }} {{ RecordName }}::{{ RecordName }} ( [[maybe_unused]] Multiplayer::ReplicationRecord& replicationRecord, - [[maybe_unused]] uint32_t authorityToAuthorityStartOffset, [[maybe_unused]] uint32_t authorityToClientStartOffset, [[maybe_unused]] uint32_t authorityToServerStartOffset, [[maybe_unused]] uint32_t authorityToAutonomousStartOffset, @@ -1040,13 +1137,6 @@ namespace {{ Component.attrib['Namespace'] }} ) {% set comma = joiner(" ,") %} {% set networkPropertyCount = {'value' : 0} %} -{% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Authority') %} -{%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} -{% endcall %} -{% if networkPropertyCount.value > 0 %} -{{ comma()|default(" :", true) }} m_authorityToAuthority(replicationRecord.m_authorityToAuthority, authorityToAuthorityStartOffset, replicationRecord.ContainsAuthorityToAuthorityBits() ? static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Authority') }}::Count) : 0) -{% endif %} -{% set networkPropertyCount = {'value' : 0} %} {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Client') %} {%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} {% endcall %} @@ -1058,7 +1148,7 @@ namespace {{ Component.attrib['Namespace'] }} {%- if networkPropertyCount.update({'value': networkPropertyCount.value + 1}) %}{% endif -%} {% endcall %} {% if networkPropertyCount.value > 0 %} - {{ comma()|default(" :", true) }} authorityToServer }}(replicationRecord.m_authorityToServer, authorityToServerStartOffset, replicationRecord.ContainsAuthorityToServerBits() ? static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Server') }}::Count) : 0) + {{ comma()|default(" :", true) }} m_authorityToServer(replicationRecord.m_authorityToServer, authorityToServerStartOffset, replicationRecord.ContainsAuthorityToServerBits() ? static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Server') }}::Count) : 0) {% endif %} {% set networkPropertyCount = {'value' : 0} %} {% call(Property) AutoComponentMacros.ParseNetworkProperties(Component, 'Authority', 'Autonomous') %} @@ -1080,9 +1170,6 @@ namespace {{ Component.attrib['Namespace'] }} AZStd::unique_ptr<{{ RecordName }}> {{ RecordName }}::AllocateRecord(Multiplayer::ReplicationRecord& replicationRecord) { - uint32_t authorityToAuthorityStart = replicationRecord.m_authorityToAuthority.GetSize(); - replicationRecord.m_authorityToAuthority.Resize(authorityToAuthorityStart + static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Authority') }}::Count)); - uint32_t authorityToClientStart = replicationRecord.m_authorityToClient.GetSize(); replicationRecord.m_authorityToClient.Resize(authorityToClientStart + static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Client') }}::Count)); @@ -1096,7 +1183,6 @@ namespace {{ Component.attrib['Namespace'] }} replicationRecord.m_autonomousToAuthority.Resize(autonomousToAuthorityStart + static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Autonomous', 'Authority') }}::Count)); return AZStd::unique_ptr<{{ RecordName }}>(new {{ RecordName }}(replicationRecord, - authorityToAuthorityStart, authorityToClientStart, authorityToServerStart, authorityToAutonomousStart, @@ -1106,7 +1192,6 @@ namespace {{ Component.attrib['Namespace'] }} bool {{ RecordName }}::CanAttachRecord(Multiplayer::ReplicationRecord& replicationRecord) { bool canAttach{ true }; - canAttach &= replicationRecord.ContainsAuthorityToAuthorityBits() ? (replicationRecord.GetRemainingAuthorityToAuthorityBits() >= static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Authority') }}::Count)) : true; canAttach &= replicationRecord.ContainsAuthorityToClientBits() ? (replicationRecord.GetRemainingAuthorityToClientBits() >= static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Client') }}::Count)) : true; canAttach &= replicationRecord.ContainsAuthorityToServerBits() ? (replicationRecord.GetRemainingAuthorityToServerBits() >= static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Server') }}::Count)) : true; canAttach &= replicationRecord.ContainsAuthorityToAutonomousBits() ? (replicationRecord.GetRemainingAuthorityToAutonomousBits() >= static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Autonomous') }}::Count)) : true; @@ -1116,9 +1201,6 @@ namespace {{ Component.attrib['Namespace'] }} {{ RecordName }} {{ RecordName }}::AttachRecord(Multiplayer::ReplicationRecord& replicationRecord) { - uint32_t authorityToAuthorityStart = replicationRecord.m_authorityToAuthorityConsumedBits; - replicationRecord.ConsumeAuthorityToAuthorityBits(static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Authority') }}::Count)); - uint32_t authorityToClientStart = replicationRecord.m_authorityToClientConsumedBits; replicationRecord.ConsumeAuthorityToClientBits(static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Authority', 'Client') }}::Count)); @@ -1132,7 +1214,6 @@ namespace {{ Component.attrib['Namespace'] }} replicationRecord.ConsumeAutonomousToAuthorityBits(static_cast({{ AutoComponentMacros.GetNetPropertiesDirtyEnumName(ComponentName, 'Autonomous', 'Authority') }}::Count)); return {{ RecordName }}(replicationRecord, - authorityToAuthorityStart, authorityToClientStart, authorityToServerStart, authorityToAutonomousStart, @@ -1142,9 +1223,9 @@ namespace {{ Component.attrib['Namespace'] }} void {{ RecordName }}::SetPredictableBits() { {{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Authority', 'Client')|indent(8) -}} -{{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Authority', 'Server')|indent(8) -}} -{{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Authority', 'Autonomous')|indent(8) -}} -{{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Autonomous', 'Authority')|indent(8) }} + {{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Authority', 'Server')|indent(8) -}} + {{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Authority', 'Autonomous')|indent(8) -}} + {{ GenerateModelReplicationRecordPredictableBits(Component, ClassType, 'Autonomous', 'Authority')|indent(8) }} } {% if NetworkInputCount > 0 %} @@ -1206,23 +1287,22 @@ namespace {{ Component.attrib['Namespace'] }} return static_cast<{{ ComponentName }}&>(GetOwner()); } - {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Authority', false, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Authority', true, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Server', false, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Server', true, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Client', false, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Client', true, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', false, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', true, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', false, ControllerBaseName)|indent(4) -}} -{{ DefineNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', true, ControllerBaseName)|indent(4) }} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Server', false, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Server', true, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Client', false, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Client', true, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', false, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Authority', 'Autonomous', true, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', false, ControllerBaseName)|indent(4) -}} + {{ DefineNetworkPropertyAccessors(Component, 'Autonomous', 'Authority', true, ControllerBaseName)|indent(4) }} {{ DefineArchetypePropertyGets(Component, ClassType, ControllerBaseName, "GetParent().")|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Autonomous', 'Authority', false)|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Autonomous', 'Authority', true)|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Autonomous', false)|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Autonomous', true)|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Client', false)|indent(4) -}} -{{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Client', true)|indent(4) }} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Autonomous', 'Authority', false)|indent(4) -}} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Autonomous', 'Authority', true)|indent(4) -}} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Autonomous', false)|indent(4) -}} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Autonomous', true)|indent(4) -}} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Client', false)|indent(4) -}} + {{ DefineRpcInvocations(Component, ControllerBaseName, 'Authority', 'Client', true)|indent(4) }} + {% for Service in Component.iter('ComponentRelation') %} {% if (Service.attrib['HasController']|booleanTrue) and (Service.attrib['Constraint'] != 'Incompatible') %} {{ Service.attrib['Namespace'] }}::{{ Service.attrib['Name'] }}Controller* {{ ControllerBaseName }}::Get{{ Service.attrib['Name'] }}Controller() @@ -1241,11 +1321,10 @@ namespace {{ Component.attrib['Namespace'] }} { serializeContext->Class<{{ ComponentBaseName }}, Multiplayer::MultiplayerComponent>() ->Version(1) - {{ DefineNetworkPropertyReflection(Component, 'Authority', 'Authority', ComponentBaseName)|indent(16) -}} -{{ DefineNetworkPropertyReflection(Component, 'Authority', 'Server', ComponentBaseName)|indent(16) -}} -{{ DefineNetworkPropertyReflection(Component, 'Authority', 'Client', ComponentBaseName)|indent(16) -}} -{{ DefineNetworkPropertyReflection(Component, 'Authority', 'Autonomous', ComponentBaseName)|indent(16) -}} -{{ DefineNetworkPropertyReflection(Component, 'Autonomous', 'Authority', ComponentBaseName)|indent(16) }} + {{ DefineNetworkPropertyReflection(Component, 'Authority', 'Server', ComponentBaseName)|indent(16) -}} + {{ DefineNetworkPropertyReflection(Component, 'Authority', 'Client', ComponentBaseName)|indent(16) -}} + {{ DefineNetworkPropertyReflection(Component, 'Authority', 'Autonomous', ComponentBaseName)|indent(16) -}} + {{ DefineNetworkPropertyReflection(Component, 'Autonomous', 'Authority', ComponentBaseName)|indent(16) }} {{ DefineArchetypePropertyReflection(Component, ComponentBaseName)|indent(16) }}; } ReflectToEditContext(context); @@ -1264,11 +1343,10 @@ namespace {{ Component.attrib['Namespace'] }} ->ClassElement(AZ::Edit::ClassElements::EditorData, "") ->Attribute(AZ::Edit::Attributes::Category, "{{ Component.attrib['Namespace'] }}") ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")) - {{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Authority', ComponentBaseName)|indent(20) -}} -{{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Server', ComponentBaseName)|indent(20) -}} -{{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Client', ComponentBaseName)|indent(20) -}} -{{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Autonomous', ComponentBaseName)|indent(20) -}} -{{ DefineNetworkPropertyEditReflection(Component, 'Autonomous', 'Authority', ComponentBaseName)|indent(20) }} + {{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Server', ComponentBaseName)|indent(20) -}} + {{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Client', ComponentBaseName)|indent(20) -}} + {{ DefineNetworkPropertyEditReflection(Component, 'Authority', 'Autonomous', ComponentBaseName)|indent(20) -}} + {{ DefineNetworkPropertyEditReflection(Component, 'Autonomous', 'Authority', ComponentBaseName)|indent(20) }} {{ DefineArchetypePropertyEditReflection(Component, ComponentBaseName)|indent(20) }}; {% if ComponentDerived %} @@ -1286,18 +1364,34 @@ namespace {{ Component.attrib['Namespace'] }} AZ::BehaviorContext* behaviorContext = azrtti_cast(context); if (behaviorContext) { + {{ ReflectRpcEventDescs(Component, ComponentName, 'Server', 'Authority')|indent(4) -}} + {{ ReflectRpcEventDescs(Component, ComponentName, 'Autonomous', 'Authority')|indent(4) -}} + {{ ReflectRpcEventDescs(Component, ComponentName, 'Authority', 'Autonomous')|indent(4) -}} + {{ ReflectRpcEventDescs(Component, ComponentName, 'Authority', 'Client')|indent(4) }} + behaviorContext->Class<{{ ComponentName }}>("{{ ComponentName }}") ->Attribute(AZ::Script::Attributes::Module, "{{ LowerFirst(Component.attrib['Namespace']) }}") ->Attribute(AZ::Script::Attributes::Category, "{{ UpperFirst(Component.attrib['Namespace']) }}") - // Reflect Network Properties Get, Set, and OnChanged methods - {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Authority', ComponentName) | indent(16) -}} - {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Server', ComponentName) | indent(16) -}} - {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Client', ComponentName) | indent(16) -}} - {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Autonomous', ComponentName) | indent(16) -}} - {{ DefineNetworkPropertyBehaviorReflection(Component, 'Autonomous', 'Authority', ComponentName) | indent(16) -}} - {{- DefineArchetypePropertyBehaviorReflection(Component, ComponentName) | indent(16) }} - ; + // Reflect Network Properties Get, Set, and OnChanged methods + {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Authority', ComponentName) | indent(16) -}} + {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Server', ComponentName) | indent(16) -}} + {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Client', ComponentName) | indent(16) -}} + {{ DefineNetworkPropertyBehaviorReflection(Component, 'Authority', 'Autonomous', ComponentName) | indent(16) -}} + {{ DefineNetworkPropertyBehaviorReflection(Component, 'Autonomous', 'Authority', ComponentName) | indent(16) -}} + + // Reflect RPCs + {{ ReflectRpcInvocations(Component, ComponentName, 'Server', 'Authority')|indent(4) -}} + {{ ReflectRpcInvocations(Component, ComponentName, 'Autonomous', 'Authority')|indent(4) -}} + {{ ReflectRpcInvocations(Component, ComponentName, 'Authority', 'Autonomous')|indent(4) -}} + {{ ReflectRpcInvocations(Component, ComponentName, 'Authority', 'Client')|indent(4) -}} + {{ ReflectRpcEvents(Component, ComponentName, 'Server', 'Authority')|indent(4) -}} + {{ ReflectRpcEvents(Component, ComponentName, 'Autonomous', 'Authority')|indent(4) -}} + {{ ReflectRpcEvents(Component, ComponentName, 'Authority', 'Autonomous')|indent(4) -}} + {{ ReflectRpcEvents(Component, ComponentName, 'Authority', 'Client')|indent(4) -}} + + {{- DefineArchetypePropertyBehaviorReflection(Component, ComponentName) | indent(16) }} + ; } } @@ -1385,17 +1479,15 @@ namespace {{ Component.attrib['Namespace'] }} {% endcall %} } - {{ DefineNetworkPropertyGets(Component, 'Authority', 'Authority', false, ComponentBaseName)|indent(4) -}} -{{ DefineNetworkPropertyGets(Component, 'Authority', 'Server', false, ComponentBaseName)|indent(4) -}} + {{ DefineNetworkPropertyGets(Component, 'Authority', 'Server', false, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Autonomous', false, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Autonomous', 'Authority', false, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Client', false, ComponentBaseName)|indent(4) -}} -{{ DefineNetworkPropertyGets(Component, 'Authority', 'Authority', true, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Server', true, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Autonomous', true, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Autonomous', 'Authority', true, ComponentBaseName)|indent(4) -}} {{ DefineNetworkPropertyGets(Component, 'Authority', 'Client', true, ComponentBaseName)|indent(4) }} - {{ DefineArchetypePropertyGets(Component, ClassType, ComponentBaseName)|indent(4) -}} +{{ DefineArchetypePropertyGets(Component, ClassType, ComponentBaseName)|indent(4) -}} {{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', false)|indent(4) -}} {{ DefineRpcInvocations(Component, ComponentBaseName, 'Server', 'Authority', true)|indent(4) }} @@ -1403,7 +1495,14 @@ namespace {{ Component.attrib['Namespace'] }} { {% for Property in Component.iter('NetworkProperty') %} {% if Property.attrib['IsRewindable']|booleanTrue %} +{% if Property.attrib['Container'] == 'Vector' or Property.attrib['Container'] == 'Array' %} + for ( auto& element: m_{{ LowerFirst(Property.attrib['Name']) }}) + { + element.SetOwningConnectionId(connectionId); + } +{% else %} m_{{ LowerFirst(Property.attrib['Name']) }}.SetOwningConnectionId(connectionId); +{% endif %} {% endif %} {% endfor %} } @@ -1448,10 +1547,6 @@ namespace {{ Component.attrib['Namespace'] }} {{ RecordName }} record = {{ RecordName }}::AttachRecord(replicationRecord); - if (replicationRecord.ContainsAuthorityToAuthorityBits()) - { - SerializeAuthorityToAuthorityProperties(record, serializer); - } if (replicationRecord.ContainsAuthorityToClientBits()) { SerializeAuthorityToClientProperties(record, serializer); @@ -1527,8 +1622,7 @@ namespace {{ Component.attrib['Namespace'] }} void {{ ComponentBaseName }}::NetworkAttach(Multiplayer::NetBindComponent* netBindComponent, Multiplayer::ReplicationRecord& currentEntityRecord, Multiplayer::ReplicationRecord& predictableEntityRecord) { m_netBindComponent = netBindComponent; - {{ DefineNetworkPropertyEditConstruction(Component, 'Authority', 'Authority', ComponentBaseName)|indent(8) -}} -{{ DefineNetworkPropertyEditConstruction(Component, 'Authority', 'Server', ComponentBaseName)|indent(8) -}} + {{ DefineNetworkPropertyEditConstruction(Component, 'Authority', 'Server', ComponentBaseName)|indent(8) -}} {{ DefineNetworkPropertyEditConstruction(Component, 'Authority', 'Client', ComponentBaseName)|indent(8) -}} {{ DefineNetworkPropertyEditConstruction(Component, 'Authority', 'Autonomous', ComponentBaseName)|indent(8) -}} {{ DefineNetworkPropertyEditConstruction(Component, 'Autonomous', 'Authority', ComponentBaseName)|indent(8) }} @@ -1541,8 +1635,6 @@ namespace {{ Component.attrib['Namespace'] }} m_controller.get()->NetworkAttach(netBindComponent, predictableEntityRecord); } - {{ DeclareNetworkPropertySetSerializer(Component, 'Authority', 'Authority', ComponentBaseName, RecordName)|indent(4) }} - {{ DeclareNetworkPropertySetNotifyChanges(Component, 'Authority', 'Authority', ComponentBaseName, RecordName)|indent(4) }} {{ DeclareNetworkPropertySetSerializer(Component, 'Authority', 'Server', ComponentBaseName, RecordName)|indent(4) }} {{ DeclareNetworkPropertySetNotifyChanges(Component, 'Authority', 'Server', ComponentBaseName, RecordName)|indent(4) }} {{ DeclareNetworkPropertySetSerializer(Component, 'Authority', 'Client', ComponentBaseName, RecordName)|indent(4) }} diff --git a/Gems/Multiplayer/Code/Source/AutoGen/LocalPredictionPlayerInputComponent.AutoComponent.xml b/Gems/Multiplayer/Code/Source/AutoGen/LocalPredictionPlayerInputComponent.AutoComponent.xml index 94bdac2b5d..b6edd0e3be 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/LocalPredictionPlayerInputComponent.AutoComponent.xml +++ b/Gems/Multiplayer/Code/Source/AutoGen/LocalPredictionPlayerInputComponent.AutoComponent.xml @@ -17,20 +17,20 @@ - + - + - + - + diff --git a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml index 2f934979b1..642832805d 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml +++ b/Gems/Multiplayer/Code/Source/AutoGen/Multiplayer.AutoPackets.xml @@ -28,12 +28,6 @@ - - - - - - @@ -49,14 +43,4 @@ - - - - - - - - - - diff --git a/Gems/Multiplayer/Code/Source/AutoGen/MultiplayerEditor.AutoPackets.xml b/Gems/Multiplayer/Code/Source/AutoGen/MultiplayerEditor.AutoPackets.xml new file mode 100644 index 0000000000..8f55ecd2b8 --- /dev/null +++ b/Gems/Multiplayer/Code/Source/AutoGen/MultiplayerEditor.AutoPackets.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/Gems/Multiplayer/Code/Source/AutoGen/NetworkTransformComponent.AutoComponent.xml b/Gems/Multiplayer/Code/Source/AutoGen/NetworkTransformComponent.AutoComponent.xml index 96653a607c..a112cde4e6 100644 --- a/Gems/Multiplayer/Code/Source/AutoGen/NetworkTransformComponent.AutoComponent.xml +++ b/Gems/Multiplayer/Code/Source/AutoGen/NetworkTransformComponent.AutoComponent.xml @@ -14,7 +14,7 @@ - + diff --git a/Gems/Multiplayer/Code/Source/Components/LocalPredictionPlayerInputComponent.cpp b/Gems/Multiplayer/Code/Source/Components/LocalPredictionPlayerInputComponent.cpp index 10a0d17e73..612601883c 100644 --- a/Gems/Multiplayer/Code/Source/Components/LocalPredictionPlayerInputComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/LocalPredictionPlayerInputComponent.cpp @@ -23,7 +23,7 @@ namespace Multiplayer { AZ_CVAR(AZ::TimeMs, cl_InputRateMs, AZ::TimeMs{ 33 }, nullptr, AZ::ConsoleFunctorFlags::Null, "Rate at which to sample and process client inputs"); AZ_CVAR(AZ::TimeMs, cl_MaxRewindHistoryMs, AZ::TimeMs{ 2000 }, nullptr, AZ::ConsoleFunctorFlags::Null, "Maximum number of milliseconds to keep for server correction rewind and replay"); -#ifndef _RELEASE +#ifndef AZ_RELEASE_BUILD AZ_CVAR(float, cl_DebugHackTimeMultiplier, 1.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "Scalar value used to simulate clock hacking cheats for validating bank time system and anticheat"); #endif @@ -477,7 +477,7 @@ namespace Multiplayer const double inputRate = static_cast(static_cast(cl_InputRateMs)) / 1000.0; const double maxRewindHistory = static_cast(static_cast(cl_MaxRewindHistoryMs)) / 1000.0; -#ifndef _RELEASE +#ifndef AZ_RELEASE_BUILD m_moveAccumulator += deltaTime * cl_DebugHackTimeMultiplier; #else m_moveAccumulator += deltaTime; diff --git a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp index e48d0b0d09..d91bba2e0c 100644 --- a/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/NetBindComponent.cpp @@ -46,6 +46,80 @@ namespace Multiplayer ->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game")); } } + + AZ::BehaviorContext* behaviorContext = azrtti_cast(context); + if (behaviorContext) + { + behaviorContext->Class("NetBindComponent") + ->Attribute(AZ::Script::Attributes::Module, "multiplayer") + ->Attribute(AZ::Script::Attributes::Category, "Multiplayer") + + ->Method("IsAuthority", [](AZ::EntityId id) -> bool { + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning( "NetBindComponent", false, "NetBindComponent IsAuthority failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return false; + } + + NetBindComponent* netBindComponent = entity-> FindComponent(); + if (!netBindComponent) + { + AZ_Warning( "NetBindComponent", false, "NetBindComponent IsAuthority failed. Entity '%s' (id: %s) is missing a NetBindComponent, make sure this entity contains a component which derives from NetBindComponent.", entity->GetName().c_str(), id.ToString().c_str()) + return false; + } + return netBindComponent->IsAuthority(); + }) + ->Method("IsAutonomous", [](AZ::EntityId id) -> bool { + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning( "NetBindComponent", false, "NetBindComponent IsAutonomous failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return false; + } + + NetBindComponent* netBindComponent = entity->FindComponent(); + if (!netBindComponent) + { + AZ_Warning("NetBindComponent", false, "NetBindComponent IsAutonomous failed. Entity '%s' (id: %s) is missing a NetBindComponent, make sure this entity contains a component which derives from NetBindComponent.", entity->GetName().c_str(), id.ToString().c_str()) + return false; + } + return netBindComponent->IsAutonomous(); + }) + ->Method("IsClient", [](AZ::EntityId id) -> bool { + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning( "NetBindComponent", false, "NetBindComponent IsClient failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return false; + } + + NetBindComponent* netBindComponent = entity->FindComponent(); + if (!netBindComponent) + { + AZ_Warning("NetBindComponent", false, "NetBindComponent IsClient failed. Entity '%s' (id: %s) is missing a NetBindComponent, make sure this entity contains a component which derives from NetBindComponent.", entity->GetName().c_str(), id.ToString().c_str()) + return false; + } + return netBindComponent->IsClient(); + }) + ->Method("IsServer", [](AZ::EntityId id) -> bool { + AZ::Entity* entity = AZ::Interface::Get()->FindEntity(id); + if (!entity) + { + AZ_Warning( "NetBindComponent", false, "NetBindComponent IsServer failed. The entity with id %s doesn't exist, please provide a valid entity id.", id.ToString().c_str()) + return false; + } + + NetBindComponent* netBindComponent = entity->FindComponent(); + if (!netBindComponent) + { + AZ_Warning("NetBindComponent", false, "NetBindComponent IsServer failed. Entity '%s' (id: %s) is missing a NetBindComponent, make sure this entity contains a component which derives from NetBindComponent.", entity->GetName().c_str(), id.ToString().c_str()) + return false; + } + return netBindComponent->IsServer(); + }) + ; + } } void NetBindComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) @@ -154,12 +228,18 @@ namespace Multiplayer void NetBindComponent::SetOwningConnectionId(AzNetworking::ConnectionId connectionId) { + m_owningConnectionId = connectionId; for (MultiplayerComponent* multiplayerComponent : m_multiplayerInputComponentVector) { multiplayerComponent->SetOwningConnectionId(connectionId); } } + AzNetworking::ConnectionId NetBindComponent::GetOwningConnectionId() const + { + return m_owningConnectionId; + } + void NetBindComponent::SetAllowAutonomy(bool value) { // This flag allows a player host to autonomously control their player entity, even though the entity is in an authority role @@ -290,6 +370,11 @@ namespace Multiplayer m_localNotificationRecord.Clear(); } + void NetBindComponent::NotifySyncRewindState() + { + m_syncRewindEvent.Signal(); + } + void NetBindComponent::NotifyMigrationStart(ClientInputId migratedInputId) { m_entityMigrationStartEvent.Signal(migratedInputId); @@ -315,6 +400,11 @@ namespace Multiplayer eventHandler.Connect(m_dirtiedEvent); } + void NetBindComponent::AddEntitySyncRewindEventHandler(EntitySyncRewindEvent::Handler& eventHandler) + { + eventHandler.Connect(m_syncRewindEvent); + } + void NetBindComponent::AddEntityMigrationStartEventHandler(EntityMigrationStartEvent::Handler& eventHandler) { eventHandler.Connect(m_entityMigrationStartEvent); diff --git a/Gems/Multiplayer/Code/Source/Components/NetworkTransformComponent.cpp b/Gems/Multiplayer/Code/Source/Components/NetworkTransformComponent.cpp index 0cc4cb131e..682f7ea988 100644 --- a/Gems/Multiplayer/Code/Source/Components/NetworkTransformComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Components/NetworkTransformComponent.cpp @@ -32,7 +32,7 @@ namespace Multiplayer NetworkTransformComponent::NetworkTransformComponent() : m_rotationEventHandler([this](const AZ::Quaternion& rotation) { OnRotationChangedEvent(rotation); }) , m_translationEventHandler([this](const AZ::Vector3& translation) { OnTranslationChangedEvent(translation); }) - , m_scaleEventHandler([this](const AZ::Vector3& scale) { OnScaleChangedEvent(scale); }) + , m_scaleEventHandler([this](float scale) { OnScaleChangedEvent(scale); }) { ; } @@ -68,10 +68,10 @@ namespace Multiplayer GetTransformComponent()->SetWorldTM(worldTm); } - void NetworkTransformComponent::OnScaleChangedEvent(const AZ::Vector3& scale) + void NetworkTransformComponent::OnScaleChangedEvent(float scale) { AZ::Transform worldTm = GetTransformComponent()->GetWorldTM(); - worldTm.SetScale(scale); + worldTm.SetUniformScale(scale); GetTransformComponent()->SetWorldTM(worldTm); } @@ -100,7 +100,7 @@ namespace Multiplayer { SetRotation(worldTm.GetRotation()); SetTranslation(worldTm.GetTranslation()); - SetScale(worldTm.GetScale()); + SetScale(worldTm.GetUniformScale()); } } } diff --git a/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp index 4ae7c3fdfe..88029430c3 100644 --- a/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Debug/MultiplayerDebugSystemComponent.cpp @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include namespace Multiplayer @@ -233,6 +235,43 @@ namespace Multiplayer const float TEXT_BASE_WIDTH = ImGui::CalcTextSize("A").x; const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing(); + if (m_displayNetworkingStats) + { + if (ImGui::Begin("Networking Stats", &m_displayNetworkingStats, ImGuiWindowFlags_None)) + { + AzNetworking::INetworking* networking = AZ::Interface::Get(); + + ImGui::Text("Total sockets monitored by TcpListenThread: %u", networking->GetTcpListenThreadSocketCount()); + ImGui::Text("Total time spent updating TcpListenThread: %lld", aznumeric_cast(networking->GetTcpListenThreadUpdateTime())); + ImGui::Text("Total sockets monitored by UdpReaderThread: %u", networking->GetUdpReaderThreadSocketCount()); + ImGui::Text("Total time spent updating UdpReaderThread: %lld", aznumeric_cast(networking->GetUdpReaderThreadUpdateTime())); + + for (auto& networkInterface : networking->GetNetworkInterfaces()) + { + const char* protocol = networkInterface.second->GetType() == AzNetworking::ProtocolType::Tcp ? "Tcp" : "Udp"; + const char* trustZone = networkInterface.second->GetTrustZone() == AzNetworking::TrustZone::ExternalClientToServer ? "ExternalClientToServer" : "InternalServerToServer"; + const uint32_t port = aznumeric_cast(networkInterface.second->GetPort()); + ImGui::Text("%sNetworkInterface: %s - open to %s on port %u", protocol, networkInterface.second->GetName().GetCStr(), trustZone, port); + + const AzNetworking::NetworkInterfaceMetrics& metrics = networkInterface.second->GetMetrics(); + ImGui::Text(" - Total time spent updating in milliseconds: %lld", aznumeric_cast(metrics.m_updateTimeMs)); + ImGui::Text(" - Total number of connections: %llu", aznumeric_cast(metrics.m_connectionCount)); + ImGui::Text(" - Total send time in milliseconds: %lld", aznumeric_cast(metrics.m_sendTimeMs)); + ImGui::Text(" - Total sent packets: %llu", aznumeric_cast(metrics.m_sendPackets)); + ImGui::Text(" - Total sent bytes after compression: %llu", aznumeric_cast(metrics.m_sendBytes)); + ImGui::Text(" - Total sent bytes before compression: %llu", aznumeric_cast(metrics.m_sendBytesUncompressed)); + ImGui::Text(" - Total sent compressed packets without benefit: %llu", aznumeric_cast(metrics.m_sendCompressedPacketsNoGain)); + ImGui::Text(" - Total gain from packet compression: %lld", aznumeric_cast(metrics.m_sendBytesCompressedDelta)); + ImGui::Text(" - Total packets resent: %llu", aznumeric_cast(metrics.m_resentPackets)); + ImGui::Text(" - Total receive time in milliseconds: %lld", aznumeric_cast(metrics.m_recvTimeMs)); + ImGui::Text(" - Total received packets: %llu", aznumeric_cast(metrics.m_recvPackets)); + ImGui::Text(" - Total received bytes after compression: %llu", aznumeric_cast(metrics.m_recvBytes)); + ImGui::Text(" - Total received bytes before compression: %llu", aznumeric_cast(metrics.m_recvBytesUncompressed)); + ImGui::Text(" - Total packets discarded due to load: %llu", aznumeric_cast(metrics.m_discardedPackets)); + } + } + } + if (m_displayMultiplayerStats) { if (ImGui::Begin("Multiplayer Stats", &m_displayMultiplayerStats, ImGuiWindowFlags_None)) diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp new file mode 100644 index 0000000000..f684e1f12f --- /dev/null +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.cpp @@ -0,0 +1,187 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Multiplayer +{ + using namespace AzNetworking; + + AZ_CVAR(bool, editorsv_isDedicated, false, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Whether to init as a server expecting data from an Editor. Do not modify unless you're sure of what you're doing."); + + MultiplayerEditorConnection::MultiplayerEditorConnection() + : m_byteStream(&m_buffer) + { + m_networkEditorInterface = AZ::Interface::Get()->CreateNetworkInterface( + AZ::Name(MPEditorInterfaceName), ProtocolType::Tcp, TrustZone::ExternalClientToServer, *this); + if (editorsv_isDedicated) + { + uint16_t editorServerPort = DefaultServerEditorPort; + if (auto console = AZ::Interface::Get(); console) + { + console->GetCvarValue("editorsv_port", editorServerPort); + } + AZ_Assert(m_networkEditorInterface, "MP Editor Network Interface was unregistered before Editor Server could start listening."); + m_networkEditorInterface->Listen(editorServerPort); + } + } + + bool MultiplayerEditorConnection::HandleRequest + ( + [[maybe_unused]] AzNetworking::IConnection* connection, + [[maybe_unused]] const IPacketHeader& packetHeader, + [[maybe_unused]] MultiplayerEditorPackets::EditorServerInit& packet + ) + { + // Editor Server Init is intended for non-release targets + if (!packet.GetLastUpdate()) + { + // More packets are expected, flush this to the buffer + m_byteStream.Write(TcpPacketEncodingBuffer::GetCapacity(), reinterpret_cast(packet.ModifyAssetData().GetBuffer())); + } + else + { + // This is the last expected packet, flush it to the buffer + m_byteStream.Write(packet.GetAssetData().GetSize(), reinterpret_cast(packet.ModifyAssetData().GetBuffer())); + + // Read all assets out of the buffer + m_byteStream.Seek(0, AZ::IO::GenericStream::SeekMode::ST_SEEK_BEGIN); + AZStd::vector> assetData; + while (m_byteStream.GetCurPos() < m_byteStream.GetLength()) + { + AZ::Data::AssetId assetId; + uint32_t hintSize; + AZStd::string assetHint; + m_byteStream.Read(sizeof(AZ::Data::AssetId), reinterpret_cast(&assetId)); + m_byteStream.Read(sizeof(uint32_t), reinterpret_cast(&hintSize)); + assetHint.resize(hintSize); + m_byteStream.Read(hintSize, assetHint.data()); + + size_t assetSize = m_byteStream.GetCurPos(); + AZ::Data::AssetData* assetDatum = AZ::Utils::LoadObjectFromStream(m_byteStream, nullptr); + assetSize = m_byteStream.GetCurPos() - assetSize; + AZ::Data::Asset asset = AZ::Data::Asset(assetId, assetDatum, AZ::Data::AssetLoadBehavior::NoLoad); + asset.SetHint(assetHint); + + AZ::Data::AssetInfo assetInfo; + assetInfo.m_assetId = asset.GetId(); + assetInfo.m_assetType = asset.GetType(); + assetInfo.m_relativePath = asset.GetHint(); + assetInfo.m_sizeBytes = assetSize; + + // Register Asset to AssetManager + AZ::Data::AssetManager::Instance().AssignAssetData(asset); + AZ::Data::AssetCatalogRequestBus::Broadcast(&AZ::Data::AssetCatalogRequests::RegisterAsset, asset.GetId(), assetInfo); + + assetData.push_back(asset); + } + + // Now that we've deserialized, clear the byte stream + m_byteStream.Seek(0, AZ::IO::GenericStream::SeekMode::ST_SEEK_BEGIN); + m_byteStream.Truncate(); + + // Load the level via the root spawnable that was registered + const AZ::CVarFixedString loadLevelString = "LoadLevel Root.spawnable"; + AZ::Interface::Get()->PerformCommand(loadLevelString.c_str()); + + // Setup the normal multiplayer connection + AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::DedicatedServer); + INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPNetworkInterfaceName)); + + uint16_t serverPort = DefaultServerPort; + if (auto console = AZ::Interface::Get(); console) + { + console->GetCvarValue("sv_port", serverPort); + } + networkInterface->Listen(serverPort); + + AZLOG_INFO("Editor Server completed asset receive, responding to Editor..."); + return connection->SendReliablePacket(MultiplayerEditorPackets::EditorServerReady()); + } + + return true; + } + + bool MultiplayerEditorConnection::HandleRequest + ( + [[maybe_unused]] AzNetworking::IConnection* connection, + [[maybe_unused]] const IPacketHeader& packetHeader, + [[maybe_unused]] MultiplayerEditorPackets::EditorServerReady& packet + ) + { + if (connection->GetConnectionRole() == ConnectionRole::Connector) + { + // Receiving this packet means Editor sync is done, disconnect + connection->Disconnect(AzNetworking::DisconnectReason::TerminatedByClient, AzNetworking::TerminationEndpoint::Local); + + if (auto console = AZ::Interface::Get(); console) + { + AZ::CVarFixedString remoteAddress; + uint16_t remotePort; + if (console->GetCvarValue("editorsv_serveraddr", remoteAddress) != AZ::GetValueResult::ConsoleVarNotFound && + console->GetCvarValue("editorsv_port", remotePort) != AZ::GetValueResult::ConsoleVarNotFound) + { + // Connect the Editor to the editor server for Multiplayer simulation + AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::Client); + INetworkInterface* networkInterface = + AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPNetworkInterfaceName)); + + const IpAddress ipAddress(remoteAddress.c_str(), remotePort, networkInterface->GetType()); + networkInterface->Connect(ipAddress); + } + } + } + return true; + } + + ConnectResult MultiplayerEditorConnection::ValidateConnect + ( + [[maybe_unused]] const IpAddress& remoteAddress, + [[maybe_unused]] const IPacketHeader& packetHeader, + [[maybe_unused]] ISerializer& serializer + ) + { + return ConnectResult::Accepted; + } + + void MultiplayerEditorConnection::OnConnect([[maybe_unused]] AzNetworking::IConnection* connection) + { + ; + } + + bool MultiplayerEditorConnection::OnPacketReceived(AzNetworking::IConnection* connection, const IPacketHeader& packetHeader, ISerializer& serializer) + { + return MultiplayerEditorPackets::DispatchPacket(connection, packetHeader, serializer, *this); + } + + void MultiplayerEditorConnection::OnPacketLost([[maybe_unused]] IConnection* connection, [[maybe_unused]] PacketId packetId) + { + ; + } + + void MultiplayerEditorConnection::OnDisconnect([[maybe_unused]] AzNetworking::IConnection* connection, [[maybe_unused]] DisconnectReason reason, [[maybe_unused]] TerminationEndpoint endpoint) + { + ; + } +} diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h new file mode 100644 index 0000000000..d803a60744 --- /dev/null +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorConnection.h @@ -0,0 +1,58 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace AzNetworking +{ + class INetworkInterface; +} + +namespace Multiplayer +{ + //! MultiplayerEditorConnection is a connection listener to synchronize the Editor and a local server it launches + class MultiplayerEditorConnection final + : public AzNetworking::IConnectionListener + { + public: + MultiplayerEditorConnection(); + ~MultiplayerEditorConnection() = default; + + bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerInit& packet); + bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerEditorPackets::EditorServerReady& packet); + + //! IConnectionListener interface + //! @{ + AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; + void OnConnect(AzNetworking::IConnection* connection) override; + bool OnPacketReceived(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; + void OnPacketLost(AzNetworking::IConnection* connection, AzNetworking::PacketId packetId) override; + void OnDisconnect(AzNetworking::IConnection* connection, AzNetworking::DisconnectReason reason, AzNetworking::TerminationEndpoint endpoint) override; + //! @} + + private: + + AzNetworking::INetworkInterface* m_networkEditorInterface = nullptr; + AZStd::vector m_buffer; + AZ::IO::ByteContainerStream> m_byteStream; + }; +} diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.cpp deleted file mode 100644 index 470aa61cd0..0000000000 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorDispatcher.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - * its licensors. - * - * For complete copyright and license terms please see the LICENSE at the root of this - * distribution (the "License"). All use of this software is governed by the License, - * or, if provided, by the license below or the license accompanying this file. Do not - * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * - */ - -#include - -namespace Multiplayer -{ - MultiplayerEditorDispatcher::MultiplayerEditorDispatcher() - { - ; - } -} diff --git a/Gems/Multiplayer/Code/Source/MultiplayerEditorGem.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorGem.cpp similarity index 86% rename from Gems/Multiplayer/Code/Source/MultiplayerEditorGem.cpp rename to Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorGem.cpp index 97c5e4d105..2fe0aabe5f 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerEditorGem.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorGem.cpp @@ -10,13 +10,13 @@ * */ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include -#include +#include namespace Multiplayer { diff --git a/Gems/Multiplayer/Code/Source/MultiplayerEditorGem.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorGem.h similarity index 100% rename from Gems/Multiplayer/Code/Source/MultiplayerEditorGem.h rename to Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorGem.h diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp index aec3e7870f..523ffd90de 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.cpp @@ -10,12 +10,22 @@ * */ -#include -#include +#include +#include +#include + +#include +#include +#include + +#include #include #include +#include #include #include +#include +#include namespace Multiplayer { @@ -23,8 +33,12 @@ namespace Multiplayer AZ_CVAR(bool, editorsv_enabled, false, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Whether Editor launching a local server to connect to is supported"); + AZ_CVAR(bool, editorsv_launch, true, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, + "Whether Editor should launch a server when the server address is localhost"); AZ_CVAR(AZ::CVarFixedString, editorsv_process, "", nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The server executable that should be run. Empty to use the current project's ServerLauncher"); + AZ_CVAR(AZ::CVarFixedString, editorsv_serveraddr, AZ::CVarFixedString(LocalHost), nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The address of the server to connect to"); + AZ_CVAR(uint16_t, editorsv_port, DefaultServerEditorPort, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The port that the multiplayer editor gem will bind to for traffic"); void MultiplayerEditorSystemComponent::Reflect(AZ::ReflectContext* context) { @@ -57,12 +71,14 @@ namespace Multiplayer void MultiplayerEditorSystemComponent::Activate() { + AzFramework::GameEntityContextEventBus::Handler::BusConnect(); AzToolsFramework::EditorEvents::Bus::Handler::BusConnect(); } void MultiplayerEditorSystemComponent::Deactivate() { AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect(); + AzFramework::GameEntityContextEventBus::Handler::BusDisconnect(); } void MultiplayerEditorSystemComponent::NotifyRegisterViews() @@ -77,50 +93,6 @@ namespace Multiplayer { switch (event) { - case eNotify_OnBeginGameMode: - { - AZ::TickBus::Handler::BusConnect(); - - if (editorsv_enabled) - { - // Assemble the server's path - AZ::CVarFixedString serverProcess = editorsv_process; - if (serverProcess.empty()) - { - // If enabled but no process name is supplied, try this project's ServerLauncher - serverProcess = AZ::Utils::GetProjectName() + ".ServerLauncher"; - } - - AZ::IO::FixedMaxPathString serverPath = AZ::Utils::GetExecutableDirectory(); - if (!serverProcess.contains(AZ_TRAIT_OS_PATH_SEPARATOR)) - { - // If only the process name is specified, append that as well - serverPath.append(AZ_TRAIT_OS_PATH_SEPARATOR + serverProcess); - } - else - { - // If any path was already specified, then simply assign - serverPath = serverProcess; - } - - if (!serverProcess.ends_with(AZ_TRAIT_OS_EXECUTABLE_EXTENSION)) - { - // Add this platform's exe extension if it's not specified - serverPath.append(AZ_TRAIT_OS_EXECUTABLE_EXTENSION); - } - - // Start the configured server if it's available - AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; - processLaunchInfo.m_commandlineParameters = - AZStd::string::format("\"%s\"", serverPath.c_str()); - processLaunchInfo.m_showWindow = true; - processLaunchInfo.m_processPriority = AzFramework::ProcessPriority::PROCESSPRIORITY_NORMAL; - - m_serverProcess = AzFramework::ProcessWatcher::LaunchProcess( - processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); - } - break; - } case eNotify_OnQuit: AZ_Warning("Multiplayer Editor", m_editor != nullptr, "Multiplayer Editor received On Quit without an Editor pointer."); if (m_editor) @@ -130,25 +102,136 @@ namespace Multiplayer } [[fallthrough]]; case eNotify_OnEndGameMode: - AZ::TickBus::Handler::BusDisconnect(); // Kill the configured server if it's active if (m_serverProcess) { m_serverProcess->TerminateProcess(0); m_serverProcess = nullptr; } + INetworkInterface* editorNetworkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPEditorInterfaceName)); + if (editorNetworkInterface) + { + editorNetworkInterface->Disconnect(m_editorConnId, AzNetworking::DisconnectReason::TerminatedByClient); + } + if (auto console = AZ::Interface::Get(); console) + { + console->PerformCommand("disconnect"); + } break; } } - void MultiplayerEditorSystemComponent::OnTick([[maybe_unused]] float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) + AzFramework::ProcessWatcher* LaunchEditorServer() { + // Assemble the server's path + AZ::CVarFixedString serverProcess = editorsv_process; + AZ::IO::FixedMaxPath serverPath; + if (serverProcess.empty()) + { + // If enabled but no process name is supplied, try this project's ServerLauncher + serverProcess = AZ::Utils::GetProjectName() + ".ServerLauncher"; + serverPath = AZ::Utils::GetExecutableDirectory(); + serverPath /= serverProcess + AZ_TRAIT_OS_EXECUTABLE_EXTENSION; + } + else + { + serverPath = serverProcess; + } + // Start the configured server if it's available + AzFramework::ProcessLauncher::ProcessLaunchInfo processLaunchInfo; + processLaunchInfo.m_commandlineParameters = AZStd::string::format("\"%s\" --editorsv_isDedicated true", serverPath.c_str()); + processLaunchInfo.m_showWindow = true; + processLaunchInfo.m_processPriority = AzFramework::ProcessPriority::PROCESSPRIORITY_NORMAL; + + // Launch the Server and give it a few seconds to boot up + AzFramework::ProcessWatcher* outProcess = AzFramework::ProcessWatcher::LaunchProcess( + processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); + if (outProcess) + { + AZStd::this_thread::sleep_for(AZStd::chrono::milliseconds(15000)); + } + + return outProcess; } - int MultiplayerEditorSystemComponent::GetTickOrder() + void MultiplayerEditorSystemComponent::OnGameEntitiesStarted() { - // Tick immediately after the network system component - return AZ::TICK_PLACEMENT + 1; + auto prefabEditorEntityOwnershipInterface = AZ::Interface::Get(); + if (!prefabEditorEntityOwnershipInterface) + { + AZ_Error("MultiplayerEditor", prefabEditorEntityOwnershipInterface != nullptr, "PrefabEditorEntityOwnershipInterface unavailable"); + } + + // BeginGameMode and Prefab Processing have completed at this point + IMultiplayerTools* mpTools = AZ::Interface::Get(); + if (editorsv_enabled && mpTools != nullptr && mpTools->DidProcessNetworkPrefabs()) + { + const AZStd::vector>& assetData = prefabEditorEntityOwnershipInterface->GetPlayInEditorAssetData(); + + AZStd::vector buffer; + AZ::IO::ByteContainerStream byteStream(&buffer); + + // Serialize Asset information and AssetData into a potentially large buffer + for (const auto& asset : assetData) + { + AZ::Data::AssetId assetId = asset.GetId(); + AZStd::string assetHint = asset.GetHint(); + uint32_t hintSize = aznumeric_cast(assetHint.size()); + + byteStream.Write(sizeof(AZ::Data::AssetId), reinterpret_cast(&assetId)); + byteStream.Write(sizeof(uint32_t), reinterpret_cast(&hintSize)); + byteStream.Write(assetHint.size(), assetHint.data()); + AZ::Utils::SaveObjectToStream(byteStream, AZ::DataStream::ST_BINARY, asset.GetData(), asset.GetData()->GetType()); + } + + const AZ::CVarFixedString remoteAddress = editorsv_serveraddr; + if (editorsv_launch && LocalHost == remoteAddress) + { + m_serverProcess = LaunchEditorServer(); + } + + // Now that the server has launched, attempt to connect the NetworkInterface + INetworkInterface* editorNetworkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPEditorInterfaceName)); + AZ_Assert(editorNetworkInterface, "MP Editor Network Interface was unregistered before Editor could connect."); + m_editorConnId = editorNetworkInterface->Connect( + AzNetworking::IpAddress(remoteAddress.c_str(), editorsv_port, AzNetworking::ProtocolType::Tcp)); + + if (m_editorConnId == AzNetworking::InvalidConnectionId) + { + AZ_Warning( + "MultiplayerEditor", false, + "Could not connect to server targeted by Editor. If using a local server, check that it's built and editorsv_launch is true."); + return; + } + + // Read the buffer into EditorServerInit packets until we've flushed the whole thing + byteStream.Seek(0, AZ::IO::GenericStream::SeekMode::ST_SEEK_BEGIN); + + while (byteStream.GetCurPos() < byteStream.GetLength()) + { + MultiplayerEditorPackets::EditorServerInit packet; + AzNetworking::TcpPacketEncodingBuffer& outBuffer = packet.ModifyAssetData(); + + // Size the packet's buffer appropriately + size_t readSize = TcpPacketEncodingBuffer::GetCapacity(); + size_t byteStreamSize = byteStream.GetLength() - byteStream.GetCurPos(); + if (byteStreamSize < readSize) + { + readSize = byteStreamSize; + } + + outBuffer.Resize(readSize); + byteStream.Read(readSize, outBuffer.GetBuffer()); + + // If we've run out of buffer, mark that we're done + if (byteStream.GetCurPos() == byteStream.GetLength()) + { + packet.SetLastUpdate(true); + } + editorNetworkInterface->SendReliablePacket(m_editorConnId, packet); + } + } + } } diff --git a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h index 8c18a2e57a..81b138c675 100644 --- a/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/Editor/MultiplayerEditorSystemComponent.h @@ -14,15 +14,16 @@ #include +#include + #include #include #include #include - +#include #include #include - namespace AzNetworking { class INetworkInterface; @@ -33,7 +34,7 @@ namespace Multiplayer //! Multiplayer system component wraps the bridging logic between the game and transport layer. class MultiplayerEditorSystemComponent final : public AZ::Component - , private AZ::TickBus::Handler + , private AzFramework::GameEntityContextEventBus::Handler , private AzToolsFramework::EditorEvents::Bus::Handler , private IEditorNotifyListener { @@ -59,17 +60,19 @@ namespace Multiplayer void NotifyRegisterViews() override; //! @} - private: - - //! AZ::TickBus::Handler overrides. + private: + //! EditorEvents::Handler overrides //! @{ - void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; - int GetTickOrder() override; - //! @} - //! void OnEditorNotifyEvent(EEditorNotifyEvent event) override; + //! @} + + //! GameEntityContextEventBus::Handler overrides + //! @{ + void OnGameEntitiesStarted() override; + //! @} IEditor* m_editor = nullptr; AzFramework::ProcessWatcher* m_serverProcess = nullptr; + AzNetworking::ConnectionId m_editorConnId; }; } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp index 8eb5bf7b0c..ef8627fe54 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.cpp @@ -10,22 +10,27 @@ * */ -#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 AZ::ConsoleTypeHelpers { @@ -59,11 +64,8 @@ namespace Multiplayer { using namespace AzNetworking; - static const AZStd::string_view s_networkInterfaceName("MultiplayerNetworkInterface"); - static constexpr uint16_t DefaultServerPort = 30090; - AZ_CVAR(uint16_t, cl_clientport, 0, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The port to bind to for game traffic when connecting to a remote host, a value of 0 will select any available port"); - AZ_CVAR(AZ::CVarFixedString, cl_serveraddr, "127.0.0.1", nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The address of the remote server or host to connect to"); + AZ_CVAR(AZ::CVarFixedString, cl_serveraddr, AZ::CVarFixedString(LocalHost), nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The address of the remote server or host to connect to"); AZ_CVAR(AZ::CVarFixedString, cl_serverpassword, "", nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "Optional server password"); AZ_CVAR(uint16_t, cl_serverport, DefaultServerPort, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The port of the remote host to connect to for game traffic"); AZ_CVAR(uint16_t, sv_port, DefaultServerPort, nullptr, AZ::ConsoleFunctorFlags::DontReplicate, "The port that this multiplayer gem will bind to for game traffic"); @@ -140,7 +142,7 @@ namespace Multiplayer void MultiplayerSystemComponent::Activate() { AZ::TickBus::Handler::BusConnect(); - m_networkInterface = AZ::Interface::Get()->CreateNetworkInterface(AZ::Name(s_networkInterfaceName), sv_protocol, TrustZone::ExternalClientToServer, *this); + m_networkInterface = AZ::Interface::Get()->CreateNetworkInterface(AZ::Name(MPNetworkInterfaceName), sv_protocol, TrustZone::ExternalClientToServer, *this); m_consoleCommandHandler.Connect(AZ::Interface::Get()->GetConsoleCommandInvokedEvent()); AZ::Interface::Register(this); @@ -161,9 +163,13 @@ namespace Multiplayer // Handle deferred local rpc messages that were generated during the updates m_networkEntityManager.DispatchLocalDeferredRpcMessages(); - m_networkEntityManager.NotifyEntitiesChanged(); + + // INetworking ticks immediately before IMultiplayer, so all our pending RPC's and network property updates have now been processed + // Restore any entities that were rewound during input processing so that normal gameplay updates have the correct state + Multiplayer::GetNetworkTime()->ClearRewoundEntities(); // Let the network system know the frame is done and we can collect dirty bits + m_networkEntityManager.NotifyEntitiesChanged(); m_networkEntityManager.NotifyEntitiesDirtied(); MultiplayerStats& stats = GetStats(); @@ -300,6 +306,22 @@ namespace Multiplayer return true; } + bool MultiplayerSystemComponent::HandleRequest + ( + AzNetworking::IConnection* connection, + [[maybe_unused]] const AzNetworking::IPacketHeader& packetHeader, + MultiplayerPackets::ReadyForEntityUpdates& packet + ) + { + IConnectionData* connectionData = reinterpret_cast(connection->GetUserData()); + if (connectionData) + { + connectionData->SetCanSendUpdates(packet.GetReadyForEntityUpdates()); + return true; + } + return false; + } + bool MultiplayerSystemComponent::HandleRequest ( [[maybe_unused]] AzNetworking::IConnection* connection, @@ -307,6 +329,10 @@ namespace Multiplayer [[maybe_unused]] MultiplayerPackets::SyncConsole& packet ) { + if (GetAgentType() != MultiplayerAgentType::Client) + { + return false; + } ExecuteConsoleCommandList(connection, packet.GetCommandSet()); return true; } @@ -318,23 +344,12 @@ namespace Multiplayer [[maybe_unused]] MultiplayerPackets::ConsoleCommand& packet ) { - const bool isAcceptor = (connection->GetConnectionRole() == ConnectionRole::Acceptor); // We're hosting if we accepted the connection - const AZ::ConsoleFunctorFlags requiredSet = isAcceptor ? AZ::ConsoleFunctorFlags::AllowClientSet : AZ::ConsoleFunctorFlags::Null; + const bool isClient = (GetAgentType() == MultiplayerAgentType::Client); + const AZ::ConsoleFunctorFlags requiredSet = isClient ? AZ::ConsoleFunctorFlags::Null : AZ::ConsoleFunctorFlags::AllowClientSet; AZ::Interface::Get()->PerformCommand(packet.GetCommand().c_str(), AZ::ConsoleSilentMode::NotSilent, AZ::ConsoleInvokedFrom::AzNetworking, requiredSet); return true; } - bool MultiplayerSystemComponent::HandleRequest - ( - [[maybe_unused]] AzNetworking::IConnection* connection, - [[maybe_unused]] const IPacketHeader& packetHeader, - [[maybe_unused]] MultiplayerPackets::SyncConnectionCvars& packet - ) - { - connection->SetConnectionQuality(ConnectionQuality(packet.GetLossPercent(), packet.GetLatencyMs(), packet.GetVarianceMs())); - return true; - } - bool MultiplayerSystemComponent::HandleRequest ( [[maybe_unused]] AzNetworking::IConnection* connection, @@ -395,39 +410,6 @@ namespace Multiplayer return false; } - bool MultiplayerSystemComponent::HandleRequest - ( - [[maybe_unused]] AzNetworking::IConnection* connection, - [[maybe_unused]] const AzNetworking::IPacketHeader& packetHeader, - [[maybe_unused]] MultiplayerPackets::NotifyClientMigration& packet - ) - { - return false; - } - - bool MultiplayerSystemComponent::HandleRequest - ( - [[maybe_unused]] AzNetworking::IConnection* connection, - [[maybe_unused]] const AzNetworking::IPacketHeader& packetHeader, - [[maybe_unused]] MultiplayerPackets::EntityMigration& packet - ) - { - return false; - } - - bool MultiplayerSystemComponent::HandleRequest( AzNetworking::IConnection* connection, - [[maybe_unused]] const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet) - { - IConnectionData* connectionData = reinterpret_cast(connection->GetUserData()); - if (connectionData) - { - connectionData->SetCanSendUpdates(packet.GetReadyForEntityUpdates()); - return true; - } - - return false; - } - ConnectResult MultiplayerSystemComponent::ValidateConnect ( [[maybe_unused]] const IpAddress& remoteAddress, @@ -456,44 +438,36 @@ namespace Multiplayer m_connAcquiredEvent.Signal(datum); } - if (m_onConnectFunctor) + if (GetAgentType() == MultiplayerAgentType::ClientServer + || GetAgentType() == MultiplayerAgentType::DedicatedServer) { - // Default OnConnect behaviour has been overridden - m_onConnectFunctor(connection, datum); + PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAsset).c_str()), 1); + INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity()); + + NetworkEntityHandle controlledEntity; + if (entityList.size() > 0) + { + controlledEntity = entityList[0]; + controlledEntity.GetNetBindComponent()->SetOwningConnectionId(connection->GetConnectionId()); + } + + if (connection->GetUserData() == nullptr) // Only add user data if the connect event handler has not already done so + { + connection->SetUserData(new ServerToClientConnectionData(connection, *this, controlledEntity)); + } + + AZStd::unique_ptr window = AZStd::make_unique(controlledEntity, connection); + reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetReplicationWindow(AZStd::move(window)); } else { - if (GetAgentType() == MultiplayerAgentType::ClientServer - || GetAgentType() == MultiplayerAgentType::DedicatedServer) + if (connection->GetUserData() == nullptr) // Only add user data if the connect event handler has not already done so { - PrefabEntityId playerPrefabEntityId(AZ::Name(static_cast(sv_defaultPlayerSpawnAsset).c_str()), 1); - INetworkEntityManager::EntityList entityList = m_networkEntityManager.CreateEntitiesImmediate(playerPrefabEntityId, NetEntityRole::Authority, AZ::Transform::CreateIdentity()); - - NetworkEntityHandle controlledEntity; - if (entityList.size() > 0) - { - controlledEntity = entityList[0]; - controlledEntity.GetNetBindComponent()->SetOwningConnectionId(connection->GetConnectionId()); - } - - if (connection->GetUserData() == nullptr) // Only add user data if the connect event handler has not already done so - { - connection->SetUserData(new ServerToClientConnectionData(connection, *this, controlledEntity)); - } - - AZStd::unique_ptr window = AZStd::make_unique(controlledEntity, connection); - reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetReplicationWindow(AZStd::move(window)); + connection->SetUserData(new ClientToServerConnectionData(connection, *this)); } - else - { - if (connection->GetUserData() == nullptr) // Only add user data if the connect event handler has not already done so - { - connection->SetUserData(new ClientToServerConnectionData(connection, *this)); - } - AZStd::unique_ptr window = AZStd::make_unique(); - reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetEntityActivationTimeSliceMs(cl_defaultNetworkEntityActivationTimeSliceMs); - } + AZStd::unique_ptr window = AZStd::make_unique(); + reinterpret_cast(connection->GetUserData())->GetReplicationManager().SetEntityActivationTimeSliceMs(cl_defaultNetworkEntityActivationTimeSliceMs); } } @@ -566,11 +540,6 @@ namespace Multiplayer handler.Connect(m_shutdownEvent); } - void MultiplayerSystemComponent::SetOnConnectFunctor(const OnConnectFunctor& functor) - { - m_onConnectFunctor = functor; - } - void MultiplayerSystemComponent::SendReadyForEntityUpdates(bool readyForEntityUpdates) { IConnectionSet& connectionSet = m_networkInterface->GetConnectionSet(); @@ -664,7 +633,7 @@ namespace Multiplayer { Multiplayer::MultiplayerAgentType serverType = sv_isDedicated ? MultiplayerAgentType::DedicatedServer : MultiplayerAgentType::ClientServer; AZ::Interface::Get()->InitializeMultiplayer(serverType); - INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(s_networkInterfaceName)); + INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPNetworkInterfaceName)); networkInterface->Listen(sv_port); } AZ_CONSOLEFREEFUNC(host, AZ::ConsoleFunctorFlags::DontReplicate, "Opens a multiplayer connection as a host for other clients to connect to"); @@ -672,7 +641,7 @@ namespace Multiplayer void connect([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) { AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::Client); - INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(s_networkInterfaceName)); + INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPNetworkInterfaceName)); if (arguments.size() < 1) { @@ -702,7 +671,7 @@ namespace Multiplayer void disconnect([[maybe_unused]] const AZ::ConsoleCommandContainer& arguments) { AZ::Interface::Get()->InitializeMultiplayer(MultiplayerAgentType::Uninitialized); - INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(s_networkInterfaceName)); + INetworkInterface* networkInterface = AZ::Interface::Get()->RetrieveNetworkInterface(AZ::Name(MPNetworkInterfaceName)); auto visitor = [](IConnection& connection) { connection.Disconnect(DisconnectReason::TerminatedByUser, TerminationEndpoint::Local); }; networkInterface->GetConnectionSet().VisitConnections(visitor); } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h index 6bedd0599b..db83c50fb5 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerSystemComponent.h @@ -12,17 +12,20 @@ #pragma once +#include +#include +#include +#include +#include + #include #include #include #include +#include #include #include #include -#include -#include -#include -#include namespace AzNetworking { @@ -63,16 +66,13 @@ namespace Multiplayer bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Connect& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::Accept& packet); + bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::SyncConsole& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ConsoleCommand& packet); - bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::SyncConnectionCvars& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::EntityUpdates& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::EntityRpcs& packet); bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ClientMigration& packet); - bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::NotifyClientMigration& packet); - bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::EntityMigration& packet); - bool HandleRequest(AzNetworking::IConnection* connection, const AzNetworking::IPacketHeader& packetHeader, MultiplayerPackets::ReadyForEntityUpdates& packet); - + //! IConnectionListener interface //! @{ AzNetworking::ConnectResult ValidateConnect(const AzNetworking::IpAddress& remoteAddress, const AzNetworking::IPacketHeader& packetHeader, AzNetworking::ISerializer& serializer) override; @@ -89,7 +89,6 @@ namespace Multiplayer void AddConnectionAcquiredHandler(ConnectionAcquiredEvent::Handler& handler) override; void AddSessionInitHandler(SessionInitEvent::Handler& handler) override; void AddSessionShutdownHandler(SessionShutdownEvent::Handler& handler) override; - void SetOnConnectFunctor(const OnConnectFunctor& functor) override; void SendReadyForEntityUpdates(bool readyForEntityUpdates) override; AZ::TimeMs GetCurrentHostTimeMs() const override; INetworkTime* GetNetworkTime() override; @@ -109,6 +108,7 @@ namespace Multiplayer AZ_CONSOLEFUNC(MultiplayerSystemComponent, DumpStats, AZ::ConsoleFunctorFlags::Null, "Dumps stats for the current multiplayer session"); AzNetworking::INetworkInterface* m_networkInterface = nullptr; + AzNetworking::INetworkInterface* m_networkEditorInterface = nullptr; AZ::ConsoleCommandInvokedEvent::Handler m_consoleCommandHandler; AZ::ThreadSafeDeque m_cvarCommands; @@ -120,9 +120,11 @@ namespace Multiplayer SessionShutdownEvent m_shutdownEvent; ConnectionAcquiredEvent m_connAcquiredEvent; - OnConnectFunctor m_onConnectFunctor = nullptr; - AZ::TimeMs m_lastReplicatedHostTimeMs = AZ::TimeMs{ 0 }; HostFrameId m_lastReplicatedHostFrameId = InvalidHostFrameId; + +#if !defined(AZ_RELEASE_BUILD) + MultiplayerEditorConnection m_editorConnectionListener; +#endif }; } diff --git a/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.cpp b/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.cpp index 5a223d6214..3646dd52a4 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.cpp +++ b/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.cpp @@ -10,40 +10,40 @@ * */ -#include -#include +#include +#include #include + #include #include namespace Multiplayer { - //! Multiplayer Tools system component provides serialize context reflection for tools-only systems. - class MultiplayerToolsSystemComponent final - : public AZ::Component + + void MultiplayerToolsSystemComponent::Reflect(AZ::ReflectContext* context) { - public: - AZ_COMPONENT(MultiplayerToolsSystemComponent, "{65AF5342-0ECE-423B-B646-AF55A122F72B}"); + NetworkPrefabProcessor::Reflect(context); + } - static void Reflect(AZ::ReflectContext* context) - { - NetworkPrefabProcessor::Reflect(context); - } + void MultiplayerToolsSystemComponent::Activate() + { + AZ::Interface::Register(this); + } - MultiplayerToolsSystemComponent() = default; - ~MultiplayerToolsSystemComponent() override = default; + void MultiplayerToolsSystemComponent::Deactivate() + { + AZ::Interface::Unregister(this); + } - /// AZ::Component overrides. - void Activate() override - { + bool MultiplayerToolsSystemComponent::DidProcessNetworkPrefabs() + { + return m_didProcessNetPrefabs; + } - } - - void Deactivate() override - { - - } - }; + void MultiplayerToolsSystemComponent::SetDidProcessNetworkPrefabs(bool didProcessNetPrefabs) + { + m_didProcessNetPrefabs = didProcessNetPrefabs; + } MultiplayerToolsModule::MultiplayerToolsModule() : AZ::Module() diff --git a/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.h b/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.h index 823bd63a1d..b05e2aa5fb 100644 --- a/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.h +++ b/Gems/Multiplayer/Code/Source/MultiplayerToolsModule.h @@ -12,10 +12,36 @@ #pragma once +#include #include +#include namespace Multiplayer { + class MultiplayerToolsSystemComponent final + : public AZ::Component + , public IMultiplayerTools + { + public: + AZ_COMPONENT(MultiplayerToolsSystemComponent, "{65AF5342-0ECE-423B-B646-AF55A122F72B}"); + + static void Reflect(AZ::ReflectContext* context); + + MultiplayerToolsSystemComponent() = default; + ~MultiplayerToolsSystemComponent() override = default; + + /// AZ::Component overrides. + void Activate() override; + void Deactivate() override; + + bool DidProcessNetworkPrefabs() override; + + private: + void SetDidProcessNetworkPrefabs(bool didProcessNetPrefabs) override; + + bool m_didProcessNetPrefabs = false; + }; + class MultiplayerToolsModule : public AZ::Module { diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp index e47d142be8..bd30c5e37f 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp @@ -555,10 +555,10 @@ namespace Multiplayer { replicatorEntity = entityList[0]; } - - AZ_Assert(replicatorEntity != nullptr, "Failed to create entity from prefab %s", prefabEntityId.m_prefabName.GetCStr()); - if (replicatorEntity == nullptr) + else { + AZ_Assert(false, "There should be exactly one created entity out of prefab %s, index %d. Got: %d", + prefabEntityId.m_prefabName.GetCStr(), prefabEntityId.m_entityOffset, entityList.size()); return false; } } @@ -656,7 +656,7 @@ namespace Multiplayer { case Mode::LocalServerToRemoteClient: { - // don't trust the client by default + // Don't trust the client by default result = UpdateValidationResult::DropMessageAndDisconnect; // Clients sending data must have a replicator and be sending in the correct mode, further, they must have a replicator and can never delete a replicator if (updateMessage.GetNetworkRole() == NetEntityRole::Authority && entityReplicator && !updateMessage.GetIsDelete()) @@ -671,7 +671,7 @@ namespace Multiplayer } else { - // we can process this + // We can process this result = UpdateValidationResult::HandleMessage; } } // If we've migrated the entity away from the server, but we get this late, just drop it @@ -699,7 +699,7 @@ namespace Multiplayer case Mode::LocalServerToRemoteServer: { AZ_Assert(updateMessage.GetNetworkRole() == NetEntityRole::Server || updateMessage.GetIsDelete(), "Unexpected update type coming from peer server"); - // trust messages from a peer server by default + // Trust messages from a peer server by default result = UpdateValidationResult::HandleMessage; // If we have a replicator, make sure we're in the correct state if (entityReplicator) @@ -782,7 +782,7 @@ namespace Multiplayer PrefabEntityId prefabEntityId; if (updateMessage.GetHasValidPrefabId()) { - // If the update packet contained a sliceEntryId, use that directly + // If the update packet contained a PrefabEntityId, use that directly prefabEntityId = updateMessage.GetPrefabEntityId(); } else @@ -940,7 +940,7 @@ namespace Multiplayer { const ReplicationSet& newWindow = m_replicationWindow->GetReplicationSet(); - // walk both for adds and removals + // Walk both for adds and removals auto newWindowIter = newWindow.begin(); auto currWindowIter = m_entityReplicatorMap.begin(); while (newWindowIter != newWindow.end() && currWindowIter != m_entityReplicatorMap.end()) @@ -959,9 +959,9 @@ namespace Multiplayer } ++currWindowIter; } - else // same entity + else // Same entity { - // check if we changed modes + // Check if we changed modes EntityReplicator* currReplicator = currWindowIter->second.get(); if (currReplicator->GetRemoteNetworkRole() != newWindowIter->second.m_netEntityRole) { @@ -973,14 +973,14 @@ namespace Multiplayer } } - // do remaining adds + // Do remaining adds while (newWindowIter != newWindow.end()) { AddEntityReplicator(newWindowIter->first, newWindowIter->second.m_netEntityRole); ++newWindowIter; } - // do remaining removes + // Do remaining removes while (currWindowIter != m_entityReplicatorMap.end()) { EntityReplicator* currReplicator = currWindowIter->second.get(); @@ -1028,13 +1028,13 @@ namespace Multiplayer const EntityReplicator* entityReplicator = GetEntityReplicator(entityHandle.GetNetEntityId()); hasAuthority = (netBindComponent->GetNetEntityRole() == NetEntityRole::Authority); // Make sure someone hasn't migrated this already - isInDomain = (m_remoteEntityDomain && m_remoteEntityDomain->IsInDomain(entityHandle)); // Make sure the remote side would want it + isInDomain = (m_remoteEntityDomain && m_remoteEntityDomain->IsInDomain(entityHandle)); // Make sure the remote side would want it if (entityReplicator && entityReplicator->GetBoundLocalNetworkRole() == NetEntityRole::Authority) { - isMarkedForRemoval = entityReplicator->IsMarkedForRemoval(); // Make sure we aren't telling the other side to remove the replicator + isMarkedForRemoval = entityReplicator->IsMarkedForRemoval(); // Make sure we aren't telling the other side to remove the replicator const PropertyPublisher* propertyPublisher = entityReplicator->GetPropertyPublisher(); AZ_Assert(propertyPublisher, "Expected to have a property publisher"); - isRemoteReplicatorEstablished = propertyPublisher->IsRemoteReplicatorEstablished(); // Make sure they are setup to receive the replicator + isRemoteReplicatorEstablished = propertyPublisher->IsRemoteReplicatorEstablished(); // Make sure they are setup to receive the replicator } return hasAuthority && isInDomain && !isMarkedForRemoval && isRemoteReplicatorEstablished; @@ -1094,9 +1094,9 @@ namespace Multiplayer } bool didSucceed = true; - MultiplayerPackets::EntityMigration message; - message.SetEntityId(replicator->GetEntityHandle().GetNetEntityId()); - message.SetPrefabEntityId(netBindComponent->GetPrefabEntityId()); + EntityMigrationMessage message; + message.m_entityId = replicator->GetEntityHandle().GetNetEntityId(); + message.m_prefabEntityId = netBindComponent->GetPrefabEntityId(); if (localEnt->GetState() == AZ::Entity::State::Active) { @@ -1110,17 +1110,18 @@ namespace Multiplayer // Send an update packet if it needs one propPublisher->GenerateRecord(); bool needsNetworkPropertyUpdate = propPublisher->PrepareSerialization(); - AzNetworking::NetworkInputSerializer inputSerializer(message.ModifyPropertyUpdateData().GetBuffer(), message.ModifyPropertyUpdateData().GetCapacity()); + AzNetworking::NetworkInputSerializer inputSerializer(message.m_propertyUpdateData.GetBuffer(), message.m_propertyUpdateData.GetCapacity()); if (needsNetworkPropertyUpdate) { - // write out entity state into the buffer + // Write out entity state into the buffer propPublisher->UpdateSerialization(inputSerializer); } didSucceed &= inputSerializer.IsValid(); - message.ModifyPropertyUpdateData().Resize(inputSerializer.GetSize()); + message.m_propertyUpdateData.Resize(inputSerializer.GetSize()); } AZ_Assert(didSucceed, "Failed to migrate entity from server"); - m_connection.SendReliablePacket(message); + // TODO: Move this to an event + //m_connection.SendReliablePacket(message); AZLOG(NET_RepDeletes, "Migration packet sent %u to remote manager id %d", netEntityId, aznumeric_cast(GetRemoteHostId())); // Immediately add a new replicator so that we catch RPC invocations, the remote side will make us a new one, and then remove us if needs be @@ -1128,21 +1129,21 @@ namespace Multiplayer } } - bool EntityReplicationManager::HandleMessage([[maybe_unused]] AzNetworking::IConnection* invokingConnection, MultiplayerPackets::EntityMigration& message) + bool EntityReplicationManager::HandleEntityMigration([[maybe_unused]] AzNetworking::IConnection* invokingConnection, EntityMigrationMessage& message) { - EntityReplicator* replicator = GetEntityReplicator(message.GetEntityId()); + EntityReplicator* replicator = GetEntityReplicator(message.m_entityId); { - if (message.GetPropertyUpdateData().GetSize() > 0) + if (message.m_propertyUpdateData.GetSize() > 0) { - AzNetworking::TrackChangedSerializer outputSerializer(message.ModifyPropertyUpdateData().GetBuffer(), message.ModifyPropertyUpdateData().GetSize()); + AzNetworking::TrackChangedSerializer outputSerializer(message.m_propertyUpdateData.GetBuffer(), message.m_propertyUpdateData.GetSize()); if (!HandlePropertyChangeMessage ( replicator, AzNetworking::InvalidPacketId, - message.GetEntityId(), + message.m_entityId, NetEntityRole::Server, outputSerializer, - message.GetPrefabEntityId() + message.m_prefabEntityId )) { AZ_Assert(false, "Unable to process network properties during server entity migration"); @@ -1150,10 +1151,10 @@ namespace Multiplayer } } } - // the HandlePropertyChangeMessage will have made a replicator if we didn't have one already + // The HandlePropertyChangeMessage will have made a replicator if we didn't have one already if (!replicator) { - replicator = GetEntityReplicator(message.GetEntityId()); + replicator = GetEntityReplicator(message.m_entityId); } AZ_Assert(replicator, "Do not have replicator after handling migration message"); @@ -1170,7 +1171,7 @@ namespace Multiplayer netBindComponent->ActivateControllers(EntityIsMigrating::True); } - // change the role on the replicator + // Change the role on the replicator AddEntityReplicator(entityHandle, NetEntityRole::Server); AZLOG(NET_RepDeletes, "Handle Migration %u new authority from remote manager id %d", entityHandle.GetNetEntityId(), aznumeric_cast(GetRemoteHostId())); diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.h b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.h index 083413e19e..6172f30e8a 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/EntityReplicationManager.h @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -26,7 +28,6 @@ #include #include #include -#include namespace AzNetworking { @@ -82,7 +83,7 @@ namespace Multiplayer void AddAutonomousEntityReplicatorCreatedHandle(AZ::Event::Handler& handler); - bool HandleMessage(AzNetworking::IConnection* invokingConnection, MultiplayerPackets::EntityMigration& message); + bool HandleEntityMigration(AzNetworking::IConnection* invokingConnection, EntityMigrationMessage& message); bool HandleEntityDeleteMessage(EntityReplicator* entityReplicator, const AzNetworking::IPacketHeader& packetHeader, const NetworkEntityUpdateMessage& updateMessage); bool HandleEntityUpdateMessage(AzNetworking::IConnection* invokingConnection, const AzNetworking::IPacketHeader& packetHeader, const NetworkEntityUpdateMessage& updateMessage); bool HandleEntityRpcMessage(AzNetworking::IConnection* invokingConnection, NetworkEntityRpcMessage& message); diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/ReplicationRecord.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/ReplicationRecord.cpp index 41cc86aaee..7fe0efd323 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/ReplicationRecord.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/EntityReplication/ReplicationRecord.cpp @@ -16,14 +16,12 @@ namespace Multiplayer { ReplicationRecordStats::ReplicationRecordStats ( - uint32_t authorityToAuthorityCount, uint32_t authorityToClientCount, uint32_t authorityToServerCount, uint32_t authorityToAutonomousCount, uint32_t autonomousToAuthorityCount ) - : m_authorityToAuthorityCount(authorityToAuthorityCount) - , m_authorityToClientCount(authorityToClientCount) + : m_authorityToClientCount(authorityToClientCount) , m_authorityToServerCount(authorityToServerCount) , m_authorityToAutonomousCount(authorityToAutonomousCount) , m_autonomousToAuthorityCount(autonomousToAuthorityCount) @@ -33,8 +31,7 @@ namespace Multiplayer bool ReplicationRecordStats::operator ==(const ReplicationRecordStats& rhs) const { - return (m_authorityToAuthorityCount == rhs.m_authorityToAuthorityCount) - && (m_authorityToClientCount == rhs.m_authorityToClientCount) + return (m_authorityToClientCount == rhs.m_authorityToClientCount) && (m_authorityToServerCount == rhs.m_authorityToServerCount) && (m_authorityToAutonomousCount == rhs.m_authorityToAutonomousCount) && (m_autonomousToAuthorityCount == rhs.m_autonomousToAuthorityCount); @@ -44,7 +41,6 @@ namespace Multiplayer { return ReplicationRecordStats { - (m_authorityToAuthorityCount - rhs.m_authorityToAuthorityCount), (m_authorityToClientCount - rhs.m_authorityToClientCount), (m_authorityToServerCount - rhs.m_authorityToServerCount), (m_authorityToAutonomousCount - rhs.m_authorityToAutonomousCount), @@ -71,7 +67,6 @@ namespace Multiplayer bool ReplicationRecord::AreAllBitsConsumed() const { bool ret = true; - ret &= m_authorityToAuthorityConsumedBits == m_authorityToAuthority.GetSize(); ret &= m_authorityToClientConsumedBits == m_authorityToClient.GetSize(); ret &= m_authorityToServerConsumedBits == m_authorityToServer.GetSize(); ret &= m_authorityToAutonomousConsumedBits == m_authorityToAutonomous.GetSize(); @@ -81,7 +76,6 @@ namespace Multiplayer void ReplicationRecord::ResetConsumedBits() { - m_authorityToAuthorityConsumedBits = 0; m_authorityToClientConsumedBits = 0; m_authorityToServerConsumedBits = 0; m_authorityToAutonomousConsumedBits = 0; @@ -92,11 +86,7 @@ namespace Multiplayer { ResetConsumedBits(); - uint32_t recordSize = m_authorityToAuthority.GetSize(); - m_authorityToAuthority.Clear(); - m_authorityToAuthority.Resize(recordSize); - - recordSize = m_authorityToClient.GetSize(); + uint32_t recordSize = m_authorityToClient.GetSize(); m_authorityToClient.Clear(); m_authorityToClient.Resize(recordSize); @@ -115,7 +105,6 @@ namespace Multiplayer void ReplicationRecord::Append(const ReplicationRecord &rhs) { - m_authorityToAuthority |= rhs.m_authorityToAuthority; m_authorityToClient |= rhs.m_authorityToClient; m_authorityToServer |= rhs.m_authorityToServer; m_authorityToAutonomous |= rhs.m_authorityToAutonomous; @@ -124,7 +113,6 @@ namespace Multiplayer void ReplicationRecord::Subtract(const ReplicationRecord &rhs) { - m_authorityToAuthority.Subtract(rhs.m_authorityToAuthority); m_authorityToClient.Subtract(rhs.m_authorityToClient); m_authorityToServer.Subtract(rhs.m_authorityToServer); m_authorityToAutonomous.Subtract(rhs.m_authorityToAutonomous); @@ -134,10 +122,6 @@ namespace Multiplayer bool ReplicationRecord::HasChanges() const { bool hasChanges(false); - if (ContainsAuthorityToAuthorityBits()) - { - hasChanges = hasChanges ? hasChanges : m_authorityToAuthority.AnySet(); - } if (ContainsAuthorityToClientBits()) { hasChanges = hasChanges ? hasChanges : m_authorityToClient.AnySet(); @@ -159,10 +143,6 @@ namespace Multiplayer bool ReplicationRecord::Serialize(AzNetworking::ISerializer& serializer) { - if (ContainsAuthorityToAuthorityBits()) - { - serializer.Serialize(m_authorityToAuthority, "AuthorityToAuthorityRecord"); - } if (ContainsAuthorityToClientBits()) { serializer.Serialize(m_authorityToClient, "AuthorityToClientRecord"); @@ -182,14 +162,6 @@ namespace Multiplayer return serializer.IsValid(); } - void ReplicationRecord::ConsumeAuthorityToAuthorityBits(uint32_t consumedBits) - { - if (ContainsAuthorityToAuthorityBits()) - { - m_authorityToAuthorityConsumedBits += consumedBits; - } - } - void ReplicationRecord::ConsumeAuthorityToClientBits(uint32_t consumedBits) { if (ContainsAuthorityToClientBits()) @@ -222,12 +194,6 @@ namespace Multiplayer } } - bool ReplicationRecord::ContainsAuthorityToAuthorityBits() const - { - return (m_netEntityRole == NetEntityRole::Authority) - || (m_netEntityRole == NetEntityRole::InvalidRole); - } - bool ReplicationRecord::ContainsAuthorityToClientBits() const { return (m_netEntityRole != NetEntityRole::Authority) @@ -252,11 +218,6 @@ namespace Multiplayer || (m_netEntityRole == NetEntityRole::InvalidRole); } - uint32_t ReplicationRecord::GetRemainingAuthorityToAuthorityBits() const - { - return m_authorityToAuthorityConsumedBits < m_authorityToAuthority.GetValidBitCount() ? m_authorityToAuthority.GetValidBitCount() - m_authorityToAuthorityConsumedBits : 0; - } - uint32_t ReplicationRecord::GetRemainingAuthorityToClientBits() const { return m_authorityToClientConsumedBits < m_authorityToClient.GetValidBitCount() ? m_authorityToClient.GetValidBitCount() - m_authorityToClientConsumedBits : 0; @@ -281,7 +242,6 @@ namespace Multiplayer { return ReplicationRecordStats { - m_authorityToAuthorityConsumedBits, m_authorityToClientConsumedBits, m_authorityToServerConsumedBits, m_authorityToAutonomousConsumedBits, diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp index 6f3fdf2b23..dda3f18ad4 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.cpp @@ -34,18 +34,15 @@ namespace Multiplayer : m_networkEntityAuthorityTracker(*this) , m_removeEntitiesEvent([this] { RemoveEntities(); }, AZ::Name("NetworkEntityManager remove entities event")) , m_updateEntityDomainEvent([this] { UpdateEntityDomain(); }, AZ::Name("NetworkEntityManager update entity domain event")) - , m_onSpawnedHandler([this](AZ::Data::Asset spawnable) { this->OnSpawned(spawnable); }) - , m_onDespawnedHandler([this](AZ::Data::Asset spawnable) { this->OnDespawned(spawnable); }) { + AZ::Interface::Register(this); AzFramework::RootSpawnableNotificationBus::Handler::BusConnect(); - - AzFramework::SpawnableEntitiesInterface::Get()->AddOnSpawnedHandler(m_onSpawnedHandler); - AzFramework::SpawnableEntitiesInterface::Get()->AddOnDespawnedHandler(m_onDespawnedHandler); } NetworkEntityManager::~NetworkEntityManager() { AzFramework::RootSpawnableNotificationBus::Handler::BusDisconnect(); + AZ::Interface::Unregister(this); } void NetworkEntityManager::Initialize(HostId hostId, AZStd::unique_ptr entityDomain) @@ -331,17 +328,41 @@ namespace Multiplayer const AzFramework::Spawnable::EntityList& entities = spawnable.GetEntities(); size_t entitiesSize = entities.size(); + using EntityIdMap = AZStd::unordered_map; + EntityIdMap originalToCloneIdMap; + for (size_t i = 0; i < entitiesSize; ++i) { - AZ::Entity* clone = serializeContext->CloneObject(entities[i].get()); + AZ::Entity* originalEntity = entities[i].get(); + AZ::Entity* clone = serializeContext->CloneObject(originalEntity); AZ_Assert(clone != nullptr, "Failed to clone spawnable entity."); + clone->SetId(AZ::Entity::MakeId()); + originalToCloneIdMap[originalEntity->GetId()] = clone->GetId(); + NetBindComponent* netBindComponent = clone->FindComponent(); if (netBindComponent != nullptr) { + // Update TransformComponent parent Id. It is guaranteed for the entities array to be sorted from parent->child here. + auto* transformComponent = clone->FindComponent(); + AZ::EntityId parentId = transformComponent->GetParentId(); + if (parentId.IsValid()) + { + auto it = originalToCloneIdMap.find(parentId); + if (it != originalToCloneIdMap.end()) + { + transformComponent->SetParentRelative(it->second); + } + else + { + AZ_Warning("NetworkEntityManager", false, "Entity %s doesn't have the parent entity %s present in network.spawnable", + clone->GetName().c_str(), parentId.ToString().data()); + } + } + PrefabEntityId prefabEntityId; - prefabEntityId.m_prefabName = m_networkPrefabLibrary.GetPrefabNameFromAssetId(spawnable.GetId()); + prefabEntityId.m_prefabName = m_networkPrefabLibrary.GetSpawnableNameFromAssetId(spawnable.GetId()); prefabEntityId.m_entityOffset = aznumeric_cast(i); const NetEntityId netEntityId = NextId(); @@ -469,57 +490,19 @@ namespace Multiplayer } } - void NetworkEntityManager::OnSpawned(AZ::Data::Asset spawnable) + void NetworkEntityManager::SetupNetEntity(AZ::Entity* netEntity, PrefabEntityId prefabEntityId, NetEntityRole netEntityRole) { - AzFramework::Spawnable* spawnableData = spawnable.GetAs(); - const auto& entityList = spawnableData->GetEntities(); - if (entityList.size() == 0) + auto* netBindComponent = netEntity->FindComponent(); + + if (netBindComponent) { - AZ_Error("NetworkEntityManager", false, "OnSpawned: Spawnable %s doesn't have any entities.", - spawnable.GetHint().c_str()); - return; + const NetEntityId netEntityId = NextId(); + netBindComponent->PreInit(netEntity, prefabEntityId, netEntityId, netEntityRole); } - - const auto& rootEntity = entityList[0]; - auto* spawnableHolder = rootEntity->FindComponent(); - if (!spawnableHolder) + else { - // Root entity doesn't have NetworkSpawnableHolderComponent. It means there's no corresponding network spawnable. - return; + AZ_Error("NetworkEntityManager", false, "SetupNetEntity called for an entity with no NetBindComponent. Entity: %s", + netEntity->GetName().c_str()); } - - AZ::Data::Asset netSpawnableAsset = spawnableHolder->GetNetworkSpawnableAsset(); - AzFramework::Spawnable* netSpawnable = netSpawnableAsset.GetAs(); - if (!netSpawnable) - { - // TODO: Temp sync load until JsonSerialization of loadBehavior is fixed. - netSpawnableAsset = AZ::Data::AssetManager::Instance().GetAsset( - netSpawnableAsset.GetId(), AZ::Data::AssetLoadBehavior::PreLoad); - AZ::Data::AssetManager::Instance().BlockUntilLoadComplete(netSpawnableAsset); - - netSpawnable = netSpawnableAsset.GetAs(); - } - - if (!netSpawnable) - { - AZ_Error("NetworkEntityManager", false, "OnRootSpawnableAssigned: Net spawnable doesn't have any data."); - return; - } - - auto* multiplayer = GetMultiplayer(); - - const auto agentType = multiplayer->GetAgentType(); - const bool spawnImmediately = - (agentType == MultiplayerAgentType::ClientServer || agentType == MultiplayerAgentType::DedicatedServer); - - if (spawnImmediately) - { - CreateEntitiesImmediate(*netSpawnable, NetEntityRole::Authority); - } - } - - void NetworkEntityManager::OnDespawned([[maybe_unused]]AZ::Data::Asset spawnable) - { - // TODO: Remove entities instantiated from the spawnable } } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h index 3291f2c38d..dd9ac99a06 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkEntityManager.h @@ -62,6 +62,8 @@ namespace Multiplayer const AZ::Transform& transform ) override; + void SetupNetEntity(AZ::Entity* netEntity, PrefabEntityId prefabEntityId, NetEntityRole netEntityRole) override; + uint32_t GetEntityCount() const override; NetworkEntityHandle AddEntityToEntityMap(NetEntityId netEntityId, AZ::Entity* entity) override; void MarkForRemoval(const ConstNetworkEntityHandle& entityHandle) override; @@ -93,9 +95,6 @@ namespace Multiplayer void RemoveEntities(); NetEntityId NextId(); - void OnSpawned(AZ::Data::Asset spawnable); - void OnDespawned(AZ::Data::Asset spawnable); - NetworkEntityTracker m_networkEntityTracker; NetworkEntityAuthorityTracker m_networkEntityAuthorityTracker; MultiplayerComponentRegistry m_multiplayerComponentRegistry; @@ -123,8 +122,5 @@ namespace Multiplayer DeferredRpcMessages m_localDeferredRpcMessages; NetworkSpawnableLibrary m_networkPrefabLibrary; - - AZ::Event>::Handler m_onSpawnedHandler; - AZ::Event>::Handler m_onDespawnedHandler; }; } diff --git a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp index ebf5d2609b..935744f807 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.cpp @@ -14,20 +14,23 @@ #include #include #include +#include namespace Multiplayer { NetworkSpawnableLibrary::NetworkSpawnableLibrary() { + AZ::Interface::Register(this); AzFramework::AssetCatalogEventBus::Handler::BusConnect(); } NetworkSpawnableLibrary::~NetworkSpawnableLibrary() { AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); + AZ::Interface::Unregister(this); } - void NetworkSpawnableLibrary::BuildPrefabsList() + void NetworkSpawnableLibrary::BuildSpawnablesList() { auto enumerateCallback = [this](const AZ::Data::AssetId id, const AZ::Data::AssetInfo& info) { @@ -50,10 +53,10 @@ namespace Multiplayer void NetworkSpawnableLibrary::OnCatalogLoaded([[maybe_unused]] const char* catalogFile) { - BuildPrefabsList(); + BuildSpawnablesList(); } - AZ::Name NetworkSpawnableLibrary::GetPrefabNameFromAssetId(AZ::Data::AssetId assetId) + 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 a2c3d4ae56..6ebe2a7418 100644 --- a/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h +++ b/Gems/Multiplayer/Code/Source/NetworkEntity/NetworkSpawnableLibrary.h @@ -12,30 +12,31 @@ #pragma once -#include -#include +#include #include -#include namespace Multiplayer { /// Implementation of the network prefab library interface. class NetworkSpawnableLibrary final - : private AzFramework::AssetCatalogEventBus::Handler + : public INetworkSpawnableLibrary + , private AzFramework::AssetCatalogEventBus::Handler { public: + AZ_RTTI(NetworkSpawnableLibrary, "{65E15F33-E893-49C2-A8E2-B6A8A6EF31E0}", INetworkSpawnableLibrary); + NetworkSpawnableLibrary(); ~NetworkSpawnableLibrary(); - void BuildPrefabsList(); - void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id); + /// INetworkSpawnableLibrary overrides. + void BuildSpawnablesList() override; + void ProcessSpawnableAsset(const AZStd::string& relativePath, AZ::Data::AssetId id) override; + AZ::Name GetSpawnableNameFromAssetId(AZ::Data::AssetId assetId) override; + AZ::Data::AssetId GetAssetIdByName(AZ::Name name) override; /// AssetCatalogEventBus overrides. void OnCatalogLoaded(const char* catalogFile) override; - AZ::Name GetPrefabNameFromAssetId(AZ::Data::AssetId assetId); - AZ::Data::AssetId GetAssetIdByName(AZ::Name name); - private: AZStd::unordered_map m_spawnables; AZStd::unordered_map m_spawnablesReverseLookup; diff --git a/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.cpp b/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.cpp index 98ece0a8cc..f94a8c59d0 100644 --- a/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.cpp +++ b/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.cpp @@ -13,10 +13,15 @@ #include #include #include +#include +#include #include +#include namespace Multiplayer { + AZ_CVAR(float, sv_RewindVolumeExtrudeDistance, 50.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "The amount to increase rewind volume checks to account for fast moving entities"); + NetworkTime::NetworkTime() { AZ::Interface::Register(this); @@ -73,35 +78,59 @@ namespace Multiplayer void NetworkTime::SyncEntitiesToRewindState(const AZ::Aabb& rewindVolume) { - // TODO: extrude rewind volume for initial gather - AZStd::vector gatheredEntries; - AZ::Interface::Get()->GetDefaultVisibilityScene()->Enumerate(rewindVolume, [&gatheredEntries](const AzFramework::IVisibilityScene::NodeData& nodeData) + // Since the vis system doesn't support rewound queries, first query with an expanded volume to catch any fast moving entities + const AZ::Aabb expandedVolume = rewindVolume.GetExpanded(AZ::Vector3(sv_RewindVolumeExtrudeDistance)); + + AzFramework::IEntityBoundsUnion* entityBoundsUnion = AZ::Interface::Get(); + AZStd::vector gatheredEntities; + AZ::Interface::Get()->GetDefaultVisibilityScene()->Enumerate(expandedVolume, + [entityBoundsUnion, rewindVolume, &gatheredEntities](const AzFramework::IVisibilityScene::NodeData& nodeData) { - gatheredEntries.reserve(gatheredEntries.size() + nodeData.m_entries.size()); + gatheredEntities.reserve(gatheredEntities.size() + nodeData.m_entries.size()); for (AzFramework::VisibilityEntry* visEntry : nodeData.m_entries) { if (visEntry->m_typeFlags & AzFramework::VisibilityEntry::TypeFlags::TYPE_Entity) { - // TODO: offset aabb for exact rewound position and check against the non-extruded rewind volume - gatheredEntries.push_back(visEntry); + AZ::Entity* entity = static_cast(visEntry->m_userData); + const AZ::Aabb currentBounds = entityBoundsUnion->GetEntityLocalBoundsUnion(entity->GetId()); + const AZ::Vector3 currentCenter = currentBounds.GetCenter(); + + NetworkTransformComponent* networkTransform = entity->template FindComponent(); + + if (networkTransform != nullptr) + { + const AZ::Vector3 rewindCenter = networkTransform->GetTranslation(); // Get the rewound position + const AZ::Vector3 rewindOffset = rewindCenter - currentCenter; // Compute offset between rewound and current positions + const AZ::Aabb rewoundAabb = currentBounds.GetTranslated(rewindOffset); // Apply offset to the entity aabb + + if (AZ::ShapeIntersection::Overlaps(rewoundAabb, rewindVolume)) // Validate the rewound aabb intersects our rewind volume + { + // Due to component constraints, netBindComponent must exist if networkTransform exists + NetBindComponent* netBindComponent = entity->template FindComponent(); + gatheredEntities.push_back(netBindComponent); + } + } } } }); - for (AzFramework::VisibilityEntry* visEntry : gatheredEntries) + NetworkEntityTracker* networkEntityTracker = GetNetworkEntityTracker(); + for (NetBindComponent* netBindComponent : gatheredEntities) { - AZ::Entity* entity = static_cast(visEntry->m_userData); - [[maybe_unused]] NetBindComponent* entryNetBindComponent = entity->template FindComponent(); - if (entryNetBindComponent != nullptr) - { - // TODO: invoke the sync to rewind event on the netBindComponent and add the entity to the rewound entity set - } + netBindComponent->NotifySyncRewindState(); + m_rewoundEntities.push_back(NetworkEntityHandle(netBindComponent, networkEntityTracker)); } } void NetworkTime::ClearRewoundEntities() { AZ_Assert(!IsTimeRewound(), "Cannot clear rewound entity state while still within scoped rewind"); - // TODO: iterate all rewound entities, signal them to sync rewind state, and clear the rewound entity set + + for (NetworkEntityHandle entityHandle : m_rewoundEntities) + { + NetBindComponent* netBindComponent = entityHandle.GetNetBindComponent(); + netBindComponent->NotifySyncRewindState(); + } + m_rewoundEntities.clear(); } } diff --git a/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.h b/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.h index f714e046b3..c36b04be27 100644 --- a/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.h +++ b/Gems/Multiplayer/Code/Source/NetworkTime/NetworkTime.h @@ -13,6 +13,7 @@ #pragma once #include +#include #include #include @@ -42,6 +43,8 @@ namespace Multiplayer private: + AZStd::vector m_rewoundEntities; + HostFrameId m_hostFrameId = HostFrameId{ 0 }; HostFrameId m_unalteredFrameId = HostFrameId{ 0 }; AZ::TimeMs m_hostTimeMs = AZ::TimeMs{ 0 }; diff --git a/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp b/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp new file mode 100644 index 0000000000..6341f5b060 --- /dev/null +++ b/Gems/Multiplayer/Code/Source/Physics/PhysicsUtils.cpp @@ -0,0 +1,104 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#include + +#include +#include +#include +#include + +namespace +{ + template + AzPhysics::SceneQueryHits SceneQueryInternal(const RequestT& request) + { + auto* sceneInterface = AZ::Interface::Get(); + if (!sceneInterface) + { + return {}; + } + + AzPhysics::SceneHandle sceneHandle = sceneInterface->GetSceneHandle(AzPhysics::DefaultPhysicsSceneName); + if (sceneHandle == AzPhysics::InvalidSceneHandle) + { + return {}; + } + + Multiplayer::INetworkTime* currentNetTime = Multiplayer::GetNetworkTime(); + + if(!currentNetTime->IsTimeRewound()) + { + // If the time is not rewound, we simply execute the scene query as is. + AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &request); + return result; + } + + // If the time is rewound, we want to query against rigid bodies present at the same frame ID: the same as the current rewound time is. + RequestT netSceneQueryRequest = request; + netSceneQueryRequest.m_filterCallback = [&request, currentFrameId = (uint32_t)currentNetTime->GetHostFrameId()]( + const AzPhysics::SimulatedBody* body, const ::Physics::Shape* shape) + { + if (body->GetFrameId() == AzPhysics::SimulatedBody::UndefinedFrameId || body->GetFrameId() == currentFrameId) + { + if (request.m_filterCallback) + { + return request.m_filterCallback(body, shape); + } + + // Overlap filter callbacks return true/false rather than Touch/Block/None + if constexpr (AZStd::is_same_v) + { + return true; + } + else + { + return AzPhysics::SceneQuery::QueryHitType::Touch; + } + } + + if constexpr (AZStd::is_same_v) + { + return false; + } + else + { + return AzPhysics::SceneQuery::QueryHitType::None; + } + }; + + // Execute the scene query modified for the time rewind. + AzPhysics::SceneQueryHits result = sceneInterface->QueryScene(sceneHandle, &netSceneQueryRequest); + return result; + } +} + +namespace Multiplayer +{ + namespace Physics + { + AzPhysics::SceneQueryHits RayCast(const AzPhysics::RayCastRequest& request) + { + return SceneQueryInternal(request); + } + + AzPhysics::SceneQueryHits ShapeCast(const AzPhysics::ShapeCastRequest& request) + { + return SceneQueryInternal(request); + } + + AzPhysics::SceneQueryHits Overlap(const AzPhysics::OverlapRequest& request) + { + return SceneQueryInternal(request); + } + } // namespace Physics +} // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.cpp index 84983b700e..1696e851a5 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.cpp @@ -11,7 +11,12 @@ */ #include +#include #include +#include +#include +#include +#include namespace Multiplayer { @@ -21,15 +26,91 @@ namespace Multiplayer if (serializeContext) { serializeContext->Class() - ->Version(1); + ->Version(1) + ->Field("NetEntityIndex", &NetBindMarkerComponent::m_netEntityIndex) + ->Field("NetSpawnableAsset", &NetBindMarkerComponent::m_networkSpawnableAsset); } } + AzFramework::Spawnable* GetSpawnableFromAsset(AZ::Data::Asset& asset) + { + AzFramework::Spawnable* spawnable = asset.GetAs(); + if (!spawnable) + { + asset = + AZ::Data::AssetManager::Instance().GetAsset(asset.GetId(), AZ::Data::AssetLoadBehavior::PreLoad); + AZ::Data::AssetManager::Instance().BlockUntilLoadComplete(asset); + + spawnable = asset.GetAs(); + } + + return spawnable; + } + + void NetBindMarkerComponent::Activate() { + const auto agentType = AZ::Interface::Get()->GetAgentType(); + const bool spawnImmediately = + (agentType == MultiplayerAgentType::ClientServer || agentType == MultiplayerAgentType::DedicatedServer); + + if (spawnImmediately && m_networkSpawnableAsset.GetId().IsValid()) + { + AZ::Transform worldTm = GetEntity()->FindComponent()->GetWorldTM(); + auto preInsertionCallback = + [worldTm = AZStd::move(worldTm), netEntityIndex = m_netEntityIndex, spawnableAssetId = m_networkSpawnableAsset.GetId()] + (AzFramework::EntitySpawnTicket&, AzFramework::SpawnableEntityContainerView entities) + { + if (entities.size() == 1) + { + AZ::Entity* netEntity = *entities.begin(); + + auto* transformComponent = netEntity->FindComponent(); + transformComponent->SetWorldTM(worldTm); + + AZ::Name spawnableName = AZ::Interface::Get()->GetSpawnableNameFromAssetId(spawnableAssetId); + PrefabEntityId prefabEntityId; + prefabEntityId.m_prefabName = spawnableName; + prefabEntityId.m_entityOffset = netEntityIndex; + AZ::Interface::Get()->SetupNetEntity(netEntity, prefabEntityId, NetEntityRole::Authority); + } + else + { + AZ_Error("NetBindMarkerComponent", false, "Requested to spawn 1 entity, but received %d", entities.size()); + } + }; + + m_netSpawnTicket = AzFramework::EntitySpawnTicket(m_networkSpawnableAsset); + AzFramework::SpawnableEntitiesInterface::Get()->SpawnEntities(m_netSpawnTicket, {m_netEntityIndex}, preInsertionCallback); + } } void NetBindMarkerComponent::Deactivate() { + if(m_netSpawnTicket.IsValid()) + { + AzFramework::SpawnableEntitiesInterface::Get()->DespawnAllEntities(m_netSpawnTicket); + } } + + size_t NetBindMarkerComponent::GetNetEntityIndex() const + { + return m_netEntityIndex; + } + + void NetBindMarkerComponent::SetNetEntityIndex(size_t netEntityIndex) + { + m_netEntityIndex = netEntityIndex; + } + + void NetBindMarkerComponent::SetNetworkSpawnableAsset(AZ::Data::Asset networkSpawnableAsset) + { + m_networkSpawnableAsset = networkSpawnableAsset; + } + + AZ::Data::Asset NetBindMarkerComponent::GetNetworkSpawnableAsset() const + { + return m_networkSpawnableAsset; + } + } diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.h b/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.h index ebafead73c..5ab42ab3aa 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.h +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetBindMarkerComponent.h @@ -13,6 +13,9 @@ #pragma once #include +#include +#include +#include namespace Multiplayer { @@ -34,6 +37,15 @@ namespace Multiplayer void Deactivate() override; //! @} + size_t GetNetEntityIndex() const; + void SetNetEntityIndex(size_t val); + + void SetNetworkSpawnableAsset(AZ::Data::Asset networkSpawnableAsset); + AZ::Data::Asset GetNetworkSpawnableAsset() const; + private: + AZ::Data::Asset m_networkSpawnableAsset{AZ::Data::AssetLoadBehavior::PreLoad}; + size_t m_netEntityIndex = 0; + AzFramework::EntitySpawnTicket m_netSpawnTicket; }; } // namespace Multiplayer diff --git a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp index 4661df7564..31884d4c94 100644 --- a/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp +++ b/Gems/Multiplayer/Code/Source/Pipeline/NetworkPrefabProcessor.cpp @@ -10,7 +10,11 @@ * */ -#include +#include +#include +#include +#include +#include #include #include @@ -18,9 +22,6 @@ #include #include #include -#include -#include -#include namespace Multiplayer { @@ -29,9 +30,20 @@ namespace Multiplayer void NetworkPrefabProcessor::Process(PrefabProcessorContext& context) { + IMultiplayerTools* mpTools = AZ::Interface::Get(); + if (mpTools) + { + mpTools->SetDidProcessNetworkPrefabs(false); + } + context.ListPrefabs([&context](AZStd::string_view prefabName, PrefabDom& prefab) { ProcessPrefab(context, prefabName, prefab); }); + + if (mpTools && !context.GetProcessedObjects().empty()) + { + mpTools->SetDidProcessNetworkPrefabs(true); + } } void NetworkPrefabProcessor::Reflect(AZ::ReflectContext* context) @@ -42,33 +54,15 @@ namespace Multiplayer } } - static AZStd::vector GetEntitiesFromInstance(AZStd::unique_ptr& instance) - { - AZStd::vector result; - - instance->GetNestedEntities([&result](const AZStd::unique_ptr& entity) { - result.emplace_back(entity.get()); - return true; - }); - - if (instance->HasContainerEntity()) - { - auto containerEntityReference = instance->GetContainerEntity(); - result.emplace_back(&containerEntityReference->get()); - } - - return result; - } - void NetworkPrefabProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab) + 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::LoadInstanceFlags::AssignRandomEntityId)) + if (!PrefabDomUtils::LoadInstanceFromPrefabDom(*sourceInstance, prefab, PrefabDomUtils::LoadInstanceFlags::AssignRandomEntityId)) { - PrefabDomValueReference sourceReference = PrefabDomUtils::FindPrefabDomValue(prefab, PrefabDomUtils::SourceName); + 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) @@ -77,6 +71,38 @@ namespace Multiplayer 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::vector>& output) + { + instance->GetEntities([instance, &output](AZStd::unique_ptr& prefabEntity) + { + if (prefabEntity->FindComponent()) + { + output.push_back(AZStd::make_pair(prefabEntity.get(), instance)); + } + return true; + }); + + instance->GetNestedInstances([&output](AZStd::unique_ptr& nestedInstance) + { + GatherNetEntities(nestedInstance.get(), output); + }); + } + + void NetworkPrefabProcessor::ProcessPrefab(PrefabProcessorContext& context, AZStd::string_view prefabName, PrefabDom& prefab) + { + using namespace AzToolsFramework::Prefab; + + // convert Prefab DOM into Prefab Instance. + AZStd::unique_ptr sourceInstance = LoadInstanceFromPrefab(prefab); + if (!sourceInstance) + { return; } @@ -92,50 +118,61 @@ namespace Multiplayer auto&& [object, networkSpawnable] = ProcessedObjectStore::Create(uniqueName, context.GetSourceUuid(), AZStd::move(serializer)); - // grab all nested entities from the Instance as source entities. - AZStd::vector sourceEntities = GetEntitiesFromInstance(sourceInstance); - AZStd::vector networkedEntityIds; - networkedEntityIds.reserve(sourceEntities.size()); + // Grab all net entities with their corresponding Instances to handle nested prefabs correctly + AZStd::vector> netEntities; + GatherNetEntities(sourceInstance.get(), netEntities); - for (auto* sourceEntity : sourceEntities) - { - if (sourceEntity->FindComponent()) - { - networkedEntityIds.push_back(sourceEntity->GetId()); - } - } - - if (networkedEntityIds.empty()) + if (netEntities.empty()) { // No networked entities in the prefab, no need to do anything in this processor. return; } + // Instance container for net entities AZStd::unique_ptr networkInstance(aznew Instance()); - for (auto entityId : networkedEntityIds) - { - AZ::Entity* netEntity = sourceInstance->DetachEntity(entityId).release(); + // Create an asset for our future network spawnable: this allows us to put references to the asset in the components + AZ::Data::Asset networkSpawnableAsset; + networkSpawnableAsset.Create(networkSpawnable->GetId()); + networkSpawnableAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); + // Each spawnable has a root meta-data entity at position 0, so starting net indices from 1 + size_t netEntitiesIndexCounter = 1; + + for (auto& entityInstancePair : netEntities) + { + AZ::Entity* prefabEntity = entityInstancePair.first; + Instance* instance = entityInstancePair.second; + + AZ::EntityId entityId = prefabEntity->GetId(); + AZ::Entity* netEntity = instance->DetachEntity(entityId).release(); + AZ_Assert(netEntity, "Unable to detach entity %s [%s] from the source prefab instance", + prefabEntity->GetName().c_str(), entityId.ToString().c_str()); + + // Net entity will need a new ID to avoid IDs collision + netEntity->SetId(AZ::Entity::MakeId()); networkInstance->AddEntity(*netEntity); - AZ::Entity* breadcrumbEntity = aznew AZ::Entity(netEntity->GetName()); + // Use the old ID for the breadcrumb entity to keep parent-child relationship in the original spawnable + AZ::Entity* breadcrumbEntity = aznew AZ::Entity(entityId, netEntity->GetName()); breadcrumbEntity->SetRuntimeActiveByDefault(netEntity->IsRuntimeActiveByDefault()); - breadcrumbEntity->CreateComponent(); + + // Marker component is responsible to spawning entities based on the index. + NetBindMarkerComponent* netBindMarkerComponent = breadcrumbEntity->CreateComponent(); + netBindMarkerComponent->SetNetEntityIndex(netEntitiesIndexCounter); + netBindMarkerComponent->SetNetworkSpawnableAsset(networkSpawnableAsset); + + // Copy the transform component from the original entity to have the correct transform and parent-child relationship AzFramework::TransformComponent* transformComponent = netEntity->FindComponent(); breadcrumbEntity->CreateComponent(*transformComponent); - - // TODO: Configure NetBindMarkerComponent to refer to the net entity - sourceInstance->AddEntity(*breadcrumbEntity); + + instance->AddEntity(*breadcrumbEntity); + + netEntitiesIndexCounter++; } - // Add net spawnable asset holder + // Add net spawnable asset holder to the prefab root { - AZ::Data::AssetId assetId = networkSpawnable->GetId(); - AZ::Data::Asset networkSpawnableAsset; - networkSpawnableAsset.Create(assetId); - networkSpawnableAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::PreLoad); - EntityOptionalReference containerEntityRef = sourceInstance->GetContainerEntity(); if (containerEntityRef.has_value()) { @@ -165,7 +202,6 @@ namespace Multiplayer return; } - bool result = SpawnableUtils::CreateSpawnable(*networkSpawnable, networkPrefab); if (result) { @@ -175,6 +211,9 @@ namespace Multiplayer (*it)->InvalidateDependencies(); (*it)->EvaluateDependencies(); } + + SpawnableUtils::SortEntitiesByTransformHierarchy(*networkSpawnable); + context.GetProcessedObjects().push_back(AZStd::move(object)); } else diff --git a/Gems/Multiplayer/Code/Tests/MainTools.cpp b/Gems/Multiplayer/Code/Tests/MainTools.cpp new file mode 100644 index 0000000000..6879733d1b --- /dev/null +++ b/Gems/Multiplayer/Code/Tests/MainTools.cpp @@ -0,0 +1,65 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Multiplayer +{ + class MultiplayerToolsTestEnvironment : public AZ::Test::GemTestEnvironment + { + AZ::ComponentApplication* CreateApplicationInstance() override + { + return aznew UnitTest::ToolsTestApplication("MultiplayerToolsTest"); + } + + void AddGemsAndComponents() override + { + AZStd::vector descriptors({ + NetBindComponent::CreateDescriptor(), + NetBindMarkerComponent::CreateDescriptor(), + NetworkSpawnableHolderComponent::CreateDescriptor() + }); + + AddComponentDescriptors(descriptors); + } + + /// Allows derived environments to override to perform additional steps after the system entity is activated. + void PostSystemEntityActivate() override + { + // 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); + } + }; +} // namespace UnitTest + +// Required to support running integration tests with Qt +AZTEST_EXPORT int AZ_UNIT_TEST_HOOK_NAME(int argc, char** argv) +{ + ::testing::InitGoogleMock(&argc, argv); + AzQtComponents::PrepareQtPaths(); + QApplication app(argc, argv); + AZ::Test::printUnusedParametersWarning(argc, argv); + AZ::Test::addTestEnvironments({new Multiplayer::MultiplayerToolsTestEnvironment}); + int result = RUN_ALL_TESTS(); + return result; +} diff --git a/Gems/Multiplayer/Code/Tests/MultiplayerSystemTests.cpp b/Gems/Multiplayer/Code/Tests/MultiplayerSystemTests.cpp index 2e0b9c0759..6ace4db592 100644 --- a/Gems/Multiplayer/Code/Tests/MultiplayerSystemTests.cpp +++ b/Gems/Multiplayer/Code/Tests/MultiplayerSystemTests.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,7 @@ namespace UnitTest SetupAllocator(); AZ::NameDictionary::Create(); m_spawnableComponent = new AzFramework::SpawnableSystemComponent(); + m_netComponent = new AzNetworking::NetworkingSystemComponent(); m_mpComponent = new Multiplayer::MultiplayerSystemComponent(); m_initHandler = Multiplayer::SessionInitEvent::Handler([this](AzNetworking::INetworkInterface* value) { TestInitEvent(value); }); @@ -43,6 +45,7 @@ namespace UnitTest void TearDown() override { delete m_mpComponent; + delete m_netComponent; delete m_spawnableComponent; AZ::NameDictionary::Destroy(); TeardownAllocator(); @@ -71,6 +74,7 @@ namespace UnitTest Multiplayer::SessionShutdownEvent::Handler m_shutdownHandler; Multiplayer::ConnectionAcquiredEvent::Handler m_connAcquiredHandler; + AzNetworking::NetworkingSystemComponent* m_netComponent = nullptr; Multiplayer::MultiplayerSystemComponent* m_mpComponent = nullptr; AzFramework::SpawnableSystemComponent* m_spawnableComponent = nullptr; }; diff --git a/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp new file mode 100644 index 0000000000..c441d2ba5f --- /dev/null +++ b/Gems/Multiplayer/Code/Tests/PrefabProcessingTests.cpp @@ -0,0 +1,114 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class PrefabProcessingTestFixture : public ::testing::Test + { + public: + static void ConvertEntitiesToPrefab(const AZStd::vector& entities, AzToolsFramework::Prefab::PrefabDom& prefabDom) + { + auto* prefabSystem = AZ::Interface::Get(); + AZStd::unique_ptr sourceInstance(prefabSystem->CreatePrefab(entities, {}, "test/path")); + ASSERT_TRUE(sourceInstance); + + auto& prefabTemplateDom = prefabSystem->FindTemplateDom(sourceInstance->GetTemplateId()); + prefabDom.CopyFrom(prefabTemplateDom, prefabDom.GetAllocator()); + } + + static AZ::Entity* CreateSourceEntity(const char* name, bool networked, const AZ::Transform& tm, AZ::Entity* parent = nullptr) + { + AZ::Entity* entity = aznew AZ::Entity(name); + auto* transformComponent = entity->CreateComponent(); + + if (parent) + { + transformComponent->SetParent(parent->GetId()); + transformComponent->SetLocalTM(tm); + } + else + { + transformComponent->SetWorldTM(tm); + } + + if(networked) + { + entity->CreateComponent(); + } + + return entity; + } + }; + + TEST_F(PrefabProcessingTestFixture, NetworkPrefabProcessor_ProcessPrefabTwoEntities_NetEntityGoesToNetSpawnable) + { + using AzToolsFramework::Prefab::PrefabConversionUtils::PrefabProcessorContext; + + AZStd::vector entities; + + // Create test entities: 1 networked and 1 static + const AZStd::string staticEntityName = "static_floor"; + entities.emplace_back(CreateSourceEntity(staticEntityName.c_str(), false, AZ::Transform::CreateIdentity())); + + const AZStd::string netEntityName = "networked_entity"; + entities.emplace_back(CreateSourceEntity(netEntityName.c_str(), true, AZ::Transform::CreateIdentity())); + + // Convert the entities into prefab. Note: This will transfer the ownership of AZ::Entity* into Prefab + AzToolsFramework::Prefab::PrefabDom prefabDom; + ConvertEntitiesToPrefab(entities, prefabDom); + + // Add the prefab into the Prefab Processor Context + const AZStd::string prefabName = "testPrefab"; + PrefabProcessorContext prefabProcessorContext{AZ::Uuid::CreateRandom()}; + prefabProcessorContext.AddPrefab(prefabName, AZStd::move(prefabDom)); + + // Request NetworkPrefabProcessor to process the prefab + Multiplayer::NetworkPrefabProcessor processor; + processor.Process(prefabProcessorContext); + + // Validate results + EXPECT_TRUE(prefabProcessorContext.HasCompletedSuccessfully()); + + // Should be 1 networked spawnable + const auto& processedObjects = prefabProcessorContext.GetProcessedObjects(); + EXPECT_EQ(processedObjects.size(), 1); + + // Verify the name and the type of the spawnable asset + const AZ::Data::AssetData& spawnableAsset = processedObjects[0].GetAsset(); + EXPECT_EQ(prefabName + ".network.spawnable", processedObjects[0].GetId()); + EXPECT_EQ(spawnableAsset.GetType(), azrtti_typeid()); + + // Verify we have only the networked entity in the network spawnable and not the static one + const AzFramework::Spawnable* netSpawnable = azrtti_cast(&spawnableAsset); + const AzFramework::Spawnable::EntityList& entityList = netSpawnable->GetEntities(); + auto countEntityCallback = [](const auto& name) + { + return [name](const auto& entity) + { + return entity->GetName() == name; + }; + }; + + EXPECT_EQ(0, AZStd::count_if(entityList.begin(), entityList.end(), countEntityCallback(staticEntityName))); + EXPECT_EQ(1, AZStd::count_if(entityList.begin(), entityList.end(), countEntityCallback(netEntityName))); + } + +} // namespace UnitTest diff --git a/Gems/Multiplayer/Code/Tests/RewindableContainerTests.cpp b/Gems/Multiplayer/Code/Tests/RewindableContainerTests.cpp new file mode 100644 index 0000000000..0653dd5e08 --- /dev/null +++ b/Gems/Multiplayer/Code/Tests/RewindableContainerTests.cpp @@ -0,0 +1,121 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace UnitTest +{ + class RewindableContainerTests + : public AllocatorsFixture + { + public: + Multiplayer::NetworkTime m_networkTime; + AZ::LoggerSystemComponent m_loggerComponent; + AZ::TimeSystemComponent m_timeComponent; + }; + + static constexpr uint32_t RewindableContainerSize = 7; + + TEST_F(RewindableContainerTests, BasicVectorTest) + { + Multiplayer::RewindableFixedVector test(0, 0); + + // Test push_back + for (uint32_t idx = 0; idx < RewindableContainerSize; ++idx) + { + test.push_back(idx); + EXPECT_EQ(idx, test[idx]); + Multiplayer::GetNetworkTime()->IncrementHostFrameId(); + } + + // Test rewind for all pushed values and overall size + for (uint32_t idx = 0; idx < RewindableContainerSize; ++idx) + { + Multiplayer::ScopedAlterTime time(static_cast(idx), AZ::TimeMs{ 0 }, AzNetworking::InvalidConnectionId); + EXPECT_EQ(idx + 1, test.size()); + EXPECT_EQ(idx, test.back()); + } + + // Test pop_back + test.pop_back(); + EXPECT_EQ(RewindableContainerSize - 1, test.size()); + Multiplayer::GetNetworkTime()->IncrementHostFrameId(); + + // Test iterator + uint32_t iterCount = 0; + auto iter = test.begin(); + while (iter != test.end()) + { + ++iterCount; + ++iter; + } + EXPECT_EQ(RewindableContainerSize - 1, iterCount); + + // Test clear and empty + test.clear(); + EXPECT_EQ(0, test.size()); + Multiplayer::GetNetworkTime()->IncrementHostFrameId(); + EXPECT_TRUE(test.empty()); + + // Test rewind for pop_back and clear + Multiplayer::ScopedAlterTime pop_time(static_cast(RewindableContainerSize), AZ::TimeMs{ 0 }, AzNetworking::InvalidConnectionId); + EXPECT_EQ(RewindableContainerSize - 1, test.size()); + Multiplayer::ScopedAlterTime clear_time(static_cast(RewindableContainerSize + 1), AZ::TimeMs{ 0 }, AzNetworking::InvalidConnectionId); + EXPECT_EQ(0, test.size()); + + // Test copy_values and resize_no_construct + test.resize_no_construct(RewindableContainerSize); + test.copy_values(&test[RewindableContainerSize-1], 1); + EXPECT_EQ(1, test.size()); + test.resize_no_construct(RewindableContainerSize); + EXPECT_EQ(test[0], test[RewindableContainerSize - 1]); + } + + TEST_F(RewindableContainerTests, BasicArrayTest) + { + Multiplayer::RewindableArray test; + + test.fill(0); + Multiplayer::GetNetworkTime()->IncrementHostFrameId(); + // Test push_back + for (uint32_t idx = 0; idx < RewindableContainerSize; ++idx) + { + test[idx] = idx; + EXPECT_EQ(idx, test[idx].Get()); + Multiplayer::GetNetworkTime()->IncrementHostFrameId(); + } + + // Test rewind for all values and overall size + for (uint32_t idx = 1; idx <= RewindableContainerSize; ++idx) + { + Multiplayer::ScopedAlterTime time(static_cast(idx), AZ::TimeMs{ 0 }, AzNetworking::InvalidConnectionId); + for (uint32_t testIdx = 0; testIdx < RewindableContainerSize; ++testIdx) + { + if (testIdx < idx) + { + EXPECT_EQ(testIdx, test[testIdx].Get()); + } + else + { + EXPECT_EQ(0, test[testIdx].Get()); + } + } + } + } +} diff --git a/Gems/Multiplayer/Code/multiplayer_editor_shared_files.cmake b/Gems/Multiplayer/Code/multiplayer_editor_shared_files.cmake index 2d5611d4b6..3fb76061b8 100644 --- a/Gems/Multiplayer/Code/multiplayer_editor_shared_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_editor_shared_files.cmake @@ -12,8 +12,8 @@ set(FILES Source/MultiplayerGem.cpp Source/MultiplayerGem.h - Source/MultiplayerEditorGem.cpp - Source/MultiplayerEditorGem.h + Source/Editor/MultiplayerEditorGem.cpp + Source/Editor/MultiplayerEditorGem.h Source/Editor/MultiplayerEditorSystemComponent.cpp Source/Editor/MultiplayerEditorSystemComponent.h ) diff --git a/Gems/Multiplayer/Code/multiplayer_files.cmake b/Gems/Multiplayer/Code/multiplayer_files.cmake index 8dd7c07689..73de45ba9d 100644 --- a/Gems/Multiplayer/Code/multiplayer_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_files.cmake @@ -11,6 +11,8 @@ set(FILES Include/Multiplayer/IMultiplayer.h + Include/Multiplayer/IMultiplayerTools.h + Include/Multiplayer/MultiplayerConstants.h Include/Multiplayer/MultiplayerStats.h Include/Multiplayer/MultiplayerTypes.h Include/Multiplayer/Components/LocalPredictionPlayerInputComponent.h @@ -22,6 +24,7 @@ set(FILES Include/Multiplayer/ConnectionData/IConnectionData.h Include/Multiplayer/EntityDomains/IEntityDomain.h Include/Multiplayer/NetworkEntity/INetworkEntityManager.h + Include/Multiplayer/INetworkSpawnableLibrary.h Include/Multiplayer/NetworkEntity/NetworkEntityRpcMessage.h Include/Multiplayer/NetworkEntity/NetworkEntityUpdateMessage.h Include/Multiplayer/NetworkEntity/NetworkEntityHandle.h @@ -30,8 +33,13 @@ set(FILES Include/Multiplayer/NetworkInput/IMultiplayerComponentInput.h Include/Multiplayer/NetworkInput/NetworkInput.h Include/Multiplayer/NetworkTime/INetworkTime.h + Include/Multiplayer/NetworkTime/RewindableArray.h + Include/Multiplayer/NetworkTime/RewindableArray.inl + Include/Multiplayer/NetworkTime/RewindableFixedVector.h + Include/Multiplayer/NetworkTime/RewindableFixedVector.inl Include/Multiplayer/NetworkTime/RewindableObject.h Include/Multiplayer/NetworkTime/RewindableObject.inl + Include/Multiplayer/Physics/PhysicsUtils.h Include/Multiplayer/ReplicationWindows/IReplicationWindow.h Source/Multiplayer_precompiled.cpp Source/Multiplayer_precompiled.h @@ -45,6 +53,7 @@ set(FILES Source/AutoGen/AutoComponentTypes_Source.jinja Source/AutoGen/LocalPredictionPlayerInputComponent.AutoComponent.xml Source/AutoGen/Multiplayer.AutoPackets.xml + Source/AutoGen/MultiplayerEditor.AutoPackets.xml Source/AutoGen/NetworkTransformComponent.AutoComponent.xml Source/Components/LocalPredictionPlayerInputComponent.cpp Source/Components/MultiplayerComponent.cpp @@ -58,6 +67,8 @@ set(FILES Source/ConnectionData/ServerToClientConnectionData.cpp Source/ConnectionData/ServerToClientConnectionData.h Source/ConnectionData/ServerToClientConnectionData.inl + Source/Editor/MultiplayerEditorConnection.cpp + Source/Editor/MultiplayerEditorConnection.h Source/EntityDomains/FullOwnershipEntityDomain.cpp Source/EntityDomains/FullOwnershipEntityDomain.h Source/NetworkEntity/EntityReplication/EntityReplicationManager.cpp @@ -97,6 +108,7 @@ set(FILES Source/Pipeline/NetBindMarkerComponent.h Source/Pipeline/NetworkSpawnableHolderComponent.cpp Source/Pipeline/NetworkSpawnableHolderComponent.h + Source/Physics/PhysicsUtils.cpp Source/ReplicationWindows/NullReplicationWindow.cpp Source/ReplicationWindows/NullReplicationWindow.h Source/ReplicationWindows/ServerToClientReplicationWindow.cpp diff --git a/Gems/Multiplayer/Code/multiplayer_tests_files.cmake b/Gems/Multiplayer/Code/multiplayer_tests_files.cmake index fe1ca38186..0731c25d3b 100644 --- a/Gems/Multiplayer/Code/multiplayer_tests_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_tests_files.cmake @@ -13,5 +13,6 @@ set(FILES Tests/Main.cpp Tests/IMultiplayerConnectionMock.h Tests/MultiplayerSystemTests.cpp + Tests/RewindableContainerTests.cpp Tests/RewindableObjectTests.cpp ) diff --git a/Gems/Multiplayer/Code/multiplayer_tools_files.cmake b/Gems/Multiplayer/Code/multiplayer_tools_files.cmake index 1be02fd999..3fef954ba6 100644 --- a/Gems/Multiplayer/Code/multiplayer_tools_files.cmake +++ b/Gems/Multiplayer/Code/multiplayer_tools_files.cmake @@ -10,6 +10,7 @@ # set(FILES + Include/Multiplayer/IMultiplayerTools.h Source/Multiplayer_precompiled.cpp Source/Multiplayer_precompiled.h Source/Pipeline/NetworkPrefabProcessor.cpp diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/android_tool_dependencies.cmake b/Gems/Multiplayer/Code/multiplayer_tools_tests_files.cmake similarity index 87% rename from Templates/DefaultProject/Template/Code/Platform/Android/android_tool_dependencies.cmake rename to Gems/Multiplayer/Code/multiplayer_tools_tests_files.cmake index 14e6f1aa4c..c308b3de52 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Android/android_tool_dependencies.cmake +++ b/Gems/Multiplayer/Code/multiplayer_tools_tests_files.cmake @@ -1,4 +1,4 @@ -# {BEGIN_LICENSE} +# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. # @@ -7,8 +7,9 @@ # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} +# -set(GEM_DEPENDENCIES +set(FILES + Tests/MainTools.cpp + Tests/PrefabProcessingTests.cpp ) - diff --git a/Gems/MultiplayerCompression/Code/CMakeLists.txt b/Gems/MultiplayerCompression/Code/CMakeLists.txt index 58ce546543..acc7978e88 100644 --- a/Gems/MultiplayerCompression/Code/CMakeLists.txt +++ b/Gems/MultiplayerCompression/Code/CMakeLists.txt @@ -39,6 +39,11 @@ ly_add_target( Gem::MultiplayerCompression.Static ) +# use the MultiplayerCompression module everywhere except builders: +ly_create_alias(NAME MultiplayerCompression.Clients NAMESPACE Gem TARGETS Gem::MultiplayerCompression) +ly_create_alias(NAME MultiplayerCompression.Tools NAMESPACE Gem TARGETS Gem::MultiplayerCompression) +ly_create_alias(NAME MultiplayerCompression.Servers NAMESPACE Gem TARGETS Gem::MultiplayerCompression) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_diff.png.imagesettings b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_diff.png.imagesettings index dd621c891f..adbf7d20f9 100644 --- a/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_diff.png.imagesettings +++ b/Gems/NvCloth/Assets/Objects/cloth/Chicken/Actor/chicken_diff.png.imagesettings @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/Gems/NvCloth/Code/CMakeLists.txt b/Gems/NvCloth/Code/CMakeLists.txt index 0f019a985f..d7eaf80b16 100644 --- a/Gems/NvCloth/Code/CMakeLists.txt +++ b/Gems/NvCloth/Code/CMakeLists.txt @@ -56,6 +56,10 @@ ly_add_target( Gem::AtomLyIntegration_CommonFeatures ) +# use the NvCloth module in clients and servers: +ly_create_alias(NAME NvCloth.Clients NAMESPACE Gem TARGETS Gem::NvCloth) +ly_create_alias(NAME NvCloth.Servers NAMESPACE Gem TARGETS Gem::NvCloth) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME NvCloth.Editor.Static STATIC @@ -97,6 +101,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) RUNTIME_DEPENDENCIES Gem::AtomLyIntegration_CommonFeatures.Editor ) + + # use the NvCloth.Editor module in dev tools: + ly_create_alias(NAME NvCloth.Builders NAMESPACE Gem TARGETS Gem::NvCloth.Editor) + ly_create_alias(NAME NvCloth.Tools NAMESPACE Gem TARGETS Gem::NvCloth.Editor) endif() ################################################################################ diff --git a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp index f63382ca6e..2c9d14dc94 100644 --- a/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp +++ b/Gems/NvCloth/Code/Source/Components/ClothComponentMesh/ActorClothColliders.cpp @@ -95,7 +95,7 @@ namespace NvCloth continue; } - for (const Physics::ShapeConfigurationPair& shapeConfigPair : clothNodeConfig.m_shapes) + for (const AzPhysics::ShapeColliderPair& shapeConfigPair : clothNodeConfig.m_shapes) { const auto& colliderConfig = shapeConfigPair.first; diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/anodized_metal_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/anodized_metal_diff.tif.exportsettings index 8d01ab1ac2..e97c4e452c 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/anodized_metal_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/anodized_metal_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:0,ios:0,osx_gl:0,pc:2,provo:0,wiiu:0" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:0,ios:0,mac:0,pc:2,provo:0,wiiu:0" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/brushed_steel_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/brushed_steel_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/brushed_steel_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/brushed_steel_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/dark_leather_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/dark_leather_diff.tif.exportsettings index 2a29854fae..19e899701a 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/dark_leather_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/dark_leather_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/galvanized_steel_spec.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/galvanized_steel_spec.tif.exportsettings index 93bcddc494..08861692ea 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/galvanized_steel_spec.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/galvanized_steel_spec.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Reflectance /reduce="es3:0,ios:0,osx_gl:0,pc:1,provo:0,wiiu:0" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Reflectance /reduce="android:0,ios:0,mac:0,pc:1,provo:0,wiiu:0" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/leather_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/leather_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/leather_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/leather_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/light_leather_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/light_leather_diff.tif.exportsettings index 2a29854fae..19e899701a 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/light_leather_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/light_leather_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_diff.tif.exportsettings index 2a29854fae..19e899701a 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/mixed_stones_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/red_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/red_diff.tif.exportsettings index 54586c2db1..48c18e1fe4 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/red_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/red_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:0,ios:0,osx_gl:0,pc:3,provo:0,wiiu:0" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:0,ios:0,mac:0,pc:3,provo:0,wiiu:0" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rotary_brushed_steel_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rotary_brushed_steel_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rotary_brushed_steel_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rotary_brushed_steel_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_diff.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_diff.tif.exportsettings index 2a29854fae..19e899701a 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_diff.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/rust_diff.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=Albedo /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/wood_planks_ddna.tif.exportsettings b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/wood_planks_ddna.tif.exportsettings index f1f2f06410..a098bdcad9 100644 --- a/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/wood_planks_ddna.tif.exportsettings +++ b/Gems/PBSreferenceMaterials/Assets/materials/pbs_reference/wood_planks_ddna.tif.exportsettings @@ -1 +1 @@ -/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="es3:1,ios:1,osx_gl:1,pc:0,provo:1,wiiu:1" +/autooptimizefile=0 /M=50,50,0,50,50,50 /preset=NormalsWithSmoothness /reduce="android:1,ios:1,mac:1,pc:0,provo:1,wiiu:1" diff --git a/AutomatedTesting/Gem/Code/Platform/Linux/tool_dependencies.cmake b/Gems/PBSreferenceMaterials/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/Linux/tool_dependencies.cmake rename to Gems/PBSreferenceMaterials/CMakeLists.txt diff --git a/Gems/PhysX/Assets/PhysX/TemplateMaterialLibrary.physmaterial b/Gems/PhysX/Assets/PhysX/TemplateMaterialLibrary.physmaterial new file mode 100644 index 0000000000..481cd2fbfa --- /dev/null +++ b/Gems/PhysX/Assets/PhysX/TemplateMaterialLibrary.physmaterial @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Gems/PhysX/Code/CMakeLists.txt b/Gems/PhysX/Code/CMakeLists.txt index b4c7b580a6..b0318af9f2 100644 --- a/Gems/PhysX/Code/CMakeLists.txt +++ b/Gems/PhysX/Code/CMakeLists.txt @@ -46,6 +46,7 @@ ly_add_target( AZ::AzCore AZ::AzFramework Legacy::CryCommon + PRIVATE Gem::LmbrCentral ) @@ -66,10 +67,15 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Gem::PhysX.Static + Gem::LmbrCentral RUNTIME_DEPENDENCIES Gem::LmbrCentral ) +# use the PhysX module in clients and servers: +ly_create_alias(NAME PhysX.Clients NAMESPACE Gem TARGETS Gem::PhysX) +ly_create_alias(NAME PhysX.Servers NAMESPACE Gem TARGETS Gem::PhysX) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_associate_package(PACKAGE_NAME poly2tri-0.3.3-rev2-multiplatform TARGETS poly2tri PACKAGE_HASH 04092d06716f59b936b61906eaf3647db23b685d81d8b66131eb53e0aeaa1a38) @@ -107,7 +113,7 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::SceneCore AZ::SceneData Legacy::CryCommon - Gem::LmbrCentral + Gem::LmbrCentral.Editor Gem::PhysX.NumericalMethods Gem::PhysX.Static Gem::AtomLyIntegration_CommonFeatures.Static @@ -136,6 +142,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::LmbrCentral.Editor ) + # use the PhysX.Editor module in dev tools: + ly_create_alias(NAME PhysX.Builders NAMESPACE Gem TARGETS Gem::PhysX.Editor) + ly_create_alias(NAME PhysX.Tools NAMESPACE Gem TARGETS Gem::PhysX.Editor) + endif() ################################################################################ @@ -157,6 +167,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTestShared AZ::AzTest Gem::PhysX.Static + Gem::LmbrCentral RUNTIME_DEPENDENCIES Gem::LmbrCentral ) diff --git a/Gems/PhysX/Code/Editor/DebugDraw.cpp b/Gems/PhysX/Code/Editor/DebugDraw.cpp index fffb1e1350..829b776e28 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.cpp +++ b/Gems/PhysX/Code/Editor/DebugDraw.cpp @@ -17,13 +17,13 @@ #include #include #include +#include #include #include #include #include -#include -#include +#include namespace PhysX { @@ -415,11 +415,16 @@ namespace PhysX { case GlobalCollisionDebugColorMode::MaterialColor: { - Physics::MaterialFromAssetConfiguration materialConfiguration; const Physics::MaterialId materialId = colliderConfig.m_materialSelection.GetMaterialId(elementDebugInfo.m_materialSlotIndex); - if (colliderConfig.m_materialSelection.GetMaterialConfiguration(materialConfiguration, materialId)) + + AZStd::shared_ptr physicsMaterial; + Physics::PhysicsMaterialRequestBus::BroadcastResult( + physicsMaterial, + &Physics::PhysicsMaterialRequestBus::Events::GetMaterialById, + materialId); + if (physicsMaterial) { - debugColor = materialConfiguration.m_configuration.m_debugColor; + debugColor = physicsMaterial->GetDebugColor(); } break; } @@ -555,25 +560,37 @@ namespace PhysX if (meshConfig.GetCachedNativeMesh()) { - const AZ::Transform scaleMatrix = AZ::Transform::CreateScale(meshScale); - debugDisplay.PushMatrix(GetColliderLocalTransform(colliderConfig) * scaleMatrix); + debugDisplay.PushMatrix(GetColliderLocalTransform(colliderConfig)); if (meshConfig.GetMeshType() == Physics::CookedMeshShapeConfiguration::MeshType::TriangleMesh) { - DrawTriangleMesh(debugDisplay, colliderConfig, geomIndex); + DrawTriangleMesh(debugDisplay, colliderConfig, geomIndex, meshScale); } else { - DrawConvexMesh(debugDisplay, colliderConfig, geomIndex); + DrawConvexMesh(debugDisplay, colliderConfig, geomIndex, meshScale); } debugDisplay.PopMatrix(); } } - void Collider::DrawTriangleMesh(AzFramework::DebugDisplayRequests& debugDisplay, - const Physics::ColliderConfiguration& colliderConfig, - AZ::u32 geomIndex) const + AZStd::vector ScalePoints(const AZ::Vector3& scale, const AZStd::vector& points) + { + AZStd::vector scaledPoints; + scaledPoints.resize_no_construct(points.size()); + AZStd::transform( + points.begin(), points.end(), scaledPoints.begin(), + [scale](const AZ::Vector3& point) + { + return scale * point; + }); + return scaledPoints; + } + + void Collider::DrawTriangleMesh( + AzFramework::DebugDisplayRequests& debugDisplay, const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex, + const AZ::Vector3& meshScale) const { AZ_Assert(geomIndex < m_geometry.size(), "DrawTriangleMesh: geomIndex is out of range"); @@ -581,10 +598,10 @@ namespace PhysX const AZStd::unordered_map>& triangleIndexesByMaterialSlot = geom.m_triangleIndexesByMaterialSlot; - const AZStd::vector& verts = geom.m_verts; - const AZStd::vector& points = geom.m_points; + AZStd::vector scaledVerts = ScalePoints(meshScale, geom.m_verts); + AZStd::vector scaledPoints = ScalePoints(meshScale, geom.m_points); - if (!verts.empty()) + if (!scaledVerts.empty()) { for (const auto& element : triangleIndexesByMaterialSlot) { @@ -596,30 +613,31 @@ namespace PhysX triangleMeshInfo.m_numTriangles = triangleCount; triangleMeshInfo.m_materialSlotIndex = materialSlot; - debugDisplay.DrawTrianglesIndexed(verts, triangleIndexes + debugDisplay.DrawTrianglesIndexed(scaledVerts, triangleIndexes , CalcDebugColor(colliderConfig, triangleMeshInfo)); } - debugDisplay.DrawLines(points, WireframeColor); + debugDisplay.DrawLines(scaledPoints, WireframeColor); } } - void Collider::DrawConvexMesh(AzFramework::DebugDisplayRequests& debugDisplay, - const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex) const + void Collider::DrawConvexMesh( + AzFramework::DebugDisplayRequests& debugDisplay, const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex, + const AZ::Vector3& meshScale) const { AZ_Assert(geomIndex < m_geometry.size(), "DrawConvexMesh: geomIndex is out of range"); const GeometryData& geom = m_geometry[geomIndex]; - const AZStd::vector& verts = geom.m_verts; - const AZStd::vector& points = geom.m_points; + AZStd::vector scaledVerts = ScalePoints(meshScale, geom.m_verts); + AZStd::vector scaledPoints = ScalePoints(meshScale, geom.m_points); - if (!verts.empty()) + if (!scaledVerts.empty()) { - const AZ::u32 triangleCount = static_cast(verts.size() / 3); + const AZ::u32 triangleCount = static_cast(scaledVerts.size() / 3); ElementDebugInfo convexMeshInfo; convexMeshInfo.m_numTriangles = triangleCount; - debugDisplay.DrawTriangles(verts, CalcDebugColor(colliderConfig, convexMeshInfo)); - debugDisplay.DrawLines(points, WireframeColor); + debugDisplay.DrawTriangles(scaledVerts, CalcDebugColor(colliderConfig, convexMeshInfo)); + debugDisplay.DrawLines(scaledPoints, WireframeColor); } } @@ -685,7 +703,7 @@ namespace PhysX // Let each collider decide how to scale itself, so extract the scale here. AZ::Transform entityWorldTransformWithoutScale = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult(entityWorldTransformWithoutScale, m_entityId, &AZ::TransformInterface::GetWorldTM); - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); auto* physXDebug = AZ::Interface::Get(); if (physXDebug == nullptr) diff --git a/Gems/PhysX/Code/Editor/DebugDraw.h b/Gems/PhysX/Code/Editor/DebugDraw.h index fcff961412..c43634717a 100644 --- a/Gems/PhysX/Code/Editor/DebugDraw.h +++ b/Gems/PhysX/Code/Editor/DebugDraw.h @@ -115,11 +115,13 @@ namespace PhysX AzFramework::DebugDisplayRequests& debugDisplay) override; // Internal mesh drawing subroutines - void DrawTriangleMesh(AzFramework::DebugDisplayRequests& debugDisplay, - const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex) const; + void DrawTriangleMesh( + AzFramework::DebugDisplayRequests& debugDisplay, const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex, + const AZ::Vector3& meshScale = AZ::Vector3::CreateOne()) const; - void DrawConvexMesh(AzFramework::DebugDisplayRequests& debugDisplay, - const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex) const; + void DrawConvexMesh( + AzFramework::DebugDisplayRequests& debugDisplay, const Physics::ColliderConfiguration& colliderConfig, AZ::u32 geomIndex, + const AZ::Vector3& meshScale = AZ::Vector3::CreateOne()) const; void BuildTriangleMesh(physx::PxBase* meshData, AZ::u32 geomIndex) const; diff --git a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp index 502d60d8d9..e8e93e0d6e 100644 --- a/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp +++ b/Gems/PhysX/Code/Editor/EditorSubComponentModeSnapRotation.cpp @@ -89,7 +89,7 @@ namespace PhysX AZ::Transform worldTransform = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult( worldTransform, m_entityComponentId.GetEntityId(), &AZ::TransformInterface::GetWorldTM); - worldTransform.ExtractScale(); + worldTransform.ExtractUniformScale(); AZ::Transform localTransform = AZ::Transform::CreateIdentity(); EditorJointRequestBus::EventResult( diff --git a/Gems/PhysX/Code/Editor/SettingsWidget.cpp b/Gems/PhysX/Code/Editor/SettingsWidget.cpp index 38022e8c92..20a67a778d 100644 --- a/Gems/PhysX/Code/Editor/SettingsWidget.cpp +++ b/Gems/PhysX/Code/Editor/SettingsWidget.cpp @@ -37,14 +37,15 @@ namespace PhysX const Debug::DebugDisplayData& debugDisplayData) { m_physxSystemConfiguration = physxSystemConfiguration; - m_defaultPhysicsMaterialLibrary.m_asset = m_physxSystemConfiguration.m_defaultMaterialLibrary; + m_physicsMaterialInfo.m_defaultMaterialConfiguration = m_physxSystemConfiguration.m_defaultMaterialConfiguration; + m_physicsMaterialInfo.m_materialLibraryAsset = m_physxSystemConfiguration.m_materialLibraryAsset; m_defaultSceneConfiguration = defaultSceneConfiguration; m_debugDisplayData = debugDisplayData; blockSignals(true); m_propertyEditor->ClearInstances(); m_propertyEditor->AddInstance(&m_physxSystemConfiguration); - m_propertyEditor->AddInstance(&m_defaultPhysicsMaterialLibrary); + m_propertyEditor->AddInstance(&m_physicsMaterialInfo); m_propertyEditor->AddInstance(&m_defaultSceneConfiguration); m_propertyEditor->AddInstance(&m_debugDisplayData); m_propertyEditor->AddInstance(&m_physxSystemConfiguration.m_windConfiguration); @@ -88,7 +89,8 @@ namespace PhysX void SettingsWidget::SetPropertyEditingComplete(AzToolsFramework::InstanceDataNode* /*node*/) { - m_physxSystemConfiguration.m_defaultMaterialLibrary = m_defaultPhysicsMaterialLibrary.m_asset; + m_physxSystemConfiguration.m_defaultMaterialConfiguration = m_physicsMaterialInfo.m_defaultMaterialConfiguration; + m_physxSystemConfiguration.m_materialLibraryAsset = m_physicsMaterialInfo.m_materialLibraryAsset; emit onValueChanged(m_physxSystemConfiguration, m_defaultSceneConfiguration, m_debugDisplayData diff --git a/Gems/PhysX/Code/Editor/SettingsWidget.h b/Gems/PhysX/Code/Editor/SettingsWidget.h index 78df72b6d3..a4001e13b7 100644 --- a/Gems/PhysX/Code/Editor/SettingsWidget.h +++ b/Gems/PhysX/Code/Editor/SettingsWidget.h @@ -56,7 +56,7 @@ namespace PhysX AzToolsFramework::ReflectedPropertyEditor* m_propertyEditor; DocumentationLinkWidget* m_documentationLinkWidget; - Physics::DefaultMaterialLibraryAssetReflectionWrapper m_defaultPhysicsMaterialLibrary; + Physics::MaterialInfoReflectionWrapper m_physicsMaterialInfo; PhysX::PhysXSystemConfiguration m_physxSystemConfiguration; AzPhysics::SceneConfiguration m_defaultSceneConfiguration; Debug::DebugDisplayData m_debugDisplayData; diff --git a/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.cpp b/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.cpp index e510aa505e..b28bf6ab4a 100644 --- a/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.cpp +++ b/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.cpp @@ -30,40 +30,91 @@ namespace PhysX { - static bool CreateSurfaceTypeMaterialLibrary(const AZStd::string & targetFilePath) + constexpr const char* DefaultAssetFilename = "SurfaceTypeMaterialLibrary"; + constexpr const char* TemplateAssetFilename = "PhysX/TemplateMaterialLibrary"; + + static AZStd::optional> GetMaterialLibraryTemplate() { - auto assetType = AZ::AzTypeInfo::Uuid(); + const auto& assetType = AZ::AzTypeInfo::Uuid(); - // Create File - AZ::Data::Asset newAsset = AZ::Data::AssetManager::Instance().CreateAsset(AZ::Uuid::CreateRandom(), assetType, AZ::Data::AssetLoadBehavior::Default); + AZStd::vector assetTypeExtensions; + AZ::AssetTypeInfoBus::Event(assetType, &AZ::AssetTypeInfo::GetAssetTypeExtensions, assetTypeExtensions); - AZ::IO::FileIOStream fileStream(targetFilePath.c_str(), AZ::IO::OpenMode::ModeWrite); + if (assetTypeExtensions.size() == 1) + { + // Constructing the path to the library asset + const AZStd::string& assetExtension = assetTypeExtensions[0]; + + // Use the path relative to the asset root to avoid hardcoding full path in the configuration + AZStd::string relativePath = TemplateAssetFilename; + AzFramework::StringFunc::Path::ReplaceExtension(relativePath, assetExtension.c_str()); + + AZ::Data::AssetId assetId; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, relativePath.c_str(), assetType, false /*autoRegisterIfNotFound*/); + + if (assetId.IsValid()) + { + return AZ::Data::AssetManager::Instance().GetAsset(assetId, AZ::Data::AssetLoadBehavior::NoLoad); + } + } + + return AZStd::nullopt; + } + + static AZStd::optional> CreateMaterialLibrary(const AZStd::string& fullTargetFilePath, const AZStd::string& relativePath) + { + AZ::IO::FileIOStream fileStream(fullTargetFilePath.c_str(), AZ::IO::OpenMode::ModeWrite); if (fileStream.IsOpen()) { - Physics::MaterialLibraryAsset* materialLibraryAsset = azrtti_cast(newAsset.GetData()); - if (materialLibraryAsset) - { - // check it out in the source control system - AzToolsFramework::SourceControlCommandBus::Broadcast( - &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, targetFilePath.c_str(), true, - [](bool /*success*/, const AzToolsFramework::SourceControlFileInfo& /*info*/) {}); + const auto& assetType = AZ::AzTypeInfo::Uuid(); + AZ::Data::AssetId assetId; - // Save the material library asset into a file - auto assetHandler = const_cast(AZ::Data::AssetManager::Instance().GetHandler(assetType)); - if (assetHandler->SaveAssetData(newAsset, &fileStream)) + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + assetId, &AZ::Data::AssetCatalogRequestBus::Events::GetAssetIdByPath, relativePath.c_str(), assetType, true /*autoRegisterIfNotFound*/); + + AZ::Data::Asset newAsset = + AZ::Data::AssetManager::Instance().GetAsset(assetId, assetType, AZ::Data::AssetLoadBehavior::Default); + + if (auto* newMaterialLibraryData = azrtti_cast(newAsset.GetData())) + { + if (auto templateLibraryOpt = GetMaterialLibraryTemplate()) { - return true; - } - else - { - AZ_Error("PhysX", false, - "CreateSurfaceTypeMaterialLibrary: Unable to save Surface Types Material Library Asset to %s", - targetFilePath.c_str()); + if (const auto* templateMaterialLibData = azrtti_cast(templateLibraryOpt->GetData())) + { + templateLibraryOpt->QueueLoad(); + templateLibraryOpt->BlockUntilLoadComplete(); + + // Fill the newly created material library using the template data + for (const auto& materialData : templateMaterialLibData->GetMaterialsData()) + { + newMaterialLibraryData->AddMaterialData(materialData); + } + + // check it out in the source control system + AzToolsFramework::SourceControlCommandBus::Broadcast( + &AzToolsFramework::SourceControlCommandBus::Events::RequestEdit, fullTargetFilePath.c_str(), true /*allowMultiCheckout*/, + [](bool /*success*/, const AzToolsFramework::SourceControlFileInfo& /*info*/) {}); + + // Save the material library asset into a file + auto assetHandler = AZ::Data::AssetManager::Instance().GetHandler(assetType); + if (assetHandler->SaveAssetData(newAsset, &fileStream)) + { + return newAsset; + } + else + { + AZ_Error( + "PhysX", false, + "CreateSurfaceTypeMaterialLibrary: Unable to save Surface Types Material Library Asset to %s", + fullTargetFilePath.c_str()); + } + } } } } - return false; + return AZStd::nullopt; } void EditorSystemComponent::Reflect(AZ::ReflectContext* context) @@ -84,11 +135,26 @@ namespace PhysX { Physics::EditorWorldBus::Handler::BusConnect(); + m_onMaterialLibraryLoadErrorEventHandler = AzPhysics::SystemEvents::OnMaterialLibraryLoadErrorEvent::Handler( + [this]([[maybe_unused]] AzPhysics::SystemEvents::MaterialLibraryLoadErrorType error) + { + // Attempt to set/create the default material library if there was an error + if (auto* physxSystem = GetPhysXSystem()) + { + if (auto retrievedMaterialLibrary = RetrieveDefaultMaterialLibrary()) + { + physxSystem->UpdateMaterialLibrary(retrievedMaterialLibrary.value()); + } + } + } + ); + if (auto* physicsSystem = AZ::Interface::Get()) { AzPhysics::SceneConfiguration editorWorldConfiguration = physicsSystem->GetDefaultSceneConfiguration(); editorWorldConfiguration.m_sceneName = AzPhysics::EditorPhysicsSceneName; m_editorWorldSceneHandle = physicsSystem->AddScene(editorWorldConfiguration); + physicsSystem->RegisterOnMaterialLibraryLoadErrorEventHandler(m_onMaterialLibraryLoadErrorEventHandler); } PhysX::RegisterConfigStringLineEditHandler(); // Register custom unique string line edit control @@ -109,6 +175,8 @@ namespace PhysX physicsSystem->RemoveScene(m_editorWorldSceneHandle); } m_editorWorldSceneHandle = AzPhysics::InvalidSceneHandle; + + m_onMaterialLibraryLoadErrorEventHandler.Disconnect(); } AzPhysics::SceneHandle EditorSystemComponent::GetEditorSceneHandle() const @@ -148,7 +216,7 @@ namespace PhysX PhysX::Editor::EditorWindow::RegisterViewClass(); } - AZ::Data::AssetId EditorSystemComponent::GenerateSurfaceTypesLibrary() + AZStd::optional> EditorSystemComponent::RetrieveDefaultMaterialLibrary() { AZ::Data::AssetId resultAssetId; @@ -159,8 +227,6 @@ namespace PhysX if (assetTypeExtensions.size() == 1) { - const char* DefaultAssetFilename = "SurfaceTypeMaterialLibrary"; - // Constructing the path to the library asset const AZStd::string& assetExtension = assetTypeExtensions[0]; @@ -169,40 +235,44 @@ namespace PhysX AzFramework::StringFunc::Path::ReplaceExtension(relativePath, assetExtension.c_str()); // Try to find an already existing material library - AZ::Data::AssetCatalogRequestBus::BroadcastResult(resultAssetId, &AZ::Data::AssetCatalogRequests::GetAssetIdByPath, relativePath.c_str(), azrtti_typeid(), false); + AZ::Data::AssetCatalogRequestBus::BroadcastResult(resultAssetId, + &AZ::Data::AssetCatalogRequests::GetAssetIdByPath, relativePath.c_str(), azrtti_typeid(), false /*autoRegisterIfNotFound*/); if (!resultAssetId.IsValid()) { + // No file for the default material library, create it const char* assetRoot = AZ::IO::FileIOBase::GetInstance()->GetAlias("@devassets@"); - AZStd::string fullPath; AzFramework::StringFunc::Path::ConstructFull(assetRoot, DefaultAssetFilename, assetExtension.c_str(), fullPath); - if (CreateSurfaceTypeMaterialLibrary(fullPath)) + if (auto materialLibraryOpt = CreateMaterialLibrary(fullPath, relativePath)) { - // Find out the asset ID for the material library we've just created - AZ::Data::AssetCatalogRequestBus::BroadcastResult( - resultAssetId, &AZ::Data::AssetCatalogRequests::GetAssetIdByPath, - relativePath.c_str(), - azrtti_typeid(), true); + return materialLibraryOpt; } else { AZ_Warning("PhysX", false, - "GenerateSurfaceTypesLibrary: Failed to create material library at %s. " + "CreateMaterialLibrary: Failed to create material library at %s. " "Please check if the file is writable", fullPath.c_str()); } } + else + { + AZ::Data::Asset existingMaterialLibrary = + AZ::Data::AssetManager::Instance().GetAsset(resultAssetId, AZ::Data::AssetLoadBehavior::NoLoad); + + return existingMaterialLibrary; + } } else { AZ_Warning("PhysX", false, - "GenerateSurfaceTypesLibrary: Number of extensions for the physics material library asset is %u" + "RetrieveDefaultMaterialLibrary: Number of extensions for the physics material library asset is %u" " but should be 1. Please check if the asset registered itself with the asset system correctly", assetTypeExtensions.size()) } - return resultAssetId; + return AZStd::nullopt; } } diff --git a/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.h b/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.h index 9ebca05ccd..4bd11a951f 100644 --- a/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.h +++ b/Gems/PhysX/Code/Editor/Source/Components/EditorSystemComponent.h @@ -14,6 +14,7 @@ #include #include +#include #include namespace AzPhysics @@ -65,8 +66,9 @@ namespace PhysX void PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags) override; void NotifyRegisterViews() override; - AZ::Data::AssetId GenerateSurfaceTypesLibrary(); + AZStd::optional> RetrieveDefaultMaterialLibrary(); + AzPhysics::SystemEvents::OnMaterialLibraryLoadErrorEvent::Handler m_onMaterialLibraryLoadErrorEventHandler; AzPhysics::SceneHandle m_editorWorldSceneHandle = AzPhysics::InvalidSceneHandle; }; } diff --git a/Gems/PhysX/Code/Include/PhysX/ColliderComponentBus.h b/Gems/PhysX/Code/Include/PhysX/ColliderComponentBus.h index fc06d69b4a..4b53ccec4e 100644 --- a/Gems/PhysX/Code/Include/PhysX/ColliderComponentBus.h +++ b/Gems/PhysX/Code/Include/PhysX/ColliderComponentBus.h @@ -30,7 +30,7 @@ namespace PhysX { public: //! Gets the collection of collider configuration / shape configuration pairs used to define the collider's shapes. - virtual Physics::ShapeConfigurationList GetShapeConfigurations() = 0; + virtual AzPhysics::ShapeColliderPairList GetShapeConfigurations() = 0; //! Gets the collection of physics shapes associated with the collider. virtual AZStd::vector> GetShapes() = 0; diff --git a/Gems/PhysX/Code/Include/PhysX/Configuration/PhysXConfiguration.h b/Gems/PhysX/Code/Include/PhysX/Configuration/PhysXConfiguration.h index 936eadad18..598cdc1b4c 100644 --- a/Gems/PhysX/Code/Include/PhysX/Configuration/PhysXConfiguration.h +++ b/Gems/PhysX/Code/Include/PhysX/Configuration/PhysXConfiguration.h @@ -13,7 +13,6 @@ #pragma once #include #include -#include #include #include @@ -55,7 +54,6 @@ namespace PhysX static PhysXSystemConfiguration CreateDefault(); WindConfiguration m_windConfiguration; //!< Wind configuration for PhysX. - AZ::Data::Asset m_defaultMaterialLibrary = AZ::Data::AssetLoadBehavior::NoLoad; //!< Material Library exposed by the system component SystemBus API. bool operator==(const PhysXSystemConfiguration& other) const; bool operator!=(const PhysXSystemConfiguration& other) const; diff --git a/Gems/PhysX/Code/Include/PhysX/MeshAsset.h b/Gems/PhysX/Code/Include/PhysX/MeshAsset.h index 1af297edcc..8467c04359 100644 --- a/Gems/PhysX/Code/Include/PhysX/MeshAsset.h +++ b/Gems/PhysX/Code/Include/PhysX/MeshAsset.h @@ -58,7 +58,7 @@ namespace PhysX static constexpr AZ::u16 TriangleMeshMaterialIndex = (std::numeric_limits::max)(); using ShapeConfigurationPair = AZStd::pair, - AZStd::shared_ptr>; // Have to use shared_ptr here because Physics::ShapeConfigurationList uses it + AZStd::shared_ptr>; // Have to use shared_ptr here because AzPhysics::ShapeColliderPairList uses it using ShapeConfigurationList = AZStd::vector; ShapeConfigurationList m_colliderShapes; //!< Shapes data with optional collider configuration override. diff --git a/Gems/PhysX/Code/Include/PhysX/MeshColliderComponentBus.h b/Gems/PhysX/Code/Include/PhysX/MeshColliderComponentBus.h index 33305be145..ac36ebbc7f 100644 --- a/Gems/PhysX/Code/Include/PhysX/MeshColliderComponentBus.h +++ b/Gems/PhysX/Code/Include/PhysX/MeshColliderComponentBus.h @@ -38,10 +38,6 @@ namespace PhysX /// @param id The asset ID to set it to. virtual void SetMeshAsset(const AZ::Data::AssetId& id) = 0; - /// Sets the material library asset to the collider. - /// @param id The asset ID to set it to. - virtual void SetMaterialAsset(const AZ::Data::AssetId& id) = 0; - /// Sets the material id from the material library. /// @param id The asset ID to set it to. virtual void SetMaterialId(const Physics::MaterialId& id) = 0; diff --git a/Gems/PhysX/Code/Source/BaseColliderComponent.cpp b/Gems/PhysX/Code/Source/BaseColliderComponent.cpp index c8581efcb7..57a37e5e88 100644 --- a/Gems/PhysX/Code/Source/BaseColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/BaseColliderComponent.cpp @@ -104,7 +104,7 @@ namespace PhysX } } - void BaseColliderComponent::SetShapeConfigurationList(const Physics::ShapeConfigurationList& shapeConfigList) + void BaseColliderComponent::SetShapeConfigurationList(const AzPhysics::ShapeColliderPairList& shapeConfigList) { if (GetEntity()->GetState() == AZ::Entity::State::Active) { @@ -115,7 +115,7 @@ namespace PhysX m_shapeConfigList = shapeConfigList; } - Physics::ShapeConfigurationList BaseColliderComponent::GetShapeConfigurations() + AzPhysics::ShapeColliderPairList BaseColliderComponent::GetShapeConfigurations() { return m_shapeConfigList; } @@ -319,7 +319,7 @@ namespace PhysX { AZ_Assert(IsMeshCollider(), "InitMeshCollider called for a non-mesh collider."); - const Physics::ShapeConfigurationPair& shapeConfigurationPair = *(m_shapeConfigList.begin()); + const AzPhysics::ShapeColliderPair& shapeConfigurationPair = *(m_shapeConfigList.begin()); const Physics::ColliderConfiguration& componentColliderConfiguration = *(shapeConfigurationPair.first.get()); const Physics::PhysicsAssetShapeConfiguration& physicsAssetConfiguration = *(static_cast(shapeConfigurationPair.second.get())); diff --git a/Gems/PhysX/Code/Source/BaseColliderComponent.h b/Gems/PhysX/Code/Source/BaseColliderComponent.h index b23e6f1f09..747ffe9d16 100644 --- a/Gems/PhysX/Code/Source/BaseColliderComponent.h +++ b/Gems/PhysX/Code/Source/BaseColliderComponent.h @@ -40,10 +40,10 @@ namespace PhysX BaseColliderComponent() = default; - void SetShapeConfigurationList(const Physics::ShapeConfigurationList& shapeConfigList); + void SetShapeConfigurationList(const AzPhysics::ShapeColliderPairList& shapeConfigList); // ColliderComponentRequestBus - Physics::ShapeConfigurationList GetShapeConfigurations() override; + AzPhysics::ShapeColliderPairList GetShapeConfigurations() override; AZStd::vector> GetShapes() override; // TransformNotificationsBus @@ -114,7 +114,7 @@ namespace PhysX virtual void UpdateScaleForShapeConfigs(); ShapeInfoCache m_shapeInfoCache; - Physics::ShapeConfigurationList m_shapeConfigList; + AzPhysics::ShapeColliderPairList m_shapeConfigList; private: bool InitShapes(); bool IsMeshCollider() const; diff --git a/Gems/PhysX/Code/Source/Configuration/PhysXConfiguration.cpp b/Gems/PhysX/Code/Source/Configuration/PhysXConfiguration.cpp index 3ba520513f..a0db4d5d30 100644 --- a/Gems/PhysX/Code/Source/Configuration/PhysXConfiguration.cpp +++ b/Gems/PhysX/Code/Source/Configuration/PhysXConfiguration.cpp @@ -36,6 +36,18 @@ namespace PhysX return configuration; } + + bool PhysXSystemConfigurationConverter([[maybe_unused]] AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& dataElement) + { + if (dataElement.GetVersion() <= 1) + { + dataElement.RemoveElementByName(AZ_CRC_CE("DefaultMaterialLibrary")); + AZ_Warning("PhysXSystemConfigurationConverter", false, + "Old version of PhysX Configuration data found. Physics material library will be reset to default."); + } + + return true; + } } AZ_CLASS_ALLOCATOR_IMPL(WindConfiguration, AZ::SystemAllocator, 0); @@ -89,9 +101,8 @@ namespace PhysX if (auto* serializeContext = azdynamic_cast(context)) { serializeContext->Class() - ->Version(1) + ->Version(2, &PhysXInternal::PhysXSystemConfigurationConverter) ->Field("WindConfiguration", &PhysXSystemConfiguration::m_windConfiguration) - ->Field("MaterialLibrary", &PhysXSystemConfiguration::m_defaultMaterialLibrary) ; if (AZ::EditContext* editContext = serializeContext->GetEditContext()) @@ -115,7 +126,6 @@ namespace PhysX bool PhysXSystemConfiguration::operator==(const PhysXSystemConfiguration& other) const { return AzPhysics::SystemConfiguration::operator==(other) && - m_defaultMaterialLibrary == other.m_defaultMaterialLibrary && m_windConfiguration == other.m_windConfiguration ; } diff --git a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp index 18bb06ba74..4454429092 100644 --- a/Gems/PhysX/Code/Source/EditorColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorColliderComponent.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include @@ -312,6 +312,26 @@ namespace PhysX } } + AZStd::shared_ptr EditorProxyShapeConfig::CloneCurrent() const + { + switch (m_shapeType) + { + case Physics::ShapeType::Sphere: + return AZStd::make_shared(m_sphere); + case Physics::ShapeType::Capsule: + return AZStd::make_shared(m_capsule); + case Physics::ShapeType::PhysicsAsset: + return AZStd::make_shared(m_physicsAsset.m_configuration); + case Physics::ShapeType::CookedMesh: + return AZStd::make_shared(m_cookedMesh); + default: + AZ_Warning("EditorProxyShapeConfig", false, "Unsupported shape type, defaulting to Box."); + [[fallthrough]]; + case Physics::ShapeType::Box: + return AZStd::make_shared(m_box); + } + } + bool EditorProxyShapeConfig::ShowingSubdivisionLevel() const { return (m_hasNonUniformScale && (IsCapsuleConfig() || IsSphereConfig() || IsAssetConfig())); @@ -332,10 +352,13 @@ namespace PhysX AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); }); - m_onDefaultMaterialLibraryChangedEventHandler = AzPhysics::SystemEvents::OnDefaultMaterialLibraryChangedEvent::Handler( + m_onMaterialLibraryChangedEventHandler = AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler( [this](const AZ::Data::AssetId& defaultMaterialLibrary) { - m_configuration.m_materialSelection.OnDefaultMaterialLibraryChanged(defaultMaterialLibrary); + m_configuration.m_materialSelection.OnMaterialLibraryChanged(defaultMaterialLibrary); + + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestRefresh, + AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); }); AzToolsFramework::Components::EditorComponentBase::Activate(); @@ -443,13 +466,13 @@ namespace PhysX if (auto* physXSystem = GetPhysXSystem()) { physXSystem->RegisterSystemConfigurationChangedEvent(m_physXConfigChangedHandler); - physXSystem->RegisterOnDefaultMaterialLibraryChangedEventHandler(m_onDefaultMaterialLibraryChangedEventHandler); + physXSystem->RegisterOnMaterialLibraryChangedEventHandler(m_onMaterialLibraryChangedEventHandler); } } void EditorColliderComponent::OnDeselected() { - m_onDefaultMaterialLibraryChangedEventHandler.Disconnect(); + m_onMaterialLibraryChangedEventHandler.Disconnect(); m_physXConfigChangedHandler.Disconnect(); } @@ -583,17 +606,13 @@ namespace PhysX } AZ::Transform colliderTransform = GetWorldTM(); - colliderTransform.ExtractScale(); + colliderTransform.ExtractUniformScale(); AzPhysics::StaticRigidBodyConfiguration configuration; configuration.m_orientation = colliderTransform.GetRotation(); configuration.m_position = colliderTransform.GetTranslation(); configuration.m_entityId = GetEntityId(); configuration.m_debugName = GetEntity()->GetName(); - // This configuration needs to be at the scope of the function to be added - // to m_colliderAndShapeData as a pointer. - Physics::ColliderConfiguration colliderConfig; - if (m_shapeConfiguration.IsAssetConfig()) { AZStd::vector> shapes; @@ -603,13 +622,15 @@ namespace PhysX } else { - colliderConfig = GetColliderConfigurationScaled(); - Physics::ShapeConfiguration& shapeConfig = m_shapeConfiguration.GetCurrent(); + AZStd::shared_ptr colliderConfig = AZStd::make_shared( + GetColliderConfigurationScaled()); + AZStd::shared_ptr shapeConfig = m_shapeConfiguration.CloneCurrent(); + if (IsNonUniformlyScaledPrimitive(m_shapeConfiguration)) { - auto convexConfig = Utils::CreateConvexFromPrimitive(GetColliderConfiguration(), shapeConfig, - m_shapeConfiguration.m_subdivisionLevel, shapeConfig.m_scale); - auto colliderConfigurationNoOffset = colliderConfig; + auto convexConfig = Utils::CreateConvexFromPrimitive(GetColliderConfiguration(), *(shapeConfig.get()), + m_shapeConfiguration.m_subdivisionLevel, shapeConfig->m_scale); + Physics::ColliderConfiguration colliderConfigurationNoOffset = *colliderConfig; colliderConfigurationNoOffset.m_rotation = AZ::Quaternion::CreateIdentity(); colliderConfigurationNoOffset.m_position = AZ::Vector3::CreateZero(); @@ -622,7 +643,7 @@ namespace PhysX } else { - configuration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfig); + configuration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig); } } @@ -663,11 +684,6 @@ namespace PhysX } } - void EditorColliderComponent::SetMaterialAsset(const AZ::Data::AssetId& id) - { - m_configuration.m_materialSelection.SetMaterialLibrary(id); - } - void EditorColliderComponent::SetMaterialId(const Physics::MaterialId& id) { m_configuration.m_materialSelection.SetMaterialId(id); @@ -675,8 +691,10 @@ namespace PhysX void EditorColliderComponent::UpdateMaterialSlotsFromMeshAsset() { - Physics::SystemRequestBus::Broadcast(&Physics::SystemRequests::UpdateMaterialSelection, - m_shapeConfiguration.GetCurrent(), m_configuration); + Physics::PhysicsMaterialRequestBus::Broadcast( + &Physics::PhysicsMaterialRequestBus::Events::UpdateMaterialSelectionFromPhysicsAsset, + m_shapeConfiguration.GetCurrent(), + m_configuration.m_materialSelection); AzToolsFramework::ToolsApplicationEvents::Bus::Broadcast(&AzToolsFramework::ToolsApplicationEvents::InvalidatePropertyDisplay, AzToolsFramework::Refresh_EntireTree); @@ -805,7 +823,7 @@ namespace PhysX return; } - Physics::ShapeConfigurationList shapeConfigList; + AzPhysics::ShapeColliderPairList shapeConfigList; Utils::GetColliderShapeConfigsFromAsset(physicsAssetConfiguration, m_configuration, m_hasNonUniformScale, m_shapeConfiguration.m_subdivisionLevel, shapeConfigList); @@ -850,7 +868,7 @@ namespace PhysX colliderConfigNoOffset.m_rotation = AZ::Quaternion::CreateIdentity(); colliderConfigNoOffset.m_position = AZ::Vector3::CreateZero(); m_colliderDebugDraw.DrawMesh(debugDisplay, colliderConfigNoOffset, m_scaledPrimitive.value(), - GetWorldTM().GetScale() * m_cachedNonUniformScale, shapeIndex); + GetWorldTM().GetUniformScale() * m_cachedNonUniformScale, shapeIndex); } } @@ -879,7 +897,7 @@ namespace PhysX const Physics::PhysicsAssetShapeConfiguration& physicsAssetConfiguration = m_shapeConfiguration.m_physicsAsset.m_configuration; - Physics::ShapeConfigurationList shapeConfigList; + AzPhysics::ShapeColliderPairList shapeConfigList; Utils::GetColliderShapeConfigsFromAsset(physicsAssetConfiguration, m_configuration, m_hasNonUniformScale, m_shapeConfiguration.m_subdivisionLevel, shapeConfigList); @@ -989,7 +1007,7 @@ namespace PhysX AZ::Vector3 EditorColliderComponent::GetBoxScale() { - return GetWorldTM().GetScale(); + return AZ::Vector3(GetWorldTM().GetUniformScale()); } void EditorColliderComponent::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) @@ -1031,7 +1049,7 @@ namespace PhysX void EditorColliderComponent::UpdateShapeConfigurationScale() { auto& shapeConfiguration = m_shapeConfiguration.GetCurrent(); - shapeConfiguration.m_scale = GetWorldTM().ExtractScale() * m_cachedNonUniformScale; + shapeConfiguration.m_scale = GetWorldTM().ExtractUniformScale() * m_cachedNonUniformScale; m_colliderDebugDraw.ClearCachedGeometry(); } diff --git a/Gems/PhysX/Code/Source/EditorColliderComponent.h b/Gems/PhysX/Code/Source/EditorColliderComponent.h index 1f9c00d4f5..07e1131ea9 100644 --- a/Gems/PhysX/Code/Source/EditorColliderComponent.h +++ b/Gems/PhysX/Code/Source/EditorColliderComponent.h @@ -86,6 +86,8 @@ namespace PhysX Physics::ShapeConfiguration& GetCurrent(); const Physics::ShapeConfiguration& GetCurrent() const; + AZStd::shared_ptr CloneCurrent() const; + bool ShowingSubdivisionLevel() const; AZ::u32 OnConfigurationChanged(); @@ -156,7 +158,6 @@ namespace PhysX AZ::Data::Asset GetMeshAsset() const override; Physics::MaterialId GetMaterialId() const override; void SetMeshAsset(const AZ::Data::AssetId& id) override; - void SetMaterialAsset(const AZ::Data::AssetId& id) override; void SetMaterialId(const Physics::MaterialId& id) override; void UpdateMaterialSlotsFromMeshAsset(); @@ -249,7 +250,7 @@ namespace PhysX DebugDraw::Collider m_colliderDebugDraw; AzPhysics::SystemEvents::OnConfigurationChangedEvent::Handler m_physXConfigChangedHandler; - AzPhysics::SystemEvents::OnDefaultMaterialLibraryChangedEvent::Handler m_onDefaultMaterialLibraryChangedEventHandler; + AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler m_onMaterialLibraryChangedEventHandler; AZ::Transform m_cachedWorldTransform; AZ::NonUniformScaleChangedEvent::Handler m_nonUniformScaleChangedHandler; //!< Responds to changes in non-uniform scale. diff --git a/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp b/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp index efd65181da..f68c4d17d8 100644 --- a/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorRigidBodyComponent.cpp @@ -365,7 +365,7 @@ namespace PhysX } AZ::Transform colliderTransform = GetWorldTM(); - colliderTransform.ExtractScale(); + colliderTransform.ExtractUniformScale(); AzPhysics::RigidBodyConfiguration configuration = m_config; configuration.m_orientation = colliderTransform.GetRotation(); diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp index 82a38a04c2..0cdba94a34 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.cpp @@ -44,11 +44,14 @@ namespace PhysX AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestRefresh, AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); }) - , m_onDefaultMaterialLibraryChangedEventHandler( + , m_onMaterialLibraryChangedEventHandler( [this](const AZ::Data::AssetId& defaultMaterialLibrary) { - m_colliderConfig.m_materialSelection.OnDefaultMaterialLibraryChanged(defaultMaterialLibrary); + m_colliderConfig.m_materialSelection.OnMaterialLibraryChanged(defaultMaterialLibrary); Physics::ColliderComponentEventBus::Event(GetEntityId(), &Physics::ColliderComponentEvents::OnColliderChanged); + + AzToolsFramework::PropertyEditorGUIMessages::Bus::Broadcast(&AzToolsFramework::PropertyEditorGUIMessages::RequestRefresh, + AzToolsFramework::PropertyModificationRefreshLevel::Refresh_AttributesAndValues); }) , m_nonUniformScaleChangedHandler([this](const AZ::Vector3& scale) {OnNonUniformScaleChanged(scale);}) { @@ -205,7 +208,7 @@ namespace PhysX } AZ::Transform transform = GetWorldTM(); - transform.ExtractScale(); + transform.ExtractUniformScale(); const size_t numPoints = m_geometryCache.m_cachedSamplePoints.size(); for (size_t pointIndex = 0; pointIndex < numPoints; ++pointIndex) { @@ -226,7 +229,7 @@ namespace PhysX void EditorShapeColliderComponent::BuildGameEntity(AZ::Entity* gameEntity) { auto* shapeColliderComponent = gameEntity->CreateComponent(); - Physics::ShapeConfigurationList shapeConfigurationList; + AzPhysics::ShapeColliderPairList shapeConfigurationList; shapeConfigurationList.reserve(m_shapeConfigs.size()); for (const auto& shapeConfig : m_shapeConfigs) { @@ -257,11 +260,12 @@ namespace PhysX configuration.m_entityId = GetEntityId(); configuration.m_debugName = GetEntity()->GetName(); - AZStd::vector colliderShapePairs; + AzPhysics::ShapeColliderPairList colliderShapePairs; colliderShapePairs.reserve(m_shapeConfigs.size()); for (const auto& shapeConfig : m_shapeConfigs) { - colliderShapePairs.emplace_back(&m_colliderConfig, shapeConfig.get()); + colliderShapePairs.emplace_back( + AZStd::make_shared(m_colliderConfig), shapeConfig); } configuration.m_colliderAndShapeData = colliderShapePairs; @@ -693,16 +697,16 @@ namespace PhysX { physXSystem->RegisterSystemConfigurationChangedEvent(m_physXConfigChangedHandler); } - if (!m_onDefaultMaterialLibraryChangedEventHandler.IsConnected()) + if (!m_onMaterialLibraryChangedEventHandler.IsConnected()) { - physXSystem->RegisterOnDefaultMaterialLibraryChangedEventHandler(m_onDefaultMaterialLibraryChangedEventHandler); + physXSystem->RegisterOnMaterialLibraryChangedEventHandler(m_onMaterialLibraryChangedEventHandler); } } } void EditorShapeColliderComponent::OnDeselected() { - m_onDefaultMaterialLibraryChangedEventHandler.Disconnect(); + m_onMaterialLibraryChangedEventHandler.Disconnect(); m_physXConfigChangedHandler.Disconnect(); } diff --git a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h index 7b7fab789a..1ee87c9564 100644 --- a/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h +++ b/Gems/PhysX/Code/Source/EditorShapeColliderComponent.h @@ -155,7 +155,7 @@ namespace PhysX mutable GeometryCache m_geometryCache; //!< Cached data for generating sample points inside the attached shape. AzPhysics::SystemEvents::OnConfigurationChangedEvent::Handler m_physXConfigChangedHandler; - AzPhysics::SystemEvents::OnDefaultMaterialLibraryChangedEvent::Handler m_onDefaultMaterialLibraryChangedEventHandler; + AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler m_onMaterialLibraryChangedEventHandler; AZ::Transform m_cachedWorldTransform; AZ::NonUniformScaleChangedEvent::Handler m_nonUniformScaleChangedHandler; //!< Responds to changes in non-uniform scale. AZ::Vector3 m_currentNonUniformScale = AZ::Vector3::CreateOne(); //!< Caches the current non-uniform scale. diff --git a/Gems/PhysX/Code/Source/ForceRegion.cpp b/Gems/PhysX/Code/Source/ForceRegion.cpp index c41ae47a0e..2cdd0dea3f 100644 --- a/Gems/PhysX/Code/Source/ForceRegion.cpp +++ b/Gems/PhysX/Code/Source/ForceRegion.cpp @@ -148,7 +148,7 @@ namespace PhysX { m_worldTransform = world; m_regionParams.m_position = world.GetTranslation(); - m_regionParams.m_scale = world.GetScale(); + m_regionParams.m_scale = world.GetUniformScale(); m_regionParams.m_rotation = world.GetRotation(); AZ::EBusReduceResult triggerAabb; triggerAabb.value = AZ::Aabb::CreateNull(); @@ -223,7 +223,7 @@ namespace PhysX , entityId , &AZ::TransformBus::Events::GetWorldTM); regionParams.m_position = worldTransform.GetTranslation(); - regionParams.m_scale = worldTransform.GetScale(); + regionParams.m_scale = worldTransform.GetUniformScale(); regionParams.m_rotation = worldTransform.GetRotation(); LmbrCentral::SplineComponentRequestBus::EventResult(regionParams.m_spline diff --git a/Gems/PhysX/Code/Source/ForceRegionForces.cpp b/Gems/PhysX/Code/Source/ForceRegionForces.cpp index 8ea74c0de7..61679e9cb4 100644 --- a/Gems/PhysX/Code/Source/ForceRegionForces.cpp +++ b/Gems/PhysX/Code/Source/ForceRegionForces.cpp @@ -294,8 +294,7 @@ namespace PhysX rotateInverse.InvertFull(); } - AZ::Vector3 scaleInverse = region.m_scale; - scaleInverse = scaleInverse.GetReciprocal(); + float scaleInverse = 1.0f / region.m_scale; AZ::Vector3 position = entity.m_position + entity.m_velocity * m_lookAhead; AZ::Vector3 localPos = position - region.m_position; diff --git a/Gems/PhysX/Code/Source/ForceRegionForces.h b/Gems/PhysX/Code/Source/ForceRegionForces.h index 206e35c195..6f7eb6b277 100644 --- a/Gems/PhysX/Code/Source/ForceRegionForces.h +++ b/Gems/PhysX/Code/Source/ForceRegionForces.h @@ -36,7 +36,7 @@ namespace PhysX AZ::EntityId m_id; AZ::Vector3 m_position; AZ::Quaternion m_rotation; - AZ::Vector3 m_scale; + float m_scale; AZ::SplinePtr m_spline; AZ::Aabb m_aabb; }; diff --git a/Gems/PhysX/Code/Source/Material.cpp b/Gems/PhysX/Code/Source/Material.cpp index e8e5cab76e..5e8e3bf759 100644 --- a/Gems/PhysX/Code/Source/Material.cpp +++ b/Gems/PhysX/Code/Source/Material.cpp @@ -15,6 +15,8 @@ #include "Material.h" #include #include +#include +#include namespace PhysX { @@ -22,6 +24,9 @@ namespace PhysX : m_pxMaterial(AZStd::move(material.m_pxMaterial)) , m_surfaceType(material.m_surfaceType) , m_surfaceString(AZStd::move(material.m_surfaceString)) + , m_cryEngineSurfaceId(material.m_cryEngineSurfaceId) + , m_density(material.m_density) + , m_debugColor(AZStd::move(material.m_debugColor)) { m_pxMaterial->userData = this; } @@ -31,6 +36,11 @@ namespace PhysX m_pxMaterial = AZStd::move(material.m_pxMaterial); m_surfaceType = material.m_surfaceType; m_surfaceString = AZStd::move(material.m_surfaceString); + m_cryEngineSurfaceId = material.m_cryEngineSurfaceId; + m_density = material.m_density; + m_debugColor = AZStd::move(material.m_debugColor); + + m_pxMaterial->userData = this; return *this; } @@ -93,8 +103,10 @@ namespace PhysX pxMaterial->userData = this; m_pxMaterial = PxMaterialUniquePtr(pxMaterial, materialDestructor); - m_surfaceType = AZ::Crc32(materialConfiguration.m_surfaceType.c_str()); - m_surfaceString = materialConfiguration.m_surfaceType; + + SetSurfaceTypeName(materialConfiguration.m_surfaceType); + + SetDebugColor(materialConfiguration.m_debugColor); Physics::LegacySurfaceTypeRequestsBus::BroadcastResult( m_cryEngineSurfaceId, @@ -115,8 +127,9 @@ namespace PhysX SetDensity(configuration.m_density); - m_surfaceType = AZ::Crc32(configuration.m_surfaceType.c_str()); - m_surfaceString = configuration.m_surfaceType; + SetSurfaceTypeName(configuration.m_surfaceType); + + SetDebugColor(configuration.m_debugColor); Physics::LegacySurfaceTypeRequestsBus::BroadcastResult( m_cryEngineSurfaceId, @@ -134,9 +147,15 @@ namespace PhysX return m_surfaceType; } - void Material::SetSurfaceType(AZ::Crc32 surfaceType) + const AZStd::string& Material::GetSurfaceTypeName() const { - m_surfaceType = surfaceType; + return m_surfaceString; + } + + void Material::SetSurfaceTypeName(const AZStd::string& surfaceTypeName) + { + m_surfaceString = surfaceTypeName; + m_surfaceType = AZ::Crc32(m_surfaceString.c_str()); } float Material::GetDynamicFriction() const @@ -232,6 +251,16 @@ namespace PhysX MaterialConfiguration::MinDensityLimit, MaterialConfiguration::MaxDensityLimit); } + AZ::Color Material::GetDebugColor() const + { + return m_debugColor; + } + + void Material::SetDebugColor(const AZ::Color& debugColor) + { + m_debugColor = debugColor; + } + AZ::u32 Material::GetCryEngineSurfaceId() const { return m_cryEngineSurfaceId; @@ -243,6 +272,16 @@ namespace PhysX } MaterialsManager::MaterialsManager() + : m_physicsConfigChangedHandler( + [this](const AzPhysics::SystemConfiguration* config) + { + OnPhysicsConfigurationChanged(config); + }) + , m_materialLibraryChangedHandler( + [this](const AZ::Data::AssetId& materialLibraryAssetId) + { + OnMaterialLibraryChanged(materialLibraryAssetId); + }) { } @@ -254,133 +293,152 @@ namespace PhysX { Physics::PhysicsMaterialRequestBus::Handler::BusConnect(); MaterialManagerRequestsBus::Handler::BusConnect(); + + if (auto* physicsSystem = AZ::Interface::Get()) + { + physicsSystem->RegisterSystemConfigurationChangedEvent(m_physicsConfigChangedHandler); + physicsSystem->RegisterOnMaterialLibraryChangedEventHandler(m_materialLibraryChangedHandler); + } } void MaterialsManager::Disconnect() { + m_materialLibraryChangedHandler.Disconnect(); + m_physicsConfigChangedHandler.Disconnect(); MaterialManagerRequestsBus::Handler::BusDisconnect(); Physics::PhysicsMaterialRequestBus::Handler::BusDisconnect(); } void MaterialsManager::GetMaterials(const Physics::MaterialSelection& materialSelection - , AZStd::vector>& outMaterials) + , AZStd::vector>& outMaterials) { outMaterials.clear(); - outMaterials.reserve(materialSelection.GetMaterialIdsAssignedToSlots().size()); - // Ensure PxMaterial instances are initialized if possible. - InitializeMaterials(materialSelection); - - for (const auto& id : materialSelection.GetMaterialIdsAssignedToSlots()) + const auto& materialIdsAssignedToSlots = materialSelection.GetMaterialIdsAssignedToSlots(); + if (materialIdsAssignedToSlots.empty()) { - Physics::MaterialFromAssetConfiguration configuration; - if (materialSelection.GetMaterialConfiguration(configuration, id)) + // The material selection doesn't have any slots, return empty list. + return; + } + + // It is important to return exactly the amount of materials specified in materialSelection + // If a number of materials different to what was cooked is assigned on a physx mesh it will lead to undefined + // behavior and subtle bugs. Unfortunately, there's no warning or assertion on physx side at the shape creation time, + // nor mention of this in the documentation + outMaterials.resize(materialIdsAssignedToSlots.size(), GetDefaultMaterial()); + + for (size_t slotIndex = 0; slotIndex < materialIdsAssignedToSlots.size(); ++slotIndex) + { + const auto& materialId = materialIdsAssignedToSlots[slotIndex]; + + if (auto iterator = FindOrCreateMaterial(materialId); + iterator != m_materials.end()) { - auto iterator = m_materialsFromAssets.find(id.GetUuid()); - if (iterator != m_materialsFromAssets.end()) - { - outMaterials.push_back(iterator->second); - } - else - { - outMaterials.push_back(GetDefaultMaterial()); - } - } - else - { - // It is important to return exactly the amount of materials specified in materialSelection - // If a number of materials different to what was cooked is assigned on a physx mesh it will lead to undefined - // behavior and subtle bugs. Unfortunately, there's no warning or assertion on physx side at the shape creation time, - // nor mention of this in the documentation - outMaterials.push_back(GetDefaultMaterial()); + outMaterials[slotIndex] = iterator->second; } } } - AZStd::weak_ptr MaterialsManager::GetMaterialByName(const AZStd::string& name) + AZStd::shared_ptr MaterialsManager::GetMaterialById(Physics::MaterialId id) { - auto it = AZStd::find_if(m_materialsFromAssets.begin(), m_materialsFromAssets.end(), - [&name](const AZStd::pair>& elem) - { - return elem.second.get()->GetSurfaceTypeName() == name; - }); - - if (it != m_materialsFromAssets.end()) + if (auto it = FindOrCreateMaterial(id); + it != m_materials.end()) { return it->second; } - return {}; + return nullptr; } - AZ::u32 MaterialsManager::GetFirstSelectedMaterialIndex(const Physics::MaterialSelection& materialSelection) + AZStd::shared_ptr MaterialsManager::GetMaterialByName(const AZStd::string& name) { - const AZ::u32 defaultMaterialIndex = 0; - - if (!materialSelection.IsMaterialLibraryValid()) + if (auto it = FindOrCreateMaterial(name); + it != m_materials.end()) { - return defaultMaterialIndex; + return it->second; } - - auto materialAsset = AZ::Data::AssetManager::Instance().GetAsset(materialSelection.GetMaterialLibraryAssetId(), AZ::Data::AssetLoadBehavior::Default); - - materialAsset.BlockUntilLoadComplete(); - - AZStd::vector materialList = materialAsset.Get()->GetMaterialsData(); - - const AZStd::vector& selectedMaterials = materialSelection.GetMaterialIdsAssignedToSlots(); - if (selectedMaterials.size() == 0) - { - return defaultMaterialIndex; - } - for (AZ::u32 i=0; i < materialList.size(); ++i) - { - if (materialList[i].m_id == selectedMaterials[0]) - { - return i + 1; // Index 0 is reserved for Default material. - } - } - - return defaultMaterialIndex; + return nullptr; } void MaterialsManager::GetPxMaterials(const Physics::MaterialSelection& materialSelection , AZStd::vector& outMaterials) { - outMaterials.clear(); - if (materialSelection.GetMaterialIdsAssignedToSlots().empty()) + AZStd::vector> materials; + GetMaterials(materialSelection, materials); + + outMaterials.reserve(materials.size()); + for (const auto& material : materials) + { + PhysX::Material* physxMaterial = azrtti_cast(material.get()); + AZ_Assert(physxMaterial, "Invalid physx material"); + + outMaterials.emplace_back(physxMaterial->GetPxMaterial()); + } + } + + void MaterialsManager::UpdateMaterialSelectionFromPhysicsAsset( + const Physics::ShapeConfiguration& shapeConfiguration, + Physics::MaterialSelection& materialSelection) + { + if (shapeConfiguration.GetShapeType() != Physics::ShapeType::PhysicsAsset) { - // if the materialSelection is invalid we still - // return a default material as a fallback behavior - outMaterials.push_back(GetDefaultMaterial()->GetPxMaterial()); return; } - outMaterials.reserve(materialSelection.GetMaterialIdsAssignedToSlots().size()); - // Ensure PxMaterial instances are initialized if possible. - InitializeMaterials(materialSelection); + const Physics::PhysicsAssetShapeConfiguration& assetConfiguration = + static_cast(shapeConfiguration); - for (const auto& id : materialSelection.GetMaterialIdsAssignedToSlots()) + if (!assetConfiguration.m_asset.GetId().IsValid()) { - Physics::MaterialFromAssetConfiguration configuration; - if (materialSelection.GetMaterialConfiguration(configuration, id)) + // Set the default selection if there's no physics asset. + materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); + return; + } + + if (!assetConfiguration.m_asset.IsReady()) + { + // The asset is valid but is still loading, + // Do not set the empty slots in this case to avoid the entity being in invalid state + return; + } + + Pipeline::MeshAsset* meshAsset = assetConfiguration.m_asset.GetAs(); + if (!meshAsset) + { + materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); + AZ_Warning("PhysX", false, "UpdateMaterialSelectionFromPhysicsAsset: MeshAsset is invalid"); + return; + } + + // Set the slots from the mesh asset + materialSelection.SetMaterialSlots(meshAsset->m_assetData.m_surfaceNames); + + if (!assetConfiguration.m_useMaterialsFromAsset) + { + // Not using the materials from the asset. Nothing else to do. + return; + } + + // Update material IDs in the selection for each slot + const AZStd::vector& meshMaterialNames = meshAsset->m_assetData.m_materialNames; + for (size_t slotIndex = 0; slotIndex < meshMaterialNames.size(); ++slotIndex) + { + const AZStd::string& physicsMaterialNameFromPhysicsAsset = meshMaterialNames[slotIndex]; + if (physicsMaterialNameFromPhysicsAsset == DefaultPhysicsMaterialNameFromPhysicsAsset) { - auto iterator = m_materialsFromAssets.find(id.GetUuid()); - if (iterator != m_materialsFromAssets.end()) - { - outMaterials.push_back(iterator->second->GetPxMaterial()); - } - else - { - outMaterials.push_back(GetDefaultMaterial()->GetPxMaterial()); - } + continue; + } + + if (auto it = FindOrCreateMaterial(physicsMaterialNameFromPhysicsAsset); + it != m_materials.end()) + { + materialSelection.SetMaterialId(Physics::MaterialId::FromUUID(it->first), slotIndex); } else { - // It is important to return exactly the amount of materials specified in materialSelection - // If a number of materials different to what was cooked is assigned on a physx mesh it will lead to undefined - // behavior and subtle bugs. Unfortunately, there's no warning or assertion on physx side at the shape creation time, - // nor mention of this in the documentation - outMaterials.push_back(GetDefaultMaterial()->GetPxMaterial()); + AZ_Warning("PhysX", false, + "UpdateMaterialSelectionFromPhysicsAsset: Physics material '%s' not found in the material library. Mesh surface '%s' will use the default material.", + physicsMaterialNameFromPhysicsAsset.c_str(), + meshAsset->m_assetData.m_surfaceNames[slotIndex].c_str()); } } } @@ -390,11 +448,21 @@ namespace PhysX return GetDefaultMaterial(); } - const AZStd::shared_ptr& MaterialsManager::GetDefaultMaterial() + AZStd::shared_ptr MaterialsManager::GetDefaultMaterial() { if (!m_defaultMaterial) { - m_defaultMaterial = AZStd::make_shared(Physics::MaterialConfiguration()); + // Get default material from physics configuration + if (auto* physicsSystem = AZ::Interface::Get()) + { + m_defaultMaterialConfiguration = physicsSystem->GetConfiguration()->m_defaultMaterialConfiguration; + } + else + { + AZ_Warning("MaterialsManager", false, "Unable to get Physics System, default material will not be in sync with PhysX Configuration"); + } + + m_defaultMaterial = AZStd::make_shared(m_defaultMaterialConfiguration); } return m_defaultMaterial; @@ -403,38 +471,138 @@ namespace PhysX void MaterialsManager::ReleaseAllMaterials() { m_defaultMaterial = nullptr; - m_materialsFromAssets.clear(); + m_materials.clear(); Physics::PhysicsMaterialNotificationsBus::Broadcast(&Physics::PhysicsMaterialNotificationsBus::Events::MaterialsReleased); } - void MaterialsManager::InitializeMaterials(const Physics::MaterialSelection& materialSelection) + MaterialsManager::Materials::iterator MaterialsManager::FindOrCreateMaterial(Physics::MaterialId materialId) { - const AZStd::vector& materialIds = materialSelection.GetMaterialIdsAssignedToSlots(); - for (const auto& id : materialIds) + if (materialId.IsNull()) { - Physics::MaterialFromAssetConfiguration configuration; - if (!materialSelection.GetMaterialConfiguration(configuration, id)) - { - continue; // Default material skips code below. - } - - auto materialId = configuration.m_id; + return m_materials.end(); + } + if (auto it = m_materials.find(materialId.GetUuid()); + it != m_materials.end()) + { + return it; + } + else + { + auto* materialLibrary = GetMaterialLibrary(); + if (!materialLibrary) + { + return m_materials.end(); + } + + Physics::MaterialFromAssetConfiguration configuration; + if (!materialLibrary->GetDataForMaterialId(materialId, configuration)) + { + return m_materials.end(); + } + + auto newMaterial = AZStd::make_shared(configuration.m_configuration); + auto insertedPair = m_materials.emplace(materialId.GetUuid(), AZStd::move(newMaterial)); + return insertedPair.first; + } + } + + MaterialsManager::Materials::iterator MaterialsManager::FindOrCreateMaterial(const AZStd::string& materialName) + { + if (materialName.empty()) + { + return m_materials.end(); + } + + auto it = AZStd::find_if(m_materials.begin(), m_materials.end(), [&materialName](const auto& data) + { + return data.second->GetSurfaceTypeName() == materialName; + }); + if (it != m_materials.end()) + { + return it; + } + else + { + auto* materialLibrary = GetMaterialLibrary(); + if (!materialLibrary) + { + return m_materials.end(); + } + + Physics::MaterialFromAssetConfiguration configuration; + if (!materialLibrary->GetDataForMaterialName(materialName, configuration)) + { + return m_materials.end(); + } + + auto newMaterial = AZStd::make_shared(configuration.m_configuration); + auto insertedPair = m_materials.emplace(configuration.m_id.GetUuid(), AZStd::move(newMaterial)); + return insertedPair.first; + } + } + + Physics::MaterialLibraryAsset* MaterialsManager::GetMaterialLibrary() + { + if (auto* physicsSystem = AZ::Interface::Get()) + { + if (const auto* physicsConfiguration = physicsSystem->GetConfiguration()) + { + return physicsConfiguration->m_materialLibraryAsset.Get(); + } + } + return nullptr; + } + + void MaterialsManager::OnPhysicsConfigurationChanged(const AzPhysics::SystemConfiguration* config) + { + if (m_defaultMaterial && + m_defaultMaterialConfiguration != config->m_defaultMaterialConfiguration) + { + m_defaultMaterialConfiguration = config->m_defaultMaterialConfiguration; + + m_defaultMaterial->UpdateWithConfiguration(m_defaultMaterialConfiguration); + } + } + + void MaterialsManager::OnMaterialLibraryChanged([[maybe_unused]] const AZ::Data::AssetId& materialLibraryAssetId) + { + auto* materialLibrary = GetMaterialLibrary(); + if (!materialLibrary) + { + AZ_Warning("PhysX", false, "MaterialsManager: invalid material library"); + return; + } + + AZStd::vector materialsToRemove; + + for (auto& idMaterialPair : m_materials) + { + const Physics::MaterialId materialId = Physics::MaterialId::FromUUID(idMaterialPair.first); + + // Remove null materials if (materialId.IsNull()) { - materialId = Physics::MaterialId::Create(); + materialsToRemove.push_back(materialId.GetUuid()); + continue; } - auto iterator = m_materialsFromAssets.find(materialId.GetUuid()); - if (iterator != m_materialsFromAssets.end()) + Physics::MaterialFromAssetConfiguration configuration; + if (materialLibrary->GetDataForMaterialId(materialId, configuration)) { - iterator->second->UpdateWithConfiguration(configuration.m_configuration); + // Update materials found in the library. + idMaterialPair.second->UpdateWithConfiguration(configuration.m_configuration); } else { - auto newMaterial = AZStd::make_shared(configuration.m_configuration); - m_materialsFromAssets.emplace(materialId.GetUuid(), newMaterial); + // Add for removal the materials not present in the library anymore. + materialsToRemove.push_back(materialId.GetUuid()); } } + + for (const auto& id : materialsToRemove) + { + m_materials.erase(id); + } } } diff --git a/Gems/PhysX/Code/Source/Material.h b/Gems/PhysX/Code/Source/Material.h index a44c9766fc..1541d156d8 100644 --- a/Gems/PhysX/Code/Source/Material.h +++ b/Gems/PhysX/Code/Source/Material.h @@ -15,11 +15,18 @@ #include #include #include -#include +#include +#include #include namespace PhysX { + /// Name used by physx asset exporter to indicate that the default + /// physics material should be used for a mesh surface. The exporter + /// will use it as the fallback option when it's not possible to obtain + /// the surface information from the mesh material. + static const char* const DefaultPhysicsMaterialNameFromPhysicsAsset = ""; + /// PhysX implementation of Physics::Material interface /// =================================================== /// @@ -58,9 +65,9 @@ namespace PhysX // Physics::Material AZ::Crc32 GetSurfaceType() const override; - void SetSurfaceType(AZ::Crc32 surfaceType) override; - const AZStd::string& GetSurfaceTypeName() const override { return m_surfaceString; } + const AZStd::string& GetSurfaceTypeName() const override; + void SetSurfaceTypeName(const AZStd::string& surfaceTypeName) override; float GetDynamicFriction() const override; void SetDynamicFriction(float dynamicFriction) override; @@ -80,6 +87,9 @@ namespace PhysX float GetDensity() const override; void SetDensity(float density) override; + AZ::Color GetDebugColor() const override; + void SetDebugColor(const AZ::Color& debugColor) override; + AZ::u32 GetCryEngineSurfaceId() const override; void* GetNativePointer() override; @@ -92,6 +102,7 @@ namespace PhysX AZ::u32 m_cryEngineSurfaceId = -1; AZStd::string m_surfaceString; float m_density = 1000.0f; + AZ::Color m_debugColor = AZ::Colors::White; }; /// Bus with requests to MaterialsManager @@ -108,9 +119,17 @@ namespace PhysX static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single; static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single; + /// Returns weak pointers to physx::PxMaterial. + /// Equivalent to PhysicsMaterialRequests::GetMaterials but it returns physx::PxMaterial pointers instead. + /// @param materialSelection MaterialSelection instance to create or get materials for + /// @param outMaterials vector of pointers to physx::PxMaterial to fill with. The vector will be cleared inside the function. virtual void GetPxMaterials(const Physics::MaterialSelection& materialSelection, AZStd::vector& outMaterials) = 0; - virtual const AZStd::shared_ptr& GetDefaultMaterial() = 0; + /// Returns default material + /// @return default PhysX::Material instance + virtual AZStd::shared_ptr GetDefaultMaterial() = 0; + + /// Releases ownership of all materials created before. virtual void ReleaseAllMaterials() = 0; }; using MaterialManagerRequestsBus = AZ::EBus; @@ -120,6 +139,9 @@ namespace PhysX /// /// Material managers creates PhysX::Material instances from MaterialLibraryAsset and assumes their ownership. /// Also keeps a reference to the default material. + /// + /// Note: Materials will be created on the fly while doing queries and + /// they will be updated when the material library changes. class MaterialsManager : public MaterialManagerRequestsBus::Handler , public Physics::PhysicsMaterialRequestBus::Handler @@ -131,35 +153,19 @@ namespace PhysX MaterialsManager(); ~MaterialsManager() override; - /// Returns a vector of weak pointers to materials selected. - /// To be notified if the pointers are deleted, connect to PhysicsMaterialNotifications::MaterialsReleased(). - /// @param materialSelection MaterialSelection instance to create or get materials for. - /// @param outMaterials Collection of material weak pointers corresponding to the material selection to be returned. + // PhysicsMaterialRequestBus::Handler overrides... void GetMaterials(const Physics::MaterialSelection& materialSelection - , AZStd::vector>& outMaterials) override; - - /// Returns a weak pointer to physics material with the given name. - AZStd::weak_ptr GetMaterialByName(const AZStd::string& name) override; - - /// Returns index of selected material in its material library. 0 is the Default material. - /// @param materialSelection Selection of materials. - AZ::u32 GetFirstSelectedMaterialIndex(const Physics::MaterialSelection& materialSelection) override; - - /// Slightly faster version of GetMaterials that returns physx::PxMaterial pointers instead. \n - /// The rest is equivalent to GetMaterials function. - /// @param materialSelection MaterialSelection instance to create or get materials for - /// @param outMaterials vector of pointers to physx::PxMaterial to fill with. The vector will be cleared inside the function. - void GetPxMaterials(const Physics::MaterialSelection& materialSelection, AZStd::vector& outMaterials) override; - - /// Returns default material - /// @return default PhysX::Material instance - const AZStd::shared_ptr& GetDefaultMaterial() override; - - /// Return default material - /// @return default Physics::Material instance + , AZStd::vector>& outMaterials) override; + AZStd::shared_ptr GetMaterialById(Physics::MaterialId id) override; + AZStd::shared_ptr GetMaterialByName(const AZStd::string& name) override; + void UpdateMaterialSelectionFromPhysicsAsset( + const Physics::ShapeConfiguration& shapeConfiguration, + Physics::MaterialSelection& materialSelection) override; AZStd::shared_ptr GetGenericDefaultMaterial() override; - /// Releases ownership of all materials created before. + // MaterialManagerRequestsBus::Handler overrides... + void GetPxMaterials(const Physics::MaterialSelection& materialSelection, AZStd::vector& outMaterials) override; + AZStd::shared_ptr GetDefaultMaterial() override; void ReleaseAllMaterials() override; /// Connect to any necessary buses @@ -169,9 +175,31 @@ namespace PhysX void Disconnect(); private: - void InitializeMaterials(const Physics::MaterialSelection& materialSelection); + using Materials = AZStd::unordered_map>; - AZStd::unordered_map> m_materialsFromAssets; + /// Search a material by id, if it exists already it returns its iterator, + /// if it doesn't exist it tries to create it and add it to the list. + /// If the material id is null or not part of the material library then the + /// iterator returned is end of material list. + Materials::iterator FindOrCreateMaterial(Physics::MaterialId materialId); + + /// Search a material by name, if it exists already it returns its iterator, + /// if it doesn't exist it tries to create it and add it to the list. + /// If the material id is null or not part of the material library then the + /// iterator returned is end of material list. + Materials::iterator FindOrCreateMaterial(const AZStd::string& materialName); + + /// Returns the material library of the project. + Physics::MaterialLibraryAsset* GetMaterialLibrary(); + + void OnPhysicsConfigurationChanged(const AzPhysics::SystemConfiguration* config); + void OnMaterialLibraryChanged(const AZ::Data::AssetId& materialLibraryAssetId); + + Materials m_materials; AZStd::shared_ptr m_defaultMaterial; + Physics::MaterialConfiguration m_defaultMaterialConfiguration; + + AzPhysics::SystemEvents::OnConfigurationChangedEvent::Handler m_physicsConfigChangedHandler; + AzPhysics::SystemEvents::OnMaterialLibraryChangedEvent::Handler m_materialLibraryChangedHandler; }; } diff --git a/Gems/PhysX/Code/Source/MeshColliderComponent.cpp b/Gems/PhysX/Code/Source/MeshColliderComponent.cpp index d383ba97de..1c6fdca640 100644 --- a/Gems/PhysX/Code/Source/MeshColliderComponent.cpp +++ b/Gems/PhysX/Code/Source/MeshColliderComponent.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include @@ -85,11 +85,6 @@ namespace PhysX UpdateMeshAsset(); } - void MeshColliderComponent::SetMaterialAsset(const AZ::Data::AssetId& id) - { - m_colliderConfiguration->m_materialSelection.SetMaterialLibrary(id); - } - void MeshColliderComponent::SetMaterialId(const Physics::MaterialId& id) { m_colliderConfiguration->m_materialSelection.SetMaterialId(id); @@ -111,8 +106,10 @@ namespace PhysX { m_shapeConfiguration->m_asset = asset; - Physics::SystemRequestBus::Broadcast(&Physics::SystemRequests::UpdateMaterialSelection, - *m_shapeConfiguration, *m_colliderConfiguration); + Physics::PhysicsMaterialRequestBus::Broadcast( + &Physics::PhysicsMaterialRequestBus::Events::UpdateMaterialSelectionFromPhysicsAsset, + *m_shapeConfiguration, + m_colliderConfiguration->m_materialSelection); } } @@ -122,8 +119,10 @@ namespace PhysX { m_shapeConfiguration->m_asset = asset; - Physics::SystemRequestBus::Broadcast(&Physics::SystemRequests::UpdateMaterialSelection, - *m_shapeConfiguration, *m_colliderConfiguration); + Physics::PhysicsMaterialRequestBus::Broadcast( + &Physics::PhysicsMaterialRequestBus::Events::UpdateMaterialSelectionFromPhysicsAsset, + *m_shapeConfiguration, + m_colliderConfiguration->m_materialSelection); } } diff --git a/Gems/PhysX/Code/Source/MeshColliderComponent.h b/Gems/PhysX/Code/Source/MeshColliderComponent.h index 4014f7ab5a..9d781fd6eb 100644 --- a/Gems/PhysX/Code/Source/MeshColliderComponent.h +++ b/Gems/PhysX/Code/Source/MeshColliderComponent.h @@ -40,7 +40,6 @@ namespace PhysX AZ::Data::Asset GetMeshAsset() const override; Physics::MaterialId GetMaterialId() const override; void SetMeshAsset(const AZ::Data::AssetId& id) override; - void SetMaterialAsset(const AZ::Data::AssetId& id) override; void SetMaterialId(const Physics::MaterialId& id) override; // BaseColliderComponent diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp index d1502a0c65..87e3304a90 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/CharacterUtils.cpp @@ -15,9 +15,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include @@ -51,18 +49,32 @@ namespace PhysX static void AppendShapeIndependentProperties(physx::PxControllerDesc& controllerDesc, const Physics::CharacterConfiguration& characterConfig, CharacterControllerCallbackManager* callbackManager) { - AZStd::vector > materials; + AZStd::vector> materials; - Physics::SystemRequestBus::BroadcastResult( - materials, - &Physics::SystemRequests::CreateMaterialsFromLibrary, - characterConfig.m_materialSelection - ); - - if (materials.empty()) + if (characterConfig.m_materialSelection.GetMaterialIdsAssignedToSlots().empty()) { - AZ_Error("PhysX Character Controller", false, "Could not create character controller, material was invalid."); - return; + // If material selection has no slots, falling back to default material. + AZStd::shared_ptr defaultMaterial; + Physics::PhysicsMaterialRequestBus::BroadcastResult(defaultMaterial, + &Physics::PhysicsMaterialRequestBus::Events::GetGenericDefaultMaterial); + if (!defaultMaterial) + { + AZ_Error("PhysX Character Controller", false, "Invalid default material."); + return; + } + materials.push_back(AZStd::move(defaultMaterial)); + } + else + { + Physics::PhysicsMaterialRequestBus::Broadcast( + &Physics::PhysicsMaterialRequestBus::Events::GetMaterials, + characterConfig.m_materialSelection, + materials); + if (materials.empty()) + { + AZ_Error("PhysX Character Controller", false, "Could not create character controller, material list was empty."); + return; + } } physx::PxMaterial* pxMaterial = static_cast(materials.front()->GetNativePointer()); diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.cpp index 5249781e31..02ebe7281c 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.cpp @@ -274,7 +274,7 @@ namespace PhysX m_queuedDisableSimulation = true; } - bool Ragdoll::IsSimulated() + bool Ragdoll::IsSimulated() const { return m_simulating; } diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.h b/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.h index 7bf807bcc5..7182a3a44c 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.h +++ b/Gems/PhysX/Code/Source/PhysXCharacters/API/Ragdoll.h @@ -46,7 +46,7 @@ namespace PhysX void EnableSimulationQueued(const Physics::RagdollState& initialState) override; void DisableSimulation() override; void DisableSimulationQueued() override; - bool IsSimulated() override; + bool IsSimulated() const override; void GetState(Physics::RagdollState& ragdollState) const override; void SetState(const Physics::RagdollState& ragdollState) override; void SetStateQueued(const Physics::RagdollState& ragdollState) override; diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.cpp index 473e9534cb..86c60565a0 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.cpp @@ -73,7 +73,10 @@ namespace PhysX { } - CharacterControllerComponent::~CharacterControllerComponent() = default; + CharacterControllerComponent::~CharacterControllerComponent() + { + DisableController(); + } // AZ::Component void CharacterControllerComponent::Init() @@ -92,7 +95,7 @@ namespace PhysX void CharacterControllerComponent::Deactivate() { - DestroyController(); + DisableController(); Physics::CollisionFilteringRequestBus::Handler::BusDisconnect(); AzPhysics::SimulatedBodyComponentRequestsBus::Handler::BusDisconnect(); @@ -102,39 +105,55 @@ namespace PhysX AZ::Vector3 CharacterControllerComponent::GetBasePosition() const { - return IsPhysicsEnabled() ? m_controller->GetBasePosition() : AZ::Vector3::CreateZero(); + if (auto* controller = GetControllerConst()) + { + return controller->GetBasePosition(); + } + return AZ::Vector3::CreateZero(); } void CharacterControllerComponent::SetBasePosition(const AZ::Vector3& position) { - if (IsPhysicsEnabled()) + if (auto* controller = GetController()) { - m_controller->SetBasePosition(position); + controller->SetBasePosition(position); AZ::TransformBus::Event(GetEntityId(), &AZ::TransformBus::Events::SetWorldTranslation, position); } } AZ::Vector3 CharacterControllerComponent::GetCenterPosition() const { - return IsPhysicsEnabled() ? m_controller->GetCenterPosition() : AZ::Vector3::CreateZero(); + if (auto* controller = GetControllerConst()) + { + return controller->GetCenterPosition(); + } + return AZ::Vector3::CreateZero(); } float CharacterControllerComponent::GetStepHeight() const { - return IsPhysicsEnabled() ? m_controller->GetStepHeight() : 0.0f; + if (auto* controller = GetControllerConst()) + { + return controller->GetStepHeight(); + } + return 0.0f; } void CharacterControllerComponent::SetStepHeight(float stepHeight) { - if (IsPhysicsEnabled()) + if (auto* controller = GetController()) { - m_controller->SetStepHeight(stepHeight); + controller->SetStepHeight(stepHeight); } } AZ::Vector3 CharacterControllerComponent::GetUpDirection() const { - return IsPhysicsEnabled() ? m_controller->GetUpDirection() : AZ::Vector3::CreateZero(); + if (auto* controller = GetControllerConst()) + { + return controller->GetUpDirection(); + } + return AZ::Vector3::CreateZero(); } void CharacterControllerComponent::SetUpDirection([[maybe_unused]] const AZ::Vector3& upDirection) @@ -144,51 +163,58 @@ namespace PhysX float CharacterControllerComponent::GetSlopeLimitDegrees() const { - return IsPhysicsEnabled() ? m_controller->GetSlopeLimitDegrees() : 0.0f; + if (auto* controller = GetControllerConst()) + { + return controller->GetSlopeLimitDegrees(); + } + return 0.0f; } void CharacterControllerComponent::SetSlopeLimitDegrees(float slopeLimitDegrees) { - if (IsPhysicsEnabled()) + if (auto* controller = GetController()) { - m_controller->SetSlopeLimitDegrees(slopeLimitDegrees); + controller->SetSlopeLimitDegrees(slopeLimitDegrees); } } float CharacterControllerComponent::GetMaximumSpeed() const { - if (IsPhysicsEnabled()) + if (auto* controller = GetControllerConst()) { - return m_controller->GetMaximumSpeed(); + return controller->GetMaximumSpeed(); } - return 0.0f; } void CharacterControllerComponent::SetMaximumSpeed(float maximumSpeed) { - if (IsPhysicsEnabled()) + if (auto* controller = GetController()) { - m_controller->SetMaximumSpeed(maximumSpeed); + controller->SetMaximumSpeed(maximumSpeed); } } AZ::Vector3 CharacterControllerComponent::GetVelocity() const { - return IsPhysicsEnabled() ? m_controller->GetVelocity() : AZ::Vector3::CreateZero(); + if (auto* controller = GetControllerConst()) + { + return controller->GetVelocity(); + } + return AZ::Vector3::CreateZero(); } void CharacterControllerComponent::AddVelocity(const AZ::Vector3& velocity) { - if (IsPhysicsEnabled()) + if (auto* controller = GetController()) { - m_controller->AddVelocity(velocity); + controller->AddVelocity(velocity); } } Physics::Character* CharacterControllerComponent::GetCharacter() { - return m_controller; + return GetController(); } void CharacterControllerComponent::EnablePhysics() @@ -198,19 +224,19 @@ namespace PhysX void CharacterControllerComponent::DisablePhysics() { - DestroyController(); + DisableController(); } bool CharacterControllerComponent::IsPhysicsEnabled() const { - return m_controller != nullptr; + return GetControllerConst() != nullptr; } AZ::Aabb CharacterControllerComponent::GetAabb() const { - if (m_controller) + if (auto* controller = GetControllerConst()) { - return m_controller->GetAabb(); + return controller->GetAabb(); } return AZ::Aabb::CreateNull(); } @@ -222,94 +248,121 @@ namespace PhysX AzPhysics::SimulatedBodyHandle CharacterControllerComponent::GetSimulatedBodyHandle() const { - if (m_controller) - { - return m_controller->m_bodyHandle; - } - return AzPhysics::InvalidSimulatedBodyHandle; + return m_controllerBodyHandle; } AzPhysics::SceneQueryHit CharacterControllerComponent::RayCast(const AzPhysics::RayCastRequest& request) { - if (m_controller) + if (auto* controller = GetController()) { - return m_controller->RayCast(request); + return controller->RayCast(request); } + return AzPhysics::SceneQueryHit(); } // CharacterControllerRequestBus void CharacterControllerComponent::Resize(float height) { - return m_controller->Resize(height); + if (auto* controller = GetController()) + { + controller->Resize(height); + } } float CharacterControllerComponent::GetHeight() { - return m_controller->GetHeight(); + if (auto* controller = GetController()) + { + return controller->GetHeight(); + } + return 0.0f; } void CharacterControllerComponent::SetHeight(float height) { - return m_controller->SetHeight(height); + if (auto* controller = GetController()) + { + controller->SetHeight(height); + } } float CharacterControllerComponent::GetRadius() { - return m_controller->GetRadius(); + if (auto* controller = GetController()) + { + return controller->GetRadius(); + } + return 0.0f; } void CharacterControllerComponent::SetRadius(float radius) { - return m_controller->SetRadius(radius); + if (auto* controller = GetController()) + { + controller->SetRadius(radius); + } } float CharacterControllerComponent::GetHalfSideExtent() { - return m_controller->GetHalfSideExtent(); + if (auto* controller = GetController()) + { + return controller->GetHalfSideExtent(); + } + return 0.0f; } void CharacterControllerComponent::SetHalfSideExtent(float halfSideExtent) { - return m_controller->SetHalfSideExtent(halfSideExtent); + if (auto* controller = GetController()) + { + controller->SetHalfSideExtent(halfSideExtent); + } } float CharacterControllerComponent::GetHalfForwardExtent() { - return m_controller->GetHalfForwardExtent(); + if (auto* controller = GetController()) + { + return controller->GetHalfForwardExtent(); + } + return 0.0f; } void CharacterControllerComponent::SetHalfForwardExtent(float halfForwardExtent) { - return m_controller->SetHalfForwardExtent(halfForwardExtent); + if (auto* controller = GetController()) + { + controller->SetHalfForwardExtent(halfForwardExtent); + } } // TransformNotificationBus void CharacterControllerComponent::OnTransformChanged(const AZ::Transform& /*local*/, const AZ::Transform& world) { - if (!IsPhysicsEnabled()) + if (auto* controller = GetController()) { - return; + controller->SetBasePosition(world.GetTranslation()); } - - m_controller->SetBasePosition(world.GetTranslation()); } void CharacterControllerComponent::SetCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag) { - if (!IsPhysicsEnabled()) + auto* controller = GetController(); + if (controller == nullptr) { return; } - if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag)) + if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag)) { bool success = false; AzPhysics::CollisionLayer collisionLayer; Physics::CollisionRequestBus::BroadcastResult(success, &Physics::CollisionRequests::TryGetCollisionLayerByName, layerName, collisionLayer); if (success) { - m_controller->SetCollisionLayer(collisionLayer); + controller->SetCollisionLayer(collisionLayer); } } } @@ -317,30 +370,33 @@ namespace PhysX AZStd::string CharacterControllerComponent::GetCollisionLayerName() { AZStd::string layerName; - if (!IsPhysicsEnabled()) + auto* controller = GetControllerConst(); + if (controller == nullptr) { return layerName; } - Physics::CollisionRequestBus::BroadcastResult(layerName, &Physics::CollisionRequests::GetCollisionLayerName, m_controller->GetCollisionLayer()); + Physics::CollisionRequestBus::BroadcastResult( + layerName, &Physics::CollisionRequests::GetCollisionLayerName, controller->GetCollisionLayer()); return layerName; } void CharacterControllerComponent::SetCollisionGroup(const AZStd::string& groupName, AZ::Crc32 colliderTag) { - if (!IsPhysicsEnabled()) + auto* controller = GetController(); + if (controller == nullptr) { return; } - if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag)) + if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag)) { bool success = false; AzPhysics::CollisionGroup collisionGroup; Physics::CollisionRequestBus::BroadcastResult(success, &Physics::CollisionRequests::TryGetCollisionGroupByName, groupName, collisionGroup); if (success) { - m_controller->SetCollisionGroup(collisionGroup); + controller->SetCollisionGroup(collisionGroup); } } } @@ -348,23 +404,26 @@ namespace PhysX AZStd::string CharacterControllerComponent::GetCollisionGroupName() { AZStd::string groupName; - if (!IsPhysicsEnabled()) + auto* controller = GetControllerConst(); + if (controller == nullptr) { return groupName; } - - Physics::CollisionRequestBus::BroadcastResult(groupName, &Physics::CollisionRequests::GetCollisionGroupName, m_controller->GetCollisionGroup()); + + Physics::CollisionRequestBus::BroadcastResult( + groupName, &Physics::CollisionRequests::GetCollisionGroupName, controller->GetCollisionGroup()); return groupName; } void CharacterControllerComponent::ToggleCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag, bool enabled) { - if (!IsPhysicsEnabled()) + auto* controller = GetController(); + if (controller == nullptr) { return; } - if (Physics::Utils::FilterTag(m_controller->GetColliderTag(), colliderTag)) + if (Physics::Utils::FilterTag(controller->GetColliderTag(), colliderTag)) { bool success = false; AzPhysics::CollisionLayer collisionLayer; @@ -372,23 +431,43 @@ namespace PhysX if (success) { AzPhysics::CollisionLayer layer(layerName); - AzPhysics::CollisionGroup group = m_controller->GetCollisionGroup(); + AzPhysics::CollisionGroup group = controller->GetCollisionGroup(); group.SetLayer(layer, enabled); - m_controller->SetCollisionGroup(group); + controller->SetCollisionGroup(group); } } } void CharacterControllerComponent::OnPreSimulate(float deltaTime) { - if (m_controller) + if (auto* controller = GetController()) { - m_controller->ApplyRequestedVelocity(deltaTime); - const AZ::Vector3 newPosition = GetBasePosition(); + controller->ApplyRequestedVelocity(deltaTime); + const AZ::Vector3 newPosition = controller->GetBasePosition(); AZ::TransformBus::Event(GetEntityId(), &AZ::TransformBus::Events::SetWorldTranslation, newPosition); } } + const PhysX::CharacterController* CharacterControllerComponent::GetControllerConst() const + { + if (m_controllerBodyHandle == AzPhysics::InvalidSimulatedBodyHandle || m_attachedSceneHandle == AzPhysics::InvalidSceneHandle) + { + return nullptr; + } + + if (auto* sceneInterface = AZ::Interface::Get()) + { + return azdynamic_cast( + sceneInterface->GetSimulatedBodyFromHandle(m_attachedSceneHandle, m_controllerBodyHandle)); + } + return nullptr; + } + + PhysX::CharacterController* CharacterControllerComponent::GetController() + { + return const_cast(static_cast(*this).GetControllerConst()); + } + void CharacterControllerComponent::CreateController() { if (IsPhysicsEnabled()) @@ -396,9 +475,8 @@ namespace PhysX return; } - AzPhysics::SceneHandle defaultSceneHandle = AzPhysics::InvalidSceneHandle; - Physics::DefaultWorldBus::BroadcastResult(defaultSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle); - if (defaultSceneHandle == AzPhysics::InvalidSceneHandle) + Physics::DefaultWorldBus::BroadcastResult(m_attachedSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle); + if (m_attachedSceneHandle == AzPhysics::InvalidSceneHandle) { AZ_Error("PhysX Character Controller Component", false, "Failed to retrieve default scene."); return; @@ -421,17 +499,30 @@ namespace PhysX AZ::TransformBus::EventResult(entityTranslation, GetEntityId(), &AZ::TransformBus::Events::GetWorldTranslation); m_characterConfig->m_position = entityTranslation; - if (auto* sceneInterface = AZ::Interface::Get()) + auto* sceneInterface = AZ::Interface::Get(); + if (sceneInterface != nullptr) { - AzPhysics::SimulatedBodyHandle bodyHandle = sceneInterface->AddSimulatedBody(defaultSceneHandle, m_characterConfig.get()); - m_controller = azdynamic_cast(sceneInterface->GetSimulatedBodyFromHandle(defaultSceneHandle, bodyHandle)); + m_controllerBodyHandle = sceneInterface->AddSimulatedBody(m_attachedSceneHandle, m_characterConfig.get()); } - if (m_controller == nullptr) + if (m_controllerBodyHandle == AzPhysics::InvalidSimulatedBodyHandle) { AZ_Error("PhysX Character Controller Component", false, "Failed to create character controller."); return; } - + + if (sceneInterface != nullptr) + { + // if the scene removes this controller body, we should also clean up our resources. + m_onSimulatedBodyRemovedHandler = AzPhysics::SceneEvents::OnSimulationBodyRemoved::Handler( + [this]([[maybe_unused]] AzPhysics::SceneHandle sceneHandle, AzPhysics::SimulatedBodyHandle bodyHandle) { + if (bodyHandle == m_controllerBodyHandle) + { + DestroyController(); + } + }); + sceneInterface->RegisterSimulationBodyRemovedHandler(m_attachedSceneHandle, m_onSimulatedBodyRemovedHandler); + } + CharacterControllerRequestBus::Handler::BusConnect(GetEntityId()); m_preSimulateHandler = AzPhysics::SystemEvents::OnPresimulateEvent::Handler( @@ -447,23 +538,27 @@ namespace PhysX } } + void CharacterControllerComponent::DisableController() + { + if (auto* controller = GetController()) + { + controller->DisablePhysics(); + + if (auto* sceneInterface = AZ::Interface::Get()) + { + sceneInterface->RemoveSimulatedBody(m_attachedSceneHandle, controller->m_bodyHandle); + } + + DestroyController(); + } + } + void CharacterControllerComponent::DestroyController() { - if (!IsPhysicsEnabled()) - { - return; - } - - m_controller->DisablePhysics(); - - if (auto* sceneInterface = AZ::Interface::Get()) - { - sceneInterface->RemoveSimulatedBody(m_controller->m_sceneOwner, m_controller->m_bodyHandle); - } - m_controller = nullptr; - + m_controllerBodyHandle = AzPhysics::InvalidSimulatedBodyHandle; + m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; m_preSimulateHandler.Disconnect(); - + m_onSimulatedBodyRemovedHandler.Disconnect(); CharacterControllerRequestBus::Handler::BusDisconnect(); } } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.h b/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.h index a7a1a92ad2..54513d52f4 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.h +++ b/Gems/PhysX/Code/Source/PhysXCharacters/Components/CharacterControllerComponent.h @@ -131,14 +131,23 @@ namespace PhysX void ToggleCollisionLayer(const AZStd::string& layerName, AZ::Crc32 colliderTag, bool enabled) override; private: + const PhysX::CharacterController* GetControllerConst() const; + PhysX::CharacterController* GetController(); + // Creates the physics character controller in the current default physics scene. + // This will do nothing if the controller is already created. void CreateController(); + // Removes the physics character controller from the scene and will call DestroyController for clean up. + void DisableController(); + // Cleans up all references and events used with the physics character controller. void DestroyController(); void OnPreSimulate(float deltaTime); AZStd::unique_ptr m_characterConfig; AZStd::shared_ptr m_shapeConfig; - PhysX::CharacterController* m_controller = nullptr; + AzPhysics::SimulatedBodyHandle m_controllerBodyHandle = AzPhysics::InvalidSimulatedBodyHandle; + AzPhysics::SceneHandle m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; AzPhysics::SystemEvents::OnPresimulateEvent::Handler m_preSimulateHandler; + AzPhysics::SceneEvents::OnSimulationBodyRemoved::Handler m_onSimulatedBodyRemovedHandler; }; } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp index 4c58187fb8..8da512647f 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp +++ b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.cpp @@ -170,63 +170,88 @@ namespace PhysX // RagdollPhysicsBus void RagdollComponent::EnableSimulation(const Physics::RagdollState& initialState) { - m_ragdoll->EnableSimulation(initialState); + if (auto* ragdoll = GetPhysXRagdoll()) + { + ragdoll->EnableSimulation(initialState); + } } void RagdollComponent::EnableSimulationQueued(const Physics::RagdollState& initialState) { - m_ragdoll->EnableSimulationQueued(initialState); + if (auto* ragdoll = GetPhysXRagdoll()) + { + ragdoll->EnableSimulationQueued(initialState); + } } void RagdollComponent::DisableSimulation() { - if (m_ragdoll) + if (auto* ragdoll = GetPhysXRagdoll()) { - m_ragdoll->DisableSimulation(); + ragdoll->DisableSimulation(); } } void RagdollComponent::DisableSimulationQueued() { - if (m_ragdoll) + if (auto* ragdoll = GetPhysXRagdoll()) { - m_ragdoll->DisableSimulationQueued(); + ragdoll->DisableSimulationQueued(); } } Physics::Ragdoll* RagdollComponent::GetRagdoll() { - return m_ragdoll; + return GetPhysXRagdoll(); } void RagdollComponent::GetState(Physics::RagdollState& ragdollState) const { - m_ragdoll->GetState(ragdollState); + if (const auto* ragdoll = GetPhysXRagdollConst()) + { + ragdoll->GetState(ragdollState); + } } void RagdollComponent::SetState(const Physics::RagdollState& ragdollState) { - m_ragdoll->SetState(ragdollState); + if (auto* ragdoll = GetPhysXRagdoll()) + { + ragdoll->SetState(ragdollState); + } } void RagdollComponent::SetStateQueued(const Physics::RagdollState& ragdollState) { - m_ragdoll->SetStateQueued(ragdollState); + if (auto* ragdoll = GetPhysXRagdoll()) + { + ragdoll->SetStateQueued(ragdollState); + } } void RagdollComponent::GetNodeState(size_t nodeIndex, Physics::RagdollNodeState& nodeState) const { - m_ragdoll->GetNodeState(nodeIndex, nodeState); + if (const auto* ragdoll = GetPhysXRagdollConst()) + { + ragdoll->GetNodeState(nodeIndex, nodeState); + } } void RagdollComponent::SetNodeState(size_t nodeIndex, const Physics::RagdollNodeState& nodeState) { - m_ragdoll->SetNodeState(nodeIndex, nodeState); + if (auto* ragdoll = GetPhysXRagdoll()) + { + ragdoll->SetNodeState(nodeIndex, nodeState); + } } Physics::RagdollNode* RagdollComponent::GetNode(size_t nodeIndex) const { - return m_ragdoll->GetNode(nodeIndex); + if (const auto* ragdoll = GetPhysXRagdollConst()) + { + return ragdoll->GetNode(nodeIndex); + } + return nullptr; } void RagdollComponent::EnablePhysics() @@ -245,14 +270,19 @@ namespace PhysX bool RagdollComponent::IsPhysicsEnabled() const { - return m_ragdoll && m_ragdoll->IsSimulated(); + if (const auto* ragdoll = GetPhysXRagdollConst()) + { + return ragdoll->IsSimulated(); + } + return false; + } AZ::Aabb RagdollComponent::GetAabb() const { - if (m_ragdoll) + if (const auto* ragdoll = GetPhysXRagdollConst()) { - return m_ragdoll->GetAabb(); + return ragdoll->GetAabb(); } return AZ::Aabb::CreateNull(); } @@ -264,18 +294,14 @@ namespace PhysX AzPhysics::SimulatedBodyHandle RagdollComponent::GetSimulatedBodyHandle() const { - if (m_ragdoll) - { - return m_ragdoll->m_bodyHandle; - } - return AzPhysics::InvalidSimulatedBodyHandle; + return m_ragdollHandle; } AzPhysics::SceneQueryHit RagdollComponent::RayCast(const AzPhysics::RayCastRequest& request) { - if (m_ragdoll) + if (auto* ragdoll = GetPhysXRagdoll()) { - return m_ragdoll->RayCast(request); + return ragdoll->RayCast(request); } return AzPhysics::SceneQueryHit(); } @@ -323,23 +349,24 @@ namespace PhysX AZ::TransformBus::EventResult(entityTransform, GetEntityId(), &AZ::TransformBus::Events::GetWorldTM); ragdollConfiguration.m_initialState = GetBindPoseWorld(bindPose, entityTransform); - AzPhysics::SceneHandle defaultSceneHandle = AzPhysics::InvalidSceneHandle; - Physics::DefaultWorldBus::BroadcastResult(defaultSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle); + m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; + Physics::DefaultWorldBus::BroadcastResult(m_attachedSceneHandle, &Physics::DefaultWorldRequests::GetDefaultSceneHandle); if (auto* sceneInterface = AZ::Interface::Get()) { - AzPhysics::SimulatedBodyHandle bodyHandle = sceneInterface->AddSimulatedBody(defaultSceneHandle, &ragdollConfiguration); - m_ragdoll = azdynamic_cast(sceneInterface->GetSimulatedBodyFromHandle(defaultSceneHandle, bodyHandle)); + m_ragdollHandle = sceneInterface->AddSimulatedBody(m_attachedSceneHandle, &ragdollConfiguration); } - if (m_ragdoll == nullptr) + auto* ragdoll = GetPhysXRagdoll(); + if (ragdoll == nullptr || + m_ragdollHandle == AzPhysics::InvalidSimulatedBodyHandle) { AZ_Error("PhysX Ragdoll Component", false, "Failed to create ragdoll."); return; } - + for (size_t nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) { - if (physx::PxRigidDynamic* pxRigidBody = m_ragdoll->GetPxRigidDynamic(nodeIndex)) + if (physx::PxRigidDynamic* pxRigidBody = ragdoll->GetPxRigidDynamic(nodeIndex)) { pxRigidBody->setSolverIterationCounts(m_positionIterations, m_velocityIterations); } @@ -352,7 +379,7 @@ namespace PhysX for (size_t nodeIndex = 0; nodeIndex < numNodes; nodeIndex++) { - if (const AZStd::shared_ptr& joint = m_ragdoll->GetNode(nodeIndex)->GetJoint()) + if (const AZStd::shared_ptr& joint = ragdoll->GetNode(nodeIndex)->GetJoint()) { if (auto* pxJoint = static_cast(joint->GetNativePointer())) { @@ -374,20 +401,41 @@ namespace PhysX void RagdollComponent::DestroyRagdoll() { - if (m_ragdoll) + if (m_ragdollHandle != AzPhysics::InvalidSimulatedBodyHandle && + m_attachedSceneHandle != AzPhysics::InvalidSceneHandle) { AzFramework::RagdollPhysicsRequestBus::Handler::BusDisconnect(); - AzFramework::RagdollPhysicsNotificationBus::Event(GetEntityId(), - &AzFramework::RagdollPhysicsNotifications::OnRagdollDeactivated); + AzFramework::RagdollPhysicsNotificationBus::Event( + GetEntityId(), &AzFramework::RagdollPhysicsNotifications::OnRagdollDeactivated); if (auto* sceneInterface = AZ::Interface::Get()) { - sceneInterface->RemoveSimulatedBody(m_ragdoll->m_sceneOwner, m_ragdoll->m_bodyHandle); + sceneInterface->RemoveSimulatedBody(m_attachedSceneHandle, m_ragdollHandle); + m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; } - m_ragdoll = nullptr; } } + Ragdoll* RagdollComponent::GetPhysXRagdoll() + { + return const_cast(static_cast(*this).GetPhysXRagdollConst()); + } + + const Ragdoll* RagdollComponent::GetPhysXRagdollConst() const + { + if (m_ragdollHandle == AzPhysics::InvalidSimulatedBodyHandle || + m_attachedSceneHandle == AzPhysics::InvalidSceneHandle) + { + return nullptr; + } + + if (auto* sceneInterface = AZ::Interface::Get()) + { + return azdynamic_cast(sceneInterface->GetSimulatedBodyFromHandle(m_attachedSceneHandle, m_ragdollHandle)); + } + return nullptr; + } + // deprecated Cry functions void RagdollComponent::EnterRagdoll() { diff --git a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.h b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.h index a02e9c47fb..2c265b0f73 100644 --- a/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.h +++ b/Gems/PhysX/Code/Source/PhysXCharacters/Components/RagdollComponent.h @@ -104,10 +104,13 @@ namespace PhysX private: void CreateRagdoll(const Physics::RagdollConfiguration& ragdollConfiguration); void DestroyRagdoll(); + Ragdoll* GetPhysXRagdoll(); + const Ragdoll* GetPhysXRagdollConst() const; bool IsJointProjectionVisible(); - Ragdoll* m_ragdoll; + AzPhysics::SimulatedBodyHandle m_ragdollHandle = AzPhysics::InvalidSimulatedBodyHandle; + AzPhysics::SceneHandle m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; /// Minimum number of position iterations to perform in the PhysX solver. /// Lower iteration counts are less expensive but may behave less realistically. AZ::u32 m_positionIterations = 16; diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp index 3987936b8c..430ef7aef3 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshAssetHandler.cpp @@ -196,7 +196,7 @@ namespace PhysX AZ::Transform::CreateFromQuaternionAndTranslation(colliderConfiguration.m_rotation, colliderConfiguration.m_position); AZ::Transform shapeTransform = *m_transform; - shapeTransform.ExtractScale(); + shapeTransform.ExtractUniformScale(); shapeTransform = existingTransform * shapeTransform; diff --git a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp index 7069f9a05d..24e532e2d1 100644 --- a/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp +++ b/Gems/PhysX/Code/Source/Pipeline/MeshExporter.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include @@ -153,7 +153,7 @@ namespace PhysX AZ::SerializeContext* serializeContext = azrtti_cast(context); if (serializeContext) { - serializeContext->Class()->Version(3); + serializeContext->Class()->Version(4); } } @@ -215,7 +215,7 @@ namespace PhysX if (nameAttribute) { AZStd::string materialName = nameAttribute->value(); - AZStd::string surfaceTypeName = DefaultMaterialName; + AZStd::string surfaceTypeName = DefaultPhysicsMaterialNameFromPhysicsAsset; AZ::rapidxml::xml_attribute* surfaceTypeNode = materialNode->first_attribute("SurfaceType"); if (surfaceTypeNode && surfaceTypeNode->value_size() != 0) @@ -268,7 +268,7 @@ namespace PhysX } else { - materialName = DefaultMaterialName; + materialName = DefaultPhysicsMaterialNameFromPhysicsAsset; } materialNames.emplace_back(AZStd::move(materialName)); @@ -328,7 +328,7 @@ namespace PhysX physx::PxMeshMidPhase::Enum ret = physx::PxMeshMidPhase::eBVH34; // Fallback to 3.3 on Android and iOS platforms since they don't support SSE2, which is required for 3.4 - if (platformIdentifier == "es3" || platformIdentifier == "ios") + if (platformIdentifier == "android" || platformIdentifier == "ios") { ret = physx::PxMeshMidPhase::eBVH33; } @@ -794,6 +794,9 @@ namespace PhysX ); } + // Convex and primitive methods can only have 1 material + const bool limitToOneMaterial = pxMeshGroup.GetExportAsConvex() || pxMeshGroup.GetExportAsPrimitive(); + for (AZ::u32 faceIndex = 0; faceIndex < faceCount; ++faceIndex) { AZStd::string materialName = DefaultMaterialName; @@ -810,6 +813,14 @@ namespace PhysX } materialName = localFbxMaterialsList[materialId]; + + // Keep using the first material when it has to be limited to one. + if (limitToOneMaterial && + assetMaterialData.m_fbxMaterialNames.size() == 1 && + assetMaterialData.m_fbxMaterialNames[0] != materialName) + { + materialName = assetMaterialData.m_fbxMaterialNames[0]; + } } const AZ::SceneAPI::DataTypes::IMeshData::Face& face = nodeMesh->GetFaceInfo(faceIndex); diff --git a/Gems/PhysX/Code/Source/RigidBodyComponent.cpp b/Gems/PhysX/Code/Source/RigidBodyComponent.cpp index f770f8408c..40cac1e19e 100644 --- a/Gems/PhysX/Code/Source/RigidBodyComponent.cpp +++ b/Gems/PhysX/Code/Source/RigidBodyComponent.cpp @@ -201,9 +201,8 @@ namespace PhysX AZ::Quaternion newRotation = AZ::Quaternion::CreateIdentity(); m_interpolator->GetInterpolated(newPosition, newRotation, deltaTime); - AZ::Transform interpolatedTransform = AZ::Transform::CreateFromQuaternionAndTranslation(newRotation, newPosition); - interpolatedTransform.MultiplyByScale(m_initialScale); - AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldTM, interpolatedTransform); + AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldRotationQuaternion, newRotation); + AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldTranslation, newPosition); } } @@ -257,12 +256,8 @@ namespace PhysX } else { - // Maintain scale (this must be precise). - AZ::Transform entityTransform = AZ::Transform::Identity(); - AZ::TransformBus::EventResult(entityTransform, GetEntityId(), &AZ::TransformInterface::GetWorldTM); - transform.MultiplyByScale(m_initialScale); - - AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldTM, transform); + AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldRotationQuaternion, rigidBody->GetOrientation()); + AZ::TransformBus::Event(GetEntityId(), &AZ::TransformInterface::SetWorldTranslation, rigidBody->GetPosition()); } m_isLastMovementFromKinematicSource = false; } @@ -353,8 +348,6 @@ namespace PhysX m_interpolator = std::make_unique(); m_interpolator->Reset(transform.GetTranslation(), rotation); - m_initialScale = transform.ExtractScale(); - Physics::RigidBodyNotificationBus::Event(GetEntityId(), &Physics::RigidBodyNotificationBus::Events::OnPhysicsEnabled); } diff --git a/Gems/PhysX/Code/Source/RigidBodyComponent.h b/Gems/PhysX/Code/Source/RigidBodyComponent.h index 7b2a34cf37..07fa4fb847 100644 --- a/Gems/PhysX/Code/Source/RigidBodyComponent.h +++ b/Gems/PhysX/Code/Source/RigidBodyComponent.h @@ -161,7 +161,6 @@ namespace PhysX AzPhysics::SimulatedBodyHandle m_rigidBodyHandle = AzPhysics::InvalidSimulatedBodyHandle; AzPhysics::SceneHandle m_attachedSceneHandle = AzPhysics::InvalidSceneHandle; - AZ::Vector3 m_initialScale = AZ::Vector3::CreateOne(); bool m_staticTransformAtActivation = false; ///< Whether the transform was static when the component last activated. bool m_isLastMovementFromKinematicSource = false; ///< True when the source of the movement comes from SetKinematicTarget as opposed to coming from a Transform change bool m_rigidBodyTransformNeedsUpdateOnPhysReEnable = false; ///< True if rigid body transform needs to be synced to the entity's when physics is re-enabled diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index 79aa767959..689ea47be7 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -489,6 +489,7 @@ namespace PhysX // Disable simulation on body (not signaling OnSimulationBodySimulationDisabled event) DisableSimulationOfBodyInternal(*simulatedBody.second); } + m_simulatedBodyRemovedEvent.Signal(m_sceneHandle, simulatedBody.second->m_bodyHandle); delete simulatedBody.second; } } diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp index 1622d04aae..92f68ea13b 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.cpp +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.cpp @@ -21,12 +21,27 @@ #include +// only enable physx timestep warning when not running debug or in Release +#if !defined(DEBUG) && !defined(RELEASE) +#define ENABLE_PHYSX_TIMESTEP_WARNING +#endif + namespace PhysX { AZ_CLASS_ALLOCATOR_IMPL(PhysXSystem, AZ::SystemAllocator, 0); - PhysXSystem::MaterialLibraryAssetHelper::MaterialLibraryAssetHelper(PhysXSystem* physXSystem) - : m_physXSystem(physXSystem) +#ifdef ENABLE_PHYSX_TIMESTEP_WARNING + namespace FrameTimeWarning + { + static constexpr int MaxSamples = 1000; + static int NumSamples = 0; + static int NumSamplesOverLimit = 0; + static float LostTime = 0.0f; + } +#endif + + PhysXSystem::MaterialLibraryAssetHelper::MaterialLibraryAssetHelper(OnMaterialLibraryReloadedCallback callback) + : m_onMaterialLibraryReloadedCallback(callback) { } @@ -47,16 +62,16 @@ namespace PhysX void PhysXSystem::MaterialLibraryAssetHelper::OnAssetReloaded(AZ::Data::Asset asset) { - if (m_physXSystem == nullptr || m_physXSystem->GetDefaultMaterialLibrary() != asset) - { - return; - } - m_physXSystem->UpdateDefaultMaterialLibrary(asset); + m_onMaterialLibraryReloadedCallback(asset); } PhysXSystem::PhysXSystem(PhysXSettingsRegistryManager* registryManager, const physx::PxCookingParams& cookingParams) : m_registryManager(*registryManager) - , m_materialLibraryAssetHelper(this) + , m_materialLibraryAssetHelper( + [this](const AZ::Data::Asset& materialLibrary) + { + UpdateMaterialLibrary(materialLibrary); + }) , m_sceneInterface(this) { // Start PhysX allocator @@ -112,7 +127,7 @@ namespace PhysX 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. - m_systemConfig.m_defaultMaterialLibrary.Reset(); + m_systemConfig.m_materialLibraryAsset.Reset(); m_accumulatedTime = 0.0f; m_state = State::Shutdown; @@ -140,9 +155,26 @@ namespace PhysX } }; - AZ_Warning("PhysXSystem", deltaTime <= m_systemConfig.m_maxTimestep, - "Frame delta time of [%.6f seconds] exceeds Physics max frame timestep, physics timestep will be clamped to [%.6f seconds].", - deltaTime, m_systemConfig.m_maxTimestep); +#ifdef ENABLE_PHYSX_TIMESTEP_WARNING + if (FrameTimeWarning::NumSamples < FrameTimeWarning::MaxSamples) + { + FrameTimeWarning::NumSamples++; + if (deltaTime > m_systemConfig.m_maxTimestep) + { + FrameTimeWarning::NumSamplesOverLimit++; + FrameTimeWarning::LostTime += deltaTime - m_systemConfig.m_maxTimestep; + } + } + else + { + AZ_Warning("PhysXSystem", FrameTimeWarning::NumSamplesOverLimit <= 0, + "[%d] of [%d] frames had a deltatime over the Max physics timestep[%.6f]. Physx timestep was clamped on those frames, losing [%.6f] seconds.", + FrameTimeWarning::NumSamplesOverLimit, FrameTimeWarning::NumSamples, m_systemConfig.m_maxTimestep, FrameTimeWarning::LostTime); + FrameTimeWarning::NumSamples = 0; + FrameTimeWarning::NumSamplesOverLimit = 0; + FrameTimeWarning::LostTime = 0.0f; + } +#endif deltaTime = AZ::GetClamp(deltaTime, 0.0f, m_systemConfig.m_maxTimestep); AZ_Assert(m_systemConfig.m_fixedTimestep >= 0.0f, "PhysXSystem - fixed timestep is negitive."); @@ -337,8 +369,18 @@ namespace PhysX void PhysXSystem::OnCatalogLoaded([[maybe_unused]]const char* catalogFile) { - //now that assets can be resolved, lets load the default material library. - LoadDefaultMaterialLibrary(); + // 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); + } + + bool success = LoadMaterialLibrary(); + if (!success) + { + m_onMaterialLibraryLoadErrorEvent.Signal(AzPhysics::SystemEvents::MaterialLibraryLoadErrorType::ErrorLoading); + } } void PhysXSystem::UpdateConfiguration(const AzPhysics::SystemConfiguration* newConfig, [[maybe_unused]] bool forceReinitialization /*= false*/) @@ -346,7 +388,7 @@ namespace PhysX if (const auto* physXConfig = azdynamic_cast(newConfig); m_systemConfig != (*physXConfig)) { - const bool newMaterialLibrary = m_systemConfig.m_defaultMaterialLibrary != physXConfig->m_defaultMaterialLibrary; + const bool newMaterialLibrary = m_systemConfig.m_materialLibraryAsset != physXConfig->m_materialLibraryAsset; m_systemConfig = (*physXConfig); m_configChangeEvent.Signal(physXConfig); @@ -354,9 +396,11 @@ namespace PhysX if (newMaterialLibrary) { - LoadDefaultMaterialLibrary(); - m_onDefaultMaterialLibraryChangedEvent.Signal(m_systemConfig.m_defaultMaterialLibrary.GetId()); + LoadMaterialLibrary(); + m_onMaterialLibraryChangedEvent.Signal(m_systemConfig.m_materialLibraryAsset.GetId()); } + // This function is not called from reloading the material library asset, + // which means we don't need to check if the materials inside the library have been modified. } } @@ -413,23 +457,6 @@ namespace PhysX return m_systemConfig; } - void PhysXSystem::UpdateDefaultMaterialLibrary(const AZ::Data::Asset& materialLibrary) - { - if (m_systemConfig.m_defaultMaterialLibrary == materialLibrary) - { - return; - } - m_systemConfig.m_defaultMaterialLibrary = materialLibrary; - - LoadDefaultMaterialLibrary(); - m_onDefaultMaterialLibraryChangedEvent.Signal(materialLibrary.GetId()); - } - - const AZ::Data::Asset& PhysXSystem::GetDefaultMaterialLibrary() const - { - return m_systemConfig.m_defaultMaterialLibrary; - } - void PhysXSystem::UpdateDefaultSceneConfiguration(const AzPhysics::SceneConfiguration& sceneConfiguration) { if (m_defaultSceneConfiguration != sceneConfiguration) @@ -450,9 +477,30 @@ namespace PhysX return m_registryManager; } - bool PhysXSystem::LoadDefaultMaterialLibrary() + void PhysXSystem::UpdateMaterialLibrary(const AZ::Data::Asset& materialLibrary) { - AZ::Data::Asset& materialLibrary = m_systemConfig.m_defaultMaterialLibrary; + if (m_systemConfig.m_materialLibraryAsset == materialLibrary) + { + // Same library asset, check if its data has changed. + if (m_systemConfig.m_materialLibraryAsset->GetMaterialsData() != materialLibrary->GetMaterialsData()) + { + m_systemConfig.m_materialLibraryAsset = materialLibrary; + m_onMaterialLibraryChangedEvent.Signal(materialLibrary.GetId()); + } + } + else + { + // New material library asset + m_systemConfig.m_materialLibraryAsset = materialLibrary; + + LoadMaterialLibrary(); + m_onMaterialLibraryChangedEvent.Signal(materialLibrary.GetId()); + } + } + + bool PhysXSystem::LoadMaterialLibrary() + { + AZ::Data::Asset& materialLibrary = m_systemConfig.m_materialLibraryAsset; const AZ::Data::AssetId& materialLibraryId = materialLibrary.GetId(); if (!materialLibraryId.IsValid()) { @@ -471,7 +519,7 @@ namespace PhysX AZ_Warning("PhysX", (materialLibrary.GetData() != nullptr), "LoadDefaultMaterialLibrary: Default Material Library asset data is invalid."); - return materialLibrary.GetData() != nullptr; + return materialLibrary.GetData() != nullptr && !materialLibrary.IsError(); } //TEMP -- until these are fully moved over here diff --git a/Gems/PhysX/Code/Source/System/PhysXSystem.h b/Gems/PhysX/Code/Source/System/PhysXSystem.h index 04d23ad47d..533685bbd1 100644 --- a/Gems/PhysX/Code/Source/System/PhysXSystem.h +++ b/Gems/PhysX/Code/Source/System/PhysXSystem.h @@ -64,8 +64,6 @@ namespace PhysX AZStd::pair FindAttachedBodyHandleFromEntityId(AZ::EntityId entityId) override; const AzPhysics::SystemConfiguration* GetConfiguration() const override; void UpdateConfiguration(const AzPhysics::SystemConfiguration* newConfig, bool forceReinitialization = false) override; - void UpdateDefaultMaterialLibrary(const AZ::Data::Asset& materialLibrary) override; - const AZ::Data::Asset& GetDefaultMaterialLibrary() const override; void UpdateDefaultSceneConfiguration(const AzPhysics::SceneConfiguration& sceneConfiguration) override; const AzPhysics::SceneConfiguration& GetDefaultSceneConfiguration() const override; @@ -75,6 +73,8 @@ namespace PhysX //! Accessor to get the Settings Registry Manager. const PhysXSettingsRegistryManager& GetSettingsRegistryManager() const; + void UpdateMaterialLibrary(const AZ::Data::Asset& materialLibrary); + //TEMP -- until these are fully moved over here physx::PxPhysics* GetPxPhysics() { return m_physXSdk.m_physics; } physx::PxCooking* GetPxCooking() { return m_physXSdk.m_cooking; } @@ -92,7 +92,7 @@ namespace PhysX //! @param cookingParams The cooking params to use when setting up PhysX cooking interface. void InitializePhysXSdk(const physx::PxCookingParams& cookingParams); void ShutdownPhysXSdk(); - bool LoadDefaultMaterialLibrary(); + bool LoadMaterialLibrary(); // AzFramework::AssetCatalogEventBus::Handler ... void OnCatalogLoaded(const char* catalogFile) override; @@ -133,7 +133,9 @@ namespace PhysX : private AZ::Data::AssetBus::Handler { public: - MaterialLibraryAssetHelper(PhysXSystem* physXSystem); + using OnMaterialLibraryReloadedCallback = AZStd::function& materialLibrary)>; + + MaterialLibraryAssetHelper(OnMaterialLibraryReloadedCallback callback); void Connect(const AZ::Data::AssetId& materialLibraryId); void Disconnect(); @@ -142,7 +144,7 @@ namespace PhysX // AZ::Data::AssetBus::Handler void OnAssetReloaded(AZ::Data::Asset asset) override; - PhysXSystem* m_physXSystem; + OnMaterialLibraryReloadedCallback m_onMaterialLibraryReloadedCallback; }; MaterialLibraryAssetHelper m_materialLibraryAssetHelper; }; diff --git a/Gems/PhysX/Code/Source/SystemComponent.cpp b/Gems/PhysX/Code/Source/SystemComponent.cpp index 9ef4dc5099..b4c17f672d 100644 --- a/Gems/PhysX/Code/Source/SystemComponent.cpp +++ b/Gems/PhysX/Code/Source/SystemComponent.cpp @@ -347,27 +347,6 @@ namespace PhysX return AZStd::make_shared(materialConfiguration); } - AZStd::vector> SystemComponent::CreateMaterialsFromLibrary(const Physics::MaterialSelection& materialSelection) - { - AZStd::vector pxMaterials; - m_materialManager.GetPxMaterials(materialSelection, pxMaterials); - - AZStd::vector> genericMaterials; - genericMaterials.reserve(pxMaterials.size()); - - for (physx::PxMaterial* pxMaterial : pxMaterials) - { - genericMaterials.push_back(static_cast(pxMaterial->userData)->shared_from_this()); - } - - return genericMaterials; - } - - AZStd::shared_ptr SystemComponent::GetDefaultMaterial() - { - return m_materialManager.GetDefaultMaterial(); - } - AZStd::vector SystemComponent::GetSupportedJointTypes() { return JointUtils::GetSupportedJointTypes(); @@ -484,58 +463,6 @@ namespace PhysX return m_physXSystem->GetPxCooking(); } - bool SystemComponent::UpdateMaterialSelection(const Physics::ShapeConfiguration& shapeConfiguration, - Physics::ColliderConfiguration& colliderConfiguration) - { - Physics::MaterialSelection& materialSelection = colliderConfiguration.m_materialSelection; - - // If the material library is still not set, we can't update the material selection - if (!materialSelection.IsMaterialLibraryValid()) - { - AZ_Warning("PhysX", false, - "UpdateMaterialSelection: Material Selection tried to use an invalid/non-existing Physics material library: \"%s\". " - "Please make sure the file exists or re-assign another library", materialSelection.GetMaterialLibraryAssetHint().c_str()); - return false; - } - - // If there's no material library data loaded, try to load it - if (materialSelection.GetMaterialLibraryAssetData() == nullptr) - { - AZ::Data::AssetId materialLibraryAssetId = materialSelection.GetMaterialLibraryAssetId(); - materialSelection.SetMaterialLibrary(materialLibraryAssetId); - } - - // If there's still not material library data, we can't update the material selection - if (materialSelection.GetMaterialLibraryAssetData() == nullptr) - { - AZ::Data::AssetId materialLibraryAssetId = materialSelection.GetMaterialLibraryAssetId(); - - auto materialLibraryAsset = - AZ::Data::AssetManager::Instance().GetAsset(materialLibraryAssetId, AZ::Data::AssetLoadBehavior::Default); - - materialLibraryAsset.BlockUntilLoadComplete(); - - // Log the asset path to help find out the incorrect library reference - AZStd::string assetPath = materialLibraryAsset.GetHint(); - AZ_Warning("PhysX", false, - "UpdateMaterialSelection: Unable to load the material library for a material selection." - " Please check if the asset %s exists in the asset cache.", assetPath.c_str()); - - return false; - } - - if (shapeConfiguration.GetShapeType() == Physics::ShapeType::PhysicsAsset) - { - const Physics::PhysicsAssetShapeConfiguration& assetConfiguration = - static_cast(shapeConfiguration); - - // Use the materials data from the asset to update the collider data - return UpdateMaterialSelectionFromPhysicsAsset(assetConfiguration, colliderConfiguration); - } - - return true; - } - void SystemComponent::OnTick(float deltaTime, [[maybe_unused]] AZ::ScriptTimePoint time) { if (m_physXSystem) @@ -614,65 +541,4 @@ namespace PhysX m_windProvider = AZStd::make_unique(); } - - bool SystemComponent::UpdateMaterialSelectionFromPhysicsAsset( - const Physics::PhysicsAssetShapeConfiguration& assetConfiguration, - Physics::ColliderConfiguration& colliderConfiguration) - { - Physics::MaterialSelection& materialSelection = colliderConfiguration.m_materialSelection; - - if (!assetConfiguration.m_asset.GetId().IsValid()) - { - // Set the default selection if there's no physics asset. - materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); - return false; - } - - if (!assetConfiguration.m_asset.IsReady()) - { - // The asset is valid but is still loading, - // Do not set the empty slots in this case to avoid the entity being in invalid state - return false; - } - - Pipeline::MeshAsset* meshAsset = assetConfiguration.m_asset.GetAs(); - if (!meshAsset) - { - materialSelection.SetMaterialSlots(Physics::MaterialSelection::SlotsArray()); - AZ_Warning("PhysX", false, "UpdateMaterialSelectionFromPhysicsAsset: MeshAsset is invalid"); - return false; - } - - // Set the slots from the mesh asset - materialSelection.SetMaterialSlots(meshAsset->m_assetData.m_surfaceNames); - - if (!assetConfiguration.m_useMaterialsFromAsset) - { - return false; - } - - const Physics::MaterialLibraryAsset* materialLibrary = materialSelection.GetMaterialLibraryAssetData(); - const AZStd::vector& meshMaterialNames = meshAsset->m_assetData.m_materialNames; - - // Update material IDs in the selection for each slot - int slotIndex = 0; - for (const AZStd::string& meshMaterialName : meshMaterialNames) - { - Physics::MaterialFromAssetConfiguration materialData; - bool found = materialLibrary->GetDataForMaterialName(meshMaterialName, materialData); - - AZ_Warning("PhysX", found, - "UpdateMaterialSelectionFromPhysicsAsset: No material found for surfaceType (%s) in the collider material library", - meshMaterialName.c_str()); - - if (found) - { - materialSelection.SetMaterialId(materialData.m_id, slotIndex); - } - - slotIndex++; - } - - return true; - } } // namespace PhysX diff --git a/Gems/PhysX/Code/Source/SystemComponent.h b/Gems/PhysX/Code/Source/SystemComponent.h index 8871adfeeb..4609fde0ce 100644 --- a/Gems/PhysX/Code/Source/SystemComponent.h +++ b/Gems/PhysX/Code/Source/SystemComponent.h @@ -114,8 +114,6 @@ namespace PhysX // Physics::SystemRequestBus::Handler AZStd::shared_ptr CreateShape(const Physics::ColliderConfiguration& colliderConfiguration, const Physics::ShapeConfiguration& configuration) override; AZStd::shared_ptr CreateMaterial(const Physics::MaterialConfiguration& materialConfiguration) override; - AZStd::shared_ptr GetDefaultMaterial() override; - AZStd::vector> CreateMaterialsFromLibrary(const Physics::MaterialSelection& materialSelection) override; AZStd::vector GetSupportedJointTypes() override; AZStd::shared_ptr CreateJointLimitConfiguration(AZ::TypeId jointType) override; @@ -147,8 +145,6 @@ namespace PhysX static bool VersionConverter(AZ::SerializeContext& context, AZ::SerializeContext::DataElementNode& classElement); - bool UpdateMaterialSelection(const Physics::ShapeConfiguration& shapeConfiguration, - Physics::ColliderConfiguration& colliderConfiguration) override; private: // AZ::TickBus::Handler ... void OnTick(float deltaTime, AZ::ScriptTimePoint time) override; @@ -157,9 +153,6 @@ namespace PhysX void EnableAutoManagedPhysicsTick(bool shouldTick); void ActivatePhysXSystem(); - bool UpdateMaterialSelectionFromPhysicsAsset( - const Physics::PhysicsAssetShapeConfiguration& assetConfiguration, - Physics::ColliderConfiguration& colliderConfiguration); bool m_enabled; ///< If false, this component will not activate itself in the Activate() function. diff --git a/Gems/PhysX/Code/Source/Utils.cpp b/Gems/PhysX/Code/Source/Utils.cpp index 767f386b6f..270a352fc0 100644 --- a/Gems/PhysX/Code/Source/Utils.cpp +++ b/Gems/PhysX/Code/Source/Utils.cpp @@ -607,48 +607,6 @@ namespace PhysX return true; } - void GetMaterialList( - AZStd::vector& pxMaterials, const AZStd::vector& terrainSurfaceIdIndexMapping, - const Physics::TerrainMaterialSurfaceIdMap& terrainMaterialsToSurfaceIds) - { - pxMaterials.reserve(terrainSurfaceIdIndexMapping.size()); - - AZStd::shared_ptr defaultMaterial; - MaterialManagerRequestsBus::BroadcastResult(defaultMaterial, &MaterialManagerRequestsBus::Events::GetDefaultMaterial); - - if (terrainSurfaceIdIndexMapping.empty()) - { - pxMaterials.push_back(defaultMaterial->GetPxMaterial()); - return; - } - - AZStd::vector materials; - - for (auto& surfaceId : terrainSurfaceIdIndexMapping) - { - const auto& userAssignedMaterials = terrainMaterialsToSurfaceIds; - const auto& matSelectionIterator = userAssignedMaterials.find(surfaceId); - if (matSelectionIterator != userAssignedMaterials.end()) - { - MaterialManagerRequestsBus::Broadcast(&MaterialManagerRequests::GetPxMaterials, matSelectionIterator->second, materials); - - if (!materials.empty()) - { - pxMaterials.push_back(materials.front()); - } - else - { - AZ_Error("PhysX", false, "Creating materials: array with materials can't be empty"); - pxMaterials.push_back(defaultMaterial->GetPxMaterial()); - } - } - else - { - pxMaterials.push_back(defaultMaterial->GetPxMaterial()); - } - } - } - AZStd::string ReplaceAll(AZStd::string str, const AZStd::string& fromString, const AZStd::string& toString) { size_t positionBegin = 0; while ((positionBegin = str.find(fromString, positionBegin)) != AZStd::string::npos) @@ -718,7 +676,7 @@ namespace PhysX const float boundsInflationFactor = 1.0f; AZ::Transform overallTransformNoScale = GetColliderWorldTransform(worldTransform, colliderConfiguration.m_position, colliderConfiguration.m_rotation); - overallTransformNoScale.ExtractScale(); + overallTransformNoScale.ExtractUniformScale(); const physx::PxBounds3 bounds = physx::PxGeometryQuery::getWorldBounds(geometryHolder.any(), PxMathConvert(overallTransformNoScale), boundsInflationFactor); @@ -770,7 +728,7 @@ namespace PhysX return worldPosAabb; } - Physics::ShapeConfigurationList colliderShapes; + AzPhysics::ShapeColliderPairList colliderShapes; GetColliderShapeConfigsFromAsset(physicsAssetConfig, colliderConfiguration, hasNonUniformScale, @@ -812,7 +770,7 @@ namespace PhysX void GetColliderShapeConfigsFromAsset(const Physics::PhysicsAssetShapeConfiguration& assetConfiguration, const Physics::ColliderConfiguration& originalColliderConfiguration, bool hasNonUniformScale, - AZ::u8 subdivisionLevel, Physics::ShapeConfigurationList& resultingColliderShapes) + AZ::u8 subdivisionLevel, AzPhysics::ShapeColliderPairList& resultingColliderShapes) { if (!assetConfiguration.m_asset.IsReady()) { @@ -896,13 +854,13 @@ namespace PhysX const Physics::ColliderConfiguration& originalColliderConfiguration, bool hasNonUniformScale, AZ::u8 subdivisionLevel, AZStd::vector>& resultingShapes) { - Physics::ShapeConfigurationList resultingColliderShapeConfigs; + AzPhysics::ShapeColliderPairList resultingColliderShapeConfigs; GetColliderShapeConfigsFromAsset(assetConfiguration, originalColliderConfiguration, hasNonUniformScale, subdivisionLevel, resultingColliderShapeConfigs); resultingShapes.reserve(resultingShapes.size() + resultingColliderShapeConfigs.size()); - for (const Physics::ShapeConfigurationPair& shapeConfigPair : resultingColliderShapeConfigs) + for (const AzPhysics::ShapeColliderPair& shapeConfigPair : resultingColliderShapeConfigs) { // Scale the collider offset shapeConfigPair.first->m_position *= shapeConfigPair.second->m_scale; @@ -920,9 +878,9 @@ namespace PhysX AZ::Vector3 GetTransformScale(AZ::EntityId entityId) { - AZ::Vector3 worldScale = AZ::Vector3::CreateOne(); - AZ::TransformBus::EventResult(worldScale, entityId, &AZ::TransformBus::Events::GetWorldScale); - return worldScale; + float worldUniformScale = 1.0f; + AZ::TransformBus::EventResult(worldUniformScale, entityId, &AZ::TransformBus::Events::GetWorldUniformScale); + return AZ::Vector3(worldUniformScale); } AZ::Vector3 GetUniformScale(AZ::EntityId entityId) @@ -1378,7 +1336,7 @@ namespace PhysX AZ::TransformBus::EventResult(worldTransformWithoutScale , entityId , &AZ::TransformInterface::GetWorldTM); - worldTransformWithoutScale.ExtractScale(); + worldTransformWithoutScale.ExtractUniformScale(); return worldTransformWithoutScale; } @@ -1386,10 +1344,10 @@ namespace PhysX const AZ::Transform& entityWorldTransform) { AZ::Transform jointWorldTransformWithoutScale = jointWorldTransform; - jointWorldTransformWithoutScale.ExtractScale(); + jointWorldTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform; - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformInverse = entityWorldTransformWithoutScale.GetInverse(); return entityWorldTransformInverse * jointWorldTransformWithoutScale; @@ -1399,10 +1357,10 @@ namespace PhysX const AZ::Transform& entityWorldTransform) { AZ::Transform jointLocalTransformWithoutScale = jointLocalTransform; - jointLocalTransformWithoutScale.ExtractScale(); + jointLocalTransformWithoutScale.ExtractUniformScale(); AZ::Transform entityWorldTransformWithoutScale = entityWorldTransform; - entityWorldTransformWithoutScale.ExtractScale(); + entityWorldTransformWithoutScale.ExtractUniformScale(); return entityWorldTransformWithoutScale * jointLocalTransformWithoutScale; } diff --git a/Gems/PhysX/Code/Source/Utils.h b/Gems/PhysX/Code/Source/Utils.h index 2a8329b267..73ce813b77 100644 --- a/Gems/PhysX/Code/Source/Utils.h +++ b/Gems/PhysX/Code/Source/Utils.h @@ -115,9 +115,6 @@ namespace PhysX bool MeshDataToPxGeometry(physx::PxBase* meshData, physx::PxGeometryHolder &pxGeometry, const AZ::Vector3& scale); - void GetMaterialList( - AZStd::vector& pxMaterials, const AZStd::vector& materialIndexMapping, - const Physics::TerrainMaterialSurfaceIdMap& terrainMaterialsToSurfaceIds); //! Returns all connected busIds of the specified type. template AZStd::vector FindConnectedBusIds() @@ -179,7 +176,7 @@ namespace PhysX void GetColliderShapeConfigsFromAsset(const Physics::PhysicsAssetShapeConfiguration& assetConfiguration, const Physics::ColliderConfiguration& originalColliderConfiguration, - bool hasNonUniformScale, AZ::u8 subdivisionLevel, Physics::ShapeConfigurationList& resultingColliderShapes); + bool hasNonUniformScale, AZ::u8 subdivisionLevel, AzPhysics::ShapeColliderPairList& resultingColliderShapes); //! Gets the scale from the entity's Transform component. AZ::Vector3 GetTransformScale(AZ::EntityId entityId); diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarkWashingMachine.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarkWashingMachine.cpp index adc910e8c8..24fbfd742e 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarkWashingMachine.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarkWashingMachine.cpp @@ -13,6 +13,7 @@ #ifdef HAVE_BENCHMARK #include +#include #include #include #include @@ -96,9 +97,12 @@ namespace PhysX::Benchmarks config.m_position.SetY((cylinderRadius + halfCylinderWallThickness) * std::sin(AZ::Constants::TwoPi * i / NumCylinderSide) + position.GetY()); config.m_position.SetZ(z); config.m_orientation = AZ::Quaternion::CreateRotationZ(AZ::Constants::HalfPi + (cylinderTheta * i)); - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(cylinderRadius, cylinderWallThickness, cylinderHeight)); - config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfiguration); + + auto shapeConfiguration = AZStd::make_shared( + AZ::Vector3(cylinderRadius, cylinderWallThickness, cylinderHeight)); + + config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), shapeConfiguration); m_cylinder[i] = scene->AddSimulatedBody(&config); } @@ -114,9 +118,9 @@ namespace PhysX::Benchmarks bladeRigidBodyConfig.m_position = position; bladeRigidBodyConfig.m_position.SetZ(position.GetZ() + (bladeHeight / 2.0f)); bladeRigidBodyConfig.m_orientation = AZ::Quaternion::CreateRotationZ(0.0f); - Physics::ColliderConfiguration bladeColliderConfig; - Physics::BoxShapeConfiguration bladeShapeConfiguration(AZ::Vector3(bladeLength, 1.0f, bladeHeight)); - bladeRigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&bladeColliderConfig, &bladeShapeConfiguration); + auto bladeShapeConfiguration = AZStd::make_shared(AZ::Vector3(bladeLength, 1.0f, bladeHeight)); + bladeRigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), bladeShapeConfiguration); m_blade = scene->AddSimulatedBody(&bladeRigidBodyConfig); } diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.cpp index 1684dd4c7f..bc48b5fb92 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -34,9 +35,9 @@ namespace PhysX::Benchmarks AzPhysics::RigidBodyConfiguration rigidBodyConfig; rigidBodyConfig.m_ccdEnabled = enableCCD; - Physics::ColliderConfiguration rigidBodyColliderConfig; + auto rigidBodyColliderConfig = AZStd::make_shared(); - Physics::BoxShapeConfiguration defaultShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3::CreateOne()); + auto defaultShapeConfiguration = AZStd::make_shared(AZ::Vector3::CreateOne()); for (int i = 0; i < numRigidBodies; i++) { //call the optional function pointers, otherwise assign a default @@ -57,16 +58,16 @@ namespace PhysX::Benchmarks rigidBodyConfig.m_orientation = (*genSpawnOriFuncPtr)(i); } - Physics::ShapeConfiguration* shapeConfig = nullptr; + AZStd::shared_ptr shapeConfig = nullptr; if (genColliderFuncPtr != nullptr) { shapeConfig = (*genColliderFuncPtr)(i); } if (shapeConfig == nullptr) { - shapeConfig = &defaultShapeConfiguration; + shapeConfig = defaultShapeConfiguration; } - rigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&rigidBodyColliderConfig, shapeConfig); + rigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(rigidBodyColliderConfig, shapeConfig); AzPhysics::SimulatedBodyHandle simBodyHandle = scene->AddSimulatedBody(&rigidBodyConfig); rigidBodies.push_back(simBodyHandle); diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.h b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.h index ab9a0ba2ab..ab9bd58148 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.h +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXBenchmarksUtilities.h @@ -40,7 +40,7 @@ namespace PhysX::Benchmarks namespace Utils { //! Function pointer to allow Shape configuration customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created) - using GenerateColliderFuncPtr = AZStd::function; + using GenerateColliderFuncPtr = AZStd::function(int)>; //! Function pointer to allow spawn position customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created) using GenerateSpawnPositionFuncPtr = AZStd::function; //! Function pointer to allow spawn orientation customization rigid bodies created with Utils::CreateRigidBodies. int param is the id of the rigid body being created (values 0-N, where N=number requested to be created) diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp index 7d650d6bef..24b51f0085 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp @@ -136,9 +136,8 @@ namespace PhysX::Benchmarks { AZStd::vector joints; - Physics::ColliderConfiguration colliderConfig; - Physics::SphereShapeConfiguration shapeConfiguration = Physics::SphereShapeConfiguration(JointConstants::CreateJointDefaults::ColliderRadius); - AzPhysics::ShapeColliderPair shapeColliderConfig(&colliderConfig, &shapeConfiguration); + auto shapeConfiguration = AZStd::make_shared(JointConstants::CreateJointDefaults::ColliderRadius); + AzPhysics::ShapeColliderPair shapeColliderConfig(AZStd::make_shared(), shapeConfiguration); for (int i = 0; i < numJoints; i++) { JointGroup newJoint; @@ -340,13 +339,13 @@ namespace PhysX::Benchmarks const int numSegments = aznumeric_cast(state.range(0)); //create the collider shape config to use on the whole snake - Physics::SphereShapeConfiguration snakePartShapeConfiguration = Physics::SphereShapeConfiguration(JointConstants::CreateJointDefaults::ColliderRadius); - Physics::ColliderConfiguration snakeHeadcolliderConfig; + auto snakePartShapeConfiguration = AZStd::make_shared(JointConstants::CreateJointDefaults::ColliderRadius); //create the had of the snake this is the only static part. AzPhysics::StaticRigidBodyConfiguration snakeHeadBodyConfig; snakeHeadBodyConfig.m_position = AZ::Vector3::CreateZero(); - snakeHeadBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&snakeHeadcolliderConfig, &snakePartShapeConfiguration); + snakeHeadBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), snakePartShapeConfiguration); AzPhysics::SimulatedBody* snakeHead = nullptr; if (auto* sceneInterface = AZ::Interface::Get()) @@ -358,7 +357,7 @@ namespace PhysX::Benchmarks //create the body Utils::GenerateColliderFuncPtr colliderGenerator = [&snakePartShapeConfiguration]([[maybe_unused]] int idx) -> auto { - return &snakePartShapeConfiguration; + return snakePartShapeConfiguration; }; Utils::GenerateSpawnPositionFuncPtr posGenerator = [](int idx) -> auto { diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp index e295916554..7ad3061910 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp @@ -203,10 +203,10 @@ namespace PhysX::Benchmarks return AZ::Vector3(x, y, z); }; - Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); - Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration* + auto boxShapeConfiguration = AZStd::make_shared(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); + Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) { - return &boxShapeConfiguration; + return boxShapeConfiguration; }; //spawn the rigid bodies AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene, @@ -275,10 +275,10 @@ namespace PhysX::Benchmarks Utils::GenerateMassFuncPtr massGenerator = [&rand]([[maybe_unused]] int idx) -> float { return rand.GetRandomFloat() * 25.0f + 5.0f; }; - Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); - Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration* + auto boxShapeConfiguration = AZStd::make_shared(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); + Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) { - return &boxShapeConfiguration; + return boxShapeConfiguration; }; //spawn the rigid bodies AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene, @@ -408,10 +408,10 @@ namespace PhysX::Benchmarks Utils::GenerateEntityIdFuncPtr entityIdGenerator = [&rand](int idx) -> AZ::EntityId { return AZ::EntityId(static_cast(idx) + RigidBodyConstants::RigidBodys::RigidBodyEntityIdStart); }; - Physics::BoxShapeConfiguration boxShapeConfiguration = Physics::BoxShapeConfiguration(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); - Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) -> Physics::ShapeConfiguration* + auto boxShapeConfiguration = AZStd::make_shared(AZ::Vector3(RigidBodyConstants::RigidBodys::BoxSize)); + Utils::GenerateColliderFuncPtr colliderGenerator = [&boxShapeConfiguration]([[maybe_unused]] int idx) { - return &boxShapeConfiguration; + return boxShapeConfiguration; }; //spawn the rigid bodies AzPhysics::SimulatedBodyHandleList rigidBodies = Utils::CreateRigidBodies(numRigidBodies, m_defaultScene, diff --git a/Gems/PhysX/Code/Tests/ColliderScalingTests.cpp b/Gems/PhysX/Code/Tests/ColliderScalingTests.cpp index ae65fcfc23..19d069331a 100644 --- a/Gems/PhysX/Code/Tests/ColliderScalingTests.cpp +++ b/Gems/PhysX/Code/Tests/ColliderScalingTests.cpp @@ -30,7 +30,7 @@ namespace PhysXEditorTests PhysX::BaseColliderComponent* colliderComponent = gameEntity->FindComponent(); ASSERT_TRUE(colliderComponent != nullptr); - Physics::ShapeConfigurationList shapeConfigList = colliderComponent->GetShapeConfigurations(); + AzPhysics::ShapeColliderPairList shapeConfigList = colliderComponent->GetShapeConfigurations(); EXPECT_EQ(shapeConfigList.size(), 1); for (const auto& shapeConfigPair : shapeConfigList) @@ -68,7 +68,7 @@ namespace PhysXEditorTests AZ::EntityId editorId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.5f)); + worldTM.SetUniformScale(1.5f); worldTM.SetTranslation(AZ::Vector3(5.0f, 6.0f, 7.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(30.0f))); AZ::TransformBus::Event(editorId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -99,7 +99,7 @@ namespace PhysXEditorTests AZ::EntityId editorId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.5f)); + worldTM.SetUniformScale(1.5f); worldTM.SetTranslation(AZ::Vector3(5.0f, 6.0f, 7.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(30.0f))); AZ::TransformBus::Event(editorId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -144,7 +144,7 @@ namespace PhysXEditorTests AZ::EntityId capsuleId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(0.5f)); + worldTM.SetUniformScale(0.5f); worldTM.SetTranslation(AZ::Vector3(3.0f, 1.0f, -4.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationY(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(capsuleId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -176,7 +176,7 @@ namespace PhysXEditorTests AZ::EntityId capsuleId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(0.5f)); + worldTM.SetUniformScale(0.5f); worldTM.SetTranslation(AZ::Vector3(3.0f, 1.0f, -4.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationY(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(capsuleId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -222,7 +222,7 @@ namespace PhysXEditorTests AZ::EntityId sphereId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.2f)); + worldTM.SetUniformScale(1.2f); worldTM.SetTranslation(AZ::Vector3(-2.0f, -1.0f, 3.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(sphereId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -254,7 +254,7 @@ namespace PhysXEditorTests AZ::EntityId sphereId = editorEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.2f)); + worldTM.SetUniformScale(1.2f); worldTM.SetTranslation(AZ::Vector3(-2.0f, -1.0f, 3.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(sphereId, &AZ::TransformBus::Events::SetWorldTM, worldTM); diff --git a/Gems/PhysX/Code/Tests/DebugDrawTests.cpp b/Gems/PhysX/Code/Tests/DebugDrawTests.cpp index 5b41c37f34..610ba8d6f6 100644 --- a/Gems/PhysX/Code/Tests/DebugDrawTests.cpp +++ b/Gems/PhysX/Code/Tests/DebugDrawTests.cpp @@ -32,7 +32,7 @@ namespace PhysXEditorTests AZ::EntityId boxId = boxEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.5f)); + worldTM.SetUniformScale(1.5f); worldTM.SetTranslation(AZ::Vector3(5.0f, 6.0f, 7.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(30.0f))); AZ::TransformBus::Event(boxId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -61,7 +61,7 @@ namespace PhysXEditorTests AZ::EntityId boxId = boxEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.2f)); + worldTM.SetUniformScale(1.2f); worldTM.SetTranslation(AZ::Vector3(4.0f, -3.0f, 1.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationZ(AZ::DegToRad(45.0f))); AZ::TransformBus::Event(boxId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -91,7 +91,7 @@ namespace PhysXEditorTests AZ::EntityId boxId = boxEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.2f)); + worldTM.SetUniformScale(1.2f); worldTM.SetTranslation(AZ::Vector3(4.0f, -3.0f, 1.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationZ(AZ::DegToRad(45.0f))); AZ::TransformBus::Event(boxId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -129,7 +129,7 @@ namespace PhysXEditorTests AZ::EntityId capsuleId = capsuleEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(0.5f)); + worldTM.SetUniformScale(0.5f); worldTM.SetTranslation(AZ::Vector3(3.0f, 1.0f, -4.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationY(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(capsuleId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -158,7 +158,7 @@ namespace PhysXEditorTests AZ::EntityId capsuleId = capsuleEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.4f)); + worldTM.SetUniformScale(1.4f); worldTM.SetTranslation(AZ::Vector3(1.0f, -4.0f, 4.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(45.0f))); AZ::TransformBus::Event(capsuleId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -189,7 +189,7 @@ namespace PhysXEditorTests AZ::EntityId sphereId = sphereEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(1.2f)); + worldTM.SetUniformScale(1.2f); worldTM.SetTranslation(AZ::Vector3(-2.0f, -1.0f, 3.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationX(AZ::DegToRad(90.0f))); AZ::TransformBus::Event(sphereId, &AZ::TransformBus::Events::SetWorldTM, worldTM); @@ -218,7 +218,7 @@ namespace PhysXEditorTests AZ::EntityId sphereId = sphereEntity->GetId(); AZ::Transform worldTM; - worldTM.SetScale(AZ::Vector3(0.8f)); + worldTM.SetUniformScale(0.8f); worldTM.SetTranslation(AZ::Vector3(2.0f, -1.0f, 3.0f)); worldTM.SetRotation(AZ::Quaternion::CreateRotationY(AZ::DegToRad(45.0f))); AZ::TransformBus::Event(sphereId, &AZ::TransformBus::Events::SetWorldTM, worldTM); diff --git a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp index 043bd60acd..c2e0bbbf5e 100644 --- a/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp +++ b/Gems/PhysX/Code/Tests/EditorTestUtilities.cpp @@ -93,39 +93,43 @@ namespace PhysXEditorTests editorEntity->CreateComponent(); editorEntity->CreateComponent(LmbrCentral::EditorCylinderShapeComponentTypeId); editorEntity->Activate(); - + { - UnitTest::ErrorHandler warningHandler("Negative or zero cylinder dimensions are invalid"); + UnitTest::ErrorHandler dimensionWarningHandler("Negative or zero cylinder dimensions are invalid"); + UnitTest::ErrorHandler colliderWarningHandler("No Collider or Shape information found when creating Rigid body"); LmbrCentral::CylinderShapeComponentRequestsBus::Event(editorEntity->GetId(), &LmbrCentral::CylinderShapeComponentRequests::SetRadius, radius); // expect 2 warnings //1 if the radius is invalid //2 when re-creating the underlying simulated body - int expectedWarningCount = radius <= 0.f ? 2 : 0; - EXPECT_EQ(warningHandler.GetWarningCount(), expectedWarningCount); + int expectedWarningCount = radius <= 0.f ? 1 : 0; + EXPECT_EQ(dimensionWarningHandler.GetExpectedWarningCount(), expectedWarningCount); + EXPECT_EQ(colliderWarningHandler.GetExpectedWarningCount(), expectedWarningCount); } - + { - UnitTest::ErrorHandler warningHandler("Negative or zero cylinder dimensions are invalid"); + UnitTest::ErrorHandler dimensionWarningHandler("Negative or zero cylinder dimensions are invalid"); + UnitTest::ErrorHandler colliderWarningHandler("No Collider or Shape information found when creating Rigid body"); LmbrCentral::CylinderShapeComponentRequestsBus::Event(editorEntity->GetId(), &LmbrCentral::CylinderShapeComponentRequests::SetHeight, height); // expect 2 warnings //1 if the radius or height is invalid //2 when re-creating the underlying simulated body - int expectedWarningCount = radius <= 0.f || height <= 0.f ? 2 : 0; - EXPECT_EQ(warningHandler.GetWarningCount(), expectedWarningCount); + int expectedWarningCount = radius <= 0.f || height <= 0.f ? 1 : 0; + EXPECT_EQ(dimensionWarningHandler.GetExpectedWarningCount(), expectedWarningCount); + EXPECT_EQ(colliderWarningHandler.GetExpectedWarningCount(), expectedWarningCount); } EntityPtr gameEntity = CreateActiveGameEntityFromEditorEntity(editorEntity.get()); - + // since there was no editor rigid body component, the runtime entity should have a static rigid body const auto* staticBody = azdynamic_cast(gameEntity->FindComponent()->GetSimulatedBody()); const auto* pxRigidStatic = static_cast(staticBody->GetNativePointer()); - + PHYSX_SCENE_READ_LOCK(pxRigidStatic->getScene()); - + // there should be no shapes on the rigid body because the cylinder radius and/or height is invalid EXPECT_EQ(pxRigidStatic->getNbShapes(), 0); } diff --git a/Gems/PhysX/Code/Tests/PhysXGenericTest.cpp b/Gems/PhysX/Code/Tests/PhysXGenericTest.cpp index 45b1e469f4..7648871380 100644 --- a/Gems/PhysX/Code/Tests/PhysXGenericTest.cpp +++ b/Gems/PhysX/Code/Tests/PhysXGenericTest.cpp @@ -325,9 +325,10 @@ namespace PhysX // Box should start asleep AzPhysics::RigidBodyConfiguration config; config.m_startAsleep = true; - Physics::ColliderConfiguration colliderConfig; - Physics::SphereShapeConfiguration shapeConfiguration; - config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), + AZStd::make_shared() + ); AzPhysics::SimulatedBodyHandle rigidBodyHandle = sceneInterface->AddSimulatedBody(sceneHandle, &config); TestUtils::UpdateScene(sceneHandle, 1.0f / 60.0f, 100); diff --git a/Gems/PhysX/Code/Tests/PhysXGenericTestFixture.cpp b/Gems/PhysX/Code/Tests/PhysXGenericTestFixture.cpp index 5240cc06e6..9955cbbd97 100644 --- a/Gems/PhysX/Code/Tests/PhysXGenericTestFixture.cpp +++ b/Gems/PhysX/Code/Tests/PhysXGenericTestFixture.cpp @@ -104,12 +104,12 @@ namespace PhysX auto colliderConfig = AZStd::make_shared(); colliderConfig->m_collisionLayer = config.m_layer; - Physics::ShapeConfigurationList shapeconfigurationList; + AzPhysics::ShapeColliderPairList shapeconfigurationList; struct Visitor { AZStd::shared_ptr& colliderConfig; - Physics::ShapeConfigurationList& shapeconfigurationList; + AzPhysics::ShapeColliderPairList& shapeconfigurationList; void operator()(const MultiShapeConfig::ShapeList::ShapeData::Box& box) const { diff --git a/Gems/PhysX/Code/Tests/PhysXMaterialLibraryTest.cpp b/Gems/PhysX/Code/Tests/PhysXMaterialLibraryTest.cpp deleted file mode 100644 index 2e09ec8dca..0000000000 --- a/Gems/PhysX/Code/Tests/PhysXMaterialLibraryTest.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace PhysX -{ - class MaterialLibraryTest_MockCatalog - : public AZ::Data::AssetCatalog - , public AZ::Data::AssetCatalogRequestBus::Handler - { - - private: - AZ::Uuid m_randomUuid = AZ::Uuid::CreateRandom(); - AZStd::vector m_mockAssetIds; - - public: - AZ_CLASS_ALLOCATOR(MaterialLibraryTest_MockCatalog, AZ::SystemAllocator, 0); - - MaterialLibraryTest_MockCatalog() - { - AZ::Data::AssetCatalogRequestBus::Handler::BusConnect(); - } - - ~MaterialLibraryTest_MockCatalog() - { - AZ::Data::AssetCatalogRequestBus::Handler::BusDisconnect(); - } - - AZ::Data::AssetId GenerateMockAssetId() - { - AZ::Data::AssetId assetId = AZ::Data::AssetId(AZ::Uuid::CreateRandom(), 0); - m_mockAssetIds.push_back(assetId); - return assetId; - } - - ////////////////////////////////////////////////////////////////////////// - // AssetCatalogRequestBus - AZ::Data::AssetInfo GetAssetInfoById(const AZ::Data::AssetId& id) override - { - AZ::Data::AssetInfo result; - result.m_assetType = AZ::AzTypeInfo::Uuid(); - auto foundId = AZStd::find(m_mockAssetIds.begin(), m_mockAssetIds.end(), id); - if (foundId != m_mockAssetIds.end()) - { - result.m_assetId = *foundId; - } - - return result; - } - ////////////////////////////////////////////////////////////////////////// - - AZ::Data::AssetStreamInfo GetStreamInfoForLoad(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override - { - EXPECT_TRUE(type == AZ::AzTypeInfo::Uuid()); - AZ::Data::AssetStreamInfo info; - info.m_dataOffset = 0; - info.m_streamFlags = AZ::IO::OpenMode::ModeRead; - - for (int i = 0; i < m_mockAssetIds.size(); ++i) - { - if (m_mockAssetIds[i] == id) - { - info.m_streamName = AZStd::string::format("MaterialLibraryAssetName%d", i); - } - } - - if (!info.m_streamName.empty()) - { - // this ensures tha parallel running unit tests do not overlap their files that they use. - AZStd::string fullName = AZStd::string::format("%s-%s", m_randomUuid.ToString().c_str(), info.m_streamName.c_str()); - info.m_streamName = fullName; - info.m_dataLen = static_cast(AZ::IO::SystemFile::Length(info.m_streamName.c_str())); - } - else - { - info.m_dataLen = 0; - } - - return info; - } - - AZ::Data::AssetStreamInfo GetStreamInfoForSave(const AZ::Data::AssetId& id, const AZ::Data::AssetType& type) override - { - AZ::Data::AssetStreamInfo info; - info = GetStreamInfoForLoad(id, type); - info.m_streamFlags = AZ::IO::OpenMode::ModeWrite; - return info; - } - - bool SaveAsset(AZ::Data::Asset& asset) - { - volatile bool isDone = false; - volatile bool succeeded = false; - AZ::Data::AssetBusCallbacks callbacks; - callbacks.SetCallbacks(nullptr, nullptr, nullptr, - [&isDone, &succeeded](const AZ::Data::Asset& /*asset*/, bool isSuccessful, AZ::Data::AssetBusCallbacks& /*callbacks*/) - { - isDone = true; - succeeded = isSuccessful; - }, nullptr, nullptr, nullptr); - - callbacks.BusConnect(asset.GetId()); - asset.Save(); - - while (!isDone) - { - AZ::Data::AssetManager::Instance().DispatchEvents(); - } - return succeeded; - } - }; - - class DISABLED_PhysXMaterialLibraryTest - : public ::testing::Test - { - protected: - void SetUp() override - { - m_catalog = AZStd::make_unique(); - AZ::Data::AssetManager::Instance().RegisterCatalog(m_catalog.get(), AZ::AzTypeInfo::Uuid()); - } - - void TearDown() override - { - AZ::Data::AssetManager::Instance().UnregisterCatalog(m_catalog.get()); - } - - AZStd::unique_ptr m_catalog; - }; - - TEST_F(DISABLED_PhysXMaterialLibraryTest, DISABLED_DefaultMaterialLibrary_CorrectMaterialLibraryIsInferred) - { - AZ::Data::Asset materialLibrary = AZ::Interface::Get()->GetDefaultMaterialLibrary(); - - AZ::Data::AssetId dummyAssetId = AZ::Data::AssetId(AZ::Uuid::CreateName("DummyLibrary.physmaterial")); - AZ::Data::Asset dummyMaterialLibAsset = AZ::Data::AssetManager::Instance().GetAsset(dummyAssetId, AZ::Data::AssetLoadBehavior::Default); - materialLibrary = dummyMaterialLibAsset; - AZ::Interface::Get()->UpdateDefaultMaterialLibrary(materialLibrary); - - // We must have now a default material library setup - ASSERT_TRUE(materialLibrary.GetId().IsValid()); - - AZ::Data::AssetId otherDummyAssetId = AZ::Data::AssetId(AZ::Uuid::CreateName("OtherDummyLibrary.physmaterial")); - AZ::Data::Asset otherDummyMaterialLibAsset = AZ::Data::AssetManager::Instance().GetAsset(otherDummyAssetId, AZ::Data::AssetLoadBehavior::Default); - - // Set selection's material library to a different one than default material library - Physics::MaterialSelection selectionTest; - selectionTest.SetMaterialLibrary(otherDummyAssetId); - - ASSERT_TRUE(selectionTest.GetMaterialLibraryAssetId().IsValid()); - ASSERT_EQ(selectionTest.GetMaterialLibraryAssetId(), selectionTest.GetMaterialLibraryAssetId()); - ASSERT_NE(selectionTest.GetMaterialLibraryAssetId(), materialLibrary.GetId()); - - // By reseting the selection, now it should infer to the default material library set in the global configuration - selectionTest.ResetToDefaultMaterialLibrary(); - - ASSERT_TRUE(selectionTest.GetMaterialLibraryAssetId().IsValid()); - ASSERT_EQ(selectionTest.GetMaterialLibraryAssetId(), materialLibrary.GetId()); - - // Release material library so we exit gracefully - materialLibrary = {}; - AZ::Interface::Get()->UpdateDefaultMaterialLibrary(materialLibrary); - } -} diff --git a/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp b/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp index 2a38e1b867..9514f6908e 100644 --- a/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp +++ b/Gems/PhysX/Code/Tests/PhysXSceneTests.cpp @@ -83,10 +83,10 @@ namespace PhysX auto* sceneInterface = AZ::Interface::Get(); //add a static rigid body - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); AzPhysics::StaticRigidBodyConfiguration config; - config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config); EXPECT_FALSE(simBodyHandle == AzPhysics::InvalidSimulatedBodyHandle); } @@ -104,14 +104,15 @@ namespace PhysX EXPECT_TRUE(emptyBodies.empty()); //add some rigid bodies - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); constexpr const int numberOfBodies = 100; for (int i = 0; i < numberOfBodies; i++) { const float xpos = 2.0f * static_cast(i); AzPhysics::RigidBodyConfiguration* config = aznew AzPhysics::RigidBodyConfiguration(); - config->m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config->m_colliderAndShapeData = shapeColliderData; config->m_position = AZ::Vector3::CreateAxisX(xpos); configs.emplace_back(config); } @@ -150,15 +151,16 @@ namespace PhysX AzPhysics::SimulatedBodyConfigurationList configs; //add some rigid bodies - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); - + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); + constexpr const int numberOfBodies = 100; for (int i = 0; i < numberOfBodies; i++) { const float xpos = 2.0f * static_cast(i); AzPhysics::RigidBodyConfiguration* config = aznew AzPhysics::RigidBodyConfiguration(); - config->m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config->m_colliderAndShapeData = shapeColliderData; config->m_position = AZ::Vector3::CreateAxisX(xpos); configs.emplace_back(config); } @@ -205,10 +207,11 @@ namespace PhysX auto* sceneInterface = AZ::Interface::Get(); //add a simulated body - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); AzPhysics::StaticRigidBodyConfiguration config; - config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config.m_colliderAndShapeData = shapeColliderData; AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config); //remove the body @@ -223,10 +226,11 @@ namespace PhysX auto* sceneInterface = AZ::Interface::Get(); //add a few simulated body - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); AzPhysics::StaticRigidBodyConfiguration config; - config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config.m_colliderAndShapeData = shapeColliderData; AzPhysics::SimulatedBodyHandleList simBodyHandles; constexpr const int numBodies = 10; @@ -281,10 +285,11 @@ namespace PhysX sceneInterface->RegisterSimulationBodyRemovedHandler(m_testSceneHandle, removedEvent); //add a simulated body - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); AzPhysics::StaticRigidBodyConfiguration config; - config.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + config.m_colliderAndShapeData = shapeColliderData; AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &config); EXPECT_TRUE(addTriggered); @@ -552,17 +557,18 @@ namespace PhysX auto* sceneInterface = AZ::Interface::Get(); // setup shape config - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(1.0f, 1.0f, 1.0f)); + AzPhysics::ShapeColliderPair shapeColliderData( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3::CreateOne())); // add a static simulated body - this is not expected to be reported as an active actor AzPhysics::StaticRigidBodyConfiguration staticConfig; - staticConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + staticConfig.m_colliderAndShapeData = shapeColliderData; AzPhysics::SimulatedBodyHandle staticSphereHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &staticConfig); // add a rigid body - this is expect to be reported as an active actor AzPhysics::RigidBodyConfiguration rigidConfig; - rigidConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + rigidConfig.m_colliderAndShapeData = shapeColliderData; AzPhysics::SimulatedBodyHandle rigidSphereHandle = sceneInterface->AddSimulatedBody(m_testSceneHandle, &rigidConfig); // create + register the active handler diff --git a/Gems/PhysX/Code/Tests/PhysXSpecificTest.cpp b/Gems/PhysX/Code/Tests/PhysXSpecificTest.cpp index 74c88d0b46..98ee82f11a 100644 --- a/Gems/PhysX/Code/Tests/PhysXSpecificTest.cpp +++ b/Gems/PhysX/Code/Tests/PhysXSpecificTest.cpp @@ -539,14 +539,14 @@ namespace PhysX TEST_F(PhysXSpecificTest, RigidBody_CenterOfMassOffsetComputed) { AZ::Vector3 halfExtents(1.0f, 2.0f, 3.0f); - Physics::BoxShapeConfiguration shapeConfig(halfExtents * 2.0f); - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); + auto shapeConfig = AZStd::make_shared(halfExtents * 2.0f); + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); AzPhysics::RigidBodyConfiguration rigidBodyConfiguration; rigidBodyConfiguration.m_computeCenterOfMass = true; rigidBodyConfiguration.m_computeInertiaTensor = true; - rigidBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig); + rigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig); AzPhysics::RigidBody* rigidBody = nullptr; if (auto* sceneInterface = AZ::Interface::Get()) { @@ -562,15 +562,15 @@ namespace PhysX TEST_F(PhysXSpecificTest, RigidBody_CenterOfMassOffsetSpecified) { AZ::Vector3 halfExtents(1.0f, 2.0f, 3.0f); - Physics::BoxShapeConfiguration shapeConfig(halfExtents * 2.0f); - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); + auto shapeConfig = AZStd::make_shared(halfExtents * 2.0f); + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); AzPhysics::RigidBodyConfiguration rigidBodyConfiguration; rigidBodyConfiguration.m_computeCenterOfMass = false; rigidBodyConfiguration.m_centerOfMassOffset = AZ::Vector3::CreateOne(); rigidBodyConfiguration.m_computeInertiaTensor = true; - rigidBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig); + rigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig); AzPhysics::RigidBody* rigidBody = nullptr; if (auto* sceneInterface = AZ::Interface::Get()) @@ -1113,15 +1113,15 @@ namespace PhysX auto CreateBoxRigidBody = [this](const AZ::Vector3& position, bool simulatedFlag, bool triggerFlag) -> AzPhysics::RigidBody* { - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_isSimulated = simulatedFlag; - colliderConfig.m_isTrigger = triggerFlag; - Physics::BoxShapeConfiguration shapeConfig; + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_isSimulated = simulatedFlag; + colliderConfig->m_isTrigger = triggerFlag; AzPhysics::RigidBodyConfiguration rigidBodyConfig; rigidBodyConfig.m_entityId = AZ::EntityId(0); // Set entity ID to avoid warnings in OnTriggerEnter rigidBodyConfig.m_position = position; - rigidBodyConfig.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig); + rigidBodyConfig.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + colliderConfig, AZStd::make_shared()); if (auto* sceneInterface = AZ::Interface::Get()) { diff --git a/Gems/PhysX/Code/Tests/PhysXTestCommon.cpp b/Gems/PhysX/Code/Tests/PhysXTestCommon.cpp index 93ad7704c9..b4e5410981 100644 --- a/Gems/PhysX/Code/Tests/PhysXTestCommon.cpp +++ b/Gems/PhysX/Code/Tests/PhysXTestCommon.cpp @@ -107,7 +107,7 @@ namespace PhysX auto shapeConfig = AZStd::make_shared(radius); auto shpereColliderComponent = entity->CreateComponent(); - shpereColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + shpereColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); AzPhysics::RigidBodyConfiguration rigidBodyConfig; rigidBodyConfig.m_computeMass = false; @@ -136,7 +136,7 @@ namespace PhysX colliderConfig->m_collisionLayer = layer; auto shapeConfig = AZStd::make_shared(radius); auto sphereColliderComponent = entity->CreateComponent(); - sphereColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + sphereColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); entity->CreateComponent(sceneHandle); @@ -171,7 +171,7 @@ namespace PhysX auto boxColliderComponent = entity->CreateComponent(); auto colliderConfig = AZStd::make_shared(); colliderConfig->m_collisionLayer = layer; - boxColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + boxColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); entity->CreateComponent(sceneHandle); entity->Activate(); return entity; @@ -195,7 +195,7 @@ namespace PhysX colliderConfig->m_collisionLayer = layer; auto shapeConfig = AZStd::make_shared(height, radius); auto capsuleColliderComponent = entity->CreateComponent(); - capsuleColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + capsuleColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); AzPhysics::RigidBodyConfiguration rigidBodyConfig; rigidBodyConfig.m_computeMass = false; @@ -223,7 +223,7 @@ namespace PhysX colliderConfig->m_collisionLayer = layer; auto shapeConfig = AZStd::make_shared(height, radius); auto capsuleColliderComponent = entity->CreateComponent(); - capsuleColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + capsuleColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); entity->CreateComponent(sceneHandle); @@ -244,14 +244,13 @@ namespace PhysX AZ_Assert(cookingResult, "Failed to cook the cube mesh."); // Setup shape & collider configurations - Physics::CookedMeshShapeConfiguration shapeConfig; - shapeConfig.SetCookedMeshData(cookedData.data(), cookedData.size(), + auto shapeConfig = AZStd::make_shared(); + shapeConfig->SetCookedMeshData(cookedData.data(), cookedData.size(), Physics::CookedMeshShapeConfiguration::MeshType::TriangleMesh); - Physics::ColliderConfiguration colliderConfig; - AzPhysics::StaticRigidBodyConfiguration staticRigidBodyConfiguration; - staticRigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&colliderConfig, &shapeConfig); + staticRigidBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), shapeConfig); if (auto* sceneInterface = AZ::Interface::Get()) { @@ -290,7 +289,7 @@ namespace PhysX auto shapeConfig = AZStd::make_shared(dimensions); auto boxColliderComponent = entity->CreateComponent(); - boxColliderComponent->SetShapeConfigurationList({ AZStd::make_pair(colliderConfig, shapeConfig) }); + boxColliderComponent->SetShapeConfigurationList({ AzPhysics::ShapeColliderPair(colliderConfig, shapeConfig) }); AzPhysics::RigidBodyConfiguration rigidBodyConfig; rigidBodyConfig.m_computeMass = false; @@ -307,7 +306,7 @@ namespace PhysX AZ::TransformConfig transformConfig; transformConfig.m_worldTransform = AZ::Transform::CreateTranslation(position); entity->CreateComponent()->SetConfiguration(transformConfig); - Physics::ShapeConfigurationList shapeConfigList = { AZStd::make_pair( + AzPhysics::ShapeColliderPairList shapeConfigList = { AzPhysics::ShapeColliderPair( AZStd::make_shared(), AZStd::make_shared()) }; auto boxCollider = entity->CreateComponent(); @@ -371,10 +370,10 @@ namespace PhysX AzPhysics::StaticRigidBody* AddStaticFloorToScene(AzPhysics::SceneHandle sceneHandle, const AZ::Transform& transform) { - Physics::ColliderConfiguration colliderConfig; - Physics::BoxShapeConfiguration shapeConfiguration(AZ::Vector3(20.0f, 20.0f, 1.0f)); AzPhysics::StaticRigidBodyConfiguration staticBodyConfiguration; - staticBodyConfiguration.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + staticBodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(), + AZStd::make_shared(AZ::Vector3(20.0f, 20.0f, 1.0f))); if (auto* sceneInterface = AZ::Interface::Get()) { AzPhysics::SimulatedBodyHandle simBodyHandle = sceneInterface->AddSimulatedBody(sceneHandle, &staticBodyConfiguration); @@ -410,10 +409,10 @@ namespace PhysX AzPhysics::SimulatedBodyHandle AddSphereToScene(AzPhysics::SceneHandle sceneHandle, const AZ::Vector3& position, const float radius /*= 0.5f*/, const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/) { - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_collisionLayer = layer; - Physics::SphereShapeConfiguration shapeConfiguration; - shapeConfiguration.m_radius = radius; + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_collisionLayer = layer; + auto shapeConfiguration = AZStd::make_shared(); + shapeConfiguration->m_radius = radius; AzPhysics::RigidBodyConfiguration rigidBodySettings; rigidBodySettings.m_computeMass = false; rigidBodySettings.m_computeInertiaTensor = false; @@ -421,7 +420,7 @@ namespace PhysX rigidBodySettings.m_mass = 1.0f; rigidBodySettings.m_position = position; rigidBodySettings.m_linearDamping = 0.0f; - rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration); if (auto* sceneInterface = AZ::Interface::Get()) { @@ -435,11 +434,12 @@ namespace PhysX const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/) { AzPhysics::RigidBodyConfiguration rigidBodySettings; - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_collisionLayer = layer; - colliderConfig.m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); - Physics::CapsuleShapeConfiguration shapeConfig(height, radius); - rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfig); + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_collisionLayer = layer; + colliderConfig->m_rotation = AZ::Quaternion::CreateRotationX(AZ::Constants::HalfPi); + + rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, + AZStd::make_shared(height, radius)); rigidBodySettings.m_position = position; rigidBodySettings.m_computeMass = false; rigidBodySettings.m_computeInertiaTensor = false; @@ -457,10 +457,10 @@ namespace PhysX const AZ::Vector3& position, const AZ::Vector3& dimensions /*= AZ::Vector3(1.0f)*/, const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/) { - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_collisionLayer = layer; - Physics::BoxShapeConfiguration shapeConfiguration; - shapeConfiguration.m_dimensions = dimensions; + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_collisionLayer = layer; + auto shapeConfiguration = AZStd::make_shared(); + shapeConfiguration->m_dimensions = dimensions; AzPhysics::RigidBodyConfiguration rigidBodySettings; rigidBodySettings.m_computeMass = false; @@ -469,7 +469,7 @@ namespace PhysX rigidBodySettings.m_mass = 1.0f; rigidBodySettings.m_position = position; rigidBodySettings.m_linearDamping = 0.0f; - rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration); if (auto* sceneInterface = AZ::Interface::Get()) { return sceneInterface->AddSimulatedBody(sceneHandle, &rigidBodySettings); @@ -481,13 +481,14 @@ namespace PhysX const AZ::Vector3& position, const AZ::Vector3& dimensions /*= AZ::Vector3(1.0f)*/, const AzPhysics::CollisionLayer& layer /*= AzPhysics::CollisionLayer::Default*/) { - Physics::ColliderConfiguration colliderConfig; - colliderConfig.m_collisionLayer = layer; - Physics::BoxShapeConfiguration shapeConfiguration; - shapeConfiguration.m_dimensions = dimensions; + auto colliderConfig = AZStd::make_shared(); + colliderConfig->m_collisionLayer = layer; + auto shapeConfiguration = AZStd::make_shared(); + shapeConfiguration->m_dimensions = dimensions; + AzPhysics::StaticRigidBodyConfiguration rigidBodySettings; rigidBodySettings.m_position = position; - rigidBodySettings.m_colliderAndShapeData = AZStd::make_pair(&colliderConfig, &shapeConfiguration); + rigidBodySettings.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(colliderConfig, shapeConfiguration); if (auto* sceneInterface = AZ::Interface::Get()) { diff --git a/Gems/PhysX/Code/Tests/RigidBodyComponentTests.cpp b/Gems/PhysX/Code/Tests/RigidBodyComponentTests.cpp index eee747d390..4ff88c0b3b 100644 --- a/Gems/PhysX/Code/Tests/RigidBodyComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/RigidBodyComponentTests.cpp @@ -38,8 +38,8 @@ namespace PhysXEditorTests const AZ::Aabb originalAabb = rigidBodyComponent->GetRigidBody()->GetAabb(); // Update the scale - const AZ::Vector3 scale(2.0f); - AZ::TransformBus::Event(editorEntity->GetId(), &AZ::TransformInterface::SetLocalScale, scale); + float scale = 2.0f; + AZ::TransformBus::Event(editorEntity->GetId(), &AZ::TransformInterface::SetLocalUniformScale, scale); // Trigger editor physics world update so EditorRigidBodyComponent can process scale change auto* physicsSystem = AZ::Interface::Get(); @@ -89,8 +89,8 @@ namespace PhysXEditorTests idPair, &PhysX::EditorColliderComponentRequests::SetColliderOffset, offset); // Update the scale - const AZ::Vector3 scale(2.0f); - AZ::TransformBus::Event(editorEntity->GetId(), &AZ::TransformInterface::SetLocalScale, scale); + float scale = 2.0f; + AZ::TransformBus::Event(editorEntity->GetId(), &AZ::TransformInterface::SetLocalUniformScale, scale); // Update editor world to let updates to be applied physicsSystem->Simulate(0.1f); diff --git a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp index b00e226078..c8ab158d77 100644 --- a/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp +++ b/Gems/PhysX/Code/Tests/ShapeColliderComponentTests.cpp @@ -241,7 +241,7 @@ namespace PhysXEditorTests SetPolygonPrismHeight(entityId, 2.0f); // update the transform scale and non-uniform scale - AZ::TransformBus::Event(entityId, &AZ::TransformBus::Events::SetScale, AZ::Vector3(2.0f)); + AZ::TransformBus::Event(entityId, &AZ::TransformBus::Events::SetLocalUniformScale, 2.0f); AZ::NonUniformScaleRequestBus::Event(entityId, &AZ::NonUniformScaleRequests::SetScale, AZ::Vector3(0.5f, 1.5f, 2.0f)); EntityPtr gameEntity = CreateActiveGameEntityFromEditorEntity(editorEntity.get()); @@ -347,6 +347,7 @@ namespace PhysXEditorTests TEST_F(PhysXEditorFixture, EditorShapeColliderComponent_ShapeColliderWithUnsupportedShape_HandledGracefully) { UnitTest::ErrorHandler unsupportedShapeWarningHandler("Unsupported shape"); + UnitTest::ErrorHandler rigidBodyWarningHandler("No Collider or Shape information found when creating Rigid body"); // create an editor entity with a shape collider component and a cylinder shape component // the cylinder shape is not currently supported by the shape collider component @@ -355,10 +356,8 @@ namespace PhysXEditorTests editorEntity->CreateComponent(LmbrCentral::EditorCompoundShapeComponentTypeId); editorEntity->Activate(); - // expect 2 warnings - //1 raised for the unsupported shape - //2 when re-creating the underlying simulated body - EXPECT_EQ(unsupportedShapeWarningHandler.GetWarningCount(), 2); + EXPECT_EQ(unsupportedShapeWarningHandler.GetExpectedWarningCount(), 1); + EXPECT_EQ(rigidBodyWarningHandler.GetExpectedWarningCount(), 1); EntityPtr gameEntity = CreateActiveGameEntityFromEditorEntity(editorEntity.get()); @@ -435,8 +434,8 @@ namespace PhysXEditorTests &LmbrCentral::BoxShapeComponentRequests::GetBoxDimensions); // update the transform - const AZ::Vector3 scale(2.0f); - AZ::TransformBus::Event(editorEntityId, &AZ::TransformInterface::SetLocalScale, scale); + const float scale = 2.0f; + AZ::TransformBus::Event(editorEntityId, &AZ::TransformInterface::SetLocalUniformScale, scale); const AZ::Vector3 translation(10.0f, 20.0f, 30.0f); AZ::TransformBus::Event(editorEntityId, &AZ::TransformInterface::SetWorldTranslation, translation); @@ -527,10 +526,8 @@ namespace PhysXEditorTests editorParentEntity->Activate(); // set some scale to parent entity - const AZ::Vector3 parentScale(2.0f); - AZ::TransformBus::Event(editorParentEntity->GetId(), - &AZ::TransformInterface::SetLocalScale, - parentScale); + const float parentScale = 2.0f; + AZ::TransformBus::Event(editorParentEntity->GetId(), &AZ::TransformInterface::SetLocalUniformScale, parentScale); // create an editor child entity with a shape collider component and a box shape component EntityPtr editorChildEntity = CreateInactiveEditorEntity("ChildEntity"); diff --git a/Gems/PhysX/Code/physx_tests_files.cmake b/Gems/PhysX/Code/physx_tests_files.cmake index 406aed64a7..79999c5f74 100644 --- a/Gems/PhysX/Code/physx_tests_files.cmake +++ b/Gems/PhysX/Code/physx_tests_files.cmake @@ -23,7 +23,6 @@ set(FILES Tests/PhysXGenericTest.cpp Tests/PhysXSpecificTest.cpp Tests/PhysXForceRegionTest.cpp - Tests/PhysXMaterialLibraryTest.cpp Tests/PhysXCollisionFilteringTest.cpp Tests/PhysXJointsTest.cpp Tests/PhysXSceneTests.cpp diff --git a/Gems/PhysXDebug/Code/CMakeLists.txt b/Gems/PhysXDebug/Code/CMakeLists.txt index f198f6f26e..b0a05ef146 100644 --- a/Gems/PhysXDebug/Code/CMakeLists.txt +++ b/Gems/PhysXDebug/Code/CMakeLists.txt @@ -44,6 +44,9 @@ ly_add_target( Gem::PhysX Gem::ImGui ) +# use the PhysXDebug module in Clients and Servers: +ly_create_alias(NAME PhysXDebug.Clients NAMESPACE Gem TARGETS Gem::PhysXDebug) +ly_create_alias(NAME PhysXDebug.Servers NAMESPACE Gem TARGETS Gem::PhysXDebug) if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -66,11 +69,15 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::CryCommon Legacy::Editor.Headers AZ::AzToolsFramework - Gem::PhysX + Gem::PhysX.Editor Gem::ImGui.imguilib - Gem::ImGui + Gem::ImGui.Editor RUNTIME_DEPENDENCIES Gem::PhysX.Editor Gem::ImGui.Editor ) + # use the PhysXDebug.Editor module in dev tools: + ly_create_alias(NAME PhysXDebug.Builders NAMESPACE Gem TARGETS Gem::PhysXDebug.Editor) + ly_create_alias(NAME PhysXDebug.Tools NAMESPACE Gem TARGETS Gem::PhysXDebug.Editor) + endif() diff --git a/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_ddna.tif.imagesettings b/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_ddna.tif.imagesettings index c2fe2400cb..9da169c456 100644 --- a/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_ddna.tif.imagesettings +++ b/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_ddna.tif.imagesettings @@ -17,7 +17,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_spec.tif.imagesettings b/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_spec.tif.imagesettings index c3632028c2..43410a50df 100644 --- a/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_spec.tif.imagesettings +++ b/Gems/PhysXSamples/Assets/Characters/Cowboy/Actor/Textures/Cowboy_01_spec.tif.imagesettings @@ -17,7 +17,7 @@ - + @@ -81,7 +81,7 @@ - + diff --git a/AutomatedTesting/Gem/Code/Platform/iOS/runtime_dependencies.cmake b/Gems/PhysXSamples/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/iOS/runtime_dependencies.cmake rename to Gems/PhysXSamples/CMakeLists.txt diff --git a/AutomatedTesting/Gem/Code/Platform/iOS/tool_dependencies.cmake b/Gems/PhysicsEntities/CMakeLists.txt similarity index 100% rename from AutomatedTesting/Gem/Code/Platform/iOS/tool_dependencies.cmake rename to Gems/PhysicsEntities/CMakeLists.txt diff --git a/Gems/Prefab/PrefabBuilder/CMakeLists.txt b/Gems/Prefab/PrefabBuilder/CMakeLists.txt index 22b89287ca..dbd3c2281b 100644 --- a/Gems/Prefab/PrefabBuilder/CMakeLists.txt +++ b/Gems/Prefab/PrefabBuilder/CMakeLists.txt @@ -38,14 +38,16 @@ ly_add_target( Gem::PrefabBuilder.Static ) -ly_add_target_dependencies( - TARGETS - AssetBuilder - AssetProcessor - AssetProcessorBatch - DEPENDENT_TARGETS - Gem::PrefabBuilder -) +# the prefab builder only needs to be active in builders +# use the PrefabBuilder module in Clients and Servers: +ly_create_alias(NAME PrefabBuilder.Builders NAMESPACE Gem TARGETS Gem::PrefabBuilder) + +# we automatically add this gem, if it is present, to all our known set of builder applications: +ly_enable_gems(GEMS PrefabBuilder VARIANTS Builders TARGETS AssetProcessor AssetProcessorBatch AssetBuilder) + +# if you have a custom builder application in your project, then use ly_enable_gems() to +# add it to that application for your project, like this to make YOUR_TARGET_NAME load it automatically +# ly_enable_gems(PROJECT (YOUR_PROJECT_NAME) GEMS PrefabBuilder VARIANTS Builders TARGETS (YOUR_TARGET_NAME) ) if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) ly_add_target( diff --git a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp index 2bb0d8aaf3..ace089b9bd 100644 --- a/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp +++ b/Gems/Prefab/PrefabBuilder/PrefabBuilderTests.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace UnitTest @@ -172,6 +173,12 @@ namespace UnitTest void PrefabBuilderTests::SetUp() { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + AZ::ComponentApplication::Descriptor desc; m_app.Start(desc); m_app.CreateReflectionManager(); diff --git a/Gems/Presence/Code/CMakeLists.txt b/Gems/Presence/Code/CMakeLists.txt index 07780fc8eb..b9db324996 100644 --- a/Gems/Presence/Code/CMakeLists.txt +++ b/Gems/Presence/Code/CMakeLists.txt @@ -44,3 +44,6 @@ ly_add_target( AZ::AzFramework Gem::Presence.Headers ) + +# we activate the presence gem (if enabled) only on client applications such as the launcher: +ly_create_alias(NAME Presence.Clients NAMESPACE Gem TARGETS Gem::Presence) diff --git a/Tests/demos/win/__init__.py b/Gems/PrimitiveAssets/CMakeLists.txt old mode 100755 new mode 100644 similarity index 100% rename from Tests/demos/win/__init__.py rename to Gems/PrimitiveAssets/CMakeLists.txt diff --git a/Gems/PythonAssetBuilder/Code/CMakeLists.txt b/Gems/PythonAssetBuilder/Code/CMakeLists.txt index 60af675bc6..4af266f56d 100644 --- a/Gems/PythonAssetBuilder/Code/CMakeLists.txt +++ b/Gems/PythonAssetBuilder/Code/CMakeLists.txt @@ -69,6 +69,11 @@ ly_add_target( Gem::EditorPythonBindings.Editor ) +# the above target is used in both builders like AssetProcessor and Tools like the Editor +# but is not used in clients or servers +ly_create_alias(NAME PythonAssetBuilder.Tools NAMESPACE Gem TARGETS Gem::PythonAssetBuilder.Editor) +ly_create_alias(NAME PythonAssetBuilder.Builders NAMESPACE Gem TARGETS Gem::PythonAssetBuilder.Editor) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/QtForPython/Code/CMakeLists.txt b/Gems/QtForPython/Code/CMakeLists.txt index 413e542c9f..c11d93634e 100644 --- a/Gems/QtForPython/Code/CMakeLists.txt +++ b/Gems/QtForPython/Code/CMakeLists.txt @@ -23,6 +23,7 @@ endif() ly_add_target( NAME QtForPython.Editor.Static STATIC NAMESPACE Gem + find_package(Qt) FILES_CMAKE qtforpython_editor_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake PLATFORM_INCLUDE_FILES @@ -40,6 +41,7 @@ ly_add_target( Gem::EditorPythonBindings.Static RUNTIME_DEPENDENCIES 3rdParty::pyside2 + Qt5::Test ) ly_add_target( @@ -53,3 +55,9 @@ ly_add_target( RUNTIME_DEPENDENCIES Gem::EditorPythonBindings.Editor ) + +# the above target is used in both builders like AssetProcessor and Tools like the Editor +# but is not used in clients or servers +ly_create_alias(NAME QtForPython.Tools NAMESPACE Gem TARGETS Gem::QtForPython.Editor) +ly_create_alias(NAME QtForPython.Builders NAMESPACE Gem TARGETS Gem::QtForPython.Editor) + diff --git a/Gems/RADTelemetry/Code/CMakeLists.txt b/Gems/RADTelemetry/Code/CMakeLists.txt index 78a5561b7c..8b3cc70570 100644 --- a/Gems/RADTelemetry/Code/CMakeLists.txt +++ b/Gems/RADTelemetry/Code/CMakeLists.txt @@ -42,3 +42,8 @@ ly_add_target( PRIVATE Gem::RADTelemetry.Static ) + +# the RADTelemetry module above can be used in all kinds of applications, but we don't enable it in asset builders +ly_create_alias(NAME RADTelemetry.Clients NAMESPACE Gem TARGETS Gem::RADTelemetry) +ly_create_alias(NAME RADTelemetry.Tools NAMESPACE Gem TARGETS Gem::RADTelemetry) +ly_create_alias(NAME RADTelemetry.Servers NAMESPACE Gem TARGETS Gem::RADTelemetry) diff --git a/Gems/SaveData/Code/CMakeLists.txt b/Gems/SaveData/Code/CMakeLists.txt index 46c6e91f58..d9dc62ef03 100644 --- a/Gems/SaveData/Code/CMakeLists.txt +++ b/Gems/SaveData/Code/CMakeLists.txt @@ -46,6 +46,9 @@ ly_add_target( Gem::SaveData.Static ) +# the SaveData module above is only used in Clients by default. +ly_create_alias(NAME SaveData.Clients NAMESPACE Gem TARGETS Gem::SaveData) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/SceneLoggingExample/Code/CMakeLists.txt b/Gems/SceneLoggingExample/Code/CMakeLists.txt index 8cd012c4c2..6370420928 100644 --- a/Gems/SceneLoggingExample/Code/CMakeLists.txt +++ b/Gems/SceneLoggingExample/Code/CMakeLists.txt @@ -40,3 +40,7 @@ ly_add_target( PRIVATE Gem::SceneLoggingExample.Static ) + +# the SceneLoggingExample module above is only used in Builders and Tools by default. +ly_create_alias(NAME SceneLoggingExample.Builders NAMESPACE Gem TARGETS Gem::SceneLoggingExample) +ly_create_alias(NAME SceneLoggingExample.Tools NAMESPACE Gem TARGETS Gem::SceneLoggingExample) diff --git a/Gems/SceneProcessing/Code/CMakeLists.txt b/Gems/SceneProcessing/Code/CMakeLists.txt index 67124a74d5..4b0dfbab27 100644 --- a/Gems/SceneProcessing/Code/CMakeLists.txt +++ b/Gems/SceneProcessing/Code/CMakeLists.txt @@ -66,6 +66,10 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) AZ::SceneCore AZ::SceneData ) + # the SceneProcessing.Editor module above is only used in Builders and Tools. + ly_create_alias(NAME SceneProcessing.Builders NAMESPACE Gem TARGETS Gem::SceneProcessing.Editor) + ly_create_alias(NAME SceneProcessing.Tools NAMESPACE Gem TARGETS Gem::SceneProcessing.Editor) + endif() ################################################################################ @@ -84,7 +88,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - Gem::SceneProcessing + RUNTIME_DEPENDENCIES + Gem::SceneProcessing ) ly_add_googletest( NAME Gem::SceneProcessing.Tests diff --git a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp index 592a8e2a75..45908eb2d5 100644 --- a/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/Generation/Components/MeshOptimizer/MeshOptimizerComponent.cpp @@ -135,7 +135,7 @@ namespace AZ::SceneGenerationComponents { for (size_t controlPointIndex = 0; controlPointIndex < skinData.get().GetVertexCount(); ++controlPointIndex) { - const int usedPointIndex = meshData->GetUsedPointIndexForControlPoint(aznumeric_caster(controlPointIndex)); + const int usedPointIndex = meshData->GetUsedPointIndexForControlPoint(meshData->GetControlPointIndex(aznumeric_caster(controlPointIndex))); const size_t linkCount = skinData.get().GetLinkCount(controlPointIndex); if (usedPointIndex < 0 || linkCount == 0) diff --git a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.cpp b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.cpp index e71a5207d0..25faca3667 100644 --- a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.cpp +++ b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.cpp @@ -72,6 +72,11 @@ namespace SceneBuilder m_sceneBuilder.BusDisconnect(); } + void BuilderPluginComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) + { + required.emplace_back(AZ_CRC_CE("AssetImportRequestHandler")); + } + void BuilderPluginComponent::Reflect(AZ::ReflectContext* context) { AZ::SerializeContext* serializeContext = azrtti_cast(context); @@ -81,5 +86,4 @@ namespace SceneBuilder ->Attribute(AZ::Edit::Attributes::SystemComponentTags, AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder })); } } - } // namespace SceneBuilder diff --git a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.h b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.h index c1fc6ebb36..aed5e1b026 100644 --- a/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.h +++ b/Gems/SceneProcessing/Code/Source/SceneBuilder/SceneBuilderComponent.h @@ -32,6 +32,8 @@ namespace SceneBuilder void Activate() override; void Deactivate() override; + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + private: SceneBuilderWorker m_sceneBuilder; }; diff --git a/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderPhasesTests.cpp b/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderPhasesTests.cpp index 5f96353996..2a89911fda 100644 --- a/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderPhasesTests.cpp +++ b/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderPhasesTests.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -139,6 +140,12 @@ class SceneBuilderPhasesFixture public: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AZ::ComponentApplication::Descriptor()); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderTests.cpp b/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderTests.cpp index 66fd717508..2287077c89 100644 --- a/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderTests.cpp +++ b/Gems/SceneProcessing/Code/Tests/SceneBuilder/SceneBuilderTests.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -30,6 +31,12 @@ class SceneBuilderTests protected: void SetUp() override { + AZ::SettingsRegistryInterface* registry = AZ::SettingsRegistry::Get(); + auto projectPathKey = + AZ::SettingsRegistryInterface::FixedValueString(AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey) + "/project_path"; + registry->Set(projectPathKey, "AutomatedTesting"); + AZ::SettingsRegistryMergeUtils::MergeSettingsToRegistry_AddRuntimeFilePaths(*registry); + m_app.Start(AZ::ComponentApplication::Descriptor()); AZ::Debug::TraceMessageBus::Handler::BusConnect(); // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h index 1d1ea1d4aa..fc9613c3a7 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorker.h @@ -59,6 +59,7 @@ namespace ScriptCanvasBuilder QuantumLeap, DependencyArguments, DependencyRequirementsData, + AddAssetDependencySearch, // add new entries above Current, }; diff --git a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp index ab59ddd840..ba22789cd1 100644 --- a/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp +++ b/Gems/ScriptCanvas/Code/Builder/ScriptCanvasBuilderWorkerUtility.cpp @@ -681,6 +681,19 @@ namespace ScriptCanvasBuilder } AssetBuilderSDK::JobProduct jobProduct; + + // Scan our runtime input for any asset references + // Store them as product dependencies + AssetBuilderSDK::OutputObject(&runtimeData.m_input, + azrtti_typeid(), + input.runtimeScriptCanvasOutputPath, + azrtti_typeid(), + AZ_CRC("RuntimeData", 0x163310ae), jobProduct); + + // Output Object marks dependencies as handled. + // We still have more to evaluate + jobProduct.m_dependenciesHandled = false; + jobProduct.m_dependencies.push_back({ runtimeData.m_script.GetId(), {} }); for (const auto& assetDependency : runtimeData.m_requiredAssets) @@ -713,9 +726,6 @@ namespace ScriptCanvasBuilder } jobProduct.m_dependenciesHandled = true; - jobProduct.m_productFileName = input.runtimeScriptCanvasOutputPath; - jobProduct.m_productAssetType = azrtti_typeid(); - jobProduct.m_productSubID = AZ_CRC("RuntimeData", 0x163310ae); input.response->m_outputProducts.push_back(AZStd::move(jobProduct)); return AZ::Success(); } diff --git a/Gems/ScriptCanvas/Code/CMakeLists.txt b/Gems/ScriptCanvas/Code/CMakeLists.txt index 32efa74520..f9165192f0 100644 --- a/Gems/ScriptCanvas/Code/CMakeLists.txt +++ b/Gems/ScriptCanvas/Code/CMakeLists.txt @@ -49,6 +49,14 @@ ly_add_target( Gem::ScriptEvents.Static ) +# the script canvas debugger is an optional gem module +# To Enable it: ly_enable_gems( ... TARGETS xxxyyzzz GEMS ScriptCanvasDebugger ...) +# in any particular target. +ly_create_alias(NAME ScriptCanvasDebugger.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger) +ly_create_alias(NAME ScriptCanvasDebugger.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger) +ly_create_alias(NAME ScriptCanvasDebugger.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger) +ly_create_alias(NAME ScriptCanvasDebugger.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasDebugger) + ly_add_target( NAME ScriptCanvas.Static STATIC NAMESPACE Gem @@ -81,6 +89,8 @@ ly_add_target( *.ScriptCanvasGrammar.xml,ScriptCanvasGrammar_Source.jinja,$path/$fileprefix.generated.cpp *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Header.jinja,$path/$fileprefix.generated.h *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Source.jinja,$path/$fileprefix.generated.cpp + RUNTIME_DEPENDENCIES + Gem::ScriptCanvasDebugger ) ly_add_target( @@ -109,6 +119,10 @@ ly_add_target( Gem::ExpressionEvaluation ) +# the "ScriptCanvas" target is active in Clients and Servers +ly_create_alias(NAME ScriptCanvas.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvas) +ly_create_alias(NAME ScriptCanvas.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvas) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ScriptCanvasEditor STATIC @@ -170,6 +184,8 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::ExpressionEvaluation.Static PRIVATE Legacy::EditorCore + RUNTIME_DEPENDENCIES + Gem::ScriptCanvas ) ly_add_target( @@ -204,6 +220,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::ScriptEvents.Editor Gem::ExpressionEvaluation ) + + # the "ScriptCanvas.Editor" target is active in all dev tools: + ly_create_alias(NAME ScriptCanvas.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvas.Editor) + ly_create_alias(NAME ScriptCanvas.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvas.Editor) + + endif() ################################################################################ @@ -228,7 +250,8 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) PRIVATE AZ::AzTest AZ::AzFramework - Gem::ScriptCanvas + RUNTIME_DEPENDENCIES + Gem::ScriptCanvas ) ly_add_googletest( NAME Gem::ScriptCanvas.Tests diff --git a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp index 9c9297ec1c..6f28cbfe19 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/EditorGraph.cpp @@ -512,7 +512,7 @@ namespace ScriptCanvasEditor } } - bool Graph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, AZStd::unordered_map>& outSlotIdMap) + bool Graph::SanityCheckNodeReplacement(ScriptCanvas::Node* oldNode, ScriptCanvas::Node* newNode, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) { auto findReplacementMatch = [](const ScriptCanvas::Slot* oldSlot, const AZStd::vector& newSlots)->ScriptCanvas::SlotId { @@ -529,14 +529,14 @@ namespace ScriptCanvasEditor return {}; }; - oldNode->CustomizeReplacementNode(newNode, outSlotIdMap); - if (!newNode) { AZ_Warning("ScriptCanvas", false, "Replacement node can not be null."); return false; } + oldNode->CustomizeReplacementNode(newNode, nodeUpdateSlotReport.m_oldSlotsToNewSlots); + AZStd::unordered_map> slotNameMap = oldNode->GetReplacementSlotsMap(); const auto newSlots = newNode->GetAllSlots(); @@ -544,16 +544,19 @@ namespace ScriptCanvasEditor bool usingDefaults = true; size_t defaultMatchesFound = 0; + auto& oldSlotsToNewSlots = nodeUpdateSlotReport.m_oldSlotsToNewSlots; + for (auto oldSlot : oldSlots) { const ScriptCanvas::SlotId oldSlotId = oldSlot->GetId(); const AZStd::string oldSlotName = oldSlot->GetName(); - auto slotIdsIter = outSlotIdMap.find(oldSlotId); + + auto slotIdsIter = oldSlotsToNewSlots.find(oldSlotId); auto slotNamesIter = slotNameMap.find(oldSlotName); // For old node slot remapping, we should get: // 1. if old slot name is not static, we should find the mapping in user provided slot id map // 2. if old slot name is static, we should find the mapping in codegen generated map (case 1 can override case 2) - if (slotIdsIter != outSlotIdMap.end()) + if (slotIdsIter != oldSlotsToNewSlots.end()) { for (auto newSlotId : slotIdsIter->second) { @@ -581,9 +584,10 @@ namespace ScriptCanvasEditor if (!newSlotName.empty()) { auto newSlot = newNode->GetSlotByName(newSlotName); + if (!newSlot) { - AZ_Warning("ScriptCanvas", false, "Failed to find slot with name %s in replacement Node(%s).", newSlotName.c_str(), newNode->GetNodeName().c_str()); + AZ_Warning("ScriptCanvas", false, "Failed to find slot with name %s in replacement Node (%s).", newSlotName.c_str(), newNode->GetNodeName().c_str()); return false; } else if (newSlot && oldSlot->GetType() != newSlot->GetType()) @@ -591,10 +595,11 @@ namespace ScriptCanvasEditor AZ_Warning("ScriptCanvas", false, "Failed to map deprecated Node (%s) Slot (%s) to replacement Node (%s) Slot (%s).", oldNode->GetNodeName().c_str(), oldSlot->GetName().c_str(), newNode->GetNodeName().c_str(), newSlot->GetName().c_str()); return false; } + newSlotIds.push_back(newSlot->GetId()); } } - outSlotIdMap.emplace(oldSlot->GetId(), newSlotIds); + oldSlotsToNewSlots.emplace(oldSlot->GetId(), newSlotIds); } else if (slotNameMap.empty()) { @@ -605,7 +610,7 @@ namespace ScriptCanvasEditor { ++defaultMatchesFound; AZStd::vector slotIds{ newSlotId }; - outSlotIdMap.emplace(oldSlot->GetId(), slotIds); + oldSlotsToNewSlots.emplace(oldSlot->GetId(), slotIds); } } else @@ -615,7 +620,7 @@ namespace ScriptCanvasEditor } } - if (usingDefaults && defaultMatchesFound != oldSlots.size()) + if (usingDefaults && oldSlotsToNewSlots.size() != oldSlots.size()) { AZ_Warning("ScriptCanvas", false, "Failed to remap deprecated Node(%s) not all old slots were present in the new node.", oldNode->GetNodeName().c_str()); } @@ -690,8 +695,10 @@ namespace ScriptCanvasEditor } } - AZ::Outcome Graph::ReplaceNodeByConfig(ScriptCanvas::Node* oldNode, const ScriptCanvas::NodeConfiguration& nodeConfig, - ScriptCanvas::ReplacementConnectionMap& remapConnections) + AZ::Outcome Graph::ReplaceNodeByConfig + ( ScriptCanvas::Node* oldNode + , const ScriptCanvas::NodeConfiguration& nodeConfig + , ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport) { auto nodeEntity = oldNode->GetEntity(); if (!nodeEntity) @@ -731,8 +738,8 @@ namespace ScriptCanvasEditor AddNode(newNode->GetEntityId()); ScriptCanvas::NodeUtils::InitializeNode(newNode, nodeConfig); - AZStd::unordered_map> slotIdMap; - rollbackRequired = !SanityCheckNodeReplacement(oldNode, newNode, slotIdMap); + rollbackRequired = !SanityCheckNodeReplacement(oldNode, newNode, nodeUpdateSlotReport); + auto& slotIdMap = nodeUpdateSlotReport.m_oldSlotsToNewSlots; if (rollbackRequired) { @@ -748,25 +755,15 @@ namespace ScriptCanvasEditor else { nodeEntity->Activate(); - newNode->SignalReconfigurationBegin(); - newNode->SetNodeDisabledFlag(oldNode->GetNodeDisabledFlag()); + for (auto slotIdIter : slotIdMap) { ScriptCanvas::Slot* oldSlot = oldNode->GetSlot(slotIdIter.first); const ScriptCanvas::Endpoint oldEndpoint{ nodeEntity->GetId(), oldSlot->GetId() }; if (slotIdIter.second.size() == 0) { - // If remap id is empty, then we should just cache the old slot connection for delete - if (oldSlot->IsInput()) - { - ScriptCanvas::VersioningUtils::CreateRemapConnectionsForTargetEndpoint(*this, oldEndpoint, ScriptCanvas::Endpoint(), remapConnections); - } - else - { - ScriptCanvas::VersioningUtils::CreateRemapConnectionsForSourceEndpoint(*this, oldEndpoint, ScriptCanvas::Endpoint(), remapConnections); - } continue; } @@ -808,35 +805,11 @@ namespace ScriptCanvasEditor ScriptCanvas::VersioningUtils::CopyOldValueToDataSlot(newSlot, oldSlot->GetVariableReference(), oldSlot->FindDatum()); } - - // if old slot is visible, we need to check its connections for remapping - if (oldSlot->IsVisible()) - { - ScriptCanvas::Endpoint newEndpoint; - if (newSlot) - { - newEndpoint = { nodeEntity->GetId(), newSlot->GetId() }; - } - else - { - AZ_Warning("ScriptCanvas", false, "Invalid slot! Unable to create new connection for Node (%s).", newNode->GetNodeName().c_str()); - } - - if (oldSlot->IsInput()) - { - ScriptCanvas::VersioningUtils::CreateRemapConnectionsForTargetEndpoint(*this, oldEndpoint, newEndpoint, remapConnections); - } - else - { - ScriptCanvas::VersioningUtils::CreateRemapConnectionsForSourceEndpoint(*this, oldEndpoint, newEndpoint, remapConnections); - } - } } } + delete oldNode; - newNode->SignalReconfigurationEnd(); - return AZ::Success(newNode); } } @@ -3634,8 +3607,7 @@ namespace ScriptCanvasEditor AZStd::unordered_map< AZ::EntityId, AZ::EntityId > scriptCanvasToGraphCanvasMapping; - bool graphNeedsDirtying = false; - + bool graphNeedsDirtying = !GetVersion().IsLatest(); { QScopedValueRollback ignoreRequests(m_ignoreSaveRequests, true); @@ -3659,7 +3631,8 @@ namespace ScriptCanvasEditor AZStd::unordered_set deletedNodes; AZStd::unordered_set assetSanitizationSet; AZStd::unordered_set sanityCheckRequiredNodes; - ScriptCanvas::ReplacementConnectionMap remapConnections; + + ScriptCanvas::GraphUpdateSlotReport graphUpdateSlotReport; for (const AZ::EntityId& scriptCanvasNodeId : nodeList) { @@ -3674,12 +3647,15 @@ namespace ScriptCanvasEditor ScriptCanvas::NodeConfiguration nodeConfig = scriptCanvasNode->GetReplacementNodeConfiguration(); if (nodeConfig.IsValid()) { - auto nodeOutcome = ReplaceNodeByConfig(scriptCanvasNode, nodeConfig, remapConnections); + ScriptCanvas::NodeUpdateSlotReport nodeUpdateSlotReport; + auto nodeOutcome = ReplaceNodeByConfig(scriptCanvasNode, nodeConfig, nodeUpdateSlotReport); + if (nodeOutcome.IsSuccess()) { graphNeedsDirtying = true; scriptCanvasNode = nodeOutcome.GetValue(); m_updateStrings.insert(AZStd::string::format("Replaced node (%s)", scriptCanvasNode->GetNodeName().c_str())); + ScriptCanvas::MergeUpdateSlotReport(scriptCanvasNodeId, graphUpdateSlotReport, nodeUpdateSlotReport); } } } @@ -3688,7 +3664,6 @@ namespace ScriptCanvasEditor scriptCanvasToGraphCanvasMapping[scriptCanvasNodeId] = graphCanvasNodeId; auto saveDataIter2 = m_graphCanvasSaveData.find(scriptCanvasNodeId); - if (saveDataIter2 != m_graphCanvasSaveData.end()) { GraphCanvas::EntitySaveDataRequestBus::Event(graphCanvasNodeId, &GraphCanvas::EntitySaveDataRequests::ReadSaveData, (*saveDataIter2->second)); @@ -3699,7 +3674,7 @@ namespace ScriptCanvasEditor GraphCanvas::SceneRequestBus::Event(graphCanvasGraphId, &GraphCanvas::SceneRequests::AddNode, graphCanvasNodeId, position, false); - // If the node is deprecated, we want to stomp whatever style it had saved and apply the deperecated style + // If the node is deprecated, we want to stomp whatever style it had saved and apply the deprecated style if (scriptCanvasNode->IsDeprecated()) { GraphCanvas::NodeTitleRequestBus::Event(graphCanvasNodeId, &GraphCanvas::NodeTitleRequests::SetPaletteOverride, "DeprecatedNodeTitlePalette"); @@ -3719,27 +3694,13 @@ namespace ScriptCanvasEditor } } - // Remap connections step should be done before editor processing connections for graph - // - // Delete underlying data conenections. - for (auto remapConnection : remapConnections) + if (!graphUpdateSlotReport.IsEmpty()) { - RemoveConnection(remapConnection.first); + // currently, it is expected that there are no deleted old slots, those need manual correction + AZ_Error("ScriptCanvas", graphUpdateSlotReport.m_deletedOldSlots.empty(), "Graph upgrade path: If old slots are deleted, manual upgrading is required"); + UpdateConnectionStatus(*this, graphUpdateSlotReport); } - // Recreate connections in a separate pass to avoid triggering display updates for invalid slot ids. - for (auto remapConnection : remapConnections) - { - for (auto newEndpointPair : remapConnection.second) - { - if (newEndpointPair.first.IsValid() && newEndpointPair.second.IsValid()) - { - ConnectByEndpoint(newEndpointPair.first, newEndpointPair.second); - } - } - } - //// - AZStd::unordered_set graphCanvasNodesToDelete; for (auto scriptCanvasNode : outOfDateNodes) diff --git a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp index 7762e1d095..581c3775d6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp +++ b/Gems/ScriptCanvas/Code/Editor/Components/GraphUpgrade.cpp @@ -424,24 +424,11 @@ namespace ScriptCanvasEditor EditorGraphUpgradeMachine* sm = GetStateMachine(); auto* graph = sm->m_graph; - // Delete underlying data connections. - for (auto remapConnection : sm->m_replacementConnections) + if (!sm->m_updateReport.IsEmpty()) { - graph->RemoveConnection(remapConnection.first); - } - - // Recreate connections in a separate pass to avoid triggering display updates for invalid slot ids. - for (auto remapConnection : sm->m_replacementConnections) - { - for (auto newEndpointPair : remapConnection.second) - { - if (newEndpointPair.first.IsValid() && newEndpointPair.second.IsValid()) - { - graph->ConnectByEndpoint(newEndpointPair.first, newEndpointPair.second); - - Log("Replaced Connection: %s\n", Helpers::ConnectionToText(graph, newEndpointPair.first, newEndpointPair.second).c_str()); - } - } + // currently, it is expected that there are no deleted old slots, those need manual correction + AZ_Error("ScriptCanvas", sm->m_updateReport.m_deletedOldSlots.empty(), "Graph upgrade path: If old slots are deleted, manual upgrading is required"); + UpdateConnectionStatus(*graph, sm->m_updateReport); } } @@ -455,16 +442,18 @@ namespace ScriptCanvasEditor ScriptCanvas::NodeConfiguration nodeConfig = node->GetReplacementNodeConfiguration(); if (nodeConfig.IsValid()) { - auto nodeOutcome = graph->ReplaceNodeByConfig(node, nodeConfig, sm->m_replacementConnections); + ScriptCanvas::NodeUpdateSlotReport nodeUpdateSlotReport; + auto nodeOutcome = graph->ReplaceNodeByConfig(node, nodeConfig, nodeUpdateSlotReport); if (nodeOutcome.IsSuccess()) { + ScriptCanvas::MergeUpdateSlotReport(node->GetEntityId(), sm->m_updateReport, nodeUpdateSlotReport); + sm->m_allNodes.erase(node); sm->m_outOfDateNodes.erase(node); sm->m_sanityCheckRequiredNodes.erase(node); - sm->m_graphNeedsDirtying = true; - auto replacedNode = nodeOutcome.GetValue(); + auto replacedNode = nodeOutcome.GetValue(); sm->m_allNodes.insert(replacedNode); if (replacedNode->IsOutOfDate(graph->GetVersion())) diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h index 3bd8270629..687d783e63 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/EditorGraph.h @@ -42,6 +42,7 @@ namespace ScriptCanvas { struct NodeConfiguration; + struct NodeUpdateSlotReport; } namespace ScriptCanvasEditor @@ -361,8 +362,8 @@ namespace ScriptCanvasEditor void HandleFunctionDefinitionExtension(ScriptCanvas::Node* node, GraphCanvas::SlotId graphCanvasSlotId, const GraphCanvas::NodeId& nodeId); //// Version Update code - AZ::Outcome ReplaceNodeByConfig(ScriptCanvas::Node*, const ScriptCanvas::NodeConfiguration&, ScriptCanvas::ReplacementConnectionMap&); - bool SanityCheckNodeReplacement(ScriptCanvas::Node*, ScriptCanvas::Node*, AZStd::unordered_map>&); + AZ::Outcome ReplaceNodeByConfig(ScriptCanvas::Node*, const ScriptCanvas::NodeConfiguration&, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport); + bool SanityCheckNodeReplacement(ScriptCanvas::Node*, ScriptCanvas::Node*, ScriptCanvas::NodeUpdateSlotReport& nodeUpdateSlotReport); bool m_allowVersionUpdate = false; AZStd::unordered_set< AZ::EntityId > m_queuedConvertingNodes; diff --git a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h index 791e649e3a..cc5315808e 100644 --- a/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h +++ b/Gems/ScriptCanvas/Code/Editor/Include/ScriptCanvas/Components/GraphUpgrade.h @@ -159,7 +159,7 @@ namespace ScriptCanvasEditor AZStd::unordered_set m_deletedNodes; AZStd::unordered_set m_assetSanitizationSet; - ScriptCanvas::ReplacementConnectionMap m_replacementConnections; + ScriptCanvas::GraphUpdateSlotReport m_updateReport; AZStd::unordered_map< AZ::EntityId, AZ::EntityId > m_scriptCanvasToGraphCanvasMapping; diff --git a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h index 74f363f569..06a63fe8b6 100644 --- a/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h +++ b/Gems/ScriptCanvas/Code/Editor/Static/Include/ScriptCanvas/View/EditCtrls/GenericLineEditCtrl.h @@ -123,6 +123,11 @@ namespace ScriptCanvasEditor template AzToolsFramework::PropertyHandlerBase* RegisterGenericLineEditHandler(const EditCtrl::PropertyToStringCB& propertyToStringCB, const EditCtrl::StringToPropertyCB& stringToPropertyCB) { + if (!AzToolsFramework::PropertyTypeRegistrationMessages::Bus::FindFirstHandler()) + { + return nullptr; + } + auto propertyHandler(aznew GenericLineEditHandler(propertyToStringCB, stringToPropertyCB)); AzToolsFramework::PropertyTypeRegistrationMessages::Bus::Broadcast(&AzToolsFramework::PropertyTypeRegistrationMessages::RegisterPropertyType, propertyHandler); return propertyHandler; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasGrammar_Header.jinja b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasGrammar_Header.jinja index 089e5fe6ff..fbf2bd5355 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasGrammar_Header.jinja +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/AutoGen/ScriptCanvasGrammar_Header.jinja @@ -75,7 +75,7 @@ public: \ void ConfigureSlots() override; \ bool RequiresDynamicSlotOrdering() const override; \ bool IsDeprecated() const override; \ -{% if deprecationUuid is defined %} NodeConfiguration GetReplacementNodeConfiguration() const override; \ +{% if deprecationUuid is defined %} ScriptCanvas::NodeConfiguration GetReplacementNodeConfiguration() const override; \ {% endif %} using Node::FindDatum; \ {% if Class.attrib['GraphEntryPoint'] is defined %} bool IsEntryPoint() const override { return {%if Class.attrib['GraphEntryPoint'] == "True" %}true{%else%}false{%endif%}; } \ @@ -168,4 +168,4 @@ struct {{ className | replace(' ','') }}Property {% endfor %} -{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h index 155e5bb4c2..e2cd7008c8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Connection.h @@ -22,6 +22,7 @@ namespace ScriptCanvas { class Slot; + struct NodeUpdateSlotReport; class Connection : public AZ::Component @@ -64,6 +65,8 @@ namespace ScriptCanvas // GraphNotificationBus void OnNodeRemoved(const ID& nodeId) override; + void UpdateConnectionStatus(NodeUpdateSlotReport& report); + protected: //------------------------------------------------------------------------- static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp index dd223f34ec..0f49fb8b5d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Contracts/MethodOverloadContract.cpp @@ -33,7 +33,7 @@ namespace ScriptCanvas { if (m_availableIndexes.empty()) { - return -1; + return std::numeric_limits::max(); } return (*m_availableIndexes.begin()); @@ -151,19 +151,22 @@ namespace ScriptCanvas for (const AZ::BehaviorParameter* behaviorParameter : paramTypes.second) { - ScriptCanvas::Data::Type dataType = ScriptCanvas::Data::FromAZType(behaviorParameter->m_typeId); - if (ScriptCanvas::Data::IsValueType(dataType)) + if (behaviorParameter) { - isValueType = true; - } - else if (ScriptCanvas::Data::IsContainerType(dataType)) - { - isContainerType = true; - } + ScriptCanvas::Data::Type dataType = ScriptCanvas::Data::FromAZType(behaviorParameter->m_typeId); + if (ScriptCanvas::Data::IsValueType(dataType)) + { + isValueType = true; + } + else if (ScriptCanvas::Data::IsContainerType(dataType)) + { + isContainerType = true; + } - if (isValueType && isContainerType) - { - break; + if (isValueType && isContainerType) + { + break; + } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp index a0db02c3a8..30e55cee49 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Datum.cpp @@ -2527,15 +2527,15 @@ namespace ScriptCanvas { Data::TransformType copy(source); AZ::Vector3 pos = copy.GetTranslation(); - AZ::Vector3 scale = copy.ExtractScale(); + float scale = copy.ExtractUniformScale(); AZ::Vector3 rotation = AZ::ConvertTransformToEulerDegrees(copy); return AZStd::string::format ( "(Position: X: %f, Y: %f, Z: %f," " Rotation: X: %f, Y: %f, Z: %f," - " Scale: X: %f, Y: %f, Z: %f)" + " Scale: %f)" , static_cast(pos.GetX()), static_cast(pos.GetY()), static_cast(pos.GetZ()) , static_cast(rotation.GetX()), static_cast(rotation.GetY()), static_cast(rotation.GetZ()) - , static_cast(scale.GetX()), static_cast(scale.GetY()), static_cast(scale.GetZ())); + , scale); } AZStd::string Datum::ToStringVector2(const AZ::Vector2& source) const diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp index 8d24b67b4f..1637a2e71b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.cpp @@ -616,6 +616,34 @@ namespace ScriptCanvas return false; } + + void Graph::RemoveAllConnections() + { + for (auto connectionEntity : m_graphData.m_connections) + { + if (auto connection = connectionEntity ? AZ::EntityUtils::FindFirstDerivedComponent(connectionEntity) : nullptr) + { + if (connection->GetSourceEndpoint().IsValid()) + { + EndpointNotificationBus::Event(connection->GetSourceEndpoint(), &EndpointNotifications::OnEndpointDisconnected, connection->GetTargetEndpoint()); + } + if (connection->GetTargetEndpoint().IsValid()) + { + EndpointNotificationBus::Event(connection->GetTargetEndpoint(), &EndpointNotifications::OnEndpointDisconnected, connection->GetSourceEndpoint()); + } + } + + GraphNotificationBus::Event(GetScriptCanvasId(), &GraphNotifications::OnConnectionRemoved, connectionEntity->GetId()); + } + + for (auto& connectionRef : m_graphData.m_connections) + { + delete connectionRef; + } + + m_graphData.m_connections.clear(); + } + bool Graph::RemoveConnection(const AZ::EntityId& connectionId) { if (connectionId.IsValid()) @@ -752,7 +780,6 @@ namespace ScriptCanvas auto* connectionEntity = aznew AZ::Entity("Connection"); connectionEntity->CreateComponent(sourceEndpoint, targetEndpoint); - AZ::Entity* nodeEntity{}; AZ::ComponentApplicationBus::BroadcastResult(nodeEntity, &AZ::ComponentApplicationRequests::FindEntity, sourceEndpoint.GetNodeId()); auto node = nodeEntity ? AZ::EntityUtils::FindFirstDerivedComponent(nodeEntity) : nullptr; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h index 1862ce4966..49b22db2bf 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Graph.h @@ -87,6 +87,7 @@ namespace ScriptCanvas Slot* FindSlot(const Endpoint& endpoint) const override; bool AddConnection(const AZ::EntityId&) override; + void RemoveAllConnections(); bool RemoveConnection(const AZ::EntityId& connectionId) override; AZStd::vector GetConnections() const override; AZStd::vector GetConnectedEndpoints(const Endpoint& firstEndpoint) const override; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h index e34bdb1c71..8426e90515 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/PureData.h @@ -53,7 +53,9 @@ namespace ScriptCanvas template void AddDefaultInputAndOutputTypeSlot(DatumType&& defaultValue); void AddInputTypeAndOutputTypeSlot(const Data::Type& type); - + + bool IsDeprecated() const override { return true; } + void OnActivate() override; void OnInputChanged(const Datum& input, const SlotId& id) override; void MarkDefaultableInput() override {} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp index d37427af0b..9784cc97c4 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.cpp @@ -347,6 +347,11 @@ namespace ScriptCanvas } } + void Slot::ClearDynamicGroup() + { + m_dynamicGroup = AZ::Crc32{}; + } + void Slot::ConvertToLatentExecutionOut() { if (IsExecution() && IsOutput()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h index c65d4efc84..794ce091b1 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Core/Slot.h @@ -68,6 +68,8 @@ namespace ScriptCanvas void AddContract(const ContractDescriptor& contractDesc); + void ClearDynamicGroup(); + template T* FindContract() { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp index 8dff6da9b1..732455857e 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Grammar/AbstractCodeModel.cpp @@ -1036,12 +1036,12 @@ namespace ScriptCanvas if (azrtti_istypeof(&node)) { // todo Add node to these errors - AddError(nullptr, ValidationConstPtr(aznew NotYetImplemented(node.GetEntityId(), AZStd::string::format("NodeableNodeOverloaded doesn't have enough data connected to select a valid overload: %s", node.GetDebugName().data())))); + AddError(nullptr, ValidationConstPtr(aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("%s: %s", ParseErrors::NodeableNodeOverloadAmbiguous, node.GetDebugName().data())))); } else { // todo Add node to these errors - AddError(nullptr, ValidationConstPtr(aznew NotYetImplemented(node.GetEntityId(), AZStd::string::format("NodeableNode did not construct its internal node: %s", node.GetDebugName().data())))); + AddError(nullptr, ValidationConstPtr(aznew Internal::ParseError(node.GetEntityId(), AZStd::string::format("%s: %s", ParseErrors::NodeableNodeDidNotConstructInternalNodeable, node.GetDebugName().data())))); } } } @@ -2535,7 +2535,7 @@ namespace ScriptCanvas if (IsInfiniteVariableWriteHandlingLoop(*this, variableHandling, variableHandling->m_function, true)) { - AddError(variableHandling->m_function, aznew NotYetImplemented(AZ::EntityId(), ScriptCanvas::ParseErrors::InfiniteLoopWritingToVariable)); + AddError(variableHandling->m_function, aznew Internal::ParseError(AZ::EntityId(), ScriptCanvas::ParseErrors::InfiniteLoopWritingToVariable)); return false; } @@ -3312,7 +3312,7 @@ namespace ScriptCanvas } else { - AddError(execution, aznew NotYetImplemented(execution->GetNodeId(), childOutSlotsOutcome.TakeError())); + AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), childOutSlotsOutcome.TakeError())); } } } @@ -3615,9 +3615,11 @@ namespace ScriptCanvas void AbstractCodeModel::ParseExecutionMultipleOutSyntaxSugar(ExecutionTreePtr execution, const EndpointsResolved& executionOutNodes, const AZStd::vector& outSlots) { + const auto executionNodeId = execution->GetId().m_node ? execution->GetId().m_node->GetEntityId() : AZ::EntityId(); + if (executionOutNodes.size() != outSlots.size()) { - AddError(AZ::EntityId(), execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarMismatchOutSize); + AddError(executionNodeId, execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarMismatchOutSize); } if (execution->GetSymbol() != Symbol::Sequence) @@ -3630,13 +3632,13 @@ namespace ScriptCanvas if (!child) { - AddError(AZ::EntityId(), execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarNullChildFound); + AddError(executionNodeId, execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarNullChildFound); return; } if (child->m_execution) { - AddError(AZ::EntityId(), execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarNonNullChildExecutionFound); + AddError(executionNodeId, execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarNonNullChildExecutionFound); return; } @@ -3660,7 +3662,7 @@ namespace ScriptCanvas if (execution->GetChildrenCount() != executionOutNodes.size()) { - AddError(AZ::EntityId(), execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarChildExecutionRemovedAndNotReplaced); + AddError(executionNodeId, execution, ParseErrors::ParseExecutionMultipleOutSyntaxSugarChildExecutionRemovedAndNotReplaced); return; } } @@ -4187,7 +4189,7 @@ namespace ScriptCanvas } else { - AddError(nullptr, aznew NotYetImplemented(execution->GetNodeId(), dataSlotsOutcome.TakeError())); + AddError(nullptr, aznew Internal::ParseError(execution->GetNodeId(), dataSlotsOutcome.TakeError())); } } } @@ -4494,13 +4496,13 @@ namespace ScriptCanvas } else { - AddError(execution, aznew NotYetImplemented(execution->GetNodeId(), returnSlotsOutcome.TakeError())); + AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), returnSlotsOutcome.TakeError())); } } } else { - AddError(execution, aznew NotYetImplemented(execution->GetNodeId(), outputSlotsOutcome.TakeError())); + AddError(execution, aznew Internal::ParseError(execution->GetNodeId(), outputSlotsOutcome.TakeError())); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp index e04f7c1725..cda93c1b36 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.cpp @@ -35,15 +35,6 @@ namespace ScriptCanvas } } - AZStd::unordered_map> ArithmeticExpression::GetReplacementSlotsMap() const - { - AZStd::unordered_map> slotsMap; - slotsMap.emplace(k_evaluateName, AZStd::vector{ "In" }); - slotsMap.emplace(k_outName, AZStd::vector{ "Out" }); - slotsMap.emplace(k_resultName, AZStd::vector{ "Result" }); - return slotsMap; - } - void ArithmeticExpression::OnInit() { { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h index 351d02f2cc..7c230b359a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/BinaryOperator.h @@ -72,7 +72,6 @@ namespace ScriptCanvas bool IsDeprecated() const override { return true; } - AZStd::unordered_map> GetReplacementSlotsMap() const override; void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; protected: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp index 0b7b6020e3..d730b6bcc9 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.cpp @@ -94,8 +94,6 @@ namespace ScriptCanvas void ForEach::OnInit() { - ResetLoop(); - if (!m_sourceSlot.IsValid()) { DynamicDataSlotConfiguration slotConfiguration; @@ -130,33 +128,6 @@ namespace ScriptCanvas EndpointNotificationBus::Handler::BusConnect({ GetEntityId(), m_sourceSlot }); } - void ForEach::OnInputSignal(const SlotId& slotId) - { - auto inSlotId = ForEachProperty::GetInSlotId(this); - if (slotId == inSlotId || slotId == SlotId{}) - { - if (slotId == inSlotId) - { - if (!InitializeLoop()) - { - // Loop initialization failed - SignalOutput(ForEachProperty::GetFinishedSlotId(this)); - return; - } - } - - if (!m_breakCalled) - { - Iterate(); - } - } - else if (slotId == ForEachProperty::GetBreakSlotId(this)) - { - m_breakCalled = true; - SignalOutput(ForEachProperty::GetFinishedSlotId(this)); - } - } - UpdateResult ForEach::OnUpdateNode() { if (auto continueSlot = GetSlotByNameAndType("Continue", CombinedSlotType::ExecutionIn)) @@ -167,161 +138,6 @@ namespace ScriptCanvas return UpdateResult::DirtyGraph; } - bool ForEach::InitializeLoop() - { - ResetLoop(); - - const Datum* input = FindDatum(m_sourceSlot); - - if (input && !input->Empty()) - { - if (!Data::IsContainerType(input->GetType())) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Iteration not supported on this type: %s", Data::GetName(m_sourceContainer.GetType()).c_str()); - return false; - } - - // Make a copy of the source datum - m_sourceContainer = *input; - - // Get the size of the container - auto sizeOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(m_sourceContainer, "Size"); - - if (!sizeOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get size of container: %s", sizeOutcome.GetError().c_str()); - return false; - } - - Datum sizeResult = sizeOutcome.TakeValue(); - const size_t* sizePtr = sizeResult.GetAs(); - m_size = sizePtr ? *sizePtr : 0; - - if (Data::IsSetContainerType(m_sourceContainer.GetType()) || Data::IsMapContainerType(m_sourceContainer.GetType())) - { - // If it's a map or set, get the vector of keys - auto keysVectorOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(m_sourceContainer, "GetKeys"); - - if (!keysVectorOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get vector of keys: %s", keysVectorOutcome.GetError().c_str()); - return false; - } - - m_keysVector = keysVectorOutcome.TakeValue(); - - // Check size of vector of keys for safety - auto keysSizeOutcome = BehaviorContextMethodHelper::CallMethodOnDatum(m_keysVector, "Size"); - - if (!keysSizeOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get size of vector of keys: %s", keysSizeOutcome.GetError().c_str()); - return false; - } - - Datum keysSizeResult = keysSizeOutcome.TakeValue(); - const size_t* keysSizePtr = keysSizeResult.GetAs(); - size_t keysSize = keysSizePtr ? *keysSizePtr : 0; - - if (m_size != keysSize) - { - // This shouldn't happen - SCRIPTCANVAS_REPORT_ERROR((*this), "Container size and vector of keys size mismatch."); - return false; - } - } - - return true; - } - - return false; - } - - void ForEach::Iterate() - { - if (m_sourceContainer.Empty() || m_index >= m_size) - { - SignalOutput(ForEachProperty::GetFinishedSlotId(this)); - return; - } - - Datum& container = Data::IsVectorContainerType(m_sourceContainer.GetType()) ? m_sourceContainer : m_keysVector; - - auto keyAtOutcome = BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(container, "At", m_index); - - if (!keyAtOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get key in container: %s", keyAtOutcome.GetError().c_str()); - return; - } - - Datum keyAtResult = keyAtOutcome.TakeValue(); - - if (!SetPropertySlotData(keyAtResult, k_keySlotIndex)) - { - // Unable to set property slot - SCRIPTCANVAS_REPORT_ERROR((*this), "Unable to set one of the property slots on this node."); - SignalOutput(ForEachProperty::GetFinishedSlotId(this)); - return; - } - - if (Data::IsMapContainerType(m_sourceContainer.GetType())) - { - // If the container is a map, we want to get the value for the current key - auto valueAtOutcome = BehaviorContextMethodHelper::CallMethodOnDatumUnpackOutcomeSuccess(m_sourceContainer, "At", keyAtResult); - - if (!valueAtOutcome) - { - SCRIPTCANVAS_REPORT_ERROR((*this), "Failed to get value for key in container: %s", valueAtOutcome.GetError().c_str()); - return; - } - - Datum valueAtResult = valueAtOutcome.TakeValue(); - - if (!SetPropertySlotData(valueAtResult, k_valueSlotIndex)) - { - // Unable to set property slot - SCRIPTCANVAS_REPORT_ERROR((*this), "Unable to set one of the property slots on this node."); - SignalOutput(ForEachProperty::GetFinishedSlotId(this)); - return; - } - } - - ++m_index; - - SignalOutput(ForEachProperty::GetEachSlotId(this)); - } - - bool ForEach::SetPropertySlotData(Datum& atResult, size_t propertyIndex) - { - if (atResult.Empty()) - { - // Something went wrong with the Behavior Context call - SCRIPTCANVAS_REPORT_ERROR((*this), "Behavior Context call failed; unable to retrieve element from container."); - return false; - } - - if (m_propertySlots.size() <= propertyIndex) - { - // Missing a property slot - SCRIPTCANVAS_REPORT_ERROR((*this), "Node in invalid state; missing a property slot."); - return false; - } - - PushOutput(atResult, *GetSlot(m_propertySlots[propertyIndex].m_propertySlotId)); - return true; - } - - void ForEach::ResetLoop() - { - // Reset node state - m_index = 0; - m_size = 0; - m_breakCalled = false; - m_sourceContainer = Datum(); - m_keysVector = Datum(); - } - void ForEach::OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) { if (dynamicGroup == GetContainerGroupId() && dataType.IsValid()) diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.h index 68e75adc80..32bca9eefd 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/ForEach.h @@ -56,44 +56,29 @@ namespace ScriptCanvas bool IsBreakSlot(const SlotId&) const; - bool IsOutOfDate(const VersionData& graphVersion) const override; - - + bool IsOutOfDate(const VersionData& graphVersion) const override; UpdateResult OnUpdateNode() override; - protected: - ExecutionNameMap GetExecutionNameMap() const override; - - void OnInit() override; - void OnInputSignal(const SlotId&) override; - - bool InitializeLoop(); - void Iterate(); - bool SetPropertySlotData(Datum& atResult, size_t propertyIndex); - void ResetLoop(); - - void OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) override; - - void ClearPropertySlots(); - void AddPropertySlotsFromType(const Data::Type& dataType); - - static AZ::Crc32 GetContainerGroupId() { return AZ_CRC("ContainerGroup", 0xb81ed451); } - - SlotId m_sourceSlot; - AZ::TypeId m_previousTypeId; - AZStd::vector m_propertySlots; - + private: static const size_t k_keySlotIndex; static const size_t k_valueSlotIndex; - size_t m_index; - size_t m_size; + static AZ::Crc32 GetContainerGroupId() { return AZ_CRC("ContainerGroup", 0xb81ed451); } - bool m_breakCalled; + void AddPropertySlotsFromType(const Data::Type& dataType); - Datum m_sourceContainer; - Datum m_keysVector; + void ClearPropertySlots(); + + ExecutionNameMap GetExecutionNameMap() const override; + + void OnInit() override; + + void OnDynamicGroupDisplayTypeChanged(const AZ::Crc32& dynamicGroup, const Data::Type& dataType) override; + + SlotId m_sourceSlot; + AZ::TypeId m_previousTypeId; + AZStd::vector m_propertySlots; }; } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp index cec643d799..678ca60ef3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.cpp @@ -410,6 +410,11 @@ namespace ScriptCanvas return m_asset.GetId(); } + const AZStd::string& FunctionCallNode::GetAssetHint() const + { + return m_asset.GetHint(); + } + AZ::Outcome FunctionCallNode::GetDependencies() const { DependencyReport report; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h index fe5b453cf3..003bc2581b 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionCallNode.h @@ -70,6 +70,8 @@ namespace ScriptCanvas AZ::Data::AssetId GetAssetId() const; + const AZStd::string& GetAssetHint() const; + const AZStd::string& GetName() const; void Initialize(AZ::Data::AssetId assetId, const ScriptCanvas::Grammar::FunctionSourceId& sourceId); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp index ad556ae093..a849983deb 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.cpp @@ -19,6 +19,32 @@ #include +namespace FunctionDefinitionNodeCpp +{ + void VersionUpdateRemoveDefaultDisplayGroup(ScriptCanvas::Nodes::Core::FunctionDefinitionNode& node) + { + using namespace ScriptCanvas; + using namespace ScriptCanvas::Nodes::Core; + + AZ::SerializeContext* serializeContext{}; + AZ::ComponentApplicationBus::BroadcastResult(serializeContext, &AZ::ComponentApplicationRequests::GetSerializeContext); + if (serializeContext) + { + const auto& classData = serializeContext->FindClassData(azrtti_typeid()); + if (classData && classData->m_version < FunctionDefinitionNode::NodeVersion::RemoveDefaultDisplayGroup) + { + for (auto& slot : node.ModAllSlots()) + { + if (slot->GetType() == CombinedSlotType::DataIn || slot->GetType() == CombinedSlotType::DataOut) + { + slot->ClearDynamicGroup(); + } + } + } + } + } +} + namespace ScriptCanvas { namespace Nodes @@ -113,6 +139,12 @@ namespace ScriptCanvas } } + void FunctionDefinitionNode::OnInit() + { + Nodeling::OnInit(); + FunctionDefinitionNodeCpp::VersionUpdateRemoveDefaultDisplayGroup(*this); + } + void FunctionDefinitionNode::SetupSlots() { auto groupedSlots = GetSlotsWithDisplayGroup(GetSlotDisplayGroup()); @@ -208,7 +240,6 @@ namespace ScriptCanvas slotConfiguration.SetConnectionType(connectionType); slotConfiguration.m_displayGroup = GetDataDisplayGroup(); - slotConfiguration.m_dynamicGroup = GetDataDynamicTypeGroup(); slotConfiguration.m_dynamicDataType = DynamicDataType::Any; slotConfiguration.m_isUserAdded = true; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.h index 20b20cb65d..04dc0c7103 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/FunctionDefinitionNode.h @@ -29,14 +29,13 @@ namespace ScriptCanvas class FunctionDefinitionNode : public Internal::Nodeling { - private: + public: enum NodeVersion { - Initial = 1 + Initial = 1, + RemoveDefaultDisplayGroup, }; - public: - SCRIPTCANVAS_NODE(FunctionDefinitionNode); FunctionDefinitionNode() = default; @@ -78,14 +77,15 @@ namespace ScriptCanvas static constexpr AZ::Crc32 GetAddNodelingInputDataSlot() { return AZ_CRC_CE("AddNodelingInputDataSlot"); } static constexpr AZ::Crc32 GetAddNodelingOutputDataSlot() { return AZ_CRC_CE("AddNodelingOutputDataSlot"); } - static constexpr AZ::Crc32 GetDataDynamicTypeGroup() { return AZ_CRC_CE("DataGroup"); } - + AZStd::string GetDataDisplayGroup() const { return "DataDisplayGroup"; } SlotId HandleExtension(AZ::Crc32 extensionId) override; void ConfigureVisualExtensions() override; + void OnInit() override; + void OnSetup() override; private: diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp index b6f7bc2972..4a9e8ac3e3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.cpp @@ -208,7 +208,6 @@ namespace ScriptCanvas } } - void Method::InitializeMethod(const MethodConfiguration& config) { m_namespaces = config.m_namespaces ? *config.m_namespaces : m_namespaces; @@ -239,7 +238,11 @@ namespace ScriptCanvas for (size_t argIndex(0), sentinel(config.m_method.GetNumArguments()); argIndex != sentinel; ++argIndex) { SlotId addedSlot = AddMethodInputSlot(config, argIndex); - MethodHelper::SetSlotToDefaultValue(*this, addedSlot, config, argIndex); + + if (addedSlot.IsValid()) + { + MethodHelper::SetSlotToDefaultValue(*this, addedSlot, config, argIndex); + } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h index 6a53054ddf..829dff2c29 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/Method.h @@ -132,6 +132,8 @@ namespace ScriptCanvas const Slot* GetIfBranchSlot(bool branch) const; + AZ_INLINE const AZStd::string& GetLookupName() const { return m_lookupName; } + AZ_INLINE AZStd::recursive_mutex& GetMutex() { return m_mutex; } ConstSlotsOutcome GetSlotsInExecutionThreadByTypeImpl(const Slot& executionSlot, CombinedSlotType targetSlotType, const Slot* executionChildSlot) const override; @@ -160,6 +162,8 @@ namespace ScriptCanvas bool SanityCheckBranchOnResultMethod(const AZ::BehaviorMethod& branchOnResultMethod) const; + AZ_INLINE void SetClassNamePretty(AZStd::string_view classNamePretty) { m_classNamePretty = classNamePretty; } + void SetMethodUnchecked(const AZ::BehaviorMethod* method, const AZ::BehaviorClass* behaviorClass); AZ_INLINE void SetWarnOnMissingFunction(bool enabled) { m_warnOnMissingFunction = enabled; } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp index ed7fce7ffc..bfd0bb824d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.cpp @@ -94,7 +94,7 @@ namespace ScriptCanvas { if (!m_updatingDisplay) { - RefreshActiveIndexes(); + RefreshActiveIndexes(true, true); UpdateSlotDisplay(); } } @@ -135,10 +135,8 @@ namespace ScriptCanvas return Data::Type::Invalid(); } - AZ::Outcome MethodOverloaded::GetFunctionCallName(const Slot* slot) const + AZ::Outcome MethodOverloaded::GetFunctionCallName([[maybe_unused]] const Slot* slot) const { - AZ_UNUSED(slot); - AZStd::string overloadName; int activeIndex = GetActiveIndex(); @@ -188,7 +186,7 @@ namespace ScriptCanvas // this prevents repeated updates based on changes to slots Method::InitializeMethod(config); - + SetClassNamePretty(""); RefreshActiveIndexes(); ConfigureContracts(); @@ -197,7 +195,12 @@ namespace ScriptCanvas SlotId MethodOverloaded::AddMethodInputSlot(const MethodConfiguration& config, size_t argumentIndex) { const AZ::BehaviorParameter* argumentPtr = config.m_method.GetArgument(argumentIndex); - AZ_Assert(argumentPtr, "Method: %s had a null argument at index: %d", config.m_lookupName->data(), argumentIndex); + + if (!argumentPtr) + { + return SlotId{}; + } + const auto& argument = *argumentPtr; auto nameAndToolTip = MethodHelper::GetArgumentNameAndToolTip(config, argumentIndex); @@ -507,7 +510,7 @@ namespace ScriptCanvas } } - void MethodOverloaded::RefreshActiveIndexes(bool checkForConnections) + void MethodOverloaded::RefreshActiveIndexes(bool checkForConnections, bool adjustSlots) { DataIndexMapping concreteInputTypes; DataIndexMapping concreteOutputTypes; @@ -519,6 +522,35 @@ namespace ScriptCanvas if (m_overloadSelection.m_availableIndexes.size() == 1) { auto methodOverload = m_overloadConfiguration.m_overloads[(*m_overloadSelection.m_availableIndexes.begin())]; + + if (adjustSlots) + { + const size_t numArguments = methodOverload.first->GetNumArguments(); + const size_t numInputSlots = m_orderedInputSlotIds.size(); + + if (numArguments > numInputSlots) + { + MethodConfiguration config(*methodOverload.first, GetMethodType()); + AZStd::string_view lookupName = GetLookupName(); + config.m_lookupName = &lookupName; + + for (size_t index = numInputSlots; index != numArguments; ++index) + { + AddMethodInputSlot(config, index); + } + } + else if (numArguments < numInputSlots) + { + const size_t removeCount = numInputSlots - numArguments; + // remove extra slots, assuming remaining ones are of valid type (if not valid name) + for (size_t count = 0; count != removeCount; ++count) + { + RemoveSlot(m_orderedInputSlotIds.back()); + m_orderedInputSlotIds.pop_back(); + } + } + } + SetMethodUnchecked(methodOverload.first, methodOverload.second); } } @@ -681,9 +713,6 @@ namespace ScriptCanvas return AZ::Success(); } - } - } - } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h index 1fffbd7eac..517d3dd072 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Core/MethodOverloaded.h @@ -106,7 +106,7 @@ namespace ScriptCanvas void SetupMethodData(const AZ::BehaviorMethod* lookupMethod, const AZ::BehaviorClass* lookupClass); void ConfigureContracts(); - void RefreshActiveIndexes(bool checkForConnections = true); + void RefreshActiveIndexes(bool checkForConnections = true, bool adjustSlots = false); void FindDataIndexMappings(DataIndexMapping& inputMapping, DataIndexMapping& outputMapping, bool checkForConnections) const; void UpdateSlotDisplay(); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp index c510b55314..2f79d4218a 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/Rotate.cpp @@ -47,21 +47,10 @@ namespace ScriptCanvas AZ::Transform currentTransform = AZ::Transform::CreateIdentity(); AZ::TransformBus::EventResult(currentTransform, targetEntity, &AZ::TransformInterface::GetWorldTM); - - AZ::Vector3 position = currentTransform.GetTranslation(); - AZ::Quaternion currentRotation = currentTransform.GetRotation(); + currentTransform.SetRotation((rotation * currentTransform.GetRotation().GetNormalized())); - AZ::Quaternion newRotation = (rotation * currentRotation); - newRotation.Normalize(); - - AZ::Transform newTransform = AZ::Transform::CreateIdentity(); - - newTransform.SetScale(currentTransform.GetScale()); - newTransform.SetRotation(newRotation); - newTransform.SetTranslation(position); - - AZ::TransformBus::Event(targetEntity, &AZ::TransformInterface::SetWorldTM, newTransform); + AZ::TransformBus::Event(targetEntity, &AZ::TransformInterface::SetWorldTM, currentTransform); } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp index 20ea4e1b33..53884f4dd8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Entity/RotateMethod.cpp @@ -44,22 +44,12 @@ namespace ScriptCanvas { AZ::Quaternion rotation = AZ::ConvertEulerDegreesToQuaternion(angles); - AZ::Transform currentTransform = AZ::Transform::CreateIdentity(); - AZ::TransformBus::EventResult(currentTransform, targetEntity, &AZ::TransformInterface::GetWorldTM); + AZ::Transform transform = AZ::Transform::CreateIdentity(); + AZ::TransformBus::EventResult(transform, targetEntity, &AZ::TransformInterface::GetWorldTM); - AZ::Vector3 position = currentTransform.GetTranslation(); - AZ::Quaternion currentRotation = currentTransform.GetRotation(); + transform.SetRotation((rotation * transform.GetRotation()).GetNormalized()); - AZ::Quaternion newRotation = (rotation * currentRotation); - newRotation.Normalize(); - - AZ::Transform newTransform = AZ::Transform::CreateIdentity(); - - newTransform.CreateScale(currentTransform.ExtractScale()); - newTransform.SetRotation(newRotation); - newTransform.SetTranslation(position); - - AZ::TransformBus::Event(targetEntity, &AZ::TransformInterface::SetWorldTM, newTransform); + AZ::TransformBus::Event(targetEntity, &AZ::TransformInterface::SetWorldTM, transform); } } } diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.cpp index 641bdca8f7..8c2671ac6d 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,7 @@ namespace ScriptCanvas Entity::InitNodeRegistry(*g_nodeRegistry); Comparison::InitNodeRegistry(*g_nodeRegistry); Time::InitNodeRegistry(*g_nodeRegistry); + Spawning::InitNodeRegistry(*g_nodeRegistry); String::InitNodeRegistry(*g_nodeRegistry); Operators::InitNodeRegistry(*g_nodeRegistry); @@ -61,6 +63,7 @@ namespace ScriptCanvas Entity::Reflect(reflectContext); Comparison::Reflect(reflectContext); Time::Reflect(reflectContext); + Spawning::Reflect(reflectContext); String::Reflect(reflectContext); Operators::Reflect(reflectContext); @@ -90,6 +93,9 @@ namespace ScriptCanvas componentDescriptors = Time::GetComponentDescriptors(); libraryDescriptors.insert(libraryDescriptors.end(), componentDescriptors.begin(), componentDescriptors.end()); + componentDescriptors = Spawning::GetComponentDescriptors(); + libraryDescriptors.insert(libraryDescriptors.end(), componentDescriptors.begin(), componentDescriptors.end()); + componentDescriptors = String::GetComponentDescriptors(); libraryDescriptors.insert(libraryDescriptors.end(), componentDescriptors.begin(), componentDescriptors.end()); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h index 3388a029ac..67094f4db8 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Libraries.h @@ -143,6 +143,17 @@ namespace ScriptCanvas }; + struct Spawning : public LibraryDefinition + { + AZ_RTTI(Spawning, "{41E910AE-FBD2-41AD-9173-5105141F0466}", LibraryDefinition); + + static void Reflect(AZ::ReflectContext*); + static void InitNodeRegistry(NodeRegistry& nodeRegistry); + static AZStd::vector GetComponentDescriptors(); + + ~Spawning() override = default; + }; + struct String : public LibraryDefinition { AZ_RTTI(String, "{5B700838-21A2-4579-9303-F4A4822AFEF4}", LibraryDefinition); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h index 6a0f082272..9e66c6c6fc 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Math/TransformNodes.h @@ -26,12 +26,12 @@ namespace ScriptCanvas using namespace MathNodeUtilities; static const char* k_categoryName = "Math/Transform"; - AZ_INLINE std::tuple ExtractScale(TransformType source) + AZ_INLINE std::tuple ExtractUniformScale(TransformType source) { - auto scale(source.ExtractScale()); + auto scale(source.ExtractUniformScale()); return std::make_tuple( scale, source ); } - SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(ExtractScale, k_categoryName, "{8DFE5247-0950-4CD1-87E6-0CAAD42F1637}", "returns a vector which is the length of the scale components, and a transform with the scale extracted ", "Source", "Scale", "Extracted"); + SCRIPT_CANVAS_GENERIC_FUNCTION_MULTI_RESULTS_NODE(ExtractUniformScale, k_categoryName, "{8DFE5247-0950-4CD1-87E6-0CAAD42F1637}", "returns the uniform scale as a float, and a transform with the scale extracted ", "Source", "Uniform Scale", "Extracted"); AZ_INLINE TransformType FromMatrix3x3(Matrix3x3Type source) { @@ -57,11 +57,11 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromRotationAndTranslation, k_categoryName, "{99A4D55D-6EFB-4E24-8113-F5B46DE3A194}", "returns a transform from the rotation and the translation", "Rotation", "Translation"); - AZ_INLINE TransformType FromScale(Vector3Type scale) + AZ_INLINE TransformType FromScale(NumberType scale) { - return TransformType::CreateScale(scale); + return TransformType::CreateUniformScale(scale); } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromScale, k_categoryName, "{4B6454BC-015C-41BB-9C78-34ADBCF70187}", "returns a scale matrix and the translation set to zero", "Scale"); + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(FromScale, k_categoryName, "{4B6454BC-015C-41BB-9C78-34ADBCF70187}", "returns a transform which applies the specified uniform Scale, but no rotation or translation", "Scale"); AZ_INLINE TransformType FromTranslation(Vector3Type translation) { @@ -145,12 +145,12 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(Multiply3x3ByVector3, k_categoryName, "{4F2ABFC6-2E93-4A9D-8639-C7967DB318DB}", "returns Source's 3x3 upper matrix post multiplied by Multiplier", "Source", "Multiplier"); - AZ_INLINE TransformType MultiplyByScale(TransformType source, Vector3Type scale) + AZ_INLINE TransformType MultiplyByUniformScale(TransformType source, NumberType scale) { - source.MultiplyByScale(scale); + source.MultiplyByUniformScale(scale); return source; } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(MultiplyByScale, k_categoryName, "{90472D62-65A8-40C1-AB08-FA66D793F689}", "returns Source multiplied by the scale matrix produced by Scale", "Source", "Scale"); + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(MultiplyByUniformScale, k_categoryName, "{90472D62-65A8-40C1-AB08-FA66D793F689}", "returns Source multiplied uniformly by Scale", "Source", "Scale"); AZ_INLINE TransformType MultiplyByTransform(const TransformType& a, const TransformType& b) { @@ -194,16 +194,16 @@ namespace ScriptCanvas } SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(RotationZDegrees, k_categoryName, "{F848306A-C07C-4586-B52F-BEEE489045D2}", "returns a transform representing a rotation Degrees around the Z-Axis", "Degrees"); - AZ_INLINE Vector3Type ToScale(const TransformType& source) + AZ_INLINE NumberType ToScale(const TransformType& source) { - return source.GetScale(); + return source.GetUniformScale(); } - SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToScale, k_categoryName, "{063C58AD-F567-464D-A432-F298FE3953A6}", "returns the scale part of the Source, the length of the scale components", "Source"); + SCRIPT_CANVAS_GENERIC_FUNCTION_NODE(ToScale, k_categoryName, "{063C58AD-F567-464D-A432-F298FE3953A6}", "returns the uniform scale of the Source", "Source"); using Registrar = RegistrarGeneric < #if ENABLE_EXTENDED_MATH_SUPPORT - ExtractScaleNode , + ExtractUniformScaleNode , #endif FromMatrix3x3AndTranslationNode , FromMatrix3x3Node @@ -230,7 +230,7 @@ namespace ScriptCanvas , Multiply3x3ByVector3Node #endif - , MultiplyByScaleNode + , MultiplyByUniformScaleNode , MultiplyByTransformNode , MultiplyByVector3Node , MultiplyByVector4Node diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp index b8c1e9e400..6f8a23a2ed 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.cpp @@ -393,14 +393,6 @@ namespace ScriptCanvas AZ_UNUSED(sourceType); } - AZStd::unordered_map> OperatorBase::GetReplacementSlotsMap() const - { - AZStd::unordered_map> slotsMap; - slotsMap.emplace("In", AZStd::vector{ "In" }); - slotsMap.emplace("Out", AZStd::vector{ "Out" }); - return slotsMap; - } - void OperatorBase::CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const { auto newDataInSlots = replacementNode->GetSlotsByType(ScriptCanvas::CombinedSlotType::DataIn); diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h index bc49f3fac6..7091d7fa87 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Operators/Operator.h @@ -57,7 +57,6 @@ namespace ScriptCanvas AZStd::vector< SourceSlotConfiguration > m_sourceSlotConfigurations; }; - AZStd::unordered_map> GetReplacementSlotsMap() const override; void CustomizeReplacementNode(Node* replacementNode, AZStd::unordered_map>& outSlotIdMap) const override; using TypeList = AZStd::vector; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.ScriptCanvasNodeable.xml b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.ScriptCanvasNodeable.xml new file mode 100644 index 0000000000..e9b1ce9f4e --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.ScriptCanvasNodeable.xml @@ -0,0 +1,38 @@ + + + + + + + + + + /> + + + + + + + + + + + + diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp new file mode 100644 index 0000000000..b93844b989 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp @@ -0,0 +1,139 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include + +#include +#include + +namespace ScriptCanvas::Nodeables::Spawning +{ + SpawnNodeable::SpawnNodeable(const SpawnNodeable& rhs) + : m_spawnableAsset(rhs.m_spawnableAsset) + {} + + SpawnNodeable& SpawnNodeable::operator=(SpawnNodeable& rhs) + { + m_spawnableAsset = rhs.m_spawnableAsset; + return *this; + } + + void SpawnNodeable::OnInitializeExecutionState() + { + if (!AZ::TickBus::Handler::BusIsConnected()) + { + AZ::TickBus::Handler::BusConnect(); + } + + m_spawnTicket = AzFramework::EntitySpawnTicket(m_spawnableAsset); + } + + void SpawnNodeable::OnDeactivate() + { + AZ::TickBus::Handler::BusDisconnect(); + + m_spawnTicket = AzFramework::EntitySpawnTicket(); + } + + void SpawnNodeable::OnTick([[maybe_unused]] float delta, [[maybe_unused]] AZ::ScriptTimePoint timePoint) + { + AZStd::vector swappedSpawnedEntityList; + AZStd::vector swappedSpawnBatchSizes; + { + AZStd::lock_guard lock(m_idBatchMutex); + + swappedSpawnedEntityList.swap(m_spawnedEntityList); + swappedSpawnBatchSizes.swap(m_spawnBatchSizes); + } + + AZ::EntityId* batchBegin = swappedSpawnedEntityList.data(); + for (size_t batchSize : swappedSpawnBatchSizes) + { + if (batchSize == 0) + { + continue; + } + + AZStd::vector spawnedEntitiesBatch( + batchBegin, batchBegin + batchSize); + + CallOnSpawn(AZStd::move(spawnedEntitiesBatch)); + + batchBegin += batchSize; + } + } + + void SpawnNodeable::OnSpawnAssetChanged() + { + if (m_spawnableAsset.GetId().IsValid()) + { + AZStd::string rootSpawnableFile; + AzFramework::StringFunc::Path::GetFileName(m_spawnableAsset.GetHint().c_str(), rootSpawnableFile); + + rootSpawnableFile += AzFramework::Spawnable::DotFileExtension; + + AZ::u32 rootSubId = AzFramework::SpawnableAssetHandler::BuildSubId(AZStd::move(rootSpawnableFile)); + + if (m_spawnableAsset.GetId().m_subId != rootSubId) + { + AZ::Data::AssetId rootAssetId = m_spawnableAsset.GetId(); + rootAssetId.m_subId = rootSubId; + + m_spawnableAsset = AZ::Data::AssetManager::Instance(). + FindOrCreateAsset(rootAssetId, AZ::Data::AssetLoadBehavior::Default); + } + else + { + m_spawnableAsset.SetAutoLoadBehavior(AZ::Data::AssetLoadBehavior::Default); + } + } + } + + void SpawnNodeable::RequestSpawn(Data::Vector3Type translation, Data::Vector3Type rotation, Data::NumberType scale) + { + if (m_spawnableAsset.GetAutoLoadBehavior() == AZ::Data::AssetLoadBehavior::NoLoad) + { + return; + } + + auto preSpawnCB = [this, translation, rotation, scale]([[maybe_unused]] AzFramework::EntitySpawnTicket& ticket, + AzFramework::SpawnableEntityContainerView view) + { + AZ::Entity* rootEntity = *view.begin(); + + AzFramework::TransformComponent* entityTransform = + rootEntity->FindComponent(); + + if (entityTransform) + { + AZ::Vector3 rotationCopy = rotation; + AZ::Quaternion rotationQuat = AZ::Quaternion::CreateFromEulerAnglesDegrees(rotationCopy); + + entityTransform->SetWorldTM(AZ::Transform(translation, rotationQuat, AZ::Vector3(scale, scale, scale))); + } + }; + + auto spawnCompleteCB = [this]([[maybe_unused]] AzFramework::EntitySpawnTicket& ticket, + AzFramework::SpawnableConstEntityContainerView view) + { + AZStd::lock_guard lock(m_idBatchMutex); + m_spawnedEntityList.reserve(m_spawnedEntityList.size() + view.size()); + for (const AZ::Entity* entity : view) + { + m_spawnedEntityList.emplace_back(entity->GetId()); + } + m_spawnBatchSizes.push_back(view.size()); + }; + + AzFramework::SpawnableEntitiesInterface::Get()->SpawnAllEntities(m_spawnTicket, preSpawnCB, spawnCompleteCB); + } +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h new file mode 100644 index 0000000000..0f3a27d2ea --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h @@ -0,0 +1,52 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include + +#include + +#include + +#include +#include +#include + +namespace ScriptCanvas::Nodeables::Spawning +{ + class SpawnNodeable + : public ScriptCanvas::Nodeable, + public AZ::TickBus::Handler + { + SCRIPTCANVAS_NODE(SpawnNodeable); + public: + SpawnNodeable() = default; + SpawnNodeable(const SpawnNodeable& rhs); + SpawnNodeable& operator=(SpawnNodeable& rhs); + + void OnInitializeExecutionState() override; + void OnDeactivate() override; + + //TickBus + void OnTick(float delta, AZ::ScriptTimePoint timePoint) override; + + void OnSpawnAssetChanged(); + + private: + AzFramework::EntitySpawnTicket m_spawnTicket; + + AZStd::vector m_spawnedEntityList; + AZStd::vector m_spawnBatchSizes; + AZStd::recursive_mutex m_idBatchMutex; + }; +} diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp new file mode 100644 index 0000000000..6591950b77 --- /dev/null +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp @@ -0,0 +1,50 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include +#include + +namespace ScriptCanvas +{ + namespace Library + { + void Spawning::Reflect(AZ::ReflectContext* reflection) + { + if (AZ::SerializeContext* serializeContext = azrtti_cast(reflection)) + { + serializeContext->Class() + ->Version(1) + ; + + AZ::EditContext* editContext = serializeContext->GetEditContext(); + if (editContext) + { + editContext->Class("Spawning", "") + ->ClassElement(AZ::Edit::ClassElements::EditorData, "") + ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Libraries/Entity.png"); + } + } + } + + void Spawning::InitNodeRegistry(NodeRegistry& nodeRegistry) + { + AddNodeToRegistry(nodeRegistry); + } + + AZStd::vector Spawning::GetComponentDescriptors() + { + return AZStd::vector({ + ScriptCanvas::Nodes::SpawnNodeableNode::CreateDescriptor(), + }); + } + } +} diff --git a/Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.h similarity index 62% rename from Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.h rename to Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.h index 01688d8dc7..fa92ee97a9 100644 --- a/Gems/ScriptCanvasDiagnosticLibrary/Code/Source/precompiled.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Spawning/Spawning.h @@ -12,17 +12,6 @@ #pragma once -#include -#include -#include -#include -#include -#include - -#if !defined(SCRIPTCANVASDIAGNOSTICSLIBRARY_EDITOR) - -#include - -#else - -#endif +// This header is only meant to include the nodes and should not contain +// shared code +#include diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.ScriptCanvasGrammar.xml b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.ScriptCanvasGrammar.xml index 21adecb8fe..e1ea8a4b73 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.ScriptCanvasGrammar.xml +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Libraries/Time/Timer.ScriptCanvasGrammar.xml @@ -8,7 +8,7 @@ Base="ScriptCanvas::Node" Version="2" GeneratePropertyFriend="True" - DeprecationUUID="32A4BEDC-C207-4472-61DE-9A716402620A" + DeprecationUUID="{32A4BEDC-C207-4472-61DE-9A716402620A}" Deprecated="This node has been deprecated in favor of the nodeable form" Description="Provides a time value."> @@ -25,4 +25,4 @@ IsInput="False" IsOutput="True" /> - + \ No newline at end of file diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Results/ErrorText.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Results/ErrorText.h index 16ac7e1fa0..def4fa7761 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Results/ErrorText.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Results/ErrorText.h @@ -62,6 +62,8 @@ namespace ScriptCanvas constexpr const char* NoChildrenAfterRoot = "No children after parsing function root"; constexpr const char* NoChildrenInExtraction = "No children found in property extraction node"; constexpr const char* NoDataPresent = "Could not construct from graph, no graph data was present"; + constexpr const char* NodeableNodeOverloadAmbiguous = "NodeableNodeOverloaded doesn't have enough data connected to select a valid overload"; + constexpr const char* NodeableNodeDidNotConstructInternalNodeable = "NodeableNode did not construct its internal Nodeable"; constexpr const char* NoInputToForEach = "No Input To For Each Loop"; constexpr const char* NoOutForExecution = "No out slot for execution root"; constexpr const char* NoOutSlotInFunctionDefinitionStart = "No 'Out' slot in start of function definition"; diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.cpp b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.cpp index 5bf5f83916..0dc16f721c 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.cpp +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.cpp @@ -12,9 +12,26 @@ #include "VersioningUtils.h" #include +#include namespace ScriptCanvas { + AZStd::vector GraphUpdateSlotReport::Convert(const Endpoint& oldEndpoint) const + { + auto iter = m_oldSlotsToNewSlots.find(oldEndpoint); + return iter != m_oldSlotsToNewSlots.end() ? iter->second : AZStd::vector{ oldEndpoint }; + } + + bool GraphUpdateSlotReport::IsEmpty() const + { + return m_deletedOldSlots.empty() && m_oldSlotsToNewSlots.empty(); + } + + bool NodeUpdateSlotReport::IsEmpty() const + { + return m_deletedOldSlots.empty() && m_oldSlotsToNewSlots.empty(); + } + void VersioningUtils::CopyOldValueToDataSlot(Slot* newSlot, const VariableId& oldVariableReference, const Datum* oldDatum) { if (oldVariableReference.IsValid()) @@ -36,6 +53,99 @@ namespace ScriptCanvas } } + void MergeUpdateSlotReport(const AZ::EntityId& scriptCanvasNodeId, GraphUpdateSlotReport& report, const NodeUpdateSlotReport& source) + { + report.m_deletedOldSlots.reserve(source.m_deletedOldSlots.size()); + + for (auto& slotId : source.m_deletedOldSlots) + { + report.m_deletedOldSlots.insert({ scriptCanvasNodeId, slotId }); + } + + report.m_oldSlotsToNewSlots.reserve(source.m_oldSlotsToNewSlots.size()); + + for (auto& oldToNewIter : source.m_oldSlotsToNewSlots) + { + AZStd::vector newEndpoints; + newEndpoints.reserve(oldToNewIter.second.size()); + + for (auto& targetSlotId : oldToNewIter.second) + { + newEndpoints.push_back({ scriptCanvasNodeId, targetSlotId }); + } + + report.m_oldSlotsToNewSlots[{ scriptCanvasNodeId, oldToNewIter.first}] = AZStd::move(newEndpoints); + } + } + + AZStd::vector> CollectEndpoints(const AZStd::vector& connections, bool logEntityNames) + { + AZStd::vector names; + AZStd::vector> endpoints; + + for (auto& connectionEntity : connections) + { + if (logEntityNames) + { + names.push_back(connectionEntity->GetName()); + } + + if (auto connection = AZ::EntityUtils::FindFirstDerivedComponent(connectionEntity->GetId())) + { + endpoints.push_back(AZStd::make_pair(connection->GetSourceEndpoint(), connection->GetTargetEndpoint())); + } + } + + if (logEntityNames) + { + AZStd::sort(names.begin(), names.end()); + + AZStd::string result = "\nConnection Name list:\n"; + for (auto& name : names) + { + result += "\n"; + result += name; + } + + AZ_TracePrintf("ScriptCanvas", result.c_str()); + } + + return endpoints; + } + + void UpdateConnectionStatus(Graph& graph, const GraphUpdateSlotReport& report) + { + GraphData* graphData = graph.GetGraphData(); + if (!graphData) + { + AZ_Error("ScriptCanvas", false, "Graph was missing graph data to update"); + return; + } + + AZStd::unordered_set oldConnectedSlots; + AZ_TracePrintf("ScriptCanvas", "Connections list before: "); + auto endpoints = CollectEndpoints(graphData->m_connections, true); + graph.RemoveAllConnections(); + + for (auto& iter : endpoints) + { + const AZStd::vector& sources = report.Convert(iter.first); + const AZStd::vector& targets = report.Convert(iter.second); + + for (const auto& source : sources) + { + for (const auto& target : targets) + { + graph.ConnectByEndpoint(source, target); + } + } + } + + graphData->BuildEndpointMap(); + AZ_TracePrintf("ScriptCanvas", "Connections list after: "); + CollectEndpoints(graphData->m_connections, true); + } + void VersioningUtils::CreateRemapConnectionsForSourceEndpoint(const Graph& graph, const Endpoint& oldSourceEndpoint, const Endpoint& newSourceEndpoint, ReplacementConnectionMap& connectionMap) { diff --git a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.h b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.h index 51960e08e7..a9a40305c3 100644 --- a/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.h +++ b/Gems/ScriptCanvas/Code/Include/ScriptCanvas/Utils/VersioningUtils.h @@ -15,6 +15,8 @@ #include #include +#include +#include #include namespace AZ @@ -25,13 +27,36 @@ namespace AZ namespace ScriptCanvas { class Datum; - class Endpoint; class Graph; class Slot; - using ReplacementEndpointPairs = AZStd::unordered_set>; + using ReplacementEndpointPairs = AZStd::unordered_set>; using ReplacementConnectionMap = AZStd::unordered_map; + struct NodeUpdateSlotReport + { + AZStd::unordered_set m_deletedOldSlots; + AZStd::unordered_map> m_oldSlotsToNewSlots; + + bool IsEmpty() const; + }; + + struct GraphUpdateSlotReport + { + AZStd::unordered_set m_deletedOldSlots; + AZStd::unordered_map> m_oldSlotsToNewSlots; + + AZStd::vector Convert(const Endpoint& oldEndpoint) const; + + bool IsEmpty() const; + }; + + void MergeUpdateSlotReport(const AZ::EntityId& scriptCanvasNodeId, GraphUpdateSlotReport& report, const NodeUpdateSlotReport& source); + + AZStd::vector> CollectEndpoints(const AZStd::vector& connections, bool logEntityNames = false); + + void UpdateConnectionStatus(Graph& graph, const GraphUpdateSlotReport& report); + class VersioningUtils { public: diff --git a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake index 84391021df..f0be1accc9 100644 --- a/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake +++ b/Gems/ScriptCanvas/Code/scriptcanvasgem_common_files.cmake @@ -454,6 +454,11 @@ set(FILES Include/ScriptCanvas/Libraries/Time/TimerNodeable.h Include/ScriptCanvas/Libraries/Time/TimerNodeable.cpp Include/ScriptCanvas/Libraries/Time/TimerNodeable.ScriptCanvasNodeable.xml + Include/ScriptCanvas/Libraries/Spawning/Spawning.cpp + Include/ScriptCanvas/Libraries/Spawning/Spawning.h + Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.cpp + Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.h + Include/ScriptCanvas/Libraries/Spawning/SpawnNodeable.ScriptCanvasNodeable.xml Include/ScriptCanvas/Libraries/String/Contains.cpp Include/ScriptCanvas/Libraries/String/Contains.h Include/ScriptCanvas/Libraries/String/Contains.ScriptCanvasGrammar.xml diff --git a/Gems/ScriptCanvasDeveloper/Code/CMakeLists.txt b/Gems/ScriptCanvasDeveloper/Code/CMakeLists.txt index d9ce9004d3..8f2f6d3fc0 100644 --- a/Gems/ScriptCanvasDeveloper/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasDeveloper/Code/CMakeLists.txt @@ -54,6 +54,11 @@ ly_add_target( Gem::ScriptCanvas ) +# By default, the above module is the Client/Server module +ly_create_alias(NAME ScriptCanvasDeveloper.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper) +ly_create_alias(NAME ScriptCanvasDeveloper.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper) + + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ScriptCanvasDeveloper.Editor GEM_MODULE @@ -81,5 +86,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::GraphCanvasWidgets RUNTIME_DEPENDENCIES Gem::ScriptCanvas.Editor + Gem::GraphCanvasWidgets ) + # By Default the above module is the dev tools module + ly_create_alias(NAME ScriptCanvasDeveloper.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper.Editor) + ly_create_alias(NAME ScriptCanvasDeveloper.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasDeveloper.Editor) + endif() diff --git a/Gems/ScriptCanvasPhysics/Code/CMakeLists.txt b/Gems/ScriptCanvasPhysics/Code/CMakeLists.txt index 23ee6937c7..107db38f5e 100644 --- a/Gems/ScriptCanvasPhysics/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasPhysics/Code/CMakeLists.txt @@ -18,10 +18,9 @@ ly_add_target( PRIVATE Source BUILD_DEPENDENCIES - PUBLIC - Gem::ScriptCanvas PRIVATE Legacy::CryCommon + Gem::ScriptCanvas ) ly_add_target( @@ -36,8 +35,16 @@ ly_add_target( PRIVATE Legacy::CryCommon Gem::ScriptCanvasPhysics.Static + Gem::ScriptCanvas ) +# By default, the above module is used by all application types, however, the module depends at runtime to ScriptCanvas +# and the dependency needs to be different per application type +ly_create_alias(NAME ScriptCanvasPhysics.Clients NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics Gem::ScriptCanvas) +ly_create_alias(NAME ScriptCanvasPhysics.Servers NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics Gem::ScriptCanvas) +ly_create_alias(NAME ScriptCanvasPhysics.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics Gem::ScriptCanvas.Editor) +ly_create_alias(NAME ScriptCanvasPhysics.Builders NAMESPACE Gem TARGETS Gem::ScriptCanvasPhysics Gem::ScriptCanvas.Editor) + ################################################################################ # Tests ################################################################################ @@ -57,6 +64,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Legacy::CryCommon Gem::ScriptCanvasPhysics.Static + Gem::ScriptCanvas ) ly_add_googletest( NAME Gem::ScriptCanvasPhysics.Tests diff --git a/Gems/ScriptCanvasPhysics/Code/Tests/ScriptCanvasPhysicsTest.cpp b/Gems/ScriptCanvasPhysics/Code/Tests/ScriptCanvasPhysicsTest.cpp index 4b04434e13..07ccdc5011 100644 --- a/Gems/ScriptCanvasPhysics/Code/Tests/ScriptCanvasPhysicsTest.cpp +++ b/Gems/ScriptCanvasPhysics/Code/Tests/ScriptCanvasPhysicsTest.cpp @@ -207,8 +207,8 @@ namespace ScriptCanvasPhysicsTests { public: MOCK_CONST_METHOD0(GetSurfaceType, AZ::Crc32()); - MOCK_METHOD1(SetSurfaceType, void(AZ::Crc32)); MOCK_CONST_METHOD0(GetSurfaceTypeName, const AZStd::string&()); + MOCK_METHOD1(SetSurfaceTypeName, void(const AZStd::string&)); MOCK_CONST_METHOD0(GetDynamicFriction, float()); MOCK_METHOD1(SetDynamicFriction, void(float)); MOCK_CONST_METHOD0(GetStaticFriction, float()); @@ -223,6 +223,8 @@ namespace ScriptCanvasPhysicsTests MOCK_METHOD0(GetNativePointer, void*()); MOCK_CONST_METHOD0(GetDensity, float()); MOCK_METHOD1(SetDensity, void(float)); + MOCK_CONST_METHOD0(GetDebugColor, AZ::Color()); + MOCK_METHOD1(SetDebugColor, void(const AZ::Color&)); }; class ScriptCanvasPhysicsTestEnvironment diff --git a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt index 639ef114fc..76a549d6b9 100644 --- a/Gems/ScriptCanvasTesting/Code/CMakeLists.txt +++ b/Gems/ScriptCanvasTesting/Code/CMakeLists.txt @@ -34,7 +34,7 @@ ly_add_target( Gem::ScriptCanvas Gem::ScriptCanvasEditor Gem::GraphCanvasWidgets - Gem::ScriptEvents + Gem::ScriptEvents.Editor PRIVATE AZ::AzCore AZ::AzFramework @@ -45,6 +45,11 @@ ly_add_target( *.ScriptCanvasGrammar.xml,ScriptCanvasGrammar_Source.jinja,$path/$fileprefix.generated.cpp *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Header.jinja,$path/$fileprefix.generated.h *.ScriptCanvasNodeable.xml,ScriptCanvasNodeable_Source.jinja,$path/$fileprefix.generated.cpp + RUNTIME_DEPENDENCIES + Gem::ScriptCanvas.Editor + Gem::ScriptCanvasEditor + Gem::GraphCanvasWidgets + Gem::ScriptEvents ) ly_add_target( @@ -73,6 +78,9 @@ ly_add_target( Gem::ScriptCanvas.Editor ) +# By default, the above module is used only in tools: +ly_create_alias(NAME ScriptCanvasTesting.Tools NAMESPACE Gem TARGETS Gem::ScriptCanvasTesting.Editor) + ################################################################################ # Tests ################################################################################ @@ -101,6 +109,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzFramework AZ::AzToolsFramework Gem::ScriptCanvasTesting.Editor.Static + Gem::ScriptCanvas.Editor RUNTIME_DEPENDENCIES Gem::GraphCanvas.Editor Gem::ScriptCanvas.Editor diff --git a/Gems/ScriptEvents/Code/CMakeLists.txt b/Gems/ScriptEvents/Code/CMakeLists.txt index 12f8cfd7b6..6f75e35d71 100644 --- a/Gems/ScriptEvents/Code/CMakeLists.txt +++ b/Gems/ScriptEvents/Code/CMakeLists.txt @@ -40,6 +40,11 @@ ly_add_target( Gem::ScriptEvents.Static ) +# the above module is for use in clients and servers +ly_create_alias(NAME ScriptEvents.Clients NAMESPACE Gem TARGETS Gem::ScriptEvents) +ly_create_alias(NAME ScriptEvents.Servers NAMESPACE Gem TARGETS Gem::ScriptEvents) + + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME ScriptEvents.Editor GEM_MODULE @@ -61,6 +66,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AssetBuilderSDK Gem::ScriptEvents.Static ) + + # the above module is for use in dev tools. + ly_create_alias(NAME ScriptEvents.Tools NAMESPACE Gem TARGETS Gem::ScriptEvents.Editor) + ly_create_alias(NAME ScriptEvents.Builders NAMESPACE Gem TARGETS Gem::ScriptEvents.Editor) endif() ################################################################################ diff --git a/Gems/ScriptedEntityTweener/Code/CMakeLists.txt b/Gems/ScriptedEntityTweener/Code/CMakeLists.txt index c5062c84b7..2488057f8c 100644 --- a/Gems/ScriptedEntityTweener/Code/CMakeLists.txt +++ b/Gems/ScriptedEntityTweener/Code/CMakeLists.txt @@ -40,3 +40,9 @@ ly_add_target( AZ::AzCore Legacy::CryCommon ) + +# the above module is for use in all application types: +ly_create_alias(NAME ScriptedEntityTweener.Tools NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener) +ly_create_alias(NAME ScriptedEntityTweener.Clients NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener) +ly_create_alias(NAME ScriptedEntityTweener.Builders NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener) +ly_create_alias(NAME ScriptedEntityTweener.Servers NAMESPACE Gem TARGETS Gem::ScriptedEntityTweener) \ No newline at end of file diff --git a/Gems/SliceFavorites/Code/CMakeLists.txt b/Gems/SliceFavorites/Code/CMakeLists.txt index 4ad89ad6c3..35349c777c 100644 --- a/Gems/SliceFavorites/Code/CMakeLists.txt +++ b/Gems/SliceFavorites/Code/CMakeLists.txt @@ -51,3 +51,6 @@ ly_add_target( 3rdParty::Qt::Core Gem::SliceFavorites.Editor.Static ) + +# the above module is for use in Tools only (no need to load it in builders) +ly_create_alias(NAME SliceFavorites.Tools NAMESPACE Gem TARGETS Gem::SliceFavorites.Editor) \ No newline at end of file diff --git a/Gems/StartingPointCamera/Code/CMakeLists.txt b/Gems/StartingPointCamera/Code/CMakeLists.txt index d6dd1a7038..7bc57476a5 100644 --- a/Gems/StartingPointCamera/Code/CMakeLists.txt +++ b/Gems/StartingPointCamera/Code/CMakeLists.txt @@ -48,3 +48,9 @@ ly_add_target( RUNTIME_DEPENDENCIES Gem::CameraFramework ) + +# the above module is for use in all kinds of applications +ly_create_alias(NAME StartingPointCamera.Servers NAMESPACE Gem TARGETS Gem::StartingPointCamera) +ly_create_alias(NAME StartingPointCamera.Clients NAMESPACE Gem TARGETS Gem::StartingPointCamera) +ly_create_alias(NAME StartingPointCamera.Builders NAMESPACE Gem TARGETS Gem::StartingPointCamera) +ly_create_alias(NAME StartingPointCamera.Tools NAMESPACE Gem TARGETS Gem::StartingPointCamera) diff --git a/Gems/StartingPointCamera/Code/Source/CameraLookAtBehaviors/RotateCameraLookAt.cpp b/Gems/StartingPointCamera/Code/Source/CameraLookAtBehaviors/RotateCameraLookAt.cpp index 2ab7e0bd01..e2e818f3e7 100644 --- a/Gems/StartingPointCamera/Code/Source/CameraLookAtBehaviors/RotateCameraLookAt.cpp +++ b/Gems/StartingPointCamera/Code/Source/CameraLookAtBehaviors/RotateCameraLookAt.cpp @@ -58,19 +58,9 @@ namespace Camera float axisPolarity = m_shouldInvertAxis ? -1.0f : 1.0f; float rotationAmount = axisPolarity * m_rotationAmount; - // remove translation and scale - AZ::Vector3 translation = outLookAtTargetTransform.GetTranslation(); - outLookAtTargetTransform.SetTranslation(AZ::Vector3::CreateZero()); - AZ::Vector3 transformScale = outLookAtTargetTransform.ExtractScale(); - - // perform our rotation - AZ::Transform desiredRotationTransform = AZ::Transform::CreateFromQuaternion(AZ::Quaternion::CreateFromAxisAngle(outLookAtTargetTransform.GetBasis(m_axisOfRotation), rotationAmount)); - - outLookAtTargetTransform = desiredRotationTransform * outLookAtTargetTransform; - - // return scale and translate - outLookAtTargetTransform.SetScale(transformScale); - outLookAtTargetTransform.SetTranslation(translation); + AZ::Quaternion desiredRotation = AZ::Quaternion::CreateFromAxisAngle( + outLookAtTargetTransform.GetBasis(m_axisOfRotation), rotationAmount); + outLookAtTargetTransform.SetRotation(desiredRotation * outLookAtTargetTransform.GetRotation()); } void RotateCameraLookAt::Activate(AZ::EntityId entityId) diff --git a/Gems/StartingPointInput/Code/CMakeLists.txt b/Gems/StartingPointInput/Code/CMakeLists.txt index 1372a79a78..c6e7fdcb52 100644 --- a/Gems/StartingPointInput/Code/CMakeLists.txt +++ b/Gems/StartingPointInput/Code/CMakeLists.txt @@ -56,6 +56,10 @@ ly_add_source_properties( VALUES ${LY_PAL_TOOLS_DEFINES} ) +# the above module is for use in clients and servers +ly_create_alias(NAME StartingPointInput.Servers NAMESPACE Gem TARGETS Gem::StartingPointInput) +ly_create_alias(NAME StartingPointInput.Clients NAMESPACE Gem TARGETS Gem::StartingPointInput) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME StartingPointInput.Editor GEM_MODULE @@ -74,6 +78,11 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) AZ::AzFramework Gem::StartingPointInput.Static ) + + # by default, activate the ab ove module in builders and tools: + ly_create_alias(NAME StartingPointInput.Builders NAMESPACE Gem TARGETS Gem::StartingPointInput.Editor) + ly_create_alias(NAME StartingPointInput.Tools NAMESPACE Gem TARGETS Gem::StartingPointInput.Editor) + endif() ################################################################################ diff --git a/Gems/StartingPointInput/Code/Source/InputNode.ScriptCanvasGrammar.xml b/Gems/StartingPointInput/Code/Source/InputNode.ScriptCanvasGrammar.xml index 9d6c555c97..8c8cc34597 100644 --- a/Gems/StartingPointInput/Code/Source/InputNode.ScriptCanvasGrammar.xml +++ b/Gems/StartingPointInput/Code/Source/InputNode.ScriptCanvasGrammar.xml @@ -6,8 +6,10 @@ PreferredClassName="Input Handler" Uuid="{0B0AC61B-4BBA-42BF-BDCD-DAF2D3CA41A8}" Base="ScriptCanvas::Node" - Icon="Icons/ScriptCanvas/Bus.png" + Icon="Editor/Icons/ScriptCanvas/Bus.png" EditAttributes="AZ::Edit::Attributes::Category@Gameplay/Input" + DeprecationUUID="{0A2EB488-5A6A-E166-BB62-23FF81499E33}" + Deprecated="This node has been deprecated in favor of the nodeable form" GraphEntryPoint="True" GeneratePropertyFriend="True" Description="Handle processed input events found in input binding assets"> @@ -25,4 +27,4 @@ IsInput="False" IsOutput="True" /> - + \ No newline at end of file diff --git a/Gems/StartingPointMovement/Code/CMakeLists.txt b/Gems/StartingPointMovement/Code/CMakeLists.txt index d6434ccf78..417dfe01ee 100644 --- a/Gems/StartingPointMovement/Code/CMakeLists.txt +++ b/Gems/StartingPointMovement/Code/CMakeLists.txt @@ -40,3 +40,9 @@ ly_add_target( AZ::AzCore AZ::AzFramework ) + +# the above module is for use in all application types (there is no tool specialization) +ly_create_alias(NAME StartingPointMovement.Servers NAMESPACE Gem TARGETS Gem::StartingPointMovement) +ly_create_alias(NAME StartingPointMovement.Clients NAMESPACE Gem TARGETS Gem::StartingPointMovement) +ly_create_alias(NAME StartingPointMovement.Builders NAMESPACE Gem TARGETS Gem::StartingPointMovement) +ly_create_alias(NAME StartingPointMovement.Tools NAMESPACE Gem TARGETS Gem::StartingPointMovement) \ No newline at end of file diff --git a/Gems/SurfaceData/Code/CMakeLists.txt b/Gems/SurfaceData/Code/CMakeLists.txt index de1aa51938..642849675c 100644 --- a/Gems/SurfaceData/Code/CMakeLists.txt +++ b/Gems/SurfaceData/Code/CMakeLists.txt @@ -22,10 +22,10 @@ ly_add_target( BUILD_DEPENDENCIES PRIVATE Legacy::CryCommon + Gem::LmbrCentral PUBLIC Gem::Atom_RPI.Public Gem::Atom_Feature_Common.Static - Gem::LmbrCentral ) ly_add_target( @@ -42,10 +42,15 @@ ly_add_target( PRIVATE Legacy::CryCommon Gem::SurfaceData.Static + Gem::LmbrCentral RUNTIME_DEPENDENCIES Gem::LmbrCentral ) +# the above module is for use in all client/server types +ly_create_alias(NAME SurfaceData.Servers NAMESPACE Gem TARGETS Gem::SurfaceData) +ly_create_alias(NAME SurfaceData.Clients NAMESPACE Gem TARGETS Gem::SurfaceData) + if (PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( @@ -67,9 +72,13 @@ if (PAL_TRAIT_BUILD_HOST_TOOLS) Legacy::CryCommon AZ::AzToolsFramework Gem::SurfaceData.Static + Gem::LmbrCentral.Editor RUNTIME_DEPENDENCIES Gem::LmbrCentral.Editor ) + # the above module is for use in dev tool situations + ly_create_alias(NAME SurfaceData.Builders NAMESPACE Gem TARGETS Gem::SurfaceData.Editor) + ly_create_alias(NAME SurfaceData.Tools NAMESPACE Gem TARGETS Gem::SurfaceData.Editor) endif() @@ -93,6 +102,7 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) AZ::AzTest Legacy::CryCommon Gem::SurfaceData.Static + Gem::LmbrCentral ) 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 4dcc969434..4703977ab4 100644 --- a/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp +++ b/Gems/SurfaceData/Code/Source/Editor/EditorSurfaceDataSystemComponent.cpp @@ -118,6 +118,8 @@ namespace SurfaceData void EditorSurfaceDataSystemComponent::Deactivate() { + m_surfaceTagNameAssets.clear(); + AzFramework::AssetCatalogEventBus::Handler::BusDisconnect(); AzToolsFramework::Components::EditorComponentBase::Deactivate(); SurfaceDataTagProviderRequestBus::Handler::BusDisconnect(); diff --git a/Gems/TestAssetBuilder/Code/CMakeLists.txt b/Gems/TestAssetBuilder/Code/CMakeLists.txt index dbd2907033..ebd34140aa 100644 --- a/Gems/TestAssetBuilder/Code/CMakeLists.txt +++ b/Gems/TestAssetBuilder/Code/CMakeLists.txt @@ -40,3 +40,6 @@ ly_add_target( PRIVATE Gem::TestAssetBuilder.Static ) + +# the above module is for use in builders only +ly_create_alias(NAME TestAssetBuilder.Builders NAMESPACE Gem TARGETS Gem::TestAssetBuilder.Editor) diff --git a/Gems/TextureAtlas/Code/CMakeLists.txt b/Gems/TextureAtlas/Code/CMakeLists.txt index b7072321dc..d67601235d 100644 --- a/Gems/TextureAtlas/Code/CMakeLists.txt +++ b/Gems/TextureAtlas/Code/CMakeLists.txt @@ -10,7 +10,7 @@ # ly_add_target( - NAME TextureAtlas ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} + NAME TextureAtlas.Static STATIC NAMESPACE Gem FILES_CMAKE textureatlas_files.cmake @@ -21,4 +21,51 @@ ly_add_target( PRIVATE Legacy::CryCommon AZ::AzFramework + PUBLIC + Gem::Atom_RPI.Public + AZ::AtomCore ) + +ly_add_target( + NAME TextureAtlas ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} + NAMESPACE Gem + FILES_CMAKE + textureatlas_module_files.cmake + INCLUDE_DIRECTORIES + PUBLIC + Include + BUILD_DEPENDENCIES + PRIVATE + Legacy::CryCommon + Gem::TextureAtlas.Static +) + +if(PAL_TRAIT_BUILD_HOST_TOOLS) + ly_add_target( + NAME TextureAtlas.Editor GEM_MODULE + NAMESPACE Gem + FILES_CMAKE + textureatlas_module_files.cmake + textureatlas_builder_files.cmake + COMPILE_DEFINITIONS + PRIVATE + TEXTUREATLAS_EDITOR + INCLUDE_DIRECTORIES + PUBLIC + Include + BUILD_DEPENDENCIES + PRIVATE + Legacy::CryCommon + AZ::AzCore + AZ::AzFramework + AZ::AssetBuilderSDK + Gem::TextureAtlas.Static + Gem::ImageProcessingAtom.Headers + ) + ly_create_alias(NAME TextureAtlas.Builders NAMESPACE Gem TARGETS Gem::TextureAtlas.Editor) + ly_create_alias(NAME TextureAtlas.Tools NAMESPACE Gem TARGETS Gem::TextureAtlas.Editor) +endif() + +ly_create_alias(NAME TextureAtlas.Servers NAMESPACE Gem TARGETS Gem::TextureAtlas) +ly_create_alias(NAME TextureAtlas.Clients NAMESPACE Gem TARGETS Gem::TextureAtlas) + diff --git a/Gems/TextureAtlas/Code/Include/TextureAtlas/TextureAtlas.h b/Gems/TextureAtlas/Code/Include/TextureAtlas/TextureAtlas.h index c4e222230d..0703f19c29 100644 --- a/Gems/TextureAtlas/Code/Include/TextureAtlas/TextureAtlas.h +++ b/Gems/TextureAtlas/Code/Include/TextureAtlas/TextureAtlas.h @@ -16,7 +16,8 @@ #include #include -class ITexture; +#include +#include namespace TextureAtlasNamespace { @@ -77,9 +78,9 @@ namespace TextureAtlasNamespace //! Retrieve a coordinate set from the Atlas by its handle virtual AtlasCoordinates GetAtlasCoordinates(const AZStd::string& handle) const = 0; //! Links this atlas to an image pointer - virtual void SetTexture(ITexture* image) = 0; + virtual void SetTexture(AZ::Data::Instance image) = 0; //! Returns the image linked to this atlas - virtual ITexture* GetTexture() const = 0; + virtual AZ::Data::Instance GetTexture() const = 0; //! Returns the width of the atlas virtual int GetWidth() const = 0; //! Returns the height of the atlas diff --git a/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.cpp b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.cpp new file mode 100644 index 0000000000..0cbc653730 --- /dev/null +++ b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.cpp @@ -0,0 +1,98 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include "AtlasBuilderComponent.h" + +#include + +namespace TextureAtlasBuilder +{ + // AZ Components should only initialize their members to null and empty in constructor + // Allocation of data should occur in Init(), once we can guarantee reflection and registration of types + AtlasBuilderComponent::AtlasBuilderComponent() + { + } + + // Handle deallocation of your memory allocated in Init() + AtlasBuilderComponent::~AtlasBuilderComponent() + { + } + + // Init is where you'll actually allocate memory or create objects + // This ensures that any dependency components will have been been created and serialized + void AtlasBuilderComponent::Init() + { + } + + // Activate is where you'd perform registration with other objects and systems. + // All builder classes owned by this component should be registered here + // Any EBuses for the builder classes should also be connected at this point + void AtlasBuilderComponent::Activate() + { + AssetBuilderSDK::AssetBuilderDesc builderDescriptor; + builderDescriptor.m_name = "Atlas Worker Builder"; + builderDescriptor.m_version = 1; + builderDescriptor.m_patterns.emplace_back(AssetBuilderSDK::AssetBuilderPattern("*.texatlas", AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard)); + builderDescriptor.m_busId = azrtti_typeid(); + builderDescriptor.m_createJobFunction = AZStd::bind(&AtlasBuilderWorker::CreateJobs, &m_atlasBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); + builderDescriptor.m_processJobFunction = AZStd::bind(&AtlasBuilderWorker::ProcessJob, &m_atlasBuilder, AZStd::placeholders::_1, AZStd::placeholders::_2); + + m_atlasBuilder.BusConnect(builderDescriptor.m_busId); + + AssetBuilderSDK::AssetBuilderBus::Broadcast(&AssetBuilderSDK::AssetBuilderBusTraits::RegisterBuilderInformation, builderDescriptor); + } + + // Disconnects from any EBuses we connected to in Activate() + // Unregisters from objects and systems we register with in Activate() + void AtlasBuilderComponent::Deactivate() + { + m_atlasBuilder.BusDisconnect(); + + // We don't need to unregister the builder - the AP will handle this for us, because it is managing the lifecycle of this component + } + + // Reflect the input and output formats for the serializer + void AtlasBuilderComponent::Reflect(AZ::ReflectContext* context) + { + // components also get Reflect called automatically + // this is your opportunity to perform static reflection or type registration of any types you want the serializer to know about + if (AZ::SerializeContext* serialize = azrtti_cast(context)) + { + serialize->Class() + ->Version(0) + ->Attribute(AZ::Edit::Attributes::SystemComponentTags, AZStd::vector({ AssetBuilderSDK::ComponentTags::AssetBuilder })) + ; + } + + AtlasBuilderInput::Reflect(context); + } + + void AtlasBuilderComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided) + { + provided.push_back(AZ_CRC("Atlas Builder Plugin Service", 0x35974d0d)); + } + + void AtlasBuilderComponent::GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible) + { + incompatible.push_back(AZ_CRC("Atlas Builder Plugin Service", 0x35974d0d)); + } + + void AtlasBuilderComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required) + { + AZ_UNUSED(required); + } + + void AtlasBuilderComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent) + { + AZ_UNUSED(dependent); + } +} diff --git a/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.h b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.h new file mode 100644 index 0000000000..eb8b85dfcf --- /dev/null +++ b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderComponent.h @@ -0,0 +1,44 @@ +/* + * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or + * its licensors. + * + * For complete copyright and license terms please see the LICENSE at the root of this + * distribution (the "License"). All use of this software is governed by the License, + * or, if provided, by the license below or the license accompanying this file. Do not + * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + */ + +#pragma once + +#include +#include +#include "AtlasBuilderWorker.h" + +namespace TextureAtlasBuilder +{ + class AtlasBuilderComponent : public AZ::Component + { + public: + AZ_COMPONENT(AtlasBuilderComponent, "{F49987FB-3375-4417-AB83-97B44C78B335}"); + + AtlasBuilderComponent(); + ~AtlasBuilderComponent() override; + + void Init() override; + void Activate() override; + void Deactivate() override; + + //! Reflect formats for input and output + static void Reflect(AZ::ReflectContext* context); + + static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided); + static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible); + static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required); + static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent); + + private: + AtlasBuilderWorker m_atlasBuilder; + }; +} // namespace TextureAtlasBuilder diff --git a/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.cpp b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.cpp new file mode 100644 index 0000000000..ca60d33c0a --- /dev/null +++ b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.cpp @@ -0,0 +1,1562 @@ +/* +* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +* or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#include "AtlasBuilderWorker.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace TextureAtlasBuilder +{ + //! Counts leading zeros + uint32_t CountLeadingZeros32(uint32_t x) + { + return x == 0 ? 32 : az_clz_u32(x); + } + + //! Integer log2 + uint32_t IntegerLog2(uint32_t x) + { + return 31 - CountLeadingZeros32(x); + } + + bool IsFolderPath(const AZStd::string& path) + { + bool hasExtension = AzFramework::StringFunc::Path::HasExtension(path.c_str()); + return !hasExtension; + } + + bool HasTrailingSlash(const AZStd::string& path) + { + size_t pathLength = path.size(); + return (pathLength > 0 && (path.at(pathLength - 1) == '/' || path.at(pathLength - 1) == '\\')); + } + + bool GetCanonicalPathFromFullPath(const AZStd::string& fullPath, AZStd::string& canonicalPathOut) + { + AZStd::string curPath = fullPath; + + // We avoid using LocalFileIO::ConvertToAbsolutePath for this because it does not behave consistently across platforms. + // On non-Windows platforms, LocalFileIO::ConvertToAbsolutePath requires that the path exist, otherwise the path + // remains unchanged. This won't work for paths that include wildcards. + // Also, on non-Windows platforms, if the path is already a full path, it will remain unchanged even if it contains + // "./" or "../" somewhere other than the beginning of the path + + // Normalize path + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, curPath); + + const AZStd::string slash("/"); + + // Replace "/./" occurrances with "/" + const AZStd::string slashDotSlash("/./"); + bool replaced = false; + do + { + // Replace first occurrance + replaced = AzFramework::StringFunc::Replace(curPath, slashDotSlash.c_str(), slash.c_str(), false, true, false); + } while (replaced); + + // Replace "/xxx/../" with "/" + const AZStd::regex slashDotDotSlash("\\/[^/.]*\\/\\.\\.\\/"); + AZStd::string prevPath; + while (prevPath != curPath) + { + prevPath = curPath; + curPath = AZStd::regex_replace(prevPath, slashDotDotSlash, slash, AZStd::regex_constants::match_flag_type::format_first_only); + } + + if ((curPath.find("..") != AZStd::string::npos) || (curPath.find("./") != AZStd::string::npos) || (curPath.find("/.") != AZStd::string::npos)) + { + return false; + } + + canonicalPathOut = curPath; + return true; + } + + bool ResolveRelativePath(const AZStd::string& relativePath, const AZStd::string& watchDirectory, AZStd::string& resolvedFullPathOut) + { + bool resolved = false; + + if (relativePath[0] == '@') + { + // Get full path by resolving the alias at the front of the path + char resolvedPath[AZ_MAX_PATH_LEN]; + AZ::IO::FileIOBase::GetInstance()->ResolvePath(relativePath.c_str(), resolvedPath, AZ_MAX_PATH_LEN); + resolvedFullPathOut = resolvedPath; + resolved = true; + } + else + { + // Get full path by appending the relative path to the watch directory + AZStd::string fullPath = watchDirectory; + fullPath.append("/"); + fullPath.append(relativePath); + + // Resolve to canonical path (remove "./" and "../") + resolved = GetCanonicalPathFromFullPath(fullPath, resolvedFullPathOut); + } + + return resolved; + } + + bool GetAbsoluteSourcePathFromRelativePath(const AZStd::string& relativeSourcePath, AZStd::string& absoluteSourcePathOut) + { + bool result = false; + AZ::Data::AssetInfo info; + AZStd::string watchFolder; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(result, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, relativeSourcePath.c_str(), info, watchFolder); + if (result) + { + absoluteSourcePathOut = AZStd::string::format("%s/%s", watchFolder.c_str(), info.m_relativePath.c_str()); + + // Normalize path + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, absoluteSourcePathOut); + } + return result; + } + + // Reflect the input parameters + void AtlasBuilderInput::Reflect(AZ::ReflectContext* context) + { + if (AZ::SerializeContext* serialize = azrtti_cast(context)) + { + serialize->Class() + ->Version(1) + ->Field("Force Square", &AtlasBuilderInput::m_forceSquare) + ->Field("Force Power of Two", &AtlasBuilderInput::m_forcePowerOf2) + ->Field("Include White Texture", &AtlasBuilderInput::m_includeWhiteTexture) + ->Field("Maximum Dimension", &AtlasBuilderInput::m_maxDimension) + ->Field("Padding", &AtlasBuilderInput::m_padding) + ->Field("UnusedColor", &AtlasBuilderInput::m_unusedColor) + ->Field("PresetName", &AtlasBuilderInput::m_presetName) + ->Field("Textures to Add", &AtlasBuilderInput::m_filePaths); + } + } + + // Supports a custom parser format + AtlasBuilderInput AtlasBuilderInput::ReadFromFile(const AZStd::string& path, const AZStd::string& directory, bool& valid) + { + // Open the file + AZ::IO::FileIOBase* input = AZ::IO::FileIOBase::GetInstance(); + AZ::IO::HandleType handle; + input->Open(path.c_str(), AZ::IO::OpenMode::ModeRead, handle); + + // Read the file + AZ::u64 size; + input->Size(handle, size); + char* buffer = new char[size + 1]; + input->Read(handle, buffer, size); + buffer[size] = 0; + + // Close the file + input->Close(handle); + + // Prepare the output + AtlasBuilderInput data; + + // Parse the input into lines + AZStd::vector lines; + AzFramework::StringFunc::Tokenize(buffer, lines, "\n\t"); + delete[] buffer; + + // Parse the individual lines + for (auto line : lines) + { + line = AzFramework::StringFunc::TrimWhiteSpace(line, true, true); + // Check for comments and empty lines + if ((line.length() >= 2 && line[0] == '/' && line[1] == '/') || line.length() < 1) + { + continue; + } + else if (line.find('=') != -1) + { + AZStd::vector args; + AzFramework::StringFunc::Tokenize(line.c_str(), args, '=', true, true); + + if (args.size() > 2) + { + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to parse line: Excessive '=' symbols were found: \"%s\"", line.c_str()).c_str()); + valid = false; + } + + // Trim whitespace + args[0] = AzFramework::StringFunc::TrimWhiteSpace(args[0], true, true); + args[1] = AzFramework::StringFunc::TrimWhiteSpace(args[1], true, true); + + // No case sensitivity for property names + AZStd::to_lower(args[0].begin(), args[0].end()); + + // Keep track of if the value is rejected + bool accepted = false; + + if (args[0] == "square") + { + accepted = AzFramework::StringFunc::LooksLikeBool(args[1].c_str()); + if (accepted) + { + data.m_forceSquare = AzFramework::StringFunc::ToBool(args[1].c_str()); + } + } + else if (args[0] == "poweroftwo") + { + accepted = AzFramework::StringFunc::LooksLikeBool(args[1].c_str()); + if (accepted) + { + data.m_forcePowerOf2 = AzFramework::StringFunc::ToBool(args[1].c_str()); + } + } + else if (args[0] == "whitetexture") + { + accepted = AzFramework::StringFunc::LooksLikeBool(args[1].c_str()); + if (accepted) + { + data.m_includeWhiteTexture = AzFramework::StringFunc::ToBool(args[1].c_str()); + } + } + else if (args[0] == "maxdimension") + { + accepted = AzFramework::StringFunc::LooksLikeInt(args[1].c_str()); + if (accepted) + { + data.m_maxDimension = AzFramework::StringFunc::ToInt(args[1].c_str()); + } + } + else if (args[0] == "padding") + { + accepted = AzFramework::StringFunc::LooksLikeInt(args[1].c_str()); + if (accepted) + { + data.m_padding = AzFramework::StringFunc::ToInt(args[1].c_str()); + } + } + else if (args[0] == "unusedcolor") + { + accepted = args[1].at(0) == '#' && args[1].length() == 9; + if (accepted) + { + AZStd::string color = AZStd::string::format("%s%s%s%s", args[1].substr(7).c_str(), args[1].substr(5, 2).c_str(), + args[1].substr(3, 2).c_str(), args[1].substr(1, 2).c_str()); + data.m_unusedColor.FromU32(AZStd::stoul(color, nullptr, 16)); + } + } + else if (args[0] == "presetname") + { + accepted = true; + data.m_presetName = args[1]; + } + else + { + // Supress accepted error because this error superceeds it + accepted = true; + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to parse line: Unrecognized property: \"%s\"", args[0].c_str()).c_str()); + } + + // If the property is recognized but the value is rejected, fail the job + if (!accepted) + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to parse line: Invalid value assigned to property: Property: \"%s\" Value: \"%s\"", args[0].c_str(), args[1].c_str()).c_str()); + } + } + else if ((line[0] == '-')) + { + // Remove image files + AZStd::string remove = line.substr(1); + remove = AzFramework::StringFunc::TrimWhiteSpace(remove, true, true); + if (remove.find('*') != -1) + { + AZStd::string resolvedAbsolutePath; + bool resolved = ResolveRelativePath(remove, directory, resolvedAbsolutePath); + if (resolved) + { + RemoveFilesUsingWildCard(data.m_filePaths, resolvedAbsolutePath); + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to resolve relative path: %s", remove.c_str()).c_str()); + } + } + else if (IsFolderPath(remove)) + { + AZStd::string resolvedAbsolutePath; + bool resolved = ResolveRelativePath(remove, directory, resolvedAbsolutePath); + if (resolved) + { + RemoveFolderContents(data.m_filePaths, resolvedAbsolutePath); + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to resolve relative path: %s", remove.c_str()).c_str()); + } + } + else + { + // Get the full path to the source image from the relative source path + AZStd::string fullSourceAssetPathName; + bool fullPathFound = GetAbsoluteSourcePathFromRelativePath(remove, fullSourceAssetPathName); + + if (!fullPathFound) + { + // Try to resolve relative path as it might be using "./" or "../" + fullPathFound = ResolveRelativePath(remove, directory, fullSourceAssetPathName); + } + + if (fullPathFound) + { + for (size_t i = 0; i < data.m_filePaths.size(); ++i) + { + if (data.m_filePaths[i] == fullSourceAssetPathName) + { + data.m_filePaths.erase(data.m_filePaths.begin() + i); + } + } + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to get source asset path for image: %s", remove.c_str()).c_str()); + } + } + } + else + { + // Add image files + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, line); + bool duplicate = false; + if (line.find('*') != -1) + { + AZStd::string resolvedAbsolutePath; + bool resolved = ResolveRelativePath(line, directory, resolvedAbsolutePath); + if (resolved) + { + AddFilesUsingWildCard(data.m_filePaths, resolvedAbsolutePath); + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to resolve relative path: %s", line.c_str()).c_str()); + } + } + else if (IsFolderPath(line)) + { + AZStd::string resolvedAbsolutePath; + bool resolved = ResolveRelativePath(line, directory, resolvedAbsolutePath); + if (resolved) + { + AddFolderContents(data.m_filePaths, resolvedAbsolutePath, valid); + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to resolve relative path: %s", line.c_str()).c_str()); + } + } + else + { + // Get the full path to the source image from the relative source path + AZStd::string fullSourceAssetPathName; + bool fullPathFound = GetAbsoluteSourcePathFromRelativePath(line, fullSourceAssetPathName); + + if (!fullPathFound) + { + // Try to resolve relative path as it might be using "./" or "../" + fullPathFound = ResolveRelativePath(line, directory, fullSourceAssetPathName); + } + + if (fullPathFound) + { + // Prevent duplicates + for (size_t i = 0; i < data.m_filePaths.size() && !duplicate; ++i) + { + duplicate = data.m_filePaths[i] == fullSourceAssetPathName; + } + if (!duplicate) + { + data.m_filePaths.push_back(fullSourceAssetPathName); + } + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to get source asset path for image: %s", line.c_str()).c_str()); + } + } + } + } + + return data; + } + + void AtlasBuilderInput::AddFilesUsingWildCard(AZStd::vector& paths, const AZStd::string& insert) + { + const AZStd::string& fullPath = insert; + + AZStd::vector candidates; + AZStd::string fixedPath = fullPath.substr(0, fullPath.find('*')); + fixedPath = fixedPath.substr(0, fixedPath.find_last_of('/')); + candidates.push_back(fixedPath); + + AZStd::vector wildPath; + AzFramework::StringFunc::Tokenize(fullPath.substr(fixedPath.length()).c_str(), wildPath, "/"); + + for (size_t i = 0; i < wildPath.size() && candidates.size() > 0; ++i) + { + AZStd::vector nextCandidates; + for (size_t j = 0; j < candidates.size(); ++j) + { + AZStd::string compare = AZStd::string::format("%s/%s", candidates[j].c_str(), wildPath[i].c_str()); + QDir inputFolder(candidates[j].c_str()); + if (inputFolder.exists()) + { + QFileInfoList entries = inputFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Files); + for (const QFileInfo& entry : entries) + { + AZStd::string child = (entry.filePath().toStdString()).c_str(); + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, child); + if (DoesPathnameMatchWildCard(compare, child)) + { + nextCandidates.push_back(child); + } + } + } + } + candidates = nextCandidates; + } + + for (size_t i = 0; i < candidates.size(); ++i) + { + if (!IsFolderPath(candidates[i]) && !HasTrailingSlash(fullPath)) + { + AZStd::string ext; + AzFramework::StringFunc::Path::GetExtension(candidates[i].c_str(), ext, false); + if (ext != "dds") + { + bool duplicate = false; + for (size_t j = 0; j < paths.size() && !duplicate; ++j) + { + duplicate = paths[j] == candidates[i]; + } + if (!duplicate) + { + paths.push_back(candidates[i]); + } + } + } + else if (IsFolderPath(candidates[i]) && HasTrailingSlash(fullPath)) + { + bool waste = true; + AddFolderContents(paths, candidates[i], waste); + } + } + } + + void AtlasBuilderInput::RemoveFilesUsingWildCard(AZStd::vector& paths, const AZStd::string& remove) + { + bool isDir = (remove.at(remove.length() - 1) == '/'); + for (size_t i = 0; i < paths.size(); ++i) + { + if (isDir ? DoesWildCardDirectoryIncludePathname(remove, paths[i]) : DoesPathnameMatchWildCard(remove, paths[i])) + { + paths.erase(paths.begin() + i); + --i; + } + } + } + + // Tells us if the child follows the rule + bool AtlasBuilderInput::DoesPathnameMatchWildCard(const AZStd::string& rule, const AZStd::string& child) + { + AZStd::vector rulePathTokens; + AzFramework::StringFunc::Tokenize(rule.c_str(), rulePathTokens, "/"); + AZStd::vector pathTokens; + AzFramework::StringFunc::Tokenize(child.c_str(), pathTokens, "/"); + if (rulePathTokens.size() != pathTokens.size()) + { + return false; + } + for (size_t i = 0; i < rulePathTokens.size(); ++i) + { + if (!TokenMatchesWildcard(rulePathTokens[i], pathTokens[i])) + { + return false; + } + } + return true; + } + + bool AtlasBuilderInput::DoesWildCardDirectoryIncludePathname(const AZStd::string& rule, const AZStd::string& child) + { + AZStd::vector rulePathTokens; + AzFramework::StringFunc::Tokenize(rule.c_str(), rulePathTokens, "/"); + AZStd::vector pathTokens; + AzFramework::StringFunc::Tokenize(child.c_str(), pathTokens, "/"); + if (rulePathTokens.size() >= pathTokens.size()) + { + return false; + } + for (size_t i = 0; i < rulePathTokens.size(); ++i) + { + if (!TokenMatchesWildcard(rulePathTokens[i], pathTokens[i])) + { + return false; + } + } + return true; + } + + bool AtlasBuilderInput::TokenMatchesWildcard(const AZStd::string& rule, const AZStd::string& child) + { + AZStd::vector ruleTokens; + AzFramework::StringFunc::Tokenize(rule.c_str(), ruleTokens, "*"); + size_t pos = 0; + int token = 0; + if (rule.at(0) != '*' && child.find(ruleTokens[0]) != 0) + { + return false; + } + + while (pos != AZStd::string::npos && token < ruleTokens.size()) + { + pos = child.find(ruleTokens[token], pos); + if (pos != AZStd::string::npos) + { + pos += ruleTokens[token].size(); + } + ++token; + } + return pos == child.size() || (pos != AZStd::string::npos && rule.at(rule.length() - 1) == '*'); + } + + // Replaces all folder paths with the files they contain + void AtlasBuilderInput::AddFolderContents(AZStd::vector& paths, const AZStd::string& insert, bool& valid) + { + QDir inputFolder(insert.c_str()); + + if (inputFolder.exists()) + { + QFileInfoList entries = inputFolder.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::Files); + for (const QFileInfo& entry : entries) + { + AZStd::string child = (entry.filePath().toStdString()).c_str(); + AZStd::string ext; + bool isDir = !AzFramework::StringFunc::Path::GetExtension(child.c_str(), ext, false); + if (isDir) + { + AddFolderContents(paths, child, valid); + } + else if (ext != "dds") + { + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, child); + bool duplicate = false; + for (size_t i = 0; i < paths.size() && !duplicate; ++i) + { + duplicate = paths[i] == child; + } + if (!duplicate) + { + paths.push_back(child); + } + } + } + } + else + { + valid = false; + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to find requested directory: %s", insert.c_str()).c_str()); + } + } + + // Removes all of the contents of a folder + void AtlasBuilderInput::RemoveFolderContents(AZStd::vector& paths, const AZStd::string& remove) + { + AZStd::string folder = remove; + AzFramework::StringFunc::Strip(folder, "/", false, false, true); + folder.append("/"); + for (size_t i = 0; i < paths.size(); ++i) + { + if (paths[i].find(folder) == 0) + { + paths.erase(paths.begin() + i); + --i; + } + } + } + + // Note - Shutdown will be called on a different thread than your process job thread + void AtlasBuilderWorker::ShutDown() { m_isShuttingDown = true; } + + void AtlasBuilderWorker::CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, + AssetBuilderSDK::CreateJobsResponse& response) + { + // Read in settings/filepaths to set dependencies + AZStd::string fullPath; + AzFramework::StringFunc::Path::Join( + request.m_watchFolder.c_str(), request.m_sourceFile.c_str(), fullPath, true, true); + // Check if input is valid + bool valid = true; + AtlasBuilderInput input = AtlasBuilderInput::ReadFromFile(fullPath, request.m_watchFolder, valid); + + // Set dependencies + for (int i = 0; i < input.m_filePaths.size(); ++i) + { + AssetBuilderSDK::SourceFileDependency dependency; + dependency.m_sourceFileDependencyPath = input.m_filePaths[i].c_str(); + response.m_sourceFileDependencyList.push_back(dependency); + } + + // We process the same file for all platforms + for (const AssetBuilderSDK::PlatformInfo& info : request.m_enabledPlatforms) + { + bool doesSupportPlatform = false; + ImageProcessingAtom::ImageBuilderRequestBus::BroadcastResult(doesSupportPlatform, + &ImageProcessingAtom::ImageBuilderRequests::DoesSupportPlatform, + info.m_identifier); + if (doesSupportPlatform) + { + AssetBuilderSDK::JobDescriptor descriptor = GetJobDescriptor(request.m_sourceFile, input); + descriptor.SetPlatformIdentifier(info.m_identifier.c_str()); + response.m_createJobOutputs.push_back(descriptor); + } + } + + if (valid) + { + response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success; + } + + return; + } + + AssetBuilderSDK::JobDescriptor AtlasBuilderWorker::GetJobDescriptor(const AZStd::string& sourceFile, const AtlasBuilderInput& input) + { + // Get the extension of the file + AZStd::string ext; + AzFramework::StringFunc::Path::GetExtension(sourceFile.c_str(), ext, false); + AZStd::to_upper(ext.begin(), ext.end()); + + AssetBuilderSDK::JobDescriptor descriptor; + descriptor.m_jobKey = ext + " Atlas"; + descriptor.m_critical = false; + descriptor.m_jobParameters[AZ_CRC("forceSquare")] = input.m_forceSquare ? "true" : "false"; + descriptor.m_jobParameters[AZ_CRC("forcePowerOf2")] = input.m_forcePowerOf2 ? "true" : "false"; + descriptor.m_jobParameters[AZ_CRC("includeWhiteTexture")] = input.m_includeWhiteTexture ? "true" : "false"; + descriptor.m_jobParameters[AZ_CRC("padding")] = AZStd::to_string(input.m_padding); + descriptor.m_jobParameters[AZ_CRC("maxDimension")] = AZStd::to_string(input.m_maxDimension); + descriptor.m_jobParameters[AZ_CRC("filePaths")] = AZStd::to_string(input.m_filePaths.size()); + + AZ::u32 col = input.m_unusedColor.ToU32(); + descriptor.m_jobParameters[AZ_CRC("unusedColor")] = AZStd::to_string(*reinterpret_cast(&col)); + descriptor.m_jobParameters[AZ_CRC("presetName")] = input.m_presetName; + + // The starting point for the list + const int start = static_cast(descriptor.m_jobParameters.size()) + 1; + descriptor.m_jobParameters[AZ_CRC("startPoint")] = AZStd::to_string(start); + + for (int i = 0; i < input.m_filePaths.size(); ++i) + { + descriptor.m_jobParameters[start + i] = input.m_filePaths[i]; + } + + return descriptor; + } + + void AtlasBuilderWorker::ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, + AssetBuilderSDK::ProcessJobResponse& response) + { + // Before we begin, let's make sure we are not meant to abort. + AssetBuilderSDK::JobCancelListener jobCancelListener(request.m_jobId); + + const AZStd::string path = request.m_fullPath; + + // read in settings/filepaths + AtlasBuilderInput input; + input.m_forceSquare = AzFramework::StringFunc::ToBool(request.m_jobDescription.m_jobParameters.find(AZ_CRC("forceSquare"))->second.c_str()); + input.m_forcePowerOf2 = AzFramework::StringFunc::ToBool(request.m_jobDescription.m_jobParameters.find(AZ_CRC("forcePowerOf2"))->second.c_str()); + input.m_includeWhiteTexture = AzFramework::StringFunc::ToBool(request.m_jobDescription.m_jobParameters.find(AZ_CRC("includeWhiteTexture"))->second.c_str()); + input.m_padding = AzFramework::StringFunc::ToInt(request.m_jobDescription.m_jobParameters.find(AZ_CRC("padding"))->second.c_str()); + input.m_maxDimension = AzFramework::StringFunc::ToInt(request.m_jobDescription.m_jobParameters.find(AZ_CRC("maxDimension"))->second.c_str()); + int startAsInt = AzFramework::StringFunc::ToInt(request.m_jobDescription.m_jobParameters.find(AZ_CRC("startPoint"))->second.c_str()); + int sizeAsInt = AzFramework::StringFunc::ToInt(request.m_jobDescription.m_jobParameters.find(AZ_CRC("filePaths"))->second.c_str()); + AZ::u32 start = static_cast(AZStd::max(0, startAsInt)); + AZ::u32 size = static_cast(AZStd::max(0, sizeAsInt)); + + int col = AzFramework::StringFunc::ToInt(request.m_jobDescription.m_jobParameters.find(AZ_CRC("unusedColor"))->second.c_str()); + input.m_unusedColor.FromU32(*reinterpret_cast(&col)); + + input.m_presetName = request.m_jobDescription.m_jobParameters.find(AZ_CRC("presetName"))->second; + + for (AZ::u32 i = 0; i < size; ++i) + { + input.m_filePaths.push_back(request.m_jobDescription.m_jobParameters.find(start + i)->second); + } + + if (input.m_filePaths.empty()) + { + AZ_Error("AtlasBuilder", false, "No image files specified. Cannot create an empty atlas."); + return; + } + + // Don't allow padding to be less than zero + if (input.m_padding < 0) + { + input.m_padding = 0; + } + + if (input.m_presetName.empty()) + { + // Default to the TextureAtlas preset which is currently set to use compression for all platforms except for iOS. + // Currently the only fully supported compression for iOS is PVRTC which requires the texture to be square and a power of 2. + // Due to this limitation, we default to using no compression for iOS until ASTC is fully supported + const AZStd::string defaultPresetName = "UserInterface_Compressed"; + input.m_presetName = defaultPresetName; + } + + bool isFormatSquarePow2 = false; + ImageProcessingAtom::ImageBuilderRequestBus::BroadcastResult(isFormatSquarePow2, + &ImageProcessingAtom::ImageBuilderRequests::IsPresetFormatSquarePow2, + input.m_presetName, request.m_platformInfo.m_identifier); + + if (isFormatSquarePow2) + { + // Override the user config settings to force square and power of 2. + // Otherwise the image conversion process will stretch the image to satisfy these requirements + input.m_forceSquare = true; + input.m_forcePowerOf2 = true; + } + + // Read in images + AZStd::vector images; + AZ::u64 totalArea = 0; + int maxArea = input.m_maxDimension * input.m_maxDimension; + bool sizeFailure = false; + for (int i = 0; i < input.m_filePaths.size() && !jobCancelListener.IsCancelled(); ++i) + { + ImageProcessingAtom::IImageObjectPtr inputImage; + ImageProcessingAtom::ImageProcessingRequestBus::BroadcastResult(inputImage, &ImageProcessingAtom::ImageProcessingRequests::LoadImage, input.m_filePaths[i]); + + // Check if we were able to load the image + if (inputImage) + { + images.push_back(inputImage); + totalArea += inputImage->GetWidth(0) * inputImage->GetHeight(0); + } + else + { + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to load file: %s", input.m_filePaths[i].c_str()).c_str()); + return; + } + if (maxArea < totalArea) + { + sizeFailure = true; + } + } + // If we get cancelled, return + if (jobCancelListener.IsCancelled()) + { + return; + } + + if (sizeFailure) + { + AZ_Error("AtlasBuilder", false, AZStd::string::format("Total image area exceeds maximum alotted area. %llu > %d", totalArea, maxArea).c_str()); + return; + } + + // Convert all image paths to their output format referenced at runtime + for (auto& filePath : input.m_filePaths) + { + // Get path relative to the watch folder + bool result = false; + AZ::Data::AssetInfo info; + AZStd::string watchFolder; + AzToolsFramework::AssetSystemRequestBus::BroadcastResult(result, &AzToolsFramework::AssetSystemRequestBus::Events::GetSourceInfoBySourcePath, filePath.c_str(), info, watchFolder); + if (!result) + { + AZ_Error("AtlasBuilder", false, AZStd::string::format("Atlas Builder unable to get relative source path for image: %s", filePath.c_str()).c_str()); + return; + } + + // Remove extension + filePath = info.m_relativePath.substr(0, info.m_relativePath.find_last_of('.')); + + // Normalize path + AzFramework::ApplicationRequests::Bus::Broadcast(&AzFramework::ApplicationRequests::NormalizePathKeepCase, filePath); + } + + // Add white texture if we need to + if (input.m_includeWhiteTexture) + { + ImageProcessingAtom::IImageObjectPtr texture; + ImageProcessingAtom::ImageBuilderRequestBus::BroadcastResult(texture, + &ImageProcessingAtom::ImageBuilderRequests::CreateImage, + aznumeric_cast(cellSize), + aznumeric_cast(cellSize), + 1, + ImageProcessingAtom::EPixelFormat::ePixelFormat_R8G8B8A8); + + // Make the texture white + texture->ClearColor(1, 1, 1, 1); + images.push_back(texture); + input.m_filePaths.push_back("WhiteTexture"); + } + + // Generate algorithm inputs + ImageDimensionData data; + for (int i = 0; i < images.size(); ++i) + { + data.push_back(IndexImageDimension(i, + ImageDimension(images[i]->GetWidth(0), + images[i]->GetHeight(0)))); + } + AZStd::sort(data.begin(), data.end()); + + // Run algorithm + + // Variables that keep track of the optimal solution + int resultWidth = -1; + int resultHeight = -1; + + // Check that the max dimension is not large enough for the area to loop past the maximum integer + // This is important because we do not want the area to be calculated negative + if (input.m_maxDimension > 65535) + { + input.m_maxDimension = 65535; + } + + // Get the optimal mappings based on the input settings + AZStd::vector paddedMap; + size_t amountFit = 0; + if (!TryTightening( + input, data, GetWidest(data), GetTallest(data), aznumeric_cast(totalArea), input.m_padding, resultWidth, resultHeight, amountFit, paddedMap)) + { + AZ_Error("AtlasBuilder", false, AZStd::string::format("Cannot fit images into given maximum atlas size (%dx%d). Only %zu out of %zu images fit.", input.m_maxDimension, input.m_maxDimension, amountFit, input.m_filePaths.size()).c_str()); + // For some reason, failing the assert isn't enough to stop the Asset builder. It will still fail further + // down when it tries to assemble the atlas, but returning here is cleaner. + return; + } + + // Move coordinates from algorithm space to padded result space + TextureAtlasNamespace::AtlasCoordinateSets output; + resultWidth = 0; + resultHeight = 0; + AZStd::vector map; + for (int i = 0; i < paddedMap.size(); ++i) + { + map.push_back(AtlasCoordinates(paddedMap[i].GetLeft(), paddedMap[i].GetLeft() + images[data[i].first]->GetWidth(0), paddedMap[i].GetTop(), paddedMap[i].GetTop() + images[data[i].first]->GetHeight(0))); + resultHeight = resultHeight > map[i].GetBottom() ? resultHeight : map[i].GetBottom(); + resultWidth = resultWidth > map[i].GetRight() ? resultWidth : map[i].GetRight(); + + const AZStd::string& outputFilePath = input.m_filePaths[data[i].first]; + output.push_back(AZStd::pair(outputFilePath, map[i])); + } + if (input.m_forcePowerOf2) + { + resultWidth = aznumeric_cast(pow(2, 1 + IntegerLog2(static_cast(resultWidth - 1)))); + resultHeight = aznumeric_cast(pow(2, 1 + IntegerLog2(static_cast(resultHeight - 1)))); + } + else + { + resultWidth = (resultWidth + (cellSize - 1)) / cellSize * cellSize; + resultHeight = (resultHeight + (cellSize - 1)) / cellSize * cellSize; + } + if (input.m_forceSquare) + { + if (resultWidth > resultHeight) + { + resultHeight = resultWidth; + } + else + { + resultWidth = resultHeight; + } + } + + // Process texture sheet + ImageProcessingAtom::IImageObjectPtr outImage; + ImageProcessingAtom::ImageBuilderRequestBus::BroadcastResult(outImage, + &ImageProcessingAtom::ImageBuilderRequests::CreateImage, + aznumeric_cast(resultWidth), + aznumeric_cast(resultHeight), + 1, + ImageProcessingAtom::EPixelFormat::ePixelFormat_R8G8B8A8); + + // Clear the sheet + outImage->ClearColor(input.m_unusedColor.GetR(), input.m_unusedColor.GetG(), input.m_unusedColor.GetB(), input.m_unusedColor.GetA()); + + AZ::u8* outBuffer = nullptr; + AZ::u32 outPitch; + outImage->GetImagePointer(0, outBuffer, outPitch); + + // Copy images over + for (int i = 0; i < map.size() && !jobCancelListener.IsCancelled(); ++i) + { + AZ::u8* inBuffer = nullptr; + AZ::u32 inPitch; + images[data[i].first]->GetImagePointer(0, inBuffer, inPitch); + int j = 0; + + // The padding calculated here is the amount of excess horizontal space measured in bytes that are in each + // row of the destination space AFTER the placement of the source row. + int rightPadding = (paddedMap[i].GetRight() - map[i].GetRight() - input.m_padding); + if (map[i].GetRight() + rightPadding > resultWidth) + { + rightPadding = resultWidth - map[i].GetRight(); + } + rightPadding *= bytesPerPixel; + int bottomPadding = (paddedMap[i].GetBottom() - map[i].GetBottom() - input.m_padding); + if (map[i].GetBottom() + bottomPadding > resultHeight) + { + bottomPadding = resultHeight - map[i].GetBottom(); + } + + int leftPadding = 0; + if (map[i].GetLeft() - input.m_padding >= 0) + { + leftPadding = input.m_padding * bytesPerPixel; + } + + int topPadding = 0; + if (map[i].GetTop() - input.m_padding >= 0) + { + topPadding = input.m_padding; + } + + for (j = 0; j < map[i].GetHeight(); ++j) + { + // When we multiply `map[i].GetLeft()` by 4, we are changing the measure from atlas space, to byte array + // space. The number is 4 because in this format, each pixel is 4 bytes long. + memcpy(outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel), + inBuffer + inPitch * j, + inPitch); + // Fill in the last bit of the row in the destination space with the same colors + SetPixels(outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel) + inPitch, + outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel) + inPitch - bytesPerPixel, + rightPadding); + // Fill in the first bit of the row in the destination space with the same colors + SetPixels(outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel) - leftPadding, + outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel), + leftPadding); + } + // Fill in the last few rows of the buffer with the same colors + for (; j < map[i].GetHeight() + bottomPadding; ++j) + { + memcpy(outBuffer + (map[i].GetTop() + j) * outPitch + (map[i].GetLeft() * bytesPerPixel) - leftPadding, + outBuffer + (map[i].GetBottom() - 1) * outPitch + (map[i].GetLeft() * bytesPerPixel) - leftPadding, + inPitch + leftPadding + rightPadding); + } + for (j = 1; j <= topPadding; ++j) + { + memcpy(outBuffer + (map[i].GetTop() - j) * outPitch + (map[i].GetLeft() * bytesPerPixel) - leftPadding, + outBuffer + map[i].GetTop() * outPitch + (map[i].GetLeft() * bytesPerPixel) - leftPadding, + inPitch + rightPadding + leftPadding); + } + } + + // If we get cancelled, return + if (jobCancelListener.IsCancelled()) + { + return; + } + + // Output Atlas Coordinates + AZStd::string fileName; + AZStd::string outputPath; + AzFramework::StringFunc::Path::GetFullFileName(request.m_sourceFile.c_str(), fileName); + fileName = fileName.append("idx"); + AzFramework::StringFunc::Path::Join( + request.m_tempDirPath.c_str(), fileName.c_str(), outputPath, true, true); + + // Output texture sheet + AZStd::string imageFileName, imageOutputPath; + AzFramework::StringFunc::Path::GetFileName(request.m_sourceFile.c_str(), imageFileName); + imageFileName += ".texatlas"; + AzFramework::StringFunc::Path::Join( + request.m_tempDirPath.c_str(), imageFileName.c_str(), imageOutputPath, true, true); + + AZStd::vector outProducts; + ImageProcessingAtom::ImageBuilderRequestBus::BroadcastResult(outProducts, + &ImageProcessingAtom::ImageBuilderRequests::ConvertImageObject, + outImage, + input.m_presetName, + request.m_platformInfo.m_identifier, + imageOutputPath, + request.m_sourceFileUUID, + request.m_sourceFile); + + if (!outProducts.empty()) + { + TextureAtlasNamespace::TextureAtlasRequestBus::Broadcast( + &TextureAtlasNamespace::TextureAtlasRequests::SaveAtlasToFile, outputPath, output, resultWidth, resultHeight); + response.m_outputProducts.push_back(AssetBuilderSDK::JobProduct(outputPath)); + response.m_outputProducts[static_cast(Product::TexatlasidxProduct)].m_productAssetType = azrtti_typeid(); + response.m_outputProducts[static_cast(Product::TexatlasidxProduct)].m_productSubID = 0; + + // The Image Processing Gem can produce multiple output files under certain + // circumstances, but the texture atlas is not expected to produce such output + if (outProducts.size() > 1) + { + AZ_Error("AtlasBuilder", false, "Image processing resulted in multiple output files. Texture atlas is expected to produce one output."); + response.m_outputProducts.clear(); + return; + } + + response.m_outputProducts.push_back(outProducts[0]); + + // The texatlasidx file is a data file that indicates where the original parts are inside the atlas, + // and this would usually imply that it refers to its dds file in some way or needs it to function. + // The texatlasidx file should be the one that depends on the DDS because it's possible to use the DDS + // without the texatlasid, but not the other way around + AZ::Data::AssetId productAssetId(request.m_sourceFileUUID, response.m_outputProducts.back().m_productSubID); + response.m_outputProducts[static_cast(Product::TexatlasidxProduct)].m_dependencies.push_back(AssetBuilderSDK::ProductDependency(productAssetId, 0)); + response.m_outputProducts[static_cast(Product::TexatlasidxProduct)].m_dependenciesHandled = true; // We've populated the dependencies immediately above so it's OK to tell the AP we've handled dependencies + + response.m_resultCode = AssetBuilderSDK::ProcessJobResult_Success; + } + } + + bool AtlasBuilderWorker::TryPack(const ImageDimensionData& images, + int targetWidth, + int targetHeight, + int padding, + size_t& amountFit, + AZStd::vector& out) + { + // Start with one open slot and initialize a vector to store the closed products + AZStd::vector open; + AZStd::vector closed; + open.push_back(AtlasCoordinates(0, targetWidth, 0, targetHeight)); + bool slotNotFound = false; + for (size_t i = 0; i < images.size() && !slotNotFound; ++i) + { + slotNotFound = true; + // Try to place the image in every open slot + for (size_t j = 0; j < open.size(); ++j) + { + if (CanInsert(open[j], images[i].second, padding, targetWidth, targetHeight)) + { + // if it fits, subdivide the excess space in the slot, add it back to the open list and place the + // filled space into the closed vector + slotNotFound = false; + AtlasCoordinates spent(open[j].GetLeft(), + open[j].GetLeft() + images[i].second.m_width, + open[j].GetTop(), + open[j].GetTop() + images[i].second.m_height); + + // We are going to try pushing the object up / left to try to avoid creating tight open spaces. + bool needTrim = false; + AtlasCoordinates coords = spent; + // Modifying left will preserve width + coords.SetLeft(coords.GetLeft() - 1); + AddPadding(coords, padding, targetWidth, targetHeight); + while (spent.GetLeft() > 0 && !Collides(coords, closed)) + { + spent.SetLeft(coords.GetLeft()); + coords = spent; + coords.SetLeft(coords.GetLeft() - 1); + AddPadding(coords, padding, targetWidth, targetHeight); + needTrim = true; + } + // Refocus the search to see if we can push up + coords = spent; + coords.SetTop(coords.GetTop() - 1); + AddPadding(coords, padding, targetWidth, targetHeight); + while (spent.GetTop() > 0 && !Collides(coords, closed)) + { + spent.SetTop(coords.GetTop()); + coords = spent; + coords.SetTop(coords.GetTop() - 1); + AddPadding(coords, padding, targetWidth, targetHeight); + needTrim = true; + } + AddPadding(spent, padding, targetWidth, targetHeight); + if (needTrim) + { + TrimOverlap(open, spent); + closed.push_back(spent); + break; + } + AtlasCoordinates bigCoords; + AtlasCoordinates smallCoords; + + // Create the largest possible subdivision and another subdivision that uses the left over space + if (open[j].GetBottom() - spent.GetBottom() < open[j].GetRight() - spent.GetRight()) + { + smallCoords = AtlasCoordinates( + open[j].GetLeft(), spent.GetRight(), spent.GetBottom(), open[j].GetBottom()); + bigCoords = AtlasCoordinates(spent.GetRight(), open[j].GetRight(), open[j].GetTop(), smallCoords.GetBottom()); + } + else + { + bigCoords = AtlasCoordinates( + open[j].GetLeft(), open[j].GetRight(), spent.GetBottom(), open[j].GetBottom()); + smallCoords = AtlasCoordinates(spent.GetRight(), open[j].GetRight(), open[j].GetTop(), bigCoords.GetTop()); + } + + open.erase(open.begin() + j, open.begin() + j + 1); + if (bigCoords.GetHeight() > 0 && bigCoords.GetHeight() > 0) + { + InsertInOrder(open, bigCoords); + } + if (smallCoords.GetHeight() > 0 && smallCoords.GetHeight() > 0) + { + InsertInOrder(open, smallCoords); + } + + closed.push_back(spent); + break; + } + } + if (slotNotFound) + { + // If no single open slot can fit the object, do one last check to see if we can fit it in at any open + // corner. The reason we perform this check is in case the object can be fit across multiple different + // open spaces. If there is a space that an object can be fit in, it will probably involve the top left + // corner of that object in the top left corner of an open slot. This may miss some odd fits, but due to + // the nature of the packing algorithm, such solutions are highly unlikely to exist. If we wanted to + // expand the algorithm, we could theoretically base it on edges instead of corners to find all results, + // but it would not be time efficient. + for (size_t j = 0; j < open.size(); ++j) + { + AtlasCoordinates insert = AtlasCoordinates(open[j].GetLeft(), + open[j].GetLeft() + images[i].second.m_width, + open[j].GetTop(), + open[j].GetTop() + images[i].second.m_height); + AddPadding(insert, padding, targetWidth, targetHeight); + if (insert.GetRight() <= targetWidth && insert.GetBottom() <= targetHeight) + { + bool collision = Collides(insert, closed); + if (!collision) + { + closed.push_back(insert); + // Trim overlapping open slots + TrimOverlap(open, insert); + slotNotFound = false; + break; + } + } + } + } + } + // If we succeeded, update the output + if (!slotNotFound) + { + out = closed; + } + amountFit = amountFit > closed.size() ? amountFit : closed.size(); + return !slotNotFound; + } + + // Modifies slotList so that no items in slotList overlap with item + void AtlasBuilderWorker::TrimOverlap(AZStd::vector& slotList, AtlasCoordinates item) + { + for (size_t i = 0; i < slotList.size(); ++i) + { + if (Collides(slotList[i], item)) + { + // Subdivide the overlapping slot to seperate overlapping and non overlapping portions + AtlasCoordinates overlap = GetOverlap(item, slotList[i]); + AZStd::vector excess; + excess.push_back(AtlasCoordinates( + slotList[i].GetLeft(), overlap.GetRight(), slotList[i].GetTop(), overlap.GetTop())); + excess.push_back(AtlasCoordinates( + slotList[i].GetLeft(), overlap.GetLeft(), overlap.GetTop(), slotList[i].GetBottom())); + excess.push_back(AtlasCoordinates( + overlap.GetRight(), slotList[i].GetRight(), slotList[i].GetTop(), overlap.GetBottom())); + excess.push_back(AtlasCoordinates( + overlap.GetLeft(), slotList[i].GetRight(), overlap.GetBottom(), slotList[i].GetBottom())); + slotList.erase(slotList.begin() + i); + for (size_t j = 0; j < excess.size(); ++j) + { + if (excess[j].GetWidth() > 0 && excess[j].GetHeight() > 0) + { + InsertInOrder(slotList, excess[j]); + } + } + --i; + } + } + } + + // This function interprets input and performs the proper tightening option + bool AtlasBuilderWorker::TryTightening(AtlasBuilderInput input, + const ImageDimensionData& images, + int smallestWidth, + int smallestHeight, + int targetArea, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out) + { + if (input.m_forceSquare) + { + return TryTighteningSquare(images, + smallestWidth > smallestHeight ? smallestWidth : smallestHeight, + input.m_maxDimension, + targetArea, + input.m_forcePowerOf2, + padding, + resultWidth, + resultHeight, + amountFit, + out); + } + else + { + return TryTighteningOptimal(images, + smallestWidth, + smallestHeight, + input.m_maxDimension, + targetArea, + input.m_forcePowerOf2, + padding, + resultWidth, + resultHeight, + amountFit, + out); + } + } + + // Finds the optimal square solution by starting with the ideal solution and expanding the size of the space until everything fits + bool AtlasBuilderWorker::TryTighteningSquare(const ImageDimensionData& images, + int lowerBound, + int maxDimension, + int targetArea, + bool powerOfTwo, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out) + { + // Square solution cannot be smaller than the target area + int dimension = aznumeric_cast(sqrt(static_cast(targetArea))); + // Solution cannot be smaller than the smallest side + dimension = dimension > lowerBound ? dimension : lowerBound; + if (powerOfTwo) + { + // Starting dimension needs to be rounded up to the nearest power of two + dimension = aznumeric_cast(pow(2, 1 + IntegerLog2(static_cast(dimension - 1)))); + } + + AZStd::vector track; + // Expand the square until the contents fit + while (!TryPack(images, dimension, dimension, padding, amountFit, track) && dimension <= maxDimension) + { + // Step to the next valid value + dimension = powerOfTwo ? dimension * 2 : dimension + cellSize; + } + // Make sure we found a solution + if (dimension > maxDimension) + { + return false; + } + + resultHeight = dimension; + resultWidth = dimension; + out = track; + return true; + } + + // Finds the optimal solution by starting with a somewhat optimal solution and searching for better solutions + bool AtlasBuilderWorker::TryTighteningOptimal(const ImageDimensionData& images, + int smallestWidth, + int smallestHeight, + int maxDimension, + int targetArea, + bool powerOfTwo, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out) + { + AZStd::vector track; + + // round max dimension down to a multiple of cellSize + AZ::u32 maxDimensionRounded = maxDimension - (maxDimension % cellSize); + + // The starting width is the larger of the widest individual texture and the width required + // to fit the total texture area given the max dimension + AZ::u32 smallestWidthDueToArea = targetArea / maxDimensionRounded; + AZ::u32 minWidth = AZStd::max(static_cast(smallestWidth), smallestWidthDueToArea); + + if (powerOfTwo) + { + // Starting dimension needs to be rounded up to the nearest power of two + minWidth = aznumeric_cast(pow(2, 1 + IntegerLog2(static_cast(minWidth - 1)))); + } + + // Round min width up to the nearest compression unit + minWidth = (minWidth + (cellSize - 1)) / cellSize * cellSize; + + AZ::u32 height = 0; + // Finds the optimal thin solution + // This uses a standard binary search to find the smallest width that can pack everything + AZ::u32 lower = minWidth; + AZ::u32 upper = maxDimensionRounded; + AZ::u32 width = 0; + while (lower <= upper) + { + AZ::u32 testWidth = (lower + upper) / 2; // must be divisible by cellSize because lower and upper are + bool canPack = TryPack(images, testWidth, maxDimension, padding, amountFit, track); + if (canPack) + { + // it packed, continue looking for smaller widths that pack + width = testWidth; // best fit so far + upper = testWidth - cellSize; + } + else + { + // it failed to pack, don't try any widths smaller than this + lower = testWidth + cellSize; + } + } + // Make sure we found a solution + if (width == 0) + { + return false; + } + + // Find the height of the solution + for (int i = 0; i < track.size(); ++i) + { + uint32_t bottom = static_cast(AZStd::max(0, track[i].GetBottom())); + if (height < bottom) + { + height = bottom; + } + } + + // Fix height for power of two when applicable + if (powerOfTwo) + { + // Starting dimensions need to be rounded up to the nearest power of two + height = aznumeric_cast(pow(2, 1 + IntegerLog2(static_cast(height - 1)))); + } + + AZ::u32 resultArea = height * width; + // This for loop starts with the optimal thin width and makes it wider at each step. For each width, it + // calculates what height would be neccesary to have a more optimal solution than the stored solution. If the + // more optimal solution is valid, it tries shrinking the height until the solution fails. The loop ends when it + // is determined that a valid solution cannot exist at further steps + for (AZ::u32 testWidth = width; testWidth <= maxDimensionRounded && resultArea / testWidth >= static_cast(smallestHeight); + testWidth = powerOfTwo ? testWidth * 2 : testWidth + cellSize) + { + // The area of test height and width should be equal or less than resultArea + // Note: We don't need to force powers of two here because the Area and the width are already powers of two + int testHeight = resultArea / testWidth * cellSize / cellSize; + // Try the tighter pack + while (TryPack(images, static_cast(testWidth), testHeight, padding, amountFit, track)) + { + // Loop and continue to shrink the height until you cannot do so any further + width = testWidth; + height = testHeight; + resultArea = height * width; + // Try to step down a level + testHeight = powerOfTwo ? testHeight / 2 : testHeight - cellSize; + } + } + // Output the results of the function + out = track; + resultHeight = height; + resultWidth = width; + return true; + } + + // Allows us to keep the list of open spaces in order from lowest to highest area + void AtlasBuilderWorker::InsertInOrder(AZStd::vector& slotList, AtlasCoordinates item) + { + int area = item.GetWidth() * item.GetHeight(); + for (size_t i = 0; i < slotList.size(); ++i) + { + if (area < slotList[i].GetWidth() * slotList[i].GetHeight()) + { + slotList.insert(slotList.begin() + i, item); + return; + } + } + slotList.push_back(item); + } + + // Defines priority so that sorting can be meaningful. It may seem odd that larger items are "less than" smaller + // ones, but as this is a deduction of priority, not value, it is correct. + static bool operator<(ImageDimension a, ImageDimension b) + { + // Prioritize first by longest size + if ((a.m_width > a.m_height ? a.m_width : a.m_height) != (b.m_width > b.m_height ? b.m_width : b.m_height)) + { + return (a.m_width > a.m_height ? a.m_width : a.m_height) > (b.m_width > b.m_height ? b.m_width : b.m_height); + } + // Prioritize second by the length of the smaller side + if (a.m_width * a.m_height != b.m_width * b.m_height) + { + return a.m_width * a.m_height > b.m_width * b.m_height; + } + // Prioritize wider objects over taller objects for objects of the same size + else + { + return a.m_width > b.m_width; + } + } + + // Exposes priority logic to the sorting algorithm + static bool operator<(IndexImageDimension a, IndexImageDimension b) { return a.second < b.second; } + + // Tests if two coordinate sets intersect + bool Collides(AtlasCoordinates a, AtlasCoordinates b) + { + return !((a.GetRight() <= b.GetLeft()) || (a.GetBottom() <= b.GetTop()) || (b.GetRight() <= a.GetLeft()) + || (b.GetBottom() <= a.GetTop())); + } + + // Tests if an item collides with any items in a list + bool Collides(AtlasCoordinates item, AZStd::vector list) + { + for (size_t i = 0; i < list.size(); ++i) + { + if (Collides(list[i], item)) + { + return true; + } + } + return false; + } + + // Returns the overlap of two intersecting coordinate sets + AtlasCoordinates GetOverlap(AtlasCoordinates a, AtlasCoordinates b) + { + return AtlasCoordinates(b.GetLeft() > a.GetLeft() ? b.GetLeft() : a.GetLeft(), + b.GetRight() < a.GetRight() ? b.GetRight() : a.GetRight(), + b.GetTop() > a.GetTop() ? b.GetTop() : a.GetTop(), + b.GetBottom() < a.GetBottom() ? b.GetBottom() : a.GetBottom()); + } + + // Returns the width of the widest element in imageList + int AtlasBuilderWorker::GetWidest(const ImageDimensionData& imageList) + { + int max = 0; + for (size_t i = 0; i < imageList.size(); ++i) + { + if (max < imageList[i].second.m_width) + { + max = imageList[i].second.m_width; + } + } + return max; + } + + // Returns the height of the tallest element in imageList + int AtlasBuilderWorker::GetTallest(const ImageDimensionData& imageList) + { + int max = 0; + for (size_t i = 0; i < imageList.size(); ++i) + { + if (max < imageList[i].second.m_height) + { + max = imageList[i].second.m_height; + } + } + return max; + } + + // Performs an operation that copies a pixel to the output + void SetPixels(AZ::u8* dest, const AZ::u8* source, int destBytes) + { + if (destBytes >= bytesPerPixel) + { + memcpy(dest, source, bytesPerPixel); + int bytesCopied = bytesPerPixel; + while (bytesCopied * 2 < destBytes) + { + memcpy(dest + bytesCopied, dest, bytesCopied); + bytesCopied *= 2; + } + memcpy(dest + bytesCopied, dest, destBytes - bytesCopied); + } + } + + // Checks if we can insert an image into a slot + bool CanInsert(AtlasCoordinates slot, ImageDimension image, int padding, int farRight, int farBot) + { + int right = slot.GetLeft() + image.m_width; + if (slot.GetRight() < farRight) + { + // Add padding for my right border + right += padding; + // Round up to the nearest compression unit + right = (right + (cellSize - 1)) / cellSize * cellSize; + // Add padding for an adjacent unit's left border + right += padding; + } + + int bot = slot.GetTop() + image.m_height; + if (slot.GetBottom() < farBot) + { + // Add padding for my right border + bot += padding; + // Round up to the nearest compression unit + bot = (bot + (cellSize - 1)) / cellSize * cellSize; + // Add padding for an adjacent unit's left border + bot += padding; + } + + return slot.GetRight() >= right && slot.GetBottom() >= bot; + } + + // Adds the necessary padding to an Atlas Coordinate + void AddPadding(AtlasCoordinates& slot, int padding, [[maybe_unused]] int farRight, [[maybe_unused]] int farBot) + { + // Add padding for my right border + int right = slot.GetRight() + padding; + // Round up to the nearest compression unit + right = (right + (cellSize - 1)) / cellSize * cellSize; + // Add padding for an adjacent unit's left border + right += padding; + + // Add padding for my right border + int bot = slot.GetBottom() + padding; + // Round up to the nearest compression unit + bot = (bot + (cellSize - 1)) / cellSize * cellSize; + // Add padding for an adjacent unit's left border + bot += padding; + + slot.SetRight(right); + slot.SetBottom(bot); + } + +} diff --git a/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.h b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.h new file mode 100644 index 0000000000..36f0c3d486 --- /dev/null +++ b/Gems/TextureAtlas/Code/Source/Editor/AtlasBuilderWorker.h @@ -0,0 +1,231 @@ +/* +* All or portions of this file Copyright(c) Amazon.com, Inc.or its affiliates or +* its licensors. +* +* For complete copyright and license terms please see the LICENSE at the root of this +* distribution (the "License"). All use of this software is governed by the License, +*or, if provided, by the license below or the license accompanying this file. Do not +* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include + +namespace TextureAtlasBuilder +{ + //! Struct that is used to communicate input commands + struct AtlasBuilderInput + { + AZ_CLASS_ALLOCATOR(AtlasBuilderInput, AZ::SystemAllocator, 0); + AZ_TYPE_INFO(AtlasBuilderInput, "{F54477F9-1BDE-4274-8CC0-8320A3EF4A42}"); + + bool m_forceSquare; + bool m_forcePowerOf2; + // Includes a white default texture for the UI to use under certain circumstances + bool m_includeWhiteTexture; + int m_maxDimension; + // At least this much padding will surround each texture except on the edges of the atlas + int m_padding; + // Color used in wasted space + AZ::Color m_unusedColor; + // A preset to use for the texture atlas image processing + AZStd::string m_presetName; + + AZStd::vector m_filePaths; + AtlasBuilderInput(): + m_forceSquare(false), + m_forcePowerOf2(false), + m_includeWhiteTexture(true), + m_maxDimension(4096), + m_padding(1), + // Default color should be a non-transparent color that isn't used often in uis + m_unusedColor(.235f, .702f, .443f, 1) + { + } + + static void Reflect(AZ::ReflectContext* context); + + //! Attempts to read the input from a .texatlas file. "valid" is for reporting exceptions and telling the asset + //! proccesor to fail the job. Supports parsing through a human readable custom parser. + static AtlasBuilderInput ReadFromFile(const AZStd::string& path, const AZStd::string& directory, bool& valid); + + //! Resolves any wild cards in paths + static void AddFilesUsingWildCard(AZStd::vector& paths, const AZStd::string& insert); + + //! Removes anything that matches the wildcard + static void RemoveFilesUsingWildCard(AZStd::vector& paths, const AZStd::string& remove); + + //! Compare considering wildcards + static bool DoesPathnameMatchWildCard(const AZStd::string& rule, const AZStd::string& path); + + //! As FollowsRule but allows extra items after the last '/' + static bool DoesWildCardDirectoryIncludePathname(const AZStd::string& rule, const AZStd::string& path); + + //! Helper function for DoesPathnameMatchWildCard + static bool TokenMatchesWildcard(const AZStd::string& rule, const AZStd::string& token); + + //! Resolves any folder paths into image file paths + static void AddFolderContents(AZStd::vector& paths, const AZStd::string& insert, bool& valid); + + //! Resolves remove commands for folders + static void RemoveFolderContents(AZStd::vector& paths, const AZStd::string& remove); + }; + + //! Struct that is used to represent an object with a width and height in pixels + struct ImageDimension + { + int m_width; + int m_height; + + ImageDimension(int width, int height) + { + m_width = width; + m_height = height; + } + }; + + //! Typedef for an ImageDimension paired with an integer + using IndexImageDimension = AZStd::pair; + + //! Typedef for a list of ImageDimensions paired with integers + using ImageDimensionData = AZStd::vector; + + //! Typedef to simplify references to TextureAtlas::AtlasCoordinates + using AtlasCoordinates = TextureAtlasNamespace::AtlasCoordinates; + + //! Number of bytes in a pixel + const int bytesPerPixel = 4; + + //! The size of the padded sorting units (important for compression) + const int cellSize = 4; + + //! Indexes of the products + enum class Product + { + TexatlasidxProduct = 0, + StreamingImageProduct = 1 + }; + + //! An asset builder for texture atlases + class AtlasBuilderWorker : public AssetBuilderSDK::AssetBuilderCommandBus::Handler + { + public: + AZ_RTTI(AtlasBuilderWorker, "{79036188-E017-4575-9EC0-8D39CB560EA6}"); + + AtlasBuilderWorker() = default; + ~AtlasBuilderWorker() = default; + + //! Asset Builder Callback Functions + + //! Called by asset processor to gather information on a job for a ".texatlas" file + void CreateJobs(const AssetBuilderSDK::CreateJobsRequest& request, + AssetBuilderSDK::CreateJobsResponse& response); + //! Called by asset proccessor when it wants us to execute a job + void ProcessJob(const AssetBuilderSDK::ProcessJobRequest& request, + AssetBuilderSDK::ProcessJobResponse& response); + + //! Returns the job related information used by the builder + static AssetBuilderSDK::JobDescriptor GetJobDescriptor(const AZStd::string& sourceFile, const AtlasBuilderInput& input); + + ////////////////////////////////////////////////////////////////////////// + //! AssetBuilderSDK::AssetBuilderCommandBus interface + void ShutDown() override; // if you get this you must fail all existing jobs and return. + ////////////////////////////////////////////////////////////////////////// + + private: + bool m_isShuttingDown = false; + + //! This is the main function that takes a set of inputs and attempts to pack them into an atlas of a given + //! size. Returns true if succesful, does not update out on failure. + static bool TryPack(const ImageDimensionData& images, + int targetWidth, + int targetHeight, + int padding, + size_t& amountFit, + AZStd::vector& out); + + //! Removes any overlap between slotList and the given item + static void TrimOverlap(AZStd::vector& slotList, AtlasCoordinates item); + + //! Uses the proper tightening method based on the input and returns the maximum number of items that were able to be fit + bool TryTightening(AtlasBuilderInput input, + const ImageDimensionData& images, + int smallestWidth, + int smallestHeight, + int targetArea, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out); + + //! Finds the tightest square fit achievable by expanding a square area until a valid fit is found + bool TryTighteningSquare(const ImageDimensionData& images, + int lowerBound, + int maxDimension, + int targetArea, + bool powerOfTwo, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out); + + //! Finds the tightest fit achievable by starting with the optimal thin solution and attempting to resize to be + //! a better shape + bool TryTighteningOptimal(const ImageDimensionData& images, + int smallestWidth, + int smallestHeight, + int maxDimension, + int targetArea, + bool powerOfTwo, + int padding, + int& resultWidth, + int& resultHeight, + size_t& amountFit, + AZStd::vector& out); + + //! Sorting logic for adding a slot to a sorted list in order to maintain increasing order + static void InsertInOrder(AZStd::vector& slotList, AtlasCoordinates item); + + //! Misc Logic For Estimating Target Shape + + //! Returns the width of the widest element + static int GetWidest(const ImageDimensionData& imageList); + + //! Returns the height of the tallest area + static int GetTallest(const ImageDimensionData& imageList); + }; + + //! Used for sorting ImageDimensions + static bool operator<(ImageDimension a, ImageDimension b); + + //! Used to expose the ImageDimension in a pair to AZStd::Sort + static bool operator<(IndexImageDimension a, IndexImageDimension b); + + //! Returns true if two coordinate sets overlap + static bool Collides(AtlasCoordinates a, AtlasCoordinates b); + + //! Returns true if item collides with any object in list + static bool Collides(AtlasCoordinates item, AZStd::vector list); + + //! Returns the portion of the second item that overlaps with the first + static AtlasCoordinates GetOverlap(AtlasCoordinates a, AtlasCoordinates b); + + //! Performs an operation that copies a pixel to the output + static void SetPixels(AZ::u8* dest, const AZ::u8* source, int destBytes); + + //! Checks if we can insert an image into a slot + static bool CanInsert(AtlasCoordinates slot, ImageDimension image, int padding, int farRight, int farBot); + + //! Adds the necessary padding to an Atlas Coordinate + static void AddPadding(AtlasCoordinates& slot, int padding, int farRight, int farBot); +} diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.cpp b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.cpp index 70a1900c25..e84e843177 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.cpp +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.cpp @@ -120,14 +120,14 @@ namespace TextureAtlasNamespace } // Links this atlas to an image pointer - void TextureAtlasImpl::SetTexture(ITexture* image) + void TextureAtlasImpl::SetTexture(AZ::Data::Instance image) { // We don't need to delete the old value because the pointer is handled elsewhere m_image = image; } // Returns the image linked to this atlas - ITexture* TextureAtlasImpl::GetTexture() const + AZ::Data::Instance TextureAtlasImpl::GetTexture() const { return m_image; } diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h index af611c8c7d..22c03e0e3c 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasImpl.h @@ -20,7 +20,8 @@ #include "TextureAtlas/TextureAtlas.h" #include "TextureAtlas/TextureAtlasBus.h" -#include +#include +#include namespace TextureAtlasNamespace { @@ -61,10 +62,10 @@ namespace TextureAtlasNamespace AtlasCoordinates GetAtlasCoordinates(const AZStd::string& handle) const override; //! Links this atlas to an image pointer - void SetTexture(ITexture* image) override; + void SetTexture(AZ::Data::Instance image) override; //! Returns the image linked to this atlas - ITexture* GetTexture() const override; + AZ::Data::Instance GetTexture() const override; //! Replaces the mappings of this Texture Atlas Object, with the source's mappings void OverwriteMappings(TextureAtlasImpl* source); @@ -80,7 +81,7 @@ namespace TextureAtlasNamespace private: AZStd::unordered_map m_data; - ITexture* m_image; + AZ::Data::Instance m_image; int m_width; int m_height; }; diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasModule.cpp b/Gems/TextureAtlas/Code/Source/TextureAtlasModule.cpp index 478a3f8ca6..90114f6e79 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasModule.cpp +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasModule.cpp @@ -16,6 +16,10 @@ #include "TextureAtlasSystemComponent.h" +#ifdef TEXTUREATLAS_EDITOR +#include "Editor/AtlasBuilderComponent.h" +#endif + #include namespace TextureAtlasNamespace @@ -33,6 +37,9 @@ namespace TextureAtlasNamespace // Push results of [MyComponent]::CreateDescriptor() into m_descriptors here. m_descriptors.insert(m_descriptors.end(), { TextureAtlasSystemComponent::CreateDescriptor(), +#ifdef TEXTUREATLAS_EDITOR + TextureAtlasBuilder::AtlasBuilderComponent::CreateDescriptor(), //builder component for texture atlas +#endif }); } diff --git a/Gems/TextureAtlas/Code/Source/TextureAtlasSystemComponent.cpp b/Gems/TextureAtlas/Code/Source/TextureAtlasSystemComponent.cpp index 80d4898c41..24a5126df4 100644 --- a/Gems/TextureAtlas/Code/Source/TextureAtlasSystemComponent.cpp +++ b/Gems/TextureAtlas/Code/Source/TextureAtlasSystemComponent.cpp @@ -22,7 +22,25 @@ #include #include -#include +#include + +namespace +{ + AZ::Data::Instance LoadAtlasImage(const AZStd::string& imagePath) + { + // The file may not be in the AssetCatalog at this point if it is still processing or doesn't exist on disk. + // Use GenerateAssetIdTEMP instead of GetAssetIdByPath so that it will return a valid AssetId anyways + AZ::Data::AssetId streamingImageAssetId; + AZ::Data::AssetCatalogRequestBus::BroadcastResult( + streamingImageAssetId, &AZ::Data::AssetCatalogRequestBus::Events::GenerateAssetIdTEMP, + imagePath.c_str()); + + streamingImageAssetId.m_subId = AZ::RPI::StreamingImageAsset::GetImageAssetSubId(); + auto streamingImageAsset = AZ::Data::AssetManager::Instance().FindOrCreateAsset(streamingImageAssetId, AZ::Data::AssetLoadBehavior::PreLoad); + AZ::Data::Instance image = AZ::RPI::StreamingImage::FindOrCreate(streamingImageAsset); + return image; + } +} namespace TextureAtlasNamespace { @@ -95,27 +113,15 @@ namespace TextureAtlasNamespace // We reload the image here to prevent stuttering in the editor if (iterator->second.m_atlas && iterator->second.m_atlas->GetTexture()) { - SResourceAsync* pInfo = new SResourceAsync(); - pInfo->eClassName = eRCN_Texture; - pInfo->pResource = iterator->second.m_atlas->GetTexture(); - // ToDo: Update to work with Atom? LYN-3680 - // ???->ReleaseResourceAsync(pInfo); + iterator->second.m_atlas->GetTexture().reset(); } - // Reload Texture - AZStd::string imagePath = iterator->second.m_path.substr(0, iterator->second.m_path.find_last_of('.')); - imagePath.append(".dds"); - - // ToDo: Update to work with Atom? LYN-3680 - // uint32 loadTextureFlags = (FT_USAGE_ALLOWREADSRGB | FT_DONT_STREAM); - ITexture* texture = nullptr; - - if (!texture || !texture->IsTextureLoaded()) + AZStd::string imagePath = iterator->second.m_path; + AZ::Data::Instance texture = LoadAtlasImage(imagePath); + if (!texture) { - gEnv->pSystem->Warning(VALIDATOR_MODULE_UNKNOWN, - VALIDATOR_WARNING, - VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_TEXTURE, - imagePath.c_str(), - "No texture file found for texture atlas: %s. " + AZ_Error("TextureAtlasSystemComponent", + false, + "Failed to find or create an image instance for texture atlas '%s'" "NOTE: File must be in current project or a gem.", imagePath.c_str()); TextureAtlas* temp = iterator->second.m_atlas; @@ -123,6 +129,7 @@ namespace TextureAtlasNamespace TextureAtlasNotificationBus::Broadcast(&TextureAtlasNotifications::OnAtlasUnloaded, temp); return; } + iterator->second.m_atlas->SetTexture(texture); TextureAtlasNotificationBus::Broadcast(&TextureAtlasNotifications::OnAtlasReloaded, iterator->second.m_atlas); break; @@ -186,30 +193,23 @@ namespace TextureAtlasNamespace delete[] buffer; if (loadedAtlas) { - // Get the image path based on the atlas path + // Convert to image path based on the atlas path AZStd::string imagePath = path; - AzFramework::StringFunc::Path::ReplaceExtension(imagePath, "dds"); - - // Load the image in - // ToDo: Update to work with Atom? LYN-3680 - // uint32 loadTextureFlags = (FT_USAGE_ALLOWREADSRGB | FT_DONT_STREAM); - ITexture* texture = nullptr; - - if (!texture || !texture->IsTextureLoaded()) + AzFramework::StringFunc::Path::ReplaceExtension(imagePath, "texatlas"); + AZ::Data::Instance texture = LoadAtlasImage(imagePath); + if (!texture) { - gEnv->pSystem->Warning(VALIDATOR_MODULE_UNKNOWN, - VALIDATOR_WARNING, - VALIDATOR_FLAG_FILE | VALIDATOR_FLAG_TEXTURE, - imagePath.c_str(), - "No texture file found for texture atlas: %s. " + AZ_Error("TextureAtlasSystemComponent", + false, + "Failed to find or create an image instance for texture atlas '%s'" "NOTE: File must be in current project or a gem.", - imagePath.c_str()); + path.c_str()); + delete loadedAtlas; return nullptr; } else { - texture->SetFilter(FILTER_LINEAR); // Add the atlas to the list AtlasInfo info(loadedAtlas, assetPath); ++info.m_refs; @@ -241,11 +241,7 @@ namespace TextureAtlasNamespace // Tell the renderer to release the texture. if (temp.m_atlas && temp.m_atlas->GetTexture()) { - SResourceAsync* pInfo = new SResourceAsync(); - pInfo->eClassName = eRCN_Texture; - pInfo->pResource = temp.m_atlas->GetTexture(); - // ToDo: Update to work with Atom? LYN-3680 - // ???->ReleaseResourceAsync(pInfo); + temp.m_atlas->GetTexture().reset(); } // Delete the atlas SAFE_DELETE(temp.m_atlas); diff --git a/Gems/TextureAtlas/Code/textureatlas_builder_files.cmake b/Gems/TextureAtlas/Code/textureatlas_builder_files.cmake new file mode 100644 index 0000000000..51cb991aa8 --- /dev/null +++ b/Gems/TextureAtlas/Code/textureatlas_builder_files.cmake @@ -0,0 +1,17 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +set(FILES + Source/Editor/AtlasBuilderComponent.h + Source/Editor/AtlasBuilderComponent.cpp + Source/Editor/AtlasBuilderWorker.h + Source/Editor/AtlasBuilderWorker.cpp +) diff --git a/Gems/TextureAtlas/Code/textureatlas_files.cmake b/Gems/TextureAtlas/Code/textureatlas_files.cmake index 2da4e9ce1d..c45c1d49a8 100644 --- a/Gems/TextureAtlas/Code/textureatlas_files.cmake +++ b/Gems/TextureAtlas/Code/textureatlas_files.cmake @@ -15,7 +15,6 @@ set(FILES Include/TextureAtlas/TextureAtlasBus.h Include/TextureAtlas/TextureAtlasNotificationBus.h Include/TextureAtlas/TextureAtlas.h - Source/TextureAtlasModule.cpp Source/TextureAtlasSystemComponent.cpp Source/TextureAtlasSystemComponent.h Source/TextureAtlasImpl.h diff --git a/AutomatedTesting/Gem/Code/Platform/Windows/tool_dependencies.cmake b/Gems/TextureAtlas/Code/textureatlas_module_files.cmake similarity index 91% rename from AutomatedTesting/Gem/Code/Platform/Windows/tool_dependencies.cmake rename to Gems/TextureAtlas/Code/textureatlas_module_files.cmake index 933dd7927b..00e18d92bc 100644 --- a/AutomatedTesting/Gem/Code/Platform/Windows/tool_dependencies.cmake +++ b/Gems/TextureAtlas/Code/textureatlas_module_files.cmake @@ -9,6 +9,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -set(GEM_DEPENDENCIES - Gem::QtForPython.Editor -) \ No newline at end of file +set(FILES + Source/TextureAtlasModule.cpp +) diff --git a/Gems/TickBusOrderViewer/Code/CMakeLists.txt b/Gems/TickBusOrderViewer/Code/CMakeLists.txt index 3f56a0d554..551c62c64c 100644 --- a/Gems/TickBusOrderViewer/Code/CMakeLists.txt +++ b/Gems/TickBusOrderViewer/Code/CMakeLists.txt @@ -38,3 +38,9 @@ ly_add_target( PRIVATE Gem::TickBusOrderViewer.Static ) + + +# the above module is for use in all application types except builders +ly_create_alias(NAME TickBusOrderViewer.Servers NAMESPACE Gem TARGETS Gem::TickBusOrderViewer) +ly_create_alias(NAME TickBusOrderViewer.Clients NAMESPACE Gem TARGETS Gem::TickBusOrderViewer) +ly_create_alias(NAME TickBusOrderViewer.Tools NAMESPACE Gem TARGETS Gem::TickBusOrderViewer) diff --git a/Gems/Twitch/Code/CMakeLists.txt b/Gems/Twitch/Code/CMakeLists.txt index 14d7a41532..b5c1751003 100644 --- a/Gems/Twitch/Code/CMakeLists.txt +++ b/Gems/Twitch/Code/CMakeLists.txt @@ -29,6 +29,8 @@ ly_add_target( AZ::AzCore Gem::HttpRequestor 3rdParty::AWSNativeSDK::Core + RUNTIME_DEPENDENCIES + Gem::HttpRequestor ) ly_add_target( @@ -47,3 +49,9 @@ ly_add_target( RUNTIME_DEPENDENCIES Gem::HttpRequestor ) + +# the above module is for use in all application types except builders +ly_create_alias(NAME Twitch.Servers NAMESPACE Gem TARGETS Gem::Twitch) +ly_create_alias(NAME Twitch.Clients NAMESPACE Gem TARGETS Gem::Twitch) +ly_create_alias(NAME Twitch.Tools NAMESPACE Gem TARGETS Gem::Twitch) + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Normal.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Pressed.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Pressed.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Pressed.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Pressed.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Selected.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Selected.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Selected.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Sliced_Selected.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Normal.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Pressed.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Pressed.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Pressed.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Pressed.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Selected.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Selected.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Selected.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Button_Stretched_Selected.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check_Background.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check_Background.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check_Background.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Check_Background.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Cross.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Cross.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Cross.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Cross.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Off.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Off.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Off.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_Off.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_On.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_On.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/CheckBox_On.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/CheckBox_On.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Disabled.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Hover.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Hover.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Hover.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Hover.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Normal.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Checkbox_Background_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Checkered.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Checkered.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Checkered.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Checkered.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Disabled.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Hover.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Hover.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Hover.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Hover.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Normal.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Background_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Sliced.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Sliced.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Sliced.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Sliced.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Stretch.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Stretch.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Stretch.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Fill_Stretch.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Manipulator.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Manipulator.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Manipulator.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Manipulator.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Sliced.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Sliced.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Sliced.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Sliced.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Stretch.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Stretch.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Stretch.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Slider_Track_Stretch.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Normal.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Pressed.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Pressed.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Pressed.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Pressed.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Selected.tif.assetinfo b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Selected.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Selected.tif.assetinfo +++ b/Gems/UiBasics/Assets/Textures/Basic/Text_Input_Sliced_Selected.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Arrow.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Arrow.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Arrow.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Arrow.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowL.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowL.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowL.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowL.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowR.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowR.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowR.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowR.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowU.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowU.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowU.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_ArrowU.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Button.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Button.tif.assetinfo index 95b548a2eb..f808dda121 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Button.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Button.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Menu.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Menu.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Menu.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/Dropdown_Menu.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Hover.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Hover.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Hover.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Hover.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Background_Normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Dot.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Dot.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Dot.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/RadioButton_Dot.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/button_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/button_disabled.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/button_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/button_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/button_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/button_normal.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/button_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/button_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_hover.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_hover.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_hover.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_hover.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_normal.tif.assetinfo index 2eb5be8e93..54e075dd32 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_box_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -56,7 +56,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_check.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_check.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_check.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/checkbox_check.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_handle.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_handle.tif.assetinfo index 95b548a2eb..f808dda121 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_handle.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_handle.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_horiz_track.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_horiz_track.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_horiz_track.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_horiz_track.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_vert_track.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_vert_track.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_vert_track.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/scrollbar_vert_track.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_fill_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_disabled.tif.assetinfo index 95b548a2eb..f808dda121 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_handle_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_disabled.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_normal.tif.assetinfo index 61b2832ff3..47b628d60a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/slider_track_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_disabled.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_disabled.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_disabled.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_disabled.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_hover.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_hover.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_hover.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_hover.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_normal.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_normal.tif.assetinfo index c6f6ca1e9c..c8704c4e0d 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_normal.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/textinput_normal.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/Assets/UI/Textures/Prefab/tooltip_sliced.tif.assetinfo b/Gems/UiBasics/Assets/UI/Textures/Prefab/tooltip_sliced.tif.assetinfo index dd1d22706e..e508d7465a 100644 --- a/Gems/UiBasics/Assets/UI/Textures/Prefab/tooltip_sliced.tif.assetinfo +++ b/Gems/UiBasics/Assets/UI/Textures/Prefab/tooltip_sliced.tif.assetinfo @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/Gems/UiBasics/CMakeLists.txt b/Gems/UiBasics/CMakeLists.txt new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Gems/UiBasics/CMakeLists.txt @@ -0,0 +1,10 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# diff --git a/Gems/Vegetation/Code/CMakeLists.txt b/Gems/Vegetation/Code/CMakeLists.txt index c4a003bb4a..7283f53c97 100644 --- a/Gems/Vegetation/Code/CMakeLists.txt +++ b/Gems/Vegetation/Code/CMakeLists.txt @@ -24,12 +24,14 @@ ly_add_target( PUBLIC Include BUILD_DEPENDENCIES + PRIVATE + Gem::LmbrCentral + Gem::SurfaceData PUBLIC Legacy::CryCommon - Gem::LmbrCentral - Gem::GradientSignal - Gem::SurfaceData.Static Gem::AtomLyIntegration_CommonFeatures.Static + RUNTIME_DEPENDENCIES + Gem::GradientSignal ) ly_add_target( @@ -51,6 +53,10 @@ ly_add_target( Gem::SurfaceData ) +# the above module is for use in clients and server type applications +ly_create_alias(NAME Vegetation.Servers NAMESPACE Gem TARGETS Gem::Vegetation) +ly_create_alias(NAME Vegetation.Clients NAMESPACE Gem TARGETS Gem::Vegetation) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME Vegetation.Editor GEM_MODULE @@ -75,6 +81,10 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) Gem::GradientSignal.Editor Gem::SurfaceData.Editor ) + # the above module is for use in dev tools + ly_create_alias(NAME Vegetation.Builders NAMESPACE Gem TARGETS Gem::Vegetation.Editor) + ly_create_alias(NAME Vegetation.Tools NAMESPACE Gem TARGETS Gem::Vegetation.Editor) + endif() ################################################################################ diff --git a/Gems/Vegetation/Code/Source/DynamicSliceInstanceSpawner.cpp b/Gems/Vegetation/Code/Source/DynamicSliceInstanceSpawner.cpp index 597d0ca079..a185c9a601 100644 --- a/Gems/Vegetation/Code/Source/DynamicSliceInstanceSpawner.cpp +++ b/Gems/Vegetation/Code/Source/DynamicSliceInstanceSpawner.cpp @@ -309,7 +309,7 @@ namespace Vegetation // Create a Transform that represents our instance. AZ::Transform world = AZ::Transform::CreateFromQuaternionAndTranslation(instanceData.m_alignment * instanceData.m_rotation, instanceData.m_position); - world.MultiplyByScale(AZ::Vector3(instanceData.m_scale)); + world.MultiplyByUniformScale(instanceData.m_scale); // Request a new dynamic slice instance. AzFramework::SliceInstantiationTicket* ticket = new AzFramework::SliceInstantiationTicket(); diff --git a/Gems/Vegetation_Gem_Assets/CMakeLists.txt b/Gems/Vegetation_Gem_Assets/CMakeLists.txt new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/Gems/Vegetation_Gem_Assets/CMakeLists.txt @@ -0,0 +1,10 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# diff --git a/Gems/VideoPlaybackFramework/Code/CMakeLists.txt b/Gems/VideoPlaybackFramework/Code/CMakeLists.txt index 297f4cfaac..b29fe53216 100644 --- a/Gems/VideoPlaybackFramework/Code/CMakeLists.txt +++ b/Gems/VideoPlaybackFramework/Code/CMakeLists.txt @@ -42,6 +42,11 @@ ly_add_target( Gem::VideoPlaybackFramework.Static ) +# the video playback framework makes sense in everything but servers: +ly_create_alias(NAME VideoPlaybackFramework.Clients NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework) +ly_create_alias(NAME VideoPlaybackFramework.Tools NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework) +ly_create_alias(NAME VideoPlaybackFramework.Builders NAMESPACE Gem TARGETS Gem::VideoPlaybackFramework) + ################################################################################ # Tests ################################################################################ diff --git a/Gems/VirtualGamepad/Code/CMakeLists.txt b/Gems/VirtualGamepad/Code/CMakeLists.txt index 99a33db70b..4311796b57 100644 --- a/Gems/VirtualGamepad/Code/CMakeLists.txt +++ b/Gems/VirtualGamepad/Code/CMakeLists.txt @@ -40,3 +40,8 @@ ly_add_target( PRIVATE Gem::VirtualGamepad.Static ) + +# 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) diff --git a/Gems/WhiteBox/Code/CMakeLists.txt b/Gems/WhiteBox/Code/CMakeLists.txt index a15a4e150c..5985ff26a3 100644 --- a/Gems/WhiteBox/Code/CMakeLists.txt +++ b/Gems/WhiteBox/Code/CMakeLists.txt @@ -86,6 +86,10 @@ ly_add_target( Gem::WhiteBox.Static ) +# use the above WhiteBox module in runtimes: +ly_create_alias(NAME WhiteBox.Clients NAMESPACE Gem TARGETS Gem::WhiteBox) +ly_create_alias(NAME WhiteBox.Servers NAMESPACE Gem TARGETS Gem::WhiteBox) + if(PAL_TRAIT_BUILD_HOST_TOOLS) ly_add_target( NAME WhiteBox.Editor.Static STATIC @@ -129,6 +133,12 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PRIVATE Gem::WhiteBox.Editor.Static ) + + # use the above WhiteBox.Editor module in dev tools: + ly_create_alias(NAME WhiteBox.Tools NAMESPACE Gem TARGETS Gem::WhiteBox.Editor) + ly_create_alias(NAME WhiteBox.Builders NAMESPACE Gem TARGETS Gem::WhiteBox.Editor) + + endif() ################################################################################ diff --git a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp index c8b189942e..d7acb18f29 100644 --- a/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp +++ b/Gems/WhiteBox/Code/Source/Components/EditorWhiteBoxColliderComponent.cpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -150,7 +151,9 @@ namespace WhiteBox bodyConfiguration.m_entityId = GetEntityId(); bodyConfiguration.m_orientation = GetTransform()->GetWorldRotationQuaternion(); bodyConfiguration.m_position = GetTransform()->GetWorldTranslation(); - bodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair(&m_physicsColliderConfiguration, &m_meshShapeConfiguration); + bodyConfiguration.m_colliderAndShapeData = AzPhysics::ShapeColliderPair( + AZStd::make_shared(m_physicsColliderConfiguration), + AZStd::make_shared(m_meshShapeConfiguration)); if (m_sceneInterface) { diff --git a/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp b/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp index 41d0a4c5e3..cda82c82b0 100644 --- a/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp +++ b/Gems/WhiteBox/Code/Source/Components/WhiteBoxColliderComponent.cpp @@ -139,7 +139,7 @@ namespace WhiteBox { const AZ::Transform worldTransformWithoutScale = [worldTransform = world]() mutable { - worldTransform.SetScale(AZ::Vector3::CreateOne()); + worldTransform.SetUniformScale(1.0f); return worldTransform; }(); diff --git a/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp b/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp index 9d423d5519..840d1f4590 100644 --- a/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp +++ b/Gems/WhiteBox/Code/Source/Util/WhiteBoxMathUtil.cpp @@ -73,7 +73,7 @@ namespace WhiteBox const AZ::Transform spaceFromLocal = localFromSpace.GetInverse(); const AZ::Vector3 spacePosition = spaceFromLocal.TransformPoint(localPosition); const AZ::Vector3 spaceScaledPosition = - AZ::Transform::CreateScale(AZ::Vector3(scale)).TransformPoint(spacePosition); + AZ::Transform::CreateUniformScale(scale).TransformPoint(spacePosition); return localFromSpace.TransformPoint(spaceScaledPosition); } diff --git a/README.md b/README.md index 333ca795e8..e0442adc16 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,57 @@ Welcome to the Project Spectra Private Preview. This is a confidential pre-release project; your use is subject to the nondisclosure agreement between you (or your organization) and Amazon. Do not disclose the existence of this project, your participation in it, or any of the materials provided, to any unauthorized third party. To request access for a third party, please contact [Royal O'Brien, obriroya@amazon.com](mailto:obriroya@amazon.com). +## Full instructions can be found here: +### https://docs.o3de.org/docs/welcome-guide/setup/setup-from-github/ +(Note: Contact Royal or [Doug Erickson, dougeric@amazon.com](mailto:dougeric@amazon.com) for access) + +## Updates to this readme +May 14, 2021 +- Removed instructions for the 3rdParty zip file and downloader URL. This is no longer a requirement. +- Updated instructions for dependencies +- Links to full documentation + +April 7-13, 2021 +- Updates to the 3rdParty zip file + +March 25, 2021 +- Initial commit for instructions + ## Download and Install This repository uses Git LFS for storing large binary files. You will need to create a Github personal access token to authenticate with the LFS service. +To install Git LFS, download the binary here: https://git-lfs.github.com/. + +After installation, you will need to install the necessary git hooks with this command +``` +git lfs install +``` ### Create a Git Personal Access Token -You will need your personal access token credentials to authenticate when you clone the repository. +You will need your personal access token credentials to authenticate when you clone the repository and when downloading objects from Git LFS [Create a personal access token with the 'repo' scope.](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) +During the clone operation, you will be prompted to enter a password. Your token will be used as the password. You will also be prompted a second time for Git LFS. ### (Recommended) Verify you have a credential manager installed to store your credentials -Recent versions of Git install a credential manager to store your credentials so you don't have to put in the credentials for every request. +Recent versions of Git install a credential manager to store your credentials so you don't have to put in the credentials for every request. + It is highly recommended you check that you have a [credential manager installed and configured](https://github.com/microsoft/Git-Credential-Manager-Core) +For Linux and Mac, use the following commands to store credentials + +Linux: +``` +git config --global credential.helper cache +``` +Mac: +``` +git config --global credential.helper osxkeychain +``` ### Clone the repository @@ -43,67 +77,96 @@ Filtering content: 100% (3853/3853), 621.43 MiB | 881.00 KiB/s, done. ``` -If you have the Git credential manager core installed, you should not be prompted for your credentials anymore. +If you have the Git credential manager core or other credential helpers installed, you should not be prompted for your credentials anymore. ## Building the Engine ### Build Requirements and redistributables +#### Windows -* Visual Studio 2019 16.9.2 (All versions supported, including Community): [https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/) +* Visual Studio 2019 16.9.2 minimum (All versions supported, including Community): [https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/) * Install the following workloads: * Game Development with C++ * MSVC v142 - VS 2019 C++ x64/x86 -* Visual C++ redistributable: [https://visualstudio.microsoft.com/downloads/#other-family](https://visualstudio.microsoft.com/downloads/#other-family) -* FBXSDK for VS2015: [https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2016-1-2](https://www.autodesk.com/developer-network/platform-technologies/fbx-sdk-2016-1-2) -* WWise - 2019.2.8.7432: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) -* CMake 3.19.1: [https://cmake.org/files/LatestRelease/cmake-3.19.1-win64-x64.msi](https://cmake.org/files/LatestRelease/cmake-3.19.1-win64-x64.msi) + * C++ 2019 redistributable update +* CMake 3.19.1 minimum: [https://cmake.org/files/LatestRelease/cmake-3.19.1-win64-x64.msi](https://cmake.org/files/LatestRelease/cmake-3.19.1-win64-x64.msi) -### Build Steps +#### Optional -1. Download the 3rdParty zip file from here: **[https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev13.zip](https://d2c171ws20a1rv.cloudfront.net/3rdParty-windows-no-symbols-rev13.zip)** -2. Unzip this file into a writable folder. This will also act as a cache location for the 3rdParty downloader by default (configurable with the `LY_PACKAGE_DOWNLOAD_CACHE_LOCATION` environment variable) -3. Install the following redistributables to the following: +* WWise - 2019.2.8.7432 minimum: [https://www.audiokinetic.com/download/](https://www.audiokinetic.com/download/) + * Note: This requires registration and installation of a client to download + * You will also need to set a environment variable: `set LY_WWISE_INSTALL_PATH=` + * For example: `set LY_WWISE_INSTALL_PATH="C:\Program Files (x86)\Audiokinetic\Wwise 2019.2.8.7432"` + +### Quick Start Build Steps + +1. Create a writable folder to cache 3rd Party dependencies. You can also use this to store other redistributable SDKs. + + > For the 0.5 branch - Create an empty text file named `3rdParty.txt` in this folder, to allow a legacy CMake validator to pass + +1. Install the following redistributables to the following: - Visual Studio and VC++ redistributable can be installed to any location - - FBXSDK should be installed to `<3rdParty path>\FbxSdk\2016.1.2-az.1`. See the README in this folder for details - - WWise should be installed to: `<3rdParty Path>\Wwise\2019.2.8.7432` - - CMake should be installed to: `<3rdParty Path>\CMake\3.19.1` -4. Add the following environment variables through the command line + - CMake can be installed to any location, as long as it's available in the system path, otherwise it can be installed to: `<3rdParty Path>\CMake\3.19.1` + - WWise can be installed anywhere, but you will need to set an environment variable for CMake to detect it: `set LY_WWISE_INSTALL_PATH=` + +1. Navigate into the repo folder, then download the python runtime with this command + + > For the 0.5 branch - Set this environment variable prior to the `get_python` command below: + > ``` + > set LY_PACKAGE_SERVER_URLS=https://d2c171ws20a1rv.cloudfront.net + > ``` + ``` - set LY_3RDPARTY_PATH= - set LY_PACKAGE_SERVER_URLS="https://d2c171ws20a1rv.cloudfront.net" + python\get_python.bat ``` -5. Configure the source into a solution using this command line, replacing to a path you've created +1. While still within the repo folder, register the engine with this command: ``` - cmake -B -S -G "Visual Studio 16 2019" -DLY_3RDPARTY_PATH=%LY_3RDPARTY_PATH% -DLY_UNITY_BUILD=ON -DLY_PROJECTS=AutomatedTesting + scripts\o3de.bat register --this-engine ``` -6. Alternatively, you can do this through the CMake GUI: +1. Configure the source into a solution using this command line, replacing and <3rdParty cache path> to a path you've created: + ``` + cmake -B -S -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty cache path> -DLY_UNITY_BUILD=ON -DLY_PROJECTS=AutomatedTesting + ``` + > Note: Do not use trailing slashes for the <3rdParty cache path> + +1. Alternatively, you can do this through the CMake GUI: 1. Start `cmake-gui.exe` - 2. Select the local path of the repo under "Where is the source code" - 3. Select a path where to build binaries under "Where to build the binaries" - 4. Click "Configure" - 5. Wait for the key values to populate. Fill in the fields that are relevant, including `LY_3RDPARTY_PATH`, `LY_PACKAGE_SERVER_URLS`, and `LY_PROJECTS` - 6. Click "Generate" + 1. Select the local path of the repo under "Where is the source code" + 1. Select a path where to build binaries under "Where to build the binaries" + 1. Click "Configure" + 1. Wait for the key values to populate. Fill in the fields that are relevant, including `LY_3RDPARTY_PATH` and `LY_PROJECTS` + 1. Click "Generate" -7. The configuration of the solution is complete. To build the Editor and AssetProcessor to binaries, run this command inside your repo: +1. The configuration of the solution is complete. To build the Editor and AssetProcessor to binaries, run this command inside your repo: ``` - cmake --build --target AutomatedTesting.GameLauncher AssetProcessor Editor --config profile -- /m + cmake --build --target AutomatedTesting.GameLauncher AssetProcessor Editor --config profile -- /m ``` -8. This will compile after some time and binaries will be available in the build path you've specified +1. This will compile after some time and binaries will be available in the build path you've specified ### Setting up new projects -1. Setup new projects using this command +1. Setup new projects using the `o3de create-project` command. In the 0.5 branch, the project directory must be a subdirectory in the repo folder. ``` - \scripts\o3de.bat create-project --project-path + \scripts\o3de.bat create-project --project-path ``` -2. Once you're ready to build the project, run the same set of commands to configure and build: +1. Register the engine to the project ``` - cmake -B -S -G "Visual Studio 16 2019" -DLY_3RDPARTY_PATH=%LY_3RDPARTY_PATH% -DLY_PROJECTS= -DLY_MONOLITHIC_GAME=1 + \scripts\o3de.bat register --project-path + ``` +1. Once you're ready to build the project, run the same set of commands to configure and build: + ``` + cmake -B -S -G "Visual Studio 16" -DLY_3RDPARTY_PATH=<3rdParty cache path> - cmake --build --target --config profile -- /m + // For the 0.5 branch, you must build a new Editor for each project: + cmake --build --target Editor --config profile -- /m + + // For all other branches, just build the project: + cmake --build --target --config profile -- /m ``` + +For a tutorial on project configuration, see [Creating Projects Using the Command Line](https://docs.o3de.org/docs/welcome-guide/get-started/project-config/creating-projects-using-cli) in the documentation. ## License diff --git a/Registry/AssetProcessorPlatformConfig.setreg b/Registry/AssetProcessorPlatformConfig.setreg index 5f397db06b..2147842da7 100644 --- a/Registry/AssetProcessorPlatformConfig.setreg +++ b/Registry/AssetProcessorPlatformConfig.setreg @@ -24,13 +24,13 @@ "Platform pc": { "tags": "tools,renderer,dx12,vulkan,null" }, - "Platform es3": { + "Platform android": { "tags": "android,mobile,renderer,vulkan" }, "Platform ios": { "tags": "mobile,renderer,metal" }, - "Platform osx_gl": { + "Platform mac": { "tags": "tools,renderer,metal,null" }, // this is an example of a headless platform that has no renderer. @@ -43,9 +43,9 @@ // To enable any additional platform, just uncomment the appropriate line below. "Platforms": { //"pc": "enabled", - //"es3": "enabled", + //"android": "enabled", //"ios": "enabled", - //"osx_gl": "enabled", + //"mac": "enabled", //"server": "enabled" }, // ---- The number of worker jobs, 0 means use the number of Logical Cores @@ -95,11 +95,11 @@ // "exclude": "(comma seperated platform tags or identifiers)" // } // For example if you want to include a scan folder only for platforms that have the platform tags tools and renderer - // but omit it for platform osx_gl, you will have a scanfolder rule like + // but omit it for platform mac, you will have a scanfolder rule like // "ScanFolder (unique identifier)": { // "watch": "@ROOT@/foo", // "include": "tools, renderer", - // "exclude": "osx_gl" + // "exclude": "mac" // } "ScanFolder Game": { diff --git a/Registry/bootstrap.setreg b/Registry/bootstrap.setreg index b0c954a127..ccbf744232 100644 --- a/Registry/bootstrap.setreg +++ b/Registry/bootstrap.setreg @@ -8,9 +8,9 @@ "ios_remote_filesystem": 0, "mac_remote_filesystem": 0, "assets": "pc", - "android_assets": "es3", + "android_assets": "android", "ios_assets": "ios", - "mac_assets": "osx_gl", + "mac_assets": "mac", "allowed_list": "", "remote_ip": "127.0.0.1", "remote_port": 45643, diff --git a/Registry/gem_autoload.serializecontexttools.setreg b/Registry/gem_autoload.serializecontexttools.setreg index 1f4a8931c5..e7e88dd6a6 100644 --- a/Registry/gem_autoload.serializecontexttools.setreg +++ b/Registry/gem_autoload.serializecontexttools.setreg @@ -9,6 +9,18 @@ }, "PythonAssetBuilder.Editor": { "AutoLoad": false + }, + "AWSCore.Editor": { + "AutoLoad": false + }, + "AWSClientAuth": { + "AutoLoad": false + }, + "AWSClientAuth.Editor": { + "AutoLoad": false + }, + "AWSMetrics": { + "AutoLoad": false } } } diff --git a/Registry/sceneassetimporter.setreg b/Registry/sceneassetimporter.setreg new file mode 100644 index 0000000000..bd7c4d0705 --- /dev/null +++ b/Registry/sceneassetimporter.setreg @@ -0,0 +1,16 @@ +{ + "O3DE": + { + "SceneAPI": + { + "AssetImporter": + { + "SupportedFileTypeExtensions": + [ + ".fbx", + ".stl" + ] + } + } + } +} \ No newline at end of file diff --git a/Templates/DefaultGem/Template/CMakeLists.txt b/Templates/DefaultGem/Template/CMakeLists.txt index fb63008782..1a24bd488f 100644 --- a/Templates/DefaultGem/Template/CMakeLists.txt +++ b/Templates/DefaultGem/Template/CMakeLists.txt @@ -11,7 +11,7 @@ set(o3de_gem_path ${CMAKE_CURRENT_LIST_DIR}) set(o3de_gem_json ${o3de_gem_path}/gem.json) -o3de_gem_name(${o3de_gem_json} o3de_gem_name) +o3de_read_json_key(o3de_gem_name ${o3de_gem_json} "gem_name") o3de_restricted_path(${o3de_gem_json} o3de_gem_restricted_path) # Currently we are in the DefaultProjectSource folder: ${CMAKE_CURRENT_LIST_DIR} diff --git a/Templates/DefaultGem/Template/Code/CMakeLists.txt b/Templates/DefaultGem/Template/Code/CMakeLists.txt index 3511f8ff83..b0e52dd79f 100644 --- a/Templates/DefaultGem/Template/Code/CMakeLists.txt +++ b/Templates/DefaultGem/Template/Code/CMakeLists.txt @@ -59,6 +59,12 @@ ly_add_target( Gem::${Name}.Static ) +# By default, we will specify that the above target ${Name} would be used by +# Client and Server type targets when this gem is enabled. If you don't want it +# active in Clients or Servers by default, delete one of both of the following lines: +ly_create_alias(NAME ${Name}.Clients NAMESPACE Gem TARGETS Gem::${Name}) +ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) + # If we are on a host platform, we want to add the host tools targets like the ${Name}.Editor target which # will also depend on ${Name}.Static if(PAL_TRAIT_BUILD_HOST_TOOLS) @@ -94,6 +100,14 @@ if(PAL_TRAIT_BUILD_HOST_TOOLS) PUBLIC Gem::${Name}.Editor.Static ) + + # By default, we will specify that the above target ${Name} would be used by + # Tool and Builder type targets when this gem is enabled. If you don't want it + # active in Tools or Builders by default, delete one of both of the following lines: + ly_create_alias(NAME ${Name}.Tools NAMESPACE Gem TARGETS Gem::${Name}.Editor) + ly_create_alias(NAME ${Name}.Builders NAMESPACE Gem TARGETS Gem::${Name}.Editor) + + endif() ################################################################################ diff --git a/Templates/DefaultGem/template.json b/Templates/DefaultGem/template.json index 22d4eb27e6..b653718095 100644 --- a/Templates/DefaultGem/template.json +++ b/Templates/DefaultGem/template.json @@ -1,6 +1,6 @@ { "template_name": "DefaultGem", - "restricted": "o3de", + "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", diff --git a/Templates/DefaultProject/Template/CMakeLists.txt b/Templates/DefaultProject/Template/CMakeLists.txt index ad0a4c869d..b5b8692059 100644 --- a/Templates/DefaultProject/Template/CMakeLists.txt +++ b/Templates/DefaultProject/Template/CMakeLists.txt @@ -23,64 +23,26 @@ function(add_vs_debugger_arguments) endforeach() endfunction() -set(o3de_project_path ${CMAKE_CURRENT_LIST_DIR}) -set(o3de_project_json ${o3de_project_path}/project.json) - if(NOT PROJECT_NAME) cmake_minimum_required(VERSION 3.19) project(${Name} LANGUAGES C CXX VERSION 1.0.0.0 ) + include(EngineFinder.cmake OPTIONAL) + find_package(o3de REQUIRED) + o3de_initialize() + add_vs_debugger_arguments() +else() + # Add the project_name to global LY_PROJECTS_TARGET_NAME property + file(READ "${CMAKE_CURRENT_LIST_DIR}/project.json" project_json) - # set this project as the only project - set(LY_PROJECTS ${CMAKE_CURRENT_LIST_DIR}) - - # o3de manifest - include(o3de_manifest.cmake) - - ################################################################################ - # Set the engine_path and resolve this engines restricted path if it has one - ################################################################################ - o3de_engine_path(${o3de_project_json} o3de_engine_path) - o3de_project_name(${o3de_project_json} o3de_project_name) - o3de_restricted_path(${o3de_project_json} o3de_project_restricted_path) - message(STATUS "O3DE Project Name: ${o3de_project_name}") - message(STATUS "O3DE Project Path: ${o3de_project_path}") - if(o3de_project_restricted_path) - message(STATUS "O3DE Project Restricted Path: ${o3de_project_restricted_path}") + string(JSON project_target_name ERROR_VARIABLE json_error GET ${project_json} "project_name") + if(json_error) + message(FATAL_ERROR "Unable to read key 'project_name' from 'project.json'") endif() - # add the engines cmake folder to the CMAKE_MODULE_PATH - list(APPEND CMAKE_MODULE_PATH "${o3de_engine_path}/cmake") - - # add subdirectory on the engine path for this project - add_subdirectory(${o3de_engine_path} o3de) - - # add this --project-path arguments to visual studio debugger - add_vs_debugger_arguments() - -else() - ###################################################### - # the engine is calling add sub_directory() on us - ###################################################### - o3de_project_name(${o3de_project_json} o3de_project_name) - o3de_restricted_path(${o3de_project_json} o3de_project_restricted_path) - - # Currently we are in the folder: ${CMAKE_CURRENT_LIST_DIR} - # Get the platform specific folder ${pal_dir} for the 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 - # in which case it will see if that platform is present here or in the restricted folder. - # i.e. It could here: TestDP/Platform/ or - # //TestDP - 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}) - - # Now that we have the platform abstraction layer (PAL) folder for this folder, thats where we will find the - # project cmake for this platform. - include(${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_project.cmake) - - # Add the project_name to global LY_PROJECTS_TARGET_NAME property - set_property(GLOBAL APPEND PROPERTY LY_PROJECTS_TARGET_NAME ${o3de_project_name}) + 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/Code/${NameLower}_files.cmake index 459e33f547..f77348395b 100644 --- a/Templates/DefaultProject/Template/Code/${NameLower}_files.cmake +++ b/Templates/DefaultProject/Template/Code/${NameLower}_files.cmake @@ -13,7 +13,5 @@ set(FILES Include/${Name}/${Name}Bus.h Source/${Name}SystemComponent.cpp Source/${Name}SystemComponent.h - runtime_dependencies.cmake - tool_dependencies.cmake - server_dependencies.cmake + enabled_gems.cmake ) diff --git a/Templates/DefaultProject/Template/Code/CMakeLists.txt b/Templates/DefaultProject/Template/Code/CMakeLists.txt index 38999c031c..43459b1606 100644 --- a/Templates/DefaultProject/Template/Code/CMakeLists.txt +++ b/Templates/DefaultProject/Template/Code/CMakeLists.txt @@ -33,7 +33,7 @@ endif() # in ${pal_dir}/${NameLower}_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake ly_add_target( NAME ${Name}.Static STATIC - NAMESPACE Project + NAMESPACE Gem FILES_CMAKE ${NameLower}_files.cmake ${pal_dir}/${NameLower}_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake @@ -48,7 +48,7 @@ ly_add_target( ly_add_target( NAME ${Name} ${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE} - NAMESPACE Project + NAMESPACE Gem FILES_CMAKE ${NameLower}_shared_files.cmake ${pal_dir}/${NameLower}_shared_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake @@ -57,48 +57,60 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Project::${Name}.Static + Gem::${Name}.Static AZ::AzCore ) +# if enabled, ${Name} is used by all kinds of applications +ly_create_alias(NAME ${Name}.Builders NAMESPACE Gem TARGETS Gem::${Name}) +ly_create_alias(NAME ${Name}.Tools NAMESPACE Gem TARGETS Gem::${Name}) +ly_create_alias(NAME ${Name}.Clients NAMESPACE Gem TARGETS Gem::${Name}) +ly_create_alias(NAME ${Name}.Servers NAMESPACE Gem TARGETS Gem::${Name}) + ################################################################################ # Gem dependencies ################################################################################ -ly_add_project_dependencies( - PROJECT_NAME - ${Name} + +# The GameLauncher uses "Clients" gem variants: +ly_enable_gems( + PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake TARGETS ${Name}.GameLauncher - DEPENDENCIES_FILES - runtime_dependencies.cmake - ${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_runtime_dependencies.cmake -) + VARIANTS + Clients) if(PAL_TRAIT_BUILD_HOST_TOOLS) - ly_add_project_dependencies( - PROJECT_NAME - ${Name} + + # the builder type applications use the "Builders" variants of the enabled gems. + ly_enable_gems( + PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake TARGETS AssetBuilder AssetProcessor AssetProcessorBatch + VARIANTS + Builders) + + # the Editor applications use the "Tools" variants of the enabled gems. + ly_enable_gems( + PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake + TARGETS Editor - DEPENDENCIES_FILES - tool_dependencies.cmake - ${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_tool_dependencies.cmake - ) + VARIANTS + Tools) endif() if(PAL_TRAIT_BUILD_SERVER_SUPPORTED) - ly_add_project_dependencies( - PROJECT_NAME - ${Name} + # this property causes it to actually make a ServerLauncher. + # if you don't want a Server application, you can remove this and the + # following ly_enable_gems lines. + set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS ${Name}) + + # The ServerLauncher uses the "Servers" variants of enabled gems: + ly_enable_gems( + PROJECT_NAME ${Name} GEM_FILE enabled_gems.cmake TARGETS ${Name}.ServerLauncher - DEPENDENCIES_FILES - server_dependencies.cmake - ${pal_dir}/${PAL_PLATFORM_NAME_LOWERCASE}_server_dependencies.cmake - ) - set_property(GLOBAL APPEND PROPERTY LY_LAUNCHER_SERVER_PROJECTS ${Name}) - + VARIANTS + Servers) endif() diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake b/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake index b774cd944f..78fd98ba6c 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake +++ b/Templates/DefaultProject/Template/Code/Platform/Android/${NameLower}_android_files.cmake @@ -11,7 +11,4 @@ set(FILES PAL_android.cmake - android_runtime_dependencies.cmake - android_tool_dependencies.cmake - android_server_dependencies.cmake ) diff --git a/Templates/DefaultProject/Template/Code/Platform/Android/android_server_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Android/android_server_dependencies.cmake deleted file mode 100644 index fe28e294e9..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Android/android_server_dependencies.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake b/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake index 58fc59d265..ee0b06efc4 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake +++ b/Templates/DefaultProject/Template/Code/Platform/Linux/${NameLower}_linux_files.cmake @@ -11,7 +11,4 @@ set(FILES PAL_linux.cmake - linux_runtime_dependencies.cmake - linux_tool_dependencies.cmake - linux_server_dependencies.cmake ) diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_runtime_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Linux/linux_runtime_dependencies.cmake deleted file mode 100644 index a54c22de8c..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_runtime_dependencies.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Vulkan.Private - Gem::Atom_RHI_Vulkan.Builders -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_server_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Linux/linux_server_dependencies.cmake deleted file mode 100644 index fe28e294e9..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_server_dependencies.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_tool_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Linux/linux_tool_dependencies.cmake deleted file mode 100644 index a1ebd6e455..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Linux/linux_tool_dependencies.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Vulkan.Private -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake b/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake index 7eb776e3a6..e14e028c88 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake +++ b/Templates/DefaultProject/Template/Code/Platform/Mac/${NameLower}_mac_files.cmake @@ -12,7 +12,4 @@ set(FILES ../../../Resources/Platform/Mac/Info.plist PAL_mac.cmake - mac_runtime_dependencies.cmake - mac_tool_dependencies.cmake - mac_server_dependencies.cmake ) diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_runtime_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Mac/mac_runtime_dependencies.cmake deleted file mode 100644 index 2821493346..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_runtime_dependencies.cmake +++ /dev/null @@ -1,15 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Metal.Private - Gem::Atom_RHI_Null.Private -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_server_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Mac/mac_server_dependencies.cmake deleted file mode 100644 index fe28e294e9..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_server_dependencies.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_tool_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Mac/mac_tool_dependencies.cmake deleted file mode 100644 index adf5485ed4..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Mac/mac_tool_dependencies.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Metal.Private - Gem::Atom_RHI_Metal.Builders - Gem::Atom_RHI_Vulkan.Builders - Gem::Atom_RHI_DX12.Builders - Gem::Atom_RHI_Null.Builders -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake b/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake index 8fee85a163..b6eb718a05 100644 --- a/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake +++ b/Templates/DefaultProject/Template/Code/Platform/Windows/${NameLower}_windows_files.cmake @@ -11,7 +11,4 @@ set(FILES PAL_windows.cmake - windows_runtime_dependencies.cmake - windows_tool_dependencies.cmake - windows_server_dependencies.cmake ) diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_runtime_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Windows/windows_runtime_dependencies.cmake deleted file mode 100644 index 514a61aa57..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_runtime_dependencies.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Vulkan.Private - Gem::Atom_RHI_DX12.Private - Gem::Atom_RHI_Null.Private -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_server_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Windows/windows_server_dependencies.cmake deleted file mode 100644 index fe28e294e9..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_server_dependencies.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) diff --git a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_tool_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/Windows/windows_tool_dependencies.cmake deleted file mode 100644 index b7f4b82126..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/Windows/windows_tool_dependencies.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Vulkan.Private - Gem::Atom_RHI_Vulkan.Builders - Gem::Atom_RHI_DX12.Private - Gem::Atom_RHI_DX12.Builders - Gem::Atom_RHI_Null.Private - Gem::Atom_RHI_Null.Builders -) diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake b/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake index 41a6d13884..44f15538c8 100644 --- a/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake +++ b/Templates/DefaultProject/Template/Code/Platform/iOS/${NameLower}_ios_files.cmake @@ -12,7 +12,4 @@ set(FILES ../Resources/Platform/iOS/Info.plist PAL_ios.cmake - ios_runtime_dependencies.cmake - ios_tool_dependencies.cmake - ios_server_dependencies.cmake ) diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_runtime_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/iOS/ios_runtime_dependencies.cmake deleted file mode 100644 index e49929c6e1..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_runtime_dependencies.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::Atom_RHI_Metal.Private -) diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_server_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/iOS/ios_server_dependencies.cmake deleted file mode 100644 index fe28e294e9..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_server_dependencies.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) diff --git a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_tool_dependencies.cmake b/Templates/DefaultProject/Template/Code/Platform/iOS/ios_tool_dependencies.cmake deleted file mode 100644 index 14e6f1aa4c..0000000000 --- a/Templates/DefaultProject/Template/Code/Platform/iOS/ios_tool_dependencies.cmake +++ /dev/null @@ -1,14 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) - diff --git a/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp b/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp index 003a984dd6..4f11828366 100644 --- a/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp +++ b/Templates/DefaultProject/Template/Code/Source/${Name}Module.cpp @@ -47,4 +47,4 @@ namespace ${Name} }; }// namespace ${Name} -AZ_DECLARE_MODULE_CLASS(Project_${Name}, ${Name}::${Name}Module) +AZ_DECLARE_MODULE_CLASS(Gem_${Name}, ${Name}::${Name}Module) diff --git a/Templates/DefaultProject/Template/Code/server_dependencies.cmake b/Templates/DefaultProject/Template/Code/enabled_gems.cmake similarity index 70% rename from Templates/DefaultProject/Template/Code/server_dependencies.cmake rename to Templates/DefaultProject/Template/Code/enabled_gems.cmake index 3982bbb166..dfb7d93233 100644 --- a/Templates/DefaultProject/Template/Code/server_dependencies.cmake +++ b/Templates/DefaultProject/Template/Code/enabled_gems.cmake @@ -9,8 +9,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # {END_LICENSE} -set(GEM_DEPENDENCIES +set(ENABLED_GEMS Project::${Name} - Gem::Maestro - Gem::LmbrCentral + Atom_AtomBridge + Camera + CameraFramework + EditorPythonBindings + EMotionFX + GradientSignal + ImGui + LmbrCentral + LyShine + Maestro + NvCloth + SceneProcessing + TextureAtlas + WhiteBox ) diff --git a/Templates/DefaultProject/Template/Code/gem.json b/Templates/DefaultProject/Template/Code/gem.json new file mode 100644 index 0000000000..5b8fb3fde0 --- /dev/null +++ b/Templates/DefaultProject/Template/Code/gem.json @@ -0,0 +1,14 @@ +{ + "gem_name": "${Name}", + "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", + "display_name": "${Name}", + "summary": "A short description of ${Name}.", + "canonical_tags": [ + "Gem" + ], + "user_tags": [ + "${Name}" + ], + "icon_path": "preview.png" +} diff --git a/Templates/DefaultProject/Template/Code/runtime_dependencies.cmake b/Templates/DefaultProject/Template/Code/runtime_dependencies.cmake deleted file mode 100644 index ce8df8152d..0000000000 --- a/Templates/DefaultProject/Template/Code/runtime_dependencies.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Project::${Name} - Gem::Maestro - Gem::TextureAtlas - Gem::LmbrCentral - Gem::NvCloth - Gem::LyShine - Gem::Camera - Gem::CameraFramework - Gem::Atom_RHI.Private - Gem::EMotionFX - Gem::Atom_RPI.Private - Gem::Atom_Feature_Common - Gem::ImGui - Gem::Atom_Bootstrap - Gem::Atom_Component_DebugCamera - Gem::AtomImGuiTools - Gem::AtomLyIntegration_CommonFeatures - Gem::EMotionFX_Atom - Gem::ImguiAtom - Gem::Atom_AtomBridge - Gem::GradientSignal - Gem::AtomFont - Gem::WhiteBox -) diff --git a/Templates/DefaultProject/Template/Code/tool_dependencies.cmake b/Templates/DefaultProject/Template/Code/tool_dependencies.cmake deleted file mode 100644 index 010d45bd0f..0000000000 --- a/Templates/DefaultProject/Template/Code/tool_dependencies.cmake +++ /dev/null @@ -1,43 +0,0 @@ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Project::${Name} - Gem::Maestro.Editor - Gem::TextureAtlas - Gem::LmbrCentral.Editor - Gem::NvCloth.Editor - Gem::LyShine.Editor - Gem::SceneProcessing.Editor - Gem::EditorPythonBindings.Editor - Gem::Camera.Editor - Gem::CameraFramework - Gem::Atom_RHI.Private - Gem::EMotionFX.Editor - Gem::Atom_RPI.Builders - Gem::Atom_RPI.Editor - Gem::Atom_Feature_Common.Builders - Gem::Atom_Feature_Common.Editor - Gem::ImGui.Editor - Gem::Atom_Bootstrap - Gem::Atom_Asset_Shader.Builders - Gem::Atom_Component_DebugCamera - Gem::AtomImGuiTools - Gem::AtomLyIntegration_CommonFeatures.Editor - Gem::EMotionFX_Atom.Editor - Gem::ImageProcessingAtom.Editor - Gem::Atom_AtomBridge.Editor - Gem::ImguiAtom - Gem::AtomFont - Gem::AtomToolsFramework.Editor - Gem::GradientSignal.Editor - Gem::WhiteBox.Editor -) diff --git a/Templates/DefaultProject/Template/EngineFinder.cmake b/Templates/DefaultProject/Template/EngineFinder.cmake new file mode 100644 index 0000000000..fbbe3d8cfe --- /dev/null +++ b/Templates/DefaultProject/Template/EngineFinder.cmake @@ -0,0 +1,68 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +# This file is copied during engine registration. Edits to this file will be lost next +# time a registration happens. + +include_guard() + +# Read the engine name from the project_json file +file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json) +string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine) +if(json_error) + message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}") +endif() + +if(DEFINED ENV{USERPROFILE} AND EXISTS $ENV{USERPROFILE}) + set(manifest_path $ENV{USERPROFILE}/.o3de/o3de_manifest.json) # Windows +else() + set(manifest_path $ENV{HOME}/.o3de/o3de_manifest.json) # Unix +endif() + +# Read the ~/.o3de/o3de_manifest.json file and look through the 'engines_path' object. +# Find a key that matches LY_ENGINE_NAME_TO_USE and use that as the engine path. +if(EXISTS ${manifest_path}) + file(READ ${manifest_path} manifest_json) + + string(JSON engines_path_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines_path) + if(json_error) + message(FATAL_ERROR "Unable to read key 'engines_path' from '${manifest_path}', error: ${json_error}") + endif() + + string(JSON engines_path_type ERROR_VARIABLE json_error TYPE ${manifest_json} engines_path) + if(json_error OR NOT ${engines_path_type} STREQUAL "OBJECT") + message(FATAL_ERROR "Type of 'engines_path' in '${manifest_path}' is not a JSON Object, error: ${json_error}") + endif() + + math(EXPR engines_path_count "${engines_path_count}-1") + foreach(engine_path_index RANGE ${engines_path_count}) + string(JSON engine_name ERROR_VARIABLE json_error MEMBER ${manifest_json} engines_path ${engine_path_index}) + if(json_error) + message(FATAL_ERROR "Unable to read 'engines_path/${engine_path_index}' from '${manifest_path}', error: ${json_error}") + endif() + + if(LY_ENGINE_NAME_TO_USE STREQUAL engine_name) + string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines_path ${engine_name}) + if(json_error) + message(FATAL_ERROR "Unable to read value from 'engines_path/${engine_name}', error: ${json_error}") + endif() + + if(engine_path) + list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake") + break() + endif() + endif() + endforeach() +else() + # If the user is passing CMAKE_MODULE_PATH we assume thats where we will find the engine + if(NOT CMAKE_MODULE_PATH) + message(FATAL_ERROR "Engine registration is required before configuring a project. Please register an engine by running 'scripts/o3de register --this-engine'") + endif() +endif() diff --git a/Templates/DefaultProject/Template/ShaderLib/README.md b/Templates/DefaultProject/Template/ShaderLib/README.md new file mode 100644 index 0000000000..034550163d --- /dev/null +++ b/Templates/DefaultProject/Template/ShaderLib/README.md @@ -0,0 +1,5 @@ +# Customizing Shader Resource Groups + +Please read: +*\/Gems/Atom/Feature/Common/Assets/ShaderResourceGroups/README.md* +for details on how to customize scenesrg.srgi and viewsrg.srgi. diff --git a/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi b/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi deleted file mode 100644 index ac27571828..0000000000 --- a/Templates/DefaultProject/Template/ShaderLib/raytracingscenesrg.srgi +++ /dev/null @@ -1,30 +0,0 @@ -// {BEGIN_LICENSE} -/* -* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -* its licensors. -* -* For complete copyright and license terms please see the LICENSE at the root of this -* distribution (the "License"). All use of this software is governed by the License, -* or, if provided, by the license below or the license accompanying this file. Do not -* remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* -*/ -// {END_LICENSE} - -#pragma once - -// Please read README.md for an explanation on why scenesrg.srgi and viewsrg.srgi are -// located in this folder (And how you can optionally customize your own scenesrg.srgi -// and viewsrg.srgi in your game project). - -#include - -partial ShaderResourceGroup RayTracingSceneSrg : SRG_RayTracingScene -{ -/* Intentionally Empty. Helps define the SrgSemantic for RayTracingSceneSrg once.*/ -}; - -#define AZ_COLLECTING_PARTIAL_SRGS -#include -#undef AZ_COLLECTING_PARTIAL_SRGS diff --git a/Templates/DefaultProject/Template/ShaderLib/scenesrg.srgi b/Templates/DefaultProject/Template/ShaderLib/scenesrg.srgi index 9b4803b7dc..0a8cec5963 100644 --- a/Templates/DefaultProject/Template/ShaderLib/scenesrg.srgi +++ b/Templates/DefaultProject/Template/ShaderLib/scenesrg.srgi @@ -26,5 +26,6 @@ partial ShaderResourceGroup SceneSrg : SRG_PerScene }; #define AZ_COLLECTING_PARTIAL_SRGS -#include +#include +#include #undef AZ_COLLECTING_PARTIAL_SRGS diff --git a/Gems/ScriptCanvasDiagnosticLibrary/Code/Tests/ScriptCanvasDiagnosticLibraryTest.cpp b/Templates/DefaultProject/Template/Shaders/ShaderResourceGroups/SceneSrg.azsli similarity index 56% rename from Gems/ScriptCanvasDiagnosticLibrary/Code/Tests/ScriptCanvasDiagnosticLibraryTest.cpp rename to Templates/DefaultProject/Template/Shaders/ShaderResourceGroups/SceneSrg.azsli index 4052b9dee4..4c962fbbcd 100644 --- a/Gems/ScriptCanvasDiagnosticLibrary/Code/Tests/ScriptCanvasDiagnosticLibraryTest.cpp +++ b/Templates/DefaultProject/Template/Shaders/ShaderResourceGroups/SceneSrg.azsli @@ -1,3 +1,4 @@ +// {BEGIN_LICENSE} /* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. @@ -9,36 +10,15 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ -#include "precompiled.h" +// {END_LICENSE} -#include +#ifndef AZ_COLLECTING_PARTIAL_SRGS +#error Do not include this file directly. Include the main .srgi file instead. +#endif -class ScriptCanvasDiagnosticLibraryTest - : public ::testing::Test +partial ShaderResourceGroup SceneSrg { -protected: - static void SetUpTestCase() - { - } - - static void TearDownTestCase() - { - } - - void SetUp() override - { - } - - void TearDown() override - { - } - -}; - -TEST_F(ScriptCanvasDiagnosticLibraryTest, Sanity_Pass) -{ - EXPECT_TRUE(true); + float m_time; + float m_deltaTime; } - -AZ_UNIT_TEST_HOOK(); diff --git a/Templates/DefaultProject/Template/preview.png b/Templates/DefaultProject/Template/preview.png index 2191a0ebc2..3d4fe78063 100644 --- a/Templates/DefaultProject/Template/preview.png +++ b/Templates/DefaultProject/Template/preview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a18fae4040a22d2bb359a8ca642b97bb8f6468eeb52e2826b3b029bd8f1350b6 -size 5466 +oid sha256:40949893ed7009eeaa90b7ce6057cb6be9dfaf7b162e3c26ba9dadf985939d7d +size 2038 diff --git a/Templates/DefaultProject/template.json b/Templates/DefaultProject/template.json index 56278a6b04..26b868d315 100644 --- a/Templates/DefaultProject/template.json +++ b/Templates/DefaultProject/template.json @@ -1,6 +1,6 @@ { "template_name": "DefaultProject", - "restricted": "o3de", + "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", @@ -24,6 +24,12 @@ "isTemplated": true, "isOptional": false }, + { + "file": "EngineFinder.cmake", + "origin": "EngineFinder.cmake", + "isTemplated": false, + "isOptional": false + }, { "file": "Code/${NameLower}_files.cmake", "origin": "Code/${NameLower}_files.cmake", @@ -42,6 +48,12 @@ "isTemplated": true, "isOptional": false }, + { + "file": "Code/gem.json", + "origin": "Code/gem.json", + "isTemplated": true, + "isOptional": true + }, { "file": "Code/Include/${Name}/${Name}Bus.h", "origin": "Code/Include/${Name}/${Name}Bus.h", @@ -66,24 +78,6 @@ "isTemplated": true, "isOptional": false }, - { - "file": "Code/Platform/Android/android_runtime_dependencies.cmake", - "origin": "Code/Platform/Android/android_runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Android/android_server_dependencies.cmake", - "origin": "Code/Platform/Android/android_server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Android/android_tool_dependencies.cmake", - "origin": "Code/Platform/Android/android_tool_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, { "file": "Code/Platform/Linux/${NameLower}_linux_files.cmake", "origin": "Code/Platform/Linux/${NameLower}_linux_files.cmake", @@ -102,24 +96,6 @@ "isTemplated": true, "isOptional": false }, - { - "file": "Code/Platform/Linux/linux_runtime_dependencies.cmake", - "origin": "Code/Platform/Linux/linux_runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Linux/linux_server_dependencies.cmake", - "origin": "Code/Platform/Linux/linux_server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Linux/linux_tool_dependencies.cmake", - "origin": "Code/Platform/Linux/linux_tool_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, { "file": "Code/Platform/Mac/${NameLower}_mac_files.cmake", "origin": "Code/Platform/Mac/${NameLower}_mac_files.cmake", @@ -138,24 +114,6 @@ "isTemplated": true, "isOptional": false }, - { - "file": "Code/Platform/Mac/mac_runtime_dependencies.cmake", - "origin": "Code/Platform/Mac/mac_runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Mac/mac_server_dependencies.cmake", - "origin": "Code/Platform/Mac/mac_server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Mac/mac_tool_dependencies.cmake", - "origin": "Code/Platform/Mac/mac_tool_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, { "file": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", "origin": "Code/Platform/Windows/${NameLower}_shared_windows_files.cmake", @@ -174,24 +132,6 @@ "isTemplated": true, "isOptional": false }, - { - "file": "Code/Platform/Windows/windows_runtime_dependencies.cmake", - "origin": "Code/Platform/Windows/windows_runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Windows/windows_server_dependencies.cmake", - "origin": "Code/Platform/Windows/windows_server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/Windows/windows_tool_dependencies.cmake", - "origin": "Code/Platform/Windows/windows_tool_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, { "file": "Code/Platform/iOS/${NameLower}_ios_files.cmake", "origin": "Code/Platform/iOS/${NameLower}_ios_files.cmake", @@ -210,24 +150,6 @@ "isTemplated": true, "isOptional": false }, - { - "file": "Code/Platform/iOS/ios_runtime_dependencies.cmake", - "origin": "Code/Platform/iOS/ios_runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/iOS/ios_server_dependencies.cmake", - "origin": "Code/Platform/iOS/ios_server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/Platform/iOS/ios_tool_dependencies.cmake", - "origin": "Code/Platform/iOS/ios_tool_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, { "file": "Code/Source/${Name}Module.cpp", "origin": "Code/Source/${Name}Module.cpp", @@ -247,20 +169,8 @@ "isOptional": false }, { - "file": "Code/runtime_dependencies.cmake", - "origin": "Code/runtime_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/server_dependencies.cmake", - "origin": "Code/server_dependencies.cmake", - "isTemplated": true, - "isOptional": false - }, - { - "file": "Code/tool_dependencies.cmake", - "origin": "Code/tool_dependencies.cmake", + "file": "Code/enabled_gems.cmake", + "origin": "Code/enabled_gems.cmake", "isTemplated": true, "isOptional": false }, @@ -565,10 +475,10 @@ "isOptional": false }, { - "file": "ShaderLib/raytracingscenesrg.srgi", - "origin": "ShaderLib/raytracingscenesrg.srgi", + "file": "ShaderLib/README.md", + "origin": "ShaderLib/README.md", "isTemplated": true, - "isOptional": false + "isOptional": true }, { "file": "ShaderLib/scenesrg.srgi", @@ -588,6 +498,12 @@ "isTemplated": true, "isOptional": false }, + { + "file": "Shaders/ShaderResourceGroups/SceneSrg.azsli", + "origin": "Shaders/ShaderResourceGroups/SceneSrg.azsli", + "isTemplated": true, + "isOptional": false + }, { "file": "autoexec.cfg", "origin": "autoexec.cfg", diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds deleted file mode 100644 index 872d7b71d4..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f454e6505870d9159eaac1eb0c53751e45e803cf50bf94e5c5f51ba2232cebba -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds deleted file mode 100644 index 97ed5efe4d..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c1047fad9be53568fc471bdb5633445a030efaed6bf9b5e9d47abb09efb4d01e -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds deleted file mode 100644 index 337e63a40c..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:11b5326877643b06a5687cf1470e388752296df64ce3abb69aa06f1933e0f3b8 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds deleted file mode 100644 index 2e6b3a3eda..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:de54072f3eca1a1de6250b1585335a1aa6fa9e07e4e7ad00cd37ea5f809a303c -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds deleted file mode 100644 index 4a80ce04e1..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ac0f98198af41590052eff6550d34f05d0e3ca374bc59e7ece314be2380c210f -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds deleted file mode 100644 index d7e0e74fca..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:be47d7c0a2a64b17925e51b65abba72dd22735ef7f3913e9aa389f8c31124ede -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds deleted file mode 100644 index 391bd3ec9f..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:372359625eec486abbbe7f9ab438b51627939bfbd39002d136b6d6b9c61bbe1b -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds deleted file mode 100644 index 418a7ee3ed..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:91ba2bd2504a10a199964b35014df14a4405cf8fd47955a6c4ef9ca4f300637d -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds b/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds deleted file mode 100644 index 9c11c2fa43..0000000000 --- a/Tests/Atom/GoldenImages/Windows/amd/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7d8442967964bab77d02a572e6e7f8fcd158e62308b7e6340d4d56be13f7f455 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds deleted file mode 100644 index f9a46c53c8..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_1000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5bf373730d725a14b6833b7862c6268a93d8f9d847032a60cdc99ce14fea9dfe -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds deleted file mode 100644 index 25cce25c63..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_2000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:181c31eb7fa068027d3e42c415006fd70d1fbeb0bfe373b3290aea6e3002d762 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds deleted file mode 100644 index a1c5d4e1b8..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_3000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:efc4fbc90bfd01a1ba09ebd925b8379e67263b7156f37473dd13a91f346ed1c4 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds deleted file mode 100644 index 4cafe4e613..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_4000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b48137886ef2a38312eedbddb111367b3f3924ab5425b49f81a92ae7d4ea898e -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds deleted file mode 100644 index bb74f06212..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_5000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ea47fd8d68dab6ba54e45bfc50d84d380ec2f5b7e6915713dc9e9aa41423d4ea -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds deleted file mode 100644 index 8bc6e3de17..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_6000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9bd3fe0208cbee26cfcf00cba0a127c5938061b8bea2143d05e28fbc7f55d9ca -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds deleted file mode 100644 index 4c286062d0..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_7000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:30f6aac28e74da435ad6c018b6a7e9b7cee1ad74ec5452778e56036a7d438ec9 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds deleted file mode 100644 index 31023d437e..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_8000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2628992a8c8774ff5e77152999009ba3cbb3b68ee79d53669dd16aebe978da27 -size 5946320 diff --git a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds b/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds deleted file mode 100644 index a5f85d6b22..0000000000 --- a/Tests/Atom/GoldenImages/Windows/nvidia/Baseviewer/BistroBenchmark/screenshot_bistro_9000.dds +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:42faae0235f0c74bc0201dd8fc805a9c01f086b093026b654e207f83ea0f3f90 -size 5946320 diff --git a/Tests/Atom/image_comparison_utils.py b/Tests/Atom/image_comparison_utils.py deleted file mode 100755 index 698901710a..0000000000 --- a/Tests/Atom/image_comparison_utils.py +++ /dev/null @@ -1,105 +0,0 @@ -# """ -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. - -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -# Utility functions for image comparison tests. -# """ -# import test_tools.shared.images.qssim as qssim -# import PythonMagick -# import logging -# import os -# import shared.s3_utils -# import platform - - -#################################### -# Commented out due to need to shift to new LyTestTools, Python3 and new screenshot workflow -# Don't merge to Mainline -#################################### - - -# def create_image_path(screenshot, path, extension, golden): - # """ - # Create image path from name, path and extension - # From a specified path, create the path for the diff image - # :param screenshot: path to the screenshot which needs to be saved - # :param path: path to where screenshot should be saved - # :param extension: extension of the diff image (.dds, .jpg) - # :param golden: True or False whether screenshot is golden image or not - # :return diff_full_path: path of the iamge to be saved - # """ - # screenshot_name = os.path.basename(screenshot) - # if golden: - # diff_name = "{}_golden{}".format(screenshot_name.split('.')[:-1][0], extension) - # else: - # diff_name = "{}{}".format(screenshot_name.split('.')[:-1][0], extension) - # diff_full_path = os.path.join(path, diff_name) - # return diff_full_path - - -# def convert_dds_to_jpg(image, path, golden): - # """ - # Convert DDS to JPEG - # :param image: DDS image to convert - # :param path: path to where iamge will be saved - # :return screenshotJPG_path: path to the newly JPEG-converted DDS image - # """ - # # Convert image as JPEG for quick review - # screenshotJPG_path = create_image_path(image, path, '.jpg', golden) - # screenshot = PythonMagick.Image(image) - # screenshot.quality(100) - # screenshot.magick('JPEG') - # screenshot.write(screenshotJPG_path) - # return screenshotJPG_path - - -# def compare_screenshot_to_golden_image(screenshot, golden_image, path, threshold=0.985): - # """ - # Compare Screenshots to Golden Images - # Function to compare a newly taken screenshot with the golden image - # :param screenshot: path of the screenshot - # :param golden_image: path of the golden image (in Perforce) - # :param path: path to where the screenshot diff image will be saved - # :param threshold: threshold for the image comparison test to fail/pass (optional) - # :return failure_not_found: True or False whether screenshots are similar (due to threshold) or not - # """ - # failure_not_found = True - # logging.info("Comparing screenshot {}".format(screenshot)) - # # Calculating screenshots similarity - # quaternion_similarity = qssim.qssim(screenshot, golden_image, diff_path = path) - # # Converting original screenshots to jpg - # convert_dds_to_jpg(screenshot, path, False) - # convert_dds_to_jpg(golden_image, path, True) - # # Checking if similarity index is bypassing the threshold - # if (quaternion_similarity < threshold): - # failure_not_found = False - # logging.error("%s failed the image comparison with %s", screenshot, golden_image) - # else: - # logging.info("Comparison successful, screenshots are similar.") - # return failure_not_found - - -# def upload_screenshots_to_s3(folder_path, folder_name): - # """ - # Uploading screenshots to certain s3 bucket - # Will require certain credentials (from the IAM that has access to l-qa@amazon acc) on the machine to work - # :param folder_path: full path to folder that needs to be uploaded to s3 - # :param folder_name: name of the folder to be uploaded to s3 - # :return: None - # """ - # host_name = platform.uname()[1] - # s3_folder_name = '_'.join([folder_name, host_name]) - - # logging.info("Trying to create a folder on S3; bucket: ly.screenshot.automation.artifacts, folder: {}".format(s3_folder_name)) - # shared.s3_utils.create_folder_in_bucket('ly.screenshot.automation.artifacts', s3_folder_name) - - # for file in os.listdir(folder_path): - # key = '{}/{}'.format(s3_folder_name, file) - # shared.s3_utils.upload_to_bucket('ly.screenshot.automation.artifacts', '{}/{}'.format(folder_path, file), key) - diff --git a/Tests/Atom/windows/atomsampleviewer_tests_stability.py b/Tests/Atom/windows/atomsampleviewer_tests_stability.py deleted file mode 100755 index b480a7bc1a..0000000000 --- a/Tests/Atom/windows/atomsampleviewer_tests_stability.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -This is a file to test basic functionality of the Base Viewer executable -""" - -import os -import pytest -import subprocess -import time -import re -from ly_test_tools.environment.process_utils import kill_processes_named as kill_processes_named - -dev_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), '..', '..', '..', '..')) -bin_dir = 'Bin64vc141' - - -def gather_sample_names(): - """ - Gathers the currently eligible samples from the output of a single run of baseviewer.exe (with no sample argument). - For use in the fixture parameters. - """ - viewer_dir = os.path.join(dev_dir, bin_dir) - os.chdir(viewer_dir) - process = subprocess.Popen(['BaseViewer.exe', '-timeout', '5'], stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - out = process.communicate()[0] - log = out.splitlines() - samples = [] - for line in log: - line = str(line) - if "SampleComponentManager" in line and '-' not in line and 'Not Supported' not in line: - line_regexp = re.search('\[.*\]', line) - line = line_regexp.group(0) - sample = line.replace('[', '').replace(']', '') - samples.append(sample) - kill_processes_named('AssetProcessor', ignore_extensions=True) - if samples is not None: - return samples - - -@pytest.fixture -def kill_AP(request): - def teardown(): - kill_processes_named('AssetProcessor', ignore_extensions=True) - request.addfinalizer(teardown) - - -@pytest.mark.parametrize("samples", gather_sample_names()) -class TestBaseViewerExe(object): - - def test_OpenSampleLevel_CorrectFormat_ShouldPass(self, samples, kill_AP): - """ - Opens the specific BaseViewer samples individually and verifies they're stable for a few seconds and then exit - cleanly - """ - viewer_dir = os.path.join(dev_dir, bin_dir) - os.chdir(viewer_dir) - return_code = subprocess.check_call(['BaseViewer.exe', '-sample', samples, '-timeout', '20'], timeout=30) - assert return_code == 0, "Sample '{}' did not exit properly with code '{}'".format(samples, str(returncode)) - - def test_OpenSampleLevel_NoErrors_ShouldPass(self, samples, kill_AP): - """ - Opens the specific BaseViewer samples individually and verifies there are no errors in the output while running - """ - viewer_dir = os.path.join(dev_dir, bin_dir) - os.chdir(viewer_dir) - output = subprocess.check_output(['BaseViewer.exe', '-sample', samples, '-timeout', '20'], timeout=30) - log = output.splitlines() - errors = [] - assertions = [] - for i in range(len(log)): - line = str(log[i]) - surrounding_lines = str(log[i:i+3]) - if "Trace::Error" in line: - errors.append(surrounding_lines) - if "Trace::Assert" in line: - assertions.append(surrounding_lines) - - assert len(errors) == 0, "Sample '{}' had the following errors when run: {}".format(samples, "\n".join(errors)) - assert len(assertions) == 0, "Sample '{}' had the following assertions when run: {}".format(samples, "\n".join(assertions)) - diff --git a/Tests/Atom/windows/conftest.py b/Tests/Atom/windows/conftest.py deleted file mode 100755 index e0766a4015..0000000000 --- a/Tests/Atom/windows/conftest.py +++ /dev/null @@ -1,39 +0,0 @@ -# """ -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. - -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -# Conftest file for providing additional configuration for Screenshot Comparison tests -# """ - - - -#################################### -# Commented out due to need to shift to new LyTestTools, Python3 and new screenshot workflow -# Don't merge to Mainline -#################################### - - -# import pytest - -# def pytest_addoption(parser): - # parser.addoption( - # '--graphics_vendor', action='store', help='graphics vendor name: nvidia or amd', required=True - # ) - # parser.addoption( - # '--upload_results_to_s3', action='store_true', default=False, help='Specify if you need to upload screenshot artifacts to s3' - # ) - -# @pytest.fixture -# def graphics_vendor(request): - # return request.config.getoption('--graphics_vendor') - -# @pytest.fixture -# def upload_results_to_s3(request): - # return request.config.getoption('--upload_results_to_s3') - diff --git a/Tests/Atom/windows/screenshot_comparison_atomsampleviewer_windows.py b/Tests/Atom/windows/screenshot_comparison_atomsampleviewer_windows.py deleted file mode 100755 index fca50c9901..0000000000 --- a/Tests/Atom/windows/screenshot_comparison_atomsampleviewer_windows.py +++ /dev/null @@ -1,143 +0,0 @@ -# """ -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. - -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -# BaseViewer image comparison tests on windows -# """ - -# import Atom.image_comparison_utils as image_comparison_utils -# import test_tools.builtin.fixtures as fixtures -# import subprocess -# import pytest -# import os -# import logging -# import time -# import datetime -# from test_tools import WINDOWS -# from test_tools.shared.process_utils import kill_processes_named -# from test_tools.shared.waiter import wait_for - - - - -#################################### -# Commented out due to need to shift to new LyTestTools, Python3 and new screenshot workflow -# Don't merge to Mainline -#################################### - - - - -# workspace = fixtures.use_fixture(fixtures.builtin_workspace_fixture, scope='function') -# logger = logging.getLogger(__name__) - -# @pytest.fixture(scope='session', autouse=True) -# def closing_ap(request): - # """ - # Fixture to call once per all tests to teardown AP at the end - # :param request: pytest request - # """ - # def teardown(): - # kill_processes_named('AssetProcessor_tmp', ignore_extensions=True) - # kill_processes_named('AssetProcessor', ignore_extensions=True) - # kill_processes_named('AssetProcessorBatch', ignore_extensions=True) - # kill_processes_named('AssetBuilder', ignore_extensions=True) - # kill_processes_named('rc', ignore_extensions=True) - # request.addfinalizer(teardown) - -# @pytest.fixture() -# def screenshots_setup(request, workspace, sample, graphics_vendor, upload_results_to_s3): - # """ - # Fixture for setting up workspace needed for screenshot comparison test - # :param request: pytest request - # :param workspace: pythontesttools workspace object - # :param sample: name of BaseViwer sample - # :return final_path: path to folder where output screenshots will be stored - # """ - # # Creating output folder - # tests_path = os.path.dirname(os.path.realpath(__file__)) - # dir_name = "{}_screenshot_tests_{}_{}_{}_{}".format(datetime.datetime.now().strftime("%Y-%m-%d_%H_%M_%S_%f"), sample.replace('/', ""), workspace.release.platform, workspace.release.configuration, - # graphics_vendor) - # dir_name = dir_name.replace(":", '_') - # final_path = os.path.join(tests_path, dir_name) - # os.mkdir(final_path) - - # # Teardown to clean up Cache from .dds screenshots that are produced by BaseViewer.exe - # def teardown(): - # cache = os.path.join(workspace.release.paths.dev(), "Cache", "BaseViewer", "pc", "baseviewer") - # files = os.listdir(cache) - # for file in files: - # name, file_extension = os.path.splitext(file) - # if 'screenshot' in name and file_extension == '.dds': - # screen_to_remove = os.path.join(cache, file) - # logger.info('Deleting temp screenshot file {}.'.format(screen_to_remove)) - # os.remove(screen_to_remove) - # kill_processes_named('BaseViewer', ignore_extensions=True) - # # uploading screenshots to s3 - # if upload_results_to_s3: - # image_comparison_utils.upload_screenshots_to_s3(final_path, dir_name) - # request.addfinalizer(teardown) - # return final_path - - -# # Commenting out debug due to ATOM-1677 -# @pytest.mark.parametrize("platform,configuration,project,spec,sample", [ - # pytest.param("win_x64_vs2017", "profile", "BaseViewer", "all", "RPI/BistroBenchmark", - # marks=pytest.mark.skipif(not WINDOWS, reason="Only supported on Windows hosts")), - # #pytest.param("win_x64_vs2017", "debug", "BaseViewer", "all", "RPI/BistroBenchmark", - # # marks=pytest.mark.skipif(not WINDOWS, reason="Only supported on Windows hosts")), - # ]) -# class TestBaseViewerScreenshots(object): - # def test_BistroBenchmarkSample_CompareScreenshots(self, request, workspace, sample, screenshots_setup, graphics_vendor): - # """ - # Launches BaseViewer.exe RPI/BistoBenchmark, taking screenshot and comparing on certain frames. - # """ - # base_path = workspace.release.paths.dev() - # # Generating frames list parameter - # frames_list = range(1000,10000,1000) - # frames_param = "" - # screenshot_names = [] - # for parameter in frames_list: - # frames_param += '{},'.format(parameter) - # screenshot_names.append('screenshot_bistro_{}.dds'.format(parameter)) - # frames_param = frames_param[:-1] - # # Loading BaseViewer - # self.load_baseviewer_directly(workspace, sample, frames_param, timeout=100) - - # logger.info('Comparing screenshots to golden images') - # taken_screens_path = os.path.join(base_path, "Cache", "BaseViewer", "pc", "baseviewer") - # golden_screens_path = os.path.join(base_path, "Tests", "Atom", "GoldenImages", "Windows", graphics_vendor, "Baseviewer", "BistroBenchmark") - # failed_screenshots = [] - # for screen in screenshot_names: - # taken_image = os.path.join(taken_screens_path, screen) - # golden_image = os.path.join(golden_screens_path, screen) - # if not image_comparison_utils.compare_screenshot_to_golden_image(taken_image, golden_image, screenshots_setup): - # failed_screenshots.append(screen) - # if len(failed_screenshots) > 0: - # assert False, "A failure has been found during image comparison for the following images: {}".format(failed_screenshots) - - - # def load_baseviewer_directly(self, workspace, sample, frames, timeout): - # """ - # Launch directly Baseviewer without using the launcher (since Atom is not yet integrated in Lumberyard) - # :param workspace: pythontesttools workspace object - # :param sample: name of the sample from BaseViewer - # :param frames: list of frames to take screenshots at - # :param timeout: time in seconds to wait BaseViewer to take screenshots - # """ - # base_path = workspace.release.paths.dev() - # bin_dir = workspace.release.paths.bin_dir() - # cmd_path = os.path.join(base_path, bin_dir) - # os.chdir(cmd_path) - # p = subprocess.Popen(['BaseViewer.exe', '-sample', sample, '-screenshot', frames]) - # # Wait for BaseViewer to run and take screenshot - # last_screenshot = frames.split(',')[-1] - # screenshot_file = os.path.join(base_path, "Cache", "BaseViewer", "pc", "baseviewer", "screenshot_bistro_{}.dds".format(last_screenshot)) - # wait_for(lambda: os.path.exists(screenshot_file), timeout) - diff --git a/Tests/BuildSystems/test_BuildBAT.py b/Tests/BuildSystems/test_BuildBAT.py deleted file mode 100755 index 1521508550..0000000000 --- a/Tests/BuildSystems/test_BuildBAT.py +++ /dev/null @@ -1,212 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -BuildSystems BAT to automate building on packages for Windows -""" -import logging -import pytest -import os - -pytest.importorskip('ly_test_tools') - -import ly_test_tools.builtin.helpers as helpers -from .test_lib import build_helper - -logger = logging.getLogger(__name__) - - -@pytest.mark.BAT -@pytest.mark.parametrize('spec', ['all']) -@pytest.mark.parametrize('project', ['AutomatedTesting']) - -class TestWindowsBuildConfig(object): - """ - Automated tests for all the build configurations for Windows. - Test cases live in Repository/Build System/Lumberyard Builds/Configurations - """ - @pytest.mark.test_case_id('C15723869') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['profile']) - @pytest.mark.build - def test_build_win_x64_vs2017_profile(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15723870') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['profile_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2017_profile_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15723871') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['profile_test']) - @pytest.mark.build - def test_build_win_x64_vs2017_profile_test(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15723872') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['profile_test_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2017_profile_test_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15716369') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['debug']) - @pytest.mark.build - def test_build_win_x64_vs2017_debug(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15716370') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['debug_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2017_debug_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15716371') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['debug_test']) - @pytest.mark.build - def test_build_win_x64_vs2019_debug_test(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15716372') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['debug_test_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2017_debug_test_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15723889') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['release']) - @pytest.mark.build - def test_build_win_x64_vs2017_release(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15723890') - @pytest.mark.parametrize('platform', ['win_x64_vs2017']) - @pytest.mark.parametrize('configuration', ['release_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2017_release_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815180') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile']) - @pytest.mark.build - def test_build_win_x64_vs2019_profile(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815181') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2019_profile_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815182') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile_test']) - @pytest.mark.build - def test_build_win_x64_vs2019_profile_test(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815183') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile_test_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2019_profile_test_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815174') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['debug']) - @pytest.mark.build - def test_build_win_x64_vs2019_debug(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815175') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['debug_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2019_debug_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815176') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['debug_test']) - @pytest.mark.build - def test_build_win_x64_vs2019_debug_test(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815177') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['debug_test_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2019_debug_test_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815190') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['release']) - @pytest.mark.build - def test_build_win_x64_vs2019_release(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) - - @pytest.mark.test_case_id('C15815191') - @pytest.mark.parametrize('platform', ['win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['release_dedicated']) - @pytest.mark.build - def test_build_win_x64_vs2019_release_dedicated(self, workspace, platform, configuration, project, spec): - workspace.build() - build_log = os.path.join(workspace.artifact_manager.dest_path, 'waf_build.log') - assert build_helper.verify_build_log(build_log, platform, configuration) \ No newline at end of file diff --git a/Tests/BuildSystems/test_lib/build_helper.py b/Tests/BuildSystems/test_lib/build_helper.py deleted file mode 100755 index c2213d139b..0000000000 --- a/Tests/BuildSystems/test_lib/build_helper.py +++ /dev/null @@ -1,38 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Helper functions for build systems -""" -import os -import logging - -logger = logging.getLogger(__name__) - - -def verify_build_log(build_log_path, platform, configuration): - """ - This will search the log file for an expected success message for a specific platform configuration. - :param build_log_path: the full path to the log file. e.g. \\dev\TestResults\timestamp_folder\pytest_results\... - :param platform: the compiler to use, e.g. "win_x64_vs2017" - :param configuration: the flavor of the build, e.g. "profile" - :return: True, if success message is found within the build log. False, if success message is not found and raise an assertion error if the build log cannot be found. - """ - success_message = "[WAF] 'build_{0}_{1}' finished successfully".format(platform, configuration) - if os.path.exists(build_log_path): - with open(build_log_path) as build_file: - for line in build_file: - if success_message in line: - logger.info('Success message was found for {0}_{1}'.format(platform, configuration)) - return True - logger.info('Success message not found for {0}_{1}'.format(platform, configuration)) - return False - else: - logger.info('We cannot find the build log and this is the path we are looking for {0}'.format(build_log_path)) - raise AssertionError diff --git a/Tests/README.txt b/Tests/README.txt deleted file mode 100644 index 71598c7890..0000000000 --- a/Tests/README.txt +++ /dev/null @@ -1 +0,0 @@ -This folder contains integration tests which do not ship with Lumberyard. Tests that ship with the product can be found in folders adjacent to the code that they test. \ No newline at end of file diff --git a/Tests/ai/EditorScripts/LY_114727_NavigationComponent_MovementMethods.py b/Tests/ai/EditorScripts/LY_114727_NavigationComponent_MovementMethods.py deleted file mode 100755 index 75a13b8e17..0000000000 --- a/Tests/ai/EditorScripts/LY_114727_NavigationComponent_MovementMethods.py +++ /dev/null @@ -1,46 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -''' -This script tests movement methods Transform, Physics and Custom -''' -import sys, os -import time -import azlmbr.legacy.general as general - -from tests_common import TestHelper - -class TestMovementMethods(TestHelper): - def __init__(self): - TestHelper.__init__(self, log_prefix = 'LY-114727', args=['level']) - - def run_test(self): - # Start by assuming we'll crash and fail - self.test_success = False - # Open the level non-interactively - level_opened = self.open_level(self.get_arg('level')) - if not level_opened: - return - - # Enter game mode, so that physics in the test level starts running. - general.enter_game_mode() - # Wait for game mode to start. (Not sure if this is necessary, just being extra-cautious) - while (general.is_in_game_mode() != True): - general.idle_wait(1.0) - # Wait for game mode to finish. Entities should be navigating - while (general.is_in_game_mode() == True): - general.idle_wait(2.0) - - # We finished and haven't crashed, so assume success and exit the Editor. - self.test_success = True - -test = TestMovementMethods() -test.run() - diff --git a/Tests/ai/EditorScripts/tests_common.py b/Tests/ai/EditorScripts/tests_common.py deleted file mode 100755 index 76ad183c60..0000000000 --- a/Tests/ai/EditorScripts/tests_common.py +++ /dev/null @@ -1,163 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import sys, os -import azlmbr.legacy.general as general -import azlmbr.legacy.settings as settings - -class TestHelper: - def __init__(self, log_prefix, args = None): - self.log_prefix = log_prefix + ': ' - self.test_success = True - self.args = {} - if args: - # Get the level name and heightmap name from command-line args - if (len(sys.argv) == (len(args) + 1)): - for arg_index in range(len(args)): - self.args[args[arg_index]] = sys.argv[arg_index + 1] - else: - test_success = False - self.log('Expected command-line args: {}'.format(args)) - - - # Test Setup - # Set helpers - # Set viewport size - # Turn off display mode, antialiasing - # set log prefix, log test started - # TODO: Turn off user dialogs like Amazon login, surveys, etc... - def setup(self): - self.log('test started') - - def after_level_load(self): - # Enable the Editor to start running its idle loop. - # This is needed for Python scripts passed into the Editor startup. Since they're executed - # during the startup flow, they run before idle processing starts. Without this, the engine loop - # won't run during idle_wait, which will prevent our test level from working. - general.idle_enable(True) - - # Give everything a second to initialize - general.idle_wait(1.0) - - self.original_settings = settings.get_misc_editor_settings() - self.helpers_visible = general.is_helpers_shown() - self.viewport_size = general.get_viewport_size() - # Turn off the helper gizmos if visible - if (self.helpers_visible): - general.toggle_helpers() - general.idle_wait(1.0) - - # Set Editor viewport to a well-defined size - general.set_viewport_size(1280, 720) - general.idle_wait(1.0) - - # Turn off any display info like FPS, as that will mess up our image comparisons - # Turn off antialiasing as well - general.run_console("r_displayInfo=0") - general.run_console("r_antialiasingmode=0") - general.idle_wait(1.0) - - - - # Test Teardown - # Restore everything from above - # log test results, exit editor - def teardown(self): - # Restore the original Editor settings - settings.set_misc_editor_settings(self.original_settings) - # If the helper gizmos were on at the start, restore them - if (self.helpers_visible): - general.toggle_helpers() - # Set the viewport back to whatever size it was at the start - general.set_viewport_size(self.viewport_size.x, self.viewport_size.y) - general.idle_wait(1.0) - - self.log('test finished') - - if self.test_success == True: - self.log('result=SUCCESS') - general.set_result_to_success() - else: - self.log('result=FAILURE') - general.set_result_to_failure() - - general.exit_no_prompt() - - def run_test(self): - self.log('run') - - def run(self): - self.setup() - - # Only run the actual test if we didn't have setup issues - if self.test_success: - self.run_test() - - self.teardown() - - def get_arg(self, arg_name): - if arg_name in self.args: - return self.args[arg_name] - return '' - - - # general logger that adds prefix? - def log(self, log_line): - general.log(self.log_prefix + log_line) - - # isclose: Compares two floating-point values for "nearly-equal" - # From https://www.python.org/dev/peps/pep-0485/#proposed-implementation : - def isclose(self, a, b, rel_tol=1e-9, abs_tol=0.0): - return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol) - - - # Create a new empty level - def create_level(self, level_name, heightmap_resolution, heightmap_meters_per_pixel, terrain_texture_resolution, use_terrain): - self.log('Creating level {}'.format(level_name)) - result = general.create_level_no_prompt(level_name, heightmap_resolution, heightmap_meters_per_pixel, terrain_texture_resolution, use_terrain) - - # Result codes are ECreateLevelResult defined in CryEdit.h - if (result == 1): - self.log('Temp level already exists') - elif (result == 2): - self.log('Failed to create directory') - elif (result == 3): - self.log('Directory length is too long') - elif (result != 0): - self.log('Unknown error, failed to create level') - else: - self.log('Level created successfully') - self.after_level_load() - - return (result == 0) - - def open_level(self, level_name): - # Open the level non-interactively - self.log('Opening level {}'.format(level_name)) - result = general.open_level_no_prompt(level_name) - self.after_level_load() - if result: - self.log('Level opened successfully') - else: - self.log('Unknown error, level failed to open') - - return result - - # Take Screenshot - def take_screenshot(self, posX, posY, posZ, rotX, rotY, rotZ): - # Set our camera position / rotation and wait for the Editor to acknowledge it - general.set_current_view_position(posX, posY, posZ) - general.set_current_view_rotation(rotX, rotY, rotZ) - general.idle_wait(1.0) - # Request a screenshot and wait for the Editor to process it - general.run_console("r_GetScreenShot=2") - general.idle_wait(1.0) - diff --git a/Tests/ai/LY_114727_NavigationComponent_test.py b/Tests/ai/LY_114727_NavigationComponent_test.py deleted file mode 100755 index 3eff39c787..0000000000 --- a/Tests/ai/LY_114727_NavigationComponent_test.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - - -""" -ly102242: Runs the ly-102242 level in the Editor which reproduces the appropriate steps for -bug ly-102242 to crash when spawning an invalid touchbending asset. The touchbending asset -can be made invalid by including multiple meshes - one with skinning data and one without. -NOTE: In the bugfixed case, a crash will not occur, but touchbending will not occur and errors -will be printed to the console every time a new asset gets "touched" (spawned in the physics system). -""" -import pytest -pytest.importorskip('ly_test_tools') -import logging -import os - -from ..ly_shared import hydra_lytt_test_utils as hydra_utils - -logger = logging.getLogger(__name__) -test_directory = os.path.join(os.path.dirname(__file__), 'EditorScripts') -editor_timeout = 30 - -@pytest.mark.parametrize('platform', ['win_x64_vs2017']) -@pytest.mark.parametrize('configuration', ['profile']) -@pytest.mark.parametrize('project', ['AutomatedTesting']) -@pytest.mark.parametrize('spec', ['all']) -@pytest.mark.parametrize('level', ['AI/NavigationComponentTest']) -class TestNavigationComponent(object): - @pytest.fixture(autouse=True) - def setup_teardown(self, request): - def teardown(): - if hasattr(self, 'cfg_file_name'): - hydra_utils.cleanup_cfg_file(self.cfg_file_name) - - # Setup - add the teardown finalizer - request.addfinalizer(teardown) - - # entities with Transform, Physics and Custom movement methods navigate to the goal - def test_NavigationComponent(self, request, legacy_editor, level): - - cfg_args = [level] - - expected_lines = [ - "OnActivate NavigationAgentCustom", - "OnActivate NavigationAgentPhysics", - "OnActivate NavigationAgentTransform", - - "OnTraversalComplete NavigationAgentCustom", - "OnTraversalComplete NavigationAgentPhysics", - "OnTraversalComplete NavigationAgentTransform", - ] - - unexpected_lines = [ - "OnTraversalCanceled NavigationAgentCustom", - "OnTraversalCanceled NavigationAgentPhysics", - "OnTraversalCanceled NavigationAgentTransform", - ] - - hydra_utils.launch_and_validate_results(request, test_directory, legacy_editor, - 'LY_114727_NavigationComponent_MovementMethods.py', - expected_lines, unexpected_lines, timeout=editor_timeout, cfg_args=cfg_args) - diff --git a/Tests/ai/__init__.py b/Tests/ai/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/ai/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/demos/__init__.py b/Tests/demos/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/demos/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/demos/launcher_loading_tests.py b/Tests/demos/launcher_loading_tests.py deleted file mode 100755 index 6d23f56f1b..0000000000 --- a/Tests/demos/launcher_loading_tests.py +++ /dev/null @@ -1,183 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -""" -import pytest -import ly_test_tools - -import os -import shutil -import subprocess -from ly_test_tools.builtin.helpers import * -import tempfile -import time -# The following imports are used to detect capabilities in the current system - -from ly_test_tools.environment.process_utils import * -import Tests.shared.asset_processor_utils as aputil - -# Built-in fixture: provides a ready to use workspace. -from Tests.shared import substring -from ly_test_tools.environment.waiter import wait_for - -LAUNCHER_TIMEOUT = 120 - - -@pytest.mark.system -class TestProjectLauncher: - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, launcher): - path_to_cache = workspace.paths.asset_cache() - # Remove previous artifacts from cache - if os.path.isdir(os.path.join(path_to_cache, "user")): - shutil.rmtree(os.path.join(path_to_cache, "user")) - - user_cfg_path = os.path.join(workspace.paths.dev(), "user.cfg") - cfg_staging_path = None - - # Backup user.cfg if one exists - if os.path.exists(user_cfg_path): - cfg_staging_path = os.path.join(tempfile.gettempdir(), "user.cfg") - shutil.move(user_cfg_path, cfg_staging_path) - - # Configure the headless client - with open(user_cfg_path, "w") as user_cfg: - user_cfg.write("r_driver=NULL\n") - user_cfg.write("sys_audio_disable=1\n") - user_cfg.write("sys_skip_input=1\n") - - def teardown(): - launcher.kill() - - aputil.kill_asset_processor() - - # Restore previous user.cfg if one existed and unconfigure the headless client - if cfg_staging_path: - shutil.move(os.path.join(tempfile.gettempdir(), "user.cfg"), user_cfg_path) - elif os.path.exists(user_cfg_path): - os.remove(user_cfg_path) - - # save logs,screenshots - if os.path.exists(workspace.paths.project_log()): - workspace.artifact_manager.save_artifact(workspace.paths.project_log()) - if os.path.isdir(workspace.paths.project_screenshots()): - workspace.artifact_manager.save_artifact(workspace.paths.project_screenshots()) - - request.addfinalizer(teardown) - - @pytest.mark.parametrize('level', ['Samples/Fur_Technical_Sample', 'Samples/Advanced_RinLocomotion', 'UI/UiFeatures','Samples/Simple_JackLocomotion', - 'Samples/ScriptedEntityTweenerSample/SampleFullscreenAnimation', 'UI/UiMainMenuLuaSample', 'Samples/Metastream_Sample', - 'Samples/ScriptCanvas_Sample/ScriptCanvas_Basic_Sample', 'UI/UiIn3DWorld', 'Samples/Audio_Sample']) - @pytest.mark.test_case_id('C1698289,C1698287,C1698294,C1698280,C1698295,C1698293,C1698289,C1698290,C1698292,C1698288') - @pytest.mark.parametrize('platform', ['win_x64_vs2017', 'win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile']) - @pytest.mark.parametrize('project', ['SamplesProject']) - @pytest.mark.parametrize('spec', ['all']) - def test_LaunchAndWait_LoadsLevelAndQuit_NoCrash(self, workspace, level, launcher): - """ - Launch the Project Launcher and sets the specified level. - Performs the console steps by passing in args. - Loads the specified level and quit's the launcher. - """ - # Fast fail if the level doesn't exist - assert os.path.exists(os.path.join(workspace.paths.project(), "Levels", level)) and os.path.isdir( - os.path.join(workspace.paths.project(), "Levels", level)), "Level Doesn't Exist" - - launcher.args = ["+map", level] - launcher.launch() - - pattern_string = "Loading level " + level - test = os.path.join(workspace.paths.project_log(), "Game.log") - wait_for(lambda: os.path.exists(os.path.join(workspace.paths.project_log(), "Game.log"))) - wait_for(lambda: substring.in_file( - os.path.join(workspace.paths.project_log(), "Game.log"), pattern_string), LAUNCHER_TIMEOUT) - assert not os.path.exists( - os.path.join(workspace.paths.project_log(), "error.log")), "Launcher Crashed Unexpectedly" - - # This is a convenient place to also verify LY-90255 for free here - # (as well as any other text that must appear in the log). - # writing a separate test to launch the launcher and examine the log would just waste time as the - # above test already launches the launcher, and waits for it to finish anyway. - - assert substring.in_file(os.path.join(workspace.paths.project_log(), "Game.log"), "Initializing CryFont done, MemUsage") - - - - @pytest.mark.parametrize('level',['UI/UiFeatures','Samples/Metastream_Sample']) - @pytest.mark.parametrize('platform', ['win_x64_vs2017', 'win_x64_vs2019']) - @pytest.mark.parametrize('configuration', ['profile']) - @pytest.mark.parametrize('project', ['SamplesProject']) - @pytest.mark.parametrize('spec', ['all']) - def test_LaunchAndWait_LoadsLevelFromPakAndQuit_NoCrash(self, workspace, level, launcher): - """ - This test ensure that the Launcher can load levels from inside paks - """ - - if workspace.platform == 'win_x64_vs2017': - binDirPath = os.path.join(workspace.paths._dev_path, 'Bin64vc141') - if workspace.platform == 'win_x64_vs2019': - binDirPath = os.path.join(workspace.paths._dev_path, 'Bin64vc142') - - # Launch APBatch so that it can process all assets and quit - subprocess.check_call( - [os.path.join(binDirPath, 'AssetProcessorBatch'), "/gamefolder=SamplesProject"]) - - lowercaseProjectName = workspace.project.lower() - cacheLevelDir = os.path.join(workspace.paths.platform_cache(), lowercaseProjectName, "levels") - cacheTempLevelDir = os.path.join(workspace.paths.platform_cache(), lowercaseProjectName, "templevels") - - # Rename levels dir so that runtime cannot load levels from it - os.rename(cacheLevelDir, cacheTempLevelDir) - # Make an empty levels folder - os.mkdir(cacheLevelDir) - - # make an archive of all the levels - outputLevelsArchive = os.path.join(cacheLevelDir, "templevels") - shutil.make_archive(outputLevelsArchive, 'zip', cacheTempLevelDir) - # make archive will make a zip file - outputLevelsArchive = outputLevelsArchive + ".zip" - - # change extension from zip to pak - baseFileName = os.path.splitext(outputLevelsArchive)[0] - os.rename(outputLevelsArchive, baseFileName + ".pak") - - # Launching AP again for SamplesProject gameproject - subprocess.Popen([os.path.join(binDirPath, 'AssetProcessor'), "/gamefolder=SamplesProject", "--zeroAnalysisMode"]) - - # Waiting to give AP time some time to start the listening thread otherwise the launcher will try to launch another instance of AP - time.sleep(1) - - # ensure that in the cache level does not exist on disk - assert not os.path.exists(os.path.join(cacheLevelDir, level)) - - # load the levels - launcher.args = ["+map", level] - launcher.launch() - - pattern_string = "Loading level " + level - wait_for(lambda: os.path.exists(os.path.join(workspace.paths.project_log(), "Game.log"))) - wait_for(lambda: substring.in_file( - os.path.join(workspace.paths.project_log(), "Game.log"), pattern_string), LAUNCHER_TIMEOUT) - assert not os.path.exists( - os.path.join(workspace.paths.project_log(), "error.log")), "Launcher Crashed Unexpectedly" - - loaded_level_pattern = "Level " + level + " loaded" - wait_for(lambda: substring.in_file( - os.path.join(workspace.paths.project_log(), "Game.log"), loaded_level_pattern), LAUNCHER_TIMEOUT) - - launcher.stop() - - aputil.kill_asset_processor() - - shutil.rmtree(cacheLevelDir) - os.rename(cacheTempLevelDir, cacheLevelDir) - - - diff --git a/Tests/demos/mac/__init__.py b/Tests/demos/mac/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/demos/mac/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/demos/mac/demos_mac.py b/Tests/demos/mac/demos_mac.py deleted file mode 100755 index a2a44eab20..0000000000 --- a/Tests/demos/mac/demos_mac.py +++ /dev/null @@ -1,142 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -These tests will validate that StarterGame and SamplesProject can be setup and built, have no failing assets processed, -and will then have a screen shot taken to verify that it renders normally. All the logs and screenshots will be -transferred to the test results to be zipped up and added to the Flume result. These projects will be run in profile -and debug. -""" -import logging -import os -import pytest - -from demos.test_lib.demos_testlib import load_level, remote_console_take_screenshot, start_launcher, start_remote_console -import shared.shader_compile_server_utils as compile_server -import test_tools.shared.file_utils as file_utils -from test_tools.shared.launcher_testlib import configure_setup, assert_build_success, assert_process_assets - -import test_tools.builtin.fixtures as fixtures -from test_tools import MAC_LAUNCHER -import test_tools.launchers.phase -from test_tools.shared.remote_console_commands import RemoteConsole - -logger = logging.getLogger(__name__) - -workspace = fixtures.use_fixture(fixtures.builtin_workspace_fixture, scope='function') - - -@pytest.fixture -def launcher_instance(request, workspace, level): - """ - Creates a launcher fixture instance with an extra teardown for error log grabbing. - """ - def teardown(): - """ - Tries to grab any error logs before moving on to the next test. - """ - compile_server.stop_shader_compile_server() - - if os.path.exists(launcher.workspace.release.paths.project_log()): - for file_name in os.listdir(launcher.workspace.release.paths.project_log()): - file_utils.move_file(launcher.workspace.release.paths.project_log(), - launcher.workspace.artifact_manager.get_save_artifact_path(), - file_name) - - logs_exist = lambda: file_utils.gather_error_logs( - launcher.workspace.release.paths.dev(), - launcher.workspace.artifact_manager.get_save_artifact_path()) - try: - test_tools.shared.waiter.wait_for(logs_exist) - except AssertionError: - print("No error logs found. Completing test...") - - request.addfinalizer(teardown) - - launcher = fixtures.launcher(request, workspace, level) - return launcher - - -@pytest.fixture -def remote_console_instance(request): - """ - Creates a remote console instance to send console commands. - """ - console = RemoteConsole() - - def teardown(): - try: - console.stop() - except: - pass - - request.addfinalizer(teardown) - - return console - - -@pytest.mark.parametrize("platform,configuration,project,spec,level", [ - pytest.param("darwin_x64", "profile", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not MAC_LAUNCHER, reason="Only supported on Mac hosts")), - pytest.param("darwin_x64", "debug", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not MAC_LAUNCHER, reason="Only supported on Mac hosts")), - ]) -class TestSingleLevel(object): - def test_single_level(self, launcher_instance, configuration, level, remote_console_instance): - """ - Verifies projects with a given demo-level can compile and successfully launch. - """ - configure_setup(launcher_instance) - - assert_build_success(launcher_instance) - assert_process_assets(launcher_instance) - - compile_server.start_mac_shader_compile_server(os.path.join(launcher_instance.workspace.release.paths.dev(), - "Tools"), configuration) - start_launcher(launcher_instance) - start_remote_console(launcher_instance, remote_console_instance) - - load_level(launcher_instance, remote_console_instance, level) - remote_console_take_screenshot(launcher_instance, remote_console_instance, level) - - -@pytest.mark.parametrize("platform,configuration,project,spec,level,levels", [ - pytest.param("darwin_x64", "profile", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", - "Gems_InAppPurchases_Sample", "Metastream_Sample", "ScriptCanvas_Basic_Sample", - "Simple_JackLocomotion", "SampleFullscreenAnimation", "UiFeatures", "UiIn3DWorld", - "UiMainMenuLuaSample", "UiMainMenuScriptCanvasSample"], - marks=pytest.mark.skipif(not MAC_LAUNCHER, reason="Only supported on Mac hosts")), - pytest.param("darwin_x64", "debug", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", - "Gems_InAppPurchases_Sample", "Metastream_Sample", "ScriptCanvas_Basic_Sample", - "Simple_JackLocomotion", "SampleFullscreenAnimation", "UiFeatures", "UiIn3DWorld", - "UiMainMenuLuaSample", "UiMainMenuScriptCanvasSample"], - marks=pytest.mark.skipif(not MAC_LAUNCHER, reason="Only supported on Mac hosts")), - ]) -# Testing for projects with multiple demo levels -class TestMultipleLevels(object): - """ - Verifies projects with multiple demo-levels can compile and successfully launch. - """ - def test_multiple_levels(self, launcher_instance, configuration, levels, remote_console_instance): - configure_setup(launcher_instance) - - assert_build_success(launcher_instance) - assert_process_assets(launcher_instance) - - compile_server.start_mac_shader_compile_server(os.path.join(launcher_instance.workspace.release.paths.dev(), - "Tools"), configuration) - start_launcher(launcher_instance) - start_remote_console(launcher_instance, remote_console_instance) - - # Switch to each level, check if it loads and takes a screen shot, then move to test folder for Flume - for level in levels: - load_level(launcher_instance, remote_console_instance, level) - remote_console_take_screenshot(launcher_instance, remote_console_instance, level) diff --git a/Tests/demos/test_lib/__init__.py b/Tests/demos/test_lib/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/demos/test_lib/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/demos/test_lib/demos_testlib.py b/Tests/demos/test_lib/demos_testlib.py deleted file mode 100755 index 46ed627cab..0000000000 --- a/Tests/demos/test_lib/demos_testlib.py +++ /dev/null @@ -1,70 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -This demos_testlib file is used for a collection of reusable functionality that QA will use in their scripts specific -to the setup of demo level tests. -""" -import sys - -import shared.network_utils as network_utils -from shared.screenshot_utils import move_screenshots, take_screenshot_with_retries - -from test_tools.shared.launcher_testlib import * - -import test_tools.shared.waiter - - -def start_launcher(launcher): - """ - For PC: Used to start launcher and give time to load. - """ - launcher.launch() - launcher.run(test_tools.launchers.phase.TimePhase(120, 120)) - - -def load_level(launcher, remote_console, level): - """ - Uses the remote console to use the map command to load a level and checks the console output for a successful load. - """ - command = 'map {}'.format(level) - load = remote_console.expect_log_line('LEVEL_LOAD_COMPLETE', 300) - retry_console_command(remote_console, command, "Executing console command '{}'".format(command)) - assert load(), "{} level failed to load.".format(level) - - # Allow one minute to let level fully render and to test for stability - launcher.run(test_tools.launchers.phase.TimePhase(60, 60)) - - -def start_remote_console(launcher, remote_console, on_devkit=False): - """ - Starts the remote console. Used in QA scripts that require the use of remote console. - """ - if on_devkit: - test_tools.shared.waiter.wait_for(lambda: network_utils.check_for_remote_listening_port(4600, launcher.ip), - timeout=600, exc=AssertionError('Port 4600 not listening.')) - else: - test_tools.shared.waiter.wait_for(lambda: network_utils.check_for_listening_port(4600), timeout=300, - exc=AssertionError('Port 4600 not listening.')) - - remote_console.start() - - # Allows remote console time to connect to launcher. - launcher.run(test_tools.launchers.phase.TimePhase(60, 60)) - - -def remote_console_take_screenshot(launcher, remote_console, level): - """ - Uses the remote console to run the r_GetScreenshot command to take a screenshot of the current launcher and move - the screenshot to the test results location. - """ - screenshot_path = os.path.join(launcher.workspace.release.paths.platform_cache(), "user", "screenshots") - take_screenshot_with_retries(remote_console, launcher, level) - if os.path.exists(screenshot_path): - move_screenshots(screenshot_path, '.jpg', launcher.workspace.artifact_manager.get_save_artifact_path()) diff --git a/Tests/demos/win/demos_pc.py b/Tests/demos/win/demos_pc.py deleted file mode 100755 index cb8b9a0e4b..0000000000 --- a/Tests/demos/win/demos_pc.py +++ /dev/null @@ -1,151 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -These tests will validate that each project can be setup and built, have no failing assets processed, and will then -have a screenshot taken to verify that it renders normally. All the logs and screenshots will be transferred to the -test results to be zipped up and added to the Flume result. These projects will be run in profile and debug. -Currently SearchForEden and Bistro are failing and are temporarily commented out of these tests. -""" -import logging -import os -import pytest - -from demos.test_lib.demos_testlib import load_level, remote_console_take_screenshot, start_launcher, start_remote_console -from test_tools.shared.file_utils import gather_error_logs, move_file -from test_tools.shared.launcher_testlib import configure_setup, assert_build_success, assert_process_assets - -from test_tools import WINDOWS_LAUNCHER -import test_tools.builtin.fixtures as fixtures -import test_tools.launchers.phase -from test_tools.shared.remote_console_commands import RemoteConsole - -logger = logging.getLogger(__name__) - -# use_fixture registers the imported fixture in pytest at the specified scope. The test should provide all the -# parameters in the fixture's signature -workspace = fixtures.use_fixture(fixtures.builtin_workspace_fixture, scope='function') - - -@pytest.fixture -def launcher_instance(request, workspace, level): - """ - Creates a launcher fixture instance with an extra teardown for error log grabbing. - """ - def teardown(): - """ - Tries to grab any error logs before moving on to the next test. - """ - if os.path.exists(launcher.workspace.release.paths.project_log()): - for file_name in os.listdir(launcher.workspace.release.paths.project_log()): - move_file(launcher.workspace.release.paths.project_log(), - launcher.workspace.artifact_manager.get_save_artifact_path(), - file_name) - - logs_exist = lambda: gather_error_logs( - launcher.workspace.release.paths.dev(), - launcher.workspace.artifact_manager.get_save_artifact_path()) - try: - test_tools.shared.waiter.wait_for(logs_exist) - except AssertionError: - print("No error logs found. Completing test...") - - request.addfinalizer(teardown) - - launcher = fixtures.launcher(request, workspace, level) - return launcher - - -@pytest.fixture -def remote_console_instance(request): - """ - Creates a remote console instance to send console commands. - """ - console = RemoteConsole() - - def teardown(): - try: - console.stop() - except: - pass - - request.addfinalizer(teardown) - - return console - - -@pytest.mark.parametrize("platform,configuration,project,spec,level", [ - pytest.param("win_x64_vs2017", "profile", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2019", "profile", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2017", "debug", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2019", "debug", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - ]) -class TestSingleLevel(object): - def test_single_level(self, launcher_instance, level, remote_console_instance): - """ - Verifies projects with a given demo-level can compile and successfully launch. - """ - configure_setup(launcher_instance) - - assert_build_success(launcher_instance) - assert_process_assets(launcher_instance) - - start_launcher(launcher_instance) - start_remote_console(launcher_instance, remote_console_instance) - - load_level(launcher_instance, remote_console_instance, level) - remote_console_take_screenshot(launcher_instance, remote_console_instance, level) - - -@pytest.mark.parametrize("platform,configuration,project,spec,level,levels", [ - pytest.param("win_x64_vs2017", "profile", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", "Gems_InAppPurchases_Sample", - "Metastream_Sample", "ScriptCanvas_Basic_Sample", "Simple_JackLocomotion", - "SampleFullscreenAnimation", "UiDrawCallsSample", "UiFeatures", "UiIn3DWorld", "UiMainMenuLuaSample", - "UiMainMenuScriptCanvasSample", "UiTextureAtlasSample"], - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2019", "profile", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", "Gems_InAppPurchases_Sample", - "Metastream_Sample", "ScriptCanvas_Basic_Sample", "Simple_JackLocomotion", - "SampleFullscreenAnimation", "UiDrawCallsSample", "UiFeatures", "UiIn3DWorld", "UiMainMenuLuaSample", - "UiMainMenuScriptCanvasSample", "UiTextureAtlasSample"], - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2017", "debug", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", "Gems_InAppPurchases_Sample", - "Metastream_Sample", "ScriptCanvas_Basic_Sample", "Simple_JackLocomotion", - "SampleFullscreenAnimation", "UiDrawCallsSample", "UiFeatures", "UiIn3DWorld", "UiMainMenuLuaSample", - "UiMainMenuScriptCanvasSample", "UiTextureAtlasSample"], - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2019", "debug", "SamplesProject", "all", "Advanced_RinLocomotion", - ["Advanced_RinLocomotion", "Audio_Sample", "Fur_Technical_Sample", "Gems_InAppPurchases_Sample", - "Metastream_Sample", "ScriptCanvas_Basic_Sample", "Simple_JackLocomotion", - "SampleFullscreenAnimation", "UiDrawCallsSample", "UiFeatures", "UiIn3DWorld", "UiMainMenuLuaSample", - "UiMainMenuScriptCanvasSample", "UiTextureAtlasSample"], - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")) - ]) -class TestMultipleLevels(object): - def test_multiple_levels(self, launcher_instance, levels, remote_console_instance): - """ - Verifies projects with multiple demo-levels can compile and successfully launch. - """ - configure_setup(launcher_instance) - - assert_build_success(launcher_instance) - assert_process_assets(launcher_instance) - - start_launcher(launcher_instance) - start_remote_console(launcher_instance, remote_console_instance) - - for level in levels: - load_level(launcher_instance, remote_console_instance, level) - remote_console_take_screenshot(launcher_instance, remote_console_instance, level) diff --git a/Tests/graphics/ly107748_LightningArcProperties.cfg b/Tests/graphics/ly107748_LightningArcProperties.cfg deleted file mode 100644 index fe05f5f782..0000000000 --- a/Tests/graphics/ly107748_LightningArcProperties.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# this file is copied to $/dev/editor_autoexec.cfg so the the Editor automation runs for this Hydra test -pyRunFile @devroot@/Tests/graphics/ly107748_LightningArcProperties_test_case.py \ No newline at end of file diff --git a/Tests/graphics/ly107748_LightningArcProperties_test.py b/Tests/graphics/ly107748_LightningArcProperties_test.py deleted file mode 100755 index 59cc3d8d1b..0000000000 --- a/Tests/graphics/ly107748_LightningArcProperties_test.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# -# This is a pytest module to test the in-Editor Python API from PythonEditorFuncs -# -import pytest -pytest.importorskip('test_tools') -import time -import logging -import os -import shutil - -from test_tools import WINDOWS_LAUNCHER -import test_tools.shared.log_monitor -import test_tools.launchers.phase -import test_tools.builtin.fixtures as fixtures - -# Use the built-in workspace and editor fixtures. -# These will configure the requested project and run the editor. -workspace = fixtures.use_fixture(fixtures.builtin_workspace_fixture, scope='function') -editor = fixtures.use_fixture(fixtures.editor, scope='function') - -logger = logging.getLogger(__name__) - - -@pytest.mark.parametrize("platform,configuration,project,spec", [ - pytest.param("win_x64_vs2017", "profile", "AutomatedTesting", "all", marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), -]) -class TestLightningArcPropertyRanges(object): - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, workspace, editor): - def teardown(): - editor.ensure_stopped() - - file_utils.delete_level(editor, "LightningArcTestLevel") - - request.addfinalizer(teardown) - - def test_change_properties(self, request, editor, project): - logger.debug("Running automated test") - - request.addfinalizer(editor.ensure_stopped) - - editor.deploy() - editor.launch(["--exec", "@engroot@/Tests/graphics/ly107748_LightningArcProperties.cfg"]) - - editorlog_file = os.path.join(editor.workspace.release.paths.project_log(), 'Editor.log') - - # LY-107861 LY-108088 - # expected failure cases are commented out pending implementation of property validation by hydra - expected_lines = [ - "Created new entity.", - "Lightning Arc component added to entity.", - #"ChangeProperty m_config|Arc Parameters|Segment Count to 0 failed.", - "ChangeProperty m_config|Arc Parameters|Segment Count to 1 succeeded.", - "ChangeProperty m_config|Arc Parameters|Segment Count to 25 succeeded.", - "ChangeProperty m_config|Arc Parameters|Segment Count to 50 succeeded.", - "ChangeProperty m_config|Arc Parameters|Segment Count to 70 succeeded.", - #"ChangeProperty m_config|Arc Parameters|Segment Count to 75 failed.", - #"ChangeProperty m_config|Arc Parameters|Segment Count to 100 failed.", - #"ChangeProperty m_config|Arc Parameters|Point Count to 0 failed.", - "ChangeProperty m_config|Arc Parameters|Point Count to 1 succeeded.", - "ChangeProperty m_config|Arc Parameters|Point Count to 25 succeeded.", - "ChangeProperty m_config|Arc Parameters|Point Count to 50 succeeded.", - "ChangeProperty m_config|Arc Parameters|Point Count to 70 succeeded.", - #"ChangeProperty m_config|Arc Parameters|Point Count to 75 failed.", - #"ChangeProperty m_config|Arc Parameters|Point Count to 100 failed.", - ] - - test_tools.shared.log_monitor.monitor_for_expected_lines(editor, editorlog_file, expected_lines) - - # Rely on the test script to quit after running - editor.run(test_tools.launchers.phase.WaitForLauncherToQuit(editor, 10)) diff --git a/Tests/graphics/ly107748_LightningArcProperties_test_case.py b/Tests/graphics/ly107748_LightningArcProperties_test_case.py deleted file mode 100755 index dd0c72e893..0000000000 --- a/Tests/graphics/ly107748_LightningArcProperties_test_case.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# Tests a portion of the Component Property Get/Set Python API while the Editor is running - -import azlmbr.legacy.general as general -import azlmbr.bus as bus -import azlmbr.entity as entity -import azlmbr.editor as editor -import azlmbr.math as math - - -# Create a test level -general.create_level_no_prompt("LightningArcTestLevel", 1024, 1, 1024, True) - -def ChangeProperty(component, path, value): - getPropertyOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, path) - if not(getPropertyOutcome.IsSuccess()): - print("GetComponentProperty " + path + " failed.") - else: - oldValue = getPropertyOutcome.GetValue() - - setPropertyOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'SetComponentProperty', component, path, value) - if not(setPropertyOutcome.IsSuccess()): - print("SetComponentProperty " + path + " to " + str(value) + " failed.") - - getPropertyOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, path) - if not(getPropertyOutcome.IsSuccess()): - print("GetComponentProperty " + path + " failed.") - else: - newValue = getPropertyOutcome.GetValue() - - if not(newValue == oldValue): - print("ChangeProperty " + path + " to " + str(value) + " succeeded.") - else: - print("ChangeProperty " + path + " to " + str(value) + " failed.") - -# Create new Entity -entityId = editor.ToolsApplicationRequestBus(bus.Broadcast, 'CreateNewEntity', entity.EntityId()) - -if (entityId.IsValid()): - print("Created new entity.") - -# Get Component Type for Lightning Arc -typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', ["Lightning Arc"], entity.EntityType().Game) - -componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entityId, typeIdsList) - -if (componentOutcome.IsSuccess()): - print("Lightning Arc component added to entity.") - -components = componentOutcome.GetValue() -component = components[0] - -# Tests for GetComponentProperty/SetComponentProperty -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 0) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 1) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 25) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 50) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 70) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 75) -ChangeProperty(component, "m_config|Arc Parameters|Segment Count", 100) - -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 0) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 1) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 25) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 50) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 70) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 75) -ChangeProperty(component, "m_config|Arc Parameters|Point Count", 100) - -general.exit_no_prompt() diff --git a/Tests/hydra/ctests/open_level_tweak_and_exit.py b/Tests/hydra/ctests/open_level_tweak_and_exit.py deleted file mode 100755 index de81327852..0000000000 --- a/Tests/hydra/ctests/open_level_tweak_and_exit.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\open_level_tweak_and_exit.py -# An example of how a create a level, make an entity, and terminate successfully - -import time -import azlmbr.editor -import azlmbr.entity -import azlmbr.framework -import azlmbr.legacy.general as general -from azlmbr.bus import Broadcast - -handler = None - -def open_level(level): - print('opening level {}'.format(level)) - azlmbr.editor.EditorToolsApplicationRequestBus(Broadcast, 'OpenLevelNoPrompt', level) - general.idle_wait(1.0) - -def on_entity_registered(args): - print('on_entity_registered') - azlmbr.framework.Terminate(0) - -def main(): - print ('open_level_tweak_and_exit - starting') - open_level('auto_test') - - azlmbr.editor.ToolsApplicationRequestBus(Broadcast, 'CreateNewEntity', azlmbr.entity.EntityId()) - general.idle_wait(1.0) - - handler = azlmbr.editor.ToolsApplicationNotificationBusHandler() - handler.connect() - handler.add_callback('EntityRegistered', on_entity_registered) - azlmbr.editor.ToolsApplicationRequestBus(Broadcast, 'CreateNewEntity', azlmbr.entity.EntityId()) - -if __name__ == "__main__": - main() diff --git a/Tests/hydra/ctests/start_stop.py b/Tests/hydra/ctests/start_stop.py deleted file mode 100755 index c8fd670a97..0000000000 --- a/Tests/hydra/ctests/start_stop.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\start_stop.py -# an example of a test script that loads a level, listens for the first entity, and terminates the Editor with a 0 - -import azlmbr.framework -import azlmbr.editor -import azlmbr.bus - -handler = None - -def on_entity_registered(args): - print('on_entity_registered') - azlmbr.framework.Terminate(0) - -def main(): - print ('hello, start_stop') - handler = azlmbr.editor.ToolsApplicationNotificationBusHandler() - handler.connect() - handler.add_callback('EntityRegistered', on_entity_registered) - azlmbr.editor.EditorToolsApplicationRequestBus(azlmbr.bus.Broadcast, 'OpenLevelNoPrompt', 'auto_test') - print ('start_stop started') - -if __name__ == "__main__": - main() diff --git a/Tests/hydra/ctests/start_with_args.py b/Tests/hydra/ctests/start_with_args.py deleted file mode 100755 index e8b99b54ac..0000000000 --- a/Tests/hydra/ctests/start_with_args.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\start_with_args.py --runpythonargs foo bar baz -# An example of how to use runpythontest with a main() + args - -import azlmbr.framework - -def main(): - print("hello, start_with_args") - - # print command line arguments - for arg in sys.argv: - print (arg) - - azlmbr.framework.Terminate(0) - -if __name__ == "__main__": - main() - diff --git a/Tests/hydra/ctests/stop_with_error_one.py b/Tests/hydra/ctests/stop_with_error_one.py deleted file mode 100755 index b17b5247aa..0000000000 --- a/Tests/hydra/ctests/stop_with_error_one.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\stop_with_error_one.py -# an example terminating with a non-zero return code from Editor.exe - -import azlmbr.framework -print ('hello, stop_with_error_one') -azlmbr.framework.Terminate(1) diff --git a/Tests/hydra/ctests/stop_with_zero.py b/Tests/hydra/ctests/stop_with_zero.py deleted file mode 100755 index d1d3f4f58d..0000000000 --- a/Tests/hydra/ctests/stop_with_zero.py +++ /dev/null @@ -1,17 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\stop_with_zero.py -# An example of how a test script stops the Editor.exe with a succuessful zero return code - -import azlmbr.framework -print ('hello, stop_with_zero') -azlmbr.framework.Terminate(0) diff --git a/Tests/hydra/ctests/throws_exception.py b/Tests/hydra/ctests/throws_exception.py deleted file mode 100755 index e8b4507fb1..0000000000 --- a/Tests/hydra/ctests/throws_exception.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -# --runpythontest @devroot@\tests\hydra\ctests\throws_exception.py -# An example of how a test script to fatal from Editor.exe when a Python exception happens - -print ('hello, throws_exception') -foo = 1.0 -bar = 0.0 -baz = foo / bar - diff --git a/Tests/ly_shared/PlatformSetting.py b/Tests/ly_shared/PlatformSetting.py deleted file mode 100755 index b215275c16..0000000000 --- a/Tests/ly_shared/PlatformSetting.py +++ /dev/null @@ -1,69 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Class for querying and setting a system setting/preference. - -""" - -import pytest -import logging -from typing import Optional, Any - -import ly_test_tools.o3de.pipeline_utils as utils - -logger = logging.getLogger(__name__) - - -class PlatformSetting: - """ - Interface for managing different platforms' system variables. - """ - - class DATA_TYPE: - """Platform-agnostic data type enums""" - - INT = 1 - STR = 2 - STR_LIST = 3 - - def __init__(self, workspace: pytest.fixture, subkey: str, key: str) -> None: - self._workspace = workspace - self._key = key - self._subkey = subkey - - def get_value(self, get_type: bool = False) -> object: - """Gets the current setting's value (and optionally type as tuple) from the system. Returns None if entry DNE""" - raise NotImplementedError("Virtual PlatformSetting not implemented. Instantiate a specific platform") - - def set_value(self, value: any) -> bool: - """Sets the current setting's value. Creates the entry if it DNE. Returns True for success.""" - raise NotImplementedError("Virtual PlatformSetting not implemented. Instantiate a specific platform") - - def delete_entry(self) -> bool: - """Deletes the settings entry. Returns boolean for success.""" - raise NotImplementedError("Virtual PlatformSetting not implemented. Instantiate a specific platform") - - def entry_exists(self) -> bool: - """Checks if the settings entry exists.""" - raise NotImplementedError("Virtual PlatformSetting not implemented. Instantiate a specific platform") - - @staticmethod - def get_system_setting(workspace: pytest.fixture, subkey: str, key: str, hive: Optional[str] = None) -> Any: - """Factory method creates a platform-specific system setting accessor""" - if workspace.asset_processor_platform is 'windows': - # import WindowsSetting and return an instance - from Tests.ly_shared.WindowsRegistrySetting import WindowsRegistrySetting - - return WindowsRegistrySetting(workspace, subkey, key, hive) - # ######################################################## - # Insert Mac (and Linux?) Setting implementations - # ######################################################## - else: - raise NotImplementedError(f"Platform: {workspace.platform} not supported yet") diff --git a/Tests/ly_shared/PlatformSettingTest.py b/Tests/ly_shared/PlatformSettingTest.py deleted file mode 100755 index f0ef8b6d1a..0000000000 --- a/Tests/ly_shared/PlatformSettingTest.py +++ /dev/null @@ -1,92 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Tests the functionality of the PlatformSetting class -""" - -import pytest - -import ly_test_tools.builtin.helpers as helpers -from Tests.ly_shared.PlatformSetting import PlatformSetting - -all_platforms = helpers.all_host_platforms_params() -automatic_platform_skipping = helpers.automatic_platform_skipping -targetProjects = ["Helios"] - - -@pytest.mark.usefixtures("automatic_platform_skipping") -@pytest.mark.parametrize("platform", all_platforms) -@pytest.mark.parametrize("configuration", ["profile"]) -@pytest.mark.parametrize("spec", ["all"]) -@pytest.mark.parametrize("project", targetProjects) -class TestsPlatformSetting(object): - """ - Tests for the PlatformSetting class - """ - - def test_PlatformSetting(self, workspace): - - key = "Software" - subkey = "TemporarySystemSetting" - - # Create setting reference - setting = PlatformSetting.get_system_setting(workspace, subkey, key) - - # Test storing integer - value = 74 - setting.set_value(value) - - # Test creation of subkey - assert setting.entry_exists(), f"Failed creating key:subkey, {key}:{subkey}" - - # Test data retrieval (without type) - retrieved = setting.get_value() - # fmt:off - assert retrieved == value, \ - f"Unexpected value retrieved from system settings. Expected: {value}, Actual: {retrieved}" - # fmt:on - - # Test data retrieval (with type) - retrieved = setting.get_value(get_type=True) - assert type(retrieved) == tuple, "Getting value with type DID NOT return a tuple" - assert len(retrieved) == 2, f"Getting value with type returned a tuple of size {len(retrieved)}: expected 2" - assert retrieved[1] == PlatformSetting.DATA_TYPE.INT, "Value stored was int, but type retrieved was NOT int" - assert type(retrieved[0]) == int, "Value stored was int, but value retrieved was NOT int" - - # fmt:off - assert retrieved[0] == value, \ - f"Unexpected value retrieved from system settings. Expected: {value}, Actual: {retrieved[0]}" - # fmt:on - - # Test storing string - value = "Some Text" - setting.set_value(value) - retrieved = setting.get_value(get_type=True) - assert ( - retrieved[1] == PlatformSetting.DATA_TYPE.STR - ), "Value stored was string, but type retrieved was NOT string" - assert type(retrieved[0]) == str, "Value stored was string, but value retrieved was NOT string" - assert value == retrieved[0], f"Value retrieved not expected. Expected: {value}, Actual: {retrieved[0]}" - - # Test storing list of strings - value = ["Some", "List", "Of", "Text"] - setting.set_value(value) - retrieved = setting.get_value(get_type=True) - assert ( - retrieved[1] == PlatformSetting.DATA_TYPE.STR_LIST - ), "Value stored was string list, but type retrieved was NOT string list" - assert type(retrieved[0]) == list, "Value stored was string, but value retrieved was NOT string" - # fmt:off - assert sorted(value) == sorted(retrieved[0]), f"Value retrieved not expected. " \ - f"Expected: {value}, Actual: {retrieved[0]}" - # fmt:on - - setting.delete_entry() - assert not setting.entry_exists(), f"Failed to delete key:subkey, {key}:{subkey}" diff --git a/Tests/ly_shared/WindowsRegistrySetting.py b/Tests/ly_shared/WindowsRegistrySetting.py deleted file mode 100755 index c1aa4e4a98..0000000000 --- a/Tests/ly_shared/WindowsRegistrySetting.py +++ /dev/null @@ -1,165 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Class for querying and setting a windows registry setting. - -""" -import pytest -import logging -from typing import List, Optional, Tuple, Any - -from winreg import ( - CreateKey, - OpenKey, - QueryValueEx, - DeleteValue, - SetValueEx, - KEY_ALL_ACCESS, - KEY_WRITE, - REG_SZ, - REG_MULTI_SZ, - REG_DWORD, - HKEY_CURRENT_USER, -) - - -from Tests.ly_shared.PlatformSetting import PlatformSetting - -logger = logging.getLogger(__name__) - - -class WindowsRegistrySetting(PlatformSetting): - def __init__(self, workspace: pytest.fixture, subkey: str, key: str, hive: Optional[str] = None) -> None: - super().__init__(workspace, subkey, key) - self._hive = None - try: - if hive is not None: - self._hive = self._str_to_hive(hive) - except ValueError: - logger.warning(f"Windows Registry Hive {hive} not recognized, using default: HKEY_CURRENT_USER") - finally: - if self._hive is None: - self._hive = HKEY_CURRENT_USER - - def get_value(self, get_type: Optional[bool] = False) -> Any: - """Retrieves the fast scan value in Windows registry (and optionally the type). If entry DNE, returns None.""" - if self.entry_exists(): - registryKey = OpenKey(self._hive, self._key) - value = QueryValueEx(registryKey, self._subkey) - registryKey.Close() - # Convert windows data type to universal data type flag: PlatformSettings.DATA_TYPE - # And handles unicode conversion for strings - value = self._convert_value(value) - return value if get_type else value[0] - - else: - logger.warning(f"Could not retrieve Registry entry; key: {self._key}, subkey: {self._subkey}.") - return None - - def set_value(self, value: Any) -> bool: - """Sets the Windows registry value.""" - value, win_type = self._format_data(value) - registryKey = None - result = False - try: - CreateKey(self._hive, self._subkey) - registryKey = OpenKey(self._hive, self._key, 0, KEY_WRITE) - SetValueEx(registryKey, self._subkey, 0, win_type, value) - result = True - except WindowsError as e: - logger.warning(f"Windows error caught while setting fast scan registry: {e}") - finally: - if registryKey is not None: - # Close key if it's been opened successfully - registryKey.Close() - return result - - def delete_entry(self) -> bool: - """Deletes the Windows registry entry for fast scan enabled""" - try: - if self.entry_exists(): - registryKey = OpenKey(self._hive, self._key, 0, KEY_ALL_ACCESS) - DeleteValue(registryKey, self._subkey) - registryKey.Close() - return True - except WindowsError: - logger.error(f"Could not delete registry entry; key: {self._key}, subkey: {self._subkey}") - finally: - return False - - def entry_exists(self) -> bool: - """Checks for existence of the setting in Windows registry.""" - try: - # Attempt to open and query key. If fails then the entry DNE - registryKey = OpenKey(self._hive, self._key) - QueryValueEx(registryKey, self._subkey) - registryKey.Close() - return True - - except WindowsError: - return False - - @staticmethod - def _format_data(value: bool or int or str or List[str]) -> Tuple[int or str or List[str], int]: - """Formats the type of the value provided. Returns the formatted value and the windows registry type (int).""" - if type(value) == str: - return value, REG_SZ - elif type(value) == bool: - value = "true" if value else "false" - return value, REG_SZ - elif type(value) == int or type(value) == float: - if type(value) == float: - logger.warning(f"Windows registry does not support floats. Truncating {value} to integer") - value = int(value) - return value, REG_DWORD - elif type(value) == list: - for single_value in value: - if type(single_value) != str: - # fmt:off - raise ValueError( - f"Windows Registry lists only support strings, got a {type(single_value)} in the list") - # fmt:on - return value, REG_MULTI_SZ - else: - raise ValueError(f"Windows registry expected types: int, str and [str], found {type(value)}") - - @staticmethod - def _convert_value(value_tuple: Tuple[Any, int]) -> Tuple[Any, PlatformSetting.DATA_TYPE]: - """Converts the Windows registry data and type (tuple) to a (standardized) data and PlatformSetting.DATA_TYPE""" - value, windows_type = value_tuple - if windows_type == REG_SZ: - # Convert from unicode to string - return value, PlatformSetting.DATA_TYPE.STR - elif windows_type == REG_MULTI_SZ: - # Convert from unicode to string - return [string for string in value], PlatformSetting.DATA_TYPE.STR_LIST - elif windows_type == REG_DWORD: - return value, PlatformSetting.DATA_TYPE.INT - else: - raise ValueError(f"Type flag not recognized: {windows_type}") - - @staticmethod - def _str_to_hive(hive_str: str) -> int: - """Converts a string to a Windows Registry Hive enum (int)""" - from winreg import HKEY_CLASSES_ROOT, HKEY_CURRENT_CONFIG, HKEY_LOCAL_MACHINE, HKEY_USERS - - lower = hive_str.lower() - if lower == "hkey_current_user" or lower == "current_user": - return HKEY_CURRENT_USER - elif lower == "hkey_classes_root" or lower == "classes_root": - return HKEY_CLASSES_ROOT - elif lower == "hkey_current_config" or lower == "current_config": - return HKEY_CURRENT_CONFIG - elif lower == "hkey_local_machine" or lower == "local_machine": - return HKEY_LOCAL_MACHINE - elif lower == "hkey_users" or lower == "users": - return HKEY_USERS - else: - raise ValueError(f"Hive: {hive_str} not recognized") diff --git a/Tests/ly_shared/asset_database_utils.py b/Tests/ly_shared/asset_database_utils.py deleted file mode 100755 index da8ad3651e..0000000000 --- a/Tests/ly_shared/asset_database_utils.py +++ /dev/null @@ -1,83 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import sqlite3 -import os -from typing import List - -# Index for ProductID in Products table in DB -PRODUCT_ID_INDEX = 0 - - -def do_select(asset_db_path, cmd): - try: - connection = sqlite3.connect(asset_db_path) - # Get ProductID from database - db_rows = connection.execute(cmd) - return_result = db_rows.fetchall() - connection.close() - return return_result - except sqlite3.Error as sqlite_error: - print(f'select on db {asset_db_path} failed with exception {sqlite_error}') - return [] - - -def get_active_platforms_from_db(asset_db_path) -> List[str]: - """Returns a list of platforms that are active in the database, based on what jobs were run""" - platform_rows = do_select(asset_db_path, f"select distinct Platform from Jobs") - # Condense this into a single list of platforms. - platforms = [platform[0] for platform in platform_rows] - return platforms - - -# Convert a source product path into a db product path -# cache_platform/projectname/product_path -def get_db_product_path(workspace, source_path, cache_platform): - product_path = os.path.join(cache_platform, workspace.project, source_path) - product_path = product_path.replace('\\', '/') - return product_path - - -def get_product_id(asset_db_path, product_name) -> str: - # Get ProductID from database - product_id = list(do_select(asset_db_path, f"SELECT ProductID FROM Products where ProductName='{product_name}'")) - if len(product_id) == 0: - return product_id # return empty list - return product_id[0][PRODUCT_ID_INDEX] # Get product id from 'first' row - - -# Retrieve a product_id given a source_path assuming the source is copied into the cache with the same -# name or a product name without cache_platform or projectname prepended -def get_product_id_from_relative(workspace, source_path, asset_platform): - return get_product_id(workspace.paths.asset_db(), get_db_product_path(workspace, source_path, asset_platform)) - - -def get_missing_dependencies(asset_db_path, product_id) -> List[str]: - return list(do_select(asset_db_path, f"SELECT * FROM MissingProductDependencies where ProductPK={product_id}")) - - -def do_single_transaction(asset_db_path, cmd): - try: - connection = sqlite3.connect(asset_db_path) - cursor = connection.cursor() # SQL cursor used for issuing commands - cursor.execute(cmd) - connection.commit() # Save changes - connection.close() - except sqlite3.Error as sqlite_error: - print(f'transaction on db {asset_db_path} cmd {cmd} failed with exception {sqlite_error}') - - -def clear_missing_dependencies(asset_db_path, product_id) -> None: - do_single_transaction(asset_db_path, f"DELETE FROM MissingProductDependencies where ProductPK={product_id}") - - -def clear_all_missing_dependencies(asset_db_path) -> None: - do_single_transaction(asset_db_path, "DELETE FROM MissingProductDependencies;") diff --git a/Tests/ly_shared/asset_processor_utils.py b/Tests/ly_shared/asset_processor_utils.py deleted file mode 100755 index 13dc50ea83..0000000000 --- a/Tests/ly_shared/asset_processor_utils.py +++ /dev/null @@ -1,51 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - - -import logging -import os -import subprocess - -from ly_test_tools.environment.process_utils import kill_processes_named as kill_processes_named -logger = logging.getLogger(__name__) - - -def start_asset_processor(bin_dir): - """ - Starts the AssetProcessor from the given bin directory. Raises a RuntimeError if the process fails. - :param bin_dir: The bin directory from which to launch the AssetProcessor executable. - :return: A subprocess.Popen object for the AssetProcessor process. - """ - os.chdir(bin_dir) - asset_processor = subprocess.Popen(['AssetProcessor.exe']) - return_code = asset_processor.poll() - - if return_code is not None and return_code != 0: - logger.error("Failed to start AssetProcessor") - raise RuntimeError("AssetProcessor exited with code {}".format(return_code)) - else: - logger.info("AssetProcessor is running") - return asset_processor - - -def kill_asset_processor(): - """ - Kill the AssetProcessor and all its related processes . - """ - - kill_processes_named('AssetProcessor_tmp', ignore_extensions=True) - kill_processes_named('AssetProcessor', ignore_extensions=True) - kill_processes_named('AssetProcessorBatch', ignore_extensions=True) - kill_processes_named('AssetBuilder', ignore_extensions=True) - kill_processes_named('rc', ignore_extensions=True) - - - diff --git a/Tests/ly_shared/file_utils.py b/Tests/ly_shared/file_utils.py deleted file mode 100755 index 2fc93d7538..0000000000 --- a/Tests/ly_shared/file_utils.py +++ /dev/null @@ -1,169 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import os -import shutil -import logging -import stat - -import ly_test_tools.environment.file_system as file_system -import ly_test_tools.environment.waiter as waiter - -logger = logging.getLogger(__name__) - - -def clear_out_file(file_path): - """ - Clears out the specified config file to be empty. - :param file_path: The full path to the file. - """ - if os.path.exists(file_path): - file_system.unlock_file(file_path) - with open(file_path, 'w') as file_to_write: - file_to_write.write('') - else: - logger.debug(f'{file_path} not found while attempting to clear out file.') - - -def add_commands_to_config_file(config_file_dir, config_file_name, command_list): - """ - From the command list, appends each command to the specified config file. - :param config_file_dir: The directory the config file is contained in. - :param config_file_name: The config file name. - :param command_list: The commands to add to the file. - :return: - """ - config_file_path = os.path.join(config_file_dir, config_file_name) - os.chmod(config_file_path, stat.S_IWRITE | stat.S_IREAD | stat.S_IEXEC) - with open(config_file_path, 'w') as launch_config_file: - for command in command_list: - launch_config_file.write("{}\n".format(command)) - - -def gather_error_logs(workspace): - """ - Grabs all error logs (if there are any) and puts them into the specified logs path. - :param workspace: The AbstractWorkspaceManager object that contains all of the paths - """ - error_log_path = os.path.join(workspace.paths.project_log(), 'error.log') - error_dump_path = os.path.join(workspace.paths.project_log(), 'error.dmp') - if os.path.exists(error_dump_path): - workspace.artifact_manager.save_artifact(error_dump_path) - if os.path.exists(error_log_path): - workspace.artifact_manager.save_artifact(error_log_path) - - -def delete_screenshot_folder(workspace): - """ - Deletes screenshot folder from platform path - :param workspace: The AbstractWorkspaceManager object that contains all of the paths - """ - shutil.rmtree(workspace.paths.project_screenshots(), ignore_errors=True) - - -def move_file(src_dir, dest_dir, file_name, timeout=120): - """ - Attempts to move a file from the source directory to the destination directory. Raises an IOError if - the file is in use. - :param src_dir: Directory of the file to be moved. - :param dest_dir: Directory where the file will be moved to. - :param file_name: Name of the file to be moved. - :param timeout: Number of seconds to wait for the file to be released. - """ - file_path = os.path.join(src_dir, file_name) - if os.path.exists(file_path): - waiter.wait_for(lambda: move_file_check(src_dir, dest_dir, file_name), timeout=timeout, - exc=IOError('Cannot move file {} while in use'.format(file_path))) - - -def move_file_check(src_dir, dest_dir, file_name): - """ - Moves file and checks if the file has been moved from the source to the destination directory. - :param src_dir: Source directory of the file to be moved - :param dest_dir: Destination directory where the file should move to - :param file_name: The name of the file to be moved - :return: - """ - try: - shutil.move(os.path.join(src_dir, file_name), os.path.join(dest_dir, file_name)) - except OSError as e: - logger.info(e) - return False - - return True - - -def rename_file(file_path, dest_path, timeout=10): - # type: (str, str, int) -> None - """ - Renames a file by moving it. Waits for file to become available and raises and exception if timeout occurs. - :param file_path: absolute path to the source file - :param dest_path: absolute path to the new file - :param timeout: timeout to wait for function to complete - :return: None - """ - def _rename_file_check(): - try: - shutil.move(file_path, dest_path) - except OSError as e: - logger.debug(f'Attempted to rename file: {file_path} but an error occurred, retrying.' - f'\nError: {e}', - stackinfo=True) - return False - return True - - if os.path.exists(file_path): - waiter.wait_for(lambda: _rename_file_check(), timeout=timeout, - exc=OSError('Cannot rename file {} while in use'.format(file_path))) - - -def delete_level(workspace, level_dir, timeout=120): - """ - Attempts to delete an entire level folder from the project. - :param workspace: The workspace instance to delete the level from. - :param level_dir: The level folder to delete - """ - - if not level_dir: - logger.warning("level_dir is empty, nothing to delete.") - return - - full_level_dir = os.path.join(workspace.paths.project(), 'Levels', level_dir) - if not os.path.isdir(full_level_dir): - if os.path.exists(full_level_dir): - logger.error("level '{}' isn't a directory, it won't be deleted.".format(full_level_dir)) - else: - logger.info("level '{}' doesn't exist, nothing to delete.".format(full_level_dir)) - return - - waiter.wait_for(lambda: delete_check(full_level_dir), - timeout=timeout, - exc=IOError('Cannot delete directory {} while in use'.format(full_level_dir))) - -def delete_check(src_dir): - """ - Deletes directory and verifies that it's been deleted. - :param src_dir: The directory to delete - """ - try: - def handle_delete_error(action, path, exception_info): - logger.info("Error deleting '{}' ({}), changing permissions to writeable.".format(path, exception_info)) - os.chmod(path, stat.S_IWRITE) - # Try the passed-in action (delete) again - action(path) - - shutil.rmtree(src_dir, onerror=handle_delete_error) - except OSError as e: - logger.debug("Delete for '{}' failed: {}".format(src_dir, e)) - return False - - return not os.path.exists(src_dir) - diff --git a/Tests/ly_shared/hydra_editor_utils.py b/Tests/ly_shared/hydra_editor_utils.py deleted file mode 100755 index b75e680cf8..0000000000 --- a/Tests/ly_shared/hydra_editor_utils.py +++ /dev/null @@ -1,340 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import azlmbr.bus as bus -import azlmbr.editor as editor -import azlmbr.entity as entity -import azlmbr.object - -from typing import List -from math import isclose -import collections.abc - - -def find_entity_by_name(entity_name): - """ - Gets an entity ID from the entity with the given entity_name - :param entity_name: String of entity name to search for - :return entity ID - """ - search_filter = entity.SearchFilter() - search_filter.names = [entity_name] - matching_entity_list = entity.SearchBus(bus.Broadcast, 'SearchEntities', search_filter) - if matching_entity_list: - matching_entity = matching_entity_list[0] - if matching_entity.IsValid(): - print(f'{entity_name} entity found with ID {matching_entity.ToString()}') - return matching_entity - else: - return matching_entity_list - - -def get_component_type_id(component_name): - """ - Gets the component_type_id from a given component name - :param component_name: String of component name to search for - :return component type ID - """ - type_ids_list = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', [component_name], entity.EntityType().Game) - component_type_id = type_ids_list[0] - return component_type_id - - -def add_component(componentName, entityId): - """ - Given a component name, finds component TypeId, adds to given entity, and verifies successful add/active state. - :param componentName: String of component name to add. - :param entityId: Entity to add component to. - :return: Component object. - """ - typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', [componentName], entity.EntityType().Game) - typeNamesList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeNames', typeIdsList) - componentOutcome = editor.EditorComponentAPIBus(bus.Broadcast, 'AddComponentsOfType', entityId, typeIdsList) - isActive = editor.EditorComponentAPIBus(bus.Broadcast, 'IsComponentEnabled', componentOutcome.GetValue()[0]) - hasComponent = editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', entityId, typeIdsList[0]) - if componentOutcome.IsSuccess() and isActive: - print('{} component was added to entity'.format(typeNamesList[0])) - elif componentOutcome.IsSuccess() and not isActive: - print('{} component was added to entity, but the component is disabled'.format(typeNamesList[0])) - elif not componentOutcome.IsSuccess(): - print('Failed to add {} component to entity'.format(typeNamesList[0])) - if hasComponent: - print('Entity has a {} component'.format(typeNamesList[0])) - return componentOutcome.GetValue()[0] - - -def get_component_property_value(component, component_propertyPath): - """ - Given a component name and component property path, outputs the property's value. - :param component: Component object to act on. - :param componentPropertyPath: String of component property. (e.g. 'Settings|Visible') - :return: Value set in given componentPropertyPath - """ - componentPropertyObj = editor.EditorComponentAPIBus(bus.Broadcast, 'GetComponentProperty', component, - component_propertyPath) - if componentPropertyObj.IsSuccess(): - componentProperty = componentPropertyObj.GetValue() - print(f'{component_propertyPath} set to {componentProperty}') - return componentProperty - else: - print(f'FAILURE: Could not get value from {component_propertyPath}') - return None - - -def get_property_tree(component): - """ - Given a configured component object, prints the property tree info from that component - :param component: Component object to act on. - """ - pteObj = editor.EditorComponentAPIBus(bus.Broadcast, 'BuildComponentPropertyTreeEditor', component) - pte = pteObj.GetValue() - print(pte.build_paths_list()) - return pte - - -def compare_values(first_object: object, second_object: object, name: str) -> bool: - # Quick case - can we just directly compare the two objects successfully? - if (first_object == second_object): - result = True - # No, so get a lot more specific - elif isinstance(first_object, collections.abc.Container): - # If they aren't both containers, they're different - if not isinstance(second_object, collections.abc.Container): - result = False - # If they have different lengths, they're different - elif len(first_object) != len (second_object): - result = False - # If they're different strings, they're containers but they failed the == check so - # we know they're different - elif isinstance(first_object, str): - result = False - else: - # It's a collection of values, so iterate through them all... - collection_idx = 0 - result = True - for val1, val2 in zip(first_object, second_object): - result = result and compare_values(val1, val2, f"{name} (index [{collection_idx}])") - collection_idx = collection_idx + 1 - - else: - # Do approximate comparisons for floats - if isinstance(first_object, float) and isclose(first_object, second_object, rel_tol=0.001): - result = True - # We currently don't have a generic way to compare PythonProxyObject contents, so return a - # false positive result for now. - elif isinstance(first_object, azlmbr.object.PythonProxyObject): - print(f"{name}: validation inconclusive, the two objects cannot be directly compared.") - result = True - else: - result = False - - if not result: - print(f"compare_values failed: {first_object} ({type(first_object)}) vs {second_object} ({type(second_object)})") - - print(f"{name}: {'SUCCESS' if result else 'FAILURE'}") - return result - - -class Entity: - """ - Entity class used to create entity objects - :param name: String for the name of the Entity - :param id: The ID of the entity - """ - - def __init__(self, name: str, id: object = entity.EntityId()): - self.name: str = name - self.id: object = id - self.components: List[object] = None - self.parent_id = None - self.parent_name = None - - def create_entity(self, entity_position, components, parent_id=entity.EntityId()): - self.id = editor.ToolsApplicationRequestBus( - bus.Broadcast, "CreateNewEntityAtPosition", entity_position, entity.EntityId() - ) - if self.id.IsValid(): - print(f"{self.name} Entity successfully created") - editor.EditorEntityAPIBus(bus.Event, 'SetName', self.id, self.name) - self.components = [] - for component in components: - new_component = add_component(component, self.id) - self.components.append(new_component) - - def get_parent_info(self): - """ - Sets the value for parent_id and parent_name on the entity (self) - Prints the string for papertrail - :return: None - """ - self.parent_id = editor.EditorEntityInfoRequestBus(bus.Event, "GetParent", self.id) - self.parent_name = editor.EditorEntityInfoRequestBus(bus.Event, "GetName", self.parent_id) - print(f"The parent entity of {self.name} is {self.parent_name}") - - def set_test_parent_entity(self, parent_entity_obj): - editor.EditorEntityAPIBus(bus.Event, "SetParent", self.id, parent_entity_obj.id) - self.get_parent_info() - - def get_set_test(self, component_index: int, path: str, value: object, expected_result: object = None) -> bool: - """ - Used to set and validate changes in component values - :param component_index: Index location in the self.components list - :param path: asset path in the component - :param value: new value for the variable being changed in the component - :param expected_result: (optional) check the result against a specific expected value - """ - - if expected_result is None: - expected_result = value - - # Test Get/Set (get old value, set new value, check that new value was set correctly) - print(f"Entity {self.name} Path {path} Component Index {component_index} ") - - component = self.components[component_index] - old_value = get_component_property_value(component, path) - - if old_value is not None: - print(f"SUCCESS: Retrieved property Value for {self.name}") - else: - print(f"FAILURE: Failed to find value in {self.name} {path}") - return False - - if old_value == expected_result: - print((f"WARNING: get_set_test on {self.name} is setting the same value that already exists ({old_value})." - "The set results will be inconclusive.")) - - editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", component, path, value) - - new_value = get_component_property_value(self.components[component_index], path) - - if new_value is not None: - print(f"SUCCESS: Retrieved new property Value for {self.name}") - else: - print(f"FAILURE: Failed to find new value in {self.name}") - return False - - return compare_values(new_value, expected_result, f"{self.name} {path}") - - -def get_set_test(entity: object, component_index: int, path: str, value: object) -> bool: - """ - Used to set and validate changes in component values - :param component_index: Index location in the entity.components list - :param path: asset path in the component - :param value: new value for the variable being changed in the component - """ - return entity.get_set_test(component_index, path, value) - - -def get_set_property_test(ly_object: object, attribute_name: str, value: object, expected_result: object = None) -> bool: - """ - Used to set and validate BehaviorContext property changes in Lumberyard objects - :param ly_object: The lumberyard object to test - :param attribute_name: property (attribute) name in the BehaviorContext - :param value: new value for the variable being changed in the component - :param expected_result: (optional) check the result against a specific expected value other than the one set - """ - - if expected_result is None: - expected_result = value - - # Test Get/Set (get old value, set new value, check that new value was set correctly) - print(f"Attempting to set {ly_object.typename}.{attribute_name} = {value} (expected result is {expected_result})") - - if hasattr(ly_object, attribute_name): - print(f"SUCCESS: Located attribute {attribute_name} for {ly_object.typename}") - else: - print(f"FAILURE: Failed to find attribute {attribute_name} in {ly_object.typename}") - return False - - old_value = getattr(ly_object, attribute_name) - - if old_value is not None: - print(f"SUCCESS: Retrieved existing value {old_value} for {attribute_name} in {ly_object.typename}") - else: - print(f"FAILURE: Failed to retrieve value for {attribute_name} in {ly_object.typename}") - return False - - if old_value == expected_result: - print((f"WARNING: get_set_test on {attribute_name} is setting the same value that already exists ({old_value})." - "The 'set' result for the test will be inconclusive.")) - - setattr(ly_object, attribute_name, expected_result) - - new_value = getattr(ly_object, attribute_name) - - if new_value is not None: - print(f"SUCCESS: Retrieved new value {new_value} for {attribute_name} in {ly_object.typename}") - else: - print(f"FAILURE: Failed to retrieve value for {attribute_name} in {ly_object.typename}") - return False - - return compare_values(new_value, expected_result, f"{ly_object.typename}.{attribute_name}") -def has_components(entity_id: object, component_list: list) -> bool: - """ - Used to verify if a given entity has all the components of components_list. Returns True if all the - components are present, else False - :param entity_id: entity id of the entity - :param component_list: list of component names to be verified - """ - typeIdsList = editor.EditorComponentAPIBus(bus.Broadcast, 'FindComponentTypeIdsByEntityType', component_list , entity.EntityType().Game) - for type_id in typeIdsList: - if not editor.EditorComponentAPIBus(bus.Broadcast, 'HasComponentOfType', entity_id, type_id): - return False - return True - -class PathNotFoundError(Exception): - def __init__(self, path): - self.path = path - - def __str__(self): - return f"Path \"{self.path}\" not found in Editor Settings" - -def get_editor_settings_path_list(): - """ - Get the list of Editor Settings paths - """ - paths = editor.EditorSettingsAPIBus(bus.Broadcast, 'BuildSettingsList') - return paths - -def get_editor_settings_by_path(path): - """ - Get the value of Editor Settings based on the path. - :param path: path to the Editor Settings to get the value - """ - if path not in get_editor_settings_path_list(): - raise PathNotFoundError(path) - outcome = editor.EditorSettingsAPIBus(bus.Broadcast, 'GetValue', path) - if outcome.isSuccess(): - return outcome.GetValue() - raise RuntimeError(f"GetValue for path '{path}' failed") - -def set_editor_settings_by_path(path, value, is_bool = False): - """ - Set the value of Editor Settings based on the path. - # NOTE: Some Editor Settings may need an Editor restart to apply. - # Ex: Enabling or disabling New Viewport Interaction Model - :param path: path to the Editor Settings to get the value - :param value: value to be set - :param is_bool: True for Boolean settings (enable/disable), False for other settings - """ - if path not in get_editor_settings_path_list(): - raise PathNotFoundError(path) - if is_bool and not isinstance(value, bool): - def ParseBoolValue(value): - if(value == "0"): - return False - return True - value = ParseBoolValue(value) - outcome = editor.EditorSettingsAPIBus(bus.Broadcast, 'SetValue', path, value) - if not outcome.isSuccess(): - raise RuntimeError(f"SetValue for path '{path}' failed") - print(f"Value for path '{path}' is set to {value}") diff --git a/Tests/ly_shared/hydra_lytt_test_utils.py b/Tests/ly_shared/hydra_lytt_test_utils.py deleted file mode 100755 index bbdcbc6cb6..0000000000 --- a/Tests/ly_shared/hydra_lytt_test_utils.py +++ /dev/null @@ -1,77 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import logging -import os -import tempfile -import ly_test_tools.log.log_monitor -import ly_test_tools.environment.process_utils as process_utils -import ly_test_tools.environment.waiter as waiter - -logger = logging.getLogger(__name__) - - -def teardown_editor(editor): - """ - :param editor: Configured editor object - :return: - """ - process_utils.kill_processes_named('AssetProcessor.exe') - logger.debug('Ensuring Editor is stopped') - editor.ensure_stopped() - - -def launch_and_validate_results(request, test_directory, editor, editor_script, expected_lines, unexpected_lines=[], - halt_on_unexpected=False, auto_test_mode=True, run_python="--runpythontest", cfg_args=[], timeout=60, log_creation_max_wait=60): - """ - Creates a temporary config file for Hydra execution, runs the Editor with the specified script, and monitors for - expected log lines. - :param request: Special fixture providing information of the requesting test function. - :param test_directory: Path to test directory that editor_script lives in. - :param editor: Configured editor object to run test against. - :param editor_script: Name of script that will execute in the Editor. - :param expected_lines: Expected lines to search log for. - :param unexpected_lines: Unexpected lines to search log for. Defaults to none. - :param halt_on_unexpected: Halts test if unexpected lines are found. Defaults to False. - :param auto_test_mode: Defaults to True. Runs the test in auto_test_mode. - :param run_python: Defaults to "--runpythontest", other option is "--runpython". - :param cfg_args: Additional arguments for CFG, such as LevelName. - :param timeout: Length of time for test to run. Default is 60. - :param log_creation_max_wait: Length of time for waiting to find the log file. Default is 60. - """ - test_case = os.path.join(test_directory, editor_script) - request.addfinalizer(lambda: teardown_editor(editor)) - logger.debug("Running automated test: {}".format(editor_script)) - - editor.args.extend(["--skipWelcomeScreenDialog"]) - if auto_test_mode: editor.args.extend(["--autotest_mode"]) - editor.args.extend([run_python, test_case, "--runpythonargs", cfg_args]) - - with editor.start(): - - editorlog_file = os.path.join(editor.workspace.paths.project_log(), 'Editor.log') - log_monitor = ly_test_tools.log.log_monitor.LogMonitor(launcher=editor, log_file_path=editorlog_file, log_creation_max_wait_time=log_creation_max_wait) - log_monitor.monitor_log_for_lines(expected_lines=expected_lines, unexpected_lines=unexpected_lines, - halt_on_unexpected=halt_on_unexpected, timeout=timeout) - - -def remove_files(artifact_path, suffix): - """ - Removes files with the specified suffix from the specified path - :param artifact_path: Path to search for files - :param suffix: File extension to remove - """ - if not os.path.isdir(artifact_path): - return - - for file_name in os.listdir(artifact_path): - if file_name.endswith(suffix): - os.remove(os.path.join(artifact_path, file_name)) diff --git a/Tests/ly_shared/network_utils.py b/Tests/ly_shared/network_utils.py deleted file mode 100755 index 8b772303f1..0000000000 --- a/Tests/ly_shared/network_utils.py +++ /dev/null @@ -1,66 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import logging -import psutil -import socket - - -logger = logging.getLogger(__name__) - - -def check_for_listening_port(port): - """ - Checks to see if the connection to the designated port was established. - :param port: Port to listen to. - :return: True if port is listening. - """ - port_listening = False - for conn in psutil.net_connections(): - if 'port={}'.format(port) in str(conn): - port_listening = True - return port_listening - - -def check_for_remote_listening_port(port, ip_addr='127.0.0.1'): - """ - Tries to connect to a port to see if port is listening. - :param port: Port being tested. - :param ip_addr: IP address of the host being connected to. - :return: True if connection to the port is established. - """ - port_listening = True - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - try: - sock.connect((ip_addr, port)) - except socket.error as err: - # Socket error: Connection refused, error code 10061 - if err.errno == 10061: - port_listening = False - finally: - sock.close() - return port_listening - - -def get_local_ip_address(): - """ - Finds the IP address for the primary ethernet adapter by opening a connection and grabbing its IP address. - :return: The IP address for the adapter used to make the connection. - """ - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - try: - # Connecting to Google's public DNS so there is an open connection - # and then getting the address used for that connection - sock.connect(('8.8.8.8', 80)) - host_ip = sock.getsockname()[0] - finally: - sock.close() - return host_ip diff --git a/Tests/ly_shared/phase.py b/Tests/ly_shared/phase.py deleted file mode 100755 index 4bb827b3ad..0000000000 --- a/Tests/ly_shared/phase.py +++ /dev/null @@ -1,198 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -This represents one "phase" of a test. The test runner communicates with the launcher by running phases and waiting -for results, however they appear. -""" - -import logging -import os -import time -import xml.etree.ElementTree - -import ly_test_tools.launchers.exceptions as exceptions -from ly_test_tools.launchers.platforms.base import Launcher - -_POLL_INTERVAL_SEC = 1 -_CRASH_TIMEOUT = 5 - -logger = logging.getLogger(__name__) - - -class Phase(object): - """ - A generic test phase for running the launcher. With the launcher running elsewhere (at a minimum in a different - process, possibly on a different device altogether) the following kind of phases might occur: - - - Wait for a specific file to show up / complete processing. - - Send commands to the launcher over the network and wait for response. - - Wait for multiple launchers to coordinate networking testing. - - Wait for a specific amount of time. - - Each phase can then compile the artifacts for the next phase. - """ - def __init__(self, timeout): - """ - :param timeout: Maximum time allocated for phase. - """ - self.timeout = timeout - - def _start(self, previous_phase=None): - """ - Start the phase. - - :return: None - """ - logger.debug("start: {}".format(self.__class__.__name__)) - - def _is_complete(self): - """ - Check if the phase is complete. This is the only required function. - - :return: None - """ - raise NotImplementedError - - def _compile_artifacts(self): - """ - Compile artifacts after a completed phase. - """ - logger.debug("compile_artifacts: {}".format(self.__class__.__name__)) - - def _update(self, elapsed_time): - """ - Update the test phase if necessary. - - :param elapsed_time: Time since the last update. - :return: None - """ - logger.debug("update: {}".format(self.__class__.__name__)) - - def _wait(self, launcher): - """ - Wait for the phase to complete. - - :return: None. - :raises: TimeoutError, CrashError - """ - dead_time = -1 - logger.debug("wait begin: {}".format(self.__class__.__name__)) - start = time.time() - - while not self._is_complete(): - - if time.time() - start > self.timeout: - message = "Timeout exceeded {}s in {}".format(self.timeout, self.__class__.__name__) - logger.error(message) - raise exceptions.TimeoutError(message) - elif not launcher.is_alive(): - # The final result may arrive after the app closes. - if dead_time == -1: - dead_time = time.time() - if time.time() - dead_time > _CRASH_TIMEOUT: - message = "Unexpected termination in {} after {:0.2f}s".format( - self.__class__.__name__, time.time() - start) - logger.error(message) - raise exceptions.CrashError(message) - - sleep_start = time.time() - time.sleep(_POLL_INTERVAL_SEC) - - self._update(time.time() - sleep_start) - - logger.debug("wait end: {}, duration: {:.2f}".format(self.__class__.__name__, time.time() - start)) - - -class FileExistsPhase(Phase): - """ - Test phase that completes when a specific file is created. - """ - def __init__(self, path, timeout=60, non_empty=False): - super(FileExistsPhase, self).__init__(timeout) - self.path = path - self.non_empty = non_empty - - def _is_complete(self): - if self.path is not None and os.path.exists(self.path): - if self.non_empty: - return os.path.getsize(self.path) > 0 - else: - return True - - return False - - -class XMLValidPhase(FileExistsPhase): - """ - Test phase that completes when a valid XML file is found. - """ - def __init__(self, path, timeout=60): - super(XMLValidPhase, self).__init__(path, timeout, non_empty=True) - self.path = path - self.xml = None - - def _is_complete(self): - if not super(XMLValidPhase, self)._is_complete(): - return False - - try: - self.xml = xml.etree.ElementTree.parse(self.path) - except xml.etree.ElementTree.ParseError: - return False - - return True - - -class TimePhase(Phase): - """ - Simple class to complete in a specified time. Can be used to test timeout. - """ - def __init__(self, timeout, complete_time): - super(TimePhase, self).__init__(timeout) - self.complete_time = complete_time - - def _start(self, previous_phase=None): - super(TimePhase, self)._start(previous_phase) - self.start_time = time.time() - - def _is_complete(self): - return time.time() - self.start_time > self.complete_time - - -class ElapsedTimePhase(Phase): - """ - Simple class to complete in a specified time using elapsed time. Can be used to test timeout and elapsed time. - """ - def __init__(self, timeout, complete_time): - super(ElapsedTimePhase, self).__init__(timeout) - self.complete_time = complete_time - self.total_time = None - - def _start(self, previous_phase=None): - super(ElapsedTimePhase, self)._start(previous_phase) - self.total_time = 0 - - def _update(self, elapsed_time): - super(ElapsedTimePhase, self)._update(elapsed_time) - self.total_time += elapsed_time - - def _is_complete(self): - return self.total_time > self.complete_time - - -class WaitForLauncherToQuit(Phase): - def __init__(self, launcher, timeout=60): - # type: (Launcher, int) -> None - super(WaitForLauncherToQuit, self).__init__(timeout) - self.launcher = launcher - - def _is_complete(self): - # type: () -> bool - return not self.launcher.is_alive() diff --git a/Tests/ly_shared/pyside_utils.py b/Tests/ly_shared/pyside_utils.py deleted file mode 100755 index 1dfdcdb5c0..0000000000 --- a/Tests/ly_shared/pyside_utils.py +++ /dev/null @@ -1,939 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import azlmbr.qt -import azlmbr.qt_helpers -import asyncio -import re -from shiboken2 import wrapInstance, getCppPointer -from PySide2 import QtCore, QtWidgets, QtGui, QtTest -from PySide2.QtWidgets import QAction, QWidget -from PySide2.QtCore import Qt -from PySide2.QtTest import QTest -import azlmbr.legacy.general as general -import traceback -import threading -import types - - -qApp = QtWidgets.QApplication.instance() -# Monkey patch static method calls -QtWidgets.QApplication.activeModalWidget = qApp.activeModalWidget - - -class LmbrQtEventLoop(asyncio.AbstractEventLoop): - def __init__(self): - self.running = False - self.shutdown = threading.Event() - self.blocked_events = set() - self.finished_events = set() - self.queue = [] - self._wait_future = None - self._event_loop_nesting = 0 - - def get_debug(self): - return False - - def time(self): - return azlmbr.qt_helpers.time() - - def wait_for_condition(self, condition, action, on_timeout=None, timeout=1.0): - timeout = self.time() + timeout if timeout is not None else None - def callback(time): - # Run our action and remove us from the queue if our condition is satisfied - if condition(): - action() - return True - # Give up if timeout has elapsed - if time > timeout: - if on_timeout is not None: - on_timeout() - return True - return False - self.queue.append((callback)) - - def event_loop(self): - time = self.time() - def run_event(event): - if event in self.blocked_events or event in self.finished_events: - return False - self.blocked_events.add(event) - try: - if event(time): - self.finished_events.add(event) - except Exception: - traceback.print_exc() - self.finished_events.add(event) - finally: - self.blocked_events.remove(event) - - self._event_loop_nesting += 1 - try: - for event in self.queue: - run_event(event) - finally: - self._event_loop_nesting -= 1 - - # Clear out any finished events if the queue is safe to mutate - if self._event_loop_nesting == 0: - self.queue = [event for event in self.queue if event not in self.finished_events] - self.finished_events = set() - - if not self.running or self._wait_future is not None and self._wait_future.done(): - self.close() - - def run_until_shutdown(self): - # Run our event loop callback (via azlmbr.qt_helpers) by pumping the Qt event loop - # azlmbr.qt_helpers will attempt to ensure our event loop is always run, even when a - # new event loop is started and run from the main event loop - self.running = True - self.shutdown.clear() - azlmbr.qt_helpers.set_loop_callback(self.event_loop) - while not self.shutdown.is_set(): - qApp.processEvents(QtCore.QEventLoop.AllEvents, 0) - - def run_forever(self): - self._wait_future = None - self.run_until_shutdown() - - def run_until_complete(self, future): - # Wrap coroutines into Tasks (future-like analogs) - if isinstance(future, types.CoroutineType): - future = self.create_task(future) - self._wait_future = future - self.run_until_shutdown() - - def _timer_handle_cancelled(self, handle): - pass - - def is_running(self): - return self.running - - def is_closed(self): - return not azlmbr.qt_helpers.loop_is_running() - - def stop(self): - self.running = False - - def close(self): - self.running = False - self.shutdown.set() - azlmbr.qt_helpers.clear_loop_callback() - - def shutdown_asyncgens(self): - pass - - def call_exception_handler(self, context): - try: - raise context.get('exception', None) - except: - traceback.print_exc() - - def call_soon(self, callback, *args, **kw): - h = asyncio.Handle(callback, args, self) - def callback_wrapper(time): - if not h.cancelled(): - h._run() - return True - self.queue.append(callback_wrapper) - return h - - def call_later(self, delay, callback, *args, **kw): - if delay < 0: - raise Exception("Can't schedule in the past") - return self.call_at(self.time() + delay, callback, *args) - - def call_at(self, when, callback, *args, **kw): - h = asyncio.TimerHandle(when, callback, args, self) - h._scheduled = True - def callback_wrapper(time): - if time > when: - if not h.cancelled(): - h._run() - return True - return False - self.queue.append(callback_wrapper) - return h - - def create_task(self, coro): - return asyncio.Task(coro, loop=self) - - def create_future(self): - return asyncio.Future(loop=self) - - -class EventLoopTimeoutException(Exception): - pass - - -event_loop = LmbrQtEventLoop() -def wait_for_condition(condition, timeout=1.0): - """ - Asynchronously waits for `condition` to evaluate to True. - condition: A function with the signature def condition() -> bool - This condition will be evaluated until it evaluates to True or the timeout elapses - timeout: The time in seconds to wait - if 0, this will wait forever - Throws pyside_utils.EventLoopTimeoutException on timeout. - """ - future = event_loop.create_future() - def on_complete(): - future.set_result(True) - def on_timeout(): - future.set_exception(EventLoopTimeoutException()) - event_loop.wait_for_condition(condition, on_complete, on_timeout=on_timeout, timeout=timeout) - return future - - -async def wait_for(expression, timeout=1.0): - """ - Asynchronously waits for "expression" to evaluate to a non-None value, - then returns that value. - - expression: A function with the signature def expression() -> Generic[Any,None] - The result of expression will be returned as soon as it returns a non-None value. - timeout: The time in seconds to wait - if 0, this will wait forever - Throws pyside_utils.EventLoopTimeoutException on timeout. - """ - result = None - def condition(): - nonlocal result - result = expression() - return result is not None - await wait_for_condition(condition, timeout) - return result - - -def run_soon(fn): - """ - Runs a function on the event loop to enable asynchronous execution. - - fn: The function to run, should be a function that takes no arguments - Returns a future that will be popualted with the result of fn or the exception it threw. - """ - future = event_loop.create_future() - def coroutine(): - try: - fn() - future.set_result(True) - except Exception as e: - future.set_exception(e) - event_loop.call_soon(coroutine) - return future - - -def run_async(awaitable): - """ - Synchronously runs a coroutine or a future on the event loop. - This can be used in lieu of "await" in non-async functions. - - awaitable: The coroutine or future to await. - Returns the result of operation specified. - """ - if isinstance(awaitable, types.CoroutineType): - awaitable = event_loop.create_task(awaitable) - event_loop.run_until_complete(awaitable) - return awaitable.result() - - -def wrap_async(fn): - """ - This decorator enables an async function's execution from a synchronous one. - - For example: - @pyside_utils.wrap_async - async def foo(): - result = await long_operation() - return result - - def non_async_fn(): - x = foo() # this will return the correct result by executing the event loop - - fn: The function to wrap - Returns the decorated function. - """ - def wrapper(*args, **kw): - result = fn(*args, **kw) - return run_async(result) - return wrapper - - -def get_editor_main_window(): - """ - Fetches the main Editor instance of QMainWindow for use with PySide tests - :return Instance of QMainWindow for the Editor - """ - params = azlmbr.qt.QtForPythonRequestBus(azlmbr.bus.Broadcast, "GetQtBootstrapParameters") - editor_id = QtWidgets.QWidget.find(params.mainWindowId) - main_window = wrapInstance(int(getCppPointer(editor_id)[0]), QtWidgets.QMainWindow) - return main_window - - -def get_action_for_menu_path(editor_window: QtWidgets.QMainWindow, main_menu_item: str, *menu_item_path: str): - """ - main_menu_item: Main menu item among the MenuBar actions. Ex: "File" - menu_item_path: Path to any nested menu item. Ex: "Viewport", "Goto Coordinates" - returns: QAction object for the corresponding path. - """ - # Check if path is valid - menu_bar = editor_window.menuBar() - menu_bar_actions = [index.iconText() for index in menu_bar.actions()] - - # Verify if the given Menu exists in the Menubar - if main_menu_item not in menu_bar_actions: - print(f"QAction not found for main menu item '{main_menu_item}'") - return None - curr_action = menu_bar.actions()[menu_bar_actions.index(main_menu_item)] - curr_menu = curr_action.menu() - for index, element in enumerate(menu_item_path): - curr_menu_actions = [index.iconText() for index in curr_menu.actions()] - if element not in curr_menu_actions: - print(f"QAction not found for menu item '{element}'") - return None - if index == len(menu_item_path) - 1: - return curr_menu.actions()[curr_menu_actions.index(element)] - curr_action = curr_menu.actions()[curr_menu_actions.index(element)] - curr_menu = curr_action.menu() - return None - - -def _pattern_to_dict(pattern, **kw): - """ - Helper function, turns a pattern match parameter into a normalized dictionary - """ - - def is_string_or_regex(x): - return isinstance(x, str) or isinstance(x, re.Pattern) - - # If it's None, just make an empty dict - if pattern is None: - pattern = {} - # If our pattern is a string or regex, turn it into a text match - elif is_string_or_regex(pattern): - pattern = dict(text=pattern) - # If our pattern is an (int, int) tuple, turn it into a row/column match - elif isinstance(pattern, tuple) and isinstance(pattern[0], int) and isinstance(pattern[1], int): - pattern = dict(row=pattern[0], column=pattern[1]) - # If our pattern is a QObject type, turn it into a type match - elif isinstance(pattern, type(QtCore.QObject)): - pattern = dict(type=pattern) - # Otherwise assume it's a dict and make a copy - else: - pattern = dict(pattern) - - # Merge with any kw arguments - for key, value in kw.items(): - pattern[key] = value - return pattern - - -def _match_pattern(obj, pattern): - """ - Helper function, determines whether obj matches the pattern specified by pattern. - - It is required that pattern is normalized into a dict before calling this. - """ - - def compare(value1, value2): - # Do a regex search if it's a regex, otherwise do a normal compare - if isinstance(value2, re.Pattern): - return re.search(value2, value1) - return value1 == value2 - - item_roles = Qt.ItemDataRole.values.values() - for key, value in pattern.items(): - if key == "type": # Class type - if not isinstance(obj, value): - return False - elif key == "text": # Default 'text' path, depends on type - text_values = [] - - def get_from_attrs(*args): - for attr in args: - try: - text_values.append(getattr(obj, attr)()) - except Exception: - pass - - # Use any of the following fields for default matching, if they're defined - get_from_attrs("text", "objectName", "windowTitle") - # Additionally, use the DisplayRole for QModelIndexes - if isinstance(obj, QtCore.QModelIndex): - text_values.append(obj.data(Qt.DisplayRole)) - - if not any(compare(text, value) for text in text_values): - return False - elif key in item_roles: # QAbstractItemModel display role - if not isinstance(obj, QtCore.QModelIndex): - raise RuntimeError(f"Attempted to match data role on unsupported object {obj}") - if not compare(obj.data(key), value): - return False - elif hasattr(obj, key): - # Look up our key on the object itself - objectValue = getattr(obj, key) - # Invoke it if it's a getter - if callable(objectValue): - objectValue = objectValue() - if not compare(objectValue, value): - return False - else: - return False - - return True - - -def get_child_indexes(model, parent_index=QtCore.QModelIndex()): - indexes = [parent_index] - while len(indexes) > 0: - parent_index = indexes.pop(0) - for row in range(model.rowCount(parent_index)): - # FIXME - # PySide appears to have a bug where-in it thinks columnCount is private - # Bail gracefully for now, we can add a C++ wrapper to work around if needed - try: - column_count = model.columnCount(parent_index) - except Exception: - column_count = 1 - for col in range(column_count): - cur_index = model.index(row, col, parent_index) - yield cur_index - - -def _get_children(obj): - """ - Helper function. Get the direct descendants from a given PySide object. - This includes all: QObject children, QActions owned by the object, and QModelIndexes if applicable - """ - if isinstance(obj, QtCore.QObject): - yield from obj.children() - if isinstance(obj, QtWidgets.QWidget): - yield from obj.actions() - if isinstance(obj, (QtWidgets.QAbstractItemView, QtCore.QModelIndex)): - model = obj.model() - if model is None: - return - - # For a QAbstractItemView (e.g. QTreeView, QListView), the parent index - # will be an invalid QModelIndex(), which will use find all indexes on the root. - # For a QModelIndex, we use the actual QModelIndex as the parent_index so that - # it will find any child indexes under it - parent_index = QtCore.QModelIndex() - if isinstance(obj, QtCore.QModelIndex): - parent_index = obj - - yield from get_child_indexes(model, parent_index) - - -def _get_parents_to_search(obj_entry_or_list): - """ - Helper function, turns obj_entry_or_list into a list of parents to search - - If obj_entry_or_list is None, returns all visible top level widgets - If obj_entry_or_list is iterable, return it as a list - Otherwise, return a list containing obj_entry_or_list - """ - if obj_entry_or_list is None: - return [widget for widget in QtWidgets.QApplication.topLevelWidgets() if widget.isVisible()] - try: - return list(obj_entry_or_list) - except TypeError: - return [obj_entry_or_list] - - -def find_children_by_pattern(obj=None, pattern=None, recursive=True, **kw): - """ - Finds the children of an object that match a given pattern. - See find_child_by_pattern for more information on usage. - """ - pattern = _pattern_to_dict(pattern, **kw) - parents_to_search = _get_parents_to_search(obj) - - while len(parents_to_search) > 0: - parent = parents_to_search.pop(0) - for child in _get_children(parent): - if _match_pattern(child, pattern): - yield child - if recursive: - parents_to_search.append(child) - - -def find_child_by_pattern(obj=None, pattern=None, recursive=True, **kw): - """ - Finds the child of an object that matches a given pattern. - A "child" in this context is not necessarily a QObject child. - QActions are also considered children, as are the QModelIndex children of QAbstractItemViews. - obj: The object to search - should be either a QObject or a QModelIndex, or a list of them - If None this will search all top level windows. - pattern: The pattern to match, the first child that matches all of the criteria specified will - be returned. This is a dictionary with any combination of the following: - - - "text": generic text to match, will search object names for QObjects, display role text - for QModelIndexes, or action text() for QActions - - "type": a class type, e.g. QtWidgets.QMenu, a child will only match if it's of this type - - "row" / "column": integer row and column indices of a QModelIndex - - "type": type class (e.g. PySide.QtWidgets.QComboBox) that the object must inherit from - - A Qt.ItemDataRole: matches for QModelIndexes with data of a given value - - Any other fields will fall back on being looked up on the object itself by name, e.g. - {"windowTitle": "Foo"} would match a windowTitle named "Foo" - - Any instances where a field is specified as text can also be specified as a regular expression: - find_child_by_pattern(obj, {text: re.compile("Foo_.*")}) would find a child with text starting - with "Foo_" - - For convenience, these parameter types may also be specified as keyword arguments: - find_child_by_pattern(obj, text="foo", type=QtWidgets.QAction) - is equivalent to - find_child_by_pattern(obj, {"text": "foo", "type": QtWidgets.QAction}) - - If pattern is specified as a string, it will turn into a pattern matching "text": - find_child_by_pattern(obj, "foo") - is equivalent to - find_child_by_pattern(obj, {"text": "foo"}) - - If a pattern is specified as an (int, int) tuple, it will turn into a row/column match: - find_child_by_pattern(obj, (0, 2)) - is equivalent to - find_child_by_pattern(obj, {"row": 0, "column": 2}) - - If a pattern is specified as a type, like PySide.QtWidgets.QLabel, it will turn into a type match: - find_child_by_pattern(obj, PySide.QtWidgets.QLabel) - is equivalent to - find_child_by_pattern(obj, {"type": PySide.QtWidgets.QLabel}) - """ - # Return the first match result, if found - for match in find_children_by_pattern(obj, pattern=pattern, recursive=recursive, **kw): - return match - return None - - -def find_child_by_hierarchy(parent, *patterns): - """ - Searches for a hierarchy of children descending from parent. - parent: The Qt object (or list of Qt obejcts) to search within - If none, this will search all top level windows. - patterns: A list of patterns to match to find a hierarchy of descendants. - These patterns will be tested in order. - - For example, to look for the QComboBox in a hierarchy like the following: - QWidget (window) - -QTabWidget - -QWidget named "m_exampleTab" - -QComboBox - One might invoke: - find_child_by_hierarchy(window, QtWidgets.QTabWidget, "m_exampleTab", QtWidgets.QComboBox) - - Alternatively, "..." may be specified in place of a parent, where the hierarchy will match any - ancestors along the path, so the above might be shortened to: - find_child_by_hierarchy(window, ..., "m_exampleTab", QtWidgets.QComboBox) - """ - search_recursively = False - current_objects = _get_parents_to_search(parent) - for pattern in patterns: - # If it's an ellipsis, do the next search recursively as we're looking for any number of intermediate ancestors - if pattern is ...: - search_recursively = True - continue - - candidates = [] - for parent_candidate in current_objects: - candidates += find_children_by_pattern(parent_candidate, pattern=pattern, recursive=search_recursively) - if len(candidates) == 0: - return None - current_objects = candidates - - search_recursively = False - return current_objects[0] - -async def wait_for_child_by_hierarchy(parent, *patterns, timeout=1.0): - """ - Searches for a hierarchy of children descending from parent until timeout occurs. - Returns a future that will result in either the found child or an EventLoopTimeoutException. - - See find_child_by_hierarchy for usage information. - """ - match = None - def condition(): - nonlocal match - match = find_child_by_hierarchy(parent, *patterns) - return match is not None - await wait_for_condition(condition, timeout) - return match - - -async def wait_for_child_by_pattern(obj=None, pattern=None, recursive=True, timeout=1.0, **kw): - """ - Finds the child of an object that matches a given pattern. - Returns a future that will result in either the found child or an EventLoopTimeoutException. - - See find_child_by_hierarchy for usage information. - """ - match = None - def condition(): - nonlocal match - match = find_child_by_pattern(obj, pattern, recursive, **kw) - return match is not None - await wait_for_condition(condition, timeout) - return match - - -def find_child_by_property(obj, obj_type, property_name, property_value, reg_exp_search=False): - """ - Finds the child of an object which has the property name matching the property value - of type obj_type - obj: The property value is searched through obj children - obj_type: Type of object to be matched - property_name: Property of the child which should be verified for the required value. - property_value: Property value that needs to be matched - reg_exp_search: If True searches for the property_value based on re search. Defaults to False. - """ - for child in obj.children(): - if reg_exp_search and re.search(property_value, getattr(child, property_name)()): - return child - if not reg_exp_search and isinstance(child, obj_type) and getattr(child, property_name)() == property_value: - return child - return None - -def get_item_view_index(item_view, row, column=0, parent=QtCore.QModelIndex()): - """ - Retrieve the index for a specified row/column, with optional parent - This is necessary when needing to reference into nested hierarchies in a QTreeView - item_view: The QAbstractItemView instance - row: The requested row index - column: The requested column index (defaults to 0 in case of single column) - parent: Parent index (defaults to invalid) - """ - item_model = item_view.model() - model_index = item_model.index(row, column, parent) - return model_index - - -def get_item_view_index_rect(item_view, index): - """ - Gets the QRect for a given index in a QAbstractItemView (e.g. QTreeView, QTableView, QListView). - This is helpful because for sending mouse events to a QAbstractItemView, you have to send them to - the viewport() widget of the QAbstractItemView. - item_view: The QAbstractItemView instance - index: A QModelIndex for the item index - """ - return item_view.visualRect(index) - - -def item_view_index_mouse_click(item_view, index, button=QtCore.Qt.LeftButton, modifier=QtCore.Qt.NoModifier): - """ - Helper method version of QTest.mouseClick for injecting mouse clicks on a QAbstractItemView - item_view: The QAbstractItemView instance - index: A QModelIndex for the item index to be clicked - """ - item_index_rect = get_item_view_index_rect(item_view, index) - item_index_center = item_index_rect.center() - - # For QAbstractItemView widgets, the events need to be forwarded to the actual viewport() widget - QTest.mouseClick(item_view.viewport(), button, modifier, item_index_center) - - -def item_view_mouse_click(item_view, row, column=0, button=QtCore.Qt.LeftButton, modifier=QtCore.Qt.NoModifier): - """ - Helper method version of 'item_view_index_mouse_click' using a row, column instead of a QModelIndex - item_view: The QAbstractItemView instance - row: The requested row index - column: The requested column index (defaults to 0 in case of single column) - """ - index = get_item_view_index(item_view, row, column) - item_view_index_mouse_click(item_view, index, button, modifier) - - -async def wait_for_action_in_menu(menu, pattern, timeout=1.0): - """ - Finds a QAction inside a menu, based on the specified pattern. - - menu: The QMenu to search - pattern: The action text or pattern to match (see find_child_by_pattern) - If pattern specifies a QWidget, this will search for the associated QWidgetAction - """ - action = await wait_for_child_by_pattern(menu, pattern, timeout=timeout) - if action is None: - raise TimeoutError(f"Failed to find context menu action for {pattern}") - - # If we've found a valid QAction, we're good to go - if hasattr(action, 'trigger'): - return action - - # If pattern matches a widget and not a QAction, look for an associated QWidgetAction - widget_actions = find_children_by_pattern(menu, type=QtWidgets.QWidgetAction) - underlying_widget_action = None - for widget_action in widget_actions: - widgets_to_check = [widget_action.defaultWidget()] + widget_action.createdWidgets() - for check_widget in widgets_to_check: - if action in _get_children(check_widget): - underlying_widget_action = widget_action - break - if underlying_widget_action is not None: - action = underlying_widget_action - break - - if not hasattr(action, 'trigger'): - raise RuntimeError(f"Failed to find action associated with widget {action}") - return action - - -def queue_hide_event(widget): - """ - Explicitly post a hide event for the next frame, this can be used to ensure modal dialogs exit correctly. - - widget: The widget to hide - """ - qApp.postEvent(widget, QtGui.QHideEvent()) - - -async def wait_for_destroyed(obj, timeout=1.0): - """ - Waits for a QObject (including a widget) to be fully destroyed - - This can be used to wait for a modal dialog to shut down properly - - obj: The object to wait on destruction - timeout: The time, in seconds to wait. 0 for an indefinite wait. - """ - was_destroyed = False - def on_destroyed(): - nonlocal was_destroyed - was_destroyed = True - obj.destroyed.connect(on_destroyed) - return await wait_for_condition(lambda: was_destroyed, timeout=timeout) - - -async def close_modal(modal_widget, timeout=1.0): - """ - Closes a modal dialog and waits for it to be cleaned up. - - This attempts to ensure the modal event loop gets properly exited. - - modal_widget: The widget to close - timeout: The time, in seconds, to wait. 0 for an indefinite wait. - """ - queue_hide_event(modal_widget) - return await wait_for_destroyed(modal_widget, timeout=timeout) - - -def trigger_context_menu_entry(widget, pattern, pos=None, index=None): - """ - Trigger a context menu event on a widget and activate an entry - widget: The widget to trigger the event on - pattern: The action text or pattern to match (see find_child_by_pattern) - pos: Optional, the QPoint to set as the event origin - index: Optional, the QModelIndex to click in widget - widget must be a QAbstractItemView - """ - async def async_wrapper(): - menu = await open_context_menu(widget, pos=pos, index=index) - action = await wait_for_action_in_menu(menu, pattern) - action.trigger() - queue_hide_event(menu) - - result = async_wrapper() - # If we have an event loop, go ahead and just return the coroutine - # Otherwise, do a synchronous wait - if event_loop.is_running(): - return result - else: - return run_async(result) - - -async def open_context_menu(widget, pos=None, index=None, timeout=1.0): - """ - Trigger a context menu event on a widget - widget: The widget to trigger the event on - pos: Optional, the QPoint to set as the event origin - index: Optional, the QModelIndex to click in widget - widget must be a QAbstractItemView - - Returns the menu that was created. - """ - if index is not None: - if pos is not None: - raise RuntimeError("Error: 'index' and 'pos' are mutually exclusive") - pos = widget.visualRect(index).center() - parent = widget - widget = widget.viewport() - pos = widget.mapFrom(parent, pos) - if pos is None: - pos = widget.rect().center() - - # Post both a mouse event and a context menu to let the widget handle whichever is appropriate - qApp.postEvent(widget, QtGui.QContextMenuEvent(QtGui.QContextMenuEvent.Mouse, pos)) - QtTest.QTest.mouseClick(widget, Qt.RightButton, Qt.NoModifier, pos) - - menu = None - # Wait for a menu popup - def menu_has_focus(): - nonlocal menu - for fw in [qApp.activePopupWidget(), qApp.activeModalWidget(), qApp.focusWidget(), qApp.activeWindow()]: - if fw and isinstance(fw, QtWidgets.QMenu) and fw.isVisible(): - menu = fw - return True - return False - await wait_for_condition(menu_has_focus, timeout) - return menu - - -def move_mouse(widget, position): - """ - Helper method to move the mouse to a specified position on a widget - widget: The widget to trigger the event on - position: The QPoint (local to widget) to move the mouse to - """ - # For some reason, Qt wouldn't register the mouse movement correctly unless both of these ways are invoked. - # The QTest.mouseMove seems to update the global cursor position, but doesn't always result in the MouseMove event being - # triggered, which prevents drag/drop being able to be simulated. - # Similarly, if only the MouseMove event is sent by itself to the core application, the global cursor position wasn't - # updated properly, so drag/drop logic that depends on grabbing the globalPos didn't work. - QtTest.QTest.mouseMove(widget, position) - event = QtGui.QMouseEvent(QtCore.QEvent.MouseMove, position, widget.mapToGlobal(position), QtCore.Qt.LeftButton, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier) - QtCore.QCoreApplication.sendEvent(widget, event) - - -def drag_and_drop(source, target, source_point = QtCore.QPoint(), target_point = QtCore.QPoint()): - """ - Simulate a drag/drop event from a source object to a specified target - This has special case handling if the source is a QDockWidget (for docking) vs normal drag/drop - source: The source object to initiate the drag from - This is either a QWidget, or a tuple of (QAbstractItemView, QModelIndex) for dragging an item view item - target: The target object to drop on after dragging - This is either a QWidget, or a tuple of (QAbstractItemView, QModelIndex) for dropping on an item view item - source_point: Optional, The QPoint to initiate the drag from. If none is specified, the center of the source will be used. - target_point: Optional, The QPoint to drop on. If none is specified, the center of the target will be used. - """ - # Flag if this drag/drop is for docking, which has some special cases - docking = False - - # If the source is a tuple of (QAbstractItemView, QModelIndex), we need to use the - # viewport() as the source, and find the location of the index - if isinstance(source, tuple) and len(source) == 2: - source_item_view = source[0] - source_widget = source_item_view.viewport() - source_model_index = source[1] - source_rect = source_item_view.visualRect(source_model_index) - else: - # There are some special case actions if we are doing this drag for docking, - # so figure this out by checking if the source is a QDockWidget - if isinstance(source, QtWidgets.QDockWidget): - docking = True - - source_widget = source - source_rect = source.rect() - - # If the target is a tuple of (QAbstractItemView, QModelIndex), we need to use the - # viewport() as the target, and find the location of the index - if isinstance(target, tuple) and len(target) == 2: - target_item_view = target[0] - target_widget = target_item_view.viewport() - target_model_index = target[1] - target_rect = target_item_view.visualRect(target_model_index) - else: - # If we are doing a drag for docking, we actually want all the mouse events - # to still be directed through the source widget - if docking: - target_widget = source_widget - else: - target_widget = target - target_rect = target.rect() - - # If no source_point is specified, we need to find the center point of - # the source widget - if source_point.isNull(): - # If we are dragging for docking, initiate the drag from the center of the - # dock widget title bar - if docking: - title_bar_widget = source.titleBarWidget() - if title_bar_widget: - source_point = title_bar_widget.geometry().center() - else: - raise RuntimeError("No titleBarWidget found for QDockWidget") - # Otherwise, can just find the center of the rect - else: - source_point = source_rect.center() - - # If no target_point was specified, we need to find the center point of the target widget - if target_point.isNull(): - target_point = target_rect.center() - - # If we are dragging for docking and we aren't dragging within the same source/target, - # the mouse movements need to be directed to the source_widget, so we need to use the - # difference in global positions of our source and target widgets to adjust the target_point - # to be relative to the source - if docking and source != target: - source_top_left = source.mapToGlobal(QtCore.QPoint(0, 0)) - target_top_left = target.mapToGlobal(QtCore.QPoint(0, 0)) - offset = target_top_left - source_top_left - target_point += offset - - # Move the mouse to the source spot where we will start the drag - move_mouse(source_widget, source_point) - - # Press the left-mouse button to begin the drag - QtTest.QTest.mousePress(source_widget, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier, source_point) - - # If we are dragging for docking, we first need to drag the mouse past the minimum distance to - # trigger the docking system properly - if docking: - drag_distance = QtWidgets.QApplication.startDragDistance() + 1 - docking_trigger_point = source_point + QtCore.QPoint(drag_distance, drag_distance) - move_mouse(source_widget, docking_trigger_point) - - # Drag the mouse to the target widget over the desired point - move_mouse(target_widget, target_point) - - # Release the left-mouse button to complete the drop. - # If we are docking, we need to delay the actual mouse button release because the docking system has - # a delay before the drop zone becomes active after it has been hovered, which can be found here: - # FancyDockingDropZoneConstants::dockingTargetDelayMS = 110 ms - # So we need to delay greater than dockingTargetDelayMS after the final mouse move - # over the intended target. - delay = -1 - if docking: - delay = 200 - QtTest.QTest.mouseRelease(target_widget, QtCore.Qt.LeftButton, QtCore.Qt.NoModifier, target_point, delay) - - # Some drag/drop events have extra processing on the following event tick, so let those processEvents - # first before we complete the drag/drop operation - QtWidgets.QApplication.processEvents() - - -def trigger_action_async(action): - """ - Convenience function. Triggers an action asynchronously. - This can be used if calling action.trigger might block (e.g. if it opens a modal dialog) - - action: The action to trigger - """ - return run_soon(lambda: action.trigger()) - - -def click_button_async(button): - """ - Convenience function. Clicks a button asynchronously. - This can be used if calling button.click might block (e.g. if it opens a modal dialog) - - button: The button to click - """ - return run_soon(lambda: button.click()) - - -async def wait_for_modal_widget(timeout=1.0): - """ - Waits for an active modal widget and returns it. - """ - return await wait_for(lambda: qApp.activeModalWidget(), timeout=timeout) - -async def wait_for_popup_widget(timeout=1.0): - """ - Waits for an active popup widget and returns it. - """ - return await wait_for(lambda: qApp.activePopupWidget(), timeout=timeout) \ No newline at end of file diff --git a/Tests/ly_shared/s3_utils.py b/Tests/ly_shared/s3_utils.py deleted file mode 100755 index 5c516094f3..0000000000 --- a/Tests/ly_shared/s3_utils.py +++ /dev/null @@ -1,131 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" -import pytest -pytest.importorskip("boto3") -import boto3 -import botocore.exceptions -import logging -import os - -import ly_test_tools.environment.file_system as file_system - -logger = logging.getLogger(__name__) - - -class KeyExistsError(Exception): - pass - - -class KeyDoesNotExistError(Exception): - pass - - -class S3Utils(object): - """ - Stores a boto3 S3 client to use for AWS S3 functionalities. - """ - DEFAULT_REGION = 'us-west-2' - - def __init__(self, boto3_session=None): - # type: (boto3.Session) -> None - """ - The boto3 session can be set during init, or a default one will be created. - :param boto3_session: A boto3 session - """ - if boto3_session: - self._session = boto3_session - else: - logger.info("No session provided, using default profile for s3 resource") - self._session = boto3.session.Session() - self._s3_resource = self._session.resource('s3') - - def upload_to_bucket(self, bucket_name, file_path, overwrite=False): - """ - Uploads a given file to the given S3 bucket. - :param bucket_name: Name of the S3 bucket where the file should be uploaded. - :param file_path: Path to the target file. - :param overwrite: Overwrite the key if it exists. - """ - if not self.bucket_exists_in_s3(bucket_name): - self._s3_resource.create_bucket(Bucket=bucket_name) - - s3_bucket = self._s3_resource.Bucket(bucket_name) - - file_key = os.path.basename(file_path) - if not overwrite and self.key_exists_in_bucket(bucket_name, file_key): - raise KeyExistsError("Key '{}' already exists in S3 bucket {}".format(file_key, bucket_name)) - - s3_bucket.upload_file(file_path, file_key) - logger.info("Uploading {} to S3 bucket {}".format(file_key, bucket_name)) - - def download_from_bucket(self, bucket_name, file_key, destination_dir, file_name=None): - """ - Download the given key from the given S3 bucket to the given destination. Logs an error if there is not enough \ - space available for the download. - :param bucket_name: Name of the S3 bucket containing the desired file. - :param file_key: Name of the file stored in S3. - :param destination_dir: Directory where the file should be downloaded to. - :param file_name: The name of the file you want to save it as. Defaults to the file_key. - """ - self.bucket_exists_in_s3(bucket_name) - - if not self.key_exists_in_bucket(bucket_name, file_key): - raise KeyDoesNotExistError("Key '{}' does not exist in S3 bucket {}".format(file_key, bucket_name)) - - obj_summary = self._s3_resource.ObjectSummary(bucket_name, file_key) - required_space = obj_summary.size - - file_system.check_free_space(destination_dir, required_space, "Insufficient space available for download:") - - if not os.path.exists(destination_dir): - os.makedirs(destination_dir) - - if file_name is None: - file_name = file_key - destination_path = os.path.join(destination_dir, file_name) - self._s3_resource.Object(bucket_name, file_key).download_file(destination_path) - logger.info("Downloading {} to {}".format(file_key, destination_path)) - - def bucket_exists_in_s3(self, bucket_name): - """ - Verifies that the S3 bucket exists. - :param bucket_name: Name of the S3 bucket that may or may not exist. - :return: True if the bucket exists. False otherwise. - """ - bucket_exists = True - - try: - self._s3_resource.meta.client.head_bucket(Bucket=bucket_name) - except botocore.exceptions.ClientError as err: - if err.response['Error']['Code'] == '404': - bucket_exists = False - - return bucket_exists - - def key_exists_in_bucket(self, bucket_name, file_key): - """ - Verifies that the given key does not already exist in the given S3 bucket. - :param bucket_name: Name of the S3 bucket that may or may not contain the file key. - :param file_key: Name of the file key in question. - :return: True if the key exists. False otherwise. - """ - key_exists = True - obj_summary = self._s3_resource.ObjectSummary(bucket_name, file_key) - - # Attempting to access any member of ObjectSummary for a nonexistent key will throw an exception - # There is no built-in way to check key existence otherwise - try: - obj_summary.size - except botocore.exceptions.ClientError as err: - if err.response['Error']['Code'] == '404': - key_exists = False - - return key_exists diff --git a/Tests/ly_shared/screenshot_utils.py b/Tests/ly_shared/screenshot_utils.py deleted file mode 100755 index c000cd8258..0000000000 --- a/Tests/ly_shared/screenshot_utils.py +++ /dev/null @@ -1,195 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import os -import string - -from .file_utils import move_file -from . import phase as phase -from ly_test_tools.environment.waiter import wait_for -from ly_test_tools.image.screenshot_compare_qssim import qssim as compare_screenshots - -from ly_remote_console.remote_console_commands import capture_screenshot_command as capture_screenshot_command -from ly_remote_console.remote_console_commands import send_command_and_expect_response as send_command_and_expect_response - - -def get_next_screenshot_at_path(screenshot_path, prefix='screenshot', num_digits=4): - """ - :param screenshot_path: Root folder where the screenshots are being generated by the Launcher pr Editor. - :param prefix: Generated screenshot files are named sequentially using the prefix. - e.g: screenshot0000.jpg, screenshot0001.jpg and so on. - :param num_digits: How many digits are used for file name formation. - :return: A string with the file name (relative to screenshot_path). - """ - max_counter = 10**num_digits - counter = 0 - while counter < max_counter: - numberstr = "{}".format(counter) - formattednumber = numberstr.zfill(num_digits) - filename = "{}{}.jpg".format(prefix, formattednumber) - filepath = os.path.join(screenshot_path, filename) - if not os.path.exists(filepath): - #This filename is available. - return filename - raise AssertionError("All possible screenshot names at directory {} are taken".format(screenshot_path)) - - -def take_screenshot(remote_console_instance, workspace, screenshot_name): - """ - Takes an in game screenshot using the remote console instance passed in, validates that the screenshot exists - and then renames that screenshot to something defined by the user of this function. - :param remote_console_instance: Remote console instance that is attached to a specific launcher instance - :param workspace: workspace instance so we can get the platform cache folder. - :param screenshot_name: Name of the screenshot - :return: None - """ - screenshot_path = os.path.join(workspace.paths.platform_cache(), 'user', 'screenshots') - expected_screenshot_name = get_next_screenshot_at_path(screenshot_path) - capture_screenshot_command(remote_console_instance) - wait_for(lambda: os.path.exists(os.path.join(screenshot_path, expected_screenshot_name)), - timeout=10, - exc=AssertionError('Screenshot at path:{} and with name:{} not found.'.format(screenshot_path, expected_screenshot_name)) ) - wait_for(lambda: rename_screenshot(screenshot_path, screenshot_name), - timeout=10, - exc=AssertionError('Screenshot at path:{} and with name:{} is still in use.'.format(screenshot_path, screenshot_name))) - - -def rename_screenshot(screenshot_path, screenshot_name): - """ - Tries to rename the screenshot when the file is done being written to - :param screenshot_path: Path to the Screenshot folder - :param screenshot_name: Name we wish to change the screenshot to - :return: True when operation is completed, False if the file is still in use - """ - try: - src_img = os.path.join(screenshot_path, 'screenshot0000.jpg') - dst_img = os.path.join(screenshot_path, '{}.jpg'.format(screenshot_name)) - print('Trying to rename {} to {}'.format(src_img, dst_img)) - os.rename(src_img, dst_img) - return True - except Exception as e: - print('Found error {0} when trying to rename screenshot.'.format(str(e))) - return False - - -def move_screenshots(screenshot_path, file_type, logs_path): - """ - Moves screenshots of a specific file type to the flume location so we can gather all of the screenshots we took. - :param screenshot_path: Path to the screenshot folder - :param file_type: Types of Files to look for. IE .jpg, .tif, etc - :param logs_path: Path where flume gathers logs to be upload - """ - for file_name in os.listdir(screenshot_path): - if file_name.endswith(file_type): - move_file(screenshot_path, logs_path, file_name) - -def move_screenshots_to_artifacts(screenshot_path, file_type, artifact_manager): - """ - Saves screenshots of a specific file type to the artifact manager then removes the original files - :param screenshot_path: Path to the screenshot folder - :param file_type: Types of Files to look for. IE .jpg, .tif, etc - :param artifact_manager: The artifact manager to save the artifacts to - """ - for file_name in os.listdir(screenshot_path): - if file_name.endswith(file_type): - full_path_name = os.path.join(screenshot_path, file_name) - artifact_manager.save_artifact(full_path_name) - os.remove(full_path_name) - - - -def compare_golden_image(similarity_threshold, screenshot, screenshot_path, golden_image_name, - golden_image_path=None): - """ - This function assumes that your golden image filename contains the same base screenshot name and the word "golden" - ex. pc_gamelobby_golden - - :param similarity_threshold: A float from 0.0 - 1.0 that determines how similar images must be or an asserts - :param screenshot: A string that is the full name of the screenshot (ex. 'gamelobby_host.jpg') - :param screenshot_path: A string that contains the path to the screenshots - :param golden_image_path: A string that contains the path to the golden images, defaults to the screenshot_path - :return: - """ - if golden_image_path is None: - golden_image_path = screenshot_path - - mean_similarity = compare_screenshots((os.path.join(screenshot_path, screenshot)), - (os.path.join(golden_image_path, golden_image_name))) - assert mean_similarity > similarity_threshold, \ - '{} screenshot comparison failed! Mean similarity value is: {}'\ - .format(screenshot, mean_similarity) - -def download_qa_golden_images(project_name, destination_dir, platform): - """ - Downloads the golden images for a specified project from s3. The project_name, platform, and filetype are used to - filter which images will be downloaded as the golden images. - - https://s3.console.aws.amazon.com/s3/buckets/ly-qae-jenkins-configs/golden-images/?region=us-west-1&tab=overview - - :param project_name: a string of the project name of the folder in s3. ex: 'MultiplayerSample' - :param destination_dir: a string of where the images will be downloaded to - :param platform: a string for the platform type ('pc', 'android', 'ios', 'darwin') - :param filetype: a string for the file type. ex: '.jpg', '.png' - :return: - """ - - # Currently we import s3_utils here instead of at the top because this is the only method that needs it, - # and s3_utils has an unmet dependency on boto3 that hasn't been resolved. Once s3_utils is functional again, - # this can move back to the top of the file. - try: - from . import s3_utils as s3_utils - except ImportError: - raise Exception("Failed to import s3_utils") - # end s3_utils import - - bucket_name = 'ly-qae-jenkins-configs' - path = 'golden-images/{}/{}/'.format(project_name, platform) - - if not s3_utils.key_exists_in_bucket(bucket_name, path): - raise s3_utils.KeyDoesNotExistError("Key '{}' does not exist in S3 bucket {}".format(path, bucket_name)) - for image in s3_utils.s3.Bucket(bucket_name).objects.filter(Prefix=path): - file_name = string.replace(image.key, path, '') - if file_name != '': - s3_utils.download_from_bucket(bucket_name, image.key, destination_dir, file_name) - - -def _retry_command(remote_console_instance, command, output, tries=10, timeout=10): - """ - Retries specified console command multiple times and asserts if it still can not send. - :param remote_console: the remote console connected to the launcher. - :param command: the command to send to the console. - :param output: The expected output to check if the command was sent successfully. - :param tries: The amount of times to try before asserting. - :param timeout: The amount of time in seconds to wait for each retry send. - :return: True if succeeded, will assert otherwise. - """ - while tries > 0: - tries -= 1 - try: - send_command_and_expect_response(remote_console_instance, command, output) - return True - except: - pass #Do nothing. Let the number of tries get to 0 if necessary. - assert False, "Command \"{}\" failed to run in remote console.".format(command) - - -def prepare_for_screenshot_compare(remote_console_instance): - """ - Prepares launcher for screenshot comparison. Removes any debug text and antialiasing that may result in interference - with the comparison. - - :param remote_console_instance: Remote console instance that is attached to a specific launcher instance - :return: - """ - wait_for(lambda: _retry_command(remote_console_instance, 'r_displayinfo 0', - '$3r_DisplayInfo = $60 $5[DUMPTODISK, RESTRICTEDMODE]$4')) - wait_for(lambda: _retry_command(remote_console_instance, 'r_antialiasingmode 0', - '$3r_AntialiasingMode = $60 $5[]$4')) diff --git a/Tests/performance/Scripts/apbatch_perf_summary.py b/Tests/performance/Scripts/apbatch_perf_summary.py deleted file mode 100755 index ed34cbf490..0000000000 --- a/Tests/performance/Scripts/apbatch_perf_summary.py +++ /dev/null @@ -1,211 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -""" -Script is designed to help with asset processor performance testing. - -This script is capable of running AssetProcessorBatch.exe and -calculating how much time did it take to execute it. Also it is -processing ap batch output and grabbing actual asset processing time. - -Apart from that script is capable of logging folder size -(files, folders, actual size in bytes). - -Usage: -python apbatch_perf_summary.py [-h] {folder_size,run_apbatch} - -python apbatch_perf_summary.py folder_size path project -cache - -Will show folder size: files, folders and actual size in bytes. - -build_path: Full path to the build dev directory, e.g. F:\builds\lumberyard-0.0-639162-pc-1985\dev -project: Full project name (e.g. StarterGame or SamplesProject). --cache: specify if you need to check cache folder instead of source assets. - -python apbatch_perf_summary.py run_apbatch build_path platform num_launches -delete_cache - -Will launch AssetProcessorBatch.exe num_launches times. Will return average -running time and average asset processing time. - -build_path: Full path to the build dev directory, e.g. F:\builds\lumberyard-0.0-639162-pc-1985\dev -platform: Which platform to launch - one of following: vc141, vc142, mac -num_launches: How many times do you want to launch ap batch. --delete_cache: specify if you want to delete Cache before each run -""" - - -import subprocess -import time -import os -import argparse -import test_tools.shared.file_system as fs -import errno - - -def run_ap_batch(build_path, platform): - """ - Given a path to build will run ap batch and return total running and processing times. - :param build_path: Full path to build dev, e.g. F:\builds\lumberyard-0.0-639162-pc-1985\dev - :param platform: Specify platform where to run apbatch: vc141, vc142 or mac. - :return: (processing_time, total_running_time) tuple. - """ - assert os.path.exists(build_path) - - now = time.time() - process = subprocess.Popen(['AssetProcessorBatch'], cwd=os.path.join(build_path, platform), - shell=True, stdout=subprocess.PIPE) - for line in iter(process.stdout.readline, ''): - if 'Total Assets Processing Time' in line: - processing_time = line.split(':')[2] - process.wait() - end = time.time() - - print 'Processing time: {}'.format(processing_time.strip()) - print 'Total time: {}s'.format(end - now) - - return float(processing_time.split('s')[0]), float(end - now) - - -def run_several_times(build_path, platform, num_launches, erase_cache): - """ - Given path to build, project name and boolean parameter (whether there is need to delete a cache) - will run AssetProcessorBatch.exe num_launches and will return average running and processing times. - :param build_path: Full path to build dev, e.g. F:\builds\lumberyard-0.0-639162-pc-1985\dev - :param platform: Specify platform where to run apbatch: vc141, vc142 or mac. - :param num_launches: How many times user needs to launch ap batch. - :param erase_cache: yes/no or True/False in case user needs Cache folder to be deleted prior to apbatch launch. - :return: (avg_processing_time, avg_running_time) tuple. - """ - if not os.path.exists(build_path): - raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), build_path) - - average_processing_time = 0 - average_total_time = 0 - - # running apbatch num_launches times and getting times - for i in range(num_launches): - if erase_cache and os.path.exists(os.path.join(build_path, 'Cache')): - fs.delete([os.path.join(build_path, 'Cache')], False, True) - print 'Iteration # {}'.format(i) - processing_time, total_time = run_ap_batch(build_path, platform) - average_processing_time += processing_time - average_total_time += total_time - - # calculating average times - average_processing_time /= num_launches - average_total_time /= num_launches - - return average_processing_time, average_total_time - - -def folder_size(path): - """ - Given path to a build will calculate folder size. - :param path: Full path to the folder for which you need folder size info. - :return: (total_files_count, total_folders_count, total_size_in_bytes). - """ - total_size = 0 - total_files_count = 0 - total_folder_count = 0 - - if not os.path.exists(path): - raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), path) - - # walking over the folder and calculating files, folder; total files size - for dirpath, dirnames, filenames in os.walk(path): - total_folder_count += len(dirnames) - total_files_count += len(filenames) - for f in filenames: - fp = os.path.join(dirpath, f) - total_size += os.path.getsize(fp) - - return total_files_count, total_folder_count, total_size - - -def run_apbatch(args): - """ - Function for argparse command run_apbatch: - running run_several_times function and printing its results. - :param args: args.build_path: see run_several_times build_path. - args.num_launches: see run_several_times num_launches. - args.platform: see run_several_times platform. - args.delete: see run_several_times erase_cache. - :return: None - """ - platform_bin = { - 'vc141': 'Bin64vc141', - 'vc142': 'Bin64vc142', - 'mac': 'BinMac64' - } - running_times = run_several_times(args.build_path, platform_bin[args.platform], args.num_launches, args.delete_cache) - print '\nAssets processing time: {}s'.format(running_times[0]) - print 'Total running time: {}s'.format(running_times[1]) - - -def print_folder_size(args): - """ - Function for argparse command folder_size: - running folder_size function and printing its results. - :param args: args.build_path: see folder_size path. - args.project: specified project which folder will be analyzed. - args.cache: yes/no or True/False - whether user need to check Cache folder or not. - :return: None - """ - print '{} (cache: {}) folder size:'.format(args.project, args.cache) - if args.cache: - path = os.path.join(args.build_path, 'Cache', args.project) - else: - path = os.path.join(args.build_path, args.project) - folder_size_data = folder_size(path) - print 'Files: {}'.format(folder_size_data[0]) - print 'Folders: {}'.format(folder_size_data[1]) - print 'Size: {}'.format(folder_size_data[2]) - - -def main(): - """Main function with set-up and commands execution""" - # creating command line arguments parser - parser = argparse.ArgumentParser(prog = 'apbatch_perf_summary') - subparsers = parser.add_subparsers(help = 'sub-command help', dest='command') - - parser_folder_size = subparsers.add_parser('folder_size', - help='Will show folder size: files, folders and actual size in bytes. ') - parser_run_apbatch = subparsers.add_parser('run_apbatch', help='run_apbatch help') - - parser_run_apbatch.add_argument('build_path', - help='Full path to the build dev directory, e.g. ' - 'F:\\builds\\lumberyard-0.0-639162-pc-1985\\dev') - parser_run_apbatch.add_argument('platform', choices=['vc141', 'vc142', 'mac'], help='vc141, vc142 or mac') - parser_run_apbatch.add_argument('num_launches', type=int, help='How many times do you want to launch ap batch.') - parser_run_apbatch.add_argument('-delete_cache', default=False, action='store_true', - help='Specify if you want to delete Cache before and between runs') - - parser_run_apbatch.set_defaults(func=run_apbatch) - - parser_folder_size.add_argument('build_path', - help='Full path to the build dev directory, e.g. ' - 'F:\\builds\\lumberyard-0.0-639162-pc-1985\dev') - parser_folder_size.add_argument('project', help='Full project name (e.g. StarterGame or SamplesProject).') - parser_folder_size.add_argument('-cache', default=False, action='store_true', - help='Specify if you want to check cache folder', required=False) - parser_folder_size.set_defaults(func=print_folder_size) - - args = parser.parse_args() - - # executing passed commands - args.func(args) - - -# calling main function if script is launched as standalone module -if __name__ == '__main__': - main() - diff --git a/Tests/pipeline/__init__.py b/Tests/pipeline/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/pipeline/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/pipeline/product_dependency_tests/AssetDependencyTests.py b/Tests/pipeline/product_dependency_tests/AssetDependencyTests.py deleted file mode 100755 index 25e94b150c..0000000000 --- a/Tests/pipeline/product_dependency_tests/AssetDependencyTests.py +++ /dev/null @@ -1,88 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -from TestFixtures import HeliosProjectFixture - -import os -import pytest -import sqlite3 -import time -import codecs - -def AssertProductHasDependencies(engineRoot, projectName, buildInfo, dbCheckWaitTime, product, pathDependencies, assetIdDependencies): - productNameInDB = os.path.join(buildInfo.cacheSubfolder, projectName, product) - productNameInDB = productNameInDB.replace("\\", "/") - - sqlDatabasePath = os.path.join(engineRoot, "Cache", projectName, "assetdb.sqlite") - print (" * Connecting to database {}".format(sqlDatabasePath)) - sqlConnection = sqlite3.connect(sqlDatabasePath) - productRowsList = list() - productDbWait = dbCheckWaitTime - while len(productRowsList) == 0 and productDbWait > 0: - productRows = sqlConnection.execute( - "SELECT ProductID FROM Products where ProductName='{}'".format(productNameInDB)) - productRowsList = list(productRows.fetchall()) - time.sleep(1) - productDbWait = productDbWait - 1 - assert len(productRowsList) == 1, str.format("productRowsList= {}", productRowsList) - productId = int(productRowsList[0][0]) - - foundDependencies = list() - dependencyDbTimeout = dbCheckWaitTime - while len(foundDependencies) == 0 and dependencyDbTimeout > 0: - dependencyRows = sqlConnection.execute( - "SELECT * FROM ProductDependencies where ProductPK={}".format(productId)) - foundDependencies = list(dependencyRows.fetchall()) - time.sleep(1) - dependencyDbTimeout = dependencyDbTimeout - 1 - - foundAssetIds = list() - foundUnresolvedPaths = list() - - uuidIndex = 2 - subIdIndex = 3 - unresolvedPathIndex = 6 - for foundDependency in foundDependencies: - if foundDependency[unresolvedPathIndex] != "": - # If there's a path, there won't be an asset ID - foundUnresolvedPaths.append(foundDependency[unresolvedPathIndex]) - else: - dependencyUUIDAsHex = codecs.encode(foundDependency[uuidIndex], 'hex_codec') - subId = str(foundDependency[subIdIndex]) - assetId = "{}:{}".format(dependencyUUIDAsHex.decode('utf8'), subId) - foundAssetIds.append(assetId) - - assert sorted(pathDependencies) == sorted(foundUnresolvedPaths) - assert sorted(assetIdDependencies) == sorted(foundAssetIds) - - -def test_VegdescriptorlistValidDependencies_DependenciesInDb(HeliosProjectFixture): - engineRoot, projectName, buildInfo, dbCheckWaitTime = HeliosProjectFixture - pathDependencies = {} - assetIdDependencies = { - # MeshAsset reference to "objects/default/primative_wedge_30.cgf" - "e8b39f901f905e3998aa6f8ec4e91507:0", - # MaterialAsset reference to "materials/am_grass1.mtl" - "1151f14d38a65579888abe3139882e68:0" - } - AssertProductHasDependencies(engineRoot, projectName, buildInfo, dbCheckWaitTime, "heliosvegetation.vegdescriptorlist", pathDependencies, assetIdDependencies) - -def test_CloudLibrarytValidDependencies_DependenciesInDb(HeliosProjectFixture): - engineRoot, projectName, buildInfo, dbCheckWaitTime = HeliosProjectFixture - pathDependencies = {} - assetIdDependencies = { - # MaterialAsset reference to "materials/clouds/baseclouds.mtl" - "f249f13854055cfba3b6d95bdc1a3db0:0" - } - AssertProductHasDependencies(engineRoot, projectName, buildInfo, dbCheckWaitTime, "libs/clouds/default.xml", pathDependencies, assetIdDependencies) diff --git a/Tests/pipeline/product_dependency_tests/LvlDepTestDynamicSlice.py b/Tests/pipeline/product_dependency_tests/LvlDepTestDynamicSlice.py deleted file mode 100755 index de7609c92c..0000000000 --- a/Tests/pipeline/product_dependency_tests/LvlDepTestDynamicSlice.py +++ /dev/null @@ -1,228 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -from TestFixtures import EmptyProjectFixture - -import fileinput -import os -import pytest -import shutil -import sqlite3 -import time - -import SubprocessUtils - -def MakeEditorPythonFile(testLevelName, assetGuid, tempFolder, templatePythonFile): - outputFileName = templatePythonFile.replace(".template", ".py") - outputFilePath = os.path.join(tempFolder, outputFileName) - shutil.copy(os.path.join(os.path.dirname(os.path.realpath( - __file__)), templatePythonFile), outputFilePath) - for line in fileinput.FileInput(outputFilePath, inplace=1): - line = line.replace("${LevelName}", str.format('"{}"', testLevelName)) - line = line.replace("${MeshGuid}", str.format('"{}"', assetGuid)) - print (line) - return outputFilePath - -@pytest.mark.skip(reason="This test takes too long on Jenkins, and bundler tests catch everything we want from here") -def test_productDependencies_EntityInLevelWithAssetReference_ReferencedAssetIsLevelProductDependency( - EmptyProjectFixture, tmpdir): - print ("RunLvlDynamicSliceTest") - engineRoot, projectName, buildInfo, dbCheckWaitTime = EmptyProjectFixture - - - tempFolder = tmpdir.mkdir("EditorPyScripts") - print (" * Launch editor with dynamic slice test creation script") - - testLevelName = "SimpleLevel" - expectedDependencyGuid = "81C4A6AF-C57D-5734-81B7-822074358C4D" - exportLevelScriptPath = MakeEditorPythonFile(testLevelName, expectedDependencyGuid, str(tempFolder), "export_test_level.template") - - lyCommand = [buildInfo.editorExe, '/BatchMode', '/runpython', exportLevelScriptPath] - SubprocessUtils.SubprocessWithTimeout(lyCommand, engineRoot, 60) - - # Logic that the export_test_level.py script will run in the editor: - # * Create new level - # * Place an entity in the level - # * Add the mesh component to the entity - # * Assign a test asset to that component [dev\Engine\Objects\default\primitive_sphere.cgf] - # * Export the level - - print (" * Wait for the Asset Processor to copy the asset to the cache and update the asset database") - - projectCacheRoot = os.path.join(engineRoot, "Cache", projectName) - levelRelativeSubFolder = os.path.join("Levels", testLevelName) - cachePath = os.path.join(projectCacheRoot, buildInfo.cacheSubfolder, projectName, levelRelativeSubFolder, "level.pak") - # On an i7 running Lumberyard on an SSD, it normally takes about 1-2 minutes to complete this step. - # Add a few minutes onto that because the Jenkins machines may not be as fast. - pakTimeoutSeconds = 10 * 60 - pakTimeoutWaitTimeSeconds = 1 - # Wait for the level.pak file to exist in the cache - while not os.path.exists(cachePath) and pakTimeoutSeconds > 0: - time.sleep(pakTimeoutWaitTimeSeconds) - pakTimeoutSeconds -= pakTimeoutWaitTimeSeconds - - assert(os.path.exists(cachePath)) - - print (" * Open the asset database, check that the correct product dependency is set for the exported level.pak") - - # A newly created level will have all of these dependencies by default. - # These are tracked by the relative source path instead of the UUID because it's more readable. - expectedDependencyPaths = { - "materials/material_terrain_default.mtl", # from leveldata.xml - "EngineAssets/Materials/sky/sky.mtl", # from mission_mission0.xml - "EngineAssets/Materials/Water/ocean_default.mtl", # from mission_mission0.xml - "textures/skys/night/half_moon.tif" - } - - # Nothing is currently expected to unresolved, but this is left here in case that changes. - expectedUnresolvedPaths = { - # Hardcoded levelbuilder relative path output - os.path.join(levelRelativeSubFolder, "auto_resourcelist.txt"), - os.path.join(levelRelativeSubFolder, "level.cfg"), - os.path.join(levelRelativeSubFolder, "levelparticles.xml"), - os.path.join(levelRelativeSubFolder, "occluder.ocm"), - os.path.join(levelRelativeSubFolder, "preloadlibs.txt"), - os.path.join(levelRelativeSubFolder, "terrain", "cover.ctc"), - os.path.join(levelRelativeSubFolder, "terrain", "merged_meshes_sectors", "mmrm_used_meshes.lst"), - os.path.join(levelRelativeSubFolder, str.format("{}.xml",testLevelName)) - } - - # All expected GUIDs should match the format in the database: Lowercase, with no separators. - expectedDependencyGuids = { - expectedDependencyGuid.lower().replace('-','') - } - - CheckDatabaseForDependency(projectCacheRoot, projectName, testLevelName, expectedDependencyGuids, - expectedDependencyPaths, expectedUnresolvedPaths, buildInfo, dbCheckWaitTime) - - print ("/RunLvlDynamicSliceTest") - - -def CheckDatabaseForDependency(projectCacheRoot, projectName, testLevelName, expectedDependencyGuids, expectedDependencyPaths, expectedUnresolvedPaths, buildInfo, dbCheckWaitTime): - print ("CheckDatabaseForDependency") - - print (str.format(" * Checking expected dependencies for level.pak for level {}", testLevelName)) - print (str.format(" * Searching for these GUIDs as dependencies: {}", str(expectedDependencyGuids))) - print (str.format(" * Searching for these paths as dependencies: {}", str(expectedDependencyPaths))) - print (str.format(" * Searching for these paths as unresolved paths: {}", str(expectedUnresolvedPaths))) - - sqlDatabasePath = os.path.join(projectCacheRoot, "assetdb.sqlite") - print (" * Connecting to database " + sqlDatabasePath) - sqlConnection = sqlite3.connect(sqlDatabasePath) - try: - # Not using os.path.join because this is an expected string in a database - levelPakProduct = str.format('{}/{}/levels/{}/level.pak', buildInfo.cacheSubfolder, projectName.lower(), testLevelName.lower()) - print (" * Looking in product table for " + levelPakProduct) - productRows = sqlConnection.execute( - str.format("SELECT ProductID FROM Products where ProductName='{}'", levelPakProduct)) - - productRowsList = list(productRows.fetchall()) - - productDbWait = dbCheckWaitTime - while len(productRowsList) == 0 and productDbWait > 0: - time.sleep(1) - productDbWait = productDbWait - 1 - productRows = sqlConnection.execute( - str.format("SELECT ProductID FROM Products where ProductName='{}'", levelPakProduct)) - productRowsList = list(productRows.fetchall()) - - - assert len(productRowsList) == 1, "productRowsList= {}".format(productRowsList) - - print (" * Searching product results for product ID") - productId = int(productRowsList[0][0]) - - assert productId - - print (str.format(" * Searching for dependencies for product ID {}", str(productId))) - dependencyDbSuccess = False - dependencyDbTimeout = dbCheckWaitTime - # Make copies of the list in case multiple runs are required - expectedUnresolvedPathsCopy = [] - expectedDependencyGuidsCopy = [] - remainingDependencies = [] - - while (not dependencyDbSuccess) and dependencyDbTimeout > 0: - expectedUnresolvedPathsCopy = expectedUnresolvedPaths.copy() - expectedDependencyGuidsCopy = expectedDependencyGuids.copy() - productDependencyRows = sqlConnection.execute("SELECT * FROM ProductDependencies where ProductPK={}".format(productId)) - - dependencyRowIndex_SourceId = 2 - dependencyRowIndex_SubId = 3 - dependencyRowIndex_UnresolvedPath = 6 - - productDependencyRowList = list(productDependencyRows.fetchall()) - - expectedDependencyCount = len(expectedDependencyGuidsCopy) + len( - expectedDependencyPaths) + len(expectedUnresolvedPathsCopy) - - dependencyDbSuccess = len( - productDependencyRowList) == expectedDependencyCount - - expectedSubId = 0 - - # This will contain SQL data buffers, which are not hashable. - remainingDependencies = [] - - for dependencyRow in productDependencyRowList: - dependencySourceId = dependencyRow[dependencyRowIndex_SourceId] - dependencySubId = int(dependencyRow[dependencyRowIndex_SubId]) - dependencyDbSuccess = dependencyDbSuccess and dependencySubId == expectedSubId - - dependencySourceAsHex = str(dependencySourceId).encode('hex') - wasExpectedDependency = False - # If this dependency's UUID is in our expected UUID list, then count it as found. - if dependencySourceAsHex in expectedDependencyGuidsCopy: - wasExpectedDependency = True - expectedDependencyGuidsCopy.remove(dependencySourceAsHex) - - # If this dependency has an unresolved path that we expect, then count it as found. - unresolvedPath = dependencyRow[dependencyRowIndex_UnresolvedPath] - if unresolvedPath in expectedUnresolvedPathsCopy: - wasExpectedDependency = True - expectedUnresolvedPathsCopy.remove(unresolvedPath) - - if not wasExpectedDependency: - remainingDependencies.append(dependencySourceId) - - dependencyDbSuccess = dependencyDbSuccess and (len(expectedDependencyGuidsCopy) == 0 and - len(expectedUnresolvedPathsCopy) == 0 and - len(remainingDependencies) == len(expectedDependencyPaths)) - if not dependencyDbSuccess: - time.sleep(1) - dependencyDbTimeout = dependencyDbTimeout - 1 - - # do all the checks in asserts, instead of just assert dependencyDbSuccess so that error messages are more specific - assert len(productDependencyRowList) == expectedDependencyCount, str.format("Expected {} dependencies, found {}", expectedDependencyCount, len(productDependencyRowList)) - assert len(expectedDependencyGuidsCopy) == 0, str.format( - "Expected dependencies were not found in the asset database: {}", str(expectedDependencyGuids)) - assert len(expectedUnresolvedPathsCopy) == 0, str.format( - "Expected unresolved paths were not found in the asset database: {}", str(expectedUnresolvedPathsCopy)) - assert len(remainingDependencies) == len(expectedDependencyPaths), str.format("Expected dependency sizes do not match for {} and {}", str(remainingDependencies), str(expectedDependencyPaths)) - - for remainingDependency in remainingDependencies: - sourceRows = sqlConnection.execute("SELECT SourceName FROM Sources where SourceGuid=?", (sqlite3.Binary(remainingDependency),) ) - sourceRowsList = list(sourceRows.fetchall()) - assert len(sourceRowsList) == 1, str.format("Expected to find 1 entry for {}, found {} instead.", str(remainingDependency).encode('hex'), len(sourceRowsList)) - sourcePath = sourceRowsList[0][0] - assert sourcePath in expectedDependencyPaths, str.format("Could not find {} for UUID {} in the list of expected dependencies.", str(sourcePath), str(remainingDependency).encode('hex')) - expectedDependencyPaths.remove(sourcePath) - assert len(expectedDependencyPaths) == 0, str.format("Missing expected dependencies {}", str(expectedDependencyPaths)) - - print (" * Found all expected dependencies") - finally: - print (" * Closing database connection") - sqlConnection.close() - print ("/CheckDatabaseForDependency") - diff --git a/Tests/pipeline/product_dependency_tests/SubprocessUtils.py b/Tests/pipeline/product_dependency_tests/SubprocessUtils.py deleted file mode 100755 index d5637527f2..0000000000 --- a/Tests/pipeline/product_dependency_tests/SubprocessUtils.py +++ /dev/null @@ -1,52 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -import subprocess -import threading -import time - -class ThreadedSubprocess(): - def __init__(self, command, workingDirectory, timeOutMinutes): - self.command = command - self.workingDirectory = workingDirectory - self.timeOutSeconds=timeOutMinutes*60 - self.process = None - self.logOutput = [] - # Pytest doesn't handle asserts on other threads, capture them and report on the main thread. - self.assertError = None - - def RunCommand(self): - def RunThread(): - print (str.format("Subprocess thread starting for command: {}", self.command)) - self.process = subprocess.Popen(self.command, cwd=self.workingDirectory, shell=True, stdout=subprocess.PIPE, universal_newlines=True) - for stdoutLine in iter(self.process.stdout.readline, ""): - self.logOutput.append(stdoutLine) - self.process.communicate() - if self.process.returncode is None: - self.assertError = str.format("Subprocess call '{}' had no return code", self.command) - elif self.process.returncode != 0: - self.assertError = str.format("Subprocess call '{}' returned code {}", self.command, self.process.returncode) - print (str.format("Finished command, result {}: {}", self.process.returncode, self.command)) - - commandThread = threading.Thread(target=RunThread) - commandThread.start() - commandThread.join(self.timeOutSeconds) - assert not commandThread.is_alive(), str.format("Subprocess call '{}' timed out", self.command) - assert self.assertError is None, self.assertError - - -def SubprocessWithTimeout(command, workingDirectory, timeOutMinutes): - threadedSubprocess = ThreadedSubprocess(command, workingDirectory, timeOutMinutes) - threadedSubprocess.RunCommand() - return threadedSubprocess.logOutput diff --git a/Tests/pipeline/product_dependency_tests/TestAssets/updated_xml_schema_test.xmlschema b/Tests/pipeline/product_dependency_tests/TestAssets/updated_xml_schema_test.xmlschema deleted file mode 100644 index a979a1b245..0000000000 --- a/Tests/pipeline/product_dependency_tests/TestAssets/updated_xml_schema_test.xmlschema +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xml b/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xml deleted file mode 100644 index 95b20dc6c8..0000000000 --- a/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xmlschema b/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xmlschema deleted file mode 100644 index 69be99578d..0000000000 --- a/Tests/pipeline/product_dependency_tests/TestAssets/xml_schema_test.xmlschema +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Tests/pipeline/product_dependency_tests/TestCleanup.py b/Tests/pipeline/product_dependency_tests/TestCleanup.py deleted file mode 100755 index d57119db26..0000000000 --- a/Tests/pipeline/product_dependency_tests/TestCleanup.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -import os, subprocess, shutil, time - -import SubprocessUtils - -def KillProcess_Windows(processName): - # This only runs on Windows - processList = subprocess.check_output(str.format('tasklist /NH /FO CSV /FI "IMAGENAME eq {}"', processName)) - if processList is None or processList.startswith("INFO: No tasks are running which match the specified criteria."): - # Asset processor isn't running, no need to kill it. - return - os.system(str.format('taskkill /F /IM {}', processName)) - -def KillLumberyardTools(): - if os.name == 'nt': - KillProcess_Windows("Editor.exe") - KillProcess_Windows("AssetProcessor.exe") - else: - # Other operating systems are not yet supported, so have the test fail - assert False - - -def RemoveFolder(folderPath): - # The Asset Processor may take a bit to shut down, retry a few times if it's still holding a lock on a file. - retryCount = 5 - for retry in range(retryCount): - if os.path.exists(folderPath) == False: - return - - try: - shutil.rmtree(folderPath) - except: - if retry < retryCount-1: - # Wait a few seconds for whatever has the file handle open to close it. - time.sleep(5) - continue - else: - raise - - -def cleanUpArtifacts(engineRoot, projectName, buildInfo): - print ("cleanUpArtifacts") - - print (" * Shutting down Asset Processor") - KillLumberyardTools() - - # Setting the active project to one that is in Perforce will make sure other commands work correctly. Once the - # project created here is destroyed, lmbr_waf commands won't work. - if os.path.exists(os.path.join(buildInfo.buildFolder,buildInfo.lmbrCommand)): - print (" * Setting project to Helios") - SubprocessUtils.SubprocessWithTimeout(str.format("{} projects set-active Helios", buildInfo.lmbrCommand), buildInfo.buildFolder, 60) - else: - print (" * Cannot set project to FeatureTests, lmbr executable is not available.") - # Clearing the cache to guarantee that no data persists between tests. - print (" * Clearing the asset cache") - cachePath = os.path.join(engineRoot, "Cache", projectName) - RemoveFolder(cachePath) - - print (" * Clearing generated data") - projectPath = os.path.join(engineRoot, projectName) - RemoveFolder(projectPath) - - print ("/cleanUpArtifacts") diff --git a/Tests/pipeline/product_dependency_tests/TestFixtures.py b/Tests/pipeline/product_dependency_tests/TestFixtures.py deleted file mode 100755 index 91151748a5..0000000000 --- a/Tests/pipeline/product_dependency_tests/TestFixtures.py +++ /dev/null @@ -1,63 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -import os -import pytest - -import LmbrBuildInfo -import SubprocessUtils -import TestCleanup -import TestSetup - -@pytest.fixture(scope="session") -def EmptyProjectFixture(request): - print ("EmptyProjectFixture") - engineRoot = TestSetup.FindEngineRoot() - assert engineRoot - projectName = "LevelDepTestProj" - buildInfo = LmbrBuildInfo.GetBuildInfo(request.config.option.buildFlavor, engineRoot) - TestCleanup.cleanUpArtifacts(engineRoot, projectName, buildInfo) - - TestSetup.CreateLvlDepTestProject(engineRoot, projectName, buildInfo, request.config.option.thirdPartyPath) - # cleanUpArtifacts deleted the temp dir, so create it. - print ("Finished EmptyProjectFixture setup") - yield engineRoot, projectName, buildInfo, int(request.config.option.dbWaitTimes) - - print ("Tearing down EmptyProjectFixture") - TestCleanup.cleanUpArtifacts(engineRoot, projectName, buildInfo) - print ("Finished EmptyProjectFixture tear down") - - -# These tests require the Helios project to be built in profile and active before they are run. -# This external requirement allows faster iteration on these tests on Jenkins and locally. -@pytest.fixture(scope="session") -def HeliosProjectFixture(request): - print ("HeliosProjectFixture") - engineRoot = TestSetup.FindEngineRoot() - assert engineRoot - projectName = "Helios" - buildInfo = LmbrBuildInfo.GetBuildInfo(request.config.option.buildFlavor, engineRoot) - - # These tests are run on Jenkins after other tests, to minimize time spent on Jenkins jobs. - # Verify that the correct project has been set before this test starts. - - # Temporarily disabling while LY-103017 is not in Helios branch - # Creating a task to revert this change later: LY-103334 - - # Run asset processor once to process all assets, so the tests themselves can run at consistent speeds. - SubprocessUtils.SubprocessWithTimeout([buildInfo.assetProcessorBatch], engineRoot, 120) - - print ("Finished HeliosProjectFixture setup") - yield engineRoot, projectName, buildInfo, int(request.config.option.dbWaitTimes) - print ("Tearing down EmptyProjectFixture") diff --git a/Tests/pipeline/product_dependency_tests/XmlSchemaSystemTests.py b/Tests/pipeline/product_dependency_tests/XmlSchemaSystemTests.py deleted file mode 100755 index 51a349c185..0000000000 --- a/Tests/pipeline/product_dependency_tests/XmlSchemaSystemTests.py +++ /dev/null @@ -1,212 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -from TestFixtures import HeliosProjectFixture - -import pytest -import shutil -import subprocess -import os -import sqlite3 -import time - -TEST_ASSETS_FOLDER_NAME = 'TestAssetS' -TEST_XML_NAME = 'xml_schema_test.xml' -TEST_SCHEMA_NAME = 'xml_schema_test.xmlschema' -UPDATED_TEST_SCHEMA_NAME = 'updated_xml_schema_test.xmlschema' -SCHEMA_FOLDER_NAME = 'Schema' - -def test_XmlSchemaSystem_AddNewSchema_ReprocessXml(HeliosProjectFixture): - engineRoot, projectName, buildInfo, dbCheckWaitTime = HeliosProjectFixture - projectFolder = os.path.join(engineRoot, projectName) - - testAssetsFolder = os.path.dirname(os.path.realpath(__file__)) - testAssetsFolder = os.path.join(testAssetsFolder, TEST_ASSETS_FOLDER_NAME) - testXmlPath = os.path.join(testAssetsFolder, TEST_XML_NAME) - testSchemaPath = os.path.join(testAssetsFolder, TEST_SCHEMA_NAME) - updatedTestSchemaPath = os.path.join(testAssetsFolder, UPDATED_TEST_SCHEMA_NAME) - - projectXmlPath = os.path.join(projectFolder, TEST_XML_NAME) - schemaFolderInProject = os.path.join(projectFolder, SCHEMA_FOLDER_NAME) - projectSchemaPath = os.path.join(schemaFolderInProject, TEST_SCHEMA_NAME) - - # Clean up the existing test xml and schema assets - if CleanUpTestAsset(projectXmlPath) or CleanUpTestAsset(projectSchemaPath): - # Remove the test assets and its dependencies from the database - subprocess.call( - [os.path.join(buildInfo.buildFolder, 'AssetProcessorBatch'), "/gamefolder=Helios"]) - - # Copy test XML asset to the project - # No product dependency should be output for the XML asset without a corresponding schema - print ("Add new XML asset") - expectedUnresolvedPaths = {} - UpdateProjectAsset(testXmlPath, projectXmlPath, engineRoot, projectName, - expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, False) - - # Copy the XML schema asset to the project - # XML assets are expected to be reprocessed and output product dependencies - print ("Add new XML schema") - if not os.path.exists(schemaFolderInProject): - os.makedirs(schemaFolderInProject) - expectedUnresolvedPaths = { 'dependency1' } - UpdateProjectAsset(testSchemaPath, projectSchemaPath, engineRoot, projectName, - expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, False) - - # Update the XML schema asset inside the project - # XML assets are expected to be reprocessed and output product dependencies - print ("Update XML schema") - expectedUnresolvedPaths = { 'dependency1', 'dependency2'} - UpdateProjectAsset(updatedTestSchemaPath, projectSchemaPath, engineRoot, projectName, - expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, False) - - # Delete the schema asset in the project folder - # No product dependency should be output for the XML asset since the schema has been deleted - print ("Delete XML schema") - expectedUnresolvedPaths = {} - UpdateProjectAsset(updatedTestSchemaPath, projectSchemaPath, engineRoot, projectName, - expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, True) - - # Clean up the test assets - CleanUpTestAsset(projectXmlPath) - if not os.listdir(schemaFolderInProject): - os.rmdir(schemaFolderInProject) - -def test_XmlSchemaSystem_MoveSchemaToGem_ReprocessXml(HeliosProjectFixture): - engineRoot, projectName, buildInfo, dbCheckWaitTime = HeliosProjectFixture - - projectFolder = os.path.join(engineRoot, projectName) - testAssetsFolder = os.path.dirname(os.path.realpath(__file__)) - testAssetsFolder = os.path.join(testAssetsFolder, TEST_ASSETS_FOLDER_NAME) - testXmlPath = os.path.join(testAssetsFolder, TEST_XML_NAME) - testSchemaPath = os.path.join(testAssetsFolder, TEST_SCHEMA_NAME) - projectXmlPath = os.path.join(projectFolder, TEST_XML_NAME) - projectSchemaPath = os.path.join(projectFolder, SCHEMA_FOLDER_NAME, TEST_SCHEMA_NAME) - # The CertificateManager Gem was arbitrarily chosen. Schema can be added to any enabled gem - gemSchemaFolder = os.path.join(engineRoot, 'Gems', 'CertificateManager', 'Assets', SCHEMA_FOLDER_NAME) - gemSchemaPath = os.path.join(gemSchemaFolder, TEST_SCHEMA_NAME) - - # Clean up all the potential test xml and schema assets - if CleanUpTestAsset(projectXmlPath) or CleanUpTestAsset(projectSchemaPath) or CleanUpTestAsset(gemSchemaPath): - # Remove the test assets and its dependencies from the database - subprocess.call( - [os.path.join(buildInfo.buildFolder, 'AssetProcessorBatch'), "/gamefolder=Helios"]) - - print ('Add XML schema to CertificateManager gem') - if not os.path.exists(gemSchemaFolder): - os.makedirs(gemSchemaFolder) - shutil.copyfile(testSchemaPath, gemSchemaPath) - - print ('Reprocess test assets') - expectedUnresolvedPaths = { 'dependency1' } - UpdateProjectAsset(testXmlPath, projectXmlPath, engineRoot, projectName, expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, False) - - # Clean up the test assets - CleanUpTestAsset(projectXmlPath) - CleanUpTestAsset(gemSchemaPath) - if not os.listdir(gemSchemaFolder): - os.rmdir(gemSchemaFolder) - -def CleanUpTestAsset(assetName): - assetExists = False; - if os.path.exists(assetName): - assetExists = True; - os.remove(assetName) - - assert not os.path.exists(assetName) - - return assetExists - - -def UpdateProjectAsset(testAssetPath, projectAssetPath, engineRoot, projectName, expectedUnresolvedPaths, buildInfo, dbCheckWaitTime, deleteAsset): - if deleteAsset: - os.remove(projectAssetPath) - else: - shutil.copyfile(testAssetPath, projectAssetPath) - - # Let AP reprocess the new/updated asset - subprocess.call( - [os.path.join(buildInfo.buildFolder, 'AssetProcessorBatch'), "/gamefolder=Helios"]) - - projectCacheRoot = os.path.join(engineRoot, 'Cache', projectName) - CheckDatabaseForDependency(projectCacheRoot, projectName, - expectedUnresolvedPaths, buildInfo, dbCheckWaitTime) - - -def CheckDatabaseForDependency(projectCacheRoot, projectName, expectedUnresolvedPaths, buildInfo, dbCheckWaitTime): - print ("CheckDatabaseForDependency") - - print (" * Searching for these paths as unresolved paths: {}".format(str(expectedUnresolvedPaths))) - - sqlDatabasePath = os.path.join(projectCacheRoot, "assetdb.sqlite") - print (" * Connecting to database " + sqlDatabasePath) - sqlConnection = sqlite3.connect(sqlDatabasePath) - try: - # Not using os.path.join because this is an expected string in a database - xmlProduct = '{}/{}/xml_schema_test.xml'.format(buildInfo.cacheSubfolder, projectName.lower()) - print (" * Looking in product table for " + xmlProduct) - productRows = sqlConnection.execute( - "SELECT ProductID FROM Products where ProductName='{}'".format(xmlProduct)) - productRowsList = list(productRows.fetchall()) - - productDbWait = dbCheckWaitTime - while len(productRowsList) == 0 and productDbWait > 0: - time.sleep(1) - productDbWait = productDbWait - 1 - productRows = sqlConnection.execute( - "SELECT ProductID FROM Products where ProductName='{}'".format(xmlProduct)) - productRowsList = list(productRows.fetchall()) - - assert len(productRowsList) == 1, "productRowsList= {}".format(productRowsList) - - print (" * Searching product results for product ID") - productId = int(productRowsList[0][0]) - - assert productId - - print (" * Searching for dependencies for product ID {}".format(productId)) - dependencyDbSuccess = False - dependencyDbTimeout = dbCheckWaitTime - # Make copies of the list in case multiple runs are required - expectedUnresolvedPathsCopy = [] - dependencyRowIndex_UnresolvedPath = 6 - while (not dependencyDbSuccess) and dependencyDbTimeout > 0: - expectedUnresolvedPathsCopy = expectedUnresolvedPaths.copy() - productDependencyRows = sqlConnection.execute("SELECT * FROM ProductDependencies where ProductPK={}".format(productId)) - - productDependencyRowList = list(productDependencyRows.fetchall()) - expectedDependencyCount = len(expectedUnresolvedPathsCopy) - dependencyDbSuccess = len( - productDependencyRowList) == expectedDependencyCount - - for dependencyRow in productDependencyRowList: - # If this dependency has an unresolved path that we expect, then count it as found. - unresolvedPath = dependencyRow[dependencyRowIndex_UnresolvedPath] - if unresolvedPath in expectedUnresolvedPathsCopy: - expectedUnresolvedPathsCopy.remove(unresolvedPath) - - dependencyDbSuccess = dependencyDbSuccess and len(expectedUnresolvedPathsCopy) == 0 - - if not dependencyDbSuccess: - time.sleep(1) - dependencyDbTimeout = dependencyDbTimeout - 1 - - # do all the checks in asserts, instead of just assert dependencyDbSuccess so that error messages are more specific - assert len(expectedUnresolvedPathsCopy) == 0, str.format( - "Expected unresolved paths were not found in the asset database: {}", str(expectedUnresolvedPathsCopy)) - - print (" * Found all expected dependencies") - finally: - print (" * Closing database connection") - sqlConnection.close() - print ("/CheckDatabaseForDependency") \ No newline at end of file diff --git a/Tests/pipeline/product_dependency_tests/conftest.py b/Tests/pipeline/product_dependency_tests/conftest.py deleted file mode 100755 index cdac03401a..0000000000 --- a/Tests/pipeline/product_dependency_tests/conftest.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Automated scripts for tests calling AssetProcessorBatch validating basic features. - -""" - -def pytest_addoption(parser): - parser.addoption( - "--buildFlavor", action="store", default="WindowsVS2017", help="Sets the build type (see lmbrBuildInfo.py for what's available)" - ) - - parser.addoption( - "--dbWaitTimes", action="store", default=60, help="How long (in seconds) to wait for a condition to be met in the database before timing out" - ) - - parser.addoption( - "--thirdPartyPath", action="store", help="Path to the 3rd party folder" - ) - -def pytest_generate_tests(metafunc): - if "buildFlavor" in metafunc.fixturenames: - metafunc.parametrize("buildFlavor", metafunc.config.getoption("buildFlavor"), scope="session") - - if "dbWaitTimes" in metafunc.fixturenames: - metafunc.parametrize("dbWaitTimes", metafunc.config.getoption("dbWaitTimes"), scope="session") - - if "thirdPartyPath" in metafunc.fixturenames: - metafunc.parametrize("thirdPartyPath", metafunc.config.getoption("thirdPartyPath"), scope="session") \ No newline at end of file diff --git a/Tests/pipeline/product_dependency_tests/export_test_level.template b/Tests/pipeline/product_dependency_tests/export_test_level.template deleted file mode 100644 index 2a6567904e..0000000000 --- a/Tests/pipeline/product_dependency_tests/export_test_level.template +++ /dev/null @@ -1,38 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import os - -game_folder = general.get_game_folder() -levelName = ${LevelName} -meshGuid = ${MeshGuid} - -# Don't use terrain because creating a level with terrain causes a popup message that requires user input. -general.create_level(levelName, 128, 1, False) -levelPath = os.path.join(game_folder, "Levels", levelName, str.format("{}.ly", levelName)) - -if not isinstance(input, str): - # general.open_level_no_prompt expects the file path in utf8 format - levelPath = levelName.encode("utf-8") - -general.open_level_no_prompt(levelPath) - -newEntityIdStr = str(general.create_entity("TestEntityName")) - -componentResult = general.add_mesh_component_with_mesh(newEntityIdStr, meshGuid) - -if not componentResult: - raise Exception('Export Test Level', str.format('Failed to add mesh ID {} to entity ID {}', str(meshGuid), str(newEntityIdStr))) - -general.save_level() -general.export_to_engine() - -general.exit() diff --git a/Tests/samples/__init__.py b/Tests/samples/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/samples/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/samples/sample_tests.py b/Tests/samples/sample_tests.py deleted file mode 100755 index aef6dc0f97..0000000000 --- a/Tests/samples/sample_tests.py +++ /dev/null @@ -1,163 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Sample tests to demonstrate typical functionality of PythonTestTools and how to integrate into the BAT. -""" -# Workaround for tests which depend on old tools, before they are updated to ly_test_tools and Python 3 -import pytest -pytest.importorskip('test_tools') - -# System level imports -import os -import subprocess - -# Basic PythonTestTools imports, in most cases you should always import these -import test_tools.builtin.fixtures as fixtures -from test_tools import HOST_PLATFORM, WINDOWS_LAUNCHER - -# test_tools and shared are modules with a lot of useful utility functions already written, use them! -# Pick and choose the ones below that you need, don't just blindly copy/paste -import test_tools.launchers.phase -import test_tools.shared.process_utils as process_utils -from test_tools.shared.file_utils import gather_error_logs, clear_out_config_file, delete_screenshot_folder, move_file -from shared.network_utils import check_for_listening_port -from test_tools.shared.remote_console_commands import RemoteConsole -from test_tools.shared.waiter import wait_for - - -# This is where you should access lumberyard - building, asset processing, finding paths/logs, etc. Do NOT change or -# remove this unless you know what you're doing. -# See the documentation for PythonTestTools for more information. -workspace = fixtures.use_fixture(fixtures.builtin_empty_workspace_fixture, scope='function') - -# What are fixtures? -# Fixtures set up a testing process (or test) by running all necessary code to satisfy its preconditions. -# More reading here: https://docs.pytest.org/en/latest/fixture.html - -# This is a shared instance of the remote console that be used across multiple tests. It must have the @pytest.fixture! -# You should remove this if you aren't going to use the remote console. -@pytest.fixture -def remote_console_instance(request): - """ - Creates a remote console instance to send console commands. - """ - console = RemoteConsole() - - def teardown(): - try: - console.stop() - except: - pass - - request.addfinalizer(teardown) - - return console - - -# This is a shared instance of the launcher that can be used across multiple tests within this file and any that it -# includes. It must have the @pytest.fixture for pytest to automatically pass it around! -# You should remove this if you aren't going to use the level-specific launchers. -@pytest.fixture -def launcher_instance(request, workspace, level): - """ - Creates a launcher fixture instance with an extra teardown for error log grabbing. - """ - def teardown_launcher_copy_logs(): - """ - Tries to grab any error logs before moving on to the next test. - """ - - for file_name in os.listdir(launcher.workspace.release.paths.project_log()): - move_file(launcher.workspace.release.paths.project_log(), - launcher.workspace.artifact_manager.get_save_artifact_path(), - file_name) - - logs_exist = lambda: gather_error_logs( - launcher.workspace.release.paths.dev(), - launcher.workspace.artifact_manager.get_save_artifact_path()) - try: - test_tools.shared.waiter.wait_for(logs_exist) - except AssertionError: - print("No error logs found. Completing test...") - - request.addfinalizer(teardown_launcher_copy_logs) - - launcher = fixtures.launcher(request, workspace, level) - return launcher - -# For the rest of the file, these are sample tests that you should remove entirely, or cannibalize them to help your -# own test-writing process. -class TestSamplesAPBatch: - - # This is a shared instance of test teardown that will be used across all tests in this class. - # It must have the @pytest.fixture(autouse=True)! - @pytest.fixture(autouse=True) - def setup_teardown(self, request): - - # This is the teardown function that will be run after *each* test finishes - def teardown(): - pass - - # This is the setup section that will be run before *each* test starts - request.addfinalizer(teardown) - - # mark.BAT adds this test to the BAT. - # mark.test_case is used to link to your testrail id. - # mark.parameterize allows you to run the same test multiple times but with different parameters, such as platform, - # configuration, project, level, and more. See more on parameters here: https://docs.pytest.org/en/latest/parametrize.html - @pytest.mark.BAT - @pytest.mark.test_case(testrail_id='Foo') - @pytest.mark.parametrize('platform,configuration,project,spec', ( - pytest.param('win_x64_vs2017', 'profile', 'StarterGame', 'all', - marks=pytest.mark.skipif(HOST_PLATFORM != 'win_x64', reason='Only supported on Windows hosts')), - pytest.param('darwin_x64', 'profile', 'StarterGame', 'all', - marks=pytest.mark.skipif(HOST_PLATFORM != 'darwin_x64', reason='Only supported on Mac hosts')), - )) - def test_RunAPBatch_WorkspacePreconfigured_NoLeftoverProcessesExist(self, workspace): - """ - Tests that the Asset Processor Batch and run and doesn't leave leftover processes. - """ - # Your function docstrings (the above text) will be part of the test catalog! - - subprocess.check_call([os.path.join(workspace.release.paths.bin(), 'AssetProcessorBatch')]) - - # This is how you should do timeouts - wait_for(lambda: not process_utils.process_exists('AssetProcessorBatch', True), timeout=10) - - # Make sure to include an informative assert message to make debugging easier - assert not process_utils.process_exists('rc', True), 'rc process still exists' - assert not process_utils.process_exists('AssetBuilder', True), 'AssetBuilder process still exists' - - -# Notice that you can put the marks both on the class and on the individual methods (seen above). -@pytest.mark.BAT -@pytest.mark.parametrize("platform,configuration,project,spec,level", [ - pytest.param("win_x64_vs2017", "profile", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")), - pytest.param("win_x64_vs2019", "profile", "StarterGame", "all", "StarterGame", - marks=pytest.mark.skipif(not WINDOWS_LAUNCHER, reason="Only supported on Windows hosts")) -]) -class TestSamplesRemoteConsole(object): - - # Notice here that both the launcher_instance and remote_console_instance fixtures are being reused from above - def test_LaunchRemoteConsoleAndLauncher_CanLaunch(self, launcher_instance, platform, configuration, project, spec, - level, remote_console_instance): - """ - Verifies launcher & remote console can successfully launch. Notice that there are no asserts here, and that is - because the called functions will raise exceptions if there is unexpected behavior. - """ - launcher_instance.launch() - - launcher_instance.run(test_tools.launchers.phase.TimePhase(120, 120)) - - test_tools.shared.waiter.wait_for(lambda: check_for_listening_port(4600), timeout=300, - exc=AssertionError('Port 4600 not listening.')) - - remote_console_instance.start() diff --git a/Tests/samples/sanity_test.py b/Tests/samples/sanity_test.py deleted file mode 100755 index 062bfeea63..0000000000 --- a/Tests/samples/sanity_test.py +++ /dev/null @@ -1,58 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -A simple sanity test. -""" -import os -import pytest - -import ly_test_tools.builtin.helpers - - -class TestSanity: - - @pytest.fixture(autouse=True) - def setup_teardown(self, request, legacy_workspace): - def teardown(): - # Per-test cleanup goes here - pass - request.addfinalizer(teardown) # adds teardown to pytest important to hook before setup in case setup fails - - # Per-test setup goes here - - # builtin_empty_workspace_fixture doesn't configure lumberyard to run, it leaves all the configuration to - # the test. - # To run lumberayrd you need to at least setup 3rdParty and run setup assistant using the following lines. - # Alternatively, you can use 'builtin_workspace_fixture'. - # This sanity test only checks if the framework is sane, so there is no need to configure LY. - # workspace.run_waf_configure() - # workspace.setup_assistant.enable_default_capabilities() - - @pytest.mark.bvt - # Example of dynamically parametrized test, these parameters are consumed by the workspace fixture: - # TODO LY-109331 @pytest.mark.parametrize("platform", ["win_x64_vs2017", "win_x64_vs2019", "darwin_x64"]) - @pytest.mark.parametrize("platform", ["win_x64_vs2017", "win_x64_vs2019"]) - @pytest.mark.parametrize("configuration", ["profile"]) - @pytest.mark.parametrize("project", ["AutomatedTesting"]) - @pytest.mark.parametrize("spec", ["all"]) - def test_Paths_DevPathExists_PathItsADirectory(self, legacy_workspace, platform, configuration, project, spec): - # type: (WorkspaceManager, str, str, str, str) -> None - - # Test code goes here - # os.makedirs(workspace.paths.dev()) - - # These asserts verify that the parameters were correctly received by the workspace fixture - assert legacy_workspace.platform == platform, "Platform does not match parameters" - assert legacy_workspace.configuration == configuration, "Configuration does not match parameters" - assert legacy_workspace.project == project, "Project does not match parameters" - assert legacy_workspace.spec == spec, "Spec does not match parameters" - - # Verify that the dev folder exists - assert os.path.isdir(legacy_workspace.paths.dev()) diff --git a/Tests/shared/__init__.py b/Tests/shared/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/shared/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/shared/file_utils.py b/Tests/shared/file_utils.py deleted file mode 100755 index 98bf08c29a..0000000000 --- a/Tests/shared/file_utils.py +++ /dev/null @@ -1,182 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import os -import shutil -import subprocess -import logging - -import test_tools.shared.file_system as file_system -from test_tools.shared.waiter import wait_for - -logger = logging.getLogger(__name__) - - -def clear_out_config_file(project_path, script_name): - """ - Clears out the specified config file to be empty. - :param project_path: The directory where the file is. - :param script_name: The file name. - """ - path = os.path.join(project_path, '{}.cfg'.format(script_name)) - - if os.path.exists(path): - # Clears read only flag - file_system.unlock_file(path) - - with open(path, 'w') as initialmap_script: - initialmap_script.write('') - - -def add_commands_to_config_file(config_file_dir, config_file_name, command_list): - """ - From the command list, appends each command to the specified config file. - :param config_file_dir: The directory the config file is contained in. - :param config_file_name: The config file name. - :param command_list: The commands to add to the file. - :return: - """ - config_file_path = os.path.join(config_file_dir, config_file_name) - os.chmod(config_file_path, 0755) - with open(config_file_path, 'w') as launch_config_file: - for command in command_list: - launch_config_file.write("{}\n".format(command)) - - -def gather_error_logs(dev_path, logs_path): - """ - Grabs all error logs (if there are any) and puts them into the specified logs path. - :param dev_path: Path to the dev directory. - :param logs_path: Path to the destination directory for the logs (the test results path). - """ - error_logs_sent = False - error_log_path = os.path.join(dev_path, 'error.log') - artifact_log_path = os.path.join(logs_path, 'error.log') - error_dump_path = os.path.join(dev_path, 'error.dmp') - artifact_dump_path = os.path.join(logs_path, 'error.dmp') - if os.path.exists(error_dump_path) and os.path.exists(error_log_path): - shutil.move(error_dump_path, artifact_dump_path) - shutil.move(error_log_path, artifact_log_path) - error_logs_sent = True - return error_logs_sent - - -def delete_screenshot_folder(platform_path): - """ - Deletes screenshot folder from platform path - :param platform_path: Platform Path - :return: None - """ - platform_path = r'{}\user\screenshots'.format(platform_path) - shutil.rmtree(platform_path, ignore_errors=True) - - -def move_file(src_dir, dest_dir, file_name, timeout=120): - """ - Attempts to move a file from the source directory to the destination directory. Raises an IOError if - the file is in use. - :param src_dir: Directory of the file to be moved. - :param dest_dir: Directory where the file will be moved to. - :param file_name: Name of the file to be moved. - :param timeout: Number of seconds to wait for the file to be released. - """ - file_path = os.path.join(src_dir, file_name) - if os.path.exists(file_path): - wait_for(lambda: move_file_check(src_dir, dest_dir, file_name), - timeout=timeout, - exc=IOError('Cannot move file {} while in use'.format(file_path))) - - -def move_file_check(src_dir, dest_dir, file_name): - """ - Moves file and checks if the file has been moved from the source to the destination directory. - """ - try: - shutil.move(os.path.join(src_dir, file_name), os.path.join(dest_dir, file_name)) - except OSError as e: - print e - return False - - return True - - -def revert_config_files(launcher): - """ - Reverts modified config files from test. Runs the perforce revert command. - :param launcher: The launcher instance to revert files from. - """ - files_revert = [os.path.join(launcher.workspace.release.paths.dev(), 'bootstrap.cfg'), - os.path.join(launcher.workspace.release.paths.dev(), 'AssetProcessorPlatformConfig.ini'), - launcher.workspace.release.paths.platform_config_file()] - - for file_path in files_revert: - subprocess.check_call(['p4', 'revert', file_path]) - subprocess.check_call(['p4', 'sync', '-f', file_path]) - - -def create_file(path, file_name): - """ - Creates a file with specified file name - :param path: The path of where the file needs to be created - :param file_name: The file name - :return: - """ - file_path = os.path.join(path, file_name) - - if not os.path.exists(file_path): - new_file = open(file_path, "w") - new_file.close() - else: - print "{} already exists".format(file_name) - -def delete_level(launcher, level_dir, timeout=120): - """ - Attempts to delete an entire level folder from the project. - :param launcher: The launcher instance to delete the level from. - :param level_dir: The level folder to delete - """ - - if (not level_dir): - logger.warning("level_dir is empty, nothing to delete.") - return - - full_level_dir = os.path.join(launcher.workspace.release.paths.project(), 'Levels', level_dir) - if (not os.path.isdir(full_level_dir)): - if (os.path.exists(full_level_dir)): - logger.error("level '{}' isn't a directory, it won't be deleted.".format(full_level_dir)) - else: - logger.info("level '{}' doesn't exist, nothing to delete.".format(full_level_dir)) - return - - wait_for(lambda: delete_check(full_level_dir), - timeout=timeout, - exc=IOError('Cannot delete directory {} while in use'.format(full_level_dir))) - -def delete_check(src_dir): - """ - Deletes directory and verifies that it's been deleted. - :param src_dir: The directory to delete - """ - try: - shutil.rmtree(src_dir) - except OSError as e: - logger.debug("Delete for '{}' failed: {}".format(src_dir, e)) - return False - - return (not os.path.exists(src_dir)) - -def get_log_file_path(launcher, project_name): - """ - Creates a log file path. - :param launcher: The launcher instance to get a path from. - :param project_name: The name of the project. - """ - return os.path.join(launcher.workspace.release.paths.dev(), 'Cache', project_name, 'pc', 'user', 'log', 'Editor.log') diff --git a/Tests/shared/hydra_test_utils.py b/Tests/shared/hydra_test_utils.py deleted file mode 100755 index cce54a0f45..0000000000 --- a/Tests/shared/hydra_test_utils.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import logging -import os -import tempfile -import test_tools.shared.log_monitor -import test_tools.launchers.phase - -logger = logging.getLogger(__name__) - - -def prepare_cfg_file(editor_python_script_name, args=[]): - """ - Create a temporary .cfg file containing the python script and args to pass to the Editor. - Ex: If you pass in 'create_level.py', ['LevelName'], you'll get a cfg file with this: - pyRunFile create_level.py LevelName - :param editor_python_script_name: Name of script that will execute in the Editor. - :param args: Additional arguments for CFG, such as LevelName. - :return Config file for Hydra execution - """ - cfg_contents = '-- Auto-generated cfg file\n' - cfg_contents += 'pyRunFile ' + editor_python_script_name - for arg in args: - cfg_contents += ' ' + arg - cfg_contents += '\n' - - logger.debug("Preparing a cfg file with the following contents:\n{}".format(cfg_contents)) - f = tempfile.NamedTemporaryFile(mode='w+', suffix='.cfg', delete=False) - cfg_filename = f.name - f.write(cfg_contents) - f.close() - logger.debug("Cfg file name: {}".format(cfg_filename)) - return cfg_filename - - -def cleanup_cfg_file(cfg_filename): - """ - Removes the temporary cfg file created in prepare_cfg_file. - :param cfg_filename: Config file for Hydra execution to delete - """ - logger.debug('Cleaning up the generated cfg file') - if os.path.exists(cfg_filename): - os.remove(cfg_filename) - - -def launch_and_validate_results(test_directory, editor, editor_script, editor_timeout, expected_lines, cfg_args=[]): - """ - Creates a temporary config file for Hydra execution, runs the Editor with the specified script, and monitors for - expected log lines. - :param test_directory: Path to test directory that editor_script lives in. - :param editor: Configured editor object to run test against. - :param editor_script: Name of script that will execute in the Editor. - :param editor_timeout: Timeout for editor run. - :param expected_lines: Expected lines to search log for. - :param cfg_args: Additional arguments for CFG, such as LevelName. - """ - cfg_file_name = prepare_cfg_file(os.path.join(test_directory, editor_script), cfg_args) - - logger.debug("Running automated test: {}".format(editor_script)) - - editor.deploy() - editor.launch(["--skipWelcomeScreenDialog", "--autotest_mode", "--exec", cfg_file_name]) - - editorlog_file = os.path.join(editor.workspace.release.paths.project_log(), 'Editor.log') - - test_tools.shared.log_monitor.monitor_for_expected_lines(editor, editorlog_file, expected_lines) - - # Rely on the test script to quit after running - editor.run(test_tools.launchers.phase.WaitForLauncherToQuit(editor, editor_timeout)) diff --git a/Tests/shared/jenkins-3rdparty-symlink/symlink_utils.py b/Tests/shared/jenkins-3rdparty-symlink/symlink_utils.py deleted file mode 100755 index c8fa8b7023..0000000000 --- a/Tests/shared/jenkins-3rdparty-symlink/symlink_utils.py +++ /dev/null @@ -1,71 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import argparse -import logging -import os -import subprocess - -logger = logging.getLogger(__name__) - - -def create_symlink(path, name, reference): - """ - Checks if the defined symlink exists and returns True if it does. If it does not, it will create a - new symlink and return True. Unsuccessful commands will return False. - :param path: Path to where symlink should be created. - :param name: Name of the symlink. - :param reference: Source path of directory. - """ - sym_path = os.path.join(path, name) - - if not os.path.exists(sym_path): - if os.path.isfile(reference): - proc = subprocess.Popen('cmd /c mklink "{}" "{}"'.format(name, reference), cwd=path, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - elif os.path.isdir(reference): - proc = subprocess.Popen('cmd /c mklink /J "{}" "{}"'.format(name, reference), cwd=path, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - - exit_code = proc.wait() - - if exit_code == 0: - logger.info("Successfully created symlink from {} to {}".format(reference, sym_path)) - return True - elif "You do not have sufficient privilege to perform this operation" in proc.stderr.read(): - raise AssertionError("Permissions denied. You should be running this script with Admin rights.") - - else: - raise AssertionError("The command could not run successfully.") - - else: - logger.info("Directory or file already exists: {}".format(os.path.join(path, name))) - return False - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Creates 3rdParty symlink.') - parser.add_argument('-symlink_path', metavar='symlink_path', type=str, required=True, - help='The path to create the 3rdParty symlink. If folder exists, symlinks will be' - 'created inside the 3rdParty folder.') - parser.add_argument('-name', metavar='symlink_name', type=str, default='3rdParty', - help='Name of symlink created. Defaults to 3rdParty.') - parser.add_argument('-source_path', metavar='source_path', type=str, required=True, - help='The path where the source 3rdParty is located.') - args = parser.parse_args() - - sym_path = os.path.join(args.symlink_path, args.name) - - # If there is an existing directory, copy all source contents as symlinks. - if not create_symlink(args.symlink_path, args.name, args.source_path): - for file_dir in os.listdir(args.source_path): - create_symlink(sym_path, file_dir, os.path.join(args.source_path, file_dir)) diff --git a/Tests/shared/logging_utils.py b/Tests/shared/logging_utils.py deleted file mode 100755 index 0d822c077d..0000000000 --- a/Tests/shared/logging_utils.py +++ /dev/null @@ -1,36 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -def extract_log_lines(start_line_marker, end_line_marker, log_file, platform, level): - """ - Parses log for a start and end marker, and extracts all lines between the markers. - :param start_line_marker: String that marks beginning of loglines to extract. - :param end_line_marker: String that marks end of loglines to extract. - :param log_file: Path to log to parse. - :param platform: Platform under test passed from test parameterization. - :param level: Level under test passed from test parameterization. - """ - extracted_log = '{}_{}_log.txt'.format(platform, level) - - with open(log_file) as log: - match = False - new_log = None - - for line in log: - if start_line_marker in line: - match = True - new_log = open(extracted_log, 'w') - elif end_line_marker in line: - break - elif match: - new_log.write(line) - if new_log: - new_log.close() diff --git a/Tests/shared/network_utils.py b/Tests/shared/network_utils.py deleted file mode 100755 index b51e12e2c5..0000000000 --- a/Tests/shared/network_utils.py +++ /dev/null @@ -1,65 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import logging -import psutil -import socket - - -logger = logging.getLogger(__name__) - - -def check_for_listening_port(port): - """ - Checks to see if the connection to the designated port was established. - :param port: Port to listen to. - :return: True if port is listening. - """ - port_listening = False - for conn in psutil.net_connections(): - if 'port={}'.format(port) in str(conn): - port_listening = True - return port_listening - - -def check_for_remote_listening_port(port, ip_addr='127.0.0.1'): - """ - Tries to connect to a port to see if port is listening. - :param port: Port being tested. - :param ip_addr: IP address of the host being connected to. - :return: True if connection to the port is established. - """ - port_listening = True - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - try: - sock.connect((ip_addr, port)) - except socket.error as err: - if err.errno == 10061: - port_listening = False - finally: - sock.close() - return port_listening - - -def get_local_ip_address(): - """ - Finds the IP address for the primary ethernet adapter by opening a connection and grabbing its IP address. - :return: The IP address for the adapter used to make the connection. - """ - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - try: - # Connecting to Google's public DNS so there is an open connection - # and then getting the address used for that connection - sock.connect(('8.8.8.8', 80)) - host_ip = sock.getsockname()[0] - finally: - sock.close() - return host_ip diff --git a/Tests/shared/pipeline_utils.py b/Tests/shared/pipeline_utils.py deleted file mode 100755 index a909c7a685..0000000000 --- a/Tests/shared/pipeline_utils.py +++ /dev/null @@ -1,170 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Small library of functions to support autotests for asset processor - -""" - -import os -import shutil -import re -import ly_test_tools.environment.file_system as fs -import hashlib -import shutil -import logging - -logger = logging.getLogger(__name__) - -def compare_assets_with_cache(assets, assets_cache_path): - """ - Given a list of assets names, will try to find them (disrespecting file extensions) from project's Cache folder with test assets - :param assets: A list of assets to be compared with Cache - :param assets_cache_path: A path to cache test assets folder - :return: A tuple with two lists - first is missing in cache assets, second is existing in cache assets - """ - missing_assets = [] - existing_assets = [] - if os.path.exists(assets_cache_path): - files_in_cache = list(map(fs.remove_path_and_extension, os.listdir(assets_cache_path))) - for asset in assets: - file_without_ext = fs.remove_path_and_extension(asset).lower() - if file_without_ext in files_in_cache: - existing_assets.append(file_without_ext) - files_in_cache.remove(file_without_ext) - else: - missing_assets.append(file_without_ext) - else: - missing_assets = assets - return missing_assets, existing_assets - - -def copy_assets_to_project(assets, source_directory, target_asset_dir): - """ - Given a list of asset names and a directory, copy those assets into the target project directory - :param assets: A list of asset names to be copied - :param source_directory: A path string where assets are located - :param target_asset_dir: A path to project tests assets directory where assets will be copied over to - :return: None - """ - for asset in assets: - full_name = os.path.join(source_directory, asset) - shutil.copy(full_name, target_asset_dir) - - -def prepare_test_assets(assets_path, function_name, project_test_assets_dir): - """ - Given function name and assets cache path, will clear cache and copy test assets assigned to function name to project's folder - :param assets_path: Path to tests assets folder - :param function_name: Name of a function that corresponds to folder with assets - :param project_test_assets_dir: A path to project directory with test assets - :return: Returning path to copied assets folder - """ - test_assets_folder = os.path.join(assets_path, 'assets', function_name) - copy_assets_to_project(os.listdir(test_assets_folder), test_assets_folder, project_test_assets_dir) - return test_assets_folder - - -def find_joblog_file(joblogs_path, regexp): - """ - Given path to joblogs files and asset name in form of regexp, will try to find joblog file for provided asset; if multiple - will return first occurrence - :param joblogs_path: Path to a folder with joblogs files to look for needed file - :param regexp: Python Regexp containing name of the asset that was processed, for which we're looking joblog file for - :return: Full path to joblog file, empty string if not found - """ - for file_name in os.listdir(joblogs_path): - if re.match(regexp, file_name): - return os.path.join(joblogs_path, file_name) - return '' - - -def find_missing_lines_in_joblog(joblog_location, strings_to_verify): - """ - Given joblog file full path and list of strings to verify, will find all missing strings in the file - :param joblog_location: Full path to joblog file - :param strings_to_verify: List of string to look for in joblog file - :return: Subset of original strings list, that were not found in the file - """ - lines_not_found = [] - with open(joblog_location, 'r') as f: - read_data = f.read() - for line in strings_to_verify: - if line not in read_data: - lines_not_found.append(line) - return lines_not_found - - -def clear_project_test_assets_dir(test_assets_dir): - """ - On call - deletes test assets dir if it exists and creates new empty one - :param test_assets_dir: A path to tests assets dir - :return: None - """ - if os.path.exists(test_assets_dir): - fs.delete([test_assets_dir], True, True) - os.mkdir(test_assets_dir) - - -def get_files_hashsum(path_to_files_dir): - """ - On call - calculates md5 hashsums for filecontents. - :param path_to_files_dir: A path to files directory - :return: Returns a dict with initial filenames from path_to_files_dir as keys and their contents hashsums as values - """ - checksum_dict = {} - try: - for fname in os.listdir(path_to_files_dir): - with open(os.path.join(path_to_files_dir, fname), 'rb') as fopen: - checksum_dict[fname] = hashlib.sha256(fopen.read()).digest() - except IOError: - logger.error('An error occured trying to read file') - return checksum_dict - - -def append_to_filename(file_name, path_to_file, append_text, ignore_extension): - """ - Function for appending text to file and folder names - :param file_name: Name of a file or folder - :param path_to_file: Path to file or folder - :param append_text: Text to append - :param ignore_extension: True or False for ignoring extensions - :return: None - """ - new_name = '' - if not ignore_extension: - (name, extension) = file_name.split('.') - new_name = name + append_text + '.' + extension - else: - new_name = file_name + append_text - os.rename(os.path.join(path_to_file, file_name), os.path.join(path_to_file, new_name)) - - -def create_asset_processor_backup_directories(backup_root_directory, test_backup_directory): - """ - Function for creating the asset processor logs backup directory structure - :param backup_root_directory: The location where logs should be stored - :param test_backup_directory: The directory for the specific test being ran - :return: None - """ - if not os.path.exists(os.path.join(backup_root_directory, test_backup_directory)): - os.makedirs(os.path.join(backup_root_directory, test_backup_directory)) - - -def backup_asset_processor_logs(bin_directory, backup_directory): - """ - Function for backing up the logs created by asset processor to designated backup directory - :param bin_directory: The bin directory created by the lumberyard build process - :param backup_directory: The location where asset processor logs should be backed up to - :return: None - """ - ap_logs = os.path.join(bin_directory, 'logs') - - if os.path.exists(ap_logs): - destination = os.path.join(backup_directory, 'logs') - shutil.copytree(ap_logs, destination) diff --git a/Tests/shared/process_utils.py b/Tests/shared/process_utils.py deleted file mode 100755 index 33ab175600..0000000000 --- a/Tests/shared/process_utils.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -from contextlib import contextmanager -import psutil -import subprocess - - -@contextmanager -def managed_popen(args_list, cwd=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT): - """ - Context manager for subprocess.Popen objects which allows Popen to be used in a with/as statement. - This should not be used with processes that are to continue running outside of the with block. - :param args_list: Sequence of arguments as they would be passed to a terminal. - :param cwd: The current working directory to use when issuing the command. - :param stdout: File handle or pipe to use for stdout. - :param stderr: File handle or pipe to use for stderr. - """ - process = subprocess.Popen(args_list, cwd=cwd, stdout=stdout, stderr=stderr) - try: - yield process - finally: - if not process.poll(): - process.terminate() - - -def get_psutil_process(process_name): - """ - Gets a reference to a psutil.Process object with the given process name. - :return: A reference to the first process encountered with the given name or None if no process is found. - """ - for process in psutil.process_iter(): - if process_name == process.name(): - return process - return None diff --git a/Tests/shared/s3_utils.py b/Tests/shared/s3_utils.py deleted file mode 100755 index 403cf75642..0000000000 --- a/Tests/shared/s3_utils.py +++ /dev/null @@ -1,145 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import boto3 -import botocore.exceptions -import logging -import os - -import test_tools.shared.file_system as file_system - -logger = logging.getLogger(__name__) -s3 = boto3.resource('s3') - - -class BucketNotExists(Exception): - pass - - -class KeyExistsError(Exception): - pass - - -class KeyDoesNotExistError(Exception): - pass - - -def create_folder_in_bucket(bucket_name, folder_key): - """ - Given bucket name and folder key will create specified folder if it doesn't exist - :param bucket_name: name of the bucket where folder will be created - :param folder_key: key in s3 where folder will be created (i.e. specifying full path to folder in s3) - :return: True if folder was successfully created, False otherwise, will raise BucketNotExists exception if - bucket doesn't exist - """ - if not bucket_exists_in_s3(bucket_name): - raise BucketNotExists("Bucket {} does not exist.".format(bucket_name)) - - if key_exists_in_bucket(bucket_name, '{}/'.format(folder_key)): - logger.error("Key {} already exists in bucket {}".format(folder_key, bucket_name)) - return False - - s3_bucket = s3.Bucket(bucket_name) - logger.info("Creating {} folder in a {} bucket".format(folder_key, bucket_name)) - s3_bucket.put_object(Bucket=bucket_name, Key=(folder_key+'/')) - return True - - -def upload_to_bucket(bucket_name, file_path, file_key=None, overwrite=False): - """ - Uploads a given file to the given S3 bucket. - :param bucket_name: Name of the S3 bucket where the file should be uploaded. - :param file_path: Full Path to the target file on hard drive. - :param file_key: Needed path to file on s3 (including file name). - :param overwrite: Overwrite the key if it exists. - """ - if not bucket_exists_in_s3(bucket_name): - s3.create_bucket(Bucket=bucket_name) - - s3_bucket = s3.Bucket(bucket_name) - - if file_key is None: - file_key = os.path.basename(file_path) - - if not overwrite and key_exists_in_bucket(bucket_name, file_key): - raise KeyExistsError("Key '{}' already exists in S3 bucket {}".format(file_key, bucket_name)) - - s3_bucket.upload_file(file_path, file_key) - logger.info("Uploading {} to S3 bucket {}".format(file_key, bucket_name)) - - -def download_from_bucket(bucket_name, file_key, destination_dir, file_name=None): - """ - Download the given key from the given S3 bucket to the given destination. Logs an error if there is not enough \ - space available for the download. - :param bucket_name: Name of the S3 bucket containing the desired file. - :param file_key: Name of the file stored in S3. - :param destination_dir: Directory where the file should be downloaded to. - :param file_name: The name of the file you want to save it as. Defaults to the file_key. - """ - bucket_exists_in_s3(bucket_name) - - if not key_exists_in_bucket(bucket_name, file_key): - raise KeyDoesNotExistError("Key '{}' does not exist in S3 bucket {}".format(file_key, bucket_name)) - - obj_summary = s3.ObjectSummary(bucket_name, file_key) - required_space = obj_summary.size - disk_name = os.path.splitdrive(destination_dir)[0] - - file_system.check_free_space(disk_name, required_space, "Insufficient space available for download:") - - if not os.path.exists(destination_dir): - os.makedirs(destination_dir) - - if file_name is None: - file_name = file_key - destination_path = os.path.join(destination_dir, file_name) - s3.Object(bucket_name, file_key).download_file(destination_path) - logger.info("Downloading {} to {}".format(file_key, destination_path)) - - -def bucket_exists_in_s3(bucket_name): - """ - Verifies that the S3 bucket exists. - :param bucket_name: Name of the S3 bucket that may or may not exist. - :return: True if the bucket exists. False otherwise. - """ - bucket_exists = True - - try: - s3.meta.client.head_bucket(Bucket=bucket_name) - except botocore.exceptions.ClientError as err: - if err.response['Error']['Code'] == '404': - bucket_exists = False - - return bucket_exists - - -def key_exists_in_bucket(bucket_name, file_key): - """ - Verifies that the given key does not already exist in the given S3 bucket. - :param bucket_name: Name of the S3 bucket that may or may not contain the file key. - :param file_key: Name of the file key in question. - :return: True if the key exists. False otherwise. - """ - key_exists = True - obj_summary = s3.ObjectSummary(bucket_name, file_key) - - # Attempting to access any member of ObjectSummary for a nonexistent key will throw an exception - # There is no built-in way to check key existence otherwise - try: - obj_summary.size - except botocore.exceptions.ClientError as err: - if err.response['Error']['Code'] == '404': - key_exists = False - - return key_exists - diff --git a/Tests/shared/screenshot_utils.py b/Tests/shared/screenshot_utils.py deleted file mode 100755 index 0c64bb848a..0000000000 --- a/Tests/shared/screenshot_utils.py +++ /dev/null @@ -1,203 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import os -import botocore.exceptions -import string -import boto3 - -from test_tools.shared.file_utils import move_file - -import test_tools.launchers.phase as phase -import shared.s3_utils as s3_utils -from test_tools.shared.remote_console_commands import get_screenshot_command -from test_tools.shared.waiter import wait_for -from test_tools import HOST_PLATFORM -from test_tools.shared.images.qssim import qssim as compare_screenshots -from test_tools.shared.launcher_testlib import retry_console_command - - -def take_screenshot(remote_console_instance, launcher, screenshot_name): - """ - Takes an in game screenshot using the remote console instance passed in, validates that the screenshot exists - and then renames that screenshot to something defined by the user of this function. - :param remote_console_instance: Remote console instance that is attached to a specific launcher instance - :param launcher: Launcher instance so we can use the file exists functionality provided by test_tools - :param screenshot_name: Name of the screenshot - :return: None - """ - get_screenshot_command(remote_console_instance) - screenshot_path = os.path.join(launcher.workspace.release.paths.platform_cache(), 'user', 'screenshots') - launcher.run(phase.FileExistsPhase(os.path.join(screenshot_path, 'screenshot0000.jpg'))) - wait_for(lambda: rename_screenshot(screenshot_path, screenshot_name), - timeout=120, - exc=AssertionError('Screenshot at path:{} and with name:{} is still in use.'.format(screenshot_path, screenshot_name))) - - -def rename_screenshot(screenshot_path, screenshot_name): - """ - Tries to rename the screenshot when the file is done being written to - :param screenshot_path: Path to the Screenshot folder - :param screenshot_name: Name we wish to change the screenshot to - :return: True when operation is completed, False if the file is still in use - """ - try: - print 'Trying to rename {} to {}.'.format(os.path.join(screenshot_path, 'screenshot0000.jpg'), os.path.join(screenshot_path, '{}.jpg'.format(screenshot_name))) - os.rename(os.path.join(screenshot_path, 'screenshot0000.jpg'), - os.path.join(screenshot_path, '{}.jpg'.format(screenshot_name))) - return True - except OSError as e: - print ('Found error {0} when trying to rename screenshot. {1}'.format(str(e), str(e.message))) - return False - - -def move_screenshots(screenshot_path, file_type, logs_path): - """ - Moves screenshots of a specific file type to the flume location so we can gather all of the screenshots we took. - :param screenshot_path: Path to the screenshot folder - :param file_type: Types of Files to look for. IE .jpg, .tif, etc - :param logs_path: Path where flume gathers logs to be upload - """ - for file_name in os.listdir(screenshot_path): - if file_name.endswith(file_type): - move_file(screenshot_path, logs_path, file_name) - - -def screenshot_command(remote_console_instance, command_to_run, expected_log_line): - """ - This is just a helper function to help send and validate against screenshot console commands. - :param remote_console_instance: Remote console instance - :param command_to_run: The Screenshot command that you wish to run - :param expected_log_line: The console log line to expect in order to set the event to true - :return: - """ - return retry_console_command(remote_console_instance, command_to_run, expected_log_line) - - -def get_screenshot_command_with_retries(remote_console_instance): - """ - Used for an in-game screenshot - :param remote_console_instance: Remote console instance - :return: None - """ - if (HOST_PLATFORM == 'win_x64'): - command = 'Screenshot: @user@\screenshots/' - else: - command = 'Screenshot: @user@/screenshots/' - - wait_for(lambda: screenshot_command(remote_console_instance, 'r_GetScreenShot 1', command), timeout=240, - exc=AssertionError('Screenshot command failed')) - - -def take_screenshot_with_retries(remote_console_instance, launcher, screenshot_name): - """ - Takes an in game screenshot using the remote console instance passed in, validates that the screenshot exists - and then renames that screenshot to something defined by the user of this function. - :param remote_console_instance: Remote console instance that is attached to a specific launcher instance - :param launcher: Launcher instance so we can use the file exists functionality provided by test_tools - :param screenshot_name: Name of the screenshot - :return: None - """ - get_screenshot_command_with_retries(remote_console_instance) - screenshot_path = os.path.join(launcher.workspace.release.paths.platform_cache(), 'user', 'screenshots') - launcher.run(phase.FileExistsPhase(os.path.join(screenshot_path, 'screenshot0000.jpg'))) - wait_for(lambda: rename_screenshot(screenshot_path, screenshot_name), - timeout=120, - exc=AssertionError('Screenshot taken is still in use')) - - -def compare_golden_image(similarity_threshold, screenshot, screenshot_path, golden_image_name, - golden_image_path=None): - """ - This function assumes that your golden image filename contains the same base screenshot name and the word "golden" - ex. pc_gamelobby_golden - - :param similarity_threshold: A float from 0.0 - 1.0 that determines how similar images must be or an asserts - :param screenshot: A string that is the full name of the screenshot (ex. 'gamelobby_host.jpg') - :param screenshot_path: A string that contains the path to the screenshots - :param golden_image_path: A string that contains the path to the golden images, defaults to the screenshot_path - :return: - """ - if golden_image_path is None: - golden_image_path = screenshot_path - - mean_similarity = compare_screenshots('{}\{}'.format(screenshot_path, screenshot), - '{}\{}'.format(golden_image_path, golden_image_name)) - assert mean_similarity > similarity_threshold, \ - '{} screenshot comparison failed! Mean similarity value is: {}'\ - .format(screenshot, mean_similarity) - - -def take_screenshot_and_compare(remote_console, launcher, screenshot, similarity_threshold, - golden_image_name, screenshot_path=None, file_type='.jpg'): - """ - Takes a screenshot and compares it with its golden image. This utilizes the take_screenshot_with_retries function - which is only used for PC. There are some assumptions with the golden image naming convention that is explained in - the compare_golden_image function. This also assumes it is a jpg file. - - This function enforces a naming convention such that the golden image and screenshot share part of the same name. - Also, the screenshot will be appended with the screenshot_key as shown below. - - The screenshot name will be screenshot_base + screenshot_key + filetype - (ex. 'gamelobby_host.jpg', 'MultiplayerSampleClient_1.png') - - :param screenshot_base: A string that is the base name of the screenshot (ex. 'gamelobby') - :param screenshot_key: A string that acts as a key identifier for the screenshot. - :param similarity_threshold: A float from 0.0 - 1.0 that determines how similar images must be or it asserts - :param screenshot_path: A string for the screenshot path. Defaults to user/screenshots - :param file_type: A string for the screenshot filetype. Defaults to '.jpg' - :return: - """ - if screenshot_path is None: - screenshot_path = r'{}\user\screenshots'.format(launcher.workspace.release.paths.platform_cache()) - - take_screenshot_with_retries(remote_console, launcher, screenshot) - compare_golden_image(similarity_threshold, '{}{}'.format(screenshot, file_type), - screenshot_path, golden_image_name) - - -def download_qa_golden_images(project_name, destination_dir, platform): - """ - Downloads the golden images for a specified project from s3. The project_name, platform, and filetype are used to - filter which images will be downloaded as the golden images. - - https://s3.console.aws.amazon.com/s3/buckets/ly-qae-jenkins-configs/golden-images/?region=us-west-1&tab=overview - - :param project_name: a string of the project name of the folder in s3. ex: 'MultiplayerSample' - :param destination_dir: a string of where the images will be downloaded to - :param platform: a string for the platform type ('pc', 'android', 'ios', 'darwin') - :param filetype: a string for the file type. ex: '.jpg', '.png' - :return: - """ - bucket_name = 'ly-qae-jenkins-configs' - path = 'golden-images/{}/{}/'.format(project_name, platform) - - if not s3_utils.key_exists_in_bucket(bucket_name, path): - raise s3_utils.KeyDoesNotExistError("Key '{}' does not exist in S3 bucket {}".format(path, bucket_name)) - for image in s3_utils.s3.Bucket(bucket_name).objects.filter(Prefix=path): - file_name = string.replace(image.key, path, '') - if file_name != '': - s3_utils.download_from_bucket(bucket_name, image.key, destination_dir, file_name) - - -def prepare_for_screenshot_compare(remote_console_instance): - """ - Prepares launcher for screenshot comparison. Removes any debug text and antialiasing that may result in interference - with the comparison. - - :param remote_console_instance: Remote console instance that is attached to a specific launcher instance - :return: - """ - wait_for(lambda: retry_console_command(remote_console_instance, 'r_displayinfo 0', - '$3r_DisplayInfo = $60 $5[DUMPTODISK, RESTRICTEDMODE]$4'), timeout=120) - wait_for(lambda: retry_console_command(remote_console_instance, 'r_antialiasingmode 0', - '$3r_AntialiasingMode = $60 $5[]$4'), timeout=120) - diff --git a/Tests/shared/shader_compile_server_utils.py b/Tests/shared/shader_compile_server_utils.py deleted file mode 100755 index 4c93970561..0000000000 --- a/Tests/shared/shader_compile_server_utils.py +++ /dev/null @@ -1,120 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - -import logging -import os -import psutil -import subprocess - -import test_tools.shared.file_system as file_system -from test_tools.shared.process_utils import kill_processes_named -from test_tools import HOST_PLATFORM - -logger = logging.getLogger(__name__) - - -def start_shader_compile_server(tools_dir, build_config, win_x64_compiler, clean=True): - """ - Starts the shader compile server for the given compiler version. Failure is currently not checked due to issues - with detecting if the process is alive immediately after requesting it to be spun up. - :param tools_dir: Tools directory inside of the dev root. - :param build_config: Build configuration name (profile, debug, etc.). - :param win_x64_compiler: Windows compiler version used to build the project. - :param clean: Removes Cache, Error, Shaders, and Temp directories if set to True. - """ - shader_compile_server_dir = os.path.join(tools_dir, 'CrySCompileServer', 'x64', build_config) - os.chdir(shader_compile_server_dir) - - shader_compile_server_exe = build_shader_compile_server_file_name(win_x64_compiler) - - # Only one shader compile server can run at a time, so kill the currently running process if any - kill_processes_named(shader_compile_server_exe) - - if clean: - clean_shader_compile_server_files(tools_dir, build_config) - - logger.info("Attempting to start shader compile server") - # Running with basic user permissions since the shader compile server warns against running as admin - subprocess.Popen(['RunAs', '/trustlevel:0x20000', shader_compile_server_exe]) - - -def start_mac_shader_compile_server(tools_dir, build_config, clean=True): - """ - Mac version of starting shader compiler given build configuration. Failure is currently not checked due to issues - with detecting if the process is alive immediately after requesting it to be spun up. - :param tools_dir: Tools directory inside of the dev root. - :param build_config: Build configuration name (profile, debug, etc.). - :param clean: Removes Cache, Error, Shaders, and Temp directories if set to True. - :return: Returns the actual process. - """ - shader_compile_server_dir = os.path.join(tools_dir, 'CrySCompileServer', 'osx', build_config) - os.chdir(shader_compile_server_dir) - - kill_processes_named('CrySCompileServer') - - if clean: - clean_shader_compile_server_files(tools_dir, build_config) - - logger.info("Attempting to start shader compile server") - subprocess.Popen('./CrySCompileServer', shell=True) - - -def build_shader_compile_server_file_name(win_x64_compiler): - """ - Puts together the shader compile server file name based on the specified VC compiler version. - :param win_x64_compiler: The VC compiler version specified in vsyyyy format, where yyyy is a year (ex: vs2017) - :return: The shader compile server file name complete with extension. - """ - shader_compile_server_exe = 'CrySCompileServer' - - return '{}.exe'.format(shader_compile_server_exe) - - -def clean_shader_compile_server_files(tools_dir, build_config): - """ - Removes the shader compile server generated Cache, Error, Shaders, and Temp directories. - :param tools_dir: Tools directory inside of the dev root. - :param build_config: Build configuration name (profile, debug, etc.). - """ - if HOST_PLATFORM == 'win_x64': - shader_compile_server_dir = os.path.join(tools_dir, 'CrySCompileServer', 'x64', build_config) - else: - shader_compile_server_dir = os.path.join(tools_dir, 'CrySCompileServer', 'osx', build_config) - os.chdir(shader_compile_server_dir) - - shader_compile_server_dirs = [os.path.join(shader_compile_server_dir, 'Cache'), - os.path.join(shader_compile_server_dir, 'Error'), - os.path.join(shader_compile_server_dir, 'Shaders'), - os.path.join(shader_compile_server_dir, 'Temp')] - if not file_system.delete(shader_compile_server_dirs, True, True): - directories_still_present = [] - for directory in shader_compile_server_dirs: - if os.path.exists(directory): - directories_still_present.append(directory) - raise RuntimeError("Failed to clean folders {} from directory {}".format(directories_still_present, - shader_compile_server_dir)) - - -def stop_shader_compile_server(): - """ - Finds any process with CrySCompileServer in its name and kills it. - """ - # This is necessary because the shader compile server is spawned from another process which - # immediately terminates after spawning its child - for process in psutil.process_iter(): - try: - if 'CrySCompileServer' in process.name(): - success_code = process.kill() - if success_code == 0: - logger.error("Failed to terminate CrySCompileServer process") - except psutil.NoSuchProcess: - # Process was already killed but caught as a zombie process, so pass as normal. - pass diff --git a/Tests/shared/substring.py b/Tests/shared/substring.py deleted file mode 100755 index 45c5f6d3af..0000000000 --- a/Tests/shared/substring.py +++ /dev/null @@ -1,73 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -String and search related functions. -""" -import os -import re - - -def in_file(file_path, pattern_string): - """ - This method checks if pattern_string exists in any line in the file specified in file_path. - It cannot match multi-line patterns. - :param file_path: files path for the file to search in - :param pattern_string: string to search for. - :return: True if the String is found, False otherwise. - """ - if not os.path.exists(file_path): - raise RuntimeError("File does not exist at {}".format(file_path)) - if not pattern_string: - raise RuntimeError("Must provide string to search for") - - with open(file_path, "r") as game_log: - for line in game_log.readlines(): - if pattern_string in line: - return True - return False - - -def regex_in_file(file_path, pattern_string): - """ - This method uses regex to check if pattern_string exists in the file specified in file_path. - It can match multi-line patterns but is a lot heavier as it parses whole file as string. - :param file_path: files path for the file to search in - :param pattern_string: regex-pattern to search for. - :return: True if the regex-pattern is found found in file, False otherwise. - """ - if not os.path.exists(file_path): - raise RuntimeError("File does not exist at {}".format(file_path)) - if not pattern_string: - raise RuntimeError("Must provide string to search for") - - re.compile(pattern_string) - with open(file_path, "r") as game_log: - return re.search(pattern_string, game_log.read()) - - -def regex_in_lines_in_file(file_path, pattern_string): - """ - This method uses regex to check if pattern_string exists in any line in the file specified in file_path. - It cannot match multi-line patterns, but will often more performant than regex_in_file. - :param file_path: files path for the file to search in - :param pattern_string: regex-pattern to search for. - :return: True if the regex-pattern is found found in file, False otherwise. - """ - if not os.path.exists(file_path): - raise RuntimeError("File does not exist at {}".format(file_path)) - if not pattern_string: - raise RuntimeError("Must provide string to search for") - - re.compile(pattern_string) - with open(file_path, "r") as game_log: - for line in game_log.readlines(): - if re.search(pattern_string, line): - return True - return False diff --git a/Tests/shared/windows_registry_utils.py b/Tests/shared/windows_registry_utils.py deleted file mode 100755 index 9f10317ea9..0000000000 --- a/Tests/shared/windows_registry_utils.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Small library of functions to support autotests for utilizing Windows Utilities - -""" - -import logging -import winreg -logger = logging.getLogger(__name__) - - -def registry_key_exists(registry_hive, registry_key, registry_subkey): - """ - Searches the Windows registry for the existance of a registry key - :param registry_hive: The hive in which to find keys & subkeys. EG: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :param registry_subkey: The subkey that can contain a value assignment - :return: A boolean value of the existance of the key - """ - - try: - registryKey = winreg.OpenKey(registry_hive, registry_key) - logger.debug("Registry Key: {0} found.".format(registry_key)) - - winreg.QueryValueEx(registryKey, registry_subkey) - logger.debug("Registry Subkey: {0} found.".format(registry_subkey)) - - registryKey.Close() - - return True - except WindowsError: - # Do not raise an assert since tests could revolve around a non-existant key - logger.debug("Registry SubKey: {0} was not found.".format(registry_key)) - return False - - -def get_registry_key_value(registry_hive, registry_key, registry_subkey): - """ - If a registry key exists, it will return the value else return None - :param registry_hive: The hive in which to find keys & subkeys. EG: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :param registry_subkey: The subkey that can contain a value assignment - :return: The value of the registry key value - """ - - if registry_key_exists(registry_hive, registry_key, registry_subkey): - - registryKey = winreg.OpenKey(registry_hive, registry_key) - logger.debug("Registry Key: {0} found.".format(registry_key)) - - subkeyValue = winreg.QueryValueEx(registryKey, registry_subkey) - logger.debug("Registry Subkey: {0} value found is is set to {1}".format(registry_subkey, subkeyValue)) - - registryKey.Close() - logger.debug("Registry Key hander closed") - - return str(subkeyValue[0]) # Index 0 contains the value, Index 1 contains the registry value type - else: - assert None, "Could not retrieve Registry Key Value since Registry Key '{0}' was not found.".format(registry_key) - - -def check_registry_key_value(registry_hive, registry_key, registry_subkey, expected='', case_sensitive=True): - """ - If registry key exists, then case insensitively checks that the registry key value is as expected - :param registry_hive: The hive in which to find keys & subkeys. EG: HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :param registry_subkey: The subkey that can contain a value assignment - :param expected: The expected value to be found in the registry - :param case_sensitive: Whether or not to perform a case sensitive or insentive validation - :return: A boolean value if the registry key value matches expected - """ - - if registry_key_exists(registry_hive, registry_key, registry_subkey): - - subkeyValue = get_registry_key_value(registry_hive, registry_key, registry_subkey) - - if case_sensitive: - logger.debug("Case sensitive comparison of Subkey '{0}' to Expected Value '{1}'" - .format(subkeyValue, expected)) - return subkeyValue == expected - else: - logger.debug("Case insensitive comparison of Subkey '{0}' to Expected Value '{1}'" - .format(subkeyValue, expected)) - return subkeyValue.lower() == expected.lower() - else: - logger.debug("Could not compare Subkey Value to expected value, Subkey '{0}' was not found at Key {1}." - .format(registry_subkey, registry_key)) - return False diff --git a/Tests/shared/windows_utils.py b/Tests/shared/windows_utils.py deleted file mode 100755 index a6bcff8d91..0000000000 --- a/Tests/shared/windows_utils.py +++ /dev/null @@ -1,130 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -Small library of functions to support autotests for utilizing Windows Utilities - -""" - -import logging -import psutil -import os -import subprocess -import pyscreenshot as winScreenshot - -from _winreg import * - -logger = logging.getLogger(__name__) - -def kill_app_by_name(project): - """ - Kills the app on windows for the specified app name - :param name: name of app running on the devkit to kill - """ - process_name = project + 'Launcher.exe' - for proc in psutil.process_iter(): - # check whether the process to kill name matches - if proc.name() == process_name: - proc.kill() - -def take_screenshot(result_path, image_filename, project=None): - """ - Takes a windows screenshot - :param result_path: path for the output file - :param image_filename: filename for the new image - :param project: project name for the running process, if provided only the window for this process will be captured - """ - if not os.path.exists(result_path): - os.mkdir(result_path) - - filename = "{}.png".format(image_filename) - filename = os.path.join(result_path, filename) - - image = winScreenshot.grab() # bbox=(10, 10, 510, 510)) # X1,Y1,X2,Y2 - image.save(filename) - - if not os.path.exists(filename): - # Capture failed - return False - - return True - -def launch(bin_path, project, parameters = None): - command_line = [os.path.join(bin_path, project + 'Launcher.exe')] - if parameters != None: - command_line = command_line + parameters - process = subprocess.Popen(command_line, stdout=subprocess.PIPE) - process.poll() - -def check_registry_key_exits(registry_key): - """ - Searches the Windows registry for the existance of a registry key - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :return: A boolean value of the existance of the key - """ - try: - registryHandle = ConnectRegistry(None, HKEY_LOCAL_MACHINE) - registryKey = OpenKey(registryHandle, registry_key) - - logger.info("Registry Key: {0} found.".format(registry_key)) - registryKey.Close() - registryHandle.Close() - - return True - except: - logger.error("Registry Key: {0} was not found.".format(registry_key)) - return False - -def get_registry_key_value(registry_key): - """ - If a registry key exists, it will return the value else return None - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :return: The value of the registry key value - """ - if check_registry_key_exits(registry_key): - logger.log("Retrieving the value of Registry Key '{0}'" - .format(registry_key)) - - registryHandle = ConnectRegistry(None, HKEY_LOCAL_MACHINE) - registryKey = OpenKey(registryHandle, registry_key) - - keyValue = registryKey.Value() - - registryKey.Close() - registryHandle.Close() - - return keyValue - else: - logger.error("Could not retrieve Registry Key Value since Registry Key '{0}' was not found." - .format(registry_key)) - return None - - -def check_registry_key_value(registry_key, expected): - """ - If registry key exists, then checks that the registry key value is as expected - :param registry_key: The bin directory from which to launch the AssetProcessor executable. - :return: A boolean value if the registry key value matches expected - """ - if check_registry_key_exits(registry_key): - - keyValue = get_registry_key_value(registry_key) - - if str.lower(keyValue) == str.lower(expected): - logger.info("The value of Registry Key '{0}' matched the expected '{1}'" - .format(registry_key, expected)) - return True - else: - logger.error("The value of Registry Key '{0}' die not match the expected '{1}'" - .format(registry_key, expected)) - return False - else: - logger.error("Could not compare Registry Key Value to expected Registry Key '{0}' was not found." - .format(registry_key)) - return False diff --git a/Tests/test_lib/launcher_testlib.py b/Tests/test_lib/launcher_testlib.py deleted file mode 100755 index 00ff8bc598..0000000000 --- a/Tests/test_lib/launcher_testlib.py +++ /dev/null @@ -1,194 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -This launcher_testlib file is used for a collection of reusable functionality that QA will use in their scripts. -""" - -import os - -import test_tools.shared.asset_processor_utils as asset_processor_utils -import test_tools.shared.file_utils as file_utils -import shared.shader_compile_server_utils as compile_server -import test_tools.shared.file_system as file_system - - -def setup_win_launcher_test(launcher): - """ - Assert that the launcher was able to build and that assets were processed successfully. - - :param launcher: The test-tools Launcher to be built. - """ - assert_build_success(launcher) - assert_process_assets(launcher) - - -def setup_mac_launcher_test(launcher, configuration): - """ - Assert that the launcher was able to build and that assets were processed successfully. Also starts the Mac - shader compile server. - - :param launcher: The test-tools Launcher to be built. - :param configuration: The shader compile server configuration to be launched. - """ - assert_build_success(launcher) - assert_process_assets(launcher) - start_mac_shader_compile_server(launcher, configuration, '127.0.0.1') - - -def setup_android_launcher_test(launcher, configuration, win_x64_compiler_version): - """ - Builds the Windows asset processor, asserts that the launcher was able to build and that assets were processed - successfully, and starts the Windows shader compile server. - - :param launcher: The test-tools Launcher to be built. - :param configuration: The shader compile server configuration to be launched. - :param win_x64_compiler_version: The msvc compiler version used to build the shader compile server executable. - """ - assert_asset_processor_build_success(launcher.workspace.release, win_x64_compiler_version) - assert_build_success(launcher) - assert_process_assets(launcher) - - start_shader_compile_server(launcher, configuration, '127.0.0.1', win_x64_compiler_version) - - -def assert_asset_processor_build_success(release, win_x64_compiler_version): - """ - Builds the win_x64 AssetProcessor and asserts on build failure. - - For use with platforms that require Windows tools but not the Windows launcher. - - :param release: The test-tools Release which holds path info for the test environment in use. - :param win_x64_compiler_version: The msvc compiler version used to build the AssetProcessor. - """ - asset_proc_build_success = asset_processor_utils.build_win_x64(release.paths.dev(), release.configuration, - win_x64_compiler_version) - assert asset_proc_build_success, "AssetProcessor did not build properly" - - -def assert_process_assets(launcher): - """ - Runs the Asset Processor Batch and asserts if any assets fail to process. - - :param launcher: The test-tools Launcher to be built. - """ - process_assets_success = launcher.workspace.release.process_assets() - assert process_assets_success, 'Assets did not process correctly' - - -def assert_build_success(launcher): - """ - Runs the build command for specified launcher configuration and asserts if the build fails. - - :param launcher: The test-tools Launcher to be built. - """ - build_success = launcher.workspace.release.build() - assert build_success, "{} - Build Failed! - {} {} {}".format(launcher.workspace.release.project, - launcher.workspace.release.platform, - launcher.workspace.release.configuration, - launcher.workspace.release.spec) - -def start_shader_compile_server(launcher, configuration, ip_addr, win_x64_compiler_version): - """ - Deals with the extra setup to start the Windows shader compiler. - - :param launcher: The test-tools Launcher to be built. - :param configuration: The shader compile server configuration to be launched. - :param ip_addr: The IP address of the remote shader compile server and AssetProcessor. - :param win_x64_compiler_version: The msvc compiler version used to build the shader compile server executable. - """ - launcher.workspace.release.modify_bootstrap_setting('remote_ip', ip_addr) - launcher.workspace.release.modify_platform_setting('r_ShaderCompilerServer', ip_addr) - launcher.workspace.release.modify_platform_setting('log_RemoteConsoleAllowedAddresses', ip_addr) - compile_server.start_shader_compile_server(launcher.workspace.release.paths.tools(), configuration, - win_x64_compiler_version) - - -def start_mac_shader_compile_server(launcher, configuration, ip_addr='127.0.0.1'): - """ - Deals with the extra setup to start the Mac shader compiler. - - :param launcher: The test-tools Launcher to be built. - :param configuration: The shader compile server configuration to be launched. - :param ip_addr: The IP address of the remote shader compile server and AssetProcessor. - """ - launcher.workspace.release.modify_bootstrap_setting('remote_ip', ip_addr) - launcher.workspace.release.modify_platform_setting('r_ShaderCompilerServer', ip_addr) - launcher.workspace.release.modify_platform_setting('log_RemoteConsoleAllowedAddresses', ip_addr) - compile_server.start_mac_shader_compile_server(launcher.workspace.release.paths.tools(), configuration) - - -def set_launcher_startup_config_file(launcher, project_name, config_name, commands): - """ - Clears out the specified config_name file and adds the commands specified to the cfg file. - - :param launcher: The test-tools Launcher to be built. - :param project_name: Name of the game project in test. - :param config_name: Name of the config file holding the launcher's startup commands. - :param commands: List of commands to append to the specified config file. - """ - file_utils.clear_out_config_file(launcher.workspace.release.paths.project(), config_name) - config_path = os.path.join(launcher.workspace.release.paths.platform_cache(), project_name) - file_utils.add_commands_to_config_file(config_path, '{}.cfg'.format(config_name), commands) - - -def configure_setup(launcher, delete_logs=True, delete_shaders=True): - """ - Deletes old artifact folders and clears out any config files. - - :param launcher: - :param delete_logs: Delete the game project's logs directory if True. - :param delete_shaders: Delete the project's cache directory if True. - """ - if delete_logs: - delete_project_logs(launcher) - - if delete_shaders: - delete_shader_cache(launcher) - - file_utils.delete_screenshot_folder(launcher.workspace.release.paths.platform_cache()) - - file_utils.clear_out_config_file(launcher.workspace.release.paths.project(), 'initialmap') - file_utils.clear_out_config_file(launcher.workspace.release.paths.project(), 'autoexec') - - -def delete_project_logs(launcher): - """ - Deletes project logs in the launcher's project folder. - """ - if os.path.exists(launcher.workspace.release.paths.project_log()): - file_system.delete([launcher.workspace.release.paths.project_log()], True, True) - - -def delete_shader_cache(launcher, asset_type="pc"): - """ - Deletes shader cache in the launcher's project folder. - """ - user_folder = os.path.join(launcher.workspace.release.paths.project_cache(), asset_type, "user", "cache") - if os.path.exists(user_folder): - file_system.delete([user_folder], True, True) - - -def retry_console_command(remote_console, command, output, tries=10, timeout=10): - """ - Retries specified console command multiple times and asserts if it still can not send. - :param remote_console: the remote console connected to the launcher. - :param command: the command to send to the console. - :param output: The expected output to check if the command was sent successfully. - :param tries: The amount of times to try before asserting. - :param timeout: The amount of time in seconds to wait for each retry send. - :return: True if succeeded, will assert otherwise. - """ - while tries > 0: - check_command = remote_console.expect_log_line(output, timeout) - remote_console.send_command(command) - if check_command(): - return True - tries -= 1 - assert False, "Command \"{}\" failed to run in remote console.".format(command) diff --git a/Tests/workflow/__init__.py b/Tests/workflow/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/android/__init__.py b/Tests/workflow/android/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/android/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/android/workflow_android.py b/Tests/workflow/android/workflow_android.py deleted file mode 100755 index 4eb0f578b1..0000000000 --- a/Tests/workflow/android/workflow_android.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -""" -import logging -import pytest - -import workflow.shared.workflow_shared as workflow_shared \ No newline at end of file diff --git a/Tests/workflow/ios/__init__.py b/Tests/workflow/ios/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/ios/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/ios/workflow_ios.py b/Tests/workflow/ios/workflow_ios.py deleted file mode 100755 index 4eb0f578b1..0000000000 --- a/Tests/workflow/ios/workflow_ios.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -""" -import logging -import pytest - -import workflow.shared.workflow_shared as workflow_shared \ No newline at end of file diff --git a/Tests/workflow/mac/__init__.py b/Tests/workflow/mac/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/mac/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/mac/workflow_mac.py b/Tests/workflow/mac/workflow_mac.py deleted file mode 100755 index 4eb0f578b1..0000000000 --- a/Tests/workflow/mac/workflow_mac.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -""" -import logging -import pytest - -import workflow.shared.workflow_shared as workflow_shared \ No newline at end of file diff --git a/Tests/workflow/shared/__init__.py b/Tests/workflow/shared/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/shared/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/shared/workflow_shared.py b/Tests/workflow/shared/workflow_shared.py deleted file mode 100755 index 3581f9349e..0000000000 --- a/Tests/workflow/shared/workflow_shared.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -This demos_testlib file is used for a collection of reusable functionality that QA will use in their scripts specific -to the setup of demo level tests. -""" -import sys - -import shared.network_utils as network_utils -from shared.screenshot_utils import move_screenshots, take_screenshot_with_retries - -from test_tools.shared.launcher_testlib import * - -import test_tools.shared.waiter -import test_tools.launchers.phase - - -def start_launcher(launcher): - """ - For PC: Used to start launcher and give time to load. - """ - launcher.launch() - launcher.run(test_tools.launchers.phase.TimePhase(120, 120)) - - -def remote_console_load_level(launcher, remote_console, level): - """ - Uses the remote console to use the map command to load a level and checks the console output for a successful load. - """ - command = 'map {}'.format(level) - load = remote_console.expect_log_line('LEVEL_LOAD_COMPLETE', 300) - retry_console_command(remote_console, command, "Executing console command '{}'".format(command)) - assert load(), "{} level failed to load.".format(level) - - # Allow one minute to let level fully render and to test for stability - launcher.run(test_tools.launchers.phase.TimePhase(60, 60)) - - -def start_remote_console(launcher, remote_console, on_devkit=False): - """ - Starts the remote console. Used in QA scripts that require the use of remote console. - """ - if on_devkit: - test_tools.shared.waiter.wait_for(lambda: network_utils.check_for_remote_listening_port(4600, launcher.ip), - timeout=600, exc=AssertionError('Port 4600 not listening.')) - else: - test_tools.shared.waiter.wait_for(lambda: network_utils.check_for_listening_port(4600), timeout=300, - exc=AssertionError('Port 4600 not listening.')) - - remote_console.start() - - # Allows remote console time to connect to launcher. - launcher.run(test_tools.launchers.phase.TimePhase(60, 60)) - - -def remote_console_take_screenshot(launcher, remote_console, level): - """ - Uses the remote console to run the r_GetScreenshot command to take a screenshot of the current launcher and move - the screenshot to the test results location. - """ - screenshot_path = os.path.join(launcher.workspace.release.paths.platform_cache(), "user", "screenshots") - take_screenshot_with_retries(remote_console, launcher, level) - if os.path.exists(screenshot_path): - move_screenshots(screenshot_path, '.jpg', launcher.workspace.artifact_manager.get_save_artifact_path()) - - -def build_setup(launcher, project_dir): - game_cfg = os.path.join(project_dir, 'game.cfg') - test_tools.shared.settings.edit_text_settings_file(game_cfg, 'sys_primaryUserSelectionEnabled', 0) - test_tools.shared.settings.edit_text_settings_file(game_cfg, 'sys_localUserLobbyEnabled', 0) - - -def enable_full_mode(launcher, console_remote_filesystem, console_paks): - print("Enabling FULL Mode") - launcher.workspace.release.modify_bootstrap_setting(console_remote_filesystem, 0) - launcher.workspace.release.modify_user_setting(console_paks, "False") - - -def enable_pak_mode(launcher, console_remote_filesystem, console_paks): - print("Enabling PAK Mode") - launcher.workspace.release.modify_bootstrap_setting(console_remote_filesystem, 0) - launcher.workspace.release.modify_user_setting(console_paks, "True") - - -def enable_vfs_mode(launcher, console_remote_filesystem, console_paks): - print("Enabling VFS Mode") - launcher.workspace.release.modify_bootstrap_setting(console_remote_filesystem, 1) - launcher.workspace.release.modify_user_setting(console_paks, "False") diff --git a/Tests/workflow/win/__init__.py b/Tests/workflow/win/__init__.py deleted file mode 100755 index e912252f4e..0000000000 --- a/Tests/workflow/win/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -""" - - All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or - its licensors. - - For complete copyright and license terms please see the LICENSE at the root of this - distribution (the "License"). All use of this software is governed by the License, - or, if provided, by the license below or the license accompanying this file. Do not - remove or modify any license notices. This file is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -""" - diff --git a/Tests/workflow/win/workflow_win.py b/Tests/workflow/win/workflow_win.py deleted file mode 100755 index 4eb0f578b1..0000000000 --- a/Tests/workflow/win/workflow_win.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -its licensors. - -For complete copyright and license terms please see the LICENSE at the root of this -distribution (the "License"). All use of this software is governed by the License, -or, if provided, by the license below or the license accompanying this file. Do not -remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - -""" -import logging -import pytest - -import workflow.shared.workflow_shared as workflow_shared \ No newline at end of file diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py index 5f6db7ac05..ec4b43b023 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/abstract_resource_locator.py @@ -16,8 +16,10 @@ import pathlib import warnings from abc import ABCMeta, abstractmethod +import ly_test_tools._internal.pytest_plugin from ly_test_tools.environment.file_system import find_ancestor_file + def _find_engine_root(initial_path): # type: (str) -> str """ @@ -34,11 +36,9 @@ def _find_engine_root(initial_path): # Assumes folder structure similar to: engine_root/dev/Tools/.../ly_test_tools/builtin for _ in range(15): if os.path.exists(os.path.join(current_dir, root_file)): - # The parent of the directory containing the engineroot.txt is the root directory - engine_root = current_dir - return engine_root - # Using an explicit else to avoid aberrant behavior from following filesystem links - else: + # parent of the directory containing root_file + return current_dir + else: # explicit else avoids aberrant behavior from following filesystem links current_dir = os.path.abspath(os.path.join(current_dir, os.path.pardir)) raise OSError(f"Unable to find engine root directory. Verify root file '{root_file}' exists") @@ -50,8 +50,10 @@ def _find_project_json(engine_root, project): Find the project.json file for this project. :return: Full path to the project.json file """ - project_json = find_ancestor_file('project.json') - if not project_json: + # First check relative to defined build directory, for external projects which configure through SDK settings + project_json = find_ancestor_file(target_file_name='project.json', + start_path=ly_test_tools._internal.pytest_plugin.build_directory) + if not project_json: # check internally for a project bundled with the engine project_json = os.path.join(engine_root, project, 'project.json') return project_json @@ -250,9 +252,6 @@ class AbstractResourceLocator(object): """ return os.path.join(self.build_directory(), 'CrySCompileServer') - def bootstrap_config_file(self): - return os.path.join(self.engine_root(), 'bootstrap.cfg') - def asset_processor_config_file(self): return os.path.join(self.engine_root(), 'Registry', 'AssetProcessorPlatformConfig.setreg') diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/mac.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/mac.py index 453e80ac41..4e19a3955a 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/mac.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/mac.py @@ -21,8 +21,8 @@ from ly_test_tools._internal.managers.abstract_resource_locator import AbstractR logger = logging.getLogger(__name__) -CACHE_DIR = 'osx_gl' -CONFIG_FILE = 'system_osx_osx_gl.cfg' +CACHE_DIR = 'mac' +CONFIG_FILE = 'system_osx_mac.cfg' class _MacResourceLocator(AbstractResourceLocator): @@ -33,7 +33,7 @@ class _MacResourceLocator(AbstractResourceLocator): def platform_config_file(self): """ Return the path to the platform config file. - ex. engine_root/dev/system_osx_osx_gl.cfg + ex. engine_root/dev/system_osx_mac.cfg :return: path to the platform config file """ return os.path.join(self.engine_root(), CONFIG_FILE) diff --git a/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/windows.py b/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/windows.py index 80ac413dbb..db6e7d713d 100755 --- a/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/windows.py +++ b/Tools/LyTestTools/ly_test_tools/_internal/managers/platforms/windows.py @@ -39,7 +39,7 @@ class _WindowsResourceLocator(AbstractResourceLocator): def platform_config_file(self): """ Return the path to the platform config file. - ex. engine_root/dev/system_osx_osx_gl.cfg + ex. engine_root/dev/system_osx_mac.cfg :return: path to the platform config file """ return os.path.join(self.engine_root(), CONFIG_FILE) diff --git a/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py b/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py index 1b0afb3efe..386de62048 100755 --- a/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py +++ b/Tools/LyTestTools/ly_test_tools/launchers/platforms/base.py @@ -123,7 +123,6 @@ class Launcher(object): """ backup_path = self.workspace.settings.get_temp_path() log.debug(f"Performing automatic backup of bootstrap, platform and user settings in path {backup_path}") - self.workspace.settings.backup_bootstrap_settings(backup_path) self.workspace.settings.backup_platform_settings(backup_path) self.workspace.settings.backup_shader_compiler_settings(backup_path) diff --git a/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py index 0983d2c45f..8e2b93c20a 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/asset_processor.py @@ -36,10 +36,10 @@ DEFAULT_TIMEOUT_HOURS = 8 DEFAULT_TIMEOUT_SECONDS = 300 ASSET_PROCESSOR_PLATFORM_MAP = { - 'android': 'es3', + 'android': 'android', 'ios': 'ios', 'linux': 'linux', # Not fully implemented, see SPEC-2501 - 'mac': 'osx_gl', + 'mac': 'mac', 'windows': 'pc', } @@ -597,7 +597,7 @@ class AssetProcessor(object): run_result = subprocess.run(command, close_fds=True, timeout=timeout, capture_output=capture_output) output_list = None if capture_output: - output_list = run_result.stdout.split(b"\r\n") + output_list = run_result.stdout.splitlines() if decode: output_list = [line.decode('utf-8') for line in output_list] @@ -664,8 +664,7 @@ class AssetProcessor(object): make_dir = os.path.join(self._temp_asset_root, copy_dir) if not os.path.isdir(make_dir): os.makedirs(make_dir) - for copyfile_name in ['bootstrap.cfg', - 'Registry/AssetProcessorPlatformConfig.setreg', + for copyfile_name in ['Registry/AssetProcessorPlatformConfig.setreg', os.path.join(self._workspace.project, "project.json"), os.path.join('Assets', 'Engine', 'exclude.filetag')]: shutil.copyfile(os.path.join(self._workspace.paths.engine_root(), copyfile_name), diff --git a/Tools/LyTestTools/ly_test_tools/o3de/settings.py b/Tools/LyTestTools/ly_test_tools/o3de/settings.py index 9677a4d3a3..a1e83abe51 100644 --- a/Tools/LyTestTools/ly_test_tools/o3de/settings.py +++ b/Tools/LyTestTools/ly_test_tools/o3de/settings.py @@ -57,14 +57,6 @@ class LySettings(object): """ self._backup_settings(self._resource_locator.platform_config_file(), backup_path) - def backup_bootstrap_settings(self, backup_path=None): - """ - Creates a backup of the bootstrap settings file (~/dev/bootstrap.cfg) in the backup_path. If no path is - provided, it will store in the workspace temp path (the contents of the workspace temp directory are removed - during workspace teardown) - """ - self._backup_settings(self._resource_locator.bootstrap_config_file(), backup_path) - def backup_shader_compiler_settings(self, backup_path=None): self._backup_settings(self._resource_locator.shader_compiler_config_file(), backup_path) @@ -79,14 +71,6 @@ class LySettings(object): """ self._restore_settings(self._resource_locator.platform_config_file(), backup_path) - def restore_bootstrap_settings(self, backup_path=None): - """ - Restores the bootstrap settings file (~/dev/bootstrap.cfg) from its backup. - The backup is stored in the backup_path. - If no backup_path is provided, it will attempt to retrieve the backup from the workspace temp path. - """ - self._restore_settings(self._resource_locator.bootstrap_config_file(), backup_path) - def restore_shader_compiler_settings(self, backup_path=None): self._restore_settings(self._resource_locator.shader_compiler_config_file(), backup_path) diff --git a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py index e46fefa461..12286b3dd7 100755 --- a/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py +++ b/Tools/LyTestTools/tests/unit/test_abstract_resource_locator.py @@ -158,13 +158,6 @@ class TestAbstractResourceLocator(object): assert mock_abstract_resource_locator.shader_cache() == expected_path - def test_BootstrapConfigFile_IsCalled_ReturnBootstrapConfigFilePath(self): - mock_abstract_resource_locator = abstract_resource_locator.AbstractResourceLocator( - mock_build_directory, mock_project) - expected_path = os.path.join(mock_abstract_resource_locator.engine_root(), 'bootstrap.cfg') - - assert mock_abstract_resource_locator.bootstrap_config_file() == expected_path - def test_AssetProcessorConfigFile_IsCalled_ReturnsAssetProcessorConfigFilePath(self): mock_abstract_resource_locator = abstract_resource_locator.AbstractResourceLocator( mock_build_directory, mock_project) diff --git a/bootstrap.cfg b/bootstrap.cfg deleted file mode 100644 index 858e9093f5..0000000000 --- a/bootstrap.cfg +++ /dev/null @@ -1,12 +0,0 @@ -; This file is deprecated and is only use currently for setting the path when running O3DE in an engine-centric manner -; By engine-centric, what is meant is using CMake to configure from the directory and passing in the LY_PROJECTS value - -project_path=AutomatedTesting - -; The Asset Processor Specific settings are now the /Engine/Registry/bootstrap.setreg settings -; The Engine specific settings can be overridden in order of least precedence to most -; 1. Override the settings in a "/Registry/*.setreg(patch)" file (Shared per Gem Settings) -; 2. Override the settings in a "/Registry/*.setreg(patch)" file (Shared per Project Settings) -; 3. Override the settings in a "/user/Registry/*.setreg(patch)" file (User per Project Settings) -; 4. Override the settings in a "~/.o3de/Registry/*.setreg(patch)" file (User Global Settings) -; Where "~" is %USERPROFILE% on Windows and $HOME on Unix like platforms diff --git a/cmake/3rdParty.cmake b/cmake/3rdParty.cmake index 7385f34e5a..eb11404237 100644 --- a/cmake/3rdParty.cmake +++ b/cmake/3rdParty.cmake @@ -313,6 +313,9 @@ 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}) list(APPEND CMAKE_MODULE_PATH ${pal_dir}) -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}) -ly_include_cmake_file_list(${pal_3rdparty_dir}/cmake_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) +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}) + ly_include_cmake_file_list(${pal_3rdparty_dir}/cmake_${PAL_PLATFORM_NAME_LOWERCASE}_files.cmake) +endif() \ No newline at end of file diff --git a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake index f7cd10bcf9..3220271b42 100644 --- a/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake +++ b/cmake/3rdParty/Platform/Linux/BuiltInPackages_linux.cmake @@ -10,40 +10,41 @@ # # shared by other platforms: -ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) -ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) -ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev7-multiplatform TARGETS assimplib PACKAGE_HASH def855c89d8210db3040f1cb6ec837141ab9b8e74c158eae7c03d50160fcf30b) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) -ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) -ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) -ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) -ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) -ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) -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 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) -ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) +ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) +ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) +ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev9-multiplatform TARGETS assimplib PACKAGE_HASH 448530277b51b145ca43b96becd0266e29ae210fc9e2b45f5afe85f301a040e7) +ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) +ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) +ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) +ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) +ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) +ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) +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 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) +ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) # platform-specific: -ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) -ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-linux TARGETS freetype PACKAGE_HASH 9ad246873067717962c6b780d28a5ce3cef3321b73c9aea746a039c798f52e93) -ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-linux TARGETS tiff PACKAGE_HASH ae92b4d3b189c42ef644abc5cac865d1fb2eb7cb5622ec17e35642b00d1a0a76) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-linux TARGETS AWSNativeSDK PACKAGE_HASH b4db38de49d35a5f7500aed7f4aee5ec511dd3b584ee06fe9097885690191a5d) -ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux TARGETS Lua PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0) -ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-linux TARGETS PhysX PACKAGE_HASH e3ca36106a8dbf1524709f8bb82d520920ebd3ff3a92672d382efff406c75ee3) -ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-linux TARGETS etc2comp PACKAGE_HASH 9283aa5db5bb7fb90a0ddb7a9f3895317c8ebe8044943124bbb3673a41407430) -ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-linux TARGETS mcpp PACKAGE_HASH 0aa713f3f2c156cb2f17d9b800aed8acf9df5ab167c48b679853ecb040da9a67) -ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-linux TARGETS mikkelsen PACKAGE_HASH 5973b1e71a64633588eecdb5b5c06ca0081f7be97230f6ef64365cbda315b9c8) -ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-linux TARGETS googletest PACKAGE_HASH 7b7ad330f369450c316a4c4592d17fbb4c14c731c95bd8f37757203e8c2bbc1b) -ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-linux TARGETS GoogleBenchmark PACKAGE_HASH 4038878f337fc7e0274f0230f71851b385b2e0327c495fc3dd3d1c18a807928d) -ly_associate_package(PACKAGE_NAME unwind-1.2.1-linux TARGETS unwind PACKAGE_HASH 3453265fb056e25432f611a61546a25f60388e315515ad39007b5925dd054a77) -ly_associate_package(PACKAGE_NAME qt-5.15.2-rev3-linux TARGETS Qt PACKAGE_HASH b7d9932647f4b138b3f0b124d70debd250d2a8a6dca52b04dcbe82c6369d48ca) -ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-linux TARGETS libsamplerate PACKAGE_HASH 41643c31bc6b7d037f895f89d8d8d6369e906b92eff42b0fe05ee6a100f06261) -ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-linux TARGETS OpenSSL PACKAGE_HASH b779426d1e9c5ddf71160d5ae2e639c3b956e0fb5e9fcaf9ce97c4526024e3bc) +ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-linux TARGETS AWSGameLiftServerSDK PACKAGE_HASH a8149a95bd100384af6ade97e2b21a56173740d921e6c3da8188cd51554d39af) +ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-linux TARGETS freetype PACKAGE_HASH 9ad246873067717962c6b780d28a5ce3cef3321b73c9aea746a039c798f52e93) +ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-linux TARGETS tiff PACKAGE_HASH ae92b4d3b189c42ef644abc5cac865d1fb2eb7cb5622ec17e35642b00d1a0a76) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev4-linux TARGETS AWSNativeSDK PACKAGE_HASH b4db38de49d35a5f7500aed7f4aee5ec511dd3b584ee06fe9097885690191a5d) +ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-linux TARGETS Lua PACKAGE_HASH 1adc812abe3dd0dbb2ca9756f81d8f0e0ba45779ac85bf1d8455b25c531a38b0) +ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-linux TARGETS PhysX PACKAGE_HASH e3ca36106a8dbf1524709f8bb82d520920ebd3ff3a92672d382efff406c75ee3) +ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-linux TARGETS etc2comp PACKAGE_HASH 9283aa5db5bb7fb90a0ddb7a9f3895317c8ebe8044943124bbb3673a41407430) +ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-linux TARGETS mcpp PACKAGE_HASH 0aa713f3f2c156cb2f17d9b800aed8acf9df5ab167c48b679853ecb040da9a67) +ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-linux TARGETS mikkelsen PACKAGE_HASH 5973b1e71a64633588eecdb5b5c06ca0081f7be97230f6ef64365cbda315b9c8) +ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-linux TARGETS googletest PACKAGE_HASH 7b7ad330f369450c316a4c4592d17fbb4c14c731c95bd8f37757203e8c2bbc1b) +ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-linux TARGETS GoogleBenchmark PACKAGE_HASH 4038878f337fc7e0274f0230f71851b385b2e0327c495fc3dd3d1c18a807928d) +ly_associate_package(PACKAGE_NAME unwind-1.2.1-linux TARGETS unwind PACKAGE_HASH 3453265fb056e25432f611a61546a25f60388e315515ad39007b5925dd054a77) +ly_associate_package(PACKAGE_NAME qt-5.15.2-rev3-linux TARGETS Qt PACKAGE_HASH b7d9932647f4b138b3f0b124d70debd250d2a8a6dca52b04dcbe82c6369d48ca) +ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-linux TARGETS libsamplerate PACKAGE_HASH 41643c31bc6b7d037f895f89d8d8d6369e906b92eff42b0fe05ee6a100f06261) +ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-linux TARGETS OpenSSL PACKAGE_HASH b779426d1e9c5ddf71160d5ae2e639c3b956e0fb5e9fcaf9ce97c4526024e3bc) +ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-linux TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 235606f98512c076a1ba84a8402ad24ac21945998abcea264e8e204678efc0ba) diff --git a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake index 4ef0f8af85..f85048d13e 100644 --- a/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake +++ b/cmake/3rdParty/Platform/Mac/BuiltInPackages_mac.cmake @@ -10,42 +10,41 @@ # # shared by other platforms: -ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) -ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) -ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev7-multiplatform TARGETS assimplib PACKAGE_HASH def855c89d8210db3040f1cb6ec837141ab9b8e74c158eae7c03d50160fcf30b) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) -ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) -ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) -ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) -ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) -ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) -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 SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) -ly_associate_package(PACKAGE_NAME SPIRVCross-2020.04.20-rev1-multiplatform TARGETS SPIRVCross PACKAGE_HASH 7c8c0eaa0166c26745c62d2238525af7e27ac058a5db3defdbaec1878e8798dd) -ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-2020.08.07-rev1-multiplatform TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 04a6850ce03d4c16e19ed206f7093d885276dfb74047e6aa99f0a834c8b7cc73) -ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxcAz-5.0.0_az-rev1-multiplatform TARGETS DirectXShaderCompilerDxcAz PACKAGE_HASH 94f24989a7a371d840b513aa5ffaff02747b3d19b119bc1f899427e29978f753) -ly_associate_package(PACKAGE_NAME azslc-1.7.20-rev1-multiplatform TARGETS azslc PACKAGE_HASH 45d55f28bea2ef823ed3204f60df52e5e329f42923923d4555fdbdf3bea0af60) -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) -ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) +ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) +ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) +ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev9-multiplatform TARGETS assimplib PACKAGE_HASH 448530277b51b145ca43b96becd0266e29ae210fc9e2b45f5afe85f301a040e7) +ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) +ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) +ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) +ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) +ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) +ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) +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 SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) +ly_associate_package(PACKAGE_NAME azslc-1.7.21-rev1-multiplatform TARGETS azslc PACKAGE_HASH 772b7a2d9cc68aa1da4f0ee7db57ee1b4e7a8f20b81961fc5849af779582f4df) +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) +ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) # platform-specific: -ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-mac-ios TARGETS freetype PACKAGE_HASH 67b4f57aed92082d3fd7c16aa244a7d908d90122c296b0a63f73e0a0b8761977) -ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-mac-ios TARGETS tiff PACKAGE_HASH a23ae1f8991a29f8e5df09d6d5b00d7768a740f90752cef465558c1768343709) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev3-mac TARGETS AWSNativeSDK PACKAGE_HASH 21920372e90355407578b45ac19580df1463a39a25a867bcd0ffd8b385c8254a) -ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev6-mac TARGETS Lua PACKAGE_HASH b9079fd35634774c9269028447562c6b712dbc83b9c64975c095fd423ff04c08) -ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-mac TARGETS PhysX PACKAGE_HASH 149f5e9b44bd27291b1c4772f5e89a1e0efa88eef73c7e0b188935ed4d0c4a70) -ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-mac TARGETS etc2comp PACKAGE_HASH 1966ab101c89db7ecf30984917e0a48c0d02ee0e4d65b798743842b9469c0818) -ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-mac TARGETS mcpp PACKAGE_HASH 48a9c5197bf72843fb9ac44825501ee16bbe3e72e086a32b8c9c05bf47db12ab) -ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-mac TARGETS mikkelsen PACKAGE_HASH 83af99ca8bee123684ad254263add556f0cf49486c0b3e32e6d303535714e505) -ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-mac TARGETS googletest PACKAGE_HASH cbf020d5ef976c5db8b6e894c6c63151ade85ed98e7c502729dd20172acae5a8) -ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-mac TARGETS GoogleBenchmark PACKAGE_HASH ad25de0146769c91e179953d845de2bec8ed4a691f973f47e3eb37639381f665) -ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-mac TARGETS OpenSSL PACKAGE_HASH 28adc1c0616ac0482b2a9d7b4a3a3635a1020e87b163f8aba687c501cf35f96c) -ly_associate_package(PACKAGE_NAME qt-5.15.2-rev3-mac TARGETS Qt PACKAGE_HASH 4723ac43b19d4633c3fa4b9642f27c992d30cdc689f769f82869786f1c22a728) -ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-mac TARGETS libsamplerate PACKAGE_HASH b912af40c0ac197af9c43d85004395ba92a6a859a24b7eacd920fed5854a97fe) +ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-mac TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 2bede9a7ef3573027c005e38139237559eebf845c13ffb54c33c5b8675f962e2) +ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-mac TARGETS SPIRVCross PACKAGE_HASH 78c6376ed2fd195b9b1f5fb2b56e5267a32c3aa21fb399e905308de470eb4515) +ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-mac-ios TARGETS freetype PACKAGE_HASH 67b4f57aed92082d3fd7c16aa244a7d908d90122c296b0a63f73e0a0b8761977) +ly_associate_package(PACKAGE_NAME tiff-4.2.0.15-mac-ios TARGETS tiff PACKAGE_HASH a23ae1f8991a29f8e5df09d6d5b00d7768a740f90752cef465558c1768343709) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev3-mac TARGETS AWSNativeSDK PACKAGE_HASH 21920372e90355407578b45ac19580df1463a39a25a867bcd0ffd8b385c8254a) +ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev6-mac TARGETS Lua PACKAGE_HASH b9079fd35634774c9269028447562c6b712dbc83b9c64975c095fd423ff04c08) +ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-mac TARGETS PhysX PACKAGE_HASH 149f5e9b44bd27291b1c4772f5e89a1e0efa88eef73c7e0b188935ed4d0c4a70) +ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-mac TARGETS etc2comp PACKAGE_HASH 1966ab101c89db7ecf30984917e0a48c0d02ee0e4d65b798743842b9469c0818) +ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-mac TARGETS mcpp PACKAGE_HASH 48a9c5197bf72843fb9ac44825501ee16bbe3e72e086a32b8c9c05bf47db12ab) +ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-mac TARGETS mikkelsen PACKAGE_HASH 83af99ca8bee123684ad254263add556f0cf49486c0b3e32e6d303535714e505) +ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-mac TARGETS googletest PACKAGE_HASH cbf020d5ef976c5db8b6e894c6c63151ade85ed98e7c502729dd20172acae5a8) +ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-mac TARGETS GoogleBenchmark PACKAGE_HASH ad25de0146769c91e179953d845de2bec8ed4a691f973f47e3eb37639381f665) +ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev1-mac TARGETS OpenSSL PACKAGE_HASH 28adc1c0616ac0482b2a9d7b4a3a3635a1020e87b163f8aba687c501cf35f96c) +ly_associate_package(PACKAGE_NAME qt-5.15.2-rev3-mac TARGETS Qt PACKAGE_HASH 4723ac43b19d4633c3fa4b9642f27c992d30cdc689f769f82869786f1c22a728) +ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-mac TARGETS libsamplerate PACKAGE_HASH b912af40c0ac197af9c43d85004395ba92a6a859a24b7eacd920fed5854a97fe) diff --git a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake index b36248b929..fa1326b63d 100644 --- a/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake +++ b/cmake/3rdParty/Platform/Windows/BuiltInPackages_windows.cmake @@ -10,50 +10,49 @@ # # shared by other platforms: -ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) -ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) -ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) -ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) -ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev7-multiplatform TARGETS assimplib PACKAGE_HASH def855c89d8210db3040f1cb6ec837141ab9b8e74c158eae7c03d50160fcf30b) -ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) -ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) -ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) -ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) -ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) -ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) -ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) -ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) -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 SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) -ly_associate_package(PACKAGE_NAME SPIRVCross-2020.04.20-rev1-multiplatform TARGETS SPIRVCross PACKAGE_HASH 7c8c0eaa0166c26745c62d2238525af7e27ac058a5db3defdbaec1878e8798dd) -ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxc-2020.08.07-rev1-multiplatform TARGETS DirectXShaderCompilerDxc PACKAGE_HASH 04a6850ce03d4c16e19ed206f7093d885276dfb74047e6aa99f0a834c8b7cc73) -ly_associate_package(PACKAGE_NAME DirectXShaderCompilerDxcAz-5.0.0_az-rev1-multiplatform TARGETS DirectXShaderCompilerDxcAz PACKAGE_HASH 94f24989a7a371d840b513aa5ffaff02747b3d19b119bc1f899427e29978f753) -ly_associate_package(PACKAGE_NAME azslc-1.7.20-rev1-multiplatform TARGETS azslc PACKAGE_HASH 45d55f28bea2ef823ed3204f60df52e5e329f42923923d4555fdbdf3bea0af60) -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) -ly_associate_package(PACKAGE_NAME Blast-1.1.7-rev1-multiplatform TARGETS Blast PACKAGE_HASH 36b8f393bcd25d0f85cfc7a831ebbdac881e6054c4f0735649966aa6aa86e6f0) -ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) +ly_associate_package(PACKAGE_NAME zlib-1.2.8-rev2-multiplatform TARGETS zlib PACKAGE_HASH e6f34b8ac16acf881e3d666ef9fd0c1aee94c3f69283fb6524d35d6f858eebbb) +ly_associate_package(PACKAGE_NAME ilmbase-2.3.0-rev4-multiplatform TARGETS ilmbase PACKAGE_HASH 97547fdf1fbc4d81b8ccf382261f8c25514ed3b3c4f8fd493f0a4fa873bba348) +ly_associate_package(PACKAGE_NAME hdf5-1.0.11-rev2-multiplatform TARGETS hdf5 PACKAGE_HASH 11d5e04df8a93f8c52a5684a4cacbf0d9003056360983ce34f8d7b601082c6bd) +ly_associate_package(PACKAGE_NAME alembic-1.7.11-rev3-multiplatform TARGETS alembic PACKAGE_HASH ba7a7d4943dd752f5a662374f6c48b93493df1d8e2c5f6a8d101f3b50700dd25) +ly_associate_package(PACKAGE_NAME assimp-5.0.1-rev9-multiplatform TARGETS assimplib PACKAGE_HASH 448530277b51b145ca43b96becd0266e29ae210fc9e2b45f5afe85f301a040e7) +ly_associate_package(PACKAGE_NAME squish-ccr-20150601-rev3-multiplatform TARGETS squish-ccr PACKAGE_HASH c878c6c0c705e78403c397d03f5aa7bc87e5978298710e14d09c9daf951a83b3) +ly_associate_package(PACKAGE_NAME ASTCEncoder-2017_11_14-rev2-multiplatform TARGETS ASTCEncoder PACKAGE_HASH c240ffc12083ee39a5ce9dc241de44d116e513e1e3e4cc1d05305e7aa3bdc326) +ly_associate_package(PACKAGE_NAME md5-2.0-multiplatform TARGETS md5 PACKAGE_HASH 29e52ad22c78051551f78a40c2709594f0378762ae03b417adca3f4b700affdf) +ly_associate_package(PACKAGE_NAME RapidJSON-1.1.0-multiplatform TARGETS RapidJSON PACKAGE_HASH 18b0aef4e6e849389916ff6de6682ab9c591ebe15af6ea6017014453c1119ea1) +ly_associate_package(PACKAGE_NAME RapidXML-1.13-multiplatform TARGETS RapidXML PACKAGE_HASH 510b3c12f8872c54b34733e34f2f69dd21837feafa55bfefa445c98318d96ebf) +ly_associate_package(PACKAGE_NAME pybind11-2.4.3-rev2-multiplatform TARGETS pybind11 PACKAGE_HASH d8012f907b6c54ac990b899a0788280857e7c93a9595405a28114b48c354eb1b) +ly_associate_package(PACKAGE_NAME cityhash-1.1-multiplatform TARGETS cityhash PACKAGE_HASH 0ace9e6f0b2438c5837510032d2d4109125845c0efd7d807f4561ec905512dd2) +ly_associate_package(PACKAGE_NAME lz4-r128-multiplatform TARGETS lz4 PACKAGE_HASH d7b1d5651191db2c339827ad24f669d9d37754143e9173abc986184532f57c9d) +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 SQLite-3.32.2-rev3-multiplatform TARGETS SQLite PACKAGE_HASH dd4d3de6cbb4ce3d15fc504ba0ae0587e515dc89a25228037035fc0aef4831f4) +ly_associate_package(PACKAGE_NAME azslc-1.7.21-rev1-multiplatform TARGETS azslc PACKAGE_HASH 772b7a2d9cc68aa1da4f0ee7db57ee1b4e7a8f20b81961fc5849af779582f4df) +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) +ly_associate_package(PACKAGE_NAME Blast-1.1.7-rev1-multiplatform TARGETS Blast PACKAGE_HASH 36b8f393bcd25d0f85cfc7a831ebbdac881e6054c4f0735649966aa6aa86e6f0) +ly_associate_package(PACKAGE_NAME PVRTexTool-4.24.0-rev4-multiplatform TARGETS PVRTexTool PACKAGE_HASH d0d6da61c7557de0d2c71fc35ba56c3be49555b703f0e853d4c58225537acf1e) # platform-specific: -ly_associate_package(PACKAGE_NAME AWSGameLiftServerSDK-3.4.1-rev1-windows TARGETS AWSGameLiftServerSDK PACKAGE_HASH a0586b006e4def65cc25f388de17dc475e417dc1e6f9d96749777c88aa8271b0) -ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-windows TARGETS freetype PACKAGE_HASH 88dedc86ccb8c92f14c2c033e51ee7d828fa08eafd6475c6aa963938a99f4bf3) -ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-windows TARGETS tiff PACKAGE_HASH ab60d1398e4e1e375ec0f1a00cdb1d812a07c0096d827db575ce52dd6d714207) -ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev3-windows TARGETS AWSNativeSDK PACKAGE_HASH 929873d4252c464620a9d288e41bd5d47c0bd22750aeb3a1caa68a3da8247c48) -ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-windows TARGETS Lua PACKAGE_HASH 136faccf1f73891e3fa3b95f908523187792e56f5b92c63c6a6d7e72d1158d40) -ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-windows TARGETS PhysX PACKAGE_HASH 198bed89d1aae7caaf5dadba24cee56235fe41725d004b64040d4e50d0f3aa1a) -ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-windows TARGETS etc2comp PACKAGE_HASH fc9ae937b2ec0d42d5e7d0e9e8c80e5e4d257673fb33bc9b7d6db76002117123) -ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-windows TARGETS mcpp PACKAGE_HASH 511672598fa319bfb8db87f965b59abff1620bb7c1dcf7669e039a8acd8d3ff8) -ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-windows TARGETS mikkelsen PACKAGE_HASH 872c4d245a1c86139aa929f2b465b63ea4ea55b04ced50309135dd4597457a4e) -ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-windows TARGETS googletest PACKAGE_HASH 7e8f03ae8a01563124e3daa06386f25a2b311c10bb95bff05cae6c41eff83837) -ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-windows TARGETS GoogleBenchmark PACKAGE_HASH 0c94ca69ae8e7e4aab8e90032b5c82c5964410429f3dd9dbb1f9bf4fe032b1d4) -ly_associate_package(PACKAGE_NAME d3dx12-headers-rev1-windows TARGETS d3dx12 PACKAGE_HASH 088c637159fba4a3e4c0cf08fb4921906fd4cca498939bd239db7c54b5b2f804) -ly_associate_package(PACKAGE_NAME pyside2-qt-5.15.1-rev2-windows TARGETS pyside2 PACKAGE_HASH c90f3efcc7c10e79b22a33467855ad861f9dbd2e909df27a5cba9db9fa3edd0f) -ly_associate_package(PACKAGE_NAME openimageio-2.1.16.0-rev2-windows TARGETS OpenImageIO PACKAGE_HASH 85a2a6cf35cbc4c967c56ca8074babf0955c5b490c90c6e6fd23c78db99fc282) -ly_associate_package(PACKAGE_NAME qt-5.15.2-rev2-windows TARGETS Qt PACKAGE_HASH 29966f22ec253dc9904e88ad48fe6b6a669302b2dc7049f2e2bbd4949e79e595) -ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-windows TARGETS libsamplerate PACKAGE_HASH dcf3c11a96f212a52e2c9241abde5c364ee90b0f32fe6eeb6dcdca01d491829f) -ly_associate_package(PACKAGE_NAME OpenMesh-8.1-rev1-windows TARGETS OpenMesh PACKAGE_HASH 1c1df639358526c368e790dfce40c45cbdfcfb1c9a041b9d7054a8949d88ee77) -ly_associate_package(PACKAGE_NAME civetweb-1.8-rev1-windows TARGETS civetweb PACKAGE_HASH 36d0e58a59bcdb4dd70493fb1b177aa0354c945b06c30416348fd326cf323dd4) -ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-windows TARGETS OpenSSL PACKAGE_HASH 9af1c50343f89146b4053101a7aeb20513319a3fe2f007e356d7ce25f9241040) -ly_associate_package(PACKAGE_NAME Crashpad-0.8.0-rev1-windows TARGETS Crashpad PACKAGE_HASH d162aa3070147bc0130a44caab02c5fe58606910252caf7f90472bd48d4e31e2) +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-rev2-windows TARGETS DirectXShaderCompilerDxc PACKAGE_HASH decc53e97c7ddda9c7f853a30af7808a7b652a912f59ad2cd4bca5d308aae2c4) +ly_associate_package(PACKAGE_NAME SPIRVCross-2021.04.29-rev1-windows TARGETS SPIRVCross PACKAGE_HASH 7d601ea9d625b1d509d38bd132a1f433d7e895b16adab76bac6103567a7a6817) +ly_associate_package(PACKAGE_NAME freetype-2.10.4.14-windows TARGETS freetype PACKAGE_HASH 88dedc86ccb8c92f14c2c033e51ee7d828fa08eafd6475c6aa963938a99f4bf3) +ly_associate_package(PACKAGE_NAME tiff-4.2.0.14-windows TARGETS tiff PACKAGE_HASH ab60d1398e4e1e375ec0f1a00cdb1d812a07c0096d827db575ce52dd6d714207) +ly_associate_package(PACKAGE_NAME AWSNativeSDK-1.7.167-rev3-windows TARGETS AWSNativeSDK PACKAGE_HASH 929873d4252c464620a9d288e41bd5d47c0bd22750aeb3a1caa68a3da8247c48) +ly_associate_package(PACKAGE_NAME Lua-5.3.5-rev5-windows TARGETS Lua PACKAGE_HASH 136faccf1f73891e3fa3b95f908523187792e56f5b92c63c6a6d7e72d1158d40) +ly_associate_package(PACKAGE_NAME PhysX-4.1.0.25992954-rev1-windows TARGETS PhysX PACKAGE_HASH 198bed89d1aae7caaf5dadba24cee56235fe41725d004b64040d4e50d0f3aa1a) +ly_associate_package(PACKAGE_NAME etc2comp-9cd0f9cae0-rev1-windows TARGETS etc2comp PACKAGE_HASH fc9ae937b2ec0d42d5e7d0e9e8c80e5e4d257673fb33bc9b7d6db76002117123) +ly_associate_package(PACKAGE_NAME mcpp-2.7.2_az.1-rev1-windows TARGETS mcpp PACKAGE_HASH 511672598fa319bfb8db87f965b59abff1620bb7c1dcf7669e039a8acd8d3ff8) +ly_associate_package(PACKAGE_NAME mikkelsen-1.0.0.4-windows TARGETS mikkelsen PACKAGE_HASH 872c4d245a1c86139aa929f2b465b63ea4ea55b04ced50309135dd4597457a4e) +ly_associate_package(PACKAGE_NAME googletest-1.8.1-rev4-windows TARGETS googletest PACKAGE_HASH 7e8f03ae8a01563124e3daa06386f25a2b311c10bb95bff05cae6c41eff83837) +ly_associate_package(PACKAGE_NAME googlebenchmark-1.5.0-rev2-windows TARGETS GoogleBenchmark PACKAGE_HASH 0c94ca69ae8e7e4aab8e90032b5c82c5964410429f3dd9dbb1f9bf4fe032b1d4) +ly_associate_package(PACKAGE_NAME d3dx12-headers-rev1-windows TARGETS d3dx12 PACKAGE_HASH 088c637159fba4a3e4c0cf08fb4921906fd4cca498939bd239db7c54b5b2f804) +ly_associate_package(PACKAGE_NAME pyside2-qt-5.15.1-rev2-windows TARGETS pyside2 PACKAGE_HASH c90f3efcc7c10e79b22a33467855ad861f9dbd2e909df27a5cba9db9fa3edd0f) +ly_associate_package(PACKAGE_NAME openimageio-2.1.16.0-rev2-windows TARGETS OpenImageIO PACKAGE_HASH 85a2a6cf35cbc4c967c56ca8074babf0955c5b490c90c6e6fd23c78db99fc282) +ly_associate_package(PACKAGE_NAME qt-5.15.2-rev2-windows TARGETS Qt PACKAGE_HASH 29966f22ec253dc9904e88ad48fe6b6a669302b2dc7049f2e2bbd4949e79e595) +ly_associate_package(PACKAGE_NAME libsamplerate-0.2.1-rev2-windows TARGETS libsamplerate PACKAGE_HASH dcf3c11a96f212a52e2c9241abde5c364ee90b0f32fe6eeb6dcdca01d491829f) +ly_associate_package(PACKAGE_NAME OpenMesh-8.1-rev1-windows TARGETS OpenMesh PACKAGE_HASH 1c1df639358526c368e790dfce40c45cbdfcfb1c9a041b9d7054a8949d88ee77) +ly_associate_package(PACKAGE_NAME civetweb-1.8-rev1-windows TARGETS civetweb PACKAGE_HASH 36d0e58a59bcdb4dd70493fb1b177aa0354c945b06c30416348fd326cf323dd4) +ly_associate_package(PACKAGE_NAME OpenSSL-1.1.1b-rev2-windows TARGETS OpenSSL PACKAGE_HASH 9af1c50343f89146b4053101a7aeb20513319a3fe2f007e356d7ce25f9241040) +ly_associate_package(PACKAGE_NAME Crashpad-0.8.0-rev1-windows TARGETS Crashpad PACKAGE_HASH d162aa3070147bc0130a44caab02c5fe58606910252caf7f90472bd48d4e31e2) diff --git a/cmake/CMakeFiles.cmake b/cmake/CMakeFiles.cmake index 952f9b5eb8..77c2eb75e1 100644 --- a/cmake/CMakeFiles.cmake +++ b/cmake/CMakeFiles.cmake @@ -9,8 +9,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -# Add all cmake files in a project so they can be handled from within the IDE -ly_include_cmake_file_list(cmake/cmake_files.cmake) -add_custom_target(CMakeFiles SOURCES ${ALLFILES}) -ly_source_groups_from_folders("${ALLFILES}") -unset(ALLFILES) \ No newline at end of file +if(NOT INSTALLED_ENGINE) + # Add all cmake files in a project so they can be handled from within the IDE + ly_include_cmake_file_list(cmake/cmake_files.cmake) + add_custom_target(CMakeFiles SOURCES ${ALLFILES}) + ly_source_groups_from_folders("${ALLFILES}") + unset(ALLFILES) +endif() \ No newline at end of file diff --git a/cmake/EngineFinder.cmake b/cmake/EngineFinder.cmake deleted file mode 100644 index 9ff8ce4d66..0000000000 --- a/cmake/EngineFinder.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -# This file is copied during engine registration. Edits to this file will be lost next -# time a registration happens. - -include_guard() - -# Read the engine name from the project_json file -file(READ ${CMAKE_CURRENT_LIST_DIR}/project.json project_json) -string(JSON LY_ENGINE_NAME_TO_USE ERROR_VARIABLE json_error GET ${project_json} engine) -if(json_error) - message(FATAL_ERROR "Unable to read key 'engine' from 'project.json', error: ${json_error}") -endif() - -# Read the list of paths from ~.o3de/o3de_manifest.json -file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) # Windows -if((NOT home_directory) OR (NOT EXISTS ${home_directory})) - file(TO_CMAKE_PATH "$ENV{HOME}" home_directory)# Unix -endif() - -if (NOT home_directory) - message(FATAL_ERROR "Cannot find user home directory, the o3de manifest cannot be found") -endif() -# Set manifest path to path in the user home directory -set(manifest_path ${home_directory}/.o3de/o3de_manifest.json) - -if(EXISTS ${manifest_path}) - file(READ ${manifest_path} manifest_json) - string(JSON engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json} engines) - if(json_error) - message(FATAL_ERROR "Unable to read key 'engines' from '${manifest_path}', error: ${json_error}") - endif() - - math(EXPR engines_count "${engines_count}-1") - foreach(engine_path_index RANGE ${engines_count}) - string(JSON engine_path ERROR_VARIABLE json_error GET ${manifest_json} engines ${engine_path_index}) - if(${json_error}) - message(FATAL_ERROR "Unable to read engines[${engine_path_index}] '${manifest_path}', error: ${json_error}") - endif() - if(engine_path) - list(APPEND CMAKE_MODULE_PATH "${engine_path}/cmake") - endif() - endforeach() -endif() diff --git a/cmake/EngineJson.cmake b/cmake/EngineJson.cmake new file mode 100644 index 0000000000..c3ab29d09e --- /dev/null +++ b/cmake/EngineJson.cmake @@ -0,0 +1,47 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +# This file is copied during engine registration. Edits to this file will be lost next +# time a registration happens. + +include_guard() + +set(LY_EXTERNAL_SUBDIRS "" CACHE STRING "List of subdirectories to recurse into when running cmake against the engine's CMakeLists.txt") + +#! read_engine_external_subdirs +# Read the external subdirectories from the engine.json file +# External subdirectories are any folders with CMakeLists.txt in them +# This could be regular subdirectories, Gems(contains an additional gem.json), +# Restricted folders(contains an additional restricted.json), etc... +# \arg:output_external_subdirs name of output variable to store external subdirectories into +function(read_engine_external_subdirs output_external_subdirs) + file(READ ${LY_ROOT_FOLDER}/engine.json engine_json_data) + string(JSON external_subdirs_count ERROR_VARIABLE engine_json_error + LENGTH ${engine_json_data} "external_subdirectories") + if(engine_json_error) + message(FATAL_ERROR "Error querying number of elements in JSON array \"external_subdirectories\": ${engine_json_error}") + endif() + + if(external_subdirs_count GREATER 0) + math(EXPR external_subdir_range "${external_subdirs_count}-1") + # Convert the paths the relative paths to absolute paths using the engine root + # as the base directory + foreach(external_subdir_index RANGE ${external_subdir_range}) + string(JSON external_subdir ERROR_VARIABLE engine_json_error + GET ${engine_json_data} "external_subdirectories" "${external_subdir_index}") + if(engine_json_error) + message(FATAL_ERROR "Error reading field at index ${external_subdir_index} in \"external_subdirectories\" JSON array: ${engine_json_error}") + endif() + file(REAL_PATH ${external_subdir} real_external_subdir BASE_DIRECTORY ${CMAKE_SOURCE_DIR}) + list(APPEND external_subdirs ${real_external_subdir}) + endforeach() + endif() + set(${output_external_subdirs} ${external_subdirs} PARENT_SCOPE) +endfunction() diff --git a/cmake/FindTarget.cmake.in b/cmake/FindTarget.cmake.in deleted file mode 100644 index 8ad9822dae..0000000000 --- a/cmake/FindTarget.cmake.in +++ /dev/null @@ -1,34 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -# Generated by O3DE - -include(FindPackageHandleStandardArgs) - -ly_add_target( - NAME @NAME_PLACEHOLDER@ UNKNOWN IMPORTED - @NAMESPACE_PLACEHOLDER@ - COMPILE_DEFINITIONS - INTERFACE -@COMPILE_DEFINITIONS_PLACEHOLDER@ - INCLUDE_DIRECTORIES - INTERFACE -@INCLUDE_DIRECTORIES_PLACEHOLDER@ - BUILD_DEPENDENCIES - INTERFACE -@BUILD_DEPENDENCIES_PLACEHOLDER@ - RUNTIME_DEPENDENCIES -@RUNTIME_DEPENDENCIES_PLACEHOLDER@ -) - -foreach(config @CMAKE_CONFIGURATION_TYPES@) - include("${LY_ROOT_FOLDER}/cmake_autogen/@NAME_PLACEHOLDER@/@NAME_PLACEHOLDER@_${config}.cmake" OPTIONAL) -endforeach() diff --git a/cmake/Gems.cmake b/cmake/Gems.cmake new file mode 100644 index 0000000000..d418d5dcd1 --- /dev/null +++ b/cmake/Gems.cmake @@ -0,0 +1,217 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# This file contains utility wrappers for dealing with the Gems system. + +# ly_create_alias +# given an alias to create, and a list of one or more targets, +# this creates an alias that depends on all of the given targets. +function(ly_create_alias) + set(options) + set(oneValueArgs NAME NAMESPACE) + set(multiValueArgs TARGETS) + + cmake_parse_arguments(ly_create_alias "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT ly_create_alias_NAME) + message(FATAL_ERROR "Provide the name of the alias to create using the NAME keyword") + endif() + + if (NOT ly_create_alias_NAMESPACE) + message(FATAL_ERROR "Provide the namespace of the alias to create using the NAMESPACE keyword") + endif() + + if (NOT ly_create_alias_TARGETS) + message(FATAL_ERROR "Provide the name of the targets the alias be associated with, using the TARGETS keyword") + endif() + + if(TARGET ${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME}) + message(FATAL_ERROR "Target already exists, cannot create an alias for it: ${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME}\n" + "Make sure the target wasn't copy and pasted here or elsewhere.") + endif() + + # easy version - if its juts one target, we can directly get the target, and make both aliases, + # the namespaced and non namespaced one, point at it. + list(LENGTH ly_create_alias_TARGETS number_of_targets) + if (number_of_targets EQUAL 1) + ly_de_alias_target(${ly_create_alias_TARGETS} de_aliased_target_name) + add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + if (NOT TARGET ${ly_create_alias_NAME}) + add_library(${ly_create_alias_NAME} ALIAS ${de_aliased_target_name}) + endif() + # Store off the arguments needed used ly_create_alias into a DIRECTORY property + # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step + string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + return() + endif() + + # more complex version - one alias to multiple targets. To actually achieve this + # we have to create an interface library with those dependencies, then we have to create an alias to that target. + # by convention we create one without a namespace then alias the namespaced one. + + if(TARGET ${ly_create_alias_NAME}) + message(FATAL_ERROR "Internal alias target already exists, cannot create an alias for it: ${ly_create_alias_NAME}\n" + "This could be a copy-paste error, where some part of the ly_create_alias call was changed but the other") + endif() + + add_library(${ly_create_alias_NAME} INTERFACE IMPORTED GLOBAL) + set_target_properties(${ly_create_alias_NAME} PROPERTIES GEM_MODULE TRUE) + + foreach(target_name ${ly_create_alias_TARGETS}) + if(TARGET ${target_name}) + ly_de_alias_target(${target_name} de_aliased_target_name) + if(NOT de_aliased_target_name) + message(FATAL_ERROR "Target not found in ly_create_alias call: ${target_name} - check your spelling of the target name") + endif() + else() + set(de_aliased_target_name ${target_name}) + endif() + list(APPEND final_targets ${de_aliased_target_name}) + endforeach() + + ly_parse_third_party_dependencies("${final_targets}") + ly_add_dependencies(${ly_create_alias_NAME} ${final_targets}) + + # now add the final alias: + add_library(${ly_create_alias_NAMESPACE}::${ly_create_alias_NAME} ALIAS ${ly_create_alias_NAME}) + + # Store off the arguments needed used ly_create_alias into a DIRECTORY property + # This will be used to re-create the calls in the generated CMakeLists.txt in the INSTALL step + + # Replace the CMake list separator with a space to replicate the space separated TARGETS arguments + string(REPLACE ";" " " create_alias_args "${ly_create_alias_NAME},${ly_create_alias_NAMESPACE},${ly_create_alias_TARGETS}") + set_property(DIRECTORY APPEND PROPERTY LY_CREATE_ALIAS_ARGUMENTS "${create_alias_args}") +endfunction() + +# ly_enable_gems +# this function makes sure that the given gems, or gems listed in the variable ENABLED_GEMS +# in the GEM_FILE name, are set as runtime dependencies (and thus loaded) for the given targets +# in the context of the given project. +# note that it can't do this immediately, so it saves the data for later processing. +# Note: If you don't supply a project name, it will apply it across the board to all projects. +# this is useful in the case of "ly_add_gems being called for so called 'mandatory gems' inside the engine. +# if you specify a gem name with a namespace, it will be used, otherwise it will assume Gem:: +function(ly_enable_gems) + set(options) + set(oneValueArgs PROJECT_NAME GEM_FILE) + set(multiValueArgs GEMS TARGETS VARIANTS) + + cmake_parse_arguments(ly_enable_gems "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if (NOT ly_enable_gems_TARGETS) + message(FATAL_ERROR "You must provide the targets to add gems to using the TARGETS keyword") + endif() + + + if (NOT ly_enable_gems_PROJECT_NAME) + message(VERBOSE "Note: ly_enable_gems called with no PROJECT_NAME name, applying to all projects: \n" + " - VARIANTS ${ly_enable_gems_VARIANTS} \n" + " - GEMS ${ly_enable_gems_GEMS} \n" + " - TARGETS ${ly_enable_gems_TARGETS} \n" + " - GEM_FILE ${ly_enable_gems_GEM_FILE}") + set(ly_enable_gems_PROJECT_NAME "__NOPROJECT__") # so that the token is not blank + endif() + + if (NOT ly_enable_gems_VARIANTS) + message(FATAL_ERROR "You must provide at least 1 variant of the gem modules (Editor, Server, Client, Builder) to " + "add to your targets, using the VARIANTS keyword") + endif() + + if ((NOT ly_enable_gems_GEMS AND NOT ly_enable_gems_GEM_FILE) OR (ly_enable_gems_GEMS AND ly_enable_gems_GEM_FILE)) + message(FATAL_ERROR "Provide exactly one of either GEM_FILE (filename) or GEMS (list of gems) keywords.") + endif() + + if (ly_enable_gems_GEM_FILE) + set(store_temp ${ENABLED_GEMS}) + include(${ly_enable_gems_GEM_FILE} RESULT_VARIABLE was_able_to_load_the_file) + if(NOT was_able_to_load_the_file) + message(FATAL_ERROR "could not load the GEM_FILE ${ly_enable_gems_GEM_FILE}") + endif() + if(NOT ENABLED_GEMS) + message(FATAL_ERROR "GEM_FILE ${ly_enable_gems_GEM_FILE} did not set the value of ENABLED_GEMS.\n" + "Gem Files should contain set(ENABLED_GEMS ... )") + endif() + set(ly_enable_gems_GEMS ${ENABLED_GEMS}) + set(ENABLED_GEMS ${store_temp}) # restore value of ENABLED_GEMS just in case... + endif() + + # all the actual work has to be done later. + foreach(target_name ${ly_enable_gems_TARGETS}) + foreach(variant_name ${ly_enable_gems_VARIANTS}) + set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS "${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}") + set_property(GLOBAL APPEND PROPERTY LY_DELAYED_ENABLE_GEMS_"${ly_enable_gems_PROJECT_NAME},${target_name},${variant_name}" ${ly_enable_gems_GEMS}) + endforeach() + endforeach() +endfunction() + +# call this before runtime dependencies are used to add any relevant targets +# saved by the above function +function(ly_enable_gems_delayed) + get_property(ly_delayed_enable_gems GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS) + foreach(project_target_variant ${ly_delayed_enable_gems}) + # we expect a colon separated list of + # PROJECT_NAME,target_name,variant_name + string(REPLACE "," ";" project_target_variant_list "${project_target_variant}") + list(LENGTH project_target_variant_list project_target_variant_length) + if(project_target_variant_length EQUAL 0) + continue() + endif() + + if(NOT project_target_variant_length EQUAL 3) + message(FATAL_ERROR "Invalid specification of gems, expected 'project','target','variant' and got ${project_target_variant}") + endif() + + list(POP_BACK project_target_variant_list variant) + list(POP_BACK project_target_variant_list target) + list(POP_BACK project_target_variant_list project) + + get_property(gem_dependencies GLOBAL PROPERTY LY_DELAYED_ENABLE_GEMS_"${project_target_variant}") + if (NOT gem_dependencies) + continue() + endif() + + if(${project} STREQUAL "__NOPROJECT__") + # special case, apply to all + unset(PREFIX_CLAUSE) + else() + set(PREFIX_CLAUSE "PREFIX;${project}") + endif() + + if (NOT TARGET ${target}) + message(FATAL_ERROR "ly_enable_gems specified TARGET '${target}' but no such target was found.") + endif() + + # apply the list of gem targets. Adding a gem really just means adding the appropriate dependency. + foreach(gem_name ${gem_dependencies}) + # the gem name may already have a namespace. If it does, we use that one + ly_strip_target_namespace(TARGET ${gem_name} OUTPUT_VARIABLE unaliased_gem_name) + if (${unaliased_gem_name} STREQUAL ${gem_name}) + # if stripping a namespace had no effect, it had no namespace + # and we supply the default Gem:: namespace. + set(gem_name_with_namespace Gem::${gem_name}) + else() + # if stripping the namespace had an effect then we use the original + # with the namespace, instead of assuming Gem:: + set(gem_name_with_namespace ${gem_name}) + endif() + + # if the target exists, add it. + if (TARGET ${gem_name_with_namespace}.${variant}) + ly_add_target_dependencies( + ${PREFIX_CLAUSE} + TARGETS ${target} + DEPENDENT_TARGETS ${gem_name_with_namespace}.${variant} + ) + endif() + endforeach() + endforeach() +endfunction() \ No newline at end of file diff --git a/cmake/Install.cmake b/cmake/Install.cmake index b56f5ced85..205277f0e5 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -9,5 +9,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # -ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) -include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) \ No newline at end of file +if(NOT INSTALLED_ENGINE) + ly_get_absolute_pal_filename(pal_dir ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}) + include(${pal_dir}/Install_${PAL_PLATFORM_NAME_LOWERCASE}.cmake) +endif() \ No newline at end of file diff --git a/cmake/LYPython.cmake b/cmake/LYPython.cmake index ff5132097c..238889d829 100644 --- a/cmake/LYPython.cmake +++ b/cmake/LYPython.cmake @@ -81,7 +81,7 @@ function(update_pip_requirements requirements_file_path unique_name) set(ENV{PYTHONNOUSERSITE} 1) execute_process(COMMAND - ${LY_PYTHON_CMD} -m pip install --no-deps -r "${requirements_file_path}" --disable-pip-version-check --no-warn-script-location + ${LY_PYTHON_CMD} -m pip install -r "${requirements_file_path}" --disable-pip-version-check --no-warn-script-location WORKING_DIRECTORY ${Python_BINFOLDER} RESULT_VARIABLE PIP_RESULT OUTPUT_VARIABLE PIP_OUT @@ -265,10 +265,13 @@ if (NOT CMAKE_SCRIPT_MODE_FILE) # we also need to make sure any custom packages are installed. # this costs a moment of time though, so we'll only do it based on stamp files. + if(PAL_TRAIT_BUILD_TESTS_SUPPORTED AND NOT INSTALLED_ENGINE) + ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/Tools/LyTestTools ly-test-tools) + ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/Tools/RemoteConsole/ly_remote_console ly-remote-console) + ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools editor-python-test-tools) + endif() - ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/Tools/LyTestTools ly-test-tools) - ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/Tools/RemoteConsole/ly_remote_console ly-remote-console) - ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/AutomatedTesting/Gem/PythonTests/EditorPythonTestTools editor-python-test-tools) + ly_pip_install_local_package_editable(${LY_ROOT_FOLDER}/scripts/o3de o3de) endif() endif() diff --git a/cmake/LYTestWrappers.cmake b/cmake/LYTestWrappers.cmake index 2a65929cf6..b4d6fe308e 100644 --- a/cmake/LYTestWrappers.cmake +++ b/cmake/LYTestWrappers.cmake @@ -370,6 +370,7 @@ endfunction() #! ly_add_googletest: Adds a new RUN_TEST using for the specified target using the supplied command or fallback to running # googletest tests through AzTestRunner # \arg:NAME Name to for the test run target +# \arg:TARGET Name of the target module that is being run for tests. If not provided, will default to 'NAME' # \arg:TEST_REQUIRES(optional) List of system resources that are required to run this test. # Only available option is "gpu" # \arg:TEST_SUITE(optional) - "smoke" or "periodic" or "sandbox" - prevents the test from running normally @@ -384,14 +385,20 @@ function(ly_add_googletest) message(FATAL_ERROR "Platform does not support test targets") endif() - set(one_value_args NAME TEST_SUITE) + set(one_value_args NAME TARGET TEST_SUITE) set(multi_value_args TEST_COMMAND COMPONENT) cmake_parse_arguments(ly_add_googletest "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) + if (ly_add_googletest_TARGET) + set(target_name ${ly_add_googletest_TARGET}) + else() + set(target_name ${ly_add_googletest_NAME}) + endif() + # AzTestRunner modules only supports google test libraries, regardless of whether or not # google test suites are supported - set_property(GLOBAL APPEND PROPERTY LY_AZTESTRUNNER_TEST_MODULES "${ly_add_googletest_NAME}") + set_property(GLOBAL APPEND PROPERTY LY_AZTESTRUNNER_TEST_MODULES "${target_name}") if(NOT PAL_TRAIT_TEST_GOOGLE_TEST_SUPPORTED) return() @@ -400,7 +407,7 @@ function(ly_add_googletest) if (ly_add_googletest_TEST_SUITE AND NOT ly_add_googletest_TEST_SUITE STREQUAL "main") # if a suite is specified, we filter to only accept things which match that suite (in c++) - set(non_ide_params "-gtest_filter=*SUITE_${ly_add_googletest_TEST_SUITE}*") + set(non_ide_params "--gtest_filter=*SUITE_${ly_add_googletest_TEST_SUITE}*") else() # otherwise, if its the main suite we only runs things that dont have any of the other suites. # Note: it doesn't do AND, only 'or' - so specifying SUITE_main:REQUIRES_gpu @@ -412,11 +419,11 @@ function(ly_add_googletest) if(NOT ly_add_googletest_TEST_COMMAND) # Use the NAME parameter as the build target - set(build_target ${ly_add_googletest_NAME}) + set(build_target ${target_name}) ly_strip_target_namespace(TARGET ${build_target} OUTPUT_VARIABLE build_target) if(NOT TARGET ${build_target}) - message(FATAL_ERROR "A valid build target \"${build_target}\" for test run \"${ly_add_googletest_NAME}\" has not been found.\ + message(FATAL_ERROR "A valid build target \"${build_target}\" for test run \"${target_name}\" has not been found.\ A valid target via the TARGET parameter or a custom TEST_COMMAND must be supplied") endif() diff --git a/cmake/LYWrappers.cmake b/cmake/LYWrappers.cmake index f6a36afc89..d7f88f12ec 100644 --- a/cmake/LYWrappers.cmake +++ b/cmake/LYWrappers.cmake @@ -46,13 +46,13 @@ define_property(TARGET PROPERTY GEM_MODULE # # \arg:NAME name of the target # \arg:STATIC (bool) defines this target to be a static library +# \arg:GEM_STATIC (bool) defines this target to be a static library while also setting the GEM_MODULE property # \arg:SHARED (bool) defines this target to be a dynamic library # \arg:MODULE (bool) defines this target to be a module library # \arg:GEM_MODULE (bool) defines this target to be a module library while also marking the target as a "Gem" via the GEM_MODULE property # \arg:HEADERONLY (bool) defines this target to be a header only library. A ${NAME}_HEADERS project will be created for the IDE # \arg:EXECUTABLE (bool) defines this target to be an executable # \arg:APPLICATION (bool) defines this target to be an application (executable that is not a console) -# \arg:UNKNOWN (bool) defines this target to be unknown. This is used when importing installed targets from Find files # \arg:IMPORTED (bool) defines this target to be imported. # \arg:NAMESPACE namespace declaration for this target. It will be used for IDE and dependencies # \arg:OUTPUT_NAME (optional) overrides the name of the output target. If not specified, the name will be used. @@ -76,7 +76,7 @@ define_property(TARGET PROPERTY GEM_MODULE # \arg:AUTOGEN_RULES a set of AutoGeneration rules to be passed to the AzAutoGen expansion system function(ly_add_target) - set(options STATIC SHARED MODULE GEM_MODULE HEADERONLY EXECUTABLE APPLICATION UNKNOWN IMPORTED AUTOMOC AUTOUIC AUTORCC NO_UNITY) + set(options STATIC SHARED MODULE GEM_STATIC GEM_MODULE HEADERONLY EXECUTABLE APPLICATION IMPORTED AUTOMOC AUTOUIC AUTORCC NO_UNITY) set(oneValueArgs NAME NAMESPACE OUTPUT_SUBDIRECTORY OUTPUT_NAME) set(multiValueArgs FILES_CMAKE GENERATED_FILES INCLUDE_DIRECTORIES COMPILE_DEFINITIONS BUILD_DEPENDENCIES RUNTIME_DEPENDENCIES PLATFORM_INCLUDE_FILES TARGET_PROPERTIES AUTOGEN_RULES) @@ -86,7 +86,7 @@ function(ly_add_target) if(NOT ly_add_target_NAME) message(FATAL_ERROR "You must provide a name for the target") endif() - if(NOT ly_add_target_IMPORTED) + if(NOT ly_add_target_IMPORTED AND NOT ly_add_target_HEADERONLY) if(NOT ly_add_target_FILES_CMAKE) message(FATAL_ERROR "You must provide a list of _files.cmake files for the target") endif() @@ -96,28 +96,36 @@ function(ly_add_target) if(ly_add_target_GEM_MODULE) set(ly_add_target_MODULE ${ly_add_target_GEM_MODULE}) endif() + # If the GEM_STATIC tag is passed mark the target as STATIC + if(ly_add_target_GEM_STATIC) + set(ly_add_target_STATIC ${ly_add_target_GEM_STATIC}) + endif() foreach(file_cmake ${ly_add_target_FILES_CMAKE}) ly_include_cmake_file_list(${file_cmake}) endforeach() - set(linking_options) - set(linking_count) + unset(linking_options) + unset(linking_count) + unset(target_type_options) if(ly_add_target_STATIC) set(linking_options STATIC) + set(target_type_options STATIC) set(linking_count "${linking_count}1") endif() if(ly_add_target_SHARED) set(linking_options SHARED) + set(target_type_options SHARED) set(linking_count "${linking_count}1") endif() if(ly_add_target_MODULE) set(linking_options ${PAL_LINKOPTION_MODULE}) + set(target_type_options ${PAL_LINKOPTION_MODULE}) set(linking_count "${linking_count}1") endif() - if(ly_add_target_HEADERONLY) set(linking_options INTERFACE) + set(target_type_options INTERFACE) set(linking_count "${linking_count}1") endif() if(ly_add_target_EXECUTABLE) @@ -128,12 +136,11 @@ function(ly_add_target) set(linking_options APPLICATION) set(linking_count "${linking_count}1") endif() - if(ly_add_target_UNKNOWN) - set(linking_options UNKNOWN) - set(linking_count "${linking_count}1") - endif() if(NOT ("${linking_count}" STREQUAL "1")) - message(FATAL_ERROR "More than one of the following options [STATIC | SHARED | MODULE | HEADERONLY | EXECUTABLE | APPLICATION | UNKNOWN] was specified and they are mutually exclusive") + message(FATAL_ERROR "More than one of the following options [STATIC | SHARED | MODULE | HEADERONLY | EXECUTABLE | APPLICATION ] was specified and they are mutually exclusive") + endif() + if(ly_add_target_IMPORTED) + list(APPEND target_type_options IMPORTED GLOBAL) endif() if(ly_add_target_NAMESPACE) @@ -144,29 +151,32 @@ function(ly_add_target) set(project_NAME ${ly_add_target_NAME}) if(ly_add_target_EXECUTABLE) - add_executable(${ly_add_target_NAME} + add_executable(${ly_add_target_NAME} + ${target_type_options} ${ALLFILES} ${ly_add_target_GENERATED_FILES} ) ly_apply_platform_properties(${ly_add_target_NAME}) + if(ly_add_target_IMPORTED) + set_target_properties(${ly_add_target_NAME} PROPERTIES LINKER_LANGUAGE CXX) + endif() elseif(ly_add_target_APPLICATION) - add_executable(${ly_add_target_NAME} + add_executable(${ly_add_target_NAME} + ${target_type_options} ${PAL_EXECUTABLE_APPLICATION_FLAG} ${ALLFILES} ${ly_add_target_GENERATED_FILES} ) ly_apply_platform_properties(${ly_add_target_NAME}) + if(ly_add_target_IMPORTED) + set_target_properties(${ly_add_target_NAME} PROPERTIES LINKER_LANGUAGE CXX) + endif() elseif(ly_add_target_HEADERONLY) add_library(${ly_add_target_NAME} - ${linking_options} + ${target_type_options} ${ALLFILES} ${ly_add_target_GENERATED_FILES} ) - elseif(ly_add_target_UNKNOWN) - add_library(${ly_add_target_NAME} - ${linking_options} - IMPORTED - ) else() add_library(${ly_add_target_NAME} - ${linking_options} + ${target_type_options} ${ALLFILES} ${ly_add_target_GENERATED_FILES} ) ly_apply_platform_properties(${ly_add_target_NAME}) @@ -199,12 +209,12 @@ function(ly_add_target) endif() - if(ly_add_target_GEM_MODULE) + if(ly_add_target_GEM_MODULE OR ly_add_target_GEM_STATIC) set_target_properties(${ly_add_target_NAME} PROPERTIES GEM_MODULE TRUE) endif() if (ly_add_target_INCLUDE_DIRECTORIES) - ly_target_include_directories(${ly_add_target_NAME} + target_include_directories(${ly_add_target_NAME} ${ly_add_target_INCLUDE_DIRECTORIES} ) endif() @@ -301,10 +311,19 @@ function(ly_add_target) endif() # Store the target so we can walk through all of them in LocationDependencies.cmake - set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGETS ${ly_add_target_NAME}) + set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGETS ${interface_name}) + + # Store the aliased target into a DIRECTORY property + set_property(DIRECTORY APPEND PROPERTY LY_DIRECTORY_TARGETS ${interface_name}) + # Store the directory path in a GLOBAL property so that it can be accessed + # in the layout install logic. Skip if the directory has already been added + get_property(ly_all_target_directories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES) + if(NOT CMAKE_CURRENT_SOURCE_DIR IN_LIST ly_all_target_directories) + set_property(GLOBAL APPEND PROPERTY LY_ALL_TARGET_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}) + endif() set(runtime_dependencies_list SHARED MODULE EXECUTABLE APPLICATION) - if(linking_options IN_LIST runtime_dependencies_list) + if(NOT ly_add_target_IMPORTED AND linking_options IN_LIST runtime_dependencies_list) add_custom_command(TARGET ${ly_add_target_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${ly_add_target_NAME}.cmake @@ -332,22 +351,6 @@ function(ly_add_target) ) endif() - if(NOT ly_add_target_IMPORTED) - if(NOT ly_add_target_INSTALL_COMPONENT) - set(ly_add_target_INSTALL_COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT}) - endif() - - ly_install_target( - ${ly_add_target_NAME} - NAMESPACE ${ly_add_target_NAMESPACE} - INCLUDE_DIRECTORIES ${ly_add_target_INCLUDE_DIRECTORIES} - BUILD_DEPENDENCIES ${ly_add_target_BUILD_DEPENDENCIES} - RUNTIME_DEPENDENCIES ${ly_add_target_RUNTIME_DEPENDENCIES} - COMPILE_DEFINITIONS ${ly_add_target_COMPILE_DEFINITIONS} - COMPONENT ${ly_add_target_INSTALL_COMPONENT} - ) - endif() - endfunction() #! ly_target_link_libraries: wraps target_link_libraries handling also MODULE linkage. @@ -407,12 +410,10 @@ function(ly_delayed_target_link_libraries) endif() if(item_type STREQUAL MODULE_LIBRARY) - ly_target_include_directories(${target} ${visibility} $) + target_include_directories(${target} ${visibility} $) target_link_libraries(${target} ${visibility} $) target_compile_definitions(${target} ${visibility} $) target_compile_options(${target} ${visibility} $) - # Add it also as a manual dependency so runtime_dependencies walks it through - ly_add_dependencies(${target} ${item}) else() ly_parse_third_party_dependencies(${item}) target_link_libraries(${target} ${visibility} ${item}) @@ -508,7 +509,7 @@ endfunction() # Looks at the the following variables within the platform include file to set the equivalent target properties # LY_FILES_CMAKE -> extract list of files -> target_sources # LY_FILES -> target_source -# LY_INCLUDE_DIRECTORIES -> ly_target_include_directories +# LY_INCLUDE_DIRECTORIES -> target_include_directories # LY_COMPILE_DEFINITIONS -> target_compile_definitions # LY_COMPILE_OPTIONS -> target_compile_options # LY_LINK_OPTIONS -> target_link_options @@ -534,7 +535,11 @@ macro(ly_configure_target_platform_properties) message(FATAL_ERROR "The supplied PLATFORM_INCLUDE_FILE(${platform_include_file}) cannot be included.\ Parsing of target will halt") endif() - target_sources(${ly_add_target_NAME} PRIVATE ${platform_include_file}) + if(ly_add_target_HEADERONLY) + target_sources(${ly_add_target_NAME} INTERFACE ${platform_include_file}) + else() + target_sources(${ly_add_target_NAME} PRIVATE ${platform_include_file}) + endif() ly_source_groups_from_folders("${platform_include_file}") if(LY_FILES_CMAKE) @@ -550,7 +555,7 @@ macro(ly_configure_target_platform_properties) target_sources(${ly_add_target_NAME} PRIVATE ${LY_FILES}) endif() if (LY_INCLUDE_DIRECTORIES) - ly_target_include_directories(${ly_add_target_NAME} ${LY_INCLUDE_DIRECTORIES}) + target_include_directories(${ly_add_target_NAME} ${LY_INCLUDE_DIRECTORIES}) endif() if(LY_COMPILE_DEFINITIONS) target_compile_definitions(${ly_add_target_NAME} ${LY_COMPILE_DEFINITIONS}) @@ -653,42 +658,6 @@ function(ly_add_source_properties) endfunction() -function(ly_target_include_directories TARGET) - - # Add the includes to the build and install interface - set(reserved_keywords PRIVATE PUBLIC INTERFACE) - unset(last_keyword) - foreach(include ${ARGN}) - if(${include} IN_LIST reserved_keywords) - list(APPEND adapted_includes ${include}) - elseif(IS_ABSOLUTE ${include}) - list(APPEND adapted_includes - $ - ) - else() - string(GENEX_STRIP ${include} include_genex_expr) - if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions - # We will be installing the includes using the same directory structure used in our source tree. - # The INSTALL_INTERFACE path tells CMake the location of the includes relative to the install prefix. - # When the target is imported into an external project, cmake will find these includes at /include/ - # where is the location of the lumberyard install on disk. - file(REAL_PATH ${include} include_real) - file(RELATIVE_PATH install_dir ${CMAKE_SOURCE_DIR} ${include_real}) - list(APPEND adapted_includes - $ - $ - ) - else() - list(APPEND adapted_includes - ${include} - ) - endif() - endif() - endforeach() - target_include_directories(${TARGET} ${adapted_includes}) - -endfunction() - #! ly_project_add_subdirectory: calls add_subdirectory() if the project name is in the project list # @@ -719,3 +688,22 @@ function(ly_project_add_subdirectory project_name) endif() endif() endfunction() + +# given a target name, returns the "real" name of the target if its an alias. +# this function recursively de-aliases +function(ly_de_alias_target target_name output_variable_name) + # its not okay to call get_target_property on a non-existent target + if (NOT TARGET ${target_name}) + message(FATAL_ERROR "ly_de_alias_target called on non-existent target: ${target_name}") + endif() + + while(target_name) + set(de_aliased_target_name ${target_name}) + get_target_property(target_name ${target_name} ALIASED_TARGET) + endwhile() + + if(NOT de_aliased_target_name) + message(FATAL_ERROR "Empty de_aliased for ${target_name}") + endif() + set(${output_variable_name} ${de_aliased_target_name} PARENT_SCOPE) +endfunction() diff --git a/cmake/LyAutoGen.cmake b/cmake/LyAutoGen.cmake index 16a8a8de55..aa0e7f8d5a 100644 --- a/cmake/LyAutoGen.cmake +++ b/cmake/LyAutoGen.cmake @@ -26,7 +26,7 @@ function(ly_add_autogen) if(ly_add_autogen_AUTOGEN_RULES) set(AZCG_INPUTFILES ${ly_add_autogen_ALLFILES}) list(FILTER AZCG_INPUTFILES INCLUDE REGEX ".*\.(xml|json|jinja)$") - ly_target_include_directories(${ly_add_autogen_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated") + target_include_directories(${ly_add_autogen_NAME} PUBLIC "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated") execute_process( COMMAND ${LY_PYTHON_CMD} "${LY_ROOT_FOLDER}/Code/Framework/AzAutoGen/AzAutoGen.py" "${CMAKE_BINARY_DIR}/Azcg/TemplateCache/" "${CMAKE_CURRENT_BINARY_DIR}/Azcg/Generated/" "${CMAKE_CURRENT_SOURCE_DIR}" "${AZCG_INPUTFILES}" "${ly_add_autogen_AUTOGEN_RULES}" "-n" OUTPUT_VARIABLE AUTOGEN_OUTPUTS diff --git a/cmake/Monolithic.cmake b/cmake/Monolithic.cmake index db45c182fd..dfd6816dde 100644 --- a/cmake/Monolithic.cmake +++ b/cmake/Monolithic.cmake @@ -14,7 +14,7 @@ set(LY_MONOLITHIC_GAME FALSE CACHE BOOL "Indicates if the game will be built mon if(LY_MONOLITHIC_GAME) add_compile_definitions(AZ_MONOLITHIC_BUILD) ly_set(PAL_TRAIT_MONOLITHIC_DRIVEN_LIBRARY_TYPE STATIC) - ly_set(PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE STATIC) + ly_set(PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE GEM_STATIC) # Disable targets that are not supported with monolithic ly_set(PAL_TRAIT_BUILD_HOST_TOOLS FALSE) ly_set(PAL_TRAIT_BUILD_HOST_GUI_TOOLS FALSE) diff --git a/cmake/O3DEJson.cmake b/cmake/O3DEJson.cmake new file mode 100644 index 0000000000..ab5f95bc8c --- /dev/null +++ b/cmake/O3DEJson.cmake @@ -0,0 +1,62 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +include_guard() + +set(LY_EXTERNAL_SUBDIRS "" CACHE STRING "List of subdirectories to recurse into when running cmake against the engine's CMakeLists.txt") + +#! read_json_external_subdirs +# Read the "external_subdirectories" array from a *.json file +# External subdirectories are any folders with CMakeLists.txt in them +# This could be regular subdirectories, Gems(contains an additional gem.json), +# Restricted folders(contains an additional restricted.json), etc... +# +# \arg:output_external_subdirs name of output variable to store external subdirectories into +# \arg:input_json_path path to the *.json file to load and read the external subdirectories from +# \return: external subdirectories as is from the json file. +function(read_json_external_subdirs output_external_subdirs input_json_path) + o3de_read_json_array(json_array ${input_json_path} "external_subdirectories") + set(${output_external_subdirs} ${json_array} PARENT_SCOPE) +endfunction() + +#! read_json_array +# Reads the a json array field into a cmake list variable +function(o3de_read_json_array read_output_array input_json_path array_key) + file(READ ${input_json_path} manifest_json_data) + string(JSON array_count ERROR_VARIABLE manifest_json_error + LENGTH ${manifest_json_data} ${array_key}) + if(manifest_json_error) + # There is no key, return + return() + endif() + + if(array_count GREATER 0) + math(EXPR array_range "${array_count}-1") + foreach(array_index RANGE ${array_range}) + string(JSON array_element ERROR_VARIABLE manifest_json_error + GET ${manifest_json_data} ${array_key} "${array_index}") + if(manifest_json_error) + message(FATAL_ERROR "Error reading field at index ${array_index} in \"${array_key}\" JSON array: ${manifest_json_error}") + endif() + list(APPEND array_elements ${array_element}) + endforeach() + endif() + set(${read_output_array} ${array_elements} PARENT_SCOPE) +endfunction() + +function(o3de_read_json_key output_value input_json_path key) + file(READ ${input_json_path} manifest_json_data) + string(JSON value ERROR_VARIABLE manifest_json_error GET ${manifest_json_data} ${key}) + if(manifest_json_error) + message(FATAL_ERROR "Error reading field at key ${key} in file \"${input_json_path}\" : ${manifest_json_error}") + endif() + set(${output_value} ${value} PARENT_SCOPE) +endfunction() diff --git a/cmake/OutputDirectory.cmake b/cmake/OutputDirectory.cmake index 9055802d39..5fe5c7a957 100644 --- a/cmake/OutputDirectory.cmake +++ b/cmake/OutputDirectory.cmake @@ -13,4 +13,8 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib CACHE PATH "Build directory for static libraries and import libraries") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Build directory for shared libraries") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin CACHE PATH "Build directory for executables") -set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install CACHE PATH "Installation prefix") + +# We install outside of the binary dir because our install support muliple platforms to +# be installed together. We also have an exclusion rule in the AP that filters out the +# "build" folder which is a common binary dir +set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Installation prefix") diff --git a/cmake/PAL.cmake b/cmake/PAL.cmake index 7802ac8c58..dca54e4731 100644 --- a/cmake/PAL.cmake +++ b/cmake/PAL.cmake @@ -22,7 +22,105 @@ file(GLOB detection_files "cmake/Platform/*/PALDetection_*.cmake") foreach(detection_file ${detection_files}) include(${detection_file}) endforeach() -file(GLOB detection_files ${o3de_engine_restricted_path}/*/cmake/PALDetection_*.cmake) + + +#! o3de_restricted_id: Reads the "restricted" key from the o3de 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) + file(READ ${o3de_json_file} json_data) + string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} "restricted_name") + if(json_error) + message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}") + endif() + if(restricted_entry) + set(${restricted} ${restricted_entry} PARENT_SCOPE) + endif() +endfunction() + +#! o3de_find_restricted_folder: +# +# \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 + 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) + 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() + 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}) + 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() + endif() + endif() + # Iterate over the restricted directories from the manifest file + foreach(restricted_entry ${restricted_subdirs}) + set(restricted_json_file ${restricted_entry}/restricted.json) + file(READ ${restricted_json_file} restricted_json) + string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} "restricted_name") + if(json_error) + message(WARNING "Unable to read restricted_name from '${restricted_json_file}', error: ${json_error}") + else() + if(this_restricted_name STREQUAL restricted_name) + set(${restricted_path} ${restricted_entry} PARENT_SCOPE) + return() + endif() + endif() + endforeach() +endfunction() + + +#! o3de_restricted_path: +# +# \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) + if(restricted_name) + o3de_find_restricted_folder(${restricted_name} restricted_folder) + if(restricted_folder) + set(${restricted_path} ${restricted_folder} 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} output_restricted_path) + endif() +endfunction() + +read_engine_restricted_path(O3DE_ENGINE_RESTRICTED_PATH) + +file(GLOB detection_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PALDetection_*.cmake) foreach(detection_file ${detection_files}) include(${detection_file}) endforeach() @@ -37,8 +135,8 @@ ly_set(PAL_HOST_PLATFORM_NAME_LOWERCASE ${PAL_HOST_PLATFORM_NAME_LOWERCASE}) set(PAL_RESTRICTED_PLATFORMS) -string(LENGTH ${o3de_engine_restricted_path} engine_restricted_length) -file(GLOB pal_restricted_files ${o3de_engine_restricted_path}/*/cmake/PAL_*.cmake) +string(LENGTH "${O3DE_ENGINE_RESTRICTED_PATH}" engine_restricted_length) +file(GLOB pal_restricted_files ${O3DE_ENGINE_RESTRICTED_PATH}/*/cmake/PAL_*.cmake) foreach(pal_restricted_file ${pal_restricted_files}) string(FIND ${pal_restricted_file} "/cmake/PAL" end) if(${end} GREATER -1) @@ -109,18 +207,18 @@ function(ly_get_absolute_pal_filename out_name in_name) else() # The user has not supplied any path so we must assume it is the o3de engine restricted and o3de engine path # if the file is not in the o3de engine path then we cannot determine a PAL file for it - file(RELATIVE_PATH relative_path ${o3de_engine_path} ${full_name}) + file(RELATIVE_PATH relative_path ${LY_ROOT_FOLDER} ${full_name}) if (NOT (IS_ABSOLUTE relative_path OR relative_path MATCHES [[^(\.\./)+(.*)]])) if (NOT EXISTS ${full_name}) - string(REGEX MATCH "${o3de_engine_path}/(.*)/Platform/([^/]*)/?(.*)$" match ${full_name}) + string(REGEX MATCH "${LY_ROOT_FOLDER}/(.*)/Platform/([^/]*)/?(.*)$" match ${full_name}) if(NOT CMAKE_MATCH_1) - string(REGEX MATCH "${o3de_engine_path}/Platform/([^/]*)/?(.*)$" match ${full_name}) - set(full_name ${o3de_engine_restricted_path}/${CMAKE_MATCH_1}) + string(REGEX MATCH "${LY_ROOT_FOLDER}/Platform/([^/]*)/?(.*)$" match ${full_name}) + set(full_name ${O3DE_ENGINE_RESTRICTED_PATH}/${CMAKE_MATCH_1}) if(CMAKE_MATCH_2) string(APPEND full_name "/" ${CMAKE_MATCH_2}) endif() elseif("${CMAKE_MATCH_2}" IN_LIST PAL_RESTRICTED_PLATFORMS) - set(full_name ${o3de_engine_restricted_path}/${CMAKE_MATCH_2}/${CMAKE_MATCH_1}) + set(full_name ${O3DE_ENGINE_RESTRICTED_PATH}/${CMAKE_MATCH_2}/${CMAKE_MATCH_1}) if(CMAKE_MATCH_3) string(APPEND full_name "/" ${CMAKE_MATCH_3}) endif() @@ -149,25 +247,3 @@ set(LY_DISABLE_TEST_MODULES FALSE CACHE BOOL "Option to forcibly disable the inc if(LY_DISABLE_TEST_MODULES) ly_set(PAL_TRAIT_BUILD_TESTS_SUPPORTED FALSE) endif() - -################################################################################ -# Add each restricted platform in the engines restricted folder -# If the enabled restricted platform does not have a folder add one. -# If the restricted platform folder does not have a CMakeLists.txt, create one -# so the add_subdirectory on the external folder does not fail. -################################################################################ -function(o3de_add_engine_restricted_platform_external_subdirs) - foreach(restricted_platform ${PAL_RESTRICTED_PLATFORMS}) - if(restricted_platform IN_LIST enabled_platforms) - set(o3de_engine_restricted_platform_folder ${o3de_engine_restricted_path}/${restricted_platform}) - if(NOT EXISTS ${o3de_engine_restricted_platform_folder}) - file(MAKE_DIRECTORY ${o3de_engine_restricted_platform_folder}) - endif() - set(o3de_engine_restricted_platform_folder_cmakelists ${o3de_engine_restricted_platform_folder}/CMakeLists.txt) - if(NOT EXISTS ${o3de_engine_restricted_platform_folder_cmakelists}) - file(TOUCH ${o3de_engine_restricted_platform_folder_cmakelists}) - endif() - list(APPEND LY_EXTERNAL_SUBDIRS ${o3de_engine_restricted_platform_folder}) - endif() - endforeach() -endfunction() diff --git a/cmake/Packaging.cmake b/cmake/Packaging.cmake index 4f6565edc7..84bad13687 100644 --- a/cmake/Packaging.cmake +++ b/cmake/Packaging.cmake @@ -13,7 +13,37 @@ if(NOT PAL_TRAIT_BUILD_CPACK_SUPPORTED) return() endif() -ly_get_absolute_pal_filename(pal_dir ${CMAKE_SOURCE_DIR}/cmake/Platform/${PAL_HOST_PLATFORM_NAME}) +# public facing options will be used for conversion into cpack specific ones below. +set(LY_INSTALLER_DOWNLOAD_URL "" CACHE STRING "URL embedded into the installer to download additional artifacts") +set(LY_INSTALLER_LICENSE_URL "" CACHE STRING "Optionally embed a link to the license instead of raw text") + +set(CPACK_DESIRED_CMAKE_VERSION 3.20.2) + +# set all common cpack variable overrides first so they can be accessible via configure_file +# when the platform specific settings are applied below. additionally, any variable with +# the "CPACK_" prefix will automatically be cached for use in any phase of cpack namely +# pre/post build +set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") +set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") + +string(TOLOWER ${PROJECT_NAME} _project_name_lower) +set(CPACK_PACKAGE_FILE_NAME "${_project_name_lower}_${LY_VERSION_STRING}_installer") + +set(DEFAULT_LICENSE_NAME "Apache-2.0") +set(DEFAULT_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") + +set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) +set(CPACK_LICENSE_URL ${LY_INSTALLER_LICENSE_URL}) + +set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") + +# neither of the SOURCE_DIR variables equate to anything during execution of pre/post build scripts +set(CPACK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +set(CPACK_BINARY_DIR ${CMAKE_BINARY_DIR}/_CPack) # to match other CPack out dirs + +# attempt to apply platform specific settings +ly_get_absolute_pal_filename(pal_dir ${CPACK_SOURCE_DIR}/Platform/${PAL_HOST_PLATFORM_NAME}) 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 @@ -21,19 +51,52 @@ if(NOT CPACK_GENERATOR) return() endif() -set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}") -set(CPACK_PACKAGE_VERSION "${LY_VERSION_STRING}") -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Installation Tool") +# pull down the desired copy of CMake so it can be included in the package +if(NOT (CPACK_CMAKE_PACKAGE_FILE AND CPACK_CMAKE_PACKAGE_HASH)) + message(FATAL_ERROR + "Packaging is missing one or more following properties required to include CMake: " + " CPACK_CMAKE_PACKAGE_FILE, CPACK_CMAKE_PACKAGE_HASH") +endif() -string(TOLOWER ${PROJECT_NAME} _project_name_lower) -set(CPACK_PACKAGE_FILE_NAME "${_project_name_lower}_installer") +set(_cmake_package_dest ${CPACK_BINARY_DIR}/${CPACK_CMAKE_PACKAGE_FILE}) -set(DEFAULT_LICENSE_NAME "Apache-2.0") -set(DEFAULT_LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") +string(REPLACE "." ";" _version_componets "${CPACK_DESIRED_CMAKE_VERSION}") +list(GET _version_componets 0 _major_version) +list(GET _version_componets 1 _minor_version) -set(CPACK_RESOURCE_FILE_LICENSE ${DEFAULT_LICENSE_FILE}) +set(_url_version_tag "v${_major_version}.${_minor_version}") +set(_package_url "https://cmake.org/files/${_url_version_tag}/${CPACK_CMAKE_PACKAGE_FILE}") -set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}/${CPACK_PACKAGE_VERSION}") +message(STATUS "Ensuring CMake ${CPACK_DESIRED_CMAKE_VERSION} is available for packaging...") +download_file( + URL ${_package_url} + TARGET_FILE ${_cmake_package_dest} + EXPECTED_HASH ${CPACK_CMAKE_PACKAGE_HASH} + RESULTS _results +) +list(GET _results 0 _status_code) + +if (${_status_code} EQUAL 0 AND EXISTS ${_cmake_package_dest}) + message(STATUS "-> Package found and verified!") +else() + file(REMOVE ${_cmake_package_dest}) + list(REMOVE_AT _results 0) + + set(_error_message "An error occurred, code ${_status_code}. URL ${_package_url} - ${_results}") + + if(${_status_code} EQUAL 1) + string(APPEND _error_message + " Please double check the CPACK_CMAKE_PACKAGE_FILE and " + "CPACK_CMAKE_PACKAGE_HASH properties before trying again.") + endif() + + message(FATAL_ERROR ${_error_message}) +endif() + +install(FILES ${_cmake_package_dest} + DESTINATION ./Tools/Redistributables/CMake + COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} +) # IMPORTANT: required to be included AFTER setting all property overrides include(CPack REQUIRED) @@ -76,3 +139,12 @@ ly_configure_cpack_component( DISPLAY_NAME "${PROJECT_NAME} Core" DESCRIPTION "${PROJECT_NAME} Headers, Libraries and Tools" ) + +if(LY_INSTALLER_DOWNLOAD_URL) + # this will set the following variables: CPACK_DOWNLOAD_SITE, CPACK_DOWNLOAD_ALL, and CPACK_UPLOAD_DIRECTORY + cpack_configure_downloads( + ${LY_INSTALLER_DOWNLOAD_URL} + UPLOAD_DIRECTORY ${CMAKE_BINARY_DIR}/_CPack_Uploads # to match the _CPack_Packages directory + ALL + ) +endif() diff --git a/cmake/Platform/Android/PAL_android.cmake b/cmake/Platform/Android/PAL_android.cmake index bb4ac5f32b..5f35767f98 100644 --- a/cmake/Platform/Android/PAL_android.cmake +++ b/cmake/Platform/Android/PAL_android.cmake @@ -35,7 +35,7 @@ else() endif() # Set the default asset type for deployment -set(LY_ASSET_DEPLOY_ASSET_TYPE "es3" CACHE STRING "Set the asset type for deployment.") +set(LY_ASSET_DEPLOY_ASSET_TYPE "android" CACHE STRING "Set the asset type for deployment.") # Set the python cmd tool if(PAL_HOST_PLATFORM_NAME_LOWERCASE STREQUAL "windows") diff --git a/cmake/Platform/Common/Install_common.cmake b/cmake/Platform/Common/Install_common.cmake index 8fe2fe2c1c..b18aed6fb4 100644 --- a/cmake/Platform/Common/Install_common.cmake +++ b/cmake/Platform/Common/Install_common.cmake @@ -11,52 +11,57 @@ set(CMAKE_INSTALL_MESSAGE NEVER) # Simplify messages to reduce output noise -ly_set(LY_DEFAULT_INSTALL_COMPONENT "Core") +ly_set(LY_DEFAULT_INSTALL_COMPONENT Core) -#! ly_install_target: registers the target to be installed by cmake install. -# -# \arg:NAME name of the target -# \arg:COMPONENT the grouping string of the target used for splitting up the install -# into smaller packages. -# All other parameters are forwarded to ly_generate_target_find_file -function(ly_install_target ly_install_target_NAME) +file(RELATIVE_PATH runtime_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +file(RELATIVE_PATH library_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) +set(install_output_folder "${CMAKE_INSTALL_PREFIX}/${runtime_output_directory}/${PAL_PLATFORM_NAME}/$") - set(options) - set(oneValueArgs NAMESPACE COMPONENT) - set(multiValueArgs INCLUDE_DIRECTORIES BUILD_DEPENDENCIES RUNTIME_DEPENDENCIES COMPILE_DEFINITIONS) - cmake_parse_arguments(ly_install_target "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) +#! ly_setup_target: Setup the data needed to re-create the cmake target commands for a single target +function(ly_setup_target OUTPUT_CONFIGURED_TARGET ALIAS_TARGET_NAME) + # De-alias target name + ly_de_alias_target(${ALIAS_TARGET_NAME} TARGET_NAME) - # All include directories marked PUBLIC or INTERFACE will be installed + # All include directories marked PUBLIC or INTERFACE will be installed. We dont use PUBLIC_HEADER because in order to do that + # we need to set the PUBLIC_HEADER property of the target for all the headers we are exporting. After doing that, installing the + # headers end up in one folder instead of duplicating the folder structure of the public/interface include directory. + # Instead, we install them with install(DIRECTORY) set(include_location "include") - get_target_property(include_directories ${ly_install_target_NAME} INTERFACE_INCLUDE_DIRECTORIES) - + get_target_property(include_directories ${TARGET_NAME} INTERFACE_INCLUDE_DIRECTORIES) if (include_directories) - set_target_properties(${ly_install_target_NAME} PROPERTIES PUBLIC_HEADER "${include_directories}") - # The include directories are specified relative to the CMakeLists.txt file that adds the target. - # We need to install the includes relative to our source tree root because that's where INSTALL_INTERFACE - # will point CMake when it looks for headers - file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - string(APPEND include_location "/${relative_path}") + unset(public_headers) + foreach(include_directory ${include_directories}) + string(GENEX_STRIP ${include_directory} include_genex_expr) + if(include_genex_expr STREQUAL include_directory) # only for cases where there are no generation expressions + unset(current_public_headers) + install(DIRECTORY ${include_directory} + DESTINATION ${include_location}/${target_source_dir} + COMPONENT ${ly_install_target_COMPONENT} + FILES_MATCHING + PATTERN *.h + PATTERN *.hpp + PATTERN *.inl + ) + endif() + endforeach() endif() # Get the output folders, archive is always the same, but runtime/library can be in subfolders defined per target file(RELATIVE_PATH archive_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - get_target_property(target_runtime_output_directory ${ly_install_target_NAME} RUNTIME_OUTPUT_DIRECTORY) + get_target_property(target_runtime_output_directory ${TARGET_NAME} RUNTIME_OUTPUT_DIRECTORY) if(target_runtime_output_directory) file(RELATIVE_PATH target_runtime_output_subdirectory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${target_runtime_output_directory}) endif() - file(RELATIVE_PATH runtime_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - get_target_property(target_library_output_directory ${ly_install_target_NAME} LIBRARY_OUTPUT_DIRECTORY) + get_target_property(target_library_output_directory ${TARGET_NAME} LIBRARY_OUTPUT_DIRECTORY) if(target_library_output_directory) file(RELATIVE_PATH target_library_output_subdirectory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} ${target_library_output_directory}) endif() - file(RELATIVE_PATH library_output_directory ${CMAKE_BINARY_DIR} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) install( - TARGETS ${ly_install_target_NAME} + TARGETS ${TARGET_NAME} ARCHIVE DESTINATION ${archive_output_directory}/${PAL_PLATFORM_NAME}/$ COMPONENT ${ly_install_target_COMPONENT} @@ -66,151 +71,184 @@ function(ly_install_target ly_install_target_NAME) RUNTIME DESTINATION ${runtime_output_directory}/${PAL_PLATFORM_NAME}/$/${target_runtime_output_subdirectory} COMPONENT ${ly_install_target_COMPONENT} - PUBLIC_HEADER - DESTINATION ${include_location} - COMPONENT ${ly_install_target_COMPONENT} ) - ly_generate_target_find_file( - NAME ${ly_install_target_NAME} - ${ARGN} - ) - ly_generate_target_config_file(${ly_install_target_NAME}) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${ly_install_target_NAME}_$.cmake" - DESTINATION cmake_autogen/${ly_install_target_NAME} - COMPONENT ${ly_install_target_COMPONENT} - ) - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Find${ly_install_target_NAME}.cmake" - DESTINATION cmake - COMPONENT ${ly_install_target_COMPONENT} - ) - -endfunction() - - -#! ly_generate_target_find_file: generates the Find${target}.cmake file which is used when importing installed packages. -# -# \arg:NAME name of the target -# \arg:NAMESPACE namespace declaration for this target. It will be used for IDE and dependencies -# \arg:INCLUDE_DIRECTORIES paths to the include directories -# \arg:BUILD_DEPENDENCIES list of interfaces this target depends on (could be a compilation dependency -# if the dependency is only exposing an include path, or could be a linking -# dependency is exposing a lib) -# \arg:RUNTIME_DEPENDENCIES list of dependencies this target depends on at runtime -# \arg:COMPILE_DEFINITIONS list of compilation definitions this target will use to compile -function(ly_generate_target_find_file) - - set(options) - set(oneValueArgs NAME NAMESPACE) - set(multiValueArgs INCLUDE_DIRECTORIES COMPILE_DEFINITIONS BUILD_DEPENDENCIES RUNTIME_DEPENDENCIES) - cmake_parse_arguments(ly_generate_target_find_file "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - set(NAME_PLACEHOLDER ${ly_generate_target_find_file_NAME}) - unset(NAMESPACE_PLACEHOLDER) - unset(COMPILE_DEFINITIONS_PLACEHOLDER) - unset(include_directories_interface_props) - unset(INCLUDE_DIRECTORIES_PLACEHOLDER) - set(RUNTIME_DEPENDENCIES_PLACEHOLDER ${ly_generate_target_find_file_RUNTIME_DEPENDENCIES}) - - # These targets will be imported. We will expose PUBLIC and INTERFACE properties as INTERFACE properties since - # only INTERFACE properties can be exposed on imported targets - ly_strip_private_properties(COMPILE_DEFINITIONS_PLACEHOLDER ${ly_generate_target_find_file_COMPILE_DEFINITIONS}) - ly_strip_private_properties(include_directories_interface_props ${ly_generate_target_find_file_INCLUDE_DIRECTORIES}) - ly_strip_private_properties(BUILD_DEPENDENCIES_PLACEHOLDER ${ly_generate_target_find_file_BUILD_DEPENDENCIES}) - - if(ly_generate_target_find_file_NAMESPACE) - set(NAMESPACE_PLACEHOLDER "NAMESPACE ${ly_generate_target_find_file_NAMESPACE}") + # CMakeLists.txt file + string(REGEX MATCH "(.*)::(.*)$" match ${ALIAS_TARGET_NAME}) + if(match) + set(NAMESPACE_PLACEHOLDER "NAMESPACE ${CMAKE_MATCH_1}") + set(NAME_PLACEHOLDER ${CMAKE_MATCH_2}) + else() + set(NAMESPACE_PLACEHOLDER "") + set(NAME_PLACEHOLDER ${TARGET_NAME}) endif() - string(REPLACE ";" "\n" COMPILE_DEFINITIONS_PLACEHOLDER "${COMPILE_DEFINITIONS_PLACEHOLDER}") + set(TARGET_TYPE_PLACEHOLDER "") + get_target_property(target_type ${NAME_PLACEHOLDER} TYPE) + # Remove the _LIBRARY since we dont need to pass that to ly_add_targets + string(REPLACE "_LIBRARY" "" TARGET_TYPE_PLACEHOLDER ${target_type}) + # For HEADER_ONLY libs we end up generating "INTERFACE" libraries, need to specify HEADERONLY instead + string(REPLACE "INTERFACE" "HEADERONLY" TARGET_TYPE_PLACEHOLDER ${TARGET_TYPE_PLACEHOLDER}) + if(TARGET_TYPE_PLACEHOLDER STREQUAL "MODULE") + get_target_property(gem_module ${NAME_PLACEHOLDER} GEM_MODULE) + if(gem_module) + set(TARGET_TYPE_PLACEHOLDER "GEM_MODULE") + endif() + endif() + + get_target_property(COMPILE_DEFINITIONS_PLACEHOLDER ${TARGET_NAME} INTERFACE_COMPILE_DEFINITIONS) + if(COMPILE_DEFINITIONS_PLACEHOLDER) + string(REPLACE ";" "\n" COMPILE_DEFINITIONS_PLACEHOLDER "${COMPILE_DEFINITIONS_PLACEHOLDER}") + else() + unset(COMPILE_DEFINITIONS_PLACEHOLDER) + endif() # Includes need additional processing to add the install root - foreach(include ${include_directories_interface_props}) - set(installed_include_prefix "\${LY_ROOT_FOLDER}/include/") - file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${include}) - list(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "include/${relative_path}") - endforeach() - string(REPLACE ";" "\n" INCLUDE_DIRECTORIES_PLACEHOLDER "${INCLUDE_DIRECTORIES_PLACEHOLDER}") + if(include_directories) + foreach(include ${include_directories}) + string(GENEX_STRIP ${include} include_genex_expr) + if(include_genex_expr STREQUAL include) # only for cases where there are no generation expressions + file(RELATIVE_PATH relative_include ${absolute_target_source_dir} ${include}) + string(APPEND INCLUDE_DIRECTORIES_PLACEHOLDER "\${LY_ROOT_FOLDER}/include/${target_source_dir}/${relative_include}\n") + endif() + endforeach() + endif() - string(REPLACE ";" "\n" BUILD_DEPENDENCIES_PLACEHOLDER "${BUILD_DEPENDENCIES_PLACEHOLDER}") - string(REPLACE ";" "\n" RUNTIME_DEPENDENCIES_PLACEHOLDER "${RUNTIME_DEPENDENCIES_PLACEHOLDER}") + get_target_property(RUNTIME_DEPENDENCIES_PLACEHOLDER ${TARGET_NAME} MANUALLY_ADDED_DEPENDENCIES) + if(RUNTIME_DEPENDENCIES_PLACEHOLDER) # not found properties return the name of the variable with a "-NOTFOUND" at the end, here we set it to empty if not found + string(REPLACE ";" "\n" RUNTIME_DEPENDENCIES_PLACEHOLDER "${RUNTIME_DEPENDENCIES_PLACEHOLDER}") + else() + unset(RUNTIME_DEPENDENCIES_PLACEHOLDER) + endif() - configure_file(${LY_ROOT_FOLDER}/cmake/FindTarget.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Find${ly_generate_target_find_file_NAME}.cmake @ONLY) - -endfunction() - - -#! ly_generate_target_config_file: generates the ${target}_$.cmake files for a target -# -# The generated file will set the location of the target binary per configuration -# These per config files will be included by the target's find file to set the location of the binary/ -# \arg:NAME name of the target -function(ly_generate_target_config_file NAME) - - get_target_property(target_type ${NAME} TYPE) + get_target_property(inteface_build_dependencies_props ${TARGET_NAME} INTERFACE_LINK_LIBRARIES) + unset(INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER) + if(inteface_build_dependencies_props) + foreach(build_dependency ${inteface_build_dependencies_props}) + # Skip wrapping produced when targets are not created in the same directory + if(NOT ${build_dependency} MATCHES "^::@") + list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${build_dependency}") + endif() + endforeach() + endif() + # We also need to pass the private link libraries since we will use that to generate the runtime dependencies + get_target_property(private_build_dependencies_props ${TARGET_NAME} LINK_LIBRARIES) + if(private_build_dependencies_props) + foreach(build_dependency ${private_build_dependencies_props}) + # Skip wrapping produced when targets are not created in the same directory + if(NOT ${build_dependency} MATCHES "^::@") + list(APPEND INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${build_dependency}") + endif() + endforeach() + endif() + list(REMOVE_DUPLICATES INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER) + string(REPLACE ";" "\n" INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER "${INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER}") + # Config file set(target_file_contents "# Generated by O3DE install\n\n") if(NOT target_type STREQUAL INTERFACE_LIBRARY) unset(target_location) set(runtime_types EXECUTABLE APPLICATION) if(target_type IN_LIST runtime_types) - string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${runtime_output_directory}/${PAL_PLATFORM_NAME}/$/${target_runtime_output_subdirectory}/$\"") + set(target_location "\${LY_ROOT_FOLDER}/${runtime_output_directory}/${PAL_PLATFORM_NAME}/$/${target_runtime_output_subdirectory}/$") elseif(target_type STREQUAL MODULE_LIBRARY) - string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$\"") + set(target_location "\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$") elseif(target_type STREQUAL SHARED_LIBRARY) - string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"") - string(APPEND target_file_contents "ly_add_dependencies(${NAME} \"\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$\")\n") + string(APPEND target_file_contents "set_property(TARGET ${TARGET_NAME} PROPERTY IMPORTED_IMPLIB_$ \"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\")\n") + set(target_location "\${LY_ROOT_FOLDER}/${library_output_directory}/${PAL_PLATFORM_NAME}/$/${target_library_output_subdirectory}/$") else() # STATIC_LIBRARY, OBJECT_LIBRARY, INTERFACE_LIBRARY - string(APPEND target_location "\"\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$\"") + set(target_location "\${LY_ROOT_FOLDER}/${archive_output_directory}/${PAL_PLATFORM_NAME}/$/$") endif() - string(APPEND target_file_contents -"set(target_location ${target_location}) -set_target_properties(${NAME} - PROPERTIES - $<$:IMPORTED_LOCATION \"\${target_location}\"> - IMPORTED_LOCATION_$> \"\${target_location}\" + if(target_location) + string(APPEND target_file_contents +"set_property(TARGET ${TARGET_NAME} + APPEND_STRING PROPERTY IMPORTED_LOCATION + $<$$:${target_location}$ +) +set_property(TARGET ${TARGET_NAME} + PROPERTY IMPORTED_LOCATION_$> + ${target_location} ) -if(EXISTS \"\${target_location}\") - set(${NAME}_$_FOUND TRUE) -else() - set(${NAME}_$_FOUND FALSE) -endif() ") + endif() endif() - file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_$.cmake" CONTENT "${target_file_contents}") + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$.cmake" CONTENT "${target_file_contents}") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/${NAME_PLACEHOLDER}_$.cmake" + DESTINATION ${target_source_dir} + COMPONENT ${ly_install_target_COMPONENT} + ) + # Since a CMakeLists.txt could contain multiple targets, we generate it in a folder per target + file(READ ${LY_ROOT_FOLDER}/cmake/install/InstalledTarget.in target_cmakelists_template) + string(CONFIGURE ${target_cmakelists_template} output_cmakelists_data @ONLY) + set(${OUTPUT_CONFIGURED_TARGET} ${output_cmakelists_data} PARENT_SCOPE) +endfunction() + +#! ly_setup_subdirectories: setups all targets on a per directory basis +function(ly_setup_subdirectories) + get_property(all_subdirectories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES) + foreach(target IN LISTS all_subdirectories) + ly_setup_subdirectory(${target}) + endforeach() endfunction() -#! ly_strip_private_properties: strips private properties since we're exporting an interface target -# -# \arg:INTERFACE_PROPERTIES list of interface properties to be returned -function(ly_strip_private_properties INTERFACE_PROPERTIES) - set(reserved_keywords PRIVATE PUBLIC INTERFACE) - unset(last_keyword) - unset(stripped_props) - foreach(prop ${ARGN}) - if(${prop} IN_LIST reserved_keywords) - set(last_keyword ${prop}) - else() - if (NOT last_keyword STREQUAL "PRIVATE") - list(APPEND stripped_props ${prop}) - endif() - endif() +#! ly_setup_subdirectory: setup all targets in the subdirectory +function(ly_setup_subdirectory absolute_target_source_dir) + + # The builtin BUILDSYSTEM_TARGETS property isn't being used here as that returns the de-alised + # TARGET and we need the alias namespace for recreating the CMakeLists.txt in the install layout + get_property(ALIAS_TARGETS_NAME DIRECTORY ${absolute_target_source_dir} PROPERTY LY_DIRECTORY_TARGETS) + file(RELATIVE_PATH target_source_dir ${LY_ROOT_FOLDER} ${absolute_target_source_dir}) + foreach(ALIAS_TARGET_NAME IN LISTS ALIAS_TARGETS_NAME) + ly_setup_target(configured_target ${ALIAS_TARGET_NAME}) + string(APPEND all_configured_targets "${configured_target}") endforeach() - set(${INTERFACE_PROPERTIES} ${stripped_props} PARENT_SCOPE) -endfunction() + # Replicate the ly_create_alias() calls based on the SOURCE_DIR for each target that generates an installed CMakeLists.txt + string(JOIN "\n" create_alias_template + "if(NOT TARGET @ALIAS_NAME@)" + " ly_create_alias(NAME @ALIAS_NAME@ NAMESPACE @ALIAS_NAMESPACE@ TARGETS @ALIAS_TARGETS@)" + "endif()" + "" + ) + get_property(create_alias_commands_arg_list DIRECTORY ${absolute_target_source_dir} PROPERTY LY_CREATE_ALIAS_ARGUMENTS) + foreach(create_alias_single_command_arg_list ${create_alias_commands_arg_list}) + # Split the ly_create_alias arguments back out based on commas + string(REPLACE "," ";" create_alias_single_command_arg_list "${create_alias_single_command_arg_list}") + list(POP_FRONT create_alias_single_command_arg_list ALIAS_NAME) + list(POP_FRONT create_alias_single_command_arg_list ALIAS_NAMESPACE) + # The rest of the list are the target dependencies + set(ALIAS_TARGETS ${create_alias_single_command_arg_list}) + string(CONFIGURE "${create_alias_template}" create_alias_command @ONLY) + string(APPEND CREATE_ALIASES_PLACEHOLDER ${create_alias_command}) + endforeach() + file(READ ${LY_ROOT_FOLDER}/cmake/install/Copyright.in cmake_copyright_comment) + # Write out all the agreegated ly_add_target function calls and the final ly_create_alias() calls to the target CMakeList.txt + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/CMakeLists.txt + "${cmake_copyright_comment}" + "${all_configured_targets}" + "\n" + "${CREATE_ALIASES_PLACEHOLDER}" + ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/install/${target_source_dir}/CMakeLists.txt" + DESTINATION ${target_source_dir} + COMPONENT ${ly_install_target_COMPONENT} + ) + +endfunction() #! ly_setup_o3de_install: orchestrates the installation of the different parts. This is the entry point from the root CMakeLists.txt function(ly_setup_o3de_install) + ly_setup_subdirectories() ly_setup_cmake_install() ly_setup_target_generator() + ly_setup_runtime_dependencies() ly_setup_others() endfunction() @@ -218,16 +256,35 @@ endfunction() #! ly_setup_cmake_install: install the "cmake" folder function(ly_setup_cmake_install) - install(DIRECTORY "${CMAKE_SOURCE_DIR}/cmake" + install(DIRECTORY "${LY_ROOT_FOLDER}/cmake" DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} + PATTERN "__pycache__" EXCLUDE REGEX "Findo3de.cmake" EXCLUDE REGEX "Platform\/.*\/BuiltInPackages_.*\.cmake" EXCLUDE ) + + # Transform the LY_EXTERNAL_SUBDIRS list into a json array + set(indent " ") + foreach(external_subdir ${LY_EXTERNAL_SUBDIRS}) + file(RELATIVE_PATH engine_rel_external_subdir ${LY_ROOT_FOLDER} ${external_subdir}) + list(APPEND relative_external_subdirs "\"${engine_rel_external_subdir}\"") + endforeach() + list(JOIN relative_external_subdirs ",\n${indent}" LY_INSTALL_EXTERNAL_SUBDIRS) + + # Read the "templates" key from the source engine.json + o3de_read_json_array(engine_templates ${LY_ROOT_FOLDER}/engine.json "templates") + foreach(template_path ${engine_templates}) + list(APPEND relative_templates "\"${template_path}\"") + endforeach() + list(JOIN relative_templates ",\n${indent}" LY_INSTALL_TEMPLATES) + + configure_file(${LY_ROOT_FOLDER}/cmake/install/engine.json.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json @ONLY) + install( FILES - "${CMAKE_SOURCE_DIR}/CMakeLists.txt" - "${CMAKE_SOURCE_DIR}/engine.json" + "${LY_ROOT_FOLDER}/CMakeLists.txt" + "${CMAKE_CURRENT_BINARY_DIR}/cmake/engine.json" DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) @@ -247,14 +304,16 @@ function(ly_setup_cmake_install) # Findo3de.cmake file: we generate a different Findo3de.camke file than the one we have in cmake. This one is going to expose all # targets that are pre-built - get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) unset(FIND_PACKAGES_PLACEHOLDER) - foreach(target IN LISTS all_targets) - string(APPEND FIND_PACKAGES_PLACEHOLDER " find_package(${target})\n") + + # Add to the FIND_PACKAGES_PLACEHOLDER all directories in which ly_add_target were called in + get_property(all_subdirectories GLOBAL PROPERTY LY_ALL_TARGET_DIRECTORIES) + foreach(target_subdirectory IN LISTS all_subdirectories) + file(RELATIVE_PATH target_source_dir_relative ${LY_ROOT_FOLDER} ${target_subdirectory}) + string(APPEND FIND_PACKAGES_PLACEHOLDER " add_subdirectory(${target_source_dir_relative})\n") endforeach() - configure_file(${LY_ROOT_FOLDER}/cmake/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY) - + configure_file(${LY_ROOT_FOLDER}/cmake/install/Findo3de.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/Findo3de.cmake" DESTINATION cmake COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} @@ -282,6 +341,74 @@ function(ly_setup_cmake_install) endfunction() +#! ly_setup_runtime_dependencies: install runtime dependencies +function(ly_setup_runtime_dependencies) + + # Common functions used by the bellow code + install(CODE +"function(ly_deploy_qt_install target_output) + execute_process(COMMAND \"${WINDEPLOYQT_EXECUTABLE}\" --verbose 0 --no-compiler-runtime \"\${target_output}\" ERROR_VARIABLE deploy_error RESULT_VARIABLE deploy_result) + if (NOT \${deploy_result} EQUAL 0) + if(NOT deploy_error MATCHES \"does not seem to be a Qt executable\" ) + message(SEND_ERROR \"Deploying qt for \${target_output} returned \${deploy_result}: \${deploy_error}\") + endif() + endif() +endfunction() + +function(ly_copy source_file target_directory) + file(COPY \"\${source_file}\" DESTINATION \"\${target_directory}\" FILE_PERMISSIONS ${LY_COPY_PERMISSIONS}) +endfunction()" + COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} + ) + + unset(runtime_commands) + get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) + foreach(alias_target IN LISTS all_targets) + ly_de_alias_target(${alias_target} target) + + # Exclude targets that dont produce runtime outputs + get_target_property(target_type ${target} TYPE) + if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS) + continue() + endif() + + get_target_property(target_runtime_output_directory ${target} RUNTIME_OUTPUT_DIRECTORY) + if(target_runtime_output_directory) + file(RELATIVE_PATH target_runtime_output_subdirectory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ${target_runtime_output_directory}) + endif() + + # Qt + get_property(has_qt_dependency GLOBAL PROPERTY LY_DETECT_QT_DEPENDENCY_${target}) + if(has_qt_dependency) + # Qt deploy needs to be done after the binary is copied to the output, so we do a install(CODE) which effectively + # puts it as a postbuild step of the "install" target. Binaries are copied at that point. + if(NOT EXISTS ${WINDEPLOYQT_EXECUTABLE}) + message(FATAL_ERROR "Qt deploy executable not found: ${WINDEPLOYQT_EXECUTABLE}") + endif() + set(target_output "${install_output_folder}/${target_runtime_output_subdirectory}/$") + list(APPEND runtime_commands "ly_deploy_qt_install(\"${target_output}\")\n") + endif() + + # runtime dependencies that need to be copied to the output + set(target_file_dir "${install_output_folder}/${target_runtime_output_subdirectory}") + ly_get_runtime_dependencies(runtime_dependencies ${target}) + foreach(runtime_dependency ${runtime_dependencies}) + unset(runtime_command) + ly_get_runtime_dependency_command(runtime_command ${runtime_dependency}) + string(CONFIGURE "${runtime_command}" runtime_command @ONLY) + list(APPEND runtime_commands ${runtime_command}) + endforeach() + + endforeach() + + list(REMOVE_DUPLICATES runtime_commands) + list(JOIN runtime_commands " " runtime_commands_str) # the spaces are just to see the right identation in the cmake_install.cmake file + install(CODE "${runtime_commands_str}" + COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} + ) + +endfunction() + #! ly_setup_others: install directories required by the engine function(ly_setup_others) @@ -294,15 +421,16 @@ function(ly_setup_others) set(install_path .) endif() - install(DIRECTORY "${CMAKE_SOURCE_DIR}/${dir}" + install(DIRECTORY "${LY_ROOT_FOLDER}/${dir}" DESTINATION ${install_path} COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} + PATTERN "__pycache__" EXCLUDE ) endforeach() # Scripts - file(GLOB o3de_scripts "${CMAKE_SOURCE_DIR}/scripts/o3de.*") + file(GLOB o3de_scripts "${LY_ROOT_FOLDER}/scripts/o3de.*") install(FILES ${o3de_scripts} DESTINATION ./scripts @@ -310,8 +438,9 @@ function(ly_setup_others) ) install(DIRECTORY - ${CMAKE_SOURCE_DIR}/scripts/bundler - ${CMAKE_SOURCE_DIR}/scripts/project_manager + ${LY_ROOT_FOLDER}/scripts/bundler + ${LY_ROOT_FOLDER}/scripts/project_manager + ${LY_ROOT_FOLDER}/scripts/o3de DESTINATION ./scripts COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} PATTERN "__pycache__" EXCLUDE @@ -319,7 +448,7 @@ function(ly_setup_others) PATTERN "tests" EXCLUDE ) - install(DIRECTORY "${CMAKE_SOURCE_DIR}/python" + install(DIRECTORY "${LY_ROOT_FOLDER}/python" DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} REGEX "downloaded_packages" EXCLUDE @@ -328,36 +457,35 @@ function(ly_setup_others) # Registry install(DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/bin/$/Registry - DESTINATION ./bin/${PAL_PLATFORM_NAME}/$ + ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$/Registry + DESTINATION ./${runtime_output_directory}/${PAL_PLATFORM_NAME}/$ COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) install(DIRECTORY - ${CMAKE_SOURCE_DIR}/Registry + ${LY_ROOT_FOLDER}/Registry DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) # Engine Source Assets install(DIRECTORY - ${CMAKE_SOURCE_DIR}/Assets + ${LY_ROOT_FOLDER}/Assets DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) # Gem Source Assets and Registry # Find all gem directories relative to the CMake Source Dir - file( - GLOB_RECURSE + file(GLOB_RECURSE gems_assets_path LIST_DIRECTORIES TRUE - RELATIVE "${CMAKE_SOURCE_DIR}/" + RELATIVE "${LY_ROOT_FOLDER}/" "Gems/*" ) list(FILTER gems_assets_path INCLUDE REGEX "/(Assets|Registry)$") foreach (gem_assets_path ${gems_assets_path}) - set(gem_abs_assets_path ${CMAKE_SOURCE_DIR}/${gem_assets_path}/) + set(gem_abs_assets_path ${LY_ROOT_FOLDER}/${gem_assets_path}/) if (EXISTS ${gem_abs_assets_path}) # The trailing slash is IMPORTANT here as that is needed to prevent # the "Assets" folder from being copied underneath the /Assets folder @@ -368,50 +496,62 @@ function(ly_setup_others) endif() endforeach() - # Qt Binaries - set(QT_DIRS bearer iconengines imageformats platforms styles translations) - list(TRANSFORM QT_DIRS PREPEND "${CMAKE_CURRENT_BINARY_DIR}/bin/$/" OUTPUT_VARIABLE QT_BIN_DIRS) + # gem.json files + file(GLOB_RECURSE + gems_json_path + LIST_DIRECTORIES FALSE + RELATIVE "${LY_ROOT_FOLDER}" + "Gems/*/gem.json" + ) + foreach(gem_json_path ${gems_json_path}) + get_filename_component(gem_relative_path ${gem_json_path} DIRECTORY) + install(FILES ${gem_json_path} + DESTINATION ${gem_relative_path} + COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} + ) + endforeach() + + # Additional files needed by gems install(DIRECTORY - ${QT_BIN_DIRS} - DESTINATION ./bin/${PAL_PLATFORM_NAME}/$ + ${LY_ROOT_FOLDER}/Gems/Atom/Asset/ImageProcessingAtom/Config + DESTINATION Gems/Atom/Asset/ImageProcessingAtom COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) # Templates install(DIRECTORY - ${CMAKE_SOURCE_DIR}/Templates + ${LY_ROOT_FOLDER}/Templates DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) # Misc install(FILES - ${CMAKE_SOURCE_DIR}/ctest_pytest.ini - ${CMAKE_SOURCE_DIR}/LICENSE.txt - ${CMAKE_SOURCE_DIR}/README.md + ${LY_ROOT_FOLDER}/ctest_pytest.ini + ${LY_ROOT_FOLDER}/LICENSE.txt + ${LY_ROOT_FOLDER}/README.md DESTINATION . COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) endfunction() - #! ly_setup_target_generator: install source files needed for project launcher generation function(ly_setup_target_generator) install(FILES - ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_generator.cmake - ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/launcher_project_files.cmake - ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/LauncherProject.cpp - ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/StaticModules.in + ${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_generator.cmake + ${LY_ROOT_FOLDER}/Code/LauncherUnified/launcher_project_files.cmake + ${LY_ROOT_FOLDER}/Code/LauncherUnified/LauncherProject.cpp + ${LY_ROOT_FOLDER}/Code/LauncherUnified/StaticModules.in DESTINATION LauncherGenerator COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/Platform + install(DIRECTORY ${LY_ROOT_FOLDER}/Code/LauncherUnified/Platform DESTINATION LauncherGenerator COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) - install(FILES ${CMAKE_SOURCE_DIR}/Code/LauncherUnified/FindLauncherGenerator.cmake + install(FILES ${LY_ROOT_FOLDER}/Code/LauncherUnified/FindLauncherGenerator.cmake DESTINATION cmake COMPONENT ${LY_DEFAULT_INSTALL_COMPONENT} ) diff --git a/cmake/Platform/Common/RuntimeDependencies_common.cmake b/cmake/Platform/Common/RuntimeDependencies_common.cmake index 6ac5215a01..d9d0fe4c7f 100644 --- a/cmake/Platform/Common/RuntimeDependencies_common.cmake +++ b/cmake/Platform/Common/RuntimeDependencies_common.cmake @@ -10,7 +10,7 @@ # set(LY_COPY_PERMISSIONS "OWNER_READ OWNER_WRITE OWNER_EXECUTE") -set(LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS MODULE_LIBRARY SHARED_LIBRARY EXECUTABLE) +set(LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS MODULE_LIBRARY SHARED_LIBRARY EXECUTABLE APPLICATION) # There are several runtime dependencies to handle: # 1. Dependencies to 3rdparty libraries. This involves copying IMPORTED_LOCATION to the folder where the target is. @@ -61,7 +61,7 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET) if(dependencies) list(APPEND link_dependencies ${dependencies}) endif() - if(NOT target_type MATCHES "INTERFACE") + if(NOT target_type STREQUAL "INTERFACE_LIBRARY") unset(dependencies) get_target_property(dependencies ${ly_TARGET} LINK_LIBRARIES) if(dependencies) @@ -105,11 +105,15 @@ function(ly_get_runtime_dependencies ly_RUNTIME_DEPENDENCIES ly_TARGET) set(skip_imported TRUE) endif() endif() + if(target_type MATCHES "(INTERFACE_LIBRARY|STATIC_LIBRARY)") + # No need to copy these dependencies since the outputs are not used at runtime + set(skip_imported TRUE) + endif() if(NOT skip_imported) # Add imported locations - if(target_type MATCHES "INTERFACE") + if(target_type STREQUAL "INTERFACE_LIBRARY") set(imported_property INTERFACE_IMPORTED_LOCATION) else() set(imported_property IMPORTED_LOCATION) @@ -183,7 +187,7 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET) # To support platforms where the binaries end in different places, we are going to assume that all dependencies, # including the ones we are building, need to be copied over. However, we add a check to prevent copying something # over itself. This detection cannot happen now because the target we are copying for varies. - set(runtime_command "ly_copy(\"${source_file}\" \"$${target_directory}\")\n") + set(runtime_command "ly_copy(\"${source_file}\" \"@target_file_dir@${target_directory}\")\n") # Tentative optimization: this is an attempt to solve the first "if" at generation time, making the runtime_dependencies # file smaller and faster to run. In platforms where the built target and the dependencies targets end up in the same @@ -206,20 +210,25 @@ function(ly_get_runtime_dependency_command ly_RUNTIME_COMMAND ly_TARGET) endfunction() -get_property(additional_module_paths GLOBAL PROPERTY LY_ADDITIONAL_MODULE_PATH) -list(APPEND CMAKE_MODULE_PATH ${additional_module_paths}) +function(ly_delayed_generate_runtime_dependencies) -get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) -foreach(target IN LISTS all_targets) + get_property(additional_module_paths GLOBAL PROPERTY LY_ADDITIONAL_MODULE_PATH) + list(APPEND CMAKE_MODULE_PATH ${additional_module_paths}) - # Exclude targets that dont produce runtime outputs - get_target_property(target_type ${target} TYPE) - if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS) - continue() - endif() + get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) + foreach(aliased_target IN LISTS all_targets) - unset(runtime_dependencies) - set(runtime_commands " + unset(target) + ly_de_alias_target(${aliased_target} target) + + # Exclude targets that dont produce runtime outputs + get_target_property(target_type ${target} TYPE) + if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS) + continue() + endif() + + unset(runtime_dependencies) + set(runtime_commands " function(ly_copy source_file target_directory) get_filename_component(target_filename \"\${source_file}\" NAME) if(NOT \"\${source_file}\" STREQUAL \"\${target_directory}/\${target_filename}\") @@ -232,21 +241,23 @@ function(ly_copy source_file target_directory) endif() endif() endfunction() -\n") + \n") + + ly_get_runtime_dependencies(runtime_dependencies ${target}) + foreach(runtime_dependency ${runtime_dependencies}) + unset(runtime_command) + ly_get_runtime_dependency_command(runtime_command ${runtime_dependency}) + string(APPEND runtime_commands ${runtime_command}) + endforeach() + + # Generate the output file + set(target_file_dir "$") + string(CONFIGURE "${runtime_commands}" generated_commands @ONLY) + file(GENERATE + OUTPUT ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${target}.cmake + CONTENT "${generated_commands}" + ) - ly_get_runtime_dependencies(runtime_dependencies ${target}) - foreach(runtime_dependency ${runtime_dependencies}) - unset(runtime_command) - ly_get_runtime_dependency_command(runtime_command ${runtime_dependency}) - string(APPEND runtime_commands ${runtime_command}) endforeach() - - # Generate the output file - string(CONFIGURE "${runtime_commands}" generated_commands @ONLY) - file(GENERATE - OUTPUT ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${target}.cmake - CONTENT "${generated_commands}" - ) - -endforeach() +endfunction() diff --git a/cmake/Platform/Mac/Install_mac.cmake b/cmake/Platform/Mac/Install_mac.cmake index 8c96c199de..5c7959bf77 100644 --- a/cmake/Platform/Mac/Install_mac.cmake +++ b/cmake/Platform/Mac/Install_mac.cmake @@ -11,11 +11,5 @@ # Empty implementations for untested platforms to fix build errors. -function(ly_install_target ly_install_target_NAME) - -endfunction() - - function(ly_setup_o3de_install) - endfunction() \ No newline at end of file diff --git a/cmake/Platform/Mac/PAL_mac.cmake b/cmake/Platform/Mac/PAL_mac.cmake index f6cf034312..988d36af14 100644 --- a/cmake/Platform/Mac/PAL_mac.cmake +++ b/cmake/Platform/Mac/PAL_mac.cmake @@ -35,7 +35,7 @@ else() endif() # Set the default asset type for deployment -set(LY_ASSET_DEPLOY_ASSET_TYPE "osx_gl" CACHE STRING "Set the asset type for deployment.") +set(LY_ASSET_DEPLOY_ASSET_TYPE "mac" CACHE STRING "Set the asset type for deployment.") # Set the python cmd tool ly_set(LY_PYTHON_CMD ${CMAKE_CURRENT_SOURCE_DIR}/python/python.sh) diff --git a/cmake/Platform/Windows/Configurations_windows.cmake b/cmake/Platform/Windows/Configurations_windows.cmake index 6ab376ed0b..9ef535e455 100644 --- a/cmake/Platform/Windows/Configurations_windows.cmake +++ b/cmake/Platform/Windows/Configurations_windows.cmake @@ -106,7 +106,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio") endforeach() if(NOT version VERSION_EQUAL CMAKE_SYSTEM_VERSION) - message(STATUS "Selecting Windows SDK version ${version} to target Windows ${CMAKE_SYSTEM_VERSION}.") + message(STATUS "Using Windows SDK version ${version} to target Windows ${CMAKE_SYSTEM_VERSION}") endif() ly_set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "${version}") @@ -116,4 +116,3 @@ endif() if(NOT CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION MATCHES "10.0") message(FATAL_ERROR "Unsupported version of Windows SDK ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}, specify \"-DCMAKE_SYSTEM_VERSION=10.0\" when invoking cmake") endif() -message(STATUS "Using Windows target SDK ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") diff --git a/cmake/Platform/Windows/Packaging/Bootstrapper.wxs b/cmake/Platform/Windows/Packaging/Bootstrapper.wxs new file mode 100644 index 0000000000..55e8a8cd95 --- /dev/null +++ b/cmake/Platform/Windows/Packaging/Bootstrapper.wxs @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/Platform/Windows/Packaging/PostInstallSetup.wxs b/cmake/Platform/Windows/Packaging/PostInstallSetup.wxs new file mode 100644 index 0000000000..d4f6c181dd --- /dev/null +++ b/cmake/Platform/Windows/Packaging/PostInstallSetup.wxs @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + Installed OR NOT MANUALPRODUCTFOUND + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/Platform/Windows/Packaging/Shortcuts.wxs b/cmake/Platform/Windows/Packaging/Shortcuts.wxs new file mode 100644 index 0000000000..fb9d359b5a --- /dev/null +++ b/cmake/Platform/Windows/Packaging/Shortcuts.wxs @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/Platform/Windows/PackagingTemplate.wxs.in b/cmake/Platform/Windows/Packaging/Template.wxs.in similarity index 57% rename from cmake/Platform/Windows/PackagingTemplate.wxs.in rename to cmake/Platform/Windows/Packaging/Template.wxs.in index 3e5db03ec2..e14e064fbc 100644 --- a/cmake/Platform/Windows/PackagingTemplate.wxs.in +++ b/cmake/Platform/Windows/Packaging/Template.wxs.in @@ -12,13 +12,12 @@ Manufacturer="$(var.CPACK_PACKAGE_VENDOR)" UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)"> - + - - + + - @@ -38,7 +37,26 @@ - + + + + + + + + + + + + NOT Installed Or REINSTALL + + + NOT Installed Or REINSTALL + + + NOT Installed Or REINSTALL + + diff --git a/cmake/Platform/Windows/Packaging/product_icon.ico b/cmake/Platform/Windows/Packaging/product_icon.ico new file mode 100644 index 0000000000..0680ceea19 --- /dev/null +++ b/cmake/Platform/Windows/Packaging/product_icon.ico @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c042fce57915fc749abc7b37de765fd697c3c4d7de045a3d44805aa0ce29901a +size 107016 diff --git a/cmake/Platform/Windows/Packaging/product_logo.png b/cmake/Platform/Windows/Packaging/product_logo.png new file mode 100644 index 0000000000..d5fd60ffb8 --- /dev/null +++ b/cmake/Platform/Windows/Packaging/product_logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ac0348c906c91de864cba91c0231b4794d8a00fafa630d13f2232351b90aa59b +size 11074 diff --git a/cmake/Platform/Windows/PackagingPostBuild.cmake b/cmake/Platform/Windows/PackagingPostBuild.cmake new file mode 100644 index 0000000000..d379358bf4 --- /dev/null +++ b/cmake/Platform/Windows/PackagingPostBuild.cmake @@ -0,0 +1,89 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +# convert the path to a windows style path using string replace because TO_NATIVE_PATH +# only works on real paths +string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY}) + +# directory where the auto generated files live e.g /_CPack_Package/win64/WIX +set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY}) +set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap") + +set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}.exe") +set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename}) + +set(_ext_flags + -ext WixBalExtension +) + +set(_addtional_defines + -dCPACK_BOOTSTRAP_UPGRADE_GUID=${CPACK_WIX_BOOTSTRAP_UPGRADE_GUID} + -dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE} + -dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir} + -dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME} + -dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir} + -dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO} +) + +if(CPACK_LICENSE_URL) + list(APPEND _addtional_defines -dCPACK_LICENSE_URL=${CPACK_LICENSE_URL}) +endif() + +set(_candle_command + ${CPACK_WIX_CANDLE_EXECUTABLE} + -nologo + -arch x64 + "-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi + ${_addtional_defines} + ${_ext_flags} + "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs" + -o "${_bootstrap_out_dir}/" +) + +set(_light_command + ${CPACK_WIX_LIGHT_EXECUTABLE} + -nologo + ${_ext_flags} + ${_bootstrap_out_dir}/*.wixobj + -o "${_bootstrap_output_file}" +) + +message(STATUS "Creating Bootstrap Installer...") +execute_process( + COMMAND ${_candle_command} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${_light_command} + COMMAND_ERROR_IS_FATAL ANY +) + +file(COPY ${_bootstrap_output_file} + DESTINATION ${CPACK_PACKAGE_DIRECTORY} +) + +message(STATUS "Bootstrap installer generated to ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}") + +# use the internal default path if somehow not specified from cpack_configure_downloads +if(NOT CPACK_UPLOAD_DIRECTORY) + set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads) +endif() + +# copy the artifacts intended to be uploaded to a remote server into the folder specified +# through cpack_configure_downloads. this mimics the same process cpack does natively for +# some other frameworks that have built-in online installer support. +message(STATUS "Copying installer artifacts to upload directory...") +file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY}) +file(GLOB _artifacts "${_cpack_wix_out_dir}/*.msi" "${_cpack_wix_out_dir}/*.cab") +file(COPY ${_artifacts} + DESTINATION ${CPACK_UPLOAD_DIRECTORY} +) +message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}") diff --git a/cmake/Platform/Windows/Packaging_windows.cmake b/cmake/Platform/Windows/Packaging_windows.cmake index 8aa6f2386d..db9c7fc906 100644 --- a/cmake/Platform/Windows/Packaging_windows.cmake +++ b/cmake/Platform/Windows/Packaging_windows.cmake @@ -28,60 +28,52 @@ endif() set(CPACK_GENERATOR "WIX") +set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-windows-x86_64") +set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.zip") +set(CPACK_CMAKE_PACKAGE_HASH "15a49e2ab81c1822d75b1b1a92f7863f58e31f6d6aac1c4103eef2b071be3112") + # CPack will generate the WiX product/upgrade GUIDs further down the chain if they weren't supplied # however, they are unique for each run. instead, let's do the auto generation here and add it to -# the cache for run persistence. an additional cache file will be used to store the information on -# the original generation so we still have the ability to detect if they are still being used. -set(_guid_cache_file "${CMAKE_BINARY_DIR}/installer/wix_guid_cache.cmake") -if(NOT EXISTS ${_guid_cache_file}) - set(_wix_guid_namespace "6D43F57A-2917-4AD9-B758-1F13CDB08593") +# the cache for run persistence and have the ability to detect if they are still being used. +set(_wix_guid_namespace "6D43F57A-2917-4AD9-B758-1F13CDB08593") - # based the ISO-8601 standard (YYYY-MM-DDTHH-mm-ssTZD) e.g., 20210506145533 - string(TIMESTAMP _guid_gen_timestamp "%Y%m%d%H%M%S") - - file(WRITE ${_guid_cache_file} "set(_wix_guid_gen_timestamp ${_guid_gen_timestamp})\n") - - string(UUID _default_product_guid +function(generate_wix_guid out_value seed) + string(UUID _guid NAMESPACE ${_wix_guid_namespace} - NAME "ProductID_${_guid_gen_timestamp}" + NAME ${seed} TYPE SHA1 UPPER ) - file(APPEND ${_guid_cache_file} "set(_wix_default_product_guid ${_default_product_guid})\n") - string(UUID _default_upgrade_guid - NAMESPACE ${_wix_guid_namespace} - NAME "UpgradeCode_${_guid_gen_timestamp}" - TYPE SHA1 - UPPER - ) - file(APPEND ${_guid_cache_file} "set(_wix_default_upgrade_guid ${_default_upgrade_guid})\n") + set(${out_value} ${_guid} PARENT_SCOPE) +endfunction() + +set(_guid_seed_base "${PROJECT_NAME}_${LY_VERSION_STRING}") +generate_wix_guid(_wix_default_product_guid "${_guid_seed_base}_ProductID" ) +generate_wix_guid(_wix_default_upgrade_guid "${_guid_seed_base}_UpgradeCode") + +set(LY_WIX_PRODUCT_GUID "" CACHE STRING "GUID for the Product ID field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") +set(LY_WIX_UPGRADE_GUID "" CACHE STRING "GUID for the Upgrade Code field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") + +# clear previously cached default values to correct future runs. this will +# unfortunately only work if the seed properties still haven't changed +if(LY_WIX_PRODUCT_GUID STREQUAL ${_wix_default_product_guid}) + unset(LY_WIX_PRODUCT_GUID CACHE) endif() -include(${_guid_cache_file}) - -set(LY_WIX_PRODUCT_GUID "${_wix_default_product_guid}" CACHE STRING "GUID for the Product ID field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") -set(LY_WIX_UPGRADE_GUID "${_wix_default_upgrade_guid}" CACHE STRING "GUID for the Upgrade Code field. Format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX") - -set(_uses_default_product_guid FALSE) -if(NOT LY_WIX_PRODUCT_GUID OR LY_WIX_PRODUCT_GUID STREQUAL ${_wix_default_product_guid}) - set(_uses_default_product_guid TRUE) - set(LY_WIX_PRODUCT_GUID ${_wix_default_product_guid}) +if(LY_WIX_UPGRADE_GUID STREQUAL ${_wix_default_upgrade_guid}) + unset(LY_WIX_UPGRADE_GUID CACHE) endif() -set(_uses_default_upgrade_guid FALSE) -if(NOT LY_WIX_UPGRADE_GUID OR LY_WIX_UPGRADE_GUID STREQUAL ${_wix_default_upgrade_guid}) - set(_uses_default_upgrade_guid TRUE) - set(LY_WIX_UPGRADE_GUID ${_wix_default_upgrade_guid}) -endif() - -if(_uses_default_product_guid OR _uses_default_upgrade_guid) +if(NOT (LY_WIX_PRODUCT_GUID AND LY_WIX_UPGRADE_GUID)) message(STATUS "One or both WiX GUIDs were auto generated. It is recommended you supply your own GUIDs through LY_WIX_PRODUCT_GUID and LY_WIX_UPGRADE_GUID.") - if(_uses_default_product_guid) + if(NOT LY_WIX_PRODUCT_GUID) + set(LY_WIX_PRODUCT_GUID ${_wix_default_product_guid}) message(STATUS "-> Default LY_WIX_PRODUCT_GUID = ${LY_WIX_PRODUCT_GUID}") endif() - if(_uses_default_upgrade_guid) + if(NOT LY_WIX_UPGRADE_GUID) + set(LY_WIX_UPGRADE_GUID ${_wix_default_upgrade_guid}) message(STATUS "-> Default LY_WIX_UPGRADE_GUID = ${LY_WIX_UPGRADE_GUID}") endif() endif() @@ -89,4 +81,34 @@ endif() set(CPACK_WIX_PRODUCT_GUID ${LY_WIX_PRODUCT_GUID}) set(CPACK_WIX_UPGRADE_GUID ${LY_WIX_UPGRADE_GUID}) -set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/cmake/Platform/Windows/PackagingTemplate.wxs.in") +set(CPACK_WIX_PRODUCT_LOGO ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/product_logo.png) +set(CPACK_WIX_PRODUCT_ICON ${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/product_icon.ico) + +set(CPACK_WIX_TEMPLATE "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Template.wxs.in") + +set(CPACK_WIX_EXTRA_SOURCES + "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/PostInstallSetup.wxs" + "${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Shortcuts.wxs" +) + +set(CPACK_WIX_EXTENSIONS + WixUtilExtension +) + +set(_embed_artifacts "yes") + +if(LY_INSTALLER_DOWNLOAD_URL) + set(_embed_artifacts "no") + + # the bootstrapper will at the very least need a different upgrade guid + generate_wix_guid(CPACK_WIX_BOOTSTRAP_UPGRADE_GUID "${_guid_seed_base}_Bootstrap_UpgradeCode") + + set(CPACK_POST_BUILD_SCRIPTS + ${CPACK_SOURCE_DIR}/Platform/Windows/PackagingPostBuild.cmake + ) +endif() + +set(CPACK_WIX_CANDLE_EXTRA_FLAGS + -dCPACK_EMBED_ARTIFACTS=${_embed_artifacts} + -dCPACK_CMAKE_PACKAGE_NAME=${_cmake_package_name} +) diff --git a/cmake/Platform/Windows/platform_windows_files.cmake b/cmake/Platform/Windows/platform_windows_files.cmake index 2fc869b43e..3ce53fbcea 100644 --- a/cmake/Platform/Windows/platform_windows_files.cmake +++ b/cmake/Platform/Windows/platform_windows_files.cmake @@ -24,5 +24,8 @@ set(FILES PALDetection_windows.cmake Install_windows.cmake Packaging_windows.cmake - PackagingTemplate.wxs.in + PackagingPostBuild.cmake + Packaging/Bootstrapper.wxs + Packaging/Shortcuts.wxs + Packaging/Template.wxs.in ) diff --git a/cmake/Platform/iOS/Install_ios.cmake b/cmake/Platform/iOS/Install_ios.cmake index 8c96c199de..5c7959bf77 100644 --- a/cmake/Platform/iOS/Install_ios.cmake +++ b/cmake/Platform/iOS/Install_ios.cmake @@ -11,11 +11,5 @@ # Empty implementations for untested platforms to fix build errors. -function(ly_install_target ly_install_target_NAME) - -endfunction() - - function(ly_setup_o3de_install) - endfunction() \ No newline at end of file diff --git a/cmake/Platform/iOS/RuntimeDependencies_ios.cmake b/cmake/Platform/iOS/RuntimeDependencies_ios.cmake index d558c6f12a..a2a6d30593 100644 --- a/cmake/Platform/iOS/RuntimeDependencies_ios.cmake +++ b/cmake/Platform/iOS/RuntimeDependencies_ios.cmake @@ -118,57 +118,65 @@ function(ios_get_dependencies_recursive ios_DEPENDENCIES ly_TARGET) endfunction() -# For each (non-monolithic) game project, find runtime dependencies and tell XCode to embed/sign them -if(NOT LY_MONOLITHIC_GAME) +function(ly_delayed_generate_runtime_dependencies) - foreach(game_project ${LY_PROJECTS}) + # For each (non-monolithic) game project, find runtime dependencies and tell XCode to embed/sign them + if(NOT LY_MONOLITHIC_GAME) - # Recursively get all dependent frameworks for the game project. - unset(dependencies) - ios_get_dependencies_recursive(dependencies ${game_project}.GameLauncher) - if(dependencies) - set_target_properties(${game_project}.GameLauncher - PROPERTIES - XCODE_EMBED_FRAMEWORKS "${dependencies}" - XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY TRUE - XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" - ) + foreach(game_project ${LY_PROJECTS}) + + # Recursively get all dependent frameworks for the game project. + unset(dependencies) + ios_get_dependencies_recursive(dependencies ${game_project}.GameLauncher) + if(dependencies) + set_target_properties(${game_project}.GameLauncher + PROPERTIES + XCODE_EMBED_FRAMEWORKS "${dependencies}" + XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY TRUE + XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" + ) + endif() + + endforeach() + + endif() + + get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) + unset(test_runner_dependencies) + foreach(aliased_target IN LISTS all_targets) + + unset(target) + ly_de_alias_target(${aliased_target} target) + + # Exclude targets that dont produce runtime outputs + get_target_property(target_type ${target} TYPE) + if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS) + continue() endif() + + file(GENERATE + OUTPUT ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${target}.cmake + CONTENT "" + ) + if(target_type IN_LIST IOS_FRAMEWORK_TARGET_TYPES) + list(APPEND test_runner_dependencies ${target}) + endif() endforeach() -endif() + if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) + add_dependencies("AzTestRunner" ${test_runner_dependencies}) + + # We still need to add indirect dependencies(eg. 3rdParty) + unset(all_dependencies) + ios_get_dependencies_recursive(all_dependencies AzTestRunner) -get_property(all_targets GLOBAL PROPERTY LY_ALL_TARGETS) -unset(test_runner_dependencies) -foreach(target IN LISTS all_targets) - # Exclude targets that dont produce runtime outputs - get_target_property(target_type ${target} TYPE) - if(NOT target_type IN_LIST LY_TARGET_TYPES_WITH_RUNTIME_OUTPUTS) - continue() + set_target_properties("AzTestRunner" + PROPERTIES + XCODE_EMBED_FRAMEWORKS "${all_dependencies}" + XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY TRUE + XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" + ) endif() - - file(GENERATE - OUTPUT ${CMAKE_BINARY_DIR}/runtime_dependencies/$/${target}.cmake - CONTENT "" - ) - if(target_type IN_LIST IOS_FRAMEWORK_TARGET_TYPES) - list(APPEND test_runner_dependencies ${target}) - endif() -endforeach() - -if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) - add_dependencies("AzTestRunner" ${test_runner_dependencies}) - - # We still need to add indirect dependencies(eg. 3rdParty) - unset(all_dependencies) - ios_get_dependencies_recursive(all_dependencies AzTestRunner) - - set_target_properties("AzTestRunner" - PROPERTIES - XCODE_EMBED_FRAMEWORKS "${all_dependencies}" - XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY TRUE - XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks" - ) -endif() \ No newline at end of file +endfunction() \ No newline at end of file diff --git a/cmake/Projects.cmake b/cmake/Projects.cmake index 781fee3711..297dad4ddf 100644 --- a/cmake/Projects.cmake +++ b/cmake/Projects.cmake @@ -105,6 +105,7 @@ function(ly_add_project_dependencies) ) endfunction() + #template for generating the project build_path setreg set(project_build_path_template [[ { @@ -120,7 +121,6 @@ set(project_build_path_template [[ }]] ) - #! ly_generate_project_build_path_setreg: Generates a .setreg file that contains an absolute path to the ${CMAKE_BINARY_DIR} # This allows locate the directory where the project it's binaries are built to be located within the engine. # Which are the shared libraries and launcher executables @@ -136,18 +136,32 @@ set(project_build_path_template [[ # can only run on the host platform # \arg:project_real_path Full path to the o3de project directory function(ly_generate_project_build_path_setreg project_real_path) - # The build path isn't needed on non-monolithic platforms - # Nor on any non-host platforms - if (LY_MONOLITHIC_GAME OR NOT PAL_TRAIT_BUILD_HOST_TOOLS) - return() - endif() + # The build path isn't needed on non-monolithic platforms + # Nor on any non-host platforms + if (LY_MONOLITHIC_GAME OR NOT PAL_TRAIT_BUILD_HOST_TOOLS) + return() + endif() - # Set the project_bin_path to the ${CMAKE_BINARY_DIR} to provide the configure template - # with the project build directory - set(project_bin_path ${CMAKE_BINARY_DIR}) - string(CONFIGURE ${project_build_path_template} project_build_path_setreg_content @ONLY) - set(project_user_build_path_setreg_file ${project_real_path}/user/Registry/Platform/${PAL_PLATFORM_NAME}/build_path.setreg) - file(GENERATE OUTPUT ${project_user_build_path_setreg_file} CONTENT ${project_build_path_setreg_content}) + # Set the project_bin_path to the ${CMAKE_BINARY_DIR} to provide the configure template + # with the project build directory + set(project_bin_path ${CMAKE_BINARY_DIR}) + string(CONFIGURE ${project_build_path_template} project_build_path_setreg_content @ONLY) + set(project_user_build_path_setreg_file ${project_real_path}/user/Registry/Platform/${PAL_PLATFORM_NAME}/build_path.setreg) + file(GENERATE OUTPUT ${project_user_build_path_setreg_file} CONTENT ${project_build_path_setreg_content}) +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}) + endforeach() + + set_property(GLOBAL APPEND PROPERTY LY_EXTERNAL_SUBDIRS ${project_external_subdirs}) + endif() endfunction() # Add the projects here so the above function is found @@ -163,5 +177,6 @@ foreach(project ${LY_PROJECTS}) list(APPEND LY_PROJECTS_FOLDER_NAME ${project_folder_name}) add_subdirectory(${project} "${project_folder_name}-${full_directory_hash}") ly_generate_project_build_path_setreg(${full_directory_path}) + add_project_json_external_subdirectories(${full_directory_path}) endforeach() ly_set(LY_PROJECTS_FOLDER_NAME ${LY_PROJECTS_FOLDER_NAME}) diff --git a/cmake/SettingsRegistry.cmake b/cmake/SettingsRegistry.cmake index fd5985a5a1..4d932601b4 100644 --- a/cmake/SettingsRegistry.cmake +++ b/cmake/SettingsRegistry.cmake @@ -31,7 +31,7 @@ set(gem_module_template [[ "@stripped_gem_target@": { "Modules":["$"], - "SourcePaths":["@gem_relative_source_dir@"] + "SourcePaths":["@gem_module_root_relative_to_engine_root@"] }]] ) @@ -64,18 +64,16 @@ function(ly_get_gem_load_dependencies ly_GEM_LOAD_DEPENDENCIES ly_TARGET) get_target_property(load_dependencies ${ly_TARGET} MANUALLY_ADDED_DEPENDENCIES) if(load_dependencies) foreach(load_dependency ${load_dependencies}) - # Skip wrapping produced when targets are not created in the same directory - if(NOT ${load_dependency} MATCHES "^::@") - get_property(dependency_type TARGET ${load_dependency} PROPERTY TYPE) - get_property(is_gem_target TARGET ${load_dependency} PROPERTY GEM_MODULE SET) - # If the dependency is a "gem module" then add it as a load dependencies - # and recurse into its manually added dependencies - if (is_gem_target) - unset(dependencies) - ly_get_gem_load_dependencies(dependencies ${load_dependency}) - list(APPEND all_gem_load_dependencies ${load_dependency}) - list(APPEND all_gem_load_dependencies ${dependencies}) - endif() + # Skip wrapping produced when targets are not created in the same directory + ly_de_alias_target(${load_dependency} dealias_load_dependency) + get_property(is_gem_target TARGET ${dealias_load_dependency} PROPERTY GEM_MODULE SET) + # If the dependency is a "gem module" then add it as a load dependencies + # and recurse into its manually added dependencies + if (is_gem_target) + unset(dependencies) + ly_get_gem_load_dependencies(dependencies ${dealias_load_dependency}) + list(APPEND all_gem_load_dependencies ${dependencies}) + list(APPEND all_gem_load_dependencies ${dealias_load_dependency}) endif() endforeach() endif() @@ -83,39 +81,78 @@ function(ly_get_gem_load_dependencies ly_GEM_LOAD_DEPENDENCIES ly_TARGET) list(REMOVE_DUPLICATES all_gem_load_dependencies) set_property(GLOBAL PROPERTY LY_GEM_LOAD_DEPENDENCIES_${ly_TARGET} "${all_gem_load_dependencies}") set(${ly_GEM_LOAD_DEPENDENCIES} ${all_gem_load_dependencies} PARENT_SCOPE) + message(VERBOSE "Gem Target \"${ly_TARGET}\" has load dependencies of: ${all_gem_load_dependencies}") + endfunction() +#!ly_get_gem_module_root: Uses the supplied gem_target to lookup the nearest gem.json file above the SOURCE_DIR +# +# \arg:gem_target(TARGET) - Target to look upwards from using its SOURCE_DIR property +function(ly_get_gem_module_root output_gem_module_root gem_target) + unset(gem_module_roots) + get_property(gem_source_dir TARGET ${gem_target} PROPERTY SOURCE_DIR) + + if(gem_source_dir) + set(candidate_gem_dir ${gem_source_dir}) + # Locate the root of the gem by finding the gem.json location + while(NOT EXISTS ${candidate_gem_dir}/gem.json) + get_filename_component(parent_dir ${candidate_gem_dir} DIRECTORY) + if (${parent_dir} STREQUAL ${candidate_gem_dir}) + message(WARNING "Did not find a gem.json while processing GEM_MODULE target ${gem_target}!") + break() + endif() + set(candidate_gem_dir ${parent_dir}) + endwhile() + endif() + + if (EXISTS ${candidate_gem_dir}/gem.json) + set(gem_source_dir ${candidate_gem_dir}) + endif() + + # Set the gem module root output directory to the location with the gem.json file within it or + # the supplied gem_target SOURCE_DIR location if no gem.json file was found + set(${output_gem_module_root} ${gem_source_dir} PARENT_SCOPE) +endfunction() + + #! ly_delayed_generate_settings_registry: Generates a .setreg file for each target with dependencies # added to it via ly_add_target_dependencies # The generated file contains the file to the each dependent targets # This can be used for example to determine which list of gems to load with an application function(ly_delayed_generate_settings_registry) get_property(ly_delayed_load_targets GLOBAL PROPERTY LY_DELAYED_LOAD_DEPENDENCIES) - foreach(prefix_target ${ly_delayed_load_targets}) string(REPLACE "," ";" prefix_target_list "${prefix_target}") list(LENGTH prefix_target_list prefix_target_length) if(prefix_target_length EQUAL 0) - message(SEND_ERROR "Delayed load target is missing target name") continue() endif() # Retrieve the target name from the back of the list list(POP_BACK prefix_target_list target) - # Retreives the prefix if available from the remaining element of the list + # Retrieves the prefix if available from the remaining element of the list list(POP_BACK prefix_target_list prefix) # Get the gem dependencies for the given project and target combination get_property(gem_dependencies GLOBAL PROPERTY LY_DELAYED_LOAD_"${prefix_target}") list(REMOVE_DUPLICATES gem_dependencies) # Strip out any duplicate gem targets - set(all_gem_dependencies ${gem_dependencies}) + unset(all_gem_dependencies) foreach(gem_target ${gem_dependencies}) ly_get_gem_load_dependencies(gem_load_gem_dependencies ${gem_target}) - list(APPEND all_gem_dependencies ${gem_load_gem_dependencies}) + list(APPEND all_gem_dependencies ${gem_load_gem_dependencies} ${gem_target}) endforeach() list(REMOVE_DUPLICATES all_gem_dependencies) + # de-namespace them + unset(new_gem_dependencies) + foreach(gem_target ${all_gem_dependencies}) + ly_de_alias_target(${gem_target} stripped_gem_target) + list(APPEND new_gem_dependencies ${stripped_gem_target}) + endforeach() + set(all_gem_dependencies ${new_gem_dependencies}) + list(REMOVE_DUPLICATES all_gem_dependencies) + unset(target_gem_dependencies_names) foreach(gem_target ${all_gem_dependencies}) unset(gem_relative_source_dir) @@ -123,18 +160,20 @@ function(ly_delayed_generate_settings_registry) if (NOT TARGET ${gem_target}) message(FATAL_ERROR "Dependency ${gem_target} from ${target} does not exist") endif() - get_property(gem_relative_source_dir TARGET ${gem_target} PROPERTY SOURCE_DIR) - if(gem_relative_source_dir) - # Most gems CMakeLists.txt files reside in the /Code/ so remove "Code/" from the path - if(gem_relative_source_dir MATCHES ".*/Code$") - get_filename_component(gem_relative_source_dir ${gem_relative_source_dir} DIRECTORY) - endif() - file(TO_CMAKE_PATH ${LY_ROOT_FOLDER} ly_root_folder_cmake) - file(RELATIVE_PATH gem_relative_source_dir ${ly_root_folder_cmake} ${gem_relative_source_dir}) + + get_target_property(target_type ${gem_target} TYPE) + if (target_type STREQUAL "INTERFACE_LIBRARY") + # don't use interface libraries here, we only want ones which produce actual binaries. + # we have still already recursed into their dependencies - they'll show up later. + continue() endif() - # Strip target namespace from gem targets before configuring them into the json template - ly_strip_target_namespace(TARGET ${gem_target} OUTPUT_VARIABLE stripped_gem_target) + + ly_get_gem_module_root(gem_module_root ${gem_target}) + file(RELATIVE_PATH gem_module_root_relative_to_engine_root ${LY_ROOT_FOLDER} ${gem_module_root}) + + # De-alias namespace from gem targets before configuring them into the json template + ly_de_alias_target(${gem_target} stripped_gem_target) string(CONFIGURE ${gem_module_template} gem_module_json @ONLY) list(APPEND target_gem_dependencies_names ${gem_module_json}) endforeach() @@ -146,7 +185,12 @@ function(ly_delayed_generate_settings_registry) list(JOIN target_gem_dependencies_names ",\n" target_gem_dependencies_names) string(CONFIGURE ${gems_json_template} gem_json @ONLY) - set(dependencies_setreg $/Registry/cmake_dependencies.${specialization_name}.setreg) + if(prefix) + set(target_dir $) + else() + set(target_dir $) + endif() + set(dependencies_setreg ${target_dir}/Registry/cmake_dependencies.${specialization_name}.setreg) file(GENERATE OUTPUT ${dependencies_setreg} CONTENT ${gem_json}) set_property(TARGET ${target} APPEND PROPERTY INTERFACE_LY_TARGET_FILES "${dependencies_setreg}\nRegistry") diff --git a/cmake/TestImpactFramework/LYTestImpactFramework.cmake b/cmake/TestImpactFramework/LYTestImpactFramework.cmake index c10c5bf637..d46b16bca5 100644 --- a/cmake/TestImpactFramework/LYTestImpactFramework.cmake +++ b/cmake/TestImpactFramework/LYTestImpactFramework.cmake @@ -204,7 +204,10 @@ function(ly_test_impact_export_source_target_mappings MAPPING_TEMPLATE_FILE) get_property(LY_ALL_TARGETS GLOBAL PROPERTY LY_ALL_TARGETS) # Walk the build targets - foreach(target ${LY_ALL_TARGETS}) + foreach(aliased_target ${LY_ALL_TARGETS}) + + unset(target) + ly_de_alias_target(${aliased_target} target) message(TRACE "Exporting static source file mappings for ${target}") # Target name and path relative to root diff --git a/cmake/Tools/Platform/Android/android_deployment.py b/cmake/Tools/Platform/Android/android_deployment.py index 8a76270df1..eb8361ec18 100755 --- a/cmake/Tools/Platform/Android/android_deployment.py +++ b/cmake/Tools/Platform/Android/android_deployment.py @@ -62,7 +62,7 @@ class AndroidDeployment(object): :param deployment_type: The type of deployment (DEPLOY_APK_ONLY, DEPLOY_ASSETS_ONLY, or DEPLOY_BOTH) :param game_name: The name of the game whose assets are being deployed. None if is_test_project is True :param asset_mode: The asset mode of deployment (LOOSE, PAK, VFS). None if is_test_project is True - :param asset_type: The asset type (for android, 'es3'). None if is_test_project is True + :param asset_type: The asset type. None if is_test_project is True :param embedded_assets: Boolean to indicate if the assets are embedded in the APK or not :param is_unit_test: Boolean to indicate if this is a unit test deployment """ diff --git a/cmake/Tools/Platform/Android/generate_android_project.py b/cmake/Tools/Platform/Android/generate_android_project.py index f3f6a3acda..9a0e2760f5 100755 --- a/cmake/Tools/Platform/Android/generate_android_project.py +++ b/cmake/Tools/Platform/Android/generate_android_project.py @@ -118,7 +118,7 @@ ASSET_MODE_LOOSE = 'LOOSE' ASSET_MODE_VFS = 'VFS' ALL_ASSET_MODES = [ASSET_MODE_PAK, ASSET_MODE_LOOSE, ASSET_MODE_VFS] ASSET_TYPE_ARGUMENT_NAME = '--asset-type' -DEFAULT_ASSET_TYPE = 'es3' +DEFAULT_ASSET_TYPE = 'android' def wrap_parsed_args(parsed_args): diff --git a/cmake/Tools/Platform/Android/unit_test_android_deployment.py b/cmake/Tools/Platform/Android/unit_test_android_deployment.py index 011033649a..5ee168ca30 100755 --- a/cmake/Tools/Platform/Android/unit_test_android_deployment.py +++ b/cmake/Tools/Platform/Android/unit_test_android_deployment.py @@ -21,7 +21,7 @@ from cmake.Tools.Platform.Android import android_deployment TEST_GAME_NAME = "Foo" TEST_DEV_ROOT = pathlib.Path("Foo") TEST_ASSET_MODE = 'LOOSE' -TEST_ASSET_TYPE = 'es3' +TEST_ASSET_TYPE = 'android' TEST_ANDROID_SDK_PATH = pathlib.Path('c:\\AndroidSDK') TEST_BUILD_DIR = 'android_gradle_test' TEST_DEVICE_ID = '9A201FFAZ000ER' @@ -661,10 +661,10 @@ def test_execute_success(tmpdir, test_config, test_package_name, test_device_sto @pytest.mark.parametrize( "test_game_name, test_config, test_package_name, test_device_storage_path, test_asset_type", [ - pytest.param('game1','profile', 'com.amazon.lumberyard.foo', '/data/fool_storage', 'es3'), - pytest.param('game1','debug', 'com.amazon.lumberyard.foo', '/data/fool_storage', 'es3'), - pytest.param('game2','profile', 'com.amazon.lumberyard.bar', '/data/fool_storage', 'es3'), - pytest.param('game2','debug', 'com.amazon.lumberyard.bar', '/data/fool_storage', 'es3'), + pytest.param('game1','profile', 'com.amazon.lumberyard.foo', '/data/fool_storage', 'android'), + pytest.param('game1','debug', 'com.amazon.lumberyard.foo', '/data/fool_storage', 'android'), + pytest.param('game2','profile', 'com.amazon.lumberyard.bar', '/data/fool_storage', 'android'), + pytest.param('game2','debug', 'com.amazon.lumberyard.bar', '/data/fool_storage', 'android'), pytest.param('game3','profile', 'com.amazon.lumberyard.foo', '/data/fool_storage2', 'pc'), pytest.param('game3','debug', 'com.amazon.lumberyard.foo', '/data/fool_storage2', 'pc'), pytest.param('game4','profile', 'com.amazon.lumberyard.bar', '/data/fool_storage2', 'pc'), diff --git a/cmake/Tools/common.py b/cmake/Tools/common.py index b271c59766..c6a3e89e67 100755 --- a/cmake/Tools/common.py +++ b/cmake/Tools/common.py @@ -137,19 +137,32 @@ def get_config_file_values(config_file_path, keys_to_extract): return result_map -def get_bootstrap_values(engine_root, keys_to_extract): +def get_bootstrap_values(bootstrap_dir, keys_to_extract): """ - Extract requested values from the bootstrap.cfg file in the def root folder - :param engine_root: The engine root folder where bootstrap.cfg exists + Extract requested values from the bootstrap.setreg file in the Registry folder + :param bootstrap_dir: The parent directory of the bootstrap.setreg file :param keys_to_extract: The keys to extract into a dictionary :return: Dictionary of keys and its values (for matched keys) """ - bootstrap_file = os.path.join(engine_root, 'bootstrap.cfg') + bootstrap_file = os.path.join(bootstrap_dir, 'bootstrap.setreg') if not os.path.isfile(bootstrap_file): - raise LmbrCmdError("Missing 'bootstrap.cfg' file from engine root ('{}')".format(engine_root), - ERROR_CODE_FILE_NOT_FOUND) + raise logging.error(f'Bootstrap.setreg file {bootstrap_file} does not exist.') + + result_map = {} + with open(bootstrap_file, 'r') as f: + try: + json_data = json.load(f) + except Exception as e: + logging.error(f'Bootstrap.setreg failed to load: {str(e)}') + else: + for search_key in keys_to_extract: + try: + search_result = json_data["Amazon"]["AzCore"]["Bootstrap"][search_key] + except KeyError as e: + logging.warning(f'Bootstrap.setreg cannot find /Amazon/AzCore/Bootstrap/{search_key}: {str(e)}') + else: + result_map[search_key] = search_result - result_map = get_config_file_values(bootstrap_file, keys_to_extract) return result_map diff --git a/cmake/Tools/generate_game_paks.py b/cmake/Tools/generate_game_paks.py deleted file mode 100755 index 6a1ff1e458..0000000000 --- a/cmake/Tools/generate_game_paks.py +++ /dev/null @@ -1,244 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import argparse -import datetime -import logging -import pathlib -import platform -import sys -import os -import subprocess - -ROOT_DEV_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..')) -if ROOT_DEV_PATH not in sys.path: - sys.path.append(ROOT_DEV_PATH) - -from cmake.Tools import common - -# The location of this python script is not portable relative to the engine root, we determine the engine root based -# on its relative location -DEV_ROOT = os.path.realpath(os.path.join(__file__, '../../..')) - -BOOTSTRAP_CFG = os.path.join(DEV_ROOT, 'bootstrap.cfg') - -EXECUTABLE_EXTN = '.exe' if platform.system() == 'Windows' else '' -RC_NAME = f'rc{EXECUTABLE_EXTN}' -APB_NAME = f'AssetProcessorBatch{EXECUTABLE_EXTN}' - -# Depending on the user request for verbosity, the argument list to subprocess may or may not redirect stdout to NULL -VERBOSE_CALL_ARGS = dict( - shell=True, - cwd=DEV_ROOT -) -NON_VERBOSE_CALL_ARGS = dict( - **VERBOSE_CALL_ARGS, - stdout=subprocess.DEVNULL -) - - -def command_arg(arg): - """ - Work-around for an issue when running subprocess on Linux: subprocess.check_call will take in the argument as an array - but only invokes the first item in the array, ignoring the arguments. As quick fix, we will combine the array into the - full command line and execute it that way on non-windows platforms - """ - if platform.system() == 'Windows': - return arg - else: - return ' '.join(arg) - - -def validate(binfolder, game_name, pak_script): - - # - # Validate the binfolder is relative and contains 'rc' and 'AssetProcessorBatch' - # - if os.path.isabs(binfolder): - raise common.LmbrCmdError("Invalid value for '-b/--binfolder'. It must be a path relative to the engine root folder", - common.ERROR_CODE_ERROR_DIRECTORY) - - binfolder_abs_path = pathlib.Path(DEV_ROOT) / binfolder - if not binfolder_abs_path.is_dir(): - raise common.LmbrCmdError("Invalid value for '-b/--binfolder'. Path does not exist or is not a directory", - common.ERROR_CODE_ERROR_DIRECTORY) - - rc_check = binfolder_abs_path / RC_NAME - if not rc_check.is_file(): - raise common.LmbrCmdError(f"Invalid value for '-b/--binfolder'. Path does not contain {RC_NAME}", - common.ERROR_CODE_ERROR_DIRECTORY) - - apb_check = binfolder_abs_path / APB_NAME - if not apb_check.is_file(): - raise common.LmbrCmdError(f"Invalid value for '-b/--binfolder'. Path does not contain {APB_NAME}", - common.ERROR_CODE_ERROR_DIRECTORY) - - # - # Validate the game name represents a game project within the game engine - # - gamefolder_abs_path = pathlib.Path(DEV_ROOT) / game_name - if not gamefolder_abs_path.is_dir(): - raise common.LmbrCmdError(f"Invalid value for '-g/--game-name'. No game '{game_name} exists.", - common.ERROR_CODE_ERROR_DIRECTORY) - - project_json_path = gamefolder_abs_path / 'project.json' - if not project_json_path.is_file(): - raise common.LmbrCmdError( - f"Invalid value for '-g/--game-name'. Folder '{game_name} is not a valid game project.", - common.ERROR_CODE_FILE_NOT_FOUND) - - if not os.path.isfile(pak_script): - raise common.LmbrCmdError(f'Pak script file {pak_script} does not exist.', - common.ERROR_CODE_FILE_NOT_FOUND) - - -def process(binfolder, game_name, asset_platform, autorun_assetprocessor, recompress, fastest_compression, target, - pak_script, warn_on_assetprocessor_error, verbose): - - logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG if verbose else logging.INFO) - - target_path_root_abs = pathlib.Path(DEV_ROOT) / target - if target_path_root_abs.is_file(): - raise common.LmbrCmdError(f"Target '{target}' already exists as a file.", - common.ERROR_CODE_GENERAL_ERROR) - os.makedirs(target_path_root_abs.absolute(), exist_ok=True) - - target_pak_folder_name = f'{game_name.lower()}_{asset_platform}_paks' - target_pak = target_path_root_abs / target_pak_folder_name - - # Prepare the asset processor batch arguments and execute if requested - if autorun_assetprocessor: - ap_executable = os.path.join(binfolder, APB_NAME) - ap_cmd_args = [ap_executable, - f'/gamefolder={game_name}', - f'/platforms={asset_platform}'] - logging.debug("Calling {}".format(' '.join(ap_cmd_args))) - try: - logging.info(f"Running {APB_NAME} on {game_name}") - start_time = datetime.datetime.now() - - call_args = VERBOSE_CALL_ARGS if verbose else NON_VERBOSE_CALL_ARGS - - subprocess.check_call(command_arg(ap_cmd_args), - **call_args) - - total_time = datetime.datetime.now() - start_time - logging.info(f"Asset Processing Complete. Elapse: {total_time}") - except subprocess.CalledProcessError: - if warn_on_assetprocessor_error: - logging.warning('AssetProcessorBatch reported errors') - else: - raise common.LmbrCmdError("AssetProcessorBatch has one or more failed assets.", - common.ERROR_CODE_GENERAL_ERROR) - - rc_executable = os.path.join(binfolder, RC_NAME) - rc_cmd_args = [rc_executable, - f'/job={pak_script}', - f'/p={asset_platform}', - f'/game={game_name}', - f'/trg={target_pak}'] - if recompress: - rc_cmd_args.append('/recompress=1') - if fastest_compression: - rc_cmd_args.append('/use_fastest=1') - logging.debug("Calling {}".format(' '.join(rc_cmd_args))) - - try: - logging.info(f"Running {APB_NAME} on {game_name}") - start_time = datetime.datetime.now() - - call_args = VERBOSE_CALL_ARGS if verbose else NON_VERBOSE_CALL_ARGS - - subprocess.check_call(command_arg(rc_cmd_args), - **call_args) - - total_time = datetime.datetime.now() - start_time - logging.info(f"Asset Processing Complete. Elapse: {total_time}") - logging.info(f"Pak files for {game_name} written to {target_pak}") - - except subprocess.CalledProcessError as err: - raise common.LmbrCmdError(f"{RC_NAME} returned an error: {str(err)}.", - err.returncode) - - -def main(args): - - parser = argparse.ArgumentParser() - - parser.add_argument('-b', '--binfolder', - help='The relative location of the binary folder that contains the resource compiler and asset processor') - - bootstrap = common.get_bootstrap_values(DEV_ROOT, ['project_path']) - parser.add_argument('-g', '--game-name', - help='The name of the Game whose asset pak will be generated for', - default=bootstrap.get('project_path')) - - parser.add_argument('-p', '--asset-platform', - help='The asset platform type to process') - - parser.add_argument('-a', '--autorun-assetprocessor', - help='Option to automatically invoke asset processor batch on the game before generating the pak', - action='store_true') - - parser.add_argument('-w', '--warn-on-assetprocessor-error', - help='When -a/--autorun-assetprocessor is specified, warn on asset processor failure rather than aborting the process', - action='store_true') - - parser.add_argument('-r', '--recompress', - action='store_true', - help='If present, the ResourceCompiler (RC.exe) will decompress and compress back each PAK file ' - 'found as they are transferred from the cache folder to the game_pc_pak folder.') - parser.add_argument('-fc', '--fastest-compression', - action='store_true', - help='As each file is being added to its PAK file, they will be compressed across all available ' - 'codecs (ZLIB, ZSTD and LZ4) and the one with the fastest decompression time will be ' - 'chosen. The default is to always use ZLIB') - parser.add_argument('--target', - default='Pak', - help='Specify a target folder for the pak files. (Default : Pak)') - parser.add_argument('--pak-script', - default=f'{DEV_ROOT}/{os.path.normpath("Code/Tools/RC/Config/rc/RCJob_Generic_MakePaks.xml")}', - help="The absolute path of the pak script configuration file to use to create the paks.") - - parser.add_argument('-v', '--verbose', - help='Enable debug messages', - action='store_true') - - parsed = parser.parse_args(args) - - validate(binfolder=parsed.binfolder, - game_name=parsed.game_name, - pak_script=parsed.pak_script) - - process(binfolder=parsed.binfolder, - game_name=parsed.game_name, - asset_platform=parsed.asset_platform, - autorun_assetprocessor=parsed.autorun_assetprocessor, - recompress=parsed.recompress, - fastest_compression=parsed.fastest_compression, - target=parsed.target, - pak_script=parsed.pak_script, - warn_on_assetprocessor_error=parsed.warn_on_assetprocessor_error, - verbose=parsed.verbose) - - -if __name__ == '__main__': - try: - if not os.path.isfile(BOOTSTRAP_CFG): - raise common.LmbrCmdError("Invalid dev root, missing bootstrap.cfg.", - common.ERROR_CODE_FILE_NOT_FOUND) - - main(sys.argv[1:]) - exit(0) - - except common.LmbrCmdError as err: - print(str(err), file=sys.stderr) - exit(err.code) diff --git a/cmake/Tools/global_project.py b/cmake/Tools/global_project.py deleted file mode 100644 index 1d84d9dcfb..0000000000 --- a/cmake/Tools/global_project.py +++ /dev/null @@ -1,168 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import argparse -import logging -import os -import sys -import re -import pathlib -import json -import cmake.Tools.registration as registration - -logger = logging.getLogger() -logging.basicConfig() - - -def set_global_project(project_name: str or None, - project_path: str or pathlib.Path or None) -> int: - """ - set what the current project is - :param project_name: the name of the project you want to set, resolves project_path - :param project_path: the path of the project you want to set - :return: 0 for success or non 0 failure code - """ - if project_path and project_name: - logger.error(f'Project Name and Project Path provided, these are mutually exclusive.') - return 1 - - if not project_name and not project_path: - logger.error('Must specify either a Project name or Project Path.') - return 1 - - if project_name and not project_path: - project_path = registration.get_registered(project_name=project_name) - - if not project_path: - logger.error(f'Project Path {project_path} has not been registered.') - return 1 - - project_path = pathlib.Path(project_path).resolve() - - bootstrap_setreg_file = registration.get_o3de_registry_folder() / 'bootstrap.setreg' - if bootstrap_setreg_file.is_file(): - with bootstrap_setreg_file.open('r') as f: - try: - json_data = json.load(f) - except Exception as e: - logger.error(f'Bootstrap.setreg failed to load: {str(e)}') - else: - try: - json_data["Amazon"]["AzCore"]["Bootstrap"]["project_path"] = project_path - except Exception as e: - logger.error(f'Bootstrap.setreg failed to load: {str(e)}') - else: - try: - os.unlink(bootstrap_setreg_file) - except Exception as e: - logger.error(f'Failed to unlink bootstrap file {bootstrap_setreg_file}: {str(e)}') - return 1 - else: - json_data = {} - json_data.update({"Amazon":{"AzCore":{"Bootstrap":{"project_path":project_path.as_posix()}}}}) - - with bootstrap_setreg_file.open('w') as s: - s.write(json.dumps(json_data, indent=4)) - - return 0 - - -def get_global_project() -> pathlib.Path or None: - """ - get what the current project set is - :return: project_path or None on failure - """ - bootstrap_setreg_file = registration.get_o3de_registry_folder() / 'bootstrap.setreg' - if not bootstrap_setreg_file.is_file(): - logger.error(f'Bootstrap.setreg file {bootstrap_setreg_file} does not exist.') - return None - - with bootstrap_setreg_file.open('r') as f: - try: - json_data = json.load(f) - except Exception as e: - logger.error(f'Bootstrap.setreg failed to load: {str(e)}') - else: - try: - project_path = json_data["Amazon"]["AzCore"]["Bootstrap"]["project_path"] - except Exception as e: - logger.error(f'Bootstrap.setreg cannot find Amazon:AzCore:Bootstrap:project_path: {str(e)}') - else: - return pathlib.Path(project_path).resolve() - return None - -def _run_get_global_project(args: argparse) -> int: - if args.override_home_folder: - registration.override_home_folder = args.override_home_folder - - project_path = get_global_project() - if project_path: - print(project_path.as_posix()) - return 0 - return 1 - - -def _run_set_global_project(args: argparse) -> int: - if args.override_home_folder: - registration.override_home_folder = args.override_home_folder - - return set_global_project(args.project_name, - args.project_path) - - -def add_args(parser, subparsers) -> None: - """ - add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be - invoked locally or aggregated by a central python file. - Ex. Directly run from this file alone with: python global_project.py set_global_project --project-name TestProject - OR - o3de.py can aggregate commands by importing global_project, call add_args and - execute: python o3de.py set_global_project --project-path C:/TestProject - :param parser: the caller instantiates a parser and passes it in here - :param subparsers: the caller instantiates subparsers and passes it in here - """ - get_global_project_subparser = subparsers.add_parser('get-global-project') - get_global_project_subparser.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.') - - get_global_project_subparser.set_defaults(func=_run_get_global_project) - - set_global_project_subparser = subparsers.add_parser('set-global-project') - group = set_global_project_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-pn', '--project-name', required=False, - help='The name of the project. If supplied this will resolve the --project-path.') - group.add_argument('-pp', '--project-path', required=False, - help='The path to the project') - - set_global_project_subparser.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.') - - set_global_project_subparser.set_defaults(func=_run_set_global_project) - - -if __name__ == "__main__": - # parse the command line args - the_parser = argparse.ArgumentParser() - - # add subparsers - the_subparsers = the_parser.add_subparsers(help='sub-command help') - - # add args to the parser - add_args(the_parser, the_subparsers) - - # parse args - the_args = the_parser.parse_args() - - # run - ret = the_args.func(the_args) - - # return - sys.exit(ret) diff --git a/cmake/Tools/layout_tool.py b/cmake/Tools/layout_tool.py index 82d10f412f..3fcab241d7 100755 --- a/cmake/Tools/layout_tool.py +++ b/cmake/Tools/layout_tool.py @@ -78,19 +78,19 @@ def verify_layout(layout_dir, platform_name, project_path, asset_mode, asset_typ if remote_on_check is None: # Validate that if '_connect_to_remote is enabled, that the 'input_remote_ip' is not set to local host if input_remote_connect == '1' and input_remote_ip == LOCAL_HOST: - return _warn("'bootstrap.cfg' is configured to connect to Asset Processor remotely, but the 'remote_ip' " + return _warn("'bootstrap.setreg' is configured to connect to Asset Processor remotely, but the 'remote_ip' " " is configured for LOCAL HOST") else: if remote_on_check: # Verify we are set for remote AP connection if input_remote_ip == LOCAL_HOST: - return _warn(f"'bootstrap.cfg' is not configured for a remote Asset Processor connection (remote_ip={input_remote_ip})") + return _warn(f"'bootstrap.setreg' is not configured for a remote Asset Processor connection (remote_ip={input_remote_ip})") if input_remote_connect != '1': - return _warn(f"'bootstrap.cfg' is not configured for a remote Asset Processor connection ({platform_name}_connect_to_remote={input_remote_connect}") + return _warn(f"'bootstrap.setreg' is not configured for a remote Asset Processor connection ({platform_name}_connect_to_remote={input_remote_connect}") else: # Verify we are disabled for remote AP connection if input_remote_connect != '0': - return _warn(f"'bootstrap.cfg' is not configured for a remote Asset Processor connection ({platform_name}_connect_to_remote={input_remote_connect}") + return _warn(f"'bootstrap.setreg' is not configured for a remote Asset Processor connection ({platform_name}_connect_to_remote={input_remote_connect}") return 0 @@ -107,20 +107,15 @@ def verify_layout(layout_dir, platform_name, project_path, asset_mode, asset_typ project_name_lower = project_path.lower() layout_path = pathlib.Path(layout_dir) - # Validate bootstrap.cfg exists - bootstrap_file = layout_path / 'bootstrap.cfg' - if not bootstrap_file.is_file(): - warning_count += _warn(f"'bootstrap.cfg' is missing from {str(layout_path)}") - bootstrap_values = None - else: - bootstrap_values = common.get_config_file_values(str(bootstrap_file), [f'{platform_name_lower}_remote_filesystem', - f'{platform_name_lower}_connect_to_remote', - f'{platform_name_lower}_wait_for_connect', - f'{platform_name_lower}_assets', - f'assets', - f'{platform_name_lower}_remote_ip', - f'remote_ip' - ]) + bootstrap_path = pathlib.Path(ROOT_ENGINE_PATH) / 'Registry' + bootstrap_values = common.get_bootstrap_values(str(bootstrap_path), [f'{platform_name_lower}_remote_filesystem', + f'{platform_name_lower}_connect_to_remote', + f'{platform_name_lower}_wait_for_connect', + f'{platform_name_lower}_assets', + f'assets', + f'{platform_name_lower}_remote_ip', + f'remote_ip' + ]) # Validate the system_{platform}_{asset type}.cfg exists platform_system_cfg_file = layout_path / f'system_{platform_name_lower}_{asset_type}.cfg' @@ -141,9 +136,9 @@ def verify_layout(layout_dir, platform_name, project_path, asset_mode, asset_typ # Validate that the asset type for the platform matches the one set for the build bootstrap_asset_type = bootstrap_values.get(f'{platform_name_lower}_assets') or bootstrap_values.get('assets') if not bootstrap_asset_type: - warning_count += _warn("'bootstrap.cfg' is missing specifications for asset type.") + warning_count += _warn("'bootstrap.setreg' is missing specifications for asset type.") elif bootstrap_asset_type != asset_type: - warning_count += _warn(f"The asset type specified in bootstrap.cfg ({bootstrap_asset_type}) does not match the asset type specified for this deployment({asset_type}).") + warning_count += _warn(f"The asset type specified in bootstrap.setreg ({bootstrap_asset_type}) does not match the asset type specified for this deployment({asset_type}).") # Validate that if '_connect_to_remote is enabled, that the 'remote_ip' is not set to local host warning_count += _validate_remote_ap(remote_ip, remote_connect, None) @@ -211,7 +206,7 @@ def verify_layout(layout_dir, platform_name, project_path, asset_mode, asset_typ elif asset_mode == ASSET_MODE_VFS: remote_file_system = bootstrap_values.get(f'{platform_name_lower}_remote_filesystem') or '0' if not remote_file_system != '1': - warning_count += _warn("Remote file system is not configured in bootstrap.cfg for VFS mode.") + warning_count += _warn("Remote file system is not configured in bootstrap.setreg for VFS mode.") else: warning_count += _validate_remote_ap(remote_ip, remote_connect, True) @@ -333,7 +328,9 @@ def create_link(src:pathlib.Path, tgt:pathlib.Path, copy): import _winapi _winapi.CreateJunction(str(src), str(tgt)) else: - src.symlink_to(tgt, target_is_directory=True) + if tgt.exists(): + tgt.unlink() + tgt.symlink_to(src, target_is_directory=True) except OSError as e: raise common.LmbrCmdError(f"Error trying to create {link_type} {src} => {tgt} : {e}", e.errno) diff --git a/cmake/Tools/registration.py b/cmake/Tools/registration.py deleted file mode 100755 index 70fbc5ba90..0000000000 --- a/cmake/Tools/registration.py +++ /dev/null @@ -1,4405 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -""" -This file contains all the code that has to do with registering engines, projects, gems and templates -""" - -import argparse -import logging -import os -import sys -import json -import pathlib -import hashlib -import shutil -import zipfile -import urllib.parse -import urllib.request - -logger = logging.getLogger() -logging.basicConfig() - - -def backup_file(file_name: str or pathlib.Path) -> None: - index = 0 - renamed = False - while not renamed: - backup_file_name = pathlib.Path(str(file_name) + '.bak' + str(index)).resolve() - index += 1 - if not backup_file_name.is_file(): - file_name = pathlib.Path(file_name).resolve() - file_name.rename(backup_file_name) - if backup_file_name.is_file(): - renamed = True - - -def backup_folder(folder: str or pathlib.Path) -> None: - index = 0 - renamed = False - while not renamed: - backup_folder_name = pathlib.Path(str(folder) + '.bak' + str(index)).resolve() - index += 1 - if not backup_folder_name.is_dir(): - folder = pathlib.Path(folder).resolve() - folder.rename(backup_folder_name) - if backup_folder_name.is_dir(): - renamed = True - - -def get_this_engine_path() -> pathlib.Path: - return pathlib.Path(os.path.realpath(__file__)).parents[2].resolve() - - -override_home_folder = None - - -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() - - -def get_o3de_folder() -> pathlib.Path: - o3de_folder = get_home_folder() / '.o3de' - o3de_folder.mkdir(parents=True, exist_ok=True) - return o3de_folder - - -def get_o3de_registry_folder() -> pathlib.Path: - registry_folder = get_o3de_folder() / 'Registry' - registry_folder.mkdir(parents=True, exist_ok=True) - return registry_folder - - -def get_o3de_cache_folder() -> pathlib.Path: - cache_folder = get_o3de_folder() / 'Cache' - cache_folder.mkdir(parents=True, exist_ok=True) - return cache_folder - - -def get_o3de_download_folder() -> pathlib.Path: - download_folder = get_o3de_folder() / 'Download' - download_folder.mkdir(parents=True, exist_ok=True) - return download_folder - - -def get_o3de_engines_folder() -> pathlib.Path: - engines_folder = get_o3de_folder() / 'Engines' - engines_folder.mkdir(parents=True, exist_ok=True) - return engines_folder - - -def get_o3de_projects_folder() -> pathlib.Path: - 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_folder() / 'Gems' - gems_folder.mkdir(parents=True, exist_ok=True) - return gems_folder - - -def get_o3de_templates_folder() -> pathlib.Path: - templates_folder = get_o3de_folder() / 'Templates' - templates_folder.mkdir(parents=True, exist_ok=True) - return templates_folder - - -def get_o3de_restricted_folder() -> pathlib.Path: - restricted_folder = get_o3de_folder() / 'Restricted' - restricted_folder.mkdir(parents=True, exist_ok=True) - return restricted_folder - - -def get_o3de_logs_folder() -> pathlib.Path: - restricted_folder = get_o3de_folder() / 'Logs' - restricted_folder.mkdir(parents=True, exist_ok=True) - return restricted_folder - - -def register_shipped_engine_o3de_objects() -> int: - engine_path = get_this_engine_path() - - ret_val = 0 - - # directories with engines - starting_engines_directories = [ - ] - for engines_directory in sorted(starting_engines_directories, reverse=True): - error_code = register_all_engines_in_folder(engines_path=engines_directory) - if error_code: - ret_val = error_code - - # specific engines - starting_engines = [ - ] - for engine_path in sorted(starting_engines): - error_code = register(engine_path=engine_path) - if error_code: - ret_val = error_code - - # directories with projects - starting_projects_directories = [ - ] - for projects_directory in sorted(starting_projects_directories, reverse=True): - error_code = register_all_projects_in_folder(engine_path=engine_path, projects_path=projects_directory) - if error_code: - ret_val = error_code - - # specific projects - starting_projects = [ - f'{engine_path}/AutomatedTesting' - ] - for project_path in sorted(starting_projects, reverse=True): - error_code = register(engine_path=engine_path, project_path=project_path) - if error_code: - ret_val = error_code - - # directories with gems - starting_gems_directories = [ - f'{engine_path}/Gems' - ] - for gems_directory in sorted(starting_gems_directories, reverse=True): - error_code = register_all_gems_in_folder(engine_path=engine_path, gems_path=gems_directory) - if error_code: - ret_val = error_code - - # specific gems - starting_gems = [ - ] - for gem_path in sorted(starting_gems, reverse=True): - error_code = register(engine_path=engine_path, gem_path=gem_path) - if error_code: - ret_val = error_code - - # directories with templates - starting_templates_directories = [ - f'{engine_path}/Templates' - ] - for templates_directory in sorted(starting_templates_directories, reverse=True): - error_code = register_all_templates_in_folder(engine_path=engine_path, templates_path=templates_directory) - if error_code: - ret_val = error_code - - # specific templates - starting_templates = [ - ] - for template_path in sorted(starting_templates, reverse=True): - error_code = register(engine_path=engine_path, template_path=template_path) - if error_code: - ret_val = error_code - - # directories with restricted - starting_restricted_directories = [ - ] - for restricted_directory in sorted(starting_restricted_directories, reverse=True): - error_code = register_all_restricted_in_folder(engine_path=engine_path, restricted_path=restricted_directory) - if error_code: - ret_val = error_code - - # specific restricted - starting_restricted = [ - ] - for restricted_path in sorted(starting_restricted, reverse=True): - error_code = register(engine_path=engine_path, restricted_path=restricted_path) - if error_code: - ret_val = error_code - - # directories with repos - starting_repo_directories = [ - ] - for repos_directory in sorted(starting_repo_directories, reverse=True): - error_code = register_all_repos_in_folder(engine_path=engine_path, repos_path=repos_directory) - if error_code: - ret_val = error_code - - # specific repos - starting_repos = [ - ] - for repo_uri in sorted(starting_repos, reverse=True): - error_code = register(repo_uri=repo_uri) - if error_code: - ret_val = error_code - - # register anything in the users default folders globally - error_code = register_all_engines_in_folder(get_registered(default_folder='engines')) - if error_code: - ret_val = error_code - error_code = register_all_projects_in_folder(get_registered(default_folder='projects')) - if error_code: - ret_val = error_code - error_code = register_all_gems_in_folder(get_registered(default_folder='gems')) - if error_code: - ret_val = error_code - error_code = register_all_templates_in_folder(get_registered(default_folder='templates')) - if error_code: - ret_val = error_code - error_code = register_all_restricted_in_folder(get_registered(default_folder='restricted')) - if error_code: - ret_val = error_code - error_code = register_all_restricted_in_folder(get_registered(default_folder='projects')) - if error_code: - ret_val = error_code - error_code = register_all_restricted_in_folder(get_registered(default_folder='gems')) - if error_code: - ret_val = error_code - error_code = register_all_restricted_in_folder(get_registered(default_folder='templates')) - if error_code: - ret_val = error_code - - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - gems = json_data['gems'].copy() - gems.extend(engine_object['gems']) - for gem_path in sorted(gems, key=len): - gem_path = pathlib.Path(gem_path).resolve() - gem_cmake_lists_txt = gem_path / 'CMakeLists.txt' - if gem_cmake_lists_txt.is_file(): - add_gem_to_cmake(engine_path=engine_path, gem_path=gem_path, supress_errors=True) # don't care about errors - - return ret_val - - -def register_all_in_folder(folder_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None, - exclude: list = None) -> int: - if not folder_path: - logger.error(f'Folder path cannot be empty.') - return 1 - - folder_path = pathlib.Path(folder_path).resolve() - if not folder_path.is_dir(): - logger.error(f'Folder path is not dir.') - return 1 - - engines_set = set() - projects_set = set() - gems_set = set() - templates_set = set() - restricted_set = set() - repo_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(folder_path): - if root in exclude: - continue - - for name in files: - if name == 'engine.json': - engines_set.add(root) - elif name == 'project.json': - projects_set.add(root) - elif name == 'gem.json': - gems_set.add(root) - elif name == 'template.json': - templates_set.add(root) - elif name == 'restricted.json': - restricted_set.add(root) - elif name == 'repo.json': - repo_set.add(root) - - for engine in sorted(engines_set, reverse=True): - error_code = register(engine_path=engine, remove=remove) - if error_code: - ret_val = error_code - - for project in sorted(projects_set, reverse=True): - error_code = register(engine_path=engine_path, project_path=project, remove=remove) - if error_code: - ret_val = error_code - - for gem in sorted(gems_set, reverse=True): - error_code = register(engine_path=engine_path, gem_path=gem, remove=remove) - if error_code: - ret_val = error_code - - for template in sorted(templates_set, reverse=True): - error_code = register(engine_path=engine_path, template_path=template, remove=remove) - if error_code: - ret_val = error_code - - for restricted in sorted(restricted_set, reverse=True): - error_code = register(engine_path=engine_path, restricted_path=restricted, remove=remove) - if error_code: - ret_val = error_code - - for repo in sorted(repo_set, reverse=True): - error_code = register(engine_path=engine_path, repo_uri=repo, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_engines_in_folder(engines_path: str or pathlib.Path, - remove: bool = False) -> int: - if not engines_path: - logger.error(f'Engines path cannot be empty.') - return 1 - - engines_path = pathlib.Path(engines_path).resolve() - if not engines_path.is_dir(): - logger.error(f'Engines path is not dir.') - return 1 - - engines_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(engines_path): - for name in files: - if name == 'engine.json': - engines_set.add(name) - - for engine in sorted(engines_set, reverse=True): - error_code = register(engine_path=engine, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_projects_in_folder(projects_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not projects_path: - logger.error(f'Projects path cannot be empty.') - return 1 - - projects_path = pathlib.Path(projects_path).resolve() - if not projects_path.is_dir(): - logger.error(f'Projects path is not dir.') - return 1 - - projects_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(projects_path): - for name in files: - if name == 'project.json': - projects_set.add(root) - - for project in sorted(projects_set, reverse=True): - error_code = register(engine_path=engine_path, project_path=project, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_gems_in_folder(gems_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not gems_path: - logger.error(f'Gems path cannot be empty.') - return 1 - - gems_path = pathlib.Path(gems_path).resolve() - if not gems_path.is_dir(): - logger.error(f'Gems path is not dir.') - return 1 - - gems_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(gems_path): - for name in files: - if name == 'gem.json': - gems_set.add(root) - - for gem in sorted(gems_set, reverse=True): - error_code = register(engine_path=engine_path, gem_path=gem, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_templates_in_folder(templates_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not templates_path: - logger.error(f'Templates path cannot be empty.') - return 1 - - templates_path = pathlib.Path(templates_path).resolve() - if not templates_path.is_dir(): - logger.error(f'Templates path is not dir.') - return 1 - - templates_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(templates_path): - for name in files: - if name == 'template.json': - templates_set.add(root) - - for template in sorted(templates_set, reverse=True): - error_code = register(engine_path=engine_path, template_path=template, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_restricted_in_folder(restricted_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not restricted_path: - logger.error(f'Restricted path cannot be empty.') - return 1 - - restricted_path = pathlib.Path(restricted_path).resolve() - if not restricted_path.is_dir(): - logger.error(f'Restricted path is not dir.') - return 1 - - restricted_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(restricted_path): - for name in files: - if name == 'restricted.json': - restricted_set.add(root) - - for restricted in sorted(restricted_set, reverse=True): - error_code = register(engine_path=engine_path, restricted_path=restricted, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def register_all_repos_in_folder(repos_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not repos_path: - logger.error(f'Repos path cannot be empty.') - return 1 - - repos_path = pathlib.Path(repos_path).resolve() - if not repos_path.is_dir(): - logger.error(f'Repos path is not dir.') - return 1 - - repo_set = set() - - ret_val = 0 - for root, dirs, files in os.walk(repos_path): - for name in files: - if name == 'repo.json': - repo_set.add(root) - - for repo in sorted(repo_set, reverse=True): - error_code = register(engine_path=engine_path, repo_uri=repo, remove=remove) - if error_code: - ret_val = error_code - - return ret_val - - -def get_o3de_manifest() -> pathlib.Path: - manifest_path = get_o3de_folder() / 'o3de_manifest.json' - if not manifest_path.is_file(): - 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() - default_templates_folder = get_o3de_templates_folder() - default_restricted_folder = get_o3de_restricted_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) - - json_data = {} - json_data.update({'o3de_manifest_name': f'{username}'}) - json_data.update({'origin': o3de_folder.as_posix()}) - json_data.update({'default_engines_folder': default_engines_folder.as_posix()}) - json_data.update({'default_projects_folder': default_projects_folder.as_posix()}) - json_data.update({'default_gems_folder': default_gems_folder.as_posix()}) - 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({'projects': []}) - json_data.update({'gems': []}) - json_data.update({'templates': []}) - json_data.update({'restricted': []}) - json_data.update({'repos': []}) - json_data.update({'engines': []}) - - 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)) - json_data.update({'default_restricted_folder': default_restricted_folder.as_posix()}) - - 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)) - - 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)) - - 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)) - - with manifest_path.open('w') as s: - s.write(json.dumps(json_data, indent=4)) - - return manifest_path - - -def load_o3de_manifest() -> dict: - with get_o3de_manifest().open('r') as f: - try: - json_data = json.load(f) - except Exception as e: - logger.error(f'Manifest json failed to load: {str(e)}') - else: - return json_data - - -def save_o3de_manifest(json_data: dict) -> None: - with get_o3de_manifest().open('w') as s: - try: - s.write(json.dumps(json_data, indent=4)) - except Exception as e: - logger.error(f'Manifest json failed to save: {str(e)}') - - -def register_engine_path(json_data: dict, - engine_path: str or pathlib.Path, - remove: bool = False) -> int: - if not engine_path: - logger.error(f'Engine path cannot be empty.') - return 1 - engine_path = pathlib.Path(engine_path).resolve() - - for engine_object in json_data['engines']: - engine_object_path = pathlib.Path(engine_object['path']).resolve() - if engine_object_path == engine_path: - json_data['engines'].remove(engine_object) - - if remove: - return 0 - - if not engine_path.is_dir(): - logger.error(f'Engine path {engine_path} does not exist.') - return 1 - - engine_json = engine_path / 'engine.json' - if not valid_o3de_engine_json(engine_json): - logger.error(f'Engine json {engine_json} is not valid.') - return 1 - - engine_object = {} - engine_object.update({'path': engine_path.as_posix()}) - engine_object.update({'projects': []}) - engine_object.update({'gems': []}) - engine_object.update({'templates': []}) - engine_object.update({'restricted': []}) - engine_object.update({'external_subdirectories': []}) - - json_data['engines'].insert(0, engine_object) - - return 0 - - -def register_gem_path(json_data: dict, - gem_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not gem_path: - logger.error(f'Gem path cannot be empty.') - return 1 - gem_path = pathlib.Path(gem_path).resolve() - - if engine_path: - engine_data = find_engine_data(json_data, engine_path) - if not engine_data: - logger.error(f'Engine path {engine_path} is not registered.') - return 1 - - while gem_path in engine_data['gems']: - engine_data['gems'].remove(gem_path) - - while gem_path.as_posix() in engine_data['gems']: - engine_data['gems'].remove(gem_path.as_posix()) - - if remove: - logger.warn(f'Removing Gem path {gem_path}.') - return 0 - else: - while gem_path in json_data['gems']: - json_data['gems'].remove(gem_path) - - while gem_path.as_posix() in json_data['gems']: - json_data['gems'].remove(gem_path.as_posix()) - - if remove: - logger.warn(f'Removing Gem path {gem_path}.') - return 0 - - if not gem_path.is_dir(): - logger.error(f'Gem path {gem_path} does not exist.') - return 1 - - gem_json = gem_path / 'gem.json' - if not valid_o3de_gem_json(gem_json): - logger.error(f'Gem json {gem_json} is not valid.') - return 1 - - if engine_path: - engine_data['gems'].insert(0, gem_path.as_posix()) - else: - json_data['gems'].insert(0, gem_path.as_posix()) - - return 0 - - -def register_project_path(json_data: dict, - project_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not project_path: - logger.error(f'Project path cannot be empty.') - return 1 - project_path = pathlib.Path(project_path).resolve() - - if engine_path: - engine_data = find_engine_data(json_data, engine_path) - if not engine_data: - logger.error(f'Engine path {engine_path} is not registered.') - return 1 - - while project_path in engine_data['projects']: - engine_data['projects'].remove(project_path) - - while project_path.as_posix() in engine_data['projects']: - engine_data['projects'].remove(project_path.as_posix()) - - if remove: - logger.warn(f'Engine {engine_path} removing Project path {project_path}.') - return 0 - else: - while project_path in json_data['projects']: - json_data['projects'].remove(project_path) - - while project_path.as_posix() in json_data['projects']: - json_data['projects'].remove(project_path.as_posix()) - - if remove: - logger.warn(f'Removing Project path {project_path}.') - return 0 - - if not project_path.is_dir(): - logger.error(f'Project path {project_path} does not exist.') - return 1 - - project_json = project_path / 'project.json' - if not valid_o3de_project_json(project_json): - logger.error(f'Project json {project_json} is not valid.') - return 1 - - if engine_path: - engine_data['projects'].insert(0, project_path.as_posix()) - else: - json_data['projects'].insert(0, project_path.as_posix()) - - # registering a project has the additional step of setting the project.json 'engine' field - this_engine_json = get_this_engine_path() / 'engine.json' - with this_engine_json.open('r') as f: - try: - this_engine_json = json.load(f) - except Exception as e: - logger.error(f'Engine json failed to load: {str(e)}') - return 1 - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except Exception as e: - logger.error(f'Project json failed to load: {str(e)}') - return 1 - - update_project_json = False - try: - update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] - except Exception as e: - update_project_json = True - - if update_project_json: - project_json_data['engine'] = this_engine_json['engine_name'] - backup_file(project_json) - with project_json.open('w') as s: - try: - s.write(json.dumps(project_json_data, indent=4)) - except Exception as e: - logger.error(f'Project json failed to save: {str(e)}') - return 1 - - return 0 - - -def register_template_path(json_data: dict, - template_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not template_path: - logger.error(f'Template path cannot be empty.') - return 1 - template_path = pathlib.Path(template_path).resolve() - - if engine_path: - engine_data = find_engine_data(json_data, engine_path) - if not engine_data: - logger.error(f'Engine path {engine_path} is not registered.') - return 1 - - while template_path in engine_data['templates']: - engine_data['templates'].remove(template_path) - - while template_path.as_posix() in engine_data['templates']: - engine_data['templates'].remove(template_path.as_posix()) - - if remove: - logger.warn(f'Engine {engine_path} removing Template path {template_path}.') - return 0 - else: - while template_path in json_data['templates']: - json_data['templates'].remove(template_path) - - while template_path.as_posix() in json_data['templates']: - json_data['templates'].remove(template_path.as_posix()) - - if remove: - logger.warn(f'Removing Template path {template_path}.') - return 0 - - if not template_path.is_dir(): - logger.error(f'Template path {template_path} does not exist.') - return 1 - - template_json = template_path / 'template.json' - if not valid_o3de_template_json(template_json): - logger.error(f'Template json {template_json} is not valid.') - return 1 - - if engine_path: - engine_data['templates'].insert(0, template_path.as_posix()) - else: - json_data['templates'].insert(0, template_path.as_posix()) - - return 0 - - -def register_restricted_path(json_data: dict, - restricted_path: str or pathlib.Path, - remove: bool = False, - engine_path: str or pathlib.Path = None) -> int: - if not restricted_path: - logger.error(f'Restricted path cannot be empty.') - return 1 - restricted_path = pathlib.Path(restricted_path).resolve() - - if engine_path: - engine_data = find_engine_data(json_data, engine_path) - if not engine_data: - logger.error(f'Engine path {engine_path} is not registered.') - return 1 - - while restricted_path in engine_data['restricted']: - engine_data['restricted'].remove(restricted_path) - - while restricted_path.as_posix() in engine_data['restricted']: - engine_data['restricted'].remove(restricted_path.as_posix()) - - if remove: - logger.warn(f'Engine {engine_path} removing Restricted path {restricted_path}.') - return 0 - else: - while restricted_path in json_data['restricted']: - json_data['restricted'].remove(restricted_path) - - while restricted_path.as_posix() in json_data['restricted']: - json_data['restricted'].remove(restricted_path.as_posix()) - - if remove: - logger.warn(f'Removing Restricted path {restricted_path}.') - return 0 - - if not restricted_path.is_dir(): - logger.error(f'Restricted path {restricted_path} does not exist.') - return 1 - - restricted_json = restricted_path / 'restricted.json' - if not valid_o3de_restricted_json(restricted_json): - logger.error(f'Restricted json {restricted_json} is not valid.') - return 1 - - if engine_path: - engine_data['restricted'].insert(0, restricted_path.as_posix()) - else: - json_data['restricted'].insert(0, restricted_path.as_posix()) - - return 0 - - -def valid_o3de_repo_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['repo_name'] - test = json_data['origin'] - except Exception as e: - return False - - return True - - -def valid_o3de_engine_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['engine_name'] - # test = json_data['origin'] # will be required soon - except Exception as e: - return False - return True - - -def valid_o3de_project_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['project_name'] - # test = json_data['origin'] # will be required soon - except Exception as e: - return False - return True - - -def valid_o3de_gem_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['gem_name'] - # test = json_data['origin'] # will be required soon - except Exception as e: - return False - return True - - -def valid_o3de_template_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['template_name'] - # test = json_data['origin'] # will be required soon - except Exception as e: - return False - return True - - -def valid_o3de_restricted_json(file_name: str or pathlib.Path) -> bool: - file_name = pathlib.Path(file_name).resolve() - if not file_name.is_file(): - return False - with file_name.open('r') as f: - try: - json_data = json.load(f) - test = json_data['restricted_name'] - # test = json_data['origin'] # will be required soon - except Exception as e: - return False - return True - - -def process_add_o3de_repo(file_name: str or pathlib.Path, - repo_set: set) -> int: - file_name = pathlib.Path(file_name).resolve() - if not valid_o3de_repo_json(file_name): - return 1 - - cache_folder = get_o3de_cache_folder() - - with file_name.open('r') as f: - try: - repo_data = json.load(f) - except Exception as e: - logger.error(f'{file_name} failed to load: {str(e)}') - return 1 - - for engine_uri in repo_data['engines']: - engine_uri = f'{engine_uri}/engine.json' - engine_sha256 = hashlib.sha256(engine_uri.encode()) - cache_file = cache_folder / str(engine_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - parsed_uri = urllib.parse.urlparse(engine_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(engine_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - engine_json = pathlib.Path(engine_uri).resolve() - if not engine_json.is_file(): - return 1 - shutil.copy(engine_json, cache_file) - - for project_uri in repo_data['projects']: - project_uri = f'{project_uri}/project.json' - project_sha256 = hashlib.sha256(project_uri.encode()) - cache_file = cache_folder / str(project_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - parsed_uri = urllib.parse.urlparse(project_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(project_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - project_json = pathlib.Path(project_uri).resolve() - if not project_json.is_file(): - return 1 - shutil.copy(project_json, cache_file) - - for gem_uri in repo_data['gems']: - gem_uri = f'{gem_uri}/gem.json' - gem_sha256 = hashlib.sha256(gem_uri.encode()) - cache_file = cache_folder / str(gem_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - parsed_uri = urllib.parse.urlparse(gem_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(gem_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - gem_json = pathlib.Path(gem_uri).resolve() - if not gem_json.is_file(): - return 1 - shutil.copy(gem_json, cache_file) - - for template_uri in repo_data['templates']: - template_uri = f'{template_uri}/template.json' - template_sha256 = hashlib.sha256(template_uri.encode()) - cache_file = cache_folder / str(template_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - parsed_uri = urllib.parse.urlparse(template_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(template_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - template_json = pathlib.Path(template_uri).resolve() - if not template_json.is_file(): - return 1 - shutil.copy(template_json, cache_file) - - for repo_uri in repo_data['repos']: - if repo_uri not in repo_set: - repo_set.add(repo_uri) - repo_uri = f'{repo_uri}/repo.json' - repo_sha256 = hashlib.sha256(repo_uri.encode()) - cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(repo_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - repo_json = pathlib.Path(repo_uri).resolve() - if not repo_json.is_file(): - return 1 - shutil.copy(repo_json, cache_file) - return 0 - - -def register_repo(json_data: dict, - repo_uri: str or pathlib.Path, - remove: bool = False) -> int: - if not repo_uri: - logger.error(f'Repo URI cannot be empty.') - return 1 - - url = f'{repo_uri}/repo.json' - parsed_uri = urllib.parse.urlparse(url) - - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - while repo_uri in json_data['repos']: - json_data['repos'].remove(repo_uri) - else: - repo_uri = pathlib.Path(repo_uri).resolve() - while repo_uri.as_posix() in json_data['repos']: - json_data['repos'].remove(repo_uri.as_posix()) - - if remove: - logger.warn(f'Removing repo uri {repo_uri}.') - return 0 - - repo_sha256 = hashlib.sha256(url.encode()) - cache_file = get_o3de_cache_folder() / str(repo_sha256.hexdigest() + '.json') - - result = 0 - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - if not cache_file.is_file(): - with urllib.request.urlopen(url) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - json_data['repos'].insert(0, repo_uri) - else: - if not cache_file.is_file(): - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, origin_file) - json_data['repos'].insert(0, repo_uri.as_posix()) - - repo_set = set() - result = process_add_o3de_repo(cache_file, repo_set) - - return result - - -def register_default_engines_folder(json_data: dict, - default_engines_folder: str or pathlib.Path, - remove: bool = False) -> int: - if remove: - default_engines_folder = get_o3de_engines_folder() - - # make sure the path exists - default_engines_folder = pathlib.Path(default_engines_folder).resolve() - if not default_engines_folder.is_dir(): - logger.error(f'Default engines folder {default_engines_folder} does not exist.') - return 1 - - default_engines_folder = default_engines_folder.as_posix() - json_data['default_engines_folder'] = default_engines_folder - - return 0 - - -def register_default_projects_folder(json_data: dict, - default_projects_folder: str or pathlib.Path, - remove: bool = False) -> int: - if remove: - default_projects_folder = get_o3de_projects_folder() - - # make sure the path exists - default_projects_folder = pathlib.Path(default_projects_folder).resolve() - if not default_projects_folder.is_dir(): - logger.error(f'Default projects folder {default_projects_folder} does not exist.') - return 1 - - default_projects_folder = default_projects_folder.as_posix() - json_data['default_projects_folder'] = default_projects_folder - - return 0 - - -def register_default_gems_folder(json_data: dict, - default_gems_folder: str or pathlib.Path, - remove: bool = False) -> int: - if remove: - default_gems_folder = get_o3de_gems_folder() - - # make sure the path exists - default_gems_folder = pathlib.Path(default_gems_folder).resolve() - if not default_gems_folder.is_dir(): - logger.error(f'Default gems folder {default_gems_folder} does not exist.') - return 1 - - default_gems_folder = default_gems_folder.as_posix() - json_data['default_gems_folder'] = default_gems_folder - - return 0 - - -def register_default_templates_folder(json_data: dict, - default_templates_folder: str or pathlib.Path, - remove: bool = False) -> int: - if remove: - default_templates_folder = get_o3de_templates_folder() - - # make sure the path exists - default_templates_folder = pathlib.Path(default_templates_folder).resolve() - if not default_templates_folder.is_dir(): - logger.error(f'Default templates folder {default_templates_folder} does not exist.') - return 1 - - default_templates_folder = default_templates_folder.as_posix() - json_data['default_templates_folder'] = default_templates_folder - - return 0 - - -def register_default_restricted_folder(json_data: dict, - default_restricted_folder: str or pathlib.Path, - remove: bool = False) -> int: - if remove: - default_restricted_folder = get_o3de_restricted_folder() - - # make sure the path exists - default_restricted_folder = pathlib.Path(default_restricted_folder).resolve() - if not default_restricted_folder.is_dir(): - logger.error(f'Default restricted folder {default_restricted_folder} does not exist.') - return 1 - - default_restricted_folder = default_restricted_folder.as_posix() - json_data['default_restricted_folder'] = default_restricted_folder - - return 0 - - -def register(engine_path: str or pathlib.Path = None, - project_path: str or pathlib.Path = None, - gem_path: str or pathlib.Path = None, - template_path: str or pathlib.Path = None, - restricted_path: str or pathlib.Path = None, - repo_uri: str or pathlib.Path = None, - default_engines_folder: str or pathlib.Path = None, - default_projects_folder: str or pathlib.Path = None, - default_gems_folder: str or pathlib.Path = None, - default_templates_folder: str or pathlib.Path = None, - default_restricted_folder: str or pathlib.Path = None, - remove: bool = False - ) -> int: - """ - Adds/Updates entries to the .o3de/o3de_manifest.json - - :param engine_path: if engine folder is supplied the path will be added to the engine if it can, if not global - :param project_path: project folder - :param gem_path: gem folder - :param template_path: template folder - :param restricted_path: restricted folder - :param repo_uri: repo uri - :param default_engines_folder: default engines folder - :param default_projects_folder: default projects folder - :param default_gems_folder: default gems folder - :param default_templates_folder: default templates folder - :param default_restricted_folder: default restricted code folder - :param remove: add/remove the entries - - :return: 0 for success or non 0 failure code - """ - - json_data = load_o3de_manifest() - - result = 0 - - # do anything that could require a engine context first - if isinstance(project_path, str) or isinstance(project_path, pathlib.PurePath): - if not project_path: - logger.error(f'Project path cannot be empty.') - return 1 - result = register_project_path(json_data, project_path, remove, engine_path) - - elif isinstance(gem_path, str) or isinstance(gem_path, pathlib.PurePath): - if not gem_path: - logger.error(f'Gem path cannot be empty.') - return 1 - result = register_gem_path(json_data, gem_path, remove, engine_path) - - elif isinstance(template_path, str) or isinstance(template_path, pathlib.PurePath): - if not template_path: - logger.error(f'Template path cannot be empty.') - return 1 - result = register_template_path(json_data, template_path, remove, engine_path) - - elif isinstance(restricted_path, str) or isinstance(restricted_path, pathlib.PurePath): - if not restricted_path: - logger.error(f'Restricted path cannot be empty.') - return 1 - result = register_restricted_path(json_data, restricted_path, remove, engine_path) - - elif isinstance(repo_uri, str) or isinstance(repo_uri, pathlib.PurePath): - if not repo_uri: - logger.error(f'Repo URI cannot be empty.') - return 1 - result = register_repo(json_data, repo_uri, remove) - - elif isinstance(default_engines_folder, str) or isinstance(default_engines_folder, pathlib.PurePath): - result = register_default_engines_folder(json_data, default_engines_folder, remove) - - elif isinstance(default_projects_folder, str) or isinstance(default_projects_folder, pathlib.PurePath): - result = register_default_projects_folder(json_data, default_projects_folder, remove) - - elif isinstance(default_gems_folder, str) or isinstance(default_gems_folder, pathlib.PurePath): - result = register_default_gems_folder(json_data, default_gems_folder, remove) - - elif isinstance(default_templates_folder, str) or isinstance(default_templates_folder, pathlib.PurePath): - result = register_default_templates_folder(json_data, default_templates_folder, remove) - - elif isinstance(default_restricted_folder, str) or isinstance(default_restricted_folder, pathlib.PurePath): - result = register_default_restricted_folder(json_data, default_restricted_folder, remove) - - # engine is done LAST - # Now that everything that could have an engine context is done, if the engine is supplied that means this is - # registering the engine itself - elif isinstance(engine_path, str) or isinstance(engine_path, pathlib.PurePath): - if not engine_path: - logger.error(f'Engine path cannot be empty.') - return 1 - result = register_engine_path(json_data, engine_path, remove) - - if not result: - save_o3de_manifest(json_data) - - return result - - -def remove_invalid_o3de_objects() -> None: - json_data = load_o3de_manifest() - - for engine_object in json_data['engines']: - engine_path = engine_object['path'] - if not valid_o3de_engine_json(pathlib.Path(engine_path).resolve() / 'engine.json'): - logger.warn(f"Engine path {engine_path} is invalid.") - register(engine_path=engine_path, remove=True) - else: - for project in engine_object['projects']: - if not valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): - logger.warn(f"Project path {project} is invalid.") - register(engine_path=engine_path, project_path=project, remove=True) - - for gem_path in engine_object['gems']: - if not valid_o3de_gem_json(pathlib.Path(gem_path).resolve() / 'gem.json'): - logger.warn(f"Gem path {gem_path} is invalid.") - register(engine_path=engine_path, gem_path=gem_path, remove=True) - - for template_path in engine_object['templates']: - if not valid_o3de_template_json(pathlib.Path(template_path).resolve() / 'template.json'): - logger.warn(f"Template path {template_path} is invalid.") - register(engine_path=engine_path, template_path=template_path, remove=True) - - for restricted in engine_object['restricted']: - if not valid_o3de_restricted_json(pathlib.Path(restricted).resolve() / 'restricted.json'): - logger.warn(f"Restricted path {restricted} is invalid.") - register(engine_path=engine_path, restricted_path=restricted, remove=True) - - for external in engine_object['external_subdirectories']: - external = pathlib.Path(external).resolve() - if not external.is_dir(): - logger.warn(f"External subdirectory {external} is invalid.") - remove_external_subdirectory(external) - - for project in json_data['projects']: - if not valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): - logger.warn(f"Project path {project} is invalid.") - register(project_path=project, remove=True) - - for gem in json_data['gems']: - if not valid_o3de_gem_json(pathlib.Path(gem).resolve() / 'gem.json'): - logger.warn(f"Gem path {gem} is invalid.") - register(gem_path=gem, remove=True) - - for template in json_data['templates']: - if not valid_o3de_template_json(pathlib.Path(template).resolve() / 'template.json'): - logger.warn(f"Template path {template} is invalid.") - register(template_path=template, remove=True) - - for restricted in json_data['restricted']: - if not valid_o3de_restricted_json(pathlib.Path(restricted).resolve() / 'restricted.json'): - logger.warn(f"Restricted path {restricted} is invalid.") - register(restricted_path=restricted, remove=True) - - default_engines_folder = pathlib.Path(json_data['default_engines_folder']).resolve() - if not default_engines_folder.is_dir(): - new_default_engines_folder = get_o3de_folder() / 'Engines' - new_default_engines_folder.mkdir(parents=True, exist_ok=True) - logger.warn( - f"Default engines folder {default_engines_folder} is invalid. Set default {new_default_engines_folder}") - register(default_engines_folder=new_default_engines_folder.as_posix()) - - default_projects_folder = pathlib.Path(json_data['default_projects_folder']).resolve() - if not default_projects_folder.is_dir(): - new_default_projects_folder = get_o3de_folder() / 'Projects' - new_default_projects_folder.mkdir(parents=True, exist_ok=True) - logger.warn( - f"Default projects folder {default_projects_folder} is invalid. Set default {new_default_projects_folder}") - register(default_projects_folder=new_default_projects_folder.as_posix()) - - default_gems_folder = pathlib.Path(json_data['default_gems_folder']).resolve() - if not default_gems_folder.is_dir(): - new_default_gems_folder = get_o3de_folder() / 'Gems' - new_default_gems_folder.mkdir(parents=True, exist_ok=True) - logger.warn(f"Default gems folder {default_gems_folder} is invalid." - f" Set default {new_default_gems_folder}") - register(default_gems_folder=new_default_gems_folder.as_posix()) - - default_templates_folder = pathlib.Path(json_data['default_templates_folder']).resolve() - if not default_templates_folder.is_dir(): - new_default_templates_folder = get_o3de_folder() / 'Templates' - new_default_templates_folder.mkdir(parents=True, exist_ok=True) - logger.warn( - f"Default templates folder {default_templates_folder} is invalid." - f" Set default {new_default_templates_folder}") - register(default_templates_folder=new_default_templates_folder.as_posix()) - - default_restricted_folder = pathlib.Path(json_data['default_restricted_folder']).resolve() - if not default_restricted_folder.is_dir(): - default_restricted_folder = get_o3de_folder() / 'Restricted' - default_restricted_folder.mkdir(parents=True, exist_ok=True) - logger.warn( - f"Default restricted folder {default_restricted_folder} is invalid." - f" Set default {default_restricted_folder}") - register(default_restricted_folder=default_restricted_folder.as_posix()) - - -def refresh_repos() -> int: - json_data = load_o3de_manifest() - - # clear the cache - cache_folder = get_o3de_cache_folder() - shutil.rmtree(cache_folder) - cache_folder = get_o3de_cache_folder() # will recreate it - - result = 0 - - # set will stop circular references - repo_set = set() - - for repo_uri in json_data['repos']: - if repo_uri not in repo_set: - repo_set.add(repo_uri) - - repo_uri = f'{repo_uri}/repo.json' - repo_sha256 = hashlib.sha256(repo_uri.encode()) - cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') - if not cache_file.is_file(): - parsed_uri = urllib.parse.urlparse(repo_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(repo_uri) as s: - with cache_file.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(repo_uri).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, cache_file) - - if not valid_o3de_repo_json(cache_file): - logger.error(f'Repo json {repo_uri} is not valid.') - cache_file.unlink() - return 1 - - last_failure = process_add_o3de_repo(cache_file, repo_set) - if last_failure: - result = last_failure - - return result - - -def search_repo(repo_set: set, - repo_json_data: dict, - engine_name: str = None, - project_name: str = None, - gem_name: str = None, - template_name: str = None, - restricted_name: str = None) -> dict or None: - cache_folder = get_o3de_cache_folder() - - if isinstance(engine_name, str) or isinstance(engine_name, pathlib.PurePath): - for engine_uri in repo_json_data['engines']: - engine_uri = f'{engine_uri}/engine.json' - engine_sha256 = hashlib.sha256(engine_uri.encode()) - engine_cache_file = cache_folder / str(engine_sha256.hexdigest() + '.json') - if engine_cache_file.is_file(): - with engine_cache_file.open('r') as f: - try: - engine_json_data = json.load(f) - except Exception as e: - logger.warn(f'{engine_cache_file} failed to load: {str(e)}') - else: - if engine_json_data['engine_name'] == engine_name: - return engine_json_data - - elif isinstance(project_name, str) or isinstance(project_name, pathlib.PurePath): - for project_uri in repo_json_data['projects']: - project_uri = f'{project_uri}/project.json' - project_sha256 = hashlib.sha256(project_uri.encode()) - project_cache_file = cache_folder / str(project_sha256.hexdigest() + '.json') - if project_cache_file.is_file(): - with project_cache_file.open('r') as f: - try: - project_json_data = json.load(f) - except Exception as e: - logger.warn(f'{project_cache_file} failed to load: {str(e)}') - else: - if project_json_data['project_name'] == project_name: - return project_json_data - - elif isinstance(gem_name, str) or isinstance(gem_name, pathlib.PurePath): - for gem_uri in repo_json_data['gems']: - gem_uri = f'{gem_uri}/gem.json' - gem_sha256 = hashlib.sha256(gem_uri.encode()) - gem_cache_file = cache_folder / str(gem_sha256.hexdigest() + '.json') - if gem_cache_file.is_file(): - with gem_cache_file.open('r') as f: - try: - gem_json_data = json.load(f) - except Exception as e: - logger.warn(f'{gem_cache_file} failed to load: {str(e)}') - else: - if gem_json_data['gem_name'] == gem_name: - return gem_json_data - - elif isinstance(template_name, str) or isinstance(template_name, pathlib.PurePath): - for template_uri in repo_json_data['templates']: - template_uri = f'{template_uri}/template.json' - template_sha256 = hashlib.sha256(template_uri.encode()) - template_cache_file = cache_folder / str(template_sha256.hexdigest() + '.json') - if template_cache_file.is_file(): - with template_cache_file.open('r') as f: - try: - template_json_data = json.load(f) - except Exception as e: - logger.warn(f'{template_cache_file} failed to load: {str(e)}') - else: - if template_json_data['template_name'] == template_name: - return template_json_data - - elif isinstance(restricted_name, str) or isinstance(restricted_name, pathlib.PurePath): - for restricted_uri in repo_json_data['restricted']: - restricted_uri = f'{restricted_uri}/restricted.json' - restricted_sha256 = hashlib.sha256(restricted_uri.encode()) - restricted_cache_file = cache_folder / str(restricted_sha256.hexdigest() + '.json') - if restricted_cache_file.is_file(): - with restricted_cache_file.open('r') as f: - try: - restricted_json_data = json.load(f) - except Exception as e: - logger.warn(f'{restricted_cache_file} failed to load: {str(e)}') - else: - if restricted_json_data['restricted_name'] == restricted_name: - return restricted_json_data - # recurse - else: - for repo_repo_uri in repo_json_data['repos']: - if repo_repo_uri not in repo_set: - repo_set.add(repo_repo_uri) - repo_repo_uri = f'{repo_repo_uri}/repo.json' - repo_repo_sha256 = hashlib.sha256(repo_repo_uri.encode()) - repo_repo_cache_file = cache_folder / str(repo_repo_sha256.hexdigest() + '.json') - if repo_repo_cache_file.is_file(): - with repo_repo_cache_file.open('r') as f: - try: - repo_repo_json_data = json.load(f) - except Exception as e: - logger.warn(f'{repo_repo_cache_file} failed to load: {str(e)}') - else: - item = search_repo(repo_set, - repo_repo_json_data, - engine_name, - project_name, - gem_name, - template_name) - if item: - return item - return None - - -def get_downloadable(engine_name: str = None, - project_name: str = None, - gem_name: str = None, - template_name: str = None, - restricted_name: str = None) -> dict or None: - json_data = load_o3de_manifest() - cache_folder = get_o3de_cache_folder() - repo_set = set() - for repo_uri in json_data['repos']: - if repo_uri not in repo_set: - repo_set.add(repo_uri) - repo_uri = f'{repo_uri}/repo.json' - repo_sha256 = hashlib.sha256(repo_uri.encode()) - repo_cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') - if repo_cache_file.is_file(): - with repo_cache_file.open('r') as f: - try: - repo_json_data = json.load(f) - except Exception as e: - logger.warn(f'{repo_cache_file} failed to load: {str(e)}') - else: - item = search_repo(repo_set, - repo_json_data, - engine_name, - project_name, - gem_name, - template_name, - restricted_name) - if item: - return item - return None - - -def get_registered(engine_name: str = None, - project_name: str = None, - gem_name: str = None, - template_name: str = None, - default_folder: str = None, - repo_name: str = None, - restricted_name: str = None) -> pathlib.Path or None: - json_data = load_o3de_manifest() - - # check global first then this engine - if isinstance(engine_name, str): - for engine in json_data['engines']: - engine_path = pathlib.Path(engine['path']).resolve() - engine_json = engine_path / 'engine.json' - with engine_json.open('r') as f: - try: - engine_json_data = json.load(f) - except Exception as e: - logger.warn(f'{engine_json} failed to load: {str(e)}') - else: - this_engines_name = engine_json_data['engine_name'] - if this_engines_name == engine_name: - return engine_path - - elif isinstance(project_name, str): - engine_object = find_engine_data(json_data) - projects = json_data['projects'].copy() - projects.extend(engine_object['projects']) - for project_path in projects: - project_path = pathlib.Path(project_path).resolve() - project_json = project_path / 'project.json' - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except Exception as e: - logger.warn(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): - engine_object = find_engine_data(json_data) - gems = json_data['gems'].copy() - gems.extend(engine_object['gems']) - for gem_path in gems: - gem_path = pathlib.Path(gem_path).resolve() - gem_json = gem_path / 'gem.json' - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except Exception as e: - logger.warn(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): - engine_object = find_engine_data(json_data) - templates = json_data['templates'].copy() - templates.extend(engine_object['templates']) - for template_path in templates: - template_path = pathlib.Path(template_path).resolve() - template_json = template_path / 'template.json' - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except Exception as e: - logger.warn(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): - engine_object = find_engine_data(json_data) - restricted = json_data['restricted'].copy() - restricted.extend(engine_object['restricted']) - for restricted_path in restricted: - restricted_path = pathlib.Path(restricted_path).resolve() - restricted_json = restricted_path / 'restricted.json' - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except Exception as e: - logger.warn(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': - default_engines_folder = pathlib.Path(json_data['default_engines_folder']).resolve() - return default_engines_folder - elif default_folder == 'projects': - default_projects_folder = pathlib.Path(json_data['default_projects_folder']).resolve() - return default_projects_folder - elif default_folder == 'gems': - default_gems_folder = pathlib.Path(json_data['default_gems_folder']).resolve() - return default_gems_folder - elif default_folder == 'templates': - default_templates_folder = pathlib.Path(json_data['default_templates_folder']).resolve() - return default_templates_folder - elif default_folder == 'restricted': - default_restricted_folder = pathlib.Path(json_data['default_restricted_folder']).resolve() - return default_restricted_folder - - elif isinstance(repo_name, str): - cache_folder = get_o3de_cache_folder() - for repo_uri in json_data['repos']: - 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: - try: - repo_json_data = json.load(f) - except Exception as e: - logger.warn(f'{cache_file} failed to load: {str(e)}') - else: - this_repos_name = repo_json_data['repo_name'] - if this_repos_name == repo_name: - return repo_uri - return None - - -def print_engines_data(engines_data: dict) -> None: - print('\n') - print("Engines================================================") - for engine_object in engines_data: - # if it's not local it should be in the cache - engine_uri = engine_object['path'] - parsed_uri = urllib.parse.urlparse(engine_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - repo_sha256 = hashlib.sha256(engine_uri.encode()) - cache_folder = get_o3de_cache_folder() - engine = cache_folder / str(repo_sha256.hexdigest() + '.json') - print(f'{engine_uri}/engine.json cached as:') - else: - engine_json = pathlib.Path(engine_uri).resolve() / 'engine.json' - - with engine_json.open('r') as f: - try: - engine_json_data = json.load(f) - except Exception as e: - logger.warn(f'{engine_json} failed to load: {str(e)}') - else: - print(engine_json) - print(json.dumps(engine_json_data, indent=4)) - print('\n') - - -def print_projects_data(projects_data: dict) -> None: - print('\n') - print("Projects================================================") - for project_uri in projects_data: - # if it's not local it should be in the cache - parsed_uri = urllib.parse.urlparse(project_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - repo_sha256 = hashlib.sha256(project_uri.encode()) - cache_folder = get_o3de_cache_folder() - project_json = cache_folder / str(repo_sha256.hexdigest() + '.json') - else: - project_json = pathlib.Path(project_uri).resolve() / 'project.json' - - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except Exception as e: - logger.warn(f'{project_json} failed to load: {str(e)}') - else: - print(project_json) - print(json.dumps(project_json_data, indent=4)) - print('\n') - - -def print_gems_data(gems_data: dict) -> None: - print('\n') - print("Gems================================================") - for gem_uri in gems_data: - # if it's not local it should be in the cache - parsed_uri = urllib.parse.urlparse(gem_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - repo_sha256 = hashlib.sha256(gem_uri.encode()) - cache_folder = get_o3de_cache_folder() - gem_json = cache_folder / str(repo_sha256.hexdigest() + '.json') - else: - gem_json = pathlib.Path(gem_uri).resolve() / 'gem.json' - - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except Exception as e: - logger.warn(f'{gem_json} failed to load: {str(e)}') - else: - print(gem_json) - print(json.dumps(gem_json_data, indent=4)) - print('\n') - - -def print_templates_data(templates_data: dict) -> None: - print('\n') - print("Templates================================================") - for template_uri in templates_data: - # if it's not local it should be in the cache - parsed_uri = urllib.parse.urlparse(template_uri) - if parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - repo_sha256 = hashlib.sha256(template_uri.encode()) - cache_folder = get_o3de_cache_folder() - template_json = cache_folder / str(repo_sha256.hexdigest() + '.json') - else: - template_json = pathlib.Path(template_uri).resolve() / 'template.json' - - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except Exception as e: - logger.warn(f'{template_json} failed to load: {str(e)}') - else: - print(template_json) - print(json.dumps(template_json_data, indent=4)) - print('\n') - - -def print_repos_data(repos_data: dict) -> None: - print('\n') - print("Repos================================================") - cache_folder = get_o3de_cache_folder() - for repo_uri in repos_data: - repo_sha256 = hashlib.sha256(repo_uri.encode()) - cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') - if valid_o3de_repo_json(cache_file): - with cache_file.open('r') as s: - try: - repo_json_data = json.load(s) - except Exception as e: - logger.warn(f'{cache_file} failed to load: {str(e)}') - else: - print(f'{repo_uri}/repo.json cached as:') - print(cache_file) - print(json.dumps(repo_json_data, indent=4)) - print('\n') - - -def print_restricted_data(restricted_data: dict) -> None: - print('\n') - print("Restricted================================================") - for restricted_path in restricted_data: - restricted_json = pathlib.Path(restricted_path).resolve() / 'restricted.json' - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except Exception as e: - logger.warn(f'{restricted_json} failed to load: {str(e)}') - else: - print(restricted_json) - print(json.dumps(restricted_json_data, indent=4)) - print('\n') - - -def get_this_engine() -> dict: - json_data = load_o3de_manifest() - engine_data = find_engine_data(json_data) - return engine_data - - -def get_engines() -> dict: - json_data = load_o3de_manifest() - return json_data['engines'] - - -def get_projects() -> dict: - json_data = load_o3de_manifest() - return json_data['projects'] - - -def get_gems() -> dict: - json_data = load_o3de_manifest() - return json_data['gems'] - - -def get_templates() -> dict: - json_data = load_o3de_manifest() - return json_data['templates'] - - -def get_restricted() -> dict: - json_data = load_o3de_manifest() - return json_data['restricted'] - - -def get_repos() -> dict: - json_data = load_o3de_manifest() - return json_data['repos'] - - -def get_engine_projects() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - return engine_object['projects'] - - -def get_engine_gems() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - return engine_object['gems'] - - -def get_engine_templates() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - return engine_object['templates'] - - -def get_engine_restricted() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - return engine_object['restricted'] - - -def get_external_subdirectories() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - return engine_object['external_subdirectories'] - - -def get_all_projects() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - projects_data = json_data['projects'].copy() - projects_data.extend(engine_object['projects']) - return projects_data - - -def get_all_gems() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - gems_data = json_data['gems'].copy() - gems_data.extend(engine_object['gems']) - return gems_data - - -def get_all_templates() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - templates_data = json_data['templates'].copy() - templates_data.extend(engine_object['templates']) - return templates_data - - -def get_all_restricted() -> dict: - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data) - restricted_data = json_data['restricted'].copy() - restricted_data.extend(engine_object['restricted']) - return restricted_data - - -def print_this_engine(verbose: int) -> None: - engine_data = get_this_engine() - print(json.dumps(engine_data, indent=4)) - if verbose > 0: - print_engines_data(engine_data) - - -def print_engines(verbose: int) -> None: - engines_data = get_engines() - print(json.dumps(engines_data, indent=4)) - if verbose > 0: - print_engines_data(engines_data) - - -def print_projects(verbose: int) -> None: - projects_data = get_projects() - print(json.dumps(projects_data, indent=4)) - if verbose > 0: - print_projects_data(projects_data) - - -def print_gems(verbose: int) -> None: - gems_data = get_gems() - print(json.dumps(gems_data, indent=4)) - if verbose > 0: - print_gems_data(gems_data) - - -def print_templates(verbose: int) -> None: - templates_data = get_templates() - print(json.dumps(templates_data, indent=4)) - if verbose > 0: - print_templates_data(templates_data) - - -def print_restricted(verbose: int) -> None: - restricted_data = get_restricted() - print(json.dumps(restricted_data, indent=4)) - if verbose > 0: - print_restricted_data(restricted_data) - - -def register_show_repos(verbose: int) -> None: - repos_data = get_repos() - print(json.dumps(repos_data, indent=4)) - if verbose > 0: - print_repos_data(repos_data) - - -def print_engine_projects(verbose: int) -> None: - engine_projects_data = get_engine_projects() - print(json.dumps(engine_projects_data, indent=4)) - if verbose > 0: - print_projects_data(engine_projects_data) - - -def print_engine_gems(verbose: int) -> None: - engine_gems_data = get_engine_gems() - print(json.dumps(engine_gems_data, indent=4)) - if verbose > 0: - print_gems_data(engine_gems_data) - - -def print_engine_templates(verbose: int) -> None: - engine_templates_data = get_engine_templates() - print(json.dumps(engine_templates_data, indent=4)) - if verbose > 0: - print_templates_data(engine_templates_data) - - -def print_engine_restricted(verbose: int) -> None: - engine_restricted_data = get_engine_restricted() - print(json.dumps(engine_restricted_data, indent=4)) - if verbose > 0: - print_restricted_data(engine_restricted_data) - - -def print_external_subdirectories(verbose: int) -> None: - external_subdirs_data = get_external_subdirectories() - print(json.dumps(external_subdirs_data, indent=4)) - - -def print_all_projects(verbose: int) -> None: - all_projects_data = get_all_projects() - print(json.dumps(all_projects_data, indent=4)) - if verbose > 0: - print_projects_data(all_projects_data) - - -def print_all_gems(verbose: int) -> None: - all_gems_data = get_all_gems() - print(json.dumps(all_gems_data, indent=4)) - if verbose > 0: - print_gems_data(all_gems_data) - - -def print_all_templates(verbose: int) -> None: - all_templates_data = get_all_templates() - print(json.dumps(all_templates_data, indent=4)) - if verbose > 0: - print_templates_data(all_templates_data) - - -def print_all_restricted(verbose: int) -> None: - all_restricted_data = get_all_restricted() - print(json.dumps(all_restricted_data, indent=4)) - if verbose > 0: - print_restricted_data(all_restricted_data) - - -def register_show(verbose: int) -> None: - json_data = load_o3de_manifest() - print(f"{get_o3de_manifest()}:") - print(json.dumps(json_data, indent=4)) - - if verbose > 0: - print_engines_data(get_engines()) - print_projects_data(get_all_projects()) - print_gems_data(get_gems()) - print_templates_data(get_all_templates()) - print_restricted_data(get_all_restricted()) - print_repos_data(get_repos()) - - -def find_engine_data(json_data: dict, - engine_path: str or pathlib.Path = None) -> dict or None: - if not engine_path: - engine_path = get_this_engine_path() - engine_path = pathlib.Path(engine_path).resolve() - - for engine_object in json_data['engines']: - engine_object_path = pathlib.Path(engine_object['path']).resolve() - if engine_path == engine_object_path: - return engine_object - - return None - - -def get_engine_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 1 - - if engine_name and not engine_path: - engine_path = get_registered(engine_name=engine_name) - - if not engine_path: - logger.error(f'Engine Path {engine_path} has not been registered.') - return 1 - - 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 1 - if not valid_o3de_engine_json(engine_json): - logger.error(f'Engine json {engine_json} is not valid.') - return 1 - - with engine_json.open('r') as f: - try: - engine_json_data = json.load(f) - except Exception as e: - logger.warn(f'{engine_json} failed to load: {str(e)}') - else: - return engine_json_data - - return None - - -def get_project_data(project_name: str = None, - project_path: str or pathlib.Path = None, ) -> dict or None: - if not project_name and not project_path: - logger.error('Must specify either a Project name or Project Path.') - return 1 - - if project_name and not project_path: - project_path = get_registered(project_name=project_name) - - if not project_path: - logger.error(f'Project Path {project_path} has not been registered.') - return 1 - - 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 1 - if not valid_o3de_project_json(project_json): - logger.error(f'Project json {project_json} is not valid.') - return 1 - - with project_json.open('r') as f: - try: - project_json_data = json.load(f) - except Exception as e: - logger.warn(f'{project_json} failed to load: {str(e)}') - else: - return project_json_data - - return None - - -def get_gem_data(gem_name: str = None, - gem_path: str or pathlib.Path = None, ) -> dict or None: - if not gem_name and not gem_path: - logger.error('Must specify either a Gem name or Gem Path.') - return 1 - - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - - if not gem_path: - logger.error(f'Gem Path {gem_path} has not been registered.') - return 1 - - 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 1 - if not valid_o3de_gem_json(gem_json): - logger.error(f'Gem json {gem_json} is not valid.') - return 1 - - with gem_json.open('r') as f: - try: - gem_json_data = json.load(f) - except Exception as e: - logger.warn(f'{gem_json} failed to load: {str(e)}') - else: - return gem_json_data - - return None - -def get_gems_metadata(): - gem_list = get_gems() + get_engine_gems() - gem_data_dict = {} - for gem in gem_list: - json_path = os.path.join(gem, 'gem.json') - if (os.path.exists(json_path)): - with open(json_path, 'r') as gem_json: - parsed_meta_data = json.loads(gem_json.read()) - gem_data_dict[str(parsed_meta_data['gem_name'])] = parsed_meta_data - else: - logger.error(f'Gem json {gem_json} is not present.') - json_result = json.dumps(gem_data_dict, indent = 4) - return json_result - -def get_template_data(template_name: str = None, - template_path: str or pathlib.Path = None, ) -> dict or None: - if not template_name and not template_path: - logger.error('Must specify either a Template name or Template Path.') - return 1 - - if template_name and not template_path: - template_path = get_registered(template_name=template_name) - - if not template_path: - logger.error(f'Template Path {template_path} has not been registered.') - return 1 - - 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 1 - if not valid_o3de_template_json(template_json): - logger.error(f'Template json {template_json} is not valid.') - return 1 - - with template_json.open('r') as f: - try: - template_json_data = json.load(f) - except Exception as e: - logger.warn(f'{template_json} failed to load: {str(e)}') - else: - return template_json_data - - return None - - -def get_restricted_data(restricted_name: str = None, - restricted_path: str or pathlib.Path = None, ) -> dict or None: - if not restricted_name and not restricted_path: - logger.error('Must specify either a Restricted name or Restricted Path.') - return 1 - - if restricted_name and not restricted_path: - restricted_path = get_registered(restricted_name=restricted_name) - - if not restricted_path: - logger.error(f'Restricted Path {restricted_path} has not been registered.') - return 1 - - 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 1 - if not valid_o3de_restricted_json(restricted_json): - logger.error(f'Restricted json {restricted_json} is not valid.') - return 1 - - with restricted_json.open('r') as f: - try: - restricted_json_data = json.load(f) - except Exception as e: - logger.warn(f'{restricted_json} failed to load: {str(e)}') - else: - return restricted_json_data - - return None - - -def get_downloadables() -> dict: - json_data = load_o3de_manifest() - downloadable_data = {} - downloadable_data.update({'engines': []}) - downloadable_data.update({'projects': []}) - downloadable_data.update({'gems': []}) - downloadable_data.update({'templates': []}) - downloadable_data.update({'restricted': []}) - - def recurse_downloadables(repo_uri: str or pathlib.Path) -> None: - cache_folder = get_o3de_cache_folder() - repo_sha256 = hashlib.sha256(repo_uri.encode()) - cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') - if valid_o3de_repo_json(cache_file): - with cache_file.open('r') as s: - try: - repo_json_data = json.load(s) - except Exception as e: - logger.warn(f'{cache_file} failed to load: {str(e)}') - else: - for engine in repo_json_data['engines']: - if engine not in downloadable_data['engines']: - downloadable_data['engines'].append(engine) - - for project in repo_json_data['projects']: - if project not in downloadable_data['projects']: - downloadable_data['projects'].append(project) - - for gem in repo_json_data['gems']: - if gem not in downloadable_data['gems']: - downloadable_data['gems'].append(gem) - - for template in repo_json_data['templates']: - if template not in downloadable_data['templates']: - downloadable_data['templates'].append(template) - - for restricted in repo_json_data['restricted']: - if restricted not in downloadable_data['restricted']: - downloadable_data['restricted'].append(restricted) - - for repo in repo_json_data['repos']: - if repo not in downloadable_data['repos']: - downloadable_data['repos'].append(repo) - - for repo in downloadable_data['repos']: - recurse_downloadables(repo) - - for repo_entry in json_data['repos']: - recurse_downloadables(repo_entry) - return downloadable_data - - -def get_downloadable_engines() -> dict: - downloadable_data = get_downloadables() - return downloadable_data['engines'] - - -def get_downloadable_projects() -> dict: - downloadable_data = get_downloadables() - return downloadable_data['projects'] - - -def get_downloadable_gems() -> dict: - downloadable_data = get_downloadables() - return downloadable_data['gems'] - - -def get_downloadable_templates() -> dict: - downloadable_data = get_downloadables() - return downloadable_data['templates'] - - -def get_downloadable_restricted() -> dict: - downloadable_data = get_downloadables() - return downloadable_data['restricted'] - - -def print_downloadable_engines(verbose: int) -> None: - downloadable_engines = get_downloadable_engines() - for engine_data in downloadable_engines: - print(json.dumps(engine_data, indent=4)) - if verbose > 0: - print_engines_data(downloadable_engines) - - -def print_downloadable_projects(verbose: int) -> None: - downloadable_projects = get_downloadable_projects() - for projects_data in downloadable_projects: - print(json.dumps(projects_data, indent=4)) - if verbose > 0: - print_projects_data(downloadable_projects) - - -def print_downloadable_gems(verbose: int) -> None: - downloadable_gems = get_downloadable_gems() - for gem_data in downloadable_gems: - print(json.dumps(gem_data, indent=4)) - if verbose > 0: - print_gems_data(downloadable_gems) - - -def print_downloadable_templates(verbose: int) -> None: - downloadable_templates = get_downloadable_templates() - for template_data in downloadable_templates: - print(json.dumps(template_data, indent=4)) - if verbose > 0: - print_engines_data(downloadable_templates) - - -def print_downloadable_restricted(verbose: int) -> None: - downloadable_restricted = get_downloadable_restricted() - for restricted_data in downloadable_restricted: - print(json.dumps(restricted_data, indent=4)) - if verbose > 0: - print_engines_data(downloadable_restricted) - - -def print_downloadables(verbose: int) -> None: - downloadable_data = get_downloadables() - print(json.dumps(downloadable_data, indent=4)) - if verbose > 0: - print_engines_data(downloadable_data['engines']) - print_projects_data(downloadable_data['projects']) - print_gems_data(downloadable_data['gems']) - print_templates_data(downloadable_data['templates']) - print_restricted_data(downloadable_data['templates']) - -def print_gems_metadata(verbose: int) -> None: - gems_data = get_gems_metadata() - print(gems_data) - if verbose > 0: - gem_list = get_gems() + get_engine_gems() - print(gem_list) - -def download_engine(engine_name: str, - dest_path: str) -> int: - if not dest_path: - dest_path = get_registered(default_folder='engines') - if not dest_path: - logger.error(f'Destination path not cannot be empty.') - return 1 - - dest_path = pathlib.Path(dest_path).resolve() - dest_path.mkdir(exist_ok=True) - - download_path = get_o3de_download_folder() / 'engines' / engine_name - download_path.mkdir(exist_ok=True) - download_zip_path = download_path / 'engine.zip' - - downloadable_engine_data = get_downloadable(engine_name=engine_name) - if not downloadable_engine_data: - logger.error(f'Downloadable engine {engine_name} not found.') - return 1 - - origin = downloadable_engine_data['origin'] - url = f'{origin}/project.zip' - parsed_uri = urllib.parse.urlparse(url) - - if download_zip_path.is_file(): - logger.warn(f'Project already downloaded to {download_zip_path}.') - elif parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(url) as s: - with download_zip_path.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, download_zip_path) - - if not zipfile.is_zipfile(download_zip_path): - logger.error(f"Engine zip {download_zip_path} is invalid.") - download_zip_path.unlink() - return 1 - - # if the engine.json has a sha256 check it against a sha256 of the zip - try: - sha256A = downloadable_engine_data['sha256'] - except Exception as e: - logger.warn(f'SECURITY WARNING: The advertised engine you downloaded has no "sha256"!!! Be VERY careful!!!' - f' We cannot verify this is the actually the advertised engine!!!') - else: - sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded engine.zip sha256 {sha256B} does not match' - f' the advertised "sha256":{sha256A} in the engine.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - dest_engine_folder = dest_path / engine_name - if dest_engine_folder.is_dir(): - backup_folder(dest_engine_folder) - with zipfile.ZipFile(download_zip_path, 'r') as project_zip: - try: - project_zip.extractall(dest_path) - except Exception as e: - logger.error(f'UnZip exception:{str(e)}') - shutil.rmtree(dest_path) - return 1 - - unzipped_engine_json = dest_engine_folder / 'engine.json' - if not unzipped_engine_json.is_file(): - logger.error(f'Engine json {unzipped_engine_json} is missing.') - return 1 - - if not valid_o3de_engine_json(unzipped_engine_json): - logger.error(f'Engine json {unzipped_engine_json} is invalid.') - return 1 - - # remove the sha256 if present in the advertised downloadable engine.json - # then compare it to the engine.json in the zip, they should now be identical - try: - del downloadable_engine_data['sha256'] - except Exception as e: - pass - - sha256A = hashlib.sha256(json.dumps(downloadable_engine_data, indent=4).encode('utf8')).hexdigest() - with unzipped_engine_json.open('r') as s: - try: - unzipped_engine_json_data = json.load(s) - except Exception as e: - logger.error(f'Failed to read engine json {unzipped_engine_json}. Unable to confirm this' - f' is the same template that was advertised.') - return 1 - sha256B = hashlib.sha256(json.dumps(unzipped_engine_json_data, indent=4).encode('utf8')).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded engine.json does not match' - f' the advertised engine.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - return 0 - - -def download_project(project_name: str, - dest_path: str or pathlib.Path) -> int: - if not dest_path: - dest_path = get_registered(default_folder='projects') - if not dest_path: - logger.error(f'Destination path not specified and not default projects path.') - return 1 - - dest_path = pathlib.Path(dest_path).resolve() - dest_path.mkdir(exist_ok=True, parents=True) - - download_path = get_o3de_download_folder() / 'projects' / project_name - download_path.mkdir(exist_ok=True, parents=True) - download_zip_path = download_path / 'project.zip' - - downloadable_project_data = get_downloadable(project_name=project_name) - if not downloadable_project_data: - logger.error(f'Downloadable project {project_name} not found.') - return 1 - - origin = downloadable_project_data['origin'] - url = f'{origin}/project.zip' - parsed_uri = urllib.parse.urlparse(url) - - if download_zip_path.is_file(): - logger.warn(f'Project already downloaded to {download_zip_path}.') - elif parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(url) as s: - with download_zip_path.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, download_zip_path) - - if not zipfile.is_zipfile(download_zip_path): - logger.error(f"Project zip {download_zip_path} is invalid.") - download_zip_path.unlink() - return 1 - - # if the project.json has a sha256 check it against a sha256 of the zip - try: - sha256A = downloadable_project_data['sha256'] - except Exception as e: - logger.warn(f'SECURITY WARNING: The advertised project you downloaded has no "sha256"!!! Be VERY careful!!!' - f' We cannot verify this is the actually the advertised project!!!') - else: - sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded project.zip sha256 {sha256B} does not match' - f' the advertised "sha256":{sha256A} in the project.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - dest_project_folder = dest_path / project_name - if dest_project_folder.is_dir(): - backup_folder(dest_project_folder) - with zipfile.ZipFile(download_zip_path, 'r') as project_zip: - try: - project_zip.extractall(dest_project_folder) - except Exception as e: - logger.error(f'UnZip exception:{str(e)}') - shutil.rmtree(dest_path) - return 1 - - unzipped_project_json = dest_project_folder / 'project.json' - if not unzipped_project_json.is_file(): - logger.error(f'Project json {unzipped_project_json} is missing.') - return 1 - - if not valid_o3de_project_json(unzipped_project_json): - logger.error(f'Project json {unzipped_project_json} is invalid.') - return 1 - - # remove the sha256 if present in the advertised downloadable project.json - # then compare it to the project.json in the zip, they should now be identical - try: - del downloadable_project_data['sha256'] - except Exception as e: - pass - - sha256A = hashlib.sha256(json.dumps(downloadable_project_data, indent=4).encode('utf8')).hexdigest() - with unzipped_project_json.open('r') as s: - try: - unzipped_project_json_data = json.load(s) - except Exception as e: - logger.error(f'Failed to read Project json {unzipped_project_json}. Unable to confirm this' - f' is the same project that was advertised.') - return 1 - sha256B = hashlib.sha256(json.dumps(unzipped_project_json_data, indent=4).encode('utf8')).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded project.json does not match' - f' the advertised project.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - return 0 - - -def download_gem(gem_name: str, - dest_path: str or pathlib.Path) -> int: - if not dest_path: - dest_path = get_registered(default_folder='gems') - if not dest_path: - logger.error(f'Destination path not cannot be empty.') - return 1 - - dest_path = pathlib.Path(dest_path).resolve() - dest_path.mkdir(exist_ok=True, parents=True) - - download_path = get_o3de_download_folder() / 'gems' / gem_name - download_path.mkdir(exist_ok=True, parents=True) - download_zip_path = download_path / 'gem.zip' - - downloadable_gem_data = get_downloadable(gem_name=gem_name) - if not downloadable_gem_data: - logger.error(f'Downloadable gem {gem_name} not found.') - return 1 - - origin = downloadable_gem_data['origin'] - url = f'{origin}/gem.zip' - parsed_uri = urllib.parse.urlparse(url) - - if download_zip_path.is_file(): - logger.warn(f'Project already downloaded to {download_zip_path}.') - elif parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(url) as s: - with download_zip_path.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, download_zip_path) - - if not zipfile.is_zipfile(download_zip_path): - logger.error(f"Gem zip {download_zip_path} is invalid.") - download_zip_path.unlink() - return 1 - - # if the gem.json has a sha256 check it against a sha256 of the zip - try: - sha256A = downloadable_gem_data['sha256'] - except Exception as e: - logger.warn(f'SECURITY WARNING: The advertised gem you downloaded has no "sha256"!!! Be VERY careful!!!' - f' We cannot verify this is the actually the advertised gem!!!') - else: - sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded gem.zip sha256 {sha256B} does not match' - f' the advertised "sha256":{sha256A} in the gem.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - dest_gem_folder = dest_path / gem_name - if dest_gem_folder.is_dir(): - backup_folder(dest_gem_folder) - with zipfile.ZipFile(download_zip_path, 'r') as gem_zip: - try: - gem_zip.extractall(dest_path) - except Exception as e: - logger.error(f'UnZip exception:{str(e)}') - shutil.rmtree(dest_path) - return 1 - - unzipped_gem_json = dest_gem_folder / 'gem.json' - if not unzipped_gem_json.is_file(): - logger.error(f'Engine json {unzipped_gem_json} is missing.') - return 1 - - if not valid_o3de_engine_json(unzipped_gem_json): - logger.error(f'Engine json {unzipped_gem_json} is invalid.') - return 1 - - # remove the sha256 if present in the advertised downloadable gem.json - # then compare it to the gem.json in the zip, they should now be identical - try: - del downloadable_gem_data['sha256'] - except Exception as e: - pass - - sha256A = hashlib.sha256(json.dumps(downloadable_gem_data, indent=4).encode('utf8')).hexdigest() - with unzipped_gem_json.open('r') as s: - try: - unzipped_gem_json_data = json.load(s) - except Exception as e: - logger.error(f'Failed to read gem json {unzipped_gem_json}. Unable to confirm this' - f' is the same gem that was advertised.') - return 1 - sha256B = hashlib.sha256(json.dumps(unzipped_gem_json_data, indent=4).encode('utf8')).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded gem.json does not match' - f' the advertised gem.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - return 0 - - -def download_template(template_name: str, - dest_path: str or pathlib.Path) -> int: - if not dest_path: - dest_path = get_registered(default_folder='templates') - if not dest_path: - logger.error(f'Destination path not cannot be empty.') - return 1 - - dest_path = pathlib.Path(dest_path).resolve() - dest_path.mkdir(exist_ok=True, parents=True) - - download_path = get_o3de_download_folder() / 'templates' / template_name - download_path.mkdir(exist_ok=True, parents=True) - download_zip_path = download_path / 'template.zip' - - downloadable_template_data = get_downloadable(template_name=template_name) - if not downloadable_template_data: - logger.error(f'Downloadable template {template_name} not found.') - return 1 - - origin = downloadable_template_data['origin'] - url = f'{origin}/project.zip' - parsed_uri = urllib.parse.urlparse(url) - - result = 0 - - if download_zip_path.is_file(): - logger.warn(f'Project already downloaded to {download_zip_path}.') - elif parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(url) as s: - with download_zip_path.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, download_zip_path) - - if not zipfile.is_zipfile(download_zip_path): - logger.error(f"Template zip {download_zip_path} is invalid.") - download_zip_path.unlink() - return 1 - - # if the template.json has a sha256 check it against a sha256 of the zip - try: - sha256A = downloadable_template_data['sha256'] - except Exception as e: - logger.warn(f'SECURITY WARNING: The advertised template you downloaded has no "sha256"!!! Be VERY careful!!!' - f' We cannot verify this is the actually the advertised template!!!') - else: - sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded template.zip sha256 {sha256B} does not match' - f' the advertised "sha256":{sha256A} in the template.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - dest_template_folder = dest_path / template_name - if dest_template_folder.is_dir(): - backup_folder(dest_template_folder) - with zipfile.ZipFile(download_zip_path, 'r') as project_zip: - try: - project_zip.extractall(dest_path) - except Exception as e: - logger.error(f'UnZip exception:{str(e)}') - shutil.rmtree(dest_path) - return 1 - - unzipped_template_json = dest_template_folder / 'template.json' - if not unzipped_template_json.is_file(): - logger.error(f'Template json {unzipped_template_json} is missing.') - return 1 - - if not valid_o3de_engine_json(unzipped_template_json): - logger.error(f'Template json {unzipped_template_json} is invalid.') - return 1 - - # remove the sha256 if present in the advertised downloadable template.json - # then compare it to the template.json in the zip, they should now be identical - try: - del downloadable_template_data['sha256'] - except Exception as e: - pass - - sha256A = hashlib.sha256(json.dumps(downloadable_template_data, indent=4).encode('utf8')).hexdigest() - with unzipped_template_json.open('r') as s: - try: - unzipped_template_json_data = json.load(s) - except Exception as e: - logger.error(f'Failed to read Template json {unzipped_template_json}. Unable to confirm this' - f' is the same template that was advertised.') - return 1 - sha256B = hashlib.sha256(json.dumps(unzipped_template_json_data, indent=4).encode('utf8')).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded template.json does not match' - f' the advertised template.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - return 0 - - -def download_restricted(restricted_name: str, - dest_path: str or pathlib.Path) -> int: - if not dest_path: - dest_path = get_registered(default_folder='restricted') - if not dest_path: - logger.error(f'Destination path not cannot be empty.') - return 1 - - dest_path = pathlib.Path(dest_path).resolve() - dest_path.mkdir(exist_ok=True, parents=True) - - download_path = get_o3de_download_folder() / 'restricted' / restricted_name - download_path.mkdir(exist_ok=True, parents=True) - download_zip_path = download_path / 'restricted.zip' - - downloadable_restricted_data = get_downloadable(restricted_name=restricted_name) - if not downloadable_restricted_data: - logger.error(f'Downloadable Restricted {restricted_name} not found.') - return 1 - - origin = downloadable_restricted_data['origin'] - url = f'{origin}/restricted.zip' - parsed_uri = urllib.parse.urlparse(url) - - if download_zip_path.is_file(): - logger.warn(f'Restricted already downloaded to {download_zip_path}.') - elif parsed_uri.scheme == 'http' or \ - parsed_uri.scheme == 'https' or \ - parsed_uri.scheme == 'ftp' or \ - parsed_uri.scheme == 'ftps': - with urllib.request.urlopen(url) as s: - with download_zip_path.open('wb') as f: - shutil.copyfileobj(s, f) - else: - origin_file = pathlib.Path(url).resolve() - if not origin_file.is_file(): - return 1 - shutil.copy(origin_file, download_zip_path) - - if not zipfile.is_zipfile(download_zip_path): - logger.error(f"Restricted zip {download_zip_path} is invalid.") - download_zip_path.unlink() - return 1 - - # if the restricted.json has a sha256 check it against a sha256 of the zip - try: - sha256A = downloadable_restricted_data['sha256'] - except Exception as e: - logger.warn(f'SECURITY WARNING: The advertised restricted you downloaded has no "sha256"!!! Be VERY careful!!!' - f' We cannot verify this is the actually the advertised restricted!!!') - else: - sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded restricted.zip sha256 {sha256B} does not match' - f' the advertised "sha256":{sha256A} in the restricted.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - dest_restricted_folder = dest_path / restricted_name - if dest_restricted_folder.is_dir(): - backup_folder(dest_restricted_folder) - with zipfile.ZipFile(download_zip_path, 'r') as project_zip: - try: - project_zip.extractall(dest_path) - except Exception as e: - logger.error(f'UnZip exception:{str(e)}') - shutil.rmtree(dest_path) - return 1 - - unzipped_restricted_json = dest_restricted_folder / 'restricted.json' - if not unzipped_restricted_json.is_file(): - logger.error(f'Restricted json {unzipped_restricted_json} is missing.') - return 1 - - if not valid_o3de_engine_json(unzipped_restricted_json): - logger.error(f'Restricted json {unzipped_restricted_json} is invalid.') - return 1 - - # remove the sha256 if present in the advertised downloadable restricted.json - # then compare it to the restricted.json in the zip, they should now be identical - try: - del downloadable_restricted_data['sha256'] - except Exception as e: - pass - - sha256A = hashlib.sha256(json.dumps(downloadable_restricted_data, indent=4).encode('utf8')).hexdigest() - with unzipped_restricted_json.open('r') as s: - try: - unzipped_restricted_json_data = json.load(s) - except Exception as e: - logger.error( - f'Failed to read Restricted json {unzipped_restricted_json}. Unable to confirm this' - f' is the same restricted that was advertised.') - return 1 - sha256B = hashlib.sha256( - json.dumps(unzipped_restricted_json_data, indent=4).encode('utf8')).hexdigest() - if sha256A != sha256B: - logger.error(f'SECURITY VIOLATION: Downloaded restricted.json does not match' - f' the advertised restricted.json. Deleting unzipped files!!!') - shutil.rmtree(dest_path) - return 1 - - return 0 - - -def add_gem_dependency(cmake_file: str or pathlib.Path, - gem_target: str) -> int: - """ - adds a gem dependency to a cmake file - :param cmake_file: path to the cmake file - :param gem_target: name of the cmake target - :return: 0 for success or non 0 failure code - """ - if not os.path.isfile(cmake_file): - logger.error(f'Failed to locate cmake file {cmake_file}') - return 1 - - # on a line by basis, see if there already is Gem::{gem_name} - # find the first occurrence of a gem, copy its formatting and replace - # the gem name with the new one and append it - # if the gem is already present fail - t_data = [] - added = False - with open(cmake_file, 'r') as s: - for line in s: - if f'Gem::{gem_target}' in line: - logger.warning(f'{gem_target} is already a gem dependency.') - return 0 - if not added and r'Gem::' in line: - new_gem = ' ' * line.find(r'Gem::') + f'Gem::{gem_target}\n' - t_data.append(new_gem) - added = True - t_data.append(line) - - # if we didn't add it the set gem dependencies could be empty so - # add a new gem, if empty the correct format is 1 tab=4spaces - if not added: - index = 0 - for line in t_data: - index = index + 1 - if r'set(GEM_DEPENDENCIES' in line: - t_data.insert(index, f' Gem::{gem_target}\n') - added = True - break - - # if we didn't add it then it's not here, add a whole new one - if not added: - t_data.append('\n') - t_data.append('set(GEM_DEPENDENCIES\n') - t_data.append(f' Gem::{gem_target}\n') - t_data.append(')\n') - - # write the cmake - os.unlink(cmake_file) - with open(cmake_file, 'w') as s: - s.writelines(t_data) - - return 0 - - -def get_project_runtime_gem_targets(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)) - - -def get_project_tool_gem_targets(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)) - - -def get_project_server_gem_targets(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)) - - -def get_project_gem_targets(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - runtime_gems = get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)) - tool_gems = get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)) - server_gems = get_gem_targets_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)) - return runtime_gems.union(tool_gems.union(server_gems)) - - -def get_gem_targets_from_cmake_file(cmake_file: str or pathlib.Path) -> set: - """ - Gets a list of declared gem targets dependencies of a cmake file - :param cmake_file: path to the cmake file - :return: set of gem targets found - """ - cmake_file = pathlib.Path(cmake_file).resolve() - - if not cmake_file.is_file(): - logger.error(f'Failed to locate cmake file {cmake_file}') - return set() - - gem_target_set = set() - with cmake_file.open('r') as s: - for line in s: - gem_name = line.split('Gem::') - if len(gem_name) > 1: - # Only take the name as everything leading up to the first '.' if found - # Gem naming conventions will have GemName.Editor, GemName.Server, and GemName - # as different targets of the GemName Gem - gem_target_set.add(gem_name[1].replace('\n', '')) - return gem_target_set - - -def get_project_runtime_gem_names(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)) - - -def get_project_tool_gem_names(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)) - - -def get_project_server_gem_names(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - return get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)) - - -def get_project_gem_names(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - runtime_gem_names = get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)) - tool_gem_names = get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)) - server_gem_names = get_gem_names_from_cmake_file(get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)) - return runtime_gem_names.union(tool_gem_names.union(server_gem_names)) - - -def get_gem_names_from_cmake_file(cmake_file: str or pathlib.Path) -> set: - """ - Gets a list of declared gem dependencies of a cmake file - :param cmake_file: path to the cmake file - :return: set of gems found - """ - cmake_file = pathlib.Path(cmake_file).resolve() - - if not cmake_file.is_file(): - logger.error(f'Failed to locate cmake file {cmake_file}') - return set() - - gem_set = set() - with cmake_file.open('r') as s: - for line in s: - gem_name = line.split('Gem::') - if len(gem_name) > 1: - # Only take the name as everything leading up to the first '.' if found - # Gem naming conventions will have GemName.Editor, GemName.Server, and GemName - # as different targets of the GemName Gem - gem_set.add(gem_name[1].split('.')[0].replace('\n', '')) - return gem_set - - -def get_project_runtime_gem_paths(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - gem_names = get_project_runtime_gem_names(project_path, platform) - gem_paths = set() - for gem_name in gem_names: - gem_paths.add(get_registered(gem_name=gem_name)) - return gem_paths - - -def get_project_tool_gem_paths(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - gem_names = get_project_tool_gem_names(project_path, platform) - gem_paths = set() - for gem_name in gem_names: - gem_paths.add(get_registered(gem_name=gem_name)) - return gem_paths - - -def get_project_server_gem_paths(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - gem_names = get_project_server_gem_names(project_path, platform) - gem_paths = set() - for gem_name in gem_names: - gem_paths.add(get_registered(gem_name=gem_name)) - return gem_paths - - -def get_project_gem_paths(project_path: str or pathlib.Path, - platform: str = 'Common') -> set: - gem_names = get_project_gem_names(project_path, platform) - gem_paths = set() - for gem_name in gem_names: - gem_paths.add(get_registered(gem_name=gem_name)) - return gem_paths - - -def remove_gem_dependency(cmake_file: str or pathlib.Path, - gem_target: str) -> int: - """ - removes a gem dependency from a cmake file - :param cmake_file: path to the cmake file - :param gem_target: cmake target name - :return: 0 for success or non 0 failure code - """ - if not os.path.isfile(cmake_file): - logger.error(f'Failed to locate cmake file {cmake_file}') - return 1 - - # on a line by basis, remove any line with Gem::{gem_name} - t_data = [] - # Remove the gem from the cmake_dependencies file by skipping the gem name entry - removed = False - with open(cmake_file, 'r') as s: - for line in s: - if f'Gem::{gem_target}' in line: - removed = True - else: - t_data.append(line) - - if not removed: - logger.error(f'Failed to remove Gem::{gem_target} from cmake file {cmake_file}') - return 1 - - # write the cmake - os.unlink(cmake_file) - with open(cmake_file, 'w') as s: - s.writelines(t_data) - - return 0 - - -def get_project_templates(): # temporary until we have a better way to do this... maybe template_type element - project_templates = [] - for template in get_all_templates(): - if 'Project' in template: - project_templates.append(template) - return project_templates - - -def get_gem_templates(): # temporary until we have a better way to do this... maybe template_type element - gem_templates = [] - for template in get_all_templates(): - if 'Gem' in template: - gem_templates.append(template) - return gem_templates - - -def get_generic_templates(): # temporary until we have a better way to do this... maybe template_type element - generic_templates = [] - for template in get_all_templates(): - if 'Project' not in template and 'Gem' not in template: - generic_templates.append(template) - return generic_templates - - -def get_dependencies_cmake_file(project_name: str = None, - project_path: str or pathlib.Path = None, - dependency_type: str = 'runtime', - platform: str = 'Common') -> str or None: - """ - get the standard cmake file name for a particular type of dependency - :param gem_name: name of the gem, resolves gem_path - :param gem_path: path of the gem - :return: list of gem targets - """ - if not project_name and not project_path: - logger.error(f'Must supply either a Project Name or Project Path.') - return None - - if project_name and not project_path: - project_path = get_registered(project_name=project_name) - - project_path = pathlib.Path(project_path).resolve() - - if platform == 'Common': - dependencies_file = f'{dependency_type}_dependencies.cmake' - dependencies_file_path = project_path / 'Gem/Code' / dependencies_file - if dependencies_file_path.is_file(): - return dependencies_file_path - return project_path / 'Code' / dependencies_file - else: - dependencies_file = f'{platform.lower()}_{dependency_type}_dependencies.cmake' - dependencies_file_path = project_path / 'Gem/Code/Platform' / platform / dependencies_file - if dependencies_file_path.is_file(): - return dependencies_file_path - return project_path / 'Code/Platform' / platform / dependencies_file - - -def get_all_gem_targets() -> list: - modules = [] - for gem_path in get_all_gems(): - this_gems_targets = get_gem_targets(gem_path=gem_path) - modules.extend(this_gems_targets) - return modules - - -def get_gem_targets(gem_name: str = None, - gem_path: str or pathlib.Path = None) -> list: - """ - Finds gem targets in a gem - :param gem_name: name of the gem, resolves gem_path - :param gem_path: path of the gem - :return: list of gem targets - """ - if not gem_name and not gem_path: - return [] - - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - - if not gem_path: - return [] - - gem_path = pathlib.Path(gem_path).resolve() - gem_json = gem_path / 'gem.json' - if not valid_o3de_gem_json(gem_json): - return [] - - module_identifiers = [ - 'MODULE', - 'GEM_MODULE', - '${PAL_TRAIT_MONOLITHIC_DRIVEN_MODULE_TYPE}' - ] - modules = [] - for root, dirs, files in os.walk(gem_path): - for file in files: - if file == 'CMakeLists.txt': - with open(os.path.join(root, file), 'r') as s: - for line in s: - trimmed = line.lstrip() - if trimmed.startswith('NAME '): - trimmed = trimmed.rstrip(' \n') - split_trimmed = trimmed.split(' ') - if len(split_trimmed) == 3 and split_trimmed[2] in module_identifiers: - modules.append(split_trimmed[1]) - return modules - - -def add_external_subdirectory(external_subdir: str or pathlib.Path, - engine_path: str or pathlib.Path = None, - supress_errors: bool = False) -> int: - """ - add external subdirectory to a cmake - :param external_subdir: external subdirectory to add to cmake - :param engine_path: optional engine path, defaults to this engine - :param supress_errors: optional silence errors - :return: 0 for success or non 0 failure code - """ - external_subdir = pathlib.Path(external_subdir).resolve() - if not external_subdir.is_dir(): - if not supress_errors: - logger.error(f'Add External Subdirectory Failed: {external_subdir} does not exist.') - return 1 - - external_subdir_cmake = external_subdir / 'CMakeLists.txt' - if not external_subdir_cmake.is_file(): - if not supress_errors: - logger.error(f'Add External Subdirectory Failed: {external_subdir} does not contain a CMakeLists.txt.') - return 1 - - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data, engine_path) - if not engine_object: - if not supress_errors: - logger.error(f'Add External Subdirectory Failed: {engine_path} not registered.') - return 1 - - while external_subdir.as_posix() in engine_object['external_subdirectories']: - engine_object['external_subdirectories'].remove(external_subdir.as_posix()) - - def parse_cmake_file(cmake: str or pathlib.Path, - files: set()): - cmake_path = pathlib.Path(cmake).resolve() - cmake_file = cmake_path - if cmake_path.is_dir(): - files.add(cmake_path) - cmake_file = cmake_path / 'CMakeLists.txt' - elif cmake_path.is_file(): - cmake_path = cmake_path.parent - else: - return - - with cmake_file.open('r') as s: - lines = s.readlines() - for line in lines: - line = line.strip() - start = line.find('include(') - if start == 0: - end = line.find(')', start) - if end > start + len('include('): - try: - include_cmake_file = pathlib.Path(engine_path / line[start + len('include('): end]).resolve() - except Exception as e: - pass - else: - parse_cmake_file(include_cmake_file, files) - else: - start = line.find('add_subdirectory(') - if start == 0: - end = line.find(')', start) - if end > start + len('add_subdirectory('): - try: - include_cmake_file = pathlib.Path( - cmake_path / line[start + len('add_subdirectory('): end]).resolve() - except Exception as e: - pass - else: - parse_cmake_file(include_cmake_file, files) - - cmake_files = set() - parse_cmake_file(engine_path, cmake_files) - for external in engine_object["external_subdirectories"]: - parse_cmake_file(external, cmake_files) - - if external_subdir in cmake_files: - save_o3de_manifest(json_data) - if not supress_errors: - logger.error(f'External subdirectory {external_subdir.as_posix()} already included by add_subdirectory().') - return 1 - - engine_object['external_subdirectories'].insert(0, external_subdir.as_posix()) - engine_object['external_subdirectories'] = sorted(engine_object['external_subdirectories']) - - save_o3de_manifest(json_data) - - return 0 - - -def remove_external_subdirectory(external_subdir: str or pathlib.Path, - engine_path: str or pathlib.Path = None) -> int: - """ - remove external subdirectory from cmake - :param external_subdir: external subdirectory to add to cmake - :param engine_path: optional engine path, defaults to this engine - :return: 0 for success or non 0 failure code - """ - json_data = load_o3de_manifest() - engine_object = find_engine_data(json_data, engine_path) - if not engine_object: - logger.error(f'Remove External Subdirectory Failed: {engine_path} not registered.') - return 1 - - external_subdir = pathlib.Path(external_subdir).resolve() - while external_subdir.as_posix() in engine_object['external_subdirectories']: - engine_object['external_subdirectories'].remove(external_subdir.as_posix()) - - save_o3de_manifest(json_data) - - return 0 - - -def add_gem_to_cmake(gem_name: str = None, - gem_path: str or pathlib.Path = None, - engine_name: str = None, - engine_path: str or pathlib.Path = None, - supress_errors: bool = False) -> int: - """ - add a gem to a cmake as an external subdirectory for an engine - :param gem_name: name of the gem to add to cmake - :param gem_path: the path of the gem to add to cmake - :param engine_name: name of the engine to add to cmake - :param engine_path: the path of the engine to add external subdirectory to, default to this engine - :param supress_errors: optional silence errors - :return: 0 for success or non 0 failure code - """ - if not gem_name and not gem_path: - if not supress_errors: - logger.error('Must specify either a Gem name or Gem Path.') - return 1 - - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - - if not gem_path: - if not supress_errors: - logger.error(f'Gem Path {gem_path} has not been registered.') - return 1 - - gem_path = pathlib.Path(gem_path).resolve() - gem_json = gem_path / 'gem.json' - if not gem_json.is_file(): - if not supress_errors: - logger.error(f'Gem json {gem_json} is not present.') - return 1 - if not valid_o3de_gem_json(gem_json): - if not supress_errors: - logger.error(f'Gem json {gem_json} is not valid.') - return 1 - - if not engine_name and not engine_path: - engine_path = get_this_engine_path() - - if engine_name and not engine_path: - engine_path = get_registered(engine_name=engine_name) - - if not engine_path: - if not supress_errors: - logger.error(f'Engine Path {engine_path} has not been registered.') - return 1 - - engine_json = engine_path / 'engine.json' - if not engine_json.is_file(): - if not supress_errors: - logger.error(f'Engine json {engine_json} is not present.') - return 1 - if not valid_o3de_engine_json(engine_json): - if not supress_errors: - logger.error(f'Engine json {engine_json} is not valid.') - return 1 - - return add_external_subdirectory(external_subdir=gem_path, engine_path=engine_path, supress_errors=supress_errors) - - -def remove_gem_from_cmake(gem_name: str = None, - gem_path: str or pathlib.Path = None, - engine_name: str = None, - engine_path: str or pathlib.Path = None) -> int: - """ - remove a gem to cmake as an external subdirectory - :param gem_name: name of the gem to remove from cmake - :param gem_path: the path of the gem to add to cmake - :param engine_name: optional name of the engine to remove from cmake - :param engine_path: the path of the engine to remove external subdirectory from, defaults to this engine - :return: 0 for success or non 0 failure code - """ - if not gem_name and not gem_path: - logger.error('Must specify either a Gem name or Gem Path.') - return 1 - - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - - if not gem_path: - logger.error(f'Gem Path {gem_path} has not been registered.') - return 1 - - if not engine_name and not engine_path: - engine_path = get_this_engine_path() - - if engine_name and not engine_path: - engine_path = get_registered(engine_name=engine_name) - - if not engine_path: - logger.error(f'Engine Path {engine_path} is not registered.') - return 1 - - return remove_external_subdirectory(external_subdir=gem_path, engine_path=engine_path) - - -def add_gem_to_project(gem_name: str = None, - gem_path: str or pathlib.Path = None, - gem_target: str = None, - project_name: str = None, - project_path: str or pathlib.Path = None, - dependencies_file: str or pathlib.Path = None, - runtime_dependency: bool = False, - tool_dependency: bool = False, - server_dependency: bool = False, - platforms: str = 'Common', - add_to_cmake: bool = True) -> int: - """ - add a gem to a project - :param gem_name: name of the gem to add - :param gem_path: path to the gem to add - :param gem_target: the name of the cmake gem module - :param project_name: name of to the project to add the gem to - :param project_path: path to the project to add the gem to - :param dependencies_file: if this dependency goes/is in a specific file - :param runtime_dependency: bool to specify this is a runtime gem for the game - :param tool_dependency: bool to specify this is a tool gem for the editor - :param server_dependency: bool to specify this is a server gem for the server - :param platforms: str to specify common or which specific platforms - :param add_to_cmake: bool to specify that this gem should be added to cmake - :return: 0 for success or non 0 failure code - """ - # we need either a project name or path - if not project_name and not project_path: - logger.error(f'Must either specify a Project path or Project Name.') - return 1 - - # if project name resolve it into a path - if project_name and not project_path: - project_path = get_registered(project_name=project_name) - project_path = pathlib.Path(project_path).resolve() - if not project_path.is_dir(): - logger.error(f'Project path {project_path} is not a folder.') - return 1 - - # get the engine name this project is associated with - # and resolve that engines path - project_json = project_path / 'project.json' - if not valid_o3de_project_json(project_json): - logger.error(f'Project json {project_json} is not valid.') - return 1 - with project_json.open('r') as s: - try: - project_json_data = json.load(s) - except Exception as e: - logger.error(f'Error loading Project json {project_json}: {str(e)}') - return 1 - else: - try: - engine_name = project_json_data['engine'] - except Exception as e: - logger.error(f'Project json {project_json} "engine" not found: {str(e)}') - return 1 - else: - engine_path = get_registered(engine_name=engine_name) - if not engine_path: - logger.error(f'Engine {engine_name} is not registered.') - return 1 - - # we need either a gem name or path - if not gem_name and not gem_path: - logger.error(f'Must either specify a Gem path or Gem Name.') - return 1 - - # if gem name resolve it into a path - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - gem_path = pathlib.Path(gem_path).resolve() - # make sure this gem already exists if we're adding. We can always remove a gem. - if not gem_path.is_dir(): - logger.error(f'Gem Path {gem_path} does not exist.') - return 1 - - # if add to cmake, make sure the gem.json exists and valid before we proceed - if add_to_cmake: - gem_json = gem_path / 'gem.json' - if not gem_json.is_file(): - logger.error(f'Gem json {gem_json} is not present.') - return 1 - if not valid_o3de_gem_json(gem_json): - logger.error(f'Gem json {gem_json} is not valid.') - return 1 - - # find all available modules in this gem_path - modules = get_gem_targets(gem_path=gem_path) - if len(modules) == 0: - logger.error(f'No gem modules found under {gem_path}.') - return 1 - - # if the gem has no modules and the user has specified a target fail - if gem_target and not modules: - logger.error(f'Gem has no targets, but gem target {gem_target} was specified.') - return 1 - - # if the gem target is not in the modules - if gem_target not in modules: - logger.error(f'Gem target not in gem modules: {modules}') - return 1 - - if gem_target: - # if the user has not specified either we will assume they meant the most common which is runtime - if not runtime_dependency and not tool_dependency and not server_dependency and not dependencies_file: - logger.warning("Dependency type not specified: Assuming '--runtime-dependency'") - runtime_dependency = True - - ret_val = 0 - - # if the user has specified the dependencies file then ignore the runtime_dependency and tool_dependency flags - if dependencies_file: - dependencies_file = pathlib.Path(dependencies_file).resolve() - # make sure this is a project has a dependencies_file - if not dependencies_file.is_file(): - logger.error(f'Dependencies file {dependencies_file} is not present.') - return 1 - # add the dependency - ret_val = add_gem_dependency(dependencies_file, gem_target) - - else: - if ',' in platforms: - platforms = platforms.split(',') - else: - platforms = [platforms] - for platform in platforms: - if runtime_dependency: - # make sure this is a project has a runtime_dependencies.cmake file - project_runtime_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)).resolve() - if not project_runtime_dependencies_file.is_file(): - logger.error(f'Runtime dependencies file {project_runtime_dependencies_file} is not present.') - return 1 - # add the dependency - ret_val = add_gem_dependency(project_runtime_dependencies_file, gem_target) - - if (ret_val == 0) and tool_dependency: - # make sure this is a project has a tool_dependencies.cmake file - project_tool_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)).resolve() - if not project_tool_dependencies_file.is_file(): - logger.error(f'Tool dependencies file {project_tool_dependencies_file} is not present.') - return 1 - # add the dependency - ret_val = add_gem_dependency(project_tool_dependencies_file, gem_target) - - if (ret_val == 0) and server_dependency: - # make sure this is a project has a tool_dependencies.cmake file - project_server_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)).resolve() - if not project_server_dependencies_file.is_file(): - logger.error(f'Server dependencies file {project_server_dependencies_file} is not present.') - return 1 - # add the dependency - ret_val = add_gem_dependency(project_server_dependencies_file, gem_target) - - if not ret_val and add_to_cmake: - ret_val = add_gem_to_cmake(gem_path=gem_path, engine_path=engine_path) - - return ret_val - - -def remove_gem_from_project(gem_name: str = None, - gem_path: str or pathlib.Path = None, - gem_target: str = None, - project_name: str = None, - project_path: str or pathlib.Path = None, - dependencies_file: str or pathlib.Path = None, - runtime_dependency: bool = False, - tool_dependency: bool = False, - server_dependency: bool = False, - platforms: str = 'Common', - remove_from_cmake: bool = False) -> int: - """ - remove a gem from a project - :param gem_name: name of the gem to add - :param gem_path: path to the gem to add - :param gem_target: the name of teh cmake gem module - :param project_name: name of the project to add the gem to - :param project_path: path to the project to add the gem to - :param dependencies_file: if this dependency goes/is in a specific file - :param runtime_dependency: bool to specify this is a runtime gem for the game - :param tool_dependency: bool to specify this is a tool gem for the editor - :param server_dependency: bool to specify this is a server gem for the server - :param platforms: str to specify common or which specific platforms - :param remove_from_cmake: bool to specify that this gem should be removed from cmake - :return: 0 for success or non 0 failure code - """ - - # we need either a project name or path - if not project_name and not project_path: - logger.error(f'Must either specify a Project path or Project Name.') - return 1 - - # if project name resolve it into a path - if project_name and not project_path: - project_path = get_registered(project_name=project_name) - project_path = pathlib.Path(project_path).resolve() - if not project_path.is_dir(): - logger.error(f'Project path {project_path} is not a folder.') - return 1 - - # We need either a gem name or path - if not gem_name and not gem_path: - logger.error(f'Must either specify a Gem path or Gem Name.') - return 1 - - # if gem name resolve it into a path - if gem_name and not gem_path: - gem_path = get_registered(gem_name=gem_name) - gem_path = pathlib.Path(gem_path).resolve() - # make sure this gem already exists if we're adding. We can always remove a gem. - if not gem_path.is_dir(): - logger.error(f'Gem Path {gem_path} does not exist.') - return 1 - - # find all available modules in this gem_path - modules = get_gem_targets(gem_path=gem_path) - if len(modules) == 0: - logger.error(f'No gem modules found.') - return 1 - - # if the user has not set a specific gem target remove all of them - - # if gem target not specified, see if there is only 1 module - if not gem_target: - if len(modules) == 1: - gem_target = modules[0] - else: - logger.error(f'Gem target not specified: {modules}') - return 1 - elif gem_target not in modules: - logger.error(f'Gem target not in gem modules: {modules}') - return 1 - - # if the user has not specified either we will assume they meant the most common which is runtime - if not runtime_dependency and not tool_dependency and not server_dependency and not dependencies_file: - logger.warning("Dependency type not specified: Assuming '--runtime-dependency'") - runtime_dependency = True - - # when removing we will try to do as much as possible even with failures so ret_val will be the last error code - ret_val = 0 - - # if the user has specified the dependencies file then ignore the runtime_dependency and tool_dependency flags - if dependencies_file: - dependencies_file = pathlib.Path(dependencies_file).resolve() - # make sure this is a project has a dependencies_file - if not dependencies_file.is_file(): - logger.error(f'Dependencies file {dependencies_file} is not present.') - return 1 - # remove the dependency - error_code = remove_gem_dependency(dependencies_file, gem_target) - if error_code: - ret_val = error_code - else: - if ',' in platforms: - platforms = platforms.split(',') - else: - platforms = [platforms] - for platform in platforms: - if runtime_dependency: - # make sure this is a project has a runtime_dependencies.cmake file - project_runtime_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='runtime', platform=platform)).resolve() - if not project_runtime_dependencies_file.is_file(): - logger.error(f'Runtime dependencies file {project_runtime_dependencies_file} is not present.') - else: - # remove the dependency - error_code = remove_gem_dependency(project_runtime_dependencies_file, gem_target) - if error_code: - ret_val = error_code - - if tool_dependency: - # make sure this is a project has a tool_dependencies.cmake file - project_tool_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='tool', platform=platform)).resolve() - if not project_tool_dependencies_file.is_file(): - logger.error(f'Tool dependencies file {project_tool_dependencies_file} is not present.') - else: - # remove the dependency - error_code = remove_gem_dependency(project_tool_dependencies_file, gem_target) - if error_code: - ret_val = error_code - - if server_dependency: - # make sure this is a project has a tool_dependencies.cmake file - project_server_dependencies_file = pathlib.Path( - get_dependencies_cmake_file(project_path=project_path, dependency_type='server', platform=platform)).resolve() - if not project_server_dependencies_file.is_file(): - logger.error(f'Server dependencies file {project_server_dependencies_file} is not present.') - else: - # remove the dependency - error_code = remove_gem_dependency(project_server_dependencies_file, gem_target) - if error_code: - ret_val = error_code - - if remove_from_cmake: - error_code = remove_gem_from_cmake(gem_path=gem_path) - if error_code: - ret_val = error_code - - return ret_val - - -def sha256(file_path: str or pathlib.Path, - json_path: str or pathlib.Path = None) -> int: - if not file_path: - logger.error(f'File path cannot be empty.') - return 1 - file_path = pathlib.Path(file_path).resolve() - if not file_path.is_file(): - logger.error(f'File path {file_path} does not exist.') - return 1 - - if json_path: - json_path = pathlib.Path(json_path).resolve() - if not json_path.is_file(): - logger.error(f'Json path {json_path} does not exist.') - return 1 - - sha256 = hashlib.sha256(file_path.open('rb').read()).hexdigest() - - if json_path: - with json_path.open('r') as s: - try: - json_data = json.load(s) - except Exception as e: - logger.error(f'Failed to read Json path {json_path}: {str(e)}') - return 1 - json_data.update({"sha256": sha256}) - backup_file(json_path) - with json_path.open('w') as s: - try: - s.write(json.dumps(json_data, indent=4)) - except Exception as e: - logger.error(f'Failed to write Json path {json_path}: {str(e)}') - return 1 - else: - print(sha256) - return 0 - - -def _run_get_registered(args: argparse) -> str or pathlib.Path: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return get_registered(args.engine_name, - args.project_name, - args.gem_name, - args.template_name, - args.default_folder, - args.repo_name, - args.restricted_name) - - -def _run_register_show(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - if args.this_engine: - print_this_engine(args.verbose) - return 0 - elif args.engines: - print_engines(args.verbose) - return 0 - elif args.projects: - print_projects(args.verbose) - return 0 - elif args.gems: - print_gems(args.verbose) - return 0 - elif args.templates: - print_templates(args.verbose) - return 0 - elif args.repos: - register_show_repos(args.verbose) - return 0 - elif args.restricted: - print_restricted(args.verbose) - return 0 - - elif args.engine_projects: - print_engine_projects(args.verbose) - return 0 - elif args.engine_gems: - print_engine_gems(args.verbose) - return 0 - elif args.engine_templates: - print_engine_templates(args.verbose) - return 0 - elif args.engine_restricted: - print_engine_restricted(args.verbose) - return 0 - elif args.external_subdirectories: - print_external_subdirectories(args.verbose) - return 0 - - elif args.all_projects: - print_all_projects(args.verbose) - return 0 - elif args.all_gems: - print_all_gems(args.verbose) - return 0 - elif args.all_templates: - print_all_templates(args.verbose) - return 0 - elif args.all_restricted: - print_all_restricted(args.verbose) - return 0 - - elif args.downloadables: - print_downloadables(args.verbose) - return 0 - if args.downloadable_engines: - print_downloadable_engines(args.verbose) - return 0 - elif args.downloadable_projects: - print_downloadable_projects(args.verbose) - return 0 - elif args.downloadable_gems: - print_downloadable_gems(args.verbose) - return 0 - elif args.downloadable_templates: - print_downloadable_templates(args.verbose) - return 0 - elif args.gems_data: - print_gems_metadata(args.verbose) - return 0 - else: - register_show(args.verbose) - return 0 - - -def _run_download(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - if args.engine_name: - return download_engine(args.engine_name, - args.dest_path) - elif args.project_name: - return download_project(args.project_name, - args.dest_path) - elif args.gem_nanme: - return download_gem(args.gem_name, - args.dest_path) - elif args.template_name: - return download_template(args.template_name, - args.dest_path) - - -def _run_register(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - if args.update: - remove_invalid_o3de_objects() - return refresh_repos() - elif args.this_engine: - ret_val = register(engine_path=get_this_engine_path()) - error_code = register_shipped_engine_o3de_objects() - if error_code: - ret_val = error_code - return ret_val - elif args.all_engines_path: - return register_all_engines_in_folder(args.all_engines_path, args.remove) - elif args.all_projects_path: - return register_all_projects_in_folder(args.all_projects_path, args.remove) - elif args.all_gems_path: - return register_all_gems_in_folder(args.all_gems_path, args.remove) - elif args.all_templates_path: - return register_all_templates_in_folder(args.all_templates_path, args.remove) - elif args.all_restricted_path: - return register_all_restricted_in_folder(args.all_restricted_path, args.remove) - elif args.all_repo_uri: - return register_all_repos_in_folder(args.all_restricted_path, args.remove) - else: - return register(engine_path=args.engine_path, - project_path=args.project_path, - gem_path=args.gem_path, - template_path=args.template_path, - restricted_path=args.restricted_path, - repo_uri=args.repo_uri, - default_engines_folder=args.default_engines_folder, - default_projects_folder=args.default_projects_folder, - default_gems_folder=args.default_gems_folder, - default_templates_folder=args.default_templates_folder, - default_restricted_folder=args.default_restricted_folder, - remove=args.remove) - - -def _run_add_external_subdirectory(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return add_external_subdirectory(args.external_subdirectory) - - -def _run_remove_external_subdirectory(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return remove_external_subdirectory(args.external_subdirectory) - - -def _run_add_gem_to_cmake(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return add_gem_to_cmake(gem_name=args.gem_name, gem_path=args.gem_path) - - -def _run_remove_gem_from_cmake(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return remove_gem_from_cmake(args.gem_name, args.gem_path) - - -def _run_add_gem_to_project(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return add_gem_to_project(args.gem_name, - args.gem_path, - args.gem_target, - args.project_name, - args.project_path, - args.dependencies_file, - args.runtime_dependency, - args.tool_dependency, - args.server_dependency, - args.platforms, - args.add_to_cmake) - - -def _run_remove_gem_from_project(args: argparse) -> int: - if args.override_home_folder: - global override_home_folder - override_home_folder = args.override_home_folder - - return remove_gem_from_project(args.gem_name, - args.gem_path, - args.gem_target, - args.project_path, - args.project_name, - args.dependencies_file, - args.runtime_dependency, - args.tool_dependency, - args.server_dependency, - args.platforms, - args.remove_from_cmake) - - -def _run_sha256(args: argparse) -> int: - return sha256(args.file_path, - args.json_path) - - -def add_args(parser, subparsers) -> None: - """ - add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be - invoked locally or added by a central python file. - Ex. Directly run from this file alone with: python register.py register --gem-path "C:/TestGem" - OR - o3de.py can downloadable commands by importing engine_template, - call add_args and execute: python o3de.py register --gem-path "C:/TestGem" - :param parser: the caller instantiates a parser and passes it in here - :param subparsers: the caller instantiates subparsers and passes it in here - """ - # register - register_subparser = subparsers.add_parser('register') - group = register_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('--this-engine', action='store_true', required=False, - default=False, - help='Registers the engine this script is running from.') - group.add_argument('-ep', '--engine-path', type=str, required=False, - help='Engine path to register/remove.') - group.add_argument('-pp', '--project-path', type=str, required=False, - help='Project path to register/remove.') - group.add_argument('-gp', '--gem-path', type=str, required=False, - help='Gem path to register/remove.') - group.add_argument('-tp', '--template-path', type=str, required=False, - help='Template path to register/remove.') - group.add_argument('-rp', '--restricted-path', type=str, required=False, - help='A restricted folder to register/remove.') - group.add_argument('-ru', '--repo-uri', type=str, required=False, - help='A repo uri to register/remove.') - group.add_argument('-aep', '--all-engines-path', type=str, required=False, - help='All engines under this folder to register/remove.') - group.add_argument('-app', '--all-projects-path', type=str, required=False, - help='All projects under this folder to register/remove.') - group.add_argument('-agp', '--all-gems-path', type=str, required=False, - help='All gems under this folder to register/remove.') - group.add_argument('-atp', '--all-templates-path', type=str, required=False, - help='All templates under this folder to register/remove.') - group.add_argument('-arp', '--all-restricted-path', type=str, required=False, - help='All templates under this folder to register/remove.') - group.add_argument('-aru', '--all-repo-uri', type=str, required=False, - help='All repos under this folder to register/remove.') - group.add_argument('-def', '--default-engines-folder', type=str, required=False, - help='The default engines folder to register/remove.') - group.add_argument('-dpf', '--default-projects-folder', type=str, required=False, - help='The default projects folder to register/remove.') - group.add_argument('-dgf', '--default-gems-folder', type=str, required=False, - help='The default gems folder to register/remove.') - group.add_argument('-dtf', '--default-templates-folder', type=str, required=False, - help='The default templates folder to register/remove.') - group.add_argument('-drf', '--default-restricted-folder', type=str, required=False, - help='The default restricted folder to register/remove.') - group.add_argument('-u', '--update', action='store_true', required=False, - default=False, - help='Refresh the repo cache.') - - register_subparser.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.') - - register_subparser.add_argument('-r', '--remove', action='store_true', required=False, - default=False, - help='Remove entry.') - register_subparser.set_defaults(func=_run_register) - - # show - register_show_subparser = subparsers.add_parser('register-show') - group = register_show_subparser.add_mutually_exclusive_group(required=False) - group.add_argument('-te', '--this-engine', action='store_true', required=False, - default=False, - help='Just the local engines.') - - group.add_argument('-e', '--engines', action='store_true', required=False, - default=False, - help='Just the local engines.') - group.add_argument('-p', '--projects', action='store_true', required=False, - default=False, - help='Just the local projects.') - group.add_argument('-g', '--gems', action='store_true', required=False, - default=False, - help='Just the local gems.') - group.add_argument('-t', '--templates', action='store_true', required=False, - default=False, - help='Just the local templates.') - group.add_argument('-r', '--repos', action='store_true', required=False, - default=False, - help='Just the local repos. Ignores repos.') - group.add_argument('-rs', '--restricted', action='store_true', required=False, - default=False, - help='The local restricted folders.') - - group.add_argument('-ep', '--engine-projects', action='store_true', required=False, - default=False, - help='Just the local projects. Ignores repos.') - group.add_argument('-eg', '--engine-gems', action='store_true', required=False, - default=False, - help='Just the local gems. Ignores repos') - group.add_argument('-et', '--engine-templates', action='store_true', required=False, - default=False, - help='Just the local templates. Ignores repos.') - group.add_argument('-ers', '--engine-restricted', action='store_true', required=False, - default=False, - help='The restricted folders.') - group.add_argument('-x', '--external-subdirectories', action='store_true', required=False, - default=False, - help='The external subdirectories.') - - group.add_argument('-ap', '--all-projects', action='store_true', required=False, - default=False, - help='Just the local projects. Ignores repos.') - group.add_argument('-ag', '--all-gems', action='store_true', required=False, - default=False, - help='Just the local gems. Ignores repos') - group.add_argument('-at', '--all-templates', action='store_true', required=False, - default=False, - help='Just the local templates. Ignores repos.') - group.add_argument('-ars', '--all-restricted', action='store_true', required=False, - default=False, - help='The restricted folders.') - - group.add_argument('-d', '--downloadables', action='store_true', required=False, - default=False, - help='Combine all repos into a single list of resources.') - group.add_argument('-de', '--downloadable-engines', action='store_true', required=False, - default=False, - help='Combine all repos engines into a single list of resources.') - group.add_argument('-dp', '--downloadable-projects', action='store_true', required=False, - default=False, - help='Combine all repos projects into a single list of resources.') - group.add_argument('-dg', '--downloadable-gems', action='store_true', required=False, - default=False, - help='Combine all repos gems into a single list of resources.') - group.add_argument('-dt', '--downloadable-templates', action='store_true', required=False, - default=False, - help='Combine all repos templates into a single list of resources.') - group.add_argument('-gd', '--gems-data', action='store_true', required=False, - default=False, - help='Returns a json formatted string of meta data for all local and engine gems.') - - register_show_subparser.add_argument('-v', '--verbose', action='count', required=False, - default=0, - help='How verbose do you want the output to be.') - - register_show_subparser.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.') - - register_show_subparser.set_defaults(func=_run_register_show) - - # get-registered - get_registered_subparser = subparsers.add_parser('get-registered') - group = get_registered_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-en', '--engine-name', type=str, required=False, - help='Engine name.') - group.add_argument('-pn', '--project-name', type=str, required=False, - help='Project name.') - group.add_argument('-gn', '--gem-name', type=str, required=False, - help='Gem name.') - group.add_argument('-tn', '--template-name', type=str, required=False, - help='Template name.') - group.add_argument('-df', '--default-folder', type=str, required=False, - choices=['engines', 'projects', 'gems', 'templates', 'restricted'], - help='The default folders for o3de.') - group.add_argument('-rn', '--repo-name', type=str, required=False, - help='Repo name.') - group.add_argument('-rsn', '--restricted-name', type=str, required=False, - help='Restricted name.') - - get_registered_subparser.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.') - - get_registered_subparser.set_defaults(func=_run_get_registered) - - # download - download_subparser = subparsers.add_parser('download') - group = download_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-e', '--engine-name', type=str, required=False, - help='Downloadable engine name.') - group.add_argument('-p', '--project-name', type=str, required=False, - help='Downloadable project name.') - group.add_argument('-g', '--gem-name', type=str, required=False, - help='Downloadable gem name.') - group.add_argument('-t', '--template-name', type=str, required=False, - help='Downloadable template name.') - download_subparser.add_argument('-dp', '--dest-path', type=str, required=False, - default=None, - help='Optional destination folder to download into.' - ' i.e. download --project-name "StarterGame" --dest-path "C:/projects"' - ' will result in C:/projects/StarterGame' - ' If blank will download to default object type folder') - - download_subparser.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.') - - download_subparser.set_defaults(func=_run_download) - - # add external subdirectories - add_external_subdirectory_subparser = subparsers.add_parser('add-external-subdirectory') - add_external_subdirectory_subparser.add_argument('external_subdirectory', metavar='external_subdirectory', type=str, - help='add an external subdirectory to cmake') - - add_external_subdirectory_subparser.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.') - - add_external_subdirectory_subparser.set_defaults(func=_run_add_external_subdirectory) - - # remove external subdirectories - remove_external_subdirectory_subparser = subparsers.add_parser('remove-external-subdirectory') - remove_external_subdirectory_subparser.add_argument('external_subdirectory', metavar='external_subdirectory', - type=str, - help='remove external subdirectory from cmake') - - remove_external_subdirectory_subparser.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.') - - remove_external_subdirectory_subparser.set_defaults(func=_run_remove_external_subdirectory) - - # add gems to cmake - # convenience functions to disambiguate the gem name -> gem_path and call add-external-subdirectory on gem_path - add_gem_to_cmake_subparser = subparsers.add_parser('add-gem-to-cmake') - group = add_gem_to_cmake_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-gp', '--gem-path', type=str, required=False, - help='The path to the gem.') - group.add_argument('-gn', '--gem-name', type=str, required=False, - help='The name of the gem.') - - add_gem_to_cmake_subparser.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.') - - add_gem_to_cmake_subparser.set_defaults(func=_run_add_gem_to_cmake) - - # remove gems from cmake - # convenience functions to disambiguate the gem name -> gem_path and call remove-external-subdirectory on gem_path - remove_gem_from_cmake_subparser = subparsers.add_parser('remove-gem-from-cmake') - group = remove_gem_from_cmake_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-gp', '--gem-path', type=str, required=False, - help='The path to the gem.') - group.add_argument('-gn', '--gem-name', type=str, required=False, - help='The name of the gem.') - - remove_gem_from_cmake_subparser.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.') - - remove_gem_from_cmake_subparser.set_defaults(func=_run_remove_gem_from_cmake) - - # add a gem to a project - add_gem_subparser = subparsers.add_parser('add-gem-to-project') - group = add_gem_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-pp', '--project-path', type=str, required=False, - help='The path to the project.') - group.add_argument('-pn', '--project-name', type=str, required=False, - help='The name of the project.') - group = add_gem_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-gp', '--gem-path', type=str, required=False, - help='The path to the gem.') - group.add_argument('-gn', '--gem-name', type=str, required=False, - help='The name of the gem.') - add_gem_subparser.add_argument('-gt', '--gem-target', type=str, required=False, - help='The cmake target name to add. If not specified it will assume gem_name') - add_gem_subparser.add_argument('-df', '--dependencies-file', type=str, required=False, - help='The cmake dependencies file in which the gem dependencies are specified.' - 'If not specified it will assume ') - add_gem_subparser.add_argument('-rd', '--runtime-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be added as a runtime dependency') - add_gem_subparser.add_argument('-td', '--tool-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be added as a tool dependency') - add_gem_subparser.add_argument('-sd', '--server-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be added as a server dependency') - add_gem_subparser.add_argument('-pl', '--platforms', type=str, required=False, - default='Common', - help='Optional list of platforms this gem should be added to.' - ' Ex. --platforms Mac,Windows,Linux') - add_gem_subparser.add_argument('-a', '--add-to-cmake', type=bool, required=False, - default=True, - help='Automatically call add-gem-to-cmake.') - - add_gem_subparser.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.') - - add_gem_subparser.set_defaults(func=_run_add_gem_to_project) - - # remove a gem from a project - remove_gem_subparser = subparsers.add_parser('remove-gem-from-project') - group = remove_gem_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-pp', '--project-path', type=str, required=False, - help='The path to the project.') - group.add_argument('-pn', '--project-name', type=str, required=False, - help='The name of the project.') - group = remove_gem_subparser.add_mutually_exclusive_group(required=True) - group.add_argument('-gp', '--gem-path', type=str, required=False, - help='The path to the gem.') - group.add_argument('-gn', '--gem-name', type=str, required=False, - help='The name of the gem.') - remove_gem_subparser.add_argument('-gt', '--gem-target', type=str, required=False, - help='The cmake target name to add. If not specified it will assume gem_name') - remove_gem_subparser.add_argument('-df', '--dependencies-file', type=str, required=False, - help='The cmake dependencies file in which the gem dependencies are specified.' - 'If not specified it will assume ') - remove_gem_subparser.add_argument('-rd', '--runtime-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be removed as a runtime dependency') - remove_gem_subparser.add_argument('-td', '--tool-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be removed as a server dependency') - remove_gem_subparser.add_argument('-sd', '--server-dependency', action='store_true', required=False, - default=False, - help='Optional toggle if this gem should be removed as a server dependency') - remove_gem_subparser.add_argument('-pl', '--platforms', type=str, required=False, - default='Common', - help='Optional list of platforms this gem should be removed from' - ' Ex. --platforms Mac,Windows,Linux') - remove_gem_subparser.add_argument('-r', '--remove-from-cmake', type=bool, required=False, - default=False, - help='Automatically call remove-from-cmake.') - - remove_gem_subparser.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.') - - remove_gem_subparser.set_defaults(func=_run_remove_gem_from_project) - - # sha256 - sha256_subparser = subparsers.add_parser('sha256') - sha256_subparser.add_argument('-f', '--file-path', type=str, required=True, - help='The path to the file you want to sha256.') - sha256_subparser.add_argument('-j', '--json-path', type=str, required=False, - help='optional path to an o3de json file to add the "sha256" element to.') - sha256_subparser.set_defaults(func=_run_sha256) - - -if __name__ == "__main__": - # parse the command line args - the_parser = argparse.ArgumentParser() - - # add subparsers - the_subparsers = the_parser.add_subparsers(help='sub-command help') - - # add args to the parser - add_args(the_parser, the_subparsers) - - # parse args - the_args = the_parser.parse_args() - - # run - ret = the_args.func(the_args) - - # return - sys.exit(ret) diff --git a/cmake/Tools/unit_test_add_remove_gem.py b/cmake/Tools/unit_test_add_remove_gem.py deleted file mode 100755 index 81f0fa615e..0000000000 --- a/cmake/Tools/unit_test_add_remove_gem.py +++ /dev/null @@ -1,259 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import os -import pytest - -from . import add_remove_gem - -TEST_WITHOUT_NO_GEM_CONTENT = """ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES -) -""" - -TEST_WITHOUT_ONLY_GEM_CONTENT = """ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::TestGem -) -""" - -TEST_WITHOUT_ADDED_GEM_CONTENT = """ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::ExistingGem -) -""" - -TEST_WITH_ADDED_GEM_CONTENT = """ -# {BEGIN_LICENSE} -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# {END_LICENSE} - -set(GEM_DEPENDENCIES - Gem::TestGem - Gem::ExistingGem -) -""" - - -@pytest.mark.parametrize( - "contents, gem, expected_result, runtime_present, expect_failure", [ - pytest.param(TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", TEST_WITH_ADDED_GEM_CONTENT, True, False), - pytest.param(TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", TEST_WITH_ADDED_GEM_CONTENT, False, True), - pytest.param(TEST_WITHOUT_ADDED_GEM_CONTENT, "/TestGem", TEST_WITH_ADDED_GEM_CONTENT, True, True), - pytest.param(TEST_WITHOUT_NO_GEM_CONTENT, "TestGem", TEST_WITHOUT_ONLY_GEM_CONTENT, True, False), - ] -) -def test_add_gem_dependency(tmpdir, contents, gem, expected_result, runtime_present, expect_failure): - dev_root = str(tmpdir.join('dev').realpath()).replace('\\', '/') - os.makedirs(dev_root, exist_ok=True) - - dev_project_gem_code = f'{dev_root}/TestProject/Gem/Code' - os.makedirs(dev_project_gem_code, exist_ok=True) - - runtime_dependencies_cmake_file = f'{dev_project_gem_code}/runtime_dependencies.cmake' - if runtime_present: - if os.path.isfile(runtime_dependencies_cmake_file): - os.unlink(runtime_dependencies_cmake_file) - with open(runtime_dependencies_cmake_file, 'a') as s: - s.write(contents) - - result = add_remove_gem.add_gem_dependency(runtime_dependencies_cmake_file, gem) - - if expect_failure: - assert result != 0 - else: - assert result == 0 - with open(runtime_dependencies_cmake_file, 'r') as s: - s_data = s.read() - assert s_data == expected_result - - -@pytest.mark.parametrize( - "contents, gem, expected_result, runtime_present, expect_failure", [ - pytest.param(TEST_WITH_ADDED_GEM_CONTENT, "TestGem", TEST_WITHOUT_ADDED_GEM_CONTENT, True, False), - pytest.param(TEST_WITH_ADDED_GEM_CONTENT, "TestGem", TEST_WITHOUT_ADDED_GEM_CONTENT, False, True), - pytest.param(TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", TEST_WITHOUT_ADDED_GEM_CONTENT, True, True) - ] -) -def test_remove_gem_dependency(tmpdir, contents, gem, expected_result, runtime_present, expect_failure): - dev_root = str(tmpdir.join('dev').realpath()).replace('\\', '/') - os.makedirs(dev_root, exist_ok=True) - - dev_project_gem_code = f'{dev_root}/TestProject/Gem/Code' - os.makedirs(dev_project_gem_code, exist_ok=True) - - runtime_dependencies_cmake_file = f'{dev_project_gem_code}/runtime_dependencies.cmake' - if runtime_present: - if os.path.isfile(runtime_dependencies_cmake_file): - os.unlink(runtime_dependencies_cmake_file) - with open(runtime_dependencies_cmake_file, 'a') as s: - s.write(contents) - - result = add_remove_gem.remove_gem_dependency(runtime_dependencies_cmake_file, gem) - - if expect_failure: - assert result != 0 - else: - assert result == 0 - with open(runtime_dependencies_cmake_file, 'r') as s: - s_data = s.read() - assert s_data == expected_result - - -@pytest.mark.parametrize("add," - " contents, gem, project, expected_result," - " runtime_present, tool_present," - " ask_for_runtime, ask_for_tool," - " expect_failure", [ - pytest.param(True, - TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITH_ADDED_GEM_CONTENT, - True, True, - True, True, - False), - pytest.param(True, - TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITH_ADDED_GEM_CONTENT, - True, False, - True, True, - True), - pytest.param(True, - TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITH_ADDED_GEM_CONTENT, - False, True, - True, True, - True), - pytest.param(True, - TEST_WITHOUT_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITH_ADDED_GEM_CONTENT, - False, False, - True, True, - True), - - pytest.param(False, - TEST_WITH_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITHOUT_ADDED_GEM_CONTENT, - True, True, - True, True, - False), - pytest.param(False, - TEST_WITH_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITHOUT_ADDED_GEM_CONTENT, - True, False, - True, True, - True), - pytest.param(False, - TEST_WITH_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITHOUT_ADDED_GEM_CONTENT, - False, True, - True, True, - True), - pytest.param(False, - TEST_WITH_ADDED_GEM_CONTENT, "TestGem", "TestProject", - TEST_WITHOUT_ADDED_GEM_CONTENT, - False, False, - True, True, - True) - ] - ) -def test_add_remove_gem(tmpdir, - add, - contents, gem, project, - expected_result, - runtime_present, tool_present, - ask_for_runtime, ask_for_tool, - expect_failure): - dev_root = str(tmpdir.join('dev').realpath()).replace('\\', '/') - os.makedirs(dev_root, exist_ok=True) - - dev_project_gem_code = f'{dev_root}/TestProject/Gem/Code' - os.makedirs(dev_project_gem_code, exist_ok=True) - - runtime_dependencies_cmake_file = f'{dev_project_gem_code}/runtime_dependencies.cmake' - if runtime_present: - if os.path.isfile(runtime_dependencies_cmake_file): - os.unlink(runtime_dependencies_cmake_file) - with open(runtime_dependencies_cmake_file, 'a') as s: - s.write(contents) - - tool_dependencies_cmake_file = f'{dev_project_gem_code}/tool_dependencies.cmake' - os.makedirs(dev_project_gem_code, exist_ok=True) - - if tool_present: - if os.path.isfile(tool_dependencies_cmake_file): - os.unlink(tool_dependencies_cmake_file) - with open(tool_dependencies_cmake_file, 'w') as s: - s.write(contents) - - project_folder = f'{dev_root}/TestProject' - os.makedirs(project_folder, exist_ok=True) - - gems_folder = f'{dev_root}/Gems' - os.makedirs(gems_folder, exist_ok=True) - - gem_folder = f'{gems_folder}/{gem}' - os.makedirs(gem_folder, exist_ok=True) - - result = add_remove_gem.add_remove_gem(add, dev_root, gem, project, ask_for_runtime, ask_for_tool) - - if expect_failure: - assert result != 0 - else: - assert result == 0 - if runtime_present: - with open(runtime_dependencies_cmake_file, 'r') as s: - s_data = s.read() - assert s_data == expected_result - if tool_present: - with open(tool_dependencies_cmake_file, 'r') as s: - s_data = s.read() - assert s_data == expected_result - diff --git a/cmake/Tools/unit_test_common.py b/cmake/Tools/unit_test_common.py index 58f89876c3..655c2a32c1 100755 --- a/cmake/Tools/unit_test_common.py +++ b/cmake/Tools/unit_test_common.py @@ -48,60 +48,6 @@ def test_determine_engine_root(tmpdir, engine_json_content, expected_success): assert result is None -TEST_BOOTSTRAP_CONTENT_1 = """ -project_path = Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc ---No Assets -""" - -TEST_BOOTSTRAP_CONTENT_2 = """ -project_path = Game2 - foo = bar -#------------------------- - key1 = value1 -key2 = value2 -assets = pc ---No Assets -""" - - -@pytest.mark.parametrize( - "contents, input_keys, expected_result_map", [ - pytest.param(TEST_BOOTSTRAP_CONTENT_1, ['project_path', 'foo', 'assets'], {'project_path': 'Game1', - 'foo': 'bar', - 'assets': 'pc'}, id="TestFullMatch"), - pytest.param(TEST_BOOTSTRAP_CONTENT_2, ['project_path', 'foo', 'barnone'], {'project_path': 'Game2', - 'foo': 'bar'}, id="TestPartialMatch"), - pytest.param(TEST_BOOTSTRAP_CONTENT_2, ['project_pathnone', 'foonone', 'barnone'], {}, id="TestNoMatch") - ] -) -def test_get_bootstrap_values_success(tmpdir, contents, input_keys, expected_result_map): - - test_dev_root = 'dev' - tmpdir.ensure('{}/bootstrap.cfg'.format(test_dev_root)) - bootstrap_file = tmpdir.join('{}/bootstrap.cfg'.format(test_dev_root)) - bootstrap_file.write(contents) - - bootstrap_file_path = str(tmpdir.join(test_dev_root).realpath()) - - result = common.get_bootstrap_values(bootstrap_file_path, input_keys) - - assert expected_result_map == result - - -def test_get_bootstrap_values_fail(): - try: - bad_file = 'x:\\foo\\bar\\file\\' - common.get_bootstrap_values(bad_file, ['input_keys']) - except common.LmbrCmdError as err: - assert 'Missing' in str(err) - else: - assert False, "Excepted LayoutToolError (missing file)" - - TEST_AP_CONFIG_1 = """ [Platforms] ;pc=enabled @@ -245,7 +191,6 @@ def test_verify_game_project_and_dev_root_success(tmpdir): game_name = 'MyFoo' game_folder = 'myfoo' game_project_json = TEST_GAME_PROJECT_JSON_FORMAT.format(project_name=game_name) - tmpdir.ensure(f'{dev_root}/bootstrap.cfg') tmpdir.ensure(f'{dev_root}/{game_folder}/project.json') project_json_path = tmpdir / dev_root / game_folder / 'project.json' project_json_path.write_text(game_project_json, encoding='ascii') @@ -285,72 +230,6 @@ asset_deploy_type={test_asset_deploy_type} assert result.asset_deploy_type == test_asset_deploy_type -def test_transform_bootstrap_project_path(tmpdir): - - tmpdir.ensure('bootstrap.cfg') - - test_bootstrap_content = """ --- Blah Blah --- Blah Blah - -project_path=OldProject - --- remote_filesystem - enable Virtual File System (VFS) --- This feature allows a remote instance of the game to run off assets --- on the asset processor computers cache instead of deploying them the remote device --- By default it is off and can be overridden for any platform -remote_filesystem=0 -""" - test_src_bootstrap = tmpdir / 'bootstrap.cfg' - test_src_bootstrap.write_text(test_bootstrap_content, encoding='ascii') - - test_dst_bootstrap = tmpdir / 'bootstrap.transformed.cfg' - test_game_name = 'FooBar' - - common.transform_bootstrap_for_project(game_name=test_game_name, - src_bootstrap=str(test_src_bootstrap), - dst_bootstrap=str(test_dst_bootstrap)) - - transformed_text = test_dst_bootstrap.read_text('ascii') - - search_gamename = re.search(r"project_path\s*=\s*(.*)", transformed_text) - assert search_gamename - assert search_gamename.group(1) - assert search_gamename.group(1) == test_game_name - - -def test_transform_bootstrap_project_path_missing(tmpdir): - - tmpdir.ensure('bootstrap.cfg') - - test_bootstrap_content = """ --- Blah Blah --- Blah Blah - --- remote_filesystem - enable Virtual File System (VFS) --- This feature allows a remote instance of the game to run off assets --- on the asset processor computers cache instead of deploying them the remote device --- By default it is off and can be overridden for any platform -remote_filesystem=0 -""" - test_src_bootstrap = tmpdir / 'bootstrap.cfg' - test_src_bootstrap.write_text(test_bootstrap_content, encoding='ascii') - - test_dst_bootstrap = tmpdir / 'bootstrap.transformed.cfg' - test_game_name = 'FooBar' - - common.transform_bootstrap_for_project(game_name=test_game_name, - src_bootstrap=str(test_src_bootstrap), - dst_bootstrap=str(test_dst_bootstrap)) - - transformed_text = test_dst_bootstrap.read_text('ascii') - - search_gamename = re.search(r"project_path\s*=\s*(.*)", transformed_text) - assert search_gamename - assert search_gamename.group(1) - assert search_gamename.group(1) == test_game_name - - def test_cmake_dependency_success(tmpdir): test_module = 'FooBar' diff --git a/cmake/Tools/unit_test_current_project.py b/cmake/Tools/unit_test_current_project.py deleted file mode 100755 index 7db48b62aa..0000000000 --- a/cmake/Tools/unit_test_current_project.py +++ /dev/null @@ -1,102 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -import os -import pytest - -from . import current_project - -TEST_BOOTSTRAP_CONTENT_1 = """ -project_path = Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc -""" -TEST_BOOTSTRAP_CONTENT_2 = """ -project_path=Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc -""" -TEST_BOOTSTRAP_CONTENT_3 = """ -project_path= Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc -""" -TEST_BOOTSTRAP_CONTENT_4 = """ -project_path =Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc -""" -TEST_BOOTSTRAP_CONTENT_5 = """ -project_path = Game1 -foo = bar -key1 = value1 -key2 = value2 -assets = pc -""" - -@pytest.mark.parametrize( - "contents, expected_result", [ - pytest.param(TEST_BOOTSTRAP_CONTENT_1, 'Game1'), - pytest.param(TEST_BOOTSTRAP_CONTENT_2, 'Game1'), - pytest.param(TEST_BOOTSTRAP_CONTENT_3, 'Game1'), - pytest.param(TEST_BOOTSTRAP_CONTENT_4, 'Game1'), - pytest.param(TEST_BOOTSTRAP_CONTENT_5, 'Game1'), - ] -) -def test_get_current_project(tmpdir, contents, expected_result): - dev_root = str(tmpdir.join('dev').realpath()).replace('\\', '/') - os.makedirs(dev_root, exist_ok=True) - - bootstrap_file = f'{dev_root}/bootstrap.cfg' - if os.path.isfile(bootstrap_file): - os.unlink(bootstrap_file) - with open(bootstrap_file, 'a') as s: - s.write(contents) - - result = current_project.get_current_project(dev_root) - assert expected_result == result - - -@pytest.mark.parametrize( - "contents, project_to_set, expected_result", [ - pytest.param(TEST_BOOTSTRAP_CONTENT_1, 'Test1', 0), - pytest.param(TEST_BOOTSTRAP_CONTENT_1, ' Test2', 0), - pytest.param(TEST_BOOTSTRAP_CONTENT_1, 'Test3 ', 0), - pytest.param(TEST_BOOTSTRAP_CONTENT_1, '/Test4', 1), - pytest.param(TEST_BOOTSTRAP_CONTENT_1, '=Test5', 1), - ] -) -def test_set_current_project(tmpdir, contents, project_to_set, expected_result): - dev_root = str(tmpdir.join('dev').realpath()).replace('\\', '/') - os.makedirs(dev_root, exist_ok=True) - - bootstrap_file = f'{dev_root}/bootstrap.cfg' - if os.path.isfile(bootstrap_file): - os.unlink(bootstrap_file) - with open(bootstrap_file, 'a') as s: - s.write(contents) - - result = current_project.set_current_project(dev_root, project_to_set) - assert expected_result == result - - if result == 0: - project_that_is_set = current_project.get_current_project(dev_root) - print(project_that_is_set) - print(project_to_set) - assert project_to_set.strip() == project_that_is_set \ No newline at end of file diff --git a/cmake/Tools/unit_test_layout_tool.py b/cmake/Tools/unit_test_layout_tool.py index 5be2c23f11..37684654b1 100755 --- a/cmake/Tools/unit_test_layout_tool.py +++ b/cmake/Tools/unit_test_layout_tool.py @@ -212,16 +212,15 @@ def test_create_link_error(): @pytest.mark.parametrize( - "project_path, asset_type, ensure_path, warn_on_missing, expected_result", [ - pytest.param('Foo', 'pc', 'Foo/Cache/pc/bootstrap.cfg', False, 'Foo/Cache/pc'), - pytest.param('Foo', 'pc', 'dev/bootstrap.cfg', True, None), - pytest.param('Foo', 'pc', 'Foo/Cache/es3/bootstrap.cfg', True, None), - pytest.param('Foo', 'pc', 'dev/bootstrap.cfg', False, common.LmbrCmdError), - pytest.param('Foo', 'pc', 'Foo/Cache/es3/bootstrap.cfg', False, common.LmbrCmdError), + "project_path, asset_type, warn_on_missing, expected_result", [ + pytest.param('Foo', 'pc', False, 'Foo/Cache/pc'), + pytest.param('Foo', 'pc', True, None), + pytest.param('Foo', 'pc', True, None), + pytest.param('Foo', 'pc', False, common.LmbrCmdError), + pytest.param('Foo', 'pc', False, common.LmbrCmdError), ] ) -def test_construct_and_validate_cache_game_asset_folder_success(tmpdir, project_path, asset_type, ensure_path, warn_on_missing, expected_result): - tmpdir.ensure(ensure_path) +def test_construct_and_validate_cache_game_asset_folder_success(tmpdir, project_path, asset_type, warn_on_missing, expected_result): if isinstance(expected_result, str): expected_path_realpath = str(tmpdir.join(expected_result).realpath()) elif expected_result == common.LmbrCmdError: @@ -385,7 +384,6 @@ def test_sync_layout_non_vfs_success(tmpdir, mode, existing_game_link, existing_ old_remove_link = layout_tool.remove_link try: # Simple Test Parameters - tmpdir.ensure('engine-root/bootstrap.cfg') engine_root_realpath = str(tmpdir.join('engine-root').realpath()) test_project_path = str(tmpdir.join('Foo').realpath()) test_project_name_lower = 'foo' diff --git a/cmake/Tools/utils.py b/cmake/Tools/utils.py deleted file mode 100755 index 37c84ea331..0000000000 --- a/cmake/Tools/utils.py +++ /dev/null @@ -1,47 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# -""" -This file contains utility functions -""" - -import uuid - - -def validate_identifier(identifier: str) -> bool: - """ - Determine if the identifier supplied is valid. - :param identifier: the name which needs to to checked - :return: bool: if the identifier is valid or not - """ - if not identifier: - return False - elif len(identifier) > 64: - return False - elif not identifier[0].isalpha(): - return False - else: - for character in identifier: - if not (character.isalnum() or character == '_' or character == '-'): - return False - return True - - -def validate_uuid4(uuid_string: str) -> bool: - """ - Determine if the uuid supplied is valid. - :param uuid_string: the uuid which needs to to checked - :return: bool: if the uuid is valid or not - """ - try: - val = uuid.UUID(uuid_string, version=4) - except ValueError: - return False - return str(val) == uuid_string diff --git a/cmake/Version.cmake b/cmake/Version.cmake index 08d79d4ce6..1d484fb059 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake @@ -12,4 +12,5 @@ string(TIMESTAMP current_year "%Y") set(LY_VERSION_COPYRIGHT_YEAR ${current_year} CACHE STRING "Open 3D Engine's copyright year") set(LY_VERSION_STRING "0.0.0.0" CACHE STRING "Open 3D Engine's version") -set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") \ No newline at end of file +set(LY_VERSION_BUILD_NUMBER 0 CACHE STRING "Open 3D Engine's build number") +set(LY_VERSION_ENGINE_NAME "o3de" CACHE STRING "Open 3D Engine's engine name") diff --git a/cmake/cmake_files.cmake b/cmake/cmake_files.cmake index e423eb0dbc..a1fd66a06d 100644 --- a/cmake/cmake_files.cmake +++ b/cmake/cmake_files.cmake @@ -12,20 +12,25 @@ set(FILES 3rdParty.cmake 3rdPartyPackages.cmake + CMakeFiles.cmake CommandExecution.cmake Configurations.cmake Dependencies.cmake Deployment.cmake - EngineFinder.cmake + EngineJson.cmake FileUtil.cmake Findo3de.cmake + Gems.cmake + GeneralSettings.cmake Install.cmake LyAutoGen.cmake + LYPackage_S3Downloader.cmake LySet.cmake LYTestWrappers.cmake LYPython.cmake LYWrappers.cmake Monolithic.cmake + OutputDirectory.cmake Packaging.cmake PAL.cmake PALTools.cmake diff --git a/cmake/install/Copyright.in b/cmake/install/Copyright.in new file mode 100644 index 0000000000..4d5680a30d --- /dev/null +++ b/cmake/install/Copyright.in @@ -0,0 +1,10 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# diff --git a/cmake/Findo3de.cmake.in b/cmake/install/Findo3de.cmake.in similarity index 100% rename from cmake/Findo3de.cmake.in rename to cmake/install/Findo3de.cmake.in diff --git a/cmake/install/InstalledTarget.in b/cmake/install/InstalledTarget.in new file mode 100644 index 0000000000..0503fd5f2b --- /dev/null +++ b/cmake/install/InstalledTarget.in @@ -0,0 +1,23 @@ + +# Generated by O3DE + +ly_add_target( + NAME @NAME_PLACEHOLDER@ IMPORTED @TARGET_TYPE_PLACEHOLDER@ + @NAMESPACE_PLACEHOLDER@ + COMPILE_DEFINITIONS + INTERFACE +@COMPILE_DEFINITIONS_PLACEHOLDER@ + INCLUDE_DIRECTORIES + INTERFACE +@INCLUDE_DIRECTORIES_PLACEHOLDER@ + BUILD_DEPENDENCIES + INTERFACE +@INTERFACE_BUILD_DEPENDENCIES_PLACEHOLDER@ + RUNTIME_DEPENDENCIES +@RUNTIME_DEPENDENCIES_PLACEHOLDER@ +) + +set(configs @CMAKE_CONFIGURATION_TYPES@) +foreach(config ${configs}) + include("@NAME_PLACEHOLDER@_${config}.cmake" OPTIONAL) +endforeach() diff --git a/cmake/install/engine.json.in b/cmake/install/engine.json.in new file mode 100644 index 0000000000..ce2e1be25c --- /dev/null +++ b/cmake/install/engine.json.in @@ -0,0 +1,11 @@ +{ + "engine_name": "@LY_VERSION_ENGINE_NAME@", + "restricted_name": "o3de", + "FileVersion": 1, + "O3DEVersion": "@LY_VERSION_STRING@", + "O3DECopyrightYear": @LY_VERSION_COPYRIGHT_YEAR@, + "O3DEBuildNumber": @LY_VERSION_BUILD_NUMBER@, + "external_subdirectories": [@LY_INSTALL_EXTERNAL_SUBDIRS@], + "projects": [@LY_INSTALL_PROJECTS@], + "templates": [@LY_INSTALL_TEMPLATES@] +} diff --git a/cmake/o3de_manifest.cmake b/cmake/o3de_manifest.cmake deleted file mode 100644 index 1585ec2d2f..0000000000 --- a/cmake/o3de_manifest.cmake +++ /dev/null @@ -1,986 +0,0 @@ -# -# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or -# its licensors. -# -# For complete copyright and license terms please see the LICENSE at the root of this -# distribution (the "License"). All use of this software is governed by the License, -# or, if provided, by the license below or the license accompanying this file. Do not -# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# - -# Set the user home directory -set(O3DE_HOME_PATH "" CACHE PATH "Override the user home to this path") -if(O3DE_HOME_PATH) - set(home_directory ${O3DE_HOME_PATH}) -elseif(CMAKE_HOST_WIN32) - file(TO_CMAKE_PATH "$ENV{USERPROFILE}" home_directory) -else() - file(TO_CMAKE_PATH "$ENV{HOME}" home_directory) -endif() -if (NOT home_directory) - message(FATAL_ERROR "Cannot find user home directory, without the user home directory the o3de manifest cannot be found") -endif() - -# Optionally delete the home directory -if(O3DE_DELETE_HOME_PATH) - message(STATUS "O3DE_DELETE_HOME_PATH=${O3DE_DELETE_HOME_PATH}") - if(EXISTS ${home_directory}/.o3de) - message(STATUS "Deleting ${home_directory}/.o3de") - file(REMOVE_RECURSE ${home_directory}/.o3de) - else() - message(STATUS "Home path ${home_directory}/.o3de doesnt exist.") - endif() -endif() - -######################################################################################################################## -# If O3DE_REGISTER_ENGINE_PATH variable is set on the commandline this will allow registration of anything using -# O3DE_REGISTER_ENGINE_PATH o3de script. This is handy for situations like build servers which download the code and -# are expected to build without the need for someone to register o3de objects like this engine by manually typing it in. -# If O3DE_REGISTER_THIS_ENGINE=TRUE is set on the commandline when O3DE_REGISTER_ENGINE_PATH is also set this will call: -# O3DE_REGISTER_ENGINE_PATH/scripts>o3de register --this-engine --override-home-folder -# Note: register --this-engine will automatically register anything it finds in known folders, so if you put your -# o3de objects like projects/gems/templates/restricted/etc... in known folders for those types they will get registered -# automatically. Known folders for types are your .o3de/Projects and .o3de/Gems etc. So if I wanted my project to be -# registered and built by this build server I could simply put them in those known folders on the build server and they -# would get registered automatically by this call. -# OR -# I could put them on the commandline as well. This would be the way if the o3de objects we need to regiater are NOT -# in known folders or you do not intend to call with O3DE_REGISTER_THIS_ENGINE=TRUE Ex. -# -DO3DE_REGISTER_ENGINE_PATH=C:\this\engine -# -DO3DE_REGISTER_PROJECT_PATHS=C:\ThisGame;C:\ThatGame -# -DO3DE_REGISTER_GEM_PATHS=C:\ThisGem;C:\ThatGem;C:\And\Some\Other\Gem -# -DO3DE_REGISTER_RESTRICTED_PATHS=C:\this\engine\Restricted;C:\ThisGame\Restricted;C:\ThisGem\Restricted -######################################################################################################################## -if(O3DE_REGISTER_ENGINE_PATH) - message(STATUS "O3DE_REGISTER_ENGINE_PATH=${O3DE_REGISTER_ENGINE_PATH}") - - if(O3DE_REGISTER_THIS_ENGINE) - message(STATUS "O3DE_REGISTER_THIS_ENGINE=${O3DE_REGISTER_THIS_ENGINE}") - message(STATUS "register --this-engine") - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --this-engine --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_this_engine_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --this-engine --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_this_engine_cmd_result - ) - endif() - if(o3de_register_this_engine_cmd_result) - message(FATAL_ERROR "An error occured trying to register --this-engine: ${o3de_register_this_engine_cmd_result}") - else() - message(STATUS "Engine ${O3DE_REGISTER_ENGINE_PATH} registration successfull.") - endif() - endif() - - if(O3DE_REGISTER_RESTRICTED_PATHS) - message(STATUS "O3DE_REGISTER_RESTRICTED_PATHS=${O3DE_REGISTER_RESTRICTED_PATHS}") - foreach(restricted_path ${O3DE_REGISTER_RESTRICTED_PATHS}) - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --restricted-path ${restricted_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_restricted_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --restricted-path ${restricted_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_restricted_cmd_result - ) - endif() - if(o3de_register_restricted_cmd_result) - message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --restricted-path ${restricted_path} --override-home-folder ${home_directory}: ${o3de_register_restricted_cmd_result}") - else() - message(STATUS "Restricted ${restricted_path} registration successfull.") - endif() - endforeach() - endif() - - if(O3DE_REGISTER_PROJECT_PATHS) - message(STATUS "O3DE_REGISTER_PROJECT_PATHS=${O3DE_REGISTER_PROJECT_PATHS}") - foreach(project_path ${O3DE_REGISTER_PROJECT_PATHS}) - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --project-path ${project_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_project_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --project-path ${project_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_project_cmd_result - ) - endif() - if(o3de_register_project_cmd_result) - message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --project-path ${project_path} --override-home-folder ${home_directory}") - else() - message(STATUS "Project ${project_path} registration successfull.") - endif() - endforeach() - endif() - - if(O3DE_REGISTER_GEM_PATHS) - message(STATUS "O3DE_REGISTER_GEM_PATHS=${O3DE_REGISTER_GEM_PATHS}") - foreach(gem_path ${O3DE_REGISTER_GEM_PATHS}) - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --gem-path ${gem_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_gem_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --gem-path ${gem_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_gem_cmd_result - ) - endif() - if(o3de_register_gem_cmd_result) - message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --gem-path ${gem_path} --override-home-folder ${home_directory}") - else() - message(STATUS "Gem ${gem_path} registration successfull.") - endif() - endforeach() - endif() - - if(O3DE_REGISTER_TEMPLATE_PATHS) - message(STATUS "O3DE_REGISTER_TEMPLATE_PATHS=${O3DE_REGISTER_TEMPLATE_PATHS}") - foreach(template_path ${O3DE_REGISTER_TEMPLATE_PATHS}) - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --template-path ${template_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_template_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --template-path ${template_path} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_template_cmd_result - ) - endif() - if(o3de_register_template_cmd_result) - message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --template-path ${template_path} --override-home-folder ${home_directory}") - else() - message(STATUS "Template ${template_path} registration successfull.") - endif() - endforeach() - endif() - - if(O3DE_REGISTER_REPO_URIS) - message(STATUS "O3DE_REGISTER_REPO_URIS=${O3DE_REGISTER_REPO_URIS}") - foreach(repo_uri ${O3DE_REGISTER_REPO_URIS}) - if(CMAKE_HOST_WIN32) - execute_process( - COMMAND cmd /c ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.bat register --repo-uri ${repo_uri} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_repo_cmd_result - ) - else() - execute_process( - COMMAND sh ${O3DE_REGISTER_ENGINE_PATH}/scripts/o3de.sh register --repo-uri ${repo_uri} --override-home-folder ${home_directory} - RESULT_VARIABLE o3de_register_repo_cmd_result - ) - endif() - if(o3de_register_repo_cmd_result) - message(FATAL_ERROR "An error occured trying to ${O3DE_REGISTER_ENGINE_PATH}/scripts>o3de register --repo-uri ${repo_uri} --override-home-folder ${home_directory}") - else() - message(STATUS "Repo ${repo_uri} registration successfull.") - endif() - endforeach() - endif() -endif() - -################################################################################ -# o3de manifest -################################################################################ -# Set manifest json path to the /.o3de/o3de_manifest.json -set(o3de_manifest_json_path ${home_directory}/.o3de/o3de_manifest.json) -if(NOT EXISTS ${o3de_manifest_json_path}) - message(FATAL_ERROR "${o3de_manifest_json_path} not found. You must o3de register --this-engine.") -endif() -file(READ ${o3de_manifest_json_path} manifest_json_data) - -################################################################################ -# o3de manifest name -################################################################################ -string(JSON o3de_manifest_name ERROR_VARIABLE json_error GET ${manifest_json_data} o3de_manifest_name) -message(STATUS "o3de_manifest_name: ${o3de_manifest_name}") -if(json_error) - message(FATAL_ERROR "Unable to read repo_name from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de origin -################################################################################ -string(JSON o3de_origin ERROR_VARIABLE json_error GET ${manifest_json_data} origin) -if(json_error) - message(FATAL_ERROR "Unable to read origin from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de default engines folder -################################################################################ -string(JSON o3de_default_engines_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_engines_folder) -message(STATUS "default_engines_folder: ${o3de_default_engines_folder}") -if(json_error) - message(FATAL_ERROR "Unable to read default_engines_folder from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de default projects folder -################################################################################ -string(JSON o3de_default_projects_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_projects_folder) -message(STATUS "default_projects_folder: ${o3de_default_projects_folder}") -if(json_error) - message(FATAL_ERROR "Unable to read default_projects_folder from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de default gems folder -################################################################################ -string(JSON o3de_default_gems_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_gems_folder) -message(STATUS "default_gems_folder: ${o3de_default_gems_folder}") -if(json_error) - message(FATAL_ERROR "Unable to read default_gems_folder from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de default templates folder -################################################################################ -string(JSON o3de_default_templates_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_templates_folder) -message(STATUS "default_templates_folder: ${o3de_default_templates_folder}") -if(json_error) - message(FATAL_ERROR "Unable to read default_templates_folder from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de default restricted folder -################################################################################ -string(JSON o3de_default_restricted_folder ERROR_VARIABLE json_error GET ${manifest_json_data} default_restricted_folder) -message(STATUS "default_restricted_folder: ${o3de_default_restricted_folder}") -if(json_error) - message(FATAL_ERROR "Unable to read default_restricted_folder from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -################################################################################ -# o3de projects -################################################################################ -string(JSON o3de_projects_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} projects) -if(json_error) - message(FATAL_ERROR "Unable to read key 'projects' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() -if(${o3de_projects_count} GREATER 0) - math(EXPR o3de_projects_count "${o3de_projects_count}-1") - foreach(projects_index RANGE ${o3de_projects_count}) - string(JSON projects_path ERROR_VARIABLE json_error GET ${manifest_json_data} projects ${projects_index}) - if(json_error) - message(FATAL_ERROR "Unable to read projects[${projects_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_projects ${projects_path}) - list(APPEND o3de_global_projects ${projects_path}) - endforeach() -endif() - -################################################################################ -# o3de gems -################################################################################ -string(JSON o3de_gems_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} gems) -if(json_error) - message(FATAL_ERROR "Unable to read key 'gems' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() -if(${o3de_gems_count} GREATER 0) - math(EXPR o3de_gems_count "${o3de_gems_count}-1") - foreach(gems_index RANGE ${o3de_gems_count}) - string(JSON gems_path ERROR_VARIABLE json_error GET ${manifest_json_data} gems ${gems_index}) - if(json_error) - message(FATAL_ERROR "Unable to read gems[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_gems ${gems_path}) - list(APPEND o3de_global_gems ${gems_path}) - endforeach() -endif() - -################################################################################ -# o3de templates -################################################################################ -string(JSON o3de_templates_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} templates) -if(json_error) - message(FATAL_ERROR "Unable to read key 'templates' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() -if(${o3de_templates_count} GREATER 0) - math(EXPR o3de_templates_count "${o3de_templates_count}-1") - foreach(templates_index RANGE ${o3de_templates_count}) - string(JSON templates_path ERROR_VARIABLE json_error GET ${manifest_json_data} templates ${templates_index}) - if(json_error) - message(FATAL_ERROR "Unable to read templates[${templates_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_templates ${templates_path}) - list(APPEND o3de_global_templates ${templates_path}) - endforeach() -endif() - -################################################################################ -# o3de repos -################################################################################ -string(JSON o3de_repos_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} repos) -if(json_error) - message(FATAL_ERROR "Unable to read key 'repos' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() -if(${o3de_repos_count} GREATER 0) - math(EXPR o3de_repos_count "${o3de_repos_count}-1") - foreach(repos_index RANGE ${o3de_repos_count}) - string(JSON repo_uri ERROR_VARIABLE json_error GET ${manifest_json_data} repos ${repos_index}) - if(json_error) - message(FATAL_ERROR "Unable to read repos[${repos_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_repos ${repo_uri}) - list(APPEND o3de_global_repos ${repo_uri}) - endforeach() -endif() - -################################################################################ -# o3de restricted -################################################################################ -string(JSON o3de_restricted_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} restricted) -if(json_error) - message(FATAL_ERROR "Unable to read key 'restricted' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() -if(${o3de_restricted_count} GREATER 0) - math(EXPR o3de_restricted_count "${o3de_restricted_count}-1") - foreach(restricted_index RANGE ${o3de_restricted_count}) - string(JSON restricted_path ERROR_VARIABLE json_error GET ${manifest_json_data} restricted ${restricted_index}) - if(json_error) - message(FATAL_ERROR "Unable to read restricted[${restricted_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_restricted ${restricted_path}) - list(APPEND o3de_global_restricted ${restricted_path}) - endforeach() -endif() - -################################################################################ -# o3de engines -################################################################################ -string(JSON o3de_engines_count ERROR_VARIABLE json_error LENGTH ${manifest_json_data} engines) -if(json_error) - message(FATAL_ERROR "Unable to read key 'engines' from '${o3de_manifest_json_path}', error: ${json_error}") -endif() - -if(${o3de_engines_count} GREATER 0) - math(EXPR o3de_engines_count "${o3de_engines_count}-1") - # Either the engine_path and engine_json are set in which case the user is configuring from the engine - # or project_path and project_json are set in which case the user is configuring from the project. - # We need to know which engine_path the user is using so if the project_json is set then we need - # to read the project_json and disambiguate the engine_path. - if(NOT o3de_engine_path) - if(NOT o3de_project_json) - message(FATAL_ERROR "Neither o3de_engine_path nor o3de_project_json defined. Cannot determine engine!") - endif() - - # get the name of the engine this project uses - file(READ ${o3de_project_json} project_json_data) - string(JSON project_engine_name ERROR_VARIABLE json_error GET ${project_json_data} engine) - if(json_error) - message(FATAL_ERROR "Unable to read 'engine' from '${o3de_project_json}', error: ${json_error}") - endif() - - # search each engine in order from the manifest to find the matching engine name - foreach(engines_index RANGE ${o3de_engines_count}) - string(JSON engine_data ERROR_VARIABLE json_error GET ${manifest_json_data} engines ${engines_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engines[${engines_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - - # get this engines path - string(JSON this_engine_path ERROR_VARIABLE json_error GET ${engine_data} path) - if(json_error) - message(FATAL_ERROR "Unable to read engine path from '${o3de_manifest_json_path}', error: ${json_error}") - endif() - - # add this engine to the engines list - list(APPEND o3de_engines ${this_engine_path}) - - # use path to get the engine.json - set(this_engine_json ${this_engine_path}/engine.json) - - # read the name of this engine - file(READ ${this_engine_json} this_engine_json_data) - string(JSON this_engine_name ERROR_VARIABLE json_error GET ${this_engine_json_data} engine_name) - if(json_error) - message(FATAL_ERROR "Unable to read engine_name from '${this_engine_json}', error: ${json_error}") - endif() - - # see if this engines name is the same as the one this projects should use - if(${this_engine_name} STREQUAL ${project_engine_name}) - message(STATUS "Found engine: '${project_engine_name}' at ${this_engine_path}") - set(o3de_engine_path ${this_engine_path}) - break() - endif() - endforeach() - endif() -endif() - -#we should have an engine_path at this point -if(NOT o3de_engine_path) - message(FATAL_ERROR "o3de_engine_path not defined. Cannot determine engine!") -endif() - -# now that we have an engine_path read in that engines o3de resources -if(${o3de_engines_count} GREATER -1) - foreach(engines_index RANGE ${o3de_engines_count}) - string(JSON engine_data ERROR_VARIABLE json_error GET ${manifest_json_data} engines ${engines_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engines[${engines_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - - # get this engines path - string(JSON this_engine_path ERROR_VARIABLE json_error GET ${engine_data} path) - if(json_error) - message(FATAL_ERROR "Unable to read engine path from '${o3de_manifest_json_path}', error: ${json_error}") - endif() - - if(${o3de_engine_path} STREQUAL ${this_engine_path}) - ################################################################################ - # o3de engine projects - ################################################################################ - string(JSON o3de_engine_projects_count ERROR_VARIABLE json_error LENGTH ${engine_data} projects) - if(json_error) - message(FATAL_ERROR "Unable to read key 'projects' from '${engine_data}', error: ${json_error}") - endif() - if(${o3de_engine_projects_count} GREATER 0) - math(EXPR o3de_engine_projects_count "${o3de_engine_projects_count}-1") - foreach(engine_projects_index RANGE ${o3de_engine_projects_count}) - string(JSON engine_projects_path ERROR_VARIABLE json_error GET ${engine_data} projects ${engine_projects_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engine projects[${projects_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_projects ${engine_projects_path}) - list(APPEND o3de_engine_projects ${engine_projects_path}) - endforeach() - endif() - - ################################################################################ - # o3de engine gems - ################################################################################ - string(JSON o3de_engine_gems_count ERROR_VARIABLE json_error LENGTH ${engine_data} gems) - if(json_error) - message(FATAL_ERROR "Unable to read key 'gems' from '${engine_data}', error: ${json_error}") - endif() - if(${o3de_engine_gems_count} GREATER 0) - math(EXPR o3de_engine_gems_count "${o3de_engine_gems_count}-1") - foreach(engine_gems_index RANGE ${o3de_engine_gems_count}) - string(JSON engine_gems_path ERROR_VARIABLE json_error GET ${engine_data} gems ${engine_gems_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engine gems[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_gems ${engine_gems_path}) - list(APPEND o3de_engine_gems ${engine_gems_path}) - endforeach() - endif() - - ################################################################################ - # o3de engine templates - ################################################################################ - string(JSON o3de_engine_templates_count ERROR_VARIABLE json_error LENGTH ${engine_data} templates) - if(json_error) - message(FATAL_ERROR "Unable to read key 'templates' from '${o3de_manifest_json_path}', error: ${json_error}") - endif() - if(${o3de_engine_gems_count} GREATER 0) - math(EXPR o3de_engine_templates_count "${o3de_engine_templates_count}-1") - foreach(engine_templates_index RANGE ${o3de_engine_templates_count}) - string(JSON engine_templates_path ERROR_VARIABLE json_error GET ${engine_data} templates ${engine_templates_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engine templates[${templates_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_templates ${engine_templates_path}) - list(APPEND o3de_engine_templates ${engine_templates_path}) - endforeach() - endif() - - ################################################################################ - # o3de engine restricted - ################################################################################ - string(JSON o3de_engine_restricted_count ERROR_VARIABLE json_error LENGTH ${engine_data} restricted) - if(json_error) - message(FATAL_ERROR "Unable to read key 'restricted' from '${o3de_manifest_json_path}', error: ${json_error}") - endif() - if(${o3de_engine_restricted_count} GREATER 0) - math(EXPR o3de_engine_restricted_count "${o3de_engine_restricted_count}-1") - foreach(engine_restricted_index RANGE ${o3de_engine_restricted_count}) - string(JSON engine_restricted_path ERROR_VARIABLE json_error GET ${engine_data} restricted ${engine_restricted_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engine restricted[${engine_restricted_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_restricted ${engine_restricted_path}) - list(APPEND o3de_engine_restricted ${engine_restricted_path}) - endforeach() - endif() - - ################################################################################ - # o3de engine external_subdirectories - ################################################################################ - string(JSON o3de_external_subdirectories_count ERROR_VARIABLE json_error LENGTH ${engine_data} external_subdirectories) - if(json_error) - message(FATAL_ERROR "Unable to read key 'external_subdirectories' from '${o3de_manifest_json_path}', error: ${json_error}") - endif() - if(${o3de_external_subdirectories_count} GREATER 0) - math(EXPR o3de_external_subdirectories_count "${o3de_external_subdirectories_count}-1") - foreach(external_subdirectories_index RANGE ${o3de_external_subdirectories_count}) - string(JSON external_subdirectories_path ERROR_VARIABLE json_error GET ${engine_data} external_subdirectories ${external_subdirectories_index}) - if(json_error) - message(FATAL_ERROR "Unable to read engine external_subdirectories[${gems_index}] '${o3de_manifest_json_path}', error: ${json_error}") - endif() - list(APPEND o3de_engine_external_subdirectories ${external_subdirectories_path}) - endforeach() - endif() - - break() - - endif() - endforeach() -endif() - - -################################################################################ -#! o3de_engine_id: -# -# \arg:engine returns the engine association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_engine_id o3de_json_file engine) - file(READ ${o3de_json_file} json_data) - string(JSON engine_entry ERROR_VARIABLE json_error GET ${json_data} engine) - if(json_error) - message(WARNING "Unable to read engine from '${o3de_json_file}', error: ${json_error}") - message(WARNING "Setting engine to engine default 'o3de'") - set(engine_entry "o3de") - endif() - if(engine_entry) - set(${engine} ${engine_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_project_id: -# -# \arg:project returns the project association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_project_id o3de_json_file project) - file(READ ${o3de_json_file} json_data) - string(JSON project_entry ERROR_VARIABLE json_error GET ${json_data} project) - if(json_error) - message(FATAL_ERROR "Unable to read project from '${o3de_json_file}', error: ${json_error}") - endif() - if(project_entry) - set(${project} ${project_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_gem_id: -# -# \arg:gem returns the gem association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_gem_id o3de_json_file gem) - file(READ ${o3de_json_file} json_data) - string(JSON gem_entry ERROR_VARIABLE json_error GET ${json_data} gem) - if(json_error) - message(FATAL_ERROR "Unable to read gem from '${o3de_json_file}', error: ${json_error}") - endif() - if(gem_entry) - set(${gem} ${gem_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_template_id: -# -# \arg:template returns the template association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_template_id o3de_json_file template) - file(READ ${o3de_json_file} json_data) - string(JSON template_entry ERROR_VARIABLE json_error GET ${json_data} template) - if(json_error) - message(FATAL_ERROR "Unable to read template from '${o3de_json_file}', error: ${json_error}") - endif() - if(template_entry) - set(${template} ${template_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_repo_id: -# -# \arg:repo returns the repo association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_repo_id o3de_json_file repo) - file(READ ${o3de_json_file} json_data) - string(JSON repo_entry ERROR_VARIABLE json_error GET ${json_data} repo) - if(json_error) - message(FATAL_ERROR "Unable to read repo from '${o3de_json_file}', error: ${json_error}") - endif() - if(repo_entry) - set(${repo} ${repo_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_restricted_id: -# -# \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) - file(READ ${o3de_json_file} json_data) - string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} restricted) - if(json_error) - message(WARNING "Unable to read restricted from '${o3de_json_file}', error: ${json_error}") - message(WARNING "Setting restricted to engine default 'o3de'") - set(restricted_entry "o3de") - endif() - if(restricted_entry) - set(${restricted} ${restricted_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_find_engine_folder: -# -# \arg:engine_path returns the path of the o3de engine folder with name engine_name -# \arg:engine_name name of the engine -################################################################################ -function(o3de_find_engine_folder engine_name engine_path) - foreach(engine_entry ${o3de_engines}) - set(engine_json_file ${engine_entry}/engine.json) - file(READ ${engine_json_file} engine_json) - string(JSON this_engine_name ERROR_VARIABLE json_error GET ${engine_json} engine_name) - if(json_error) - message(WARNING "Unable to read engine_name from '${engine_json_file}', error: ${json_error}") - else() - if(this_engine_name STREQUAL engine_name) - set(${engine_path} ${engine_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find repo_name: '${engine_name}'") -endfunction() - - -################################################################################ -#! o3de_find_project_folder: -# -# \arg:project_path returns the path of the o3de project folder with name project_name -# \arg:project_name name of the project -################################################################################ -function(o3de_find_project_folder project_name project_path) - foreach(project_entry ${o3de_projects}) - set(project_json_file ${project_entry}/project.json) - file(READ ${project_json_file} project_json) - string(JSON this_project_name ERROR_VARIABLE json_error GET ${project_json} project_name) - if(json_error) - message(WARNING "Unable to read project_name from '${project_json_file}', error: ${json_error}") - else() - if(this_project_name STREQUAL project_name) - set(${project_path} ${project_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find project_name: '${project_name}'") -endfunction() - - -################################################################################ -#! o3de_find_gem_folder: -# -# \arg:gem_path returns the path of the o3de gem folder with name gem_name -# \arg:gem_name name of the gem -################################################################################ -function(o3de_find_gem_folder gem_name gem_path) - foreach(gem_entry ${o3de_gems}) - set(gem_json_file ${gem_entry}/gem.json) - file(READ ${gem_json_file} gem_json) - string(JSON this_gem_name ERROR_VARIABLE json_error GET ${gem_json} gem_name) - if(json_error) - message(WARNING "Unable to read gem_name from '${gem_json_file}', error: ${json_error}") - else() - if(this_gem_name STREQUAL gem_name) - set(${gem_path} ${gem_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find gem_name: '${gem_name}'") -endfunction() - - -################################################################################ -#! o3de_find_template_folder: -# -# \arg:template_path returns the path of the o3de template folder with name template_name -# \arg:template_name name of the template -################################################################################ -function(o3de_find_template_folder template_name template_path) - foreach(template_entry ${o3de_templates}) - set(template_json_file ${template_entry}/template.json) - file(READ ${template_json_file} template_json) - string(JSON this_template_name ERROR_VARIABLE json_error GET ${template_json} template_name) - if(json_error) - message(WARNING "Unable to read template_name from '${template_json_file}', error: ${json_error}") - else() - if(this_template_name STREQUAL template_name) - set(${template_path} ${template_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find template_name: '${template_name}'") -endfunction() - - -################################################################################ -#! o3de_find_repo_folder: -# -# \arg:repo_path returns the path of the o3de repo folder with name repo_name -# \arg:repo_name name of the repo -################################################################################ -function(o3de_find_repo_folder repo_name repo_path) - foreach(repo_entry ${o3de_repos}) - set(repo_json_file ${repo_entry}/repo.json) - file(READ ${repo_json_file} repo_json) - string(JSON this_repo_name ERROR_VARIABLE json_error GET ${repo_json} repo_name) - if(json_error) - message(WARNING "Unable to read repo_name from '${repo_json_file}', error: ${json_error}") - else() - if(this_repo_name STREQUAL repo_name) - set(${repo_path} ${repo_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find repo_name: '${repo_name}'") -endfunction() - - -################################################################################ -#! o3de_find_restricted_folder: -# -# \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) - foreach(restricted_entry ${o3de_restricted}) - set(restricted_json_file ${restricted_entry}/restricted.json) - file(READ ${restricted_json_file} restricted_json) - string(JSON this_restricted_name ERROR_VARIABLE json_error GET ${restricted_json} restricted_name) - if(json_error) - message(WARNING "Unable to read restricted_name from '${restricted_json_file}', error: ${json_error}") - else() - if(this_restricted_name STREQUAL restricted_name) - set(${restricted_path} ${restricted_entry} PARENT_SCOPE) - return() - endif() - endif() - endforeach() - message(FATAL_ERROR "Unable to find restricted_name: '${restricted_name}'") -endfunction() - - -################################################################################ -#! o3de_engine_name: -# -# \arg:engine returns the engine_name element from an engine.json -# \arg:o3de_engine_json_file name of the o3de json file -################################################################################ -function(o3de_engine_name o3de_engine_json_file engine) - file(READ ${o3de_engine_json_file} json_data) - string(JSON engine_entry ERROR_VARIABLE json_error GET ${json_data} engine_name) - if(json_error) - message(FATAL_ERROR "Unable to read engine_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(engine_entry) - set(${engine} ${engine_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_project_name: -# -# \arg:project returns the project_name element from an project.json -# \arg:o3de_project_json_file name of the o3de json file -################################################################################ -function(o3de_project_name o3de_project_json_file project) - file(READ ${o3de_project_json_file} json_data) - string(JSON project_entry ERROR_VARIABLE json_error GET ${json_data} project_name) - if(json_error) - message(FATAL_ERROR "Unable to read project_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(project_entry) - set(${project} ${project_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_gem_name: -# -# \arg:gem returns the gem_name element from an gem.json -# \arg:o3de_gem_json_file name of the o3de json file -################################################################################ -function(o3de_gem_name o3de_gem_json_file gem) - file(READ ${o3de_gem_json_file} json_data) - string(JSON gem_entry ERROR_VARIABLE json_error GET ${json_data} gem_name) - if(json_error) - message(FATAL_ERROR "Unable to read gem_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(gem_entry) - set(${gem} ${gem_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_template_name: -# -# \arg:template returns the template_name element from an template json -# \arg:o3de_template_json_file name of the o3de json file -################################################################################ -function(o3de_template_name o3de_template_json_file template) - file(READ ${o3de_template_json_file} json_data) - string(JSON template_entry ERROR_VARIABLE json_error GET ${json_data} template_name) - if(json_error) - message(FATAL_ERROR "Unable to read template_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(template_entry) - set(${template} ${template_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_repo_name: -# -# \arg:repo returns the repo_name element from an repo.json or o3de_manifest.json -# \arg:o3de_repo_json_file name of the o3de json file -################################################################################ -function(o3de_repo_name o3de_repo_json_file repo) - file(READ ${o3de_repo_json_file} json_data) - string(JSON repo_entry ERROR_VARIABLE json_error GET ${json_data} repo_name) - if(json_error) - message(FATAL_ERROR "Unable to read repo_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(repo_entry) - set(${repo} ${repo_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_restricted_name: -# -# \arg:restricted returns the restricted association element from an o3de json -# \arg:o3de_json_file name of the o3de json file -################################################################################ -function(o3de_restricted_name o3de_json_file restricted) - file(READ ${o3de_json_file} json_data) - string(JSON restricted_entry ERROR_VARIABLE json_error GET ${json_data} restricted_name) - if(json_error) - message(WARNING "FATAL_ERROR to read restricted_name from '${o3de_json_file}', error: ${json_error}") - endif() - if(restricted_entry) - set(${restricted} ${restricted_entry} PARENT_SCOPE) - endif() -endfunction() - - -################################################################################ -#! o3de_engine_path: -# -# \arg:engine_path returns the path of the o3de engine folder with name engine_name -# \arg:engine_name name of the engine -################################################################################ -function(o3de_engine_path o3de_json_file engine_path) - o3de_engine_id(${o3de_json_file} engine_name) - if(engine_name) - o3de_find_engine_folder(${engine_name} engine_folder) - if(engine_folder) - set(${engine_path} ${engine_folder} PARENT_SCOPE) - endif() - endif() -endfunction() - - -################################################################################ -#! o3de_project_path: -# -# \arg:project_path returns the path of the o3de project folder with name project_name -# \arg:project_name name of the project -################################################################################ -function(o3de_project_path o3de_json_file project_path) - o3de_project_id(${o3de_json_file} project_name) - if(project_name) - o3de_find_project_folder(${project_name} project_folder) - if(project_folder) - set(${project_path} ${project_folder} PARENT_SCOPE) - endif() - endif() -endfunction() - - -################################################################################ -#! o3de_template_path: -# -# \arg:template_path returns the path of the o3de template folder with name template_name -# \arg:template_name name of the template -################################################################################ -function(o3de_template_path o3de_json_file template_path) - o3de_template_id(${o3de_json_file} template_name) - if(template_name) - o3de_find_template_folder(${template_name} template_folder) - if(template_folder) - set(${template_path} ${template_folder} PARENT_SCOPE) - endif() - endif() -endfunction() - - -################################################################################ -#! o3de_repo_path: -# -# \arg:repo_path returns the path of the o3de repo folder with name repo_name -# \arg:repo_name name of the repo -################################################################################ -function(o3de_repo_path o3de_json_file repo_path) - o3de_repo_id(${o3de_json_file} repo_name) - if(repo_name) - o3de_find_repo_folder(${repo_name} repo_folder) - if(repo_folder) - set(${repo_path} ${repo_folder} PARENT_SCOPE) - endif() - endif() -endfunction() - - -################################################################################ -#! o3de_restricted_path: -# -# \arg:restricted_path returns the path of the o3de restricted folder with name restricted_name -# \arg:restricted_name name of the restricted -################################################################################ -function(o3de_restricted_path o3de_json_file restricted_path) - o3de_restricted_id(${o3de_json_file} restricted_name) - if(restricted_name) - o3de_find_restricted_folder(${restricted_name} restricted_folder) - if(restricted_folder) - set(${restricted_path} ${restricted_folder} PARENT_SCOPE) - endif() - endif() -endfunction() diff --git a/engine.json b/engine.json index 22ac2512f5..09bb3f5ff6 100644 --- a/engine.json +++ b/engine.json @@ -1,7 +1,98 @@ { "engine_name": "o3de", - "restricted": "o3de", + "restricted_name": "o3de", "FileVersion": 1, "O3DEVersion": "0.0.0.0", - "O3DECopyrightYear": 2021 + "O3DECopyrightYear": 2021, + "O3DEBuildNumber": 0, + "external_subdirectories": [ + "Gems/Achievements", + "Gems/AssetMemoryAnalyzer", + "Gems/AssetValidation", + "Gems/Atom", + "Gems/AtomContent", + "Gems/AtomLyIntegration", + "Gems/AtomTressFX", + "Gems/AudioEngineWwise", + "Gems/AudioSystem", + "Gems/AutomatedLauncherTesting", + "Gems/AWSClientAuth", + "Gems/AWSCore", + "Gems/AWSMetrics", + "Gems/Blast", + "Gems/Camera", + "Gems/CameraFramework", + "Gems/CertificateManager", + "Gems/CrashReporting", + "Gems/CustomAssetExample", + "Gems/DebugDraw", + "Gems/DevTextures", + "Gems/EditorPythonBindings", + "Gems/EMotionFX", + "Gems/ExpressionEvaluation", + "Gems/FastNoise", + "Gems/GameState", + "Gems/GameStateSamples", + "Gems/Gestures", + "Gems/GradientSignal", + "Gems/GraphCanvas", + "Gems/GraphModel", + "Gems/HttpRequestor", + "Gems/ImGui", + "Gems/InAppPurchases", + "Gems/LandscapeCanvas", + "Gems/LmbrCentral", + "Gems/LocalUser", + "Gems/LyShine", + "Gems/LyShineExamples", + "Gems/Maestro", + "Gems/MessagePopup", + "Gems/Metastream", + "Gems/Microphone", + "Gems/Multiplayer", + "Gems/MultiplayerCompression", + "Gems/NvCloth", + "Gems/PBSreferenceMaterials", + "Gems/PhysicsEntities", + "Gems/PhysX", + "Gems/PhysXDebug", + "Gems/PhysXSamples", + "Gems/Prefab", + "Gems/Presence", + "Gems/PrimitiveAssets", + "Gems/PythonAssetBuilder", + "Gems/QtForPython", + "Gems/RADTelemetry", + "Gems/SaveData", + "Gems/SceneLoggingExample", + "Gems/SceneProcessing", + "Gems/ScriptCanvas", + "Gems/ScriptCanvasDeveloper", + "Gems/ScriptCanvasPhysics", + "Gems/ScriptCanvasTesting", + "Gems/ScriptedEntityTweener", + "Gems/ScriptEvents", + "Gems/SliceFavorites", + "Gems/StartingPointCamera", + "Gems/StartingPointInput", + "Gems/StartingPointMovement", + "Gems/SurfaceData", + "Gems/TestAssetBuilder", + "Gems/TextureAtlas", + "Gems/TickBusOrderViewer", + "Gems/Twitch", + "Gems/UiBasics", + "Gems/Vegetation", + "Gems/Vegetation_Gem_Assets", + "Gems/VideoPlaybackFramework", + "Gems/VirtualGamepad", + "Gems/WhiteBox" + ], + "projects": [ + "AutomatedTesting" + ], + "templates": [ + "Templates/DefaultGem", + "Templates/DefaultProject" + ] } diff --git a/python/get_python.bat b/python/get_python.bat index e9f18441b5..e11c4ab92f 100644 --- a/python/get_python.bat +++ b/python/get_python.bat @@ -25,7 +25,8 @@ call python.cmd --version > NUL IF !ERRORLEVEL!==0 ( echo get_python.bat: Python is already installed: call python.cmd --version - call "%CMD_DIR%\pip.cmd" install -r "%CMD_DIR%/requirements.txt" --quiet --disable-pip-version-check + call "%CMD_DIR%\pip.cmd" install -r "%CMD_DIR%/requirements.txt" --quiet --disable-pip-version-check --no-warn-script-location + call "%CMD_DIR%\pip.cmd" install -e "%CMD_DIR%/../scripts/o3de" --quiet --disable-pip-version-check --no-warn-script-location --no-deps exit /B 0 ) @@ -65,6 +66,7 @@ if ERRORLEVEL 1 ( ) echo calling PIP to install requirements... -call "%CMD_DIR%\pip.cmd" install -r "%CMD_DIR%/requirements.txt" --disable-pip-version-check +call "%CMD_DIR%\pip.cmd" install -r "%CMD_DIR%/requirements.txt" --disable-pip-version-check --no-warn-script-location +call "%CMD_DIR%\pip.cmd" install -e "%CMD_DIR%/../scripts/o3de" --disable-pip-version-check --no-warn-script-location --no-deps exit /B %ERRORLEVEL% diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index d2843a9013..d3c9640665 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -11,5 +11,6 @@ add_subdirectory(detect_file_changes) add_subdirectory(commit_validation) +add_subdirectory(o3de) add_subdirectory(project_manager) add_subdirectory(ctest) diff --git a/scripts/build/Jenkins/Jenkinsfile b/scripts/build/Jenkins/Jenkinsfile index ae2779eba8..2f6be2b060 100644 --- a/scripts/build/Jenkins/Jenkinsfile +++ b/scripts/build/Jenkins/Jenkinsfile @@ -190,12 +190,14 @@ def CheckoutBootstrapScripts(String branchName) { doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'PruneStaleBranch'], + [$class: 'AuthorInChangelog'], [$class: 'SparseCheckoutPaths', sparseCheckoutPaths: [ [ $class: 'SparseCheckoutPath', path: 'scripts/build/Jenkins/' ], [ $class: 'SparseCheckoutPath', path: 'scripts/build/bootstrap/' ], [ $class: 'SparseCheckoutPath', path: 'scripts/build/Platform' ] ]], - [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true] + // Shallow checkouts break changelog computation. Do not enable. + [$class: 'CloneOption', noTags: false, reference: '', shallow: false] ], submoduleCfg: [], userRemoteConfigs: scm.userRemoteConfigs @@ -234,6 +236,7 @@ def CheckoutRepo(boolean disableSubmodules = false) { branches: scm.branches, extensions: [ [$class: 'PruneStaleBranch'], + [$class: 'AuthorInChangelog'], [$class: 'SubmoduleOption', disableSubmodules: disableSubmodules, recursiveSubmodules: true], [$class: 'CheckoutOption', timeout: 60] ], @@ -339,14 +342,17 @@ def TestMetrics(Map pipelineConfig, String workspace, String branchName, String checkout scm: [ $class: 'GitSCM', branches: [[name: '*/main']], - extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: 'mars']], + extensions: [ + [$class: 'AuthorInChangelog'], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'mars'] + ], userRemoteConfigs: [[url: "${env.MARS_REPO}", name: 'mars', credentialsId: "${env.GITHUB_USER}"]] ] withCredentials([usernamePassword(credentialsId: "${env.SERVICE_USER}", passwordVariable: 'apitoken', usernameVariable: 'username')]) { def command = "${pipelineConfig.PYTHON_DIR}/python.cmd -u mars/scripts/python/ctest_test_metric_scraper.py " + '-e jenkins.creds.user %username% -e jenkins.creds.pass %apitoken% ' + "-e jenkins.base_url ${env.JENKINS_URL} " + - "${cmakeBuildDir} ${branchName} %BUILD_NUMBER% AR ${configuration} ${repoName} " + "${cmakeBuildDir} ${branchName} %BUILD_NUMBER% AR ${configuration} ${repoName} --url ${env.BUILD_URL}" bat label: "Publishing ${buildJobName} Test Metrics", script: command } diff --git a/scripts/build/Platform/Android/build_config.json b/scripts/build/Platform/Android/build_config.json index d0fce80964..adaa417380 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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -60,7 +60,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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -76,7 +76,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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=FALSE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -93,13 +93,13 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"build\\windows_vs2019", - "CMAKE_OPTIONS":"-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS":"-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"AssetProcessorBatch", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", "ASSET_PROCESSOR_BINARY": "bin\\profile\\AssetProcessorBatch.exe", "ASSET_PROCESSOR_OPTIONS": "/zeroAnalysisMode --regset=\"/Amazon/AssetProcessor/Settings/Exclude Android/pattern=.*/DiffuseGlobalIllumination/.*precompiledshader\"", - "ASSET_PROCESSOR_PLATFORMS":"es3" + "ASSET_PROCESSOR_PLATFORMS":"android" } }, "release": { @@ -112,7 +112,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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" @@ -128,7 +128,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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "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_3RDPARTY_PATH!\\android-ndk\\r21d\" -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AutomatedTesting", "CMAKE_TARGET":"all", "CMAKE_BUILD_ARGS":"-j!NUMBER_OF_PROCESSORS!" diff --git a/scripts/build/Platform/Linux/build_config.json b/scripts/build/Platform/Linux/build_config.json index bbfc3e4269..ee6da77b29 100644 --- a/scripts/build/Platform/Linux/build_config.json +++ b/scripts/build/Platform/Linux/build_config.json @@ -37,7 +37,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all" } @@ -53,7 +53,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all" } @@ -66,7 +66,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all" } @@ -80,10 +80,10 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all", - "CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -L FRAMEWORK_googletest" + "CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -LE SUITE_sandbox -L FRAMEWORK_googletest" } }, "test_profile_nounity": { @@ -92,10 +92,10 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all", - "CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -L FRAMEWORK_googletest" + "CTEST_OPTIONS": "-E (Gem::EMotionFX.Editor.Tests|Gem::AWSClientAuth.Tests|Gem::AWSCore.Editor.Tests) -LE SUITE_sandbox -L FRAMEWORK_googletest" } }, "asset_profile": { @@ -108,7 +108,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "AssetProcessorBatch", "ASSET_PROCESSOR_BINARY": "bin/profile/AssetProcessorBatch", @@ -122,7 +122,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=FALSE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "AssetProcessorBatch", "ASSET_PROCESSOR_BINARY": "bin/profile/AssetProcessorBatch", @@ -140,10 +140,29 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", - "CTEST_OPTIONS": "-L \"(SUITE_periodic)\"" + "CTEST_OPTIONS": "-L (SUITE_periodic)" + } + }, + "sandbox_test_profile": { + "TAGS": [ + "nightly-incremental", + "nightly-clean", + "weekly-build-metrics" + ], + "PIPELINE_ENV": { + "ON_FAILURE_MARK": "UNSTABLE" + }, + "COMMAND": "build_test_linux.sh", + "PARAMETERS": { + "CONFIGURATION": "profile", + "OUTPUT_DIRECTORY": "build/linux", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_LY_PROJECTS": "AutomatedTesting", + "CMAKE_TARGET": "all", + "CTEST_OPTIONS": "-L (SUITE_sandbox)" } }, "benchmark_test_profile": { @@ -156,10 +175,10 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", - "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\"" + "CTEST_OPTIONS": "-L (SUITE_benchmark)" } }, "release": { @@ -172,7 +191,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build/linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all" } @@ -187,7 +206,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build/mono_linux", - "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4 -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DCMAKE_C_COMPILER=clang-6.0 -DCMAKE_CXX_COMPILER=clang++-6.0 -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE -DLY_PARALLEL_LINK_JOBS=4", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "all" } diff --git a/scripts/build/Platform/Mac/build_config.json b/scripts/build/Platform/Mac/build_config.json index f312279fe6..971e5e47a1 100644 --- a/scripts/build/Platform/Mac/build_config.json +++ b/scripts/build/Platform/Mac/build_config.json @@ -37,7 +37,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } @@ -51,7 +51,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } @@ -66,7 +66,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=FALSE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } @@ -81,12 +81,12 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "AssetProcessorBatch", "ASSET_PROCESSOR_BINARY": "bin/profile/AssetProcessorBatch", "ASSET_PROCESSOR_OPTIONS": "/zeroAnalysisMode", - "ASSET_PROCESSOR_PLATFORMS": "osx_gl" + "ASSET_PROCESSOR_PLATFORMS": "mac" } }, "periodic_test_profile": { @@ -99,7 +99,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", "CTEST_OPTIONS": "-L \"(SUITE_periodic)\"" @@ -115,7 +115,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", "CTEST_OPTIONS": "-L \"(SUITE_benchmark)\"" @@ -131,7 +131,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build/mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } @@ -146,7 +146,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build/mono_mac", - "CMAKE_OPTIONS": "-G Xcode -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD" } diff --git a/scripts/build/Platform/Windows/build_config.json b/scripts/build/Platform/Windows/build_config.json index ee34bae3e3..38cd7d6ad8 100644 --- a/scripts/build/Platform/Windows/build_config.json +++ b/scripts/build/Platform/Windows/build_config.json @@ -87,7 +87,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -101,7 +101,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_BUILD_WITH_INCREMENTAL_LINKING_DEBUG=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -119,7 +119,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -135,7 +135,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=FALSE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -150,7 +150,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -171,7 +171,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -190,7 +190,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "AssetProcessorBatch", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -209,7 +209,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_periodic", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -231,7 +231,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_sandbox", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -250,7 +250,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "TEST_SUITE_benchmark", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo", @@ -269,7 +269,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -285,7 +285,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build\\mono_windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_MONOLITHIC_GAME=TRUE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -300,7 +300,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_DISABLE_TEST_MODULES=TRUE -DCMAKE_INSTALL_PREFIX=install -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DLY_DISABLE_TEST_MODULES=TRUE", "CMAKE_LY_PROJECTS": "", "CMAKE_TARGET": "INSTALL", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" @@ -332,7 +332,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build\\windows_vs2019", - "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DCMAKE_MODULE_PATH=!WORKSPACE!/o3de/build/windows_vs2019/install/cmake", + "CMAKE_OPTIONS": "-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DCMAKE_MODULE_PATH=!WORKSPACE!/o3de/install/cmake", "CMAKE_LY_PROJECTS": "", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" diff --git a/scripts/build/Platform/Windows/package_build_config.json b/scripts/build/Platform/Windows/package_build_config.json index 40f479a098..a5ca861377 100644 --- a/scripts/build/Platform/Windows/package_build_config.json +++ b/scripts/build/Platform/Windows/package_build_config.json @@ -4,7 +4,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "windows_vs2017", - "CMAKE_OPTIONS": "-G \"Visual Studio 15 2017\" -A x64 -T host=x64 -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G \"Visual Studio 15 2017\" -A x64 -T host=x64 -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AtomTest;AtomSampleViewer", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m:4 /p:CL_MPCount=!HALF_PROCESSORS! /nologo" @@ -15,7 +15,7 @@ "PARAMETERS": { "CONFIGURATION":"profile", "OUTPUT_DIRECTORY":"windows_vs2019", - "CMAKE_OPTIONS":"-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"!WORKSPACE!/home\" -DO3DE_REGISTER_ENGINE_PATH=\"!WORKSPACE!/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS":"-G \"Visual Studio 16 2019\" -DCMAKE_SYSTEM_VERSION=10.0 -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS":"AtomTest;AtomSampleViewer", "CMAKE_TARGET":"ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "/m /nologo" diff --git a/scripts/build/Platform/Windows/pipeline.json b/scripts/build/Platform/Windows/pipeline.json index 5f10ccc7ae..622fa9d5ae 100644 --- a/scripts/build/Platform/Windows/pipeline.json +++ b/scripts/build/Platform/Windows/pipeline.json @@ -1,6 +1,6 @@ { "ENV": { - "NODE_LABEL": "windows-047e5cdf", + "NODE_LABEL": "windows-b3c8994f1", "LY_3RDPARTY_PATH": "C:/ly/3rdParty", "TIMEOUT": 30, "WORKSPACE": "D:/workspace", diff --git a/scripts/build/Platform/iOS/build_config.json b/scripts/build/Platform/iOS/build_config.json index d689c600a1..2d9c57f6ee 100644 --- a/scripts/build/Platform/iOS/build_config.json +++ b/scripts/build/Platform/iOS/build_config.json @@ -27,7 +27,7 @@ "PARAMETERS": { "CONFIGURATION": "debug", "OUTPUT_DIRECTORY": "build/ios", - "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "-destination generic/platform=iOS" @@ -44,7 +44,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/ios", - "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "-destination generic/platform=iOS" @@ -60,7 +60,7 @@ "PARAMETERS": { "CONFIGURATION": "profile", "OUTPUT_DIRECTORY": "build/ios", - "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=FALSE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=FALSE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "-destination generic/platform=iOS" @@ -94,7 +94,7 @@ "PARAMETERS": { "CONFIGURATION": "release", "OUTPUT_DIRECTORY": "build/ios", - "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE -DO3DE_HOME_PATH=\"${WORKSPACE}/home\" -DO3DE_REGISTER_ENGINE_PATH=\"${WORKSPACE}/o3de\" -DO3DE_REGISTER_THIS_ENGINE=TRUE", + "CMAKE_OPTIONS": "-G Xcode -DCMAKE_TOOLCHAIN_FILE=cmake/Platform/iOS/Toolchain_ios.cmake -DLY_MONOLITHIC_GAME=TRUE -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=FALSE -DLY_IOS_CODE_SIGNING_IDENTITY=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS=\"\" -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=FALSE -DLY_UNITY_BUILD=TRUE", "CMAKE_LY_PROJECTS": "AutomatedTesting", "CMAKE_TARGET": "ALL_BUILD", "CMAKE_NATIVE_BUILD_ARGS": "-destination generic/platform=iOS" diff --git a/scripts/build/build_node/Platform/Linux/install-ubuntu-python3.sh b/scripts/build/build_node/Platform/Linux/install-ubuntu-python3.sh new file mode 100755 index 0000000000..d0855aff43 --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/install-ubuntu-python3.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +# This script must be run as root +if [[ $EUID -ne 0 ]] +then + echo "This script must be run as root (sudo)" + exit 1 +fi + +# Install python3 if necessary +python3 --version >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo Installing Python3 + apt-get install python3 + + if [ $? -ne 0 ] + then + echo Error installing python3 + exit 1 + fi + +else + PYTHON_VERSION=$(python3 --version) + echo Python3 already installed \($PYTHON_VERSION\) +fi + +# Install python3 pip if necessary +pip3 --version >/dev/null 2>&1 +if [ $? -ne 0 ] +then + echo Installing Python3 PIP + apt-get install -y python3-pip + + if [ $? -ne 0 ] + then + echo Error installing python3 + exit 1 + fi + +else + PYTHON_VERSION=$(pip3 --version | awk '{print $2}') + echo Python3 Pip already installed \($PYTHON_VERSION\) +fi + + +# Read from the package list and process each package +PIP_REQUIREMENTS_FILE=requirements.txt + +pip3 install -r $PIP_REQUIREMENTS_FILE +if [ $? -ne 0 ] +then + echo Error installing python3 + exit 1 +fi + + +echo Python3 setup complete +exit 0 diff --git a/scripts/build/build_node/Platform/Linux/requirements.txt b/scripts/build/build_node/Platform/Linux/requirements.txt new file mode 100644 index 0000000000..1a466c03f8 --- /dev/null +++ b/scripts/build/build_node/Platform/Linux/requirements.txt @@ -0,0 +1,43 @@ +boto3==1.16.18 \ + --hash=sha256:51c419d890ae216b9b031be31f3182739dc3deb5b64351f286bffca2818ddb35 \ + --hash=sha256:d70d21ea137d786e84124639a62be42f92f4b09472ebfb761156057c92dc5366 +psutil==5.8.0 \ + --hash=sha256:0066a82f7b1b37d334e68697faba68e5ad5e858279fd6351c8ca6024e8d6ba64 \ + --hash=sha256:02b8292609b1f7fcb34173b25e48d0da8667bc85f81d7476584d889c6e0f2131 \ + --hash=sha256:0ae6f386d8d297177fd288be6e8d1afc05966878704dad9847719650e44fc49c \ + --hash=sha256:0c9ccb99ab76025f2f0bbecf341d4656e9c1351db8cc8a03ccd62e318ab4b5c6 \ + --hash=sha256:0dd4465a039d343925cdc29023bb6960ccf4e74a65ad53e768403746a9207023 \ + --hash=sha256:12d844996d6c2b1d3881cfa6fa201fd635971869a9da945cf6756105af73d2df \ + --hash=sha256:1bff0d07e76114ec24ee32e7f7f8d0c4b0514b3fae93e3d2aaafd65d22502394 \ + --hash=sha256:245b5509968ac0bd179287d91210cd3f37add77dad385ef238b275bad35fa1c4 \ + --hash=sha256:28ff7c95293ae74bf1ca1a79e8805fcde005c18a122ca983abf676ea3466362b \ + --hash=sha256:36b3b6c9e2a34b7d7fbae330a85bf72c30b1c827a4366a07443fc4b6270449e2 \ + --hash=sha256:52de075468cd394ac98c66f9ca33b2f54ae1d9bff1ef6b67a212ee8f639ec06d \ + --hash=sha256:5da29e394bdedd9144c7331192e20c1f79283fb03b06e6abd3a8ae45ffecee65 \ + --hash=sha256:61f05864b42fedc0771d6d8e49c35f07efd209ade09a5afe6a5059e7bb7bf83d \ + --hash=sha256:6223d07a1ae93f86451d0198a0c361032c4c93ebd4bf6d25e2fb3edfad9571ef \ + --hash=sha256:6323d5d845c2785efb20aded4726636546b26d3b577aded22492908f7c1bdda7 \ + --hash=sha256:6ffe81843131ee0ffa02c317186ed1e759a145267d54fdef1bc4ea5f5931ab60 \ + --hash=sha256:74f2d0be88db96ada78756cb3a3e1b107ce8ab79f65aa885f76d7664e56928f6 \ + --hash=sha256:74fb2557d1430fff18ff0d72613c5ca30c45cdbfcddd6a5773e9fc1fe9364be8 \ + --hash=sha256:90d4091c2d30ddd0a03e0b97e6a33a48628469b99585e2ad6bf21f17423b112b \ + --hash=sha256:90f31c34d25b1b3ed6c40cdd34ff122b1887a825297c017e4cbd6796dd8b672d \ + --hash=sha256:99de3e8739258b3c3e8669cb9757c9a861b2a25ad0955f8e53ac662d66de61ac \ + --hash=sha256:c6a5fd10ce6b6344e616cf01cc5b849fa8103fbb5ba507b6b2dee4c11e84c935 \ + --hash=sha256:ce8b867423291cb65cfc6d9c4955ee9bfc1e21fe03bb50e177f2b957f1c2469d \ + --hash=sha256:d225cd8319aa1d3c85bf195c4e07d17d3cd68636b8fc97e6cf198f782f99af28 \ + --hash=sha256:ea313bb02e5e25224e518e4352af4bf5e062755160f77e4b1767dd5ccb65f876 \ + --hash=sha256:ea372bcc129394485824ae3e3ddabe67dc0b118d262c568b4d2602a7070afdb0 \ + --hash=sha256:f4634b033faf0d968bb9220dd1c793b897ab7f1189956e1aa9eae752527127d3 \ + --hash=sha256:fcc01e900c1d7bee2a37e5d6e4f9194760a93597c97fee89c4ae51701de03563 +requests==2.25.1 \ + --hash=sha256:27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804 \ + --hash=sha256:c210084e36a42ae6b9219e00e48287def368a26d03a048ddad7bfee44f75871e +traceback2==1.4.0 \ + --hash=sha256:05acc67a09980c2ecfedd3423f7ae0104839eccb55fc645773e1caa0951c3030 \ + --hash=sha256:8253cebec4b19094d67cc5ed5af99bf1dba1285292226e98a31929f87a5d6b23 +urllib3==1.26.4 \ + --hash=sha256:2f4da4594db7e1e110a944bb1b551fdf4e6c136ad42e4234131391e21eb5b0df \ + --hash=sha256:e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937 +tempfile2==0.1.1 \ + --hash=sha256:77fdd256c16804053d3d588168b79595099ea5e874c3fb171893b0ababd10340 diff --git a/scripts/build/lambda/trigger_first_build.py b/scripts/build/lambda/trigger_first_build.py index 6ebe09f7ee..3b4587e737 100755 --- a/scripts/build/lambda/trigger_first_build.py +++ b/scripts/build/lambda/trigger_first_build.py @@ -53,7 +53,7 @@ def lambda_handler(event, context): backoff = 30 status_list = [404] # Retry if the branch doesn't exist yet and provide time for Jenkins to discover it. method_list = ['POST'] - retry_config = Retry(total=retries, backoff_factor=backoff, status_forcelist=status_list, method_whitelist=method_list) + retry_config = Retry(total=retries, backoff_factor=backoff, status_forcelist=status_list, allowed_methods=method_list) session = requests.Session() session.mount('https://', HTTPAdapter(max_retries=retry_config)) diff --git a/scripts/build/package/package.py b/scripts/build/package/package.py index 96b39f0753..4cb09f3918 100755 --- a/scripts/build/package/package.py +++ b/scripts/build/package/package.py @@ -25,9 +25,6 @@ from glob3 import glob def package(options): package_env = PackageEnv(options.platform, options.type, options.package_env) - # Override values in bootstrap.cfg for PC package - override_bootstrap_cfg(package_env) - if not package_env.get('SKIP_BUILD'): print(package_env.get('SKIP_BUILD')) print('SKIP_BUILD is False, running CMake build...') @@ -51,34 +48,6 @@ def get_python_path(package_env): return os.path.join(package_env.get('ENGINE_ROOT'), 'python', 'python.sh') -def override_bootstrap_cfg(package_env): - print('Override values in bootstrap.cfg') - engine_root = package_env.get('ENGINE_ROOT') - bootstrap_path = os.path.join(engine_root, 'bootstrap.cfg') - replace_values = {'project_path':'{}'.format(package_env.get('BOOTSTRAP_CFG_GAME_FOLDER'))} - try: - with open(bootstrap_path, 'r') as bootstrap_cfg: - content = bootstrap_cfg.read() - except: - error('Cannot read file {}'.format(bootstrap_path)) - content = content.split('\n') - new_content = [] - for line in content: - if not line.startswith('--'): - strs = line.split('=') - if len(strs): - key = strs[0].strip(' ') - if key in replace_values: - line = '{}={}'.format(key, replace_values[key]) - new_content.append(line) - try: - with open(bootstrap_path, 'w') as out: - out.write('\n'.join(new_content)) - except: - error('Cannot write to file {}'.format(bootstrap_path)) - print('{} updated with value {}'.format(bootstrap_path, replace_values)) - - def cmake_build(package_env): build_targets = package_env.get('BUILD_TARGETS') for build_target in build_targets: diff --git a/scripts/bundler/gen_shaders.py b/scripts/bundler/gen_shaders.py index 46857179b1..bfb60287af 100644 --- a/scripts/bundler/gen_shaders.py +++ b/scripts/bundler/gen_shaders.py @@ -163,11 +163,11 @@ def add_shaders_types(): shaders.append(gl4) gles3 = _ShaderType('GLES3', 'GLSL_HLSLcc') - gles3.add_configuration('Android', 'es3') + gles3.add_configuration('Android', 'android') shaders.append(gles3) metal = _ShaderType('METAL', 'METAL_LLVM_DXC') - metal.add_configuration('Mac', 'osx_gl') + metal.add_configuration('Mac', 'mac') metal.add_configuration('iOS', 'ios') shaders.append(metal) diff --git a/scripts/ctest/result_processing/result_processing.py b/scripts/ctest/result_processing/result_processing.py index 791b15fece..e8ba78265c 100755 --- a/scripts/ctest/result_processing/result_processing.py +++ b/scripts/ctest/result_processing/result_processing.py @@ -118,8 +118,10 @@ def _merge_xml_results(xml_results_path, prefix, merged_xml_name, parent_element def _aggregate_attributes(nodes): for node in nodes: for attribute in attributes_to_aggregate: - value = node.attrib[attribute.name] - temp_dict[attribute.name] += attribute.func(value) + if attribute.name in node.attrib: + temp_dict[attribute.name] += attribute.func(node.attrib[attribute.name]) + else: + print("Failed to find key {} in {}, continuing...".format(attribute.name, node.tag)) base_tree = xet.parse(xml_files[0]) base_tree_root = base_tree.getroot() diff --git a/scripts/o3de.bat b/scripts/o3de.bat index 0a65b722d7..9031933e61 100644 --- a/scripts/o3de.bat +++ b/scripts/o3de.bat @@ -12,15 +12,15 @@ REM pushd %~dp0% CD %~dp0.. -SET BASE_PATH=%CD% +SET "BASE_PATH=%CD%" CD %~dp0 -SET PYTHON_DIRECTORY=%BASE_PATH%\python +SET "PYTHON_DIRECTORY=%BASE_PATH%\python" IF EXIST "%PYTHON_DIRECTORY%" GOTO pythonPathAvailable GOTO pythonDirNotFound :pythonPathAvailable SET PYTHON_EXECUTABLE=%PYTHON_DIRECTORY%\python.cmd IF NOT EXIST "%PYTHON_EXECUTABLE%" GOTO pythonExeNotFound -CALL "%PYTHON_EXECUTABLE%" %BASE_PATH%\scripts\o3de.py %* +CALL "%PYTHON_EXECUTABLE%" "%BASE_PATH%\scripts\o3de.py" %* GOTO end :pythonDirNotFound ECHO Python directory not found: %PYTHON_DIRECTORY% diff --git a/scripts/o3de.py b/scripts/o3de.py index dbb9c53e4b..8d7532878c 100755 --- a/scripts/o3de.py +++ b/scripts/o3de.py @@ -10,23 +10,54 @@ # import argparse +import pathlib import sys -import os - -# Resolve the common python module -ROOT_DEV_PATH = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) -if ROOT_DEV_PATH not in sys.path: - sys.path.append(ROOT_DEV_PATH) - -from cmake.Tools import engine_template -from cmake.Tools import global_project -from cmake.Tools import registration def add_args(parser, subparsers) -> None: - global_project.add_args(parser, subparsers) - engine_template.add_args(parser, subparsers) - registration.add_args(parser, subparsers) + """ + add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be + invoked by o3de.py + Ex o3de.py can invoke the register downloadable commands by importing register, + call add_args and execute: python o3de.py register --gem-path "C:/TestGem" + :param parser: the caller instantiates a parser and passes it in here + :param subparsers: the caller instantiates subparsers and passes it in here + """ + + # As o3de.py shares the same name as the o3de package attempting to use a regular + # from o3de import line tries to import from the current o3de.py script and not the package + # So the {current script directory} / 'o3de' is added to the front of the sys.path + script_dir = pathlib.Path(__file__).parent + o3de_package_dir = (script_dir / 'o3de').resolve() + # add the scripts/o3de directory to the front of the sys.path + sys.path.insert(0, str(o3de_package_dir)) + from o3de import engine_template, global_project, register, print_registration, get_registration, \ + enable_gem, disable_gem, sha256 + # Remove the temporarily added path + sys.path = sys.path[1:] + + # global_project + global_project.add_args(subparsers) + # engine templaate + engine_template.add_args(subparsers) + + # register + register.add_args(subparsers) + + # show + print_registration.add_args(subparsers) + + # get-registered + get_registration.add_args(subparsers) + + # add a gem to a project + enable_gem.add_args(subparsers) + + # remove a gem from a project + disable_gem.add_args(subparsers) + + # sha256 + sha256.add_args(subparsers) if __name__ == "__main__": diff --git a/scripts/o3de/CMakeLists.txt b/scripts/o3de/CMakeLists.txt new file mode 100644 index 0000000000..9819c1cd6e --- /dev/null +++ b/scripts/o3de/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +add_subdirectory(tests) diff --git a/scripts/o3de/README.txt b/scripts/o3de/README.txt new file mode 100644 index 0000000000..51bbf78cbd --- /dev/null +++ b/scripts/o3de/README.txt @@ -0,0 +1,41 @@ +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + +INTRODUCTION +------------ + +o3de is a package of scripts containing functionality to register engine, projects, gems, +templates and download repositories with the o3de manifests +It also contains functionality for creating new projects, gems and templates as well +as querying existing gems and templates + + +REQUIREMENTS +------------ + + * Python 3.7.10 (64-bit) + +INSTALL +----------- +It is recommended to set up these these tools with O3DE's CMake build commands. +Assuming CMake is already setup on your operating system, below are some sample build commands: + cd /path/to/od3e/ + cmake -B windows_vs2019 -S . -G"Visual Studio 16" -DLY_3RDPARTY_PATH="%LY_3RDPARTY_PATH%" + +To manually install the project in development mode using your own installed Python interpreter: + cd /path/to/od3e/o3de + /path/to/your/python -m pip install -e . + + +UNINSTALLATION +-------------- + +The preferred way to uninstall the project is: + /path/to/your/python -m pip uninstall o3de diff --git a/Tests/Atom/__init__.py b/scripts/o3de/o3de/__init__.py old mode 100755 new mode 100644 similarity index 98% rename from Tests/Atom/__init__.py rename to scripts/o3de/o3de/__init__.py index 36d43bea05..4d5680a30d --- a/Tests/Atom/__init__.py +++ b/scripts/o3de/o3de/__init__.py @@ -1,9 +1,10 @@ -# """ +# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. - +# # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# diff --git a/scripts/o3de/o3de/cmake.py b/scripts/o3de/o3de/cmake.py new file mode 100644 index 0000000000..dfcce708eb --- /dev/null +++ b/scripts/o3de/o3de/cmake.py @@ -0,0 +1,106 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +Contains methods for query CMake gem target information +""" + +import logging +import os +import pathlib + +from o3de import manifest + +logger = logging.getLogger() +logging.basicConfig() + +def get_project_gems(project_path: pathlib.Path, + platform: str = 'Common') -> set: + return get_gems_from_cmake_file(get_enabled_gem_cmake_file(project_path=project_path, platform=platform)) + + +def get_enabled_gems(cmake_file: pathlib.Path) -> set: + """ + Gets a list of enabled gems from the cmake file + :param cmake_file: path to the cmake file + :return: set of gem targets found + """ + cmake_file = pathlib.Path(cmake_file).resolve() + + if not cmake_file.is_file(): + logger.error(f'Failed to locate cmake file {cmake_file}') + return set() + + enable_gem_start_marker = 'set(ENABLED_GEMS' + enable_gem_end_marker = ')' + gem_target_set = set() + with cmake_file.open('r') as s: + in_gem_list = False + for line in s: + line = line.strip() + if line.startswith(enable_gem_start_marker): + # Set the flag to indicate that we are in the ENABLED_GEMS variable + in_gem_list = True + # Skip pass the 'set(ENABLED_GEMS' marker just in case their are gems declared on the same line + line = line[len(enable_gem_start_marker):] + if in_gem_list: + # Since we are inside the ENABLED_GEMS variable determine if the line has the end_marker of ')' + if line.endswith(enable_gem_end_marker): + # Strip away the line end marker + line = line[:-len(enable_gem_end_marker)] + # Set the flag to indicate that we are no longer in the ENABLED_GEMS variable after this line + in_gem_list = False + # Split the rest of the line on whitespace just in case there are multiple gems in a line + gem_name_list = line.split() + gem_target_set.update(gem_name_list) + + return gem_target_set + + +def get_project_gem_paths(project_path: pathlib.Path, + platform: str = 'Common') -> set: + gem_names = get_project_gems(project_path, platform) + gem_paths = set() + for gem_name in gem_names: + gem_paths.add(manifest.get_registered(gem_name=gem_name)) + return gem_paths + + +def get_enabled_gem_cmake_file(project_name: str = None, + project_path: str or pathlib.Path = None, + platform: str = 'Common') -> pathlib.Path or None: + """ + get the standard cmake file name for a particular type of dependency + :param gem_name: name of the gem, resolves gem_path + :param gem_path: path of the gem + :return: list of gem targets + """ + if not project_name and not project_path: + logger.error(f'Must supply either a Project Name or Project Path.') + return None + + if project_name and not project_path: + project_path = manifest.get_registered(project_name=project_name) + + project_path = pathlib.Path(project_path).resolve() + enable_gem_filename = "enabled_gems.cmake" + + if platform == 'Common': + project_code_dir = project_path / 'Gem/Code' + if project_code_dir.is_dir(): + dependencies_file_path = project_code_dir / enable_gem_filename + return dependencies_file_path.resolve() + return (project_path / 'Code' / enable_gem_filename).resolve() + else: + project_code_dir = project_path / 'Gem/Code/Platform' / platform + if project_code_dir.is_dir(): + dependencies_file_path = project_code_dir / enable_gem_filename + return dependencies_file_path.resolve() + return (project_path / 'Code/Platform' / platform / enable_gem_filename).resolve() diff --git a/scripts/o3de/o3de/disable_gem.py b/scripts/o3de/o3de/disable_gem.py new file mode 100644 index 0000000000..61d71445f0 --- /dev/null +++ b/scripts/o3de/o3de/disable_gem.py @@ -0,0 +1,211 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +Contains methods for removing a gem from a project +""" + +import argparse +import logging +import os +import pathlib +import sys + +from o3de import cmake, manifest + +logger = logging.getLogger() +logging.basicConfig() + + +def remove_gem_dependency(cmake_file: pathlib.Path, + gem_name: str) -> int: + """ + removes a gem dependency from a cmake file + :param cmake_file: path to the cmake file + :param gem_name: name of the gem + :return: 0 for success or non 0 failure code + """ + if not cmake_file.is_file(): + logger.error(f'Failed to locate cmake file {cmake_file}') + return 1 + + # on a line by basis, remove any line with {gem_name} + t_data = [] + # Remove the gem from the enabled_gem file by skipping the gem name entry + removed = False + with open(cmake_file, 'r') as s: + for line in s: + if gem_name == line.strip(): + removed = True + else: + t_data.append(line) + + if not removed: + logger.error(f'Failed to remove {gem_name} from cmake file {cmake_file}') + return 1 + + # write the cmake + with open(cmake_file, 'w') as s: + s.writelines(t_data) + + return 0 + + +def disable_gem_in_project(gem_name: str = None, + gem_path: pathlib.Path = None, + project_name: str = None, + project_path: pathlib.Path = None, + enabled_gem_file: pathlib.Path = None) -> int: + """ + disable a gem in a projects enabled_gems.cmake file + :param gem_name: name of the gem to add + :param gem_path: path to the gem to add + :param project_name: name of the project to add the gem to + :param project_path: path to the project to add the gem to + :param enabled_gem_file: File to remove enabled gem from + :return: 0 for success or non 0 failure code + """ + + # we need either a project name or path + if not project_name and not project_path: + logger.error(f'Must either specify a Project path or Project Name.') + return 1 + + # if project name resolve it into a path + if project_name and not project_path: + project_path = manifest.get_registered(project_name=project_name) + if not project_path: + logger.error(f'Unable to locate project path from the registered manifest.json files:' + f' {str(pathlib.Path("~/.o3de/o3de_manifest.json").expanduser())}, engine.json') + return 1 + + project_path = pathlib.Path(project_path).resolve() + if not project_path.is_dir(): + logger.error(f'Project path {project_path} is not a folder.') + return 1 + + # We need either a gem name or path + if not gem_name and not gem_path: + logger.error(f'Must either specify a Gem path or Gem Name.') + return 1 + + # if gem name resolve it into a path + if gem_name and not gem_path: + gem_path = manifest.get_registered(gem_name=gem_name) + if not gem_path: + logger.error(f'Unable to locate gem path from the registered manifest.json files:' + f' {str(pathlib.Path.home() / ".o3de/manifest.json")},' + f' {project_path / "project.json"}, engine.json') + return 1 + gem_path = pathlib.Path(gem_path).resolve() + # make sure this gem already exists if we're adding. We can always remove a gem. + if not gem_path.is_dir(): + logger.error(f'Gem Path {gem_path} does not exist.') + return 1 + + + # Read gem.json from the gem path + gem_json_data = manifest.get_gem_json_data(gem_path=gem_path) + if not gem_json_data: + logger.error(f'Could not read gem.json content under {gem_path}.') + return 1 + + # when removing we will try to do as much as possible even with failures so ret_val will be the last error code + ret_val = 0 + + if not enabled_gem_file: + enabled_gem_file = cmake.get_enabled_gem_cmake_file(project_path=project_path) + + # make sure this is a project has an enabled gems file + if not enabled_gem_file.is_file(): + logger.error(f'Enabled gem file {enabled_gem_file} is not present.') + return 1 + # remove the gem + error_code = remove_gem_dependency(enabled_gem_file, gem_json_data['gem_name']) + if error_code: + ret_val = error_code + + return ret_val + + +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, + args.project_path, + args.enabled_gem_file) + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python disable_gem.py --project-path D:/Test --gem-name Atom + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-pp', '--project-path', type=pathlib.Path, required=False, + help='The path to the project.') + group.add_argument('-pn', '--project-name', type=str, required=False, + help='The name of the project.') + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-gp', '--gem-path', type=pathlib.Path, required=False, + help='The path to the gem.') + group.add_argument('-gn', '--gem-name', type=str, required=False, + help='The name of the gem.') + parser.add_argument('-egf', '--enabled-gem-file', type=pathlib.Path, required=False, + 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) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py disable-gem-from-cmake --project-path D:/Test --gem-name Atom + :param subparsers: the caller instantiates subparsers and passes it in here + """ + disable_gem_project_subparser = subparsers.add_parser('disable-gem') + add_parser_args(disable_gem_project_subparser) + + +def main(): + """ + Runs disable_gem_project.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/download.py b/scripts/o3de/o3de/download.py new file mode 100644 index 0000000000..6f1b82e754 --- /dev/null +++ b/scripts/o3de/o3de/download.py @@ -0,0 +1,240 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +Implements functionality for downloading o3de objecs either locally or from a URI +""" + +import argparse +import hashlib +import json +import logging +import pathlib +import shutil +import sys +import urllib.parse +import urllib.request + +from o3de import manifest, repo, utils, validation + +logger = logging.getLogger() +logging.basicConfig() + +def unzip_manifest_json_data(download_zip_path: pathlib.Path, zip_file_name: str) -> dict: + json_data = {} + with zipfile.ZipFile(download_zip_path, 'r') as zip_data: + with zip_data.open(zip_file_name) as manifest_json_file: + try: + json_data = json.load(manifest_json_file) + except json.JSONDecodeError as e: + logger.error(f'UnZip exception:{str(e)}') + + return json_data + +def validate_downloaded_zip_sha256(download_uri_json_data: dict, download_zip_path: pathlib.Path, + manifest_json_name) -> int: + # if the engine.json has a sha256 check it against a sha256 of the zip + try: + sha256A = download_uri_json_data['sha256'] + except KeyError as e: + logger.warn(f'SECURITY WARNING: The advertised o3de object you downloaded has no "sha256"!!! Be VERY careful!!!' + f' We cannot verify this is the actually the advertised object!!!') + else: + sha256B = hashlib.sha256(download_zip_path.open('rb').read()).hexdigest() + if sha256A != sha256B: + logger.error(f'SECURITY VIOLATION: Downloaded zip sha256 {sha256B} does not match' + f' the advertised "sha256":{sha256A} in the f{manifest_json_name}. Deleting unzipped files!!!') + shutil.rmtree(dest_path) + return 1 + + manifest_json_data = unzip_manifest_json_data(download_zip_path, manifest_json_name) + + # remove the sha256 if present in the advertised downloadable manifest json + # then compare it to the json in the zip, they should now be identical + try: + del download_uri_json_data['sha256'] + except KeyError as e: + pass + + sha256A = hashlib.sha256(json.dumps(download_uri_json_data, indent=4).encode('utf8')).hexdigest() + with unzipped_manifest_json.open('r') as s: + try: + unzipped_manifest_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to read manifest json {unzipped_manifest_json}. Unable to confirm this' + f' is the same template that was advertised.') + return 1 + sha256B = hashlib.sha256(json.dumps(unzipped_manifest_json_data, indent=4).encode('utf8')).hexdigest() + if sha256A != sha256B: + logger.error(f'SECURITY VIOLATION: Downloaded manifest json does not match' + f' the advertised manifest json. Deleting unzipped files!!!') + shutil.rmtree(dest_path) + return 1 + + return 0 + + +def get_downloadable(engine_name: str = None, + project_name: str = None, + gem_name: str = None, + template_name: str = None, + restricted_name: str = None) -> dict or None: + json_data = manifest.load_o3de_manifest() + try: + o3de_object_uris = json_data['repos'] + except KeyError as key_err: + logger.error(f'Unable to load repos from o3de manifest: {str(key_err)}') + return None + + manifest_json = 'repo.json' + search_func = lambda: repo.search_repo(manifest_json, engine_name, project_name, gem_name, template_name) + return repo.search_o3de_object(manifest_json, o3de_object_uris, search_func) + + +def download_o3de_object(object_name: str, default_folder_name: str, dest_path: str or pathlib.Path, + object_type: str, downloadable_kwarg_key) -> int: + if not dest_path: + dest_path = manifest.get_registered(default_folder=default_folder_name) + if not dest_path: + logger.error(f'Destination path not cannot be empty.') + return 1 + + dest_path = pathlib.Path(dest_path).resolve() + dest_path.mkdir(exist_ok=True) + + download_path = manifest.get_o3de_download_folder() / default_folder_name / object_name + download_path.mkdir(exist_ok=True) + download_zip_path = download_path / f'{object_type}.zip' + + downloadable_object_data = get_downloadable(**{downloadable_kwarg_key : object_name}) + if not downloadable_object_data: + logger.error(f'Downloadable o3de object {object_name} not found.') + return 1 + + origin = downloadable_json_data['origin'] + url = f'{origin}/object_type.zip' + parsed_uri = urllib.parse.urlparse(url) + + download_zip_result = utils.download_zip_file(parsed_uri, download_zip_path) + if download_zip_result != 0: + return download_zip_result + + return validate_downloaded_zip_sha256(downloadable_object_data, download_zip_path) + + +def download_engine(engine_name: str, + dest_path: str or pathlib.Path) -> int: + return download_o3de_object(engine_name, 'engines', dest_path, 'engine', 'engine_name') + + +def download_project(project_name: str, + dest_path: str or pathlib.Path) -> int: + return download_o3de_object(project_name, 'projects', dest_path, 'project', 'project_name') + + +def download_gem(gem_name: str, + dest_path: str or pathlib.Path) -> int: + return download_o3de_object(gem_name, 'gems', dest_path, 'gem', 'gem_name') + + +def download_template(template_name: str, + dest_path: str or pathlib.Path) -> int: + return download_o3de_object(template_name, 'templates', dest_path, 'template', 'template_name') + + + +def download_restricted(restricted_name: str, + dest_path: str or pathlib.Path) -> int: + return download_o3de_object(restricted_name, 'restricted', dest_path, 'restricted', 'restricted_name') + + +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) + elif args.project_name: + return download_project(args.project_name, + args.dest_path) + elif args.gem_nanme: + return download_gem(args.gem_name, + args.dest_path) + elif args.template_name: + return download_template(args.template_name, + args.dest_path) + + return 1 + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python download.py --engine-name "o3de" + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-e', '--engine-name', type=str, required=False, + help='Downloadable engine name.') + group.add_argument('-p', '--project-name', type=str, required=False, + help='Downloadable project name.') + group.add_argument('-g', '--gem-name', type=str, required=False, + help='Downloadable gem name.') + group.add_argument('-t', '--template-name', type=str, required=False, + help='Downloadable template name.') + parser.add_argument('-dp', '--dest-path', type=str, required=False, + default=None, + help='Optional destination folder to download into.' + ' i.e. download --project-name "AstomSamplerViewer" --dest-path "C:/projects"' + ' will result in C:/projects/AtomSampleViewer' + ' If blank will download to default object type folder') + + 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) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py download --engine-name "o3de" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + download_subparser = subparsers.add_parser('download') + add_parser_args(download_subparser) + + +def main(): + """ + Runs download.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +# Do not allow running the download.py script as a standalone script until it is reviewed by app-sec diff --git a/scripts/o3de/o3de/enable_gem.py b/scripts/o3de/o3de/enable_gem.py new file mode 100644 index 0000000000..0dee01e05e --- /dev/null +++ b/scripts/o3de/o3de/enable_gem.py @@ -0,0 +1,231 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +Contains command to add a gem to a project's enabled_gem.cmake file +""" + +import argparse +import json +import logging +import os +import pathlib +import sys + +from o3de import cmake, manifest, validation + +logger = logging.getLogger() +logging.basicConfig() + +def add_gem_dependency(cmake_file: pathlib.Path, + gem_name: str) -> int: + """ + adds a gem dependency to a cmake file + :param cmake_file: path to the cmake file + :param gem_name: name of the gem + :return: 0 for success or non 0 failure code + """ + if not cmake_file.is_file(): + logger.error(f'Failed to locate cmake file {str(cmake_file)}') + return 1 + + # on a line by basis, see if there already is {gem_name} + # find the first occurrence of a gem, copy its formatting and replace + # the gem name with the new one and append it + # if the gem is already present fail + t_data = [] + added = False + line_index_to_append = None + with open(cmake_file, 'r') as s: + line_index = 0 + for line in s: + if 'ENABLED_GEMS' in line: + line_index_to_append = line_index + if f'{gem_name}' == line.strip(): + logger.warning(f'{gem_name} is already enabled in file {str(cmake_file)}.') + return 0 + t_data.append(line) + line_index += 1 + + + indent = 4 + if line_index_to_append: + t_data[line_index_to_append] = f'{" " * indent}{gem_name}\n' + added = True + + # if we didn't add, then create a new set(ENABLED_GEMS) variable + # add a new gem, if empty the correct format is 1 tab=4spaces + if not added: + t_data.append('\n') + t_data.append('set(ENABLED_GEMS\n') + t_data.append(f'{" " * indent}{gem_name}\n') + t_data.append(')\n') + + # write the cmake + with open(cmake_file, 'w') as s: + s.writelines(t_data) + + return 0 + + +def enable_gem_in_project(gem_name: str = None, + gem_path: pathlib.Path = None, + project_name: str = None, + project_path: pathlib.Path = None, + enabled_gem_file: pathlib.Path = None) -> int: + """ + enable a gem in a projects enabled_gems.cmake file + :param gem_name: name of the gem to add + :param gem_path: path to the gem to add + :param project_name: name of to the project to add the gem to + :param project_path: path to the project to add the gem to + :param enabled_gem_file_file: if this dependency goes/is in a specific file + :return: 0 for success or non 0 failure code + """ + # we need either a project name or path + if not project_name and not project_path: + logger.error(f'Must either specify a Project path or Project Name.') + return 1 + + # if project name resolve it into a path + if project_name and not project_path: + project_path = manifest.get_registered(project_name=project_name) + if not project_path: + logger.error(f'Unable to locate project path from the registered manifest.json files:' + f' {str(pathlib.Path.home() / ".o3de/manifest.json")}, engine.json') + return 1 + + project_path = pathlib.Path(project_path).resolve() + if not project_path.is_dir(): + logger.error(f'Project path {project_path} is not a folder.') + return 1 + + # we need either a gem name or path + if not gem_name and not gem_path: + logger.error(f'Must either specify a Gem path or Gem Name.') + return 1 + + # if gem name resolve it into a path + if gem_name and not gem_path: + gem_path = manifest.get_registered(gem_name=gem_name) + if not gem_path: + logger.error(f'Unable to locate gem path from the registered manifest.json files:' + f' {str(pathlib.Path( "~/.o3de/o3de_manifest.json").expanduser())},' + f' {project_path / "project.json"}, engine.json') + return 1 + + gem_path = pathlib.Path(gem_path).resolve() + # make sure this gem already exists if we're adding. We can always remove a gem. + if not gem_path.is_dir(): + logger.error(f'Gem Path {gem_path} does not exist.') + return 1 + + # Read gem.json from the gem path + gem_json_data = manifest.get_gem_json_data(gem_path=gem_path) + if not gem_json_data: + logger.error(f'Could not read gem.json content under {gem_path}.') + return 1 + + + ret_val = 0 + if enabled_gem_file: + # make sure this is a project has an enabled gems file + if not enabled_gem_file.is_file(): + logger.error(f'Enabled gem file {enabled_gem_file} is not present.') + return 1 + # add the gem + ret_val = add_gem_dependency(enabled_gem_file, gem_json_data['gem_name']) + + else: + # Find the path to enabled gem file. + # It will be created if it doesn't exist + project_enabled_gem_file = cmake.get_enabled_gem_cmake_file(project_path=project_path) + if not project_enabled_gem_file.is_file(): + project_enabled_gem_file.touch() + # add the gem + ret_val = add_gem_dependency(project_enabled_gem_file, gem_json_data['gem_name']) + + return ret_val + + +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, + args.project_path, + args.enabled_gem_file) + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python enable_gem.py --project-path "D:/TestProject" --gem-path "D:/TestGem" + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-pp', '--project-path', type=pathlib.Path, required=False, + help='The path to the project.') + group.add_argument('-pn', '--project-name', type=str, required=False, + help='The name of the project.') + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-gp', '--gem-path', type=pathlib.Path, required=False, + help='The path to the gem.') + group.add_argument('-gn', '--gem-name', type=str, required=False, + help='The name of the gem.') + parser.add_argument('-egf', '--enabled-gem-file', type=pathlib.Path, required=False, + 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) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py add-gem-to-project --project-path "D:/TestProject" --gem-path "D:/TestGem" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + enable_gem_project_subparser = subparsers.add_parser('enable-gem') + add_parser_args(enable_gem_project_subparser) + + +def main(): + """ + Runs enable_gem.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/cmake/Tools/engine_template.py b/scripts/o3de/o3de/engine_template.py similarity index 93% rename from cmake/Tools/engine_template.py rename to scripts/o3de/o3de/engine_template.py index 78de209ab4..63dec3e765 100755 --- a/cmake/Tools/engine_template.py +++ b/scripts/o3de/o3de/engine_template.py @@ -20,8 +20,8 @@ import json import uuid import re -from cmake.Tools import utils -import cmake.Tools.registration as registration + +from o3de import manifest, validation, utils logger = logging.getLogger() logging.basicConfig() @@ -79,7 +79,7 @@ restricted_platforms = { } template_file_name = 'template.json' - +this_script_parent = os.path.dirname(os.path.realpath(__file__)) def _transform(s_data: str, replacements: list, @@ -321,7 +321,7 @@ def _instantiate_template(template_json_data: dict, platform_json = f'{template_restricted_platform_path_rel}/{template_file_name}'.replace('//', '/') if os.path.isfile(platform_json): - if not registration.valid_o3de_template_json(platform_json): + if not validation.valid_o3de_template_json(platform_json): logger.error(f'Template json {platform_json} is invalid.') return 1 @@ -329,7 +329,7 @@ def _instantiate_template(template_json_data: dict, with open(platform_json, 'r') as s: try: json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Failed to load {platform_json}: ' + str(e)) return 1 else: @@ -403,11 +403,11 @@ def create_template(source_path: str, template_path = source_name template_path = template_path.replace('\\', '/') if not os.path.isabs(template_path): - default_templates_folder = registration.get_registered(default_folder='templates') + default_templates_folder = manifest.get_registered(default_folder='templates') template_path = f'{default_templates_folder}/{template_path}' logger.info(f'Template path not a full path. Using default templates folder {template_path}') if os.path.isdir(template_path): - logger.error(f'Template path {template_path} is already exists.') + logger.error(f'Template path {template_path} already exists.') return 1 # template name is now the last component of the template_path @@ -419,28 +419,28 @@ def create_template(source_path: str, return 1 if source_restricted_name and not source_restricted_path: - source_restricted_path = registration.get_registered(restricted_name=source_restricted_name) + source_restricted_path = manifest.get_registered(restricted_name=source_restricted_name) # source_restricted_path if source_restricted_path: source_restricted_path = source_restricted_path.replace('\\', '/') if not os.path.isabs(source_restricted_path): - engine_json = f'{registration.get_this_engine_path()}/engine.json' - if not registration.valid_o3de_engine_json(engine_json): + engine_json = f'{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 Exception as e: + 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'] - except Exception as e: + 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 = registration.get_registered(restricted_name=engine_restricted) + engine_restricted_folder = manifest.get_registered(restricted_name=engine_restricted) new_source_restricted_path = f'{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}') @@ -449,7 +449,7 @@ def create_template(source_path: str, return 1 if template_restricted_name and not template_restricted_path: - template_restricted_path = registration.get_registered(restricted_name=template_restricted_name) + template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) if not template_restricted_name: template_restricted_name = template_name @@ -458,7 +458,7 @@ def create_template(source_path: str, if template_restricted_path: template_restricted_path = template_restricted_path.replace('\\', '/') if not os.path.isabs(template_restricted_path): - default_templates_restricted_folder = registration.get_registered(restricted_name='templates') + default_templates_restricted_folder = manifest.get_registered(restricted_name='templates') new_template_restricted_path = f'{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}') @@ -466,21 +466,21 @@ def create_template(source_path: str, if os.path.isdir(template_restricted_path): # see if this is already a restricted path, if it is get the "restricted_name" from the restricted json - # so we can set "restricted" to it for this template + # so we can set "restricted_name" to it for this template restricted_json = f'{template_restricted_path}/restricted.json' if os.path.isfile(restricted_json): - if not registration.valid_o3de_restricted_json(restricted_json): + 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 Exception as e: + 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 Exception as e: + except KeyError as e: logger.error(f'Failed to read restricted_name from {restricted_json}') return 1 else: @@ -928,7 +928,7 @@ def create_template(source_path: str, json_data.update({'user_tags': [f"{template_name}"]}) json_data.update({'icon_path': "preview.png"}) if template_restricted_path: - json_data.update({'restricted': template_restricted_name}) + 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({'copyFiles': copy_files}) @@ -943,8 +943,7 @@ def create_template(source_path: str, s.write(json.dumps(json_data, indent=4)) # copy the default preview.png - this_script_parent = os.path.dirname(os.path.realpath(__file__)) - preview_png_src = f'{this_script_parent}/preview.png' + preview_png_src = f'{this_script_parent}/resources/preview.png' preview_png_dst = f'{template_path}/Template/preview.png' if not os.path.isfile(preview_png_dst): shutil.copy(preview_png_src, preview_png_dst) @@ -1048,7 +1047,7 @@ def create_from_template(destination_path: str, return 1 if template_name: - template_path = registration.get_registered(template_name=template_name) + template_path = manifest.get_registered(template_name=template_name) if not os.path.isdir(template_path): logger.error(f'Could not find the template {template_name}=>{template_path}') @@ -1059,7 +1058,7 @@ def create_from_template(destination_path: str, # the template.json should be in the template_path, make sure it's there a nd valid template_json = f'{template_path}/template.json' - if not registration.valid_o3de_template_json(template_json): + if not validation.valid_o3de_template_json(template_json): logger.error(f'Template json {template_path} is invalid.') return 1 @@ -1067,14 +1066,14 @@ def create_from_template(destination_path: str, with open(template_json) as s: try: template_json_data = json.load(s) - except Exception as e: + except KeyError as e: logger.error(f'Could read template json {template_json}: {str(e)}.') return 1 # read template name from the json try: template_name = template_json_data['template_name'] - except Exception as e: + except KeyError as e: logger.error(f'Could not read "template_name" from template json {template_json}: {str(e)}.') return 1 @@ -1082,57 +1081,57 @@ def create_from_template(destination_path: str, # 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'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".') + template_json_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: # If the user specified a --template-restricted-name we need to check that against the templates - # 'restricted' if it has one and see if they match. If they match then we don't have a problem. + # 'restricted_name' if it has one and see if they match. If they match then we don't have a problem. # If they don't then we error out. If supplied but not present in the template we warn and use it. # If not supplied we set what's in the template. If not supplied and not in the template we continue # on as if there is no template restricted files. if template_restricted_name: # The user specified a --template-restricted-name try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_name}') else: if template_json_restricted_name != template_restricted_name: logger.error( f'The supplied --template-restricted-name {template_restricted_name} does not match the' - f' templates "restricted". Either the the --template-restricted-name is incorrect or the' - f' templates "restricted" is wrong. Note that since this template specifies "restricted" as' + f' templates "restricted_name". Either the the --template-restricted-name is incorrect or the' + f' templates "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name}, --template-restricted-name need not be supplied.') - template_restricted_path = registration.get_registered(restricted_name=template_restricted_name) + template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) else: # The user has supplied the --template-restricted-path, see if that matches the template specifies. # If it does then we do not have a problem. If it doesn't match then error out. If not specified # in the template then warn and use the --template-restricted-path template_restricted_path = template_restricted_path.replace('\\', '/') try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_path}') else: - template_json_restricted_path = registration.get_registered( + template_json_restricted_path = manifest.get_registered( restricted_name=template_json_restricted_name) if template_json_restricted_path != template_restricted_path: logger.error( f'The supplied --template-restricted-path {template_restricted_path} does not match the' - f' templates "restricted" {template_restricted_name} => {template_json_restricted_path}.' + f' templates "restricted_name" {template_restricted_name} => {template_json_restricted_path}.' f' Either the the supplied --template-restricted-path is incorrect or the templates' - f' "restricted" is wrong. Note that since this template specifies "restricted" as' + f' "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name} --template-restricted-path need not be supplied' f' and {template_json_restricted_path} will be used.') return 1 @@ -1154,7 +1153,7 @@ def create_from_template(destination_path: str, try: template_json_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # the template json doesn't have a 'restricted_platform_relative_path' element warn and use it logger.info(f'The template does not specify a "restricted_platform_relative_path".' f' Using {template_restricted_platform_relative_path}') @@ -1175,7 +1174,7 @@ def create_from_template(destination_path: str, try: template_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # The template json doesn't have a 'restricted_platform_relative_path' element, set empty string. template_restricted_platform_relative_path = '' @@ -1203,19 +1202,19 @@ def create_from_template(destination_path: str, # destination restricted name if destination_restricted_name: - destination_restricted_path = registration.get_registered(restricted_name=destination_restricted_name) + destination_restricted_path = manifest.get_registered(restricted_name=destination_restricted_name) # destination restricted path elif destination_restricted_path: destination_restricted_path = destination_restricted_path.replace('\\', '/') if os.path.isabs(destination_restricted_path): - restricted_default_path = registration.get_registered(default='restricted') + restricted_default_path = manifest.get_registered(default='restricted') new_destination_restricted_path = f'{restricted_default_path}/{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 = registration.get_registered(default='restricted') + restricted_default_path = manifest.get_registered(default='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 @@ -1337,8 +1336,12 @@ def create_project(project_path: str, template_name = 'DefaultProject' if template_name and not template_path: - template_path = registration.get_registered(template_name=template_name) + template_path = manifest.get_registered(template_name=template_name) + if not template_path: + logger.error(f'Could not find the template path using name {template_name}.\n' + f'Has the engine been registered yet. It can be registered via the "o3de.py register --this-engine" command') + return 1 if not os.path.isdir(template_path): logger.error(f'Could not find the template {template_name}=>{template_path}') return 1 @@ -1348,7 +1351,7 @@ def create_project(project_path: str, # the template.json should be in the template_path, make sure it's there and valid template_json = f'{template_path}/template.json' - if not registration.valid_o3de_template_json(template_json): + if not validation.valid_o3de_template_json(template_json): logger.error(f'Template json {template_path} is not valid.') return 1 @@ -1356,14 +1359,14 @@ def create_project(project_path: str, with open(template_json) as s: try: template_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Could read template json {template_json}: {str(e)}.') return 1 # read template name from the json try: template_name = template_json_data['template_name'] - except Exception as e: + except KeyError as e: logger.error(f'Could not read "template_name" from template json {template_json}: {str(e)}.') return 1 @@ -1371,57 +1374,57 @@ def create_project(project_path: str, # 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'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".') + template_json_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: # If the user specified a --template-restricted-name we need to check that against the templates - # 'restricted' if it has one and see if they match. If they match then we don't have a problem. + # 'restricted_name' if it has one and see if they match. If they match then we don't have a problem. # If they don't then we error out. If supplied but not present in the template we warn and use it. # If not supplied we set what's in the template. If not supplied and not in the template we continue # on as if there is no template restricted files. if template_restricted_name and not template_restricted_path: # The user specified a --template-restricted-name try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_name}') else: if template_json_restricted_name != template_restricted_name: logger.error( f'The supplied --template-restricted-name {template_restricted_name} does not match the' - f' templates "restricted". Either the the --template-restricted-name is incorrect or the' - f' templates "restricted" is wrong. Note that since this template specifies "restricted" as' + f' templates "restricted_name". Either the the --template-restricted-name is incorrect or the' + f' templates "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name}, --template-restricted-name need not be supplied.') - template_restricted_path = registration.get_registered(restricted_name=template_restricted_name) + template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) else: # The user has supplied the --template-restricted-path, see if that matches the template specifies. # If it does then we do not have a problem. If it doesn't match then error out. If not specified # in the template then warn and use the --template-restricted-path template_restricted_path = template_restricted_path.replace('\\', '/') try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_path}') else: - template_json_restricted_path = registration.get_registered( + template_json_restricted_path = manifest.get_registered( restricted_name=template_json_restricted_name) if template_json_restricted_path != template_restricted_path: logger.error( f'The supplied --template-restricted-path {template_restricted_path} does not match the' - f' templates "restricted" {template_restricted_name} => {template_json_restricted_path}.' + f' templates "restricted_name" {template_restricted_name} => {template_json_restricted_path}.' f' Either the the supplied --template-restricted-path is incorrect or the templates' - f' "restricted" is wrong. Note that since this template specifies "restricted" as' + f' "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name} --template-restricted-path need not be supplied' f' and {template_json_restricted_path} will be used.') return 1 @@ -1442,7 +1445,7 @@ def create_project(project_path: str, try: template_json_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # the template json doesn't have a 'restricted_platform_relative_path' element warn and use it logger.info(f'The template does not specify a "restricted_platform_relative_path".' f' Using {template_restricted_platform_relative_path}') @@ -1463,7 +1466,7 @@ def create_project(project_path: str, try: template_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # The template json doesn't have a 'restricted_platform_relative_path' element, set empty string. template_restricted_platform_relative_path = '' if not template_restricted_platform_relative_path: @@ -1475,7 +1478,7 @@ def create_project(project_path: str, return 1 project_path = project_path.replace('\\', '/') if not os.path.isabs(project_path): - default_projects_folder = registration.get_registered(default_folder='projects') + default_projects_folder = manifest.get_registered(default_folder='projects') new_project_path = f'{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}') @@ -1496,19 +1499,19 @@ def create_project(project_path: str, # project restricted name if project_restricted_name and not project_restricted_path: - project_restricted_path = registration.get_registered(restricted_name=project_restricted_name) + project_restricted_path = manifest.get_registered(restricted_name=project_restricted_name) # project restricted path elif project_restricted_path: project_restricted_path = project_restricted_path.replace('\\', '/') if not os.path.isabs(project_restricted_path): - default_projects_restricted_folder = registration.get_registered(restricted_name='projects') + default_projects_restricted_folder = manifest.get_registered(restricted_name='projects') new_project_restricted_path = f'{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 = registration.get_registered(restricted_name='projects') + 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 @@ -1585,7 +1588,7 @@ def create_project(project_path: str, # read the restricted_name from the projects restricted.json restricted_json = f"{project_restricted_path}/restricted.json".replace('//', '/') if os.path.isfile(restricted_json): - if not registration.valid_o3de_restricted_json(restricted_json): + if not validation.valid_o3de_restricted_json(restricted_json): logger.error(f'Restricted json {restricted_json} is not valid.') return 1 else: @@ -1597,35 +1600,35 @@ def create_project(project_path: str, with open(restricted_json, 'r') as s: try: restricted_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Failed to load restricted json {restricted_json}.') return 1 try: restricted_name = restricted_json_data["restricted_name"] - except Exception as e: + except KeyError as e: logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') return 1 - # set the "restricted": "restricted_name" element of the project.json + # set the "restricted_name": "restricted_name" element of the project.json project_json = f"{project_path}/project.json".replace('//', '/') - if not registration.valid_o3de_project_json(project_json): + if not validation.valid_o3de_project_json(project_json): logger.error(f'Project json {project_json} is not valid.') return 1 with open(project_json, 'r') as s: try: project_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Failed to load project json {project_json}.') return 1 - project_json_data.update({"restricted": restricted_name}) + project_json_data.update({"restricted_name": restricted_name}) os.unlink(project_json) with open(project_json, 'w') as s: try: s.write(json.dumps(project_json_data, indent=4)) - except Exception as e: + except OSError as e: logger.error(f'Failed to write project json {project_json}.') return 1 @@ -1652,10 +1655,22 @@ def create_project(project_path: str, d.write('# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n') d.write('# {END_LICENSE}\n') - # copy the o3de_manifest.cmake into the project root - engine_path = registration.get_this_engine_path() - o3de_manifest_cmake = f'{engine_path}/cmake/o3de_manifest.cmake' - shutil.copy(o3de_manifest_cmake, project_path) + # set the "engine" element of the project.json + engine_json_data = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) + try: + engine_name = engine_json_data['engine_name'] + except KeyError as e: + logger.error(f"engine_name for this engine not found in engine.json.") + return 1 + + project_json_data = manifest.get_project_json_data(project_path=project_path) + project_json_data.update({"engine": engine_name}) + with open(project_json, 'w') as s: + try: + s.write(json.dumps(project_json_data, indent=4)) + except OSError as e: + logger.error(f'Failed to write project json at {project_path}.') + return 1 return 0 @@ -1718,7 +1733,7 @@ def create_gem(gem_path: str, template_name = 'DefaultGem' if template_name and not template_path: - template_path = registration.get_registered(template_name=template_name) + template_path = manifest.get_registered(template_name=template_name) if not os.path.isdir(template_path): logger.error(f'Could not find the template {template_name}=>{template_path}') @@ -1729,7 +1744,7 @@ def create_gem(gem_path: str, # the template.json should be in the template_path, make sure it's there and valid template_json = f'{template_path}/template.json' - if not registration.valid_o3de_template_json(template_json): + if not validation.valid_o3de_template_json(template_json): logger.error(f'Template json {template_path} is not valid.') return 1 @@ -1737,14 +1752,14 @@ def create_gem(gem_path: str, with open(template_json) as s: try: template_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Could read template json {template_json}: {str(e)}.') return 1 # read template name from the json try: template_name = template_json_data['template_name'] - except Exception as e: + except KeyError as e: logger.error(f'Could not read "template_name" from template json {template_json}: {str(e)}.') return 1 @@ -1752,56 +1767,56 @@ def create_gem(gem_path: str, # 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'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".') + template_json_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: - # if the user specified a --template-restricted-name we need to check that against the templates 'restricted' + # if the user specified a --template-restricted-name we need to check that against the templates 'restricted_name' # if it has one and see if they match. If they match then we don't have a problem. If they don't then we error # out. If supplied but not present in the template we warn and use it. If not supplied we set what's in the # template. If not supplied and not in the template we continue on as if there is no template restricted files. if template_restricted_name and not template_restricted_path: # The user specified a --template-restricted-name try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_name}') else: if template_json_restricted_name != template_restricted_name: logger.error( f'The supplied --template-restricted-name {template_restricted_name} does not match the' - f' templates "restricted". Either the the --template-restricted-name is incorrect or the' - f' templates "restricted" is wrong. Note that since this template specifies "restricted" as' + f' templates "restricted_name". Either the the --template-restricted-name is incorrect or the' + f' templates "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name}, --template-restricted-name need not be supplied.') - template_restricted_path = registration.get_registered(restricted_name=template_restricted_name) + template_restricted_path = manifest.get_registered(restricted_name=template_restricted_name) else: # The user has supplied the --template-restricted-path, see if that matches the template specifies. # If it does then we do not have a problem. If it doesn't match then error out. If not specified # in the template then warn and use the --template-restricted-path template_restricted_path = template_restricted_path.replace('\\', '/') try: - template_json_restricted_name = template_json_data['restricted'] - except Exception as e: - # the template json doesn't have a 'restricted' element warn and use it - logger.info(f'The template does not specify a "restricted".' + template_json_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".' f' Using supplied {template_restricted_path}') else: - template_json_restricted_path = registration.get_registered( + template_json_restricted_path = manifest.get_registered( restricted_name=template_json_restricted_name) if template_json_restricted_path != template_restricted_path: logger.error( f'The supplied --template-restricted-path {template_restricted_path} does not match the' - f' templates "restricted" {template_restricted_name} => {template_json_restricted_path}.' + f' templates "restricted_name" {template_restricted_name} => {template_json_restricted_path}.' f' Either the the supplied --template-restricted-path is incorrect or the templates' - f' "restricted" is wrong. Note that since this template specifies "restricted" as' + f' "restricted_name" is wrong. Note that since this template specifies "restricted_name" as' f' {template_json_restricted_name} --template-restricted-path need not be supplied' f' and {template_json_restricted_path} will be used.') return 1 @@ -1821,7 +1836,7 @@ def create_gem(gem_path: str, try: template_json_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # the template json doesn't have a 'restricted_platform_relative_path' element warn and use it logger.info(f'The template does not specify a "restricted_platform_relative_path".' f' Using {template_restricted_platform_relative_path}') @@ -1842,7 +1857,7 @@ def create_gem(gem_path: str, try: template_restricted_platform_relative_path = template_json_data[ 'restricted_platform_relative_path'] - except Exception as e: + except KeyError as e: # The template json doesn't have a 'restricted_platform_relative_path' element, set empty string. template_restricted_platform_relative_path = '' if not template_restricted_platform_relative_path: @@ -1854,7 +1869,7 @@ def create_gem(gem_path: str, return 1 gem_path = gem_path.replace('\\', '/') if not os.path.isabs(gem_path): - default_gems_folder = registration.get_registered(default_folder='gems') + default_gems_folder = manifest.get_registered(default_folder='gems') new_gem_path = f'{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}') @@ -1875,19 +1890,19 @@ def create_gem(gem_path: str, # gem restricted name if gem_restricted_name and not gem_restricted_path: - gem_restricted_path = registration.get_registered(restricted_name=gem_restricted_name) + gem_restricted_path = manifest.get_registered(restricted_name=gem_restricted_name) # gem restricted path elif gem_restricted_path: gem_restricted_path = gem_restricted_path.replace('\\', '/') if not os.path.isabs(gem_restricted_path): - default_gems_restricted_folder = registration.get_registered(restricted_name='gems') + default_gems_restricted_folder = manifest.get_registered(restricted_name='gems') new_gem_restricted_path = f'{default_gems_restricted_folder}/{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 elif template_restricted_path: - gem_restricted_default_path = registration.get_registered(restricted_name='gems') + gem_restricted_default_path = manifest.get_registered(restricted_name='gems') logger.info(f'--gem-restricted-path is not specified, using default gem restricted path / gem name' f' = {gem_restricted_default_path}') gem_restricted_path = gem_restricted_default_path @@ -1964,7 +1979,7 @@ def create_gem(gem_path: str, # read the restricted_name from the gems restricted.json restricted_json = f"{gem_restricted_path}/restricted.json".replace('//', '/') if os.path.isfile(restricted_json): - if not registration.valid_o3de_restricted_json(restricted_json): + if not validation.valid_o3de_restricted_json(restricted_json): logger.error(f'Restricted json {restricted_json} is not valid.') return 1 else: @@ -1976,35 +1991,35 @@ def create_gem(gem_path: str, with open(restricted_json, 'r') as s: try: restricted_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Failed to load restricted json {restricted_json}.') return 1 try: restricted_name = restricted_json_data["restricted_name"] - except Exception as e: + except KeyError as e: logger.error(f'Failed to read "restricted_name" from restricted json {restricted_json}.') return 1 - # set the "restricted": "restricted_name" element of the gem.json + # set the "restricted_name": "restricted_name" element of the gem.json gem_json = f"{gem_path}/gem.json".replace('//', '/') - if not registration.valid_o3de_gem_json(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: gem_json_data = json.load(s) - except Exception as e: + except json.JSONDecodeError as e: logger.error(f'Failed to load gem json {gem_json}.') return 1 - gem_json_data.update({"restricted": restricted_name}) + 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)) - except Exception as e: + except OSError as e: logger.error(f'Failed to write project json {gem_json}.') return 1 @@ -2098,15 +2113,14 @@ def _run_create_gem(args: argparse) -> int: args.module_id) -def add_args(parser, subparsers) -> None: +def add_args(subparsers) -> None: """ add_args is called to add expected parser arguments and subparsers arguments to each command such that it can be invoked locally or aggregated by a central python file. - Ex. Directly run from this file alone with: python engine_template.py create_gem --gem-path TestGem + Ex. Directly run from this file alone with: python engine_template.py create-gem --gem-path TestGem OR o3de.py can aggregate commands by importing engine_template, - call add_args and execute: python o3de.py create_gem --gem-path TestGem - :param parser: the caller instantiates a parser and passes it in here + 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 @@ -2116,7 +2130,7 @@ def add_args(parser, subparsers) -> None: create_template_subparser.add_argument('-tp', '--template-path', type=str, required=False, help='The path to the template to create, can be absolute or relative' ' to default templates path') - group = create_template_subparser.add_mutually_exclusive_group(required=True) + group = create_template_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-srp', '--source-restricted-path', type=str, required=False, default=None, help='The path to the source restricted folder.') @@ -2125,7 +2139,7 @@ def add_args(parser, subparsers) -> None: help='The name of the source restricted folder. If supplied this will resolve' ' the --source-restricted-path.') - group = create_template_subparser.add_mutually_exclusive_group(required=True) + group = create_template_subparser.add_mutually_exclusive_group(required=False) group.add_argument('-trp', '--template-restricted-path', type=str, required=False, default=None, help='The path to the templates restricted folder.') @@ -2423,16 +2437,16 @@ if __name__ == "__main__": the_parser = argparse.ArgumentParser() # add subparsers - the_subparsers = the_parser.add_subparsers(help='sub-command help') + the_subparsers = the_parser.add_subparsers(help='sub-command help', dest='command', required=True) # add args to the parser - add_args(the_parser, the_subparsers) + add_args(the_subparsers) # parse args the_args = the_parser.parse_args() # run - ret = the_args.func(the_args) + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 # return sys.exit(ret) diff --git a/scripts/o3de/o3de/get_registration.py b/scripts/o3de/o3de/get_registration.py new file mode 100644 index 0000000000..d51600826c --- /dev/null +++ b/scripts/o3de/o3de/get_registration.py @@ -0,0 +1,96 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import argparse +import pathlib +import sys + +from o3de import manifest + +def _run_get_registered(args: argparse) -> str or pathlib.Path: + if args.override_home_folder: + manifest.override_home_folder = args.override_home_folder + + return manifest.get_registered(args.engine_name, + args.project_name, + args.gem_name, + args.template_name, + args.default_folder, + args.repo_name, + args.restricted_name) + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python get_registration.py --engine-name "o3de" + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('-en', '--engine-name', type=str, required=False, + help='Engine name.') + group.add_argument('-pn', '--project-name', type=str, required=False, + help='Project name.') + group.add_argument('-gn', '--gem-name', type=str, required=False, + help='Gem name.') + group.add_argument('-tn', '--template-name', type=str, required=False, + help='Template name.') + group.add_argument('-df', '--default-folder', type=str, required=False, + choices=['engines', 'projects', 'gems', 'templates', 'restricted'], + help='The default folders for o3de.') + group.add_argument('-rn', '--repo-name', type=str, required=False, + help='Repo name.') + 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) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py get-registered --engine-name "o3de" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + get_registered_subparser = subparsers.add_parser('get-registered') + add_parser_args(get_registered_subparser) + + +def main(): + """ + Runs get_registration.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/global_project.py b/scripts/o3de/o3de/global_project.py new file mode 100644 index 0000000000..d165510250 --- /dev/null +++ b/scripts/o3de/o3de/global_project.py @@ -0,0 +1,214 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import argparse +import logging +import os +import sys +import re +import pathlib +import json + +from o3de import manifest, validation + +logger = logging.getLogger() +logging.basicConfig() + +DEFAULT_BOOTSTRAP_SETREG = pathlib.Path('~/.o3de/Registry/bootstrap.setreg').expanduser() +PROJECT_PATH_KEY = ('Amazon', 'AzCore', 'Bootstrap', 'project_path') + +def get_json_data(input_path: pathlib.Path): + setreg_json_data = {} + # If the output_path exist validate that it is a valid json file + if input_path.is_file(): + with input_path.open('r') as f: + try: + setreg_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.error(f'The file: {input_path} is not a valid json file: {str(e)}') + + return setreg_json_data + +def set_global_project(output_path: pathlib.Path, + project_name: str = None, + project_path: pathlib.Path = None, + force: bool = False) -> int: + """ + Adds a project path the a settings registry file in the users ~/.o3de/Registry directory + :param output_path: path to .setreg file to store project_path value into + :param project_name: name of the project to lookup path for + :param project_path: path to the project to add to .setreg file + :param force: if set, the project path will be set within the .setreg file regardless of if the path doesn't exist + :return: 0 for success or non 0 failure code + """ + # we need either a project name or path + if not project_name and not project_path: + logger.error(f'Must either specify a Project path or Project Name.') + return 1 + + # if project name resolve it into a path + if project_name and not project_path: + project_path = manifest.get_registered(project_name=project_name) + + if not project_path: + logger.error( + f'The project name has been supplied. Unable to locate project path from the registered manifest.json files:' + f' {str(pathlib.Path("~/.o3de/o3de_manifest.json").expanduser())}, engine.json\n' + 'A The --project-path parameter can be used directly to skip checking the manifest') + return 1 + + # Only perform project path validations when force=False + if not force: + if not project_path.is_dir(): + logger.error(f'Project path {project_path} is not a folder.') + return 1 + + # Validate that the supplied path points contains a valid project.json + if not validation.valid_o3de_project_json(project_path / 'project.json'): + logger.error(f'The supplied project path does not contain a valid project.json.\n' + f'The Path will not be set') + return 1 + + # If the output_path exist validate that it is a valid json file and read it's json data + setreg_json_data = get_json_data(output_path) + if output_path.is_file(): + with output_path.open('r') as f: + try: + setreg_json_data = json.load(f) + except (json.JSONDecodeError) as e: + logger.error(f'The output file: {output_path} is not a valid json file: {str(e)}') + return 1 + + # Add a json dictionary that will be merged with any existing json data from the .setreg file + merge_json_data = {} + json_object_iter = merge_json_data + for json_key in PROJECT_PATH_KEY[:-1]: + # Add the parent json object for the key to update + json_object_iter = json_object_iter.setdefault(json_key, {}) + + # Set the project path value here + json_object_iter[PROJECT_PATH_KEY[-1]] = project_path.as_posix() + setreg_json_data.update(merge_json_data) + + # Create the parent directories + if output_path.parent: + output_path.parent.mkdir(parents=True, exist_ok=True) + try: + with output_path.open('w') as s: + s.write(json.dumps(setreg_json_data, indent=4) + '\n') + except OSError as e: + logger.error(f'Failed to write project path {project_path} to file {output_path}: {str(e)}') + return 1 + + return 0 + + +def get_global_project(input_path: pathlib.Path) -> pathlib.Path or None: + """ + Retrieves the /Amazon/AzCore/Bootstrap/project_path key from the supplied file path + :return: project_path or None on failure + """ + setreg_json_data = get_json_data(input_path) + + try: + # Iterate over each element of the tuple and read the json key from each successive json object + json_object_iter = setreg_json_data + for json_key in PROJECT_PATH_KEY: + json_object_iter = json_object_iter[json_key] + except KeyError as e: + logger.error(f'Cannot read key /{"/".join(PROJECT_PATH_KEY)} from file {input_path.as_posix()}: {str(e)}') + else: + project_path = json_object_iter + return pathlib.Path(project_path).resolve() + return None + +def _run_get_global_project(args: argparse) -> int: + project_path = get_global_project(args.input_path) + if project_path: + print(project_path.as_posix()) + return 0 + return 1 + + +def _run_set_global_project(args: argparse) -> int: + return set_global_project(args.output_path, + args.project_name, + args.project_path, + args.force) + + +def add_parser_args(get_project_parser, set_project_parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python global_project.py --project-path "D:/TestProject" + :param parser: the caller passes an argparse parser like instance to this method + """ + + # get-current-project + get_project_parser.add_argument('-i', '--input-path', type=pathlib.Path, required=False, default=DEFAULT_BOOTSTRAP_SETREG, + help=f'Optional path to file to read /{"/".join(PROJECT_PATH_KEY)} key from.' + f' If not supplied, then {DEFAULT_BOOTSTRAP_SETREG} is used instead') + get_project_parser.set_defaults(func=_run_get_global_project) + + # set-current-project + group = set_project_parser.add_mutually_exclusive_group(required=True) + group.add_argument('-pp', '--project-path', type=pathlib.Path, required=False, + help='The path to the project.') + group.add_argument('-pn', '--project-name', type=str, required=False, + help='The name of the project.') + set_project_parser.add_argument('-o', '--output-path', type=pathlib.Path, required=False, + default=DEFAULT_BOOTSTRAP_SETREG, + help=f'Optional path to output file to write project_path key to. ' + f'If not supplied, then {DEFAULT_BOOTSTRAP_SETREG} is used instead') + set_project_parser.add_argument('-f', '--force', action='store_true', default=False, + help=f'Force the setting of the project path in the supplied setreg file') + set_project_parser.set_defaults(func=_run_set_global_project) + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py set-global-project --project-path "D:/TestProject" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + get_project_subparser = subparsers.add_parser('get-global-project') + set_project_subparser = subparsers.add_parser('set-global-project') + add_parser_args(get_project_subparser, set_project_subparser) + + +def main(): + """ + Runs this script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + project_subparsers = the_parser.add_subparsers(help="Commands for modifying the project path in the user's home" + " setreg files") + + # add args to the parser + add_args(project_subparsers) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/manifest.py b/scripts/o3de/o3de/manifest.py new file mode 100644 index 0000000000..9436e1dd29 --- /dev/null +++ b/scripts/o3de/o3de/manifest.py @@ -0,0 +1,675 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +Contains functions for data from json files such as the o3de_manifests.json, engine.json, project.json, etc... +""" + +import json +import logging +import os +import pathlib + +from o3de import validation + +logger = logging.getLogger() +logging.basicConfig() + +# 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() + + +def get_o3de_folder() -> pathlib.Path: + o3de_folder = get_home_folder() / '.o3de' + o3de_folder.mkdir(parents=True, exist_ok=True) + return o3de_folder + + +def get_o3de_registry_folder() -> pathlib.Path: + registry_folder = get_o3de_folder() / 'Registry' + registry_folder.mkdir(parents=True, exist_ok=True) + return registry_folder + + +def get_o3de_cache_folder() -> pathlib.Path: + cache_folder = get_o3de_folder() / 'Cache' + cache_folder.mkdir(parents=True, exist_ok=True) + return cache_folder + + +def get_o3de_download_folder() -> pathlib.Path: + download_folder = get_o3de_folder() / 'Download' + download_folder.mkdir(parents=True, exist_ok=True) + return download_folder + + +def get_o3de_engines_folder() -> pathlib.Path: + engines_folder = get_o3de_folder() / 'Engines' + engines_folder.mkdir(parents=True, exist_ok=True) + return engines_folder + + +def get_o3de_projects_folder() -> pathlib.Path: + 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_folder() / 'Gems' + gems_folder.mkdir(parents=True, exist_ok=True) + return gems_folder + + +def get_o3de_templates_folder() -> pathlib.Path: + templates_folder = get_o3de_folder() / 'Templates' + templates_folder.mkdir(parents=True, exist_ok=True) + return templates_folder + + +def get_o3de_restricted_folder() -> pathlib.Path: + restricted_folder = get_o3de_folder() / 'Restricted' + restricted_folder.mkdir(parents=True, exist_ok=True) + return restricted_folder + + +def get_o3de_logs_folder() -> pathlib.Path: + logs_folder = get_o3de_folder() / 'Logs' + logs_folder.mkdir(parents=True, exist_ok=True) + return logs_folder + + +# o3de manifest file methods +def get_o3de_manifest() -> pathlib.Path: + manifest_path = get_o3de_folder() / 'o3de_manifest.json' + if not manifest_path.is_file(): + 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() + default_templates_folder = get_o3de_templates_folder() + default_restricted_folder = get_o3de_restricted_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) + + json_data = {} + json_data.update({'o3de_manifest_name': f'{username}'}) + json_data.update({'origin': o3de_folder.as_posix()}) + json_data.update({'default_engines_folder': default_engines_folder.as_posix()}) + json_data.update({'default_projects_folder': default_projects_folder.as_posix()}) + json_data.update({'default_gems_folder': default_gems_folder.as_posix()}) + 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({'projects': []}) + json_data.update({'external_subdirectories': []}) + json_data.update({'templates': []}) + json_data.update({'restricted': []}) + json_data.update({'repos': []}) + json_data.update({'engines': []}) + + 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') + json_data.update({'default_restricted_folder': default_restricted_folder.as_posix()}) + + 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') + + with manifest_path.open('w') as s: + s.write(json.dumps(json_data, indent=4) + '\n') + + return manifest_path + + +def load_o3de_manifest(manifest_path: pathlib.Path = None) -> dict: + """ + Loads supplied manifest file or ~/.o3de/o3de_manifest.json if None + + :param manifest_path: optional path to manifest file to load + """ + if not manifest_path: + manifest_path = get_o3de_manifest() + with manifest_path.open('r') as f: + try: + json_data = json.load(f) + except json.JSONDecodeError as e: + logger.error(f'Manifest json failed to load: {str(e)}') + return {} + else: + return json_data + + +def save_o3de_manifest(json_data: dict, manifest_path: pathlib.Path = None) -> None: + """ + Save the json dictionary to the supplied manifest file or ~/.o3de/o3de_manifest.json if None + + :param json_data: dictionary to save in json format at the file path + :param manifest_path: optional path to manifest file to save + """ + if not manifest_path: + manifest_path = get_o3de_manifest() + with manifest_path.open('w') as s: + try: + s.write(json.dumps(json_data, indent=4) + '\n') + except OSError as e: + logger.error(f'Manifest json failed to save: {str(e)}') + + +# Data query methods +def get_this_engine() -> dict: + json_data = load_o3de_manifest() + engine_data = find_engine_data(json_data) + return engine_data + + +def get_engines() -> list: + json_data = load_o3de_manifest() + return json_data['engines'] + + +def get_projects() -> list: + json_data = load_o3de_manifest() + return json_data['projects'] + + +def get_gems() -> list: + def is_gem_subdirectory(subdir): + return (pathlib.Path(subdir) / 'gem.json').exists() + + external_subdirs = get_external_subdirectories() + return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + + +def get_external_subdirectories() -> list: + json_data = load_o3de_manifest() + return json_data['external_subdirectories'] + + +def get_templates() -> list: + json_data = load_o3de_manifest() + return json_data['templates'] + + +def get_restricted() -> list: + json_data = load_o3de_manifest() + return json_data['restricted'] + + +def get_repos() -> list: + json_data = load_o3de_manifest() + return json_data['repos'] + +# engine.json queries +def get_engine_projects() -> list: + engine_path = get_this_engine_path() + engine_object = get_engine_json_data(engine_path=engine_path) + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['projects'])) if 'projects' in engine_object else [] + + +def get_engine_gems() -> list: + def is_gem_subdirectory(subdir): + return (pathlib.Path(subdir) / 'gem.json').exists() + + external_subdirs = get_engine_external_subdirectories() + return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + + +def get_engine_external_subdirectories() -> list: + engine_path = get_this_engine_path() + engine_object = get_engine_json_data(engine_path=engine_path) + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['external_subdirectories'])) if 'external_subdirectories' in engine_object else [] + + +def get_engine_templates() -> list: + engine_path = get_this_engine_path() + engine_object = get_engine_json_data(engine_path=engine_path) + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['templates'])) + + +def get_engine_restricted() -> list: + engine_path = get_this_engine_path() + engine_object = get_engine_json_data(engine_path=engine_path) + return list(map(lambda rel_path: (pathlib.Path(engine_path) / rel_path).as_posix(), + engine_object['restricted'])) if 'restricted' in engine_object else [] + + +# project.json queries +def get_project_gems(project_path: pathlib.Path) -> list: + def is_gem_subdirectory(subdir): + return (pathlib.Path(subdir) / 'gem.json').exists() + + external_subdirs = get_project_external_subdirectories(project_path) + return list(filter(is_gem_subdirectory, external_subdirs)) if external_subdirs else [] + + +def get_project_external_subdirectories(project_path: pathlib.Path) -> list: + project_object = get_project_json_data(project_path=project_path) + return list(map(lambda rel_path: (pathlib.Path(project_path) / rel_path).as_posix(), + project_object['external_subdirectories'])) if 'external_subdirectories' in project_object else [] + + +# Combined manifest queries +def get_all_projects() -> list: + projects_data = set(get_projects()) + projects_data.update(get_engine_projects()) + return list(projects_data) + + +def get_all_gems(project_path: pathlib.Path = None) -> list: + gems_data = set(get_gems()) + gems_data.update(get_engine_gems()) + if project_path: + gems_data.update(get_project_gems(project_path)) + return list(gems_data) + + +def get_all_external_subdirectories(project_path: pathlib.Path = None) -> list: + external_subdirectories_data = set(get_external_subdirectories()) + external_subdirectories_data.update(get_engine_external_subdirectories()) + if project_path: + external_subdirectories_data.update(get_project_external_subdirectories(project_path)) + return list(templates_data) + + +def get_all_templates() -> list: + templates_data = set(get_templates()) + templates_data.update(get_engine_templates()) + return list(templates_data) + + +def get_all_restricted() -> list: + restricted_data = set(get_restricted()) + restricted_data.update(get_engine_restricted()) + return list(gems_data) + + +# Template functions +def get_project_templates(): # temporary until we have a better way to do this... maybe template_type element + project_templates = [] + for template in get_all_templates(): + if 'Project' in template: + project_templates.append(template) + return project_templates + + +def get_gem_templates(): # temporary until we have a better way to do this... maybe template_type element + gem_templates = [] + for template in get_all_templates(): + if 'Gem' in template: + gem_templates.append(template) + return gem_templates + + +def get_generic_templates(): # temporary until we have a better way to do this... maybe template_type element + generic_templates = [] + for template in get_all_templates(): + if 'Project' not in template and 'Gem' not in template: + generic_templates.append(template) + return generic_templates + + +def get_all_restricted() -> list: + engine_restricted = get_engine_restricted() + restricted_data = get_restricted() + restricted_data.extend(engine_restricted) + return restricted_data + + +def find_engine_data(json_data: dict, + engine_path: str or pathlib.Path = None) -> dict or None: + if not engine_path: + engine_path = get_this_engine_path() + engine_path = pathlib.Path(engine_path).resolve() + + for engine_object in json_data['engines']: + engine_object_path = pathlib.Path(engine_object['path']).resolve() + if engine_path == engine_object_path: + return engine_object + + return None + + +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) + + if not engine_path: + logger.error(f'Engine Path {engine_path} has not been registered.') + return None + + 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 validation.valid_o3de_engine_json(engine_json): + logger.error(f'Engine json {engine_json} is not valid.') + return None + + with engine_json.open('r') as f: + try: + engine_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{engine_json} failed to load: {str(e)}') + else: + return engine_json_data + + return None + + +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: + logger.error('Must specify either a Project name or Project Path.') + return None + + if project_name and not project_path: + project_path = get_registered(project_name=project_name) + + 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.warn(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) -> dict or None: + if not gem_name and not gem_path: + logger.error('Must specify either a Gem name or Gem Path.') + return None + + if gem_name and not gem_path: + gem_path = get_registered(gem_name=gem_name) + + 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.warn(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) -> dict or None: + if not template_name and not template_path: + logger.error('Must specify either a Template name or Template Path.') + return None + + if template_name and not template_path: + template_path = get_registered(template_name=template_name) + + 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.warn(f'{template_json} failed to load: {str(e)}') + else: + return template_json_data + + return None + + +def get_restricted_data(restricted_name: str = None, + restricted_path: str or pathlib.Path = None) -> dict or None: + if not restricted_name and not restricted_path: + logger.error('Must specify either a Restricted name or Restricted Path.') + return None + + if restricted_name and not restricted_path: + restricted_path = get_registered(restricted_name=restricted_name) + + if not restricted_path: + logger.error(f'Restricted Path {restricted_path} has not been registered.') + return None + + 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 + + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{restricted_json} failed to load: {str(e)}') + else: + return restricted_json_data + + return None + + +def get_registered(engine_name: str = None, + project_name: str = None, + gem_name: str = None, + template_name: str = None, + default_folder: str = None, + repo_name: str = None, + restricted_name: str = None) -> pathlib.Path or None: + json_data = load_o3de_manifest() + + # check global first then this engine + if isinstance(engine_name, str): + for engine in json_data['engines']: + engine_path = pathlib.Path(engine['path']).resolve() + engine_json = engine_path / 'engine.json' + with engine_json.open('r') as f: + try: + engine_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{engine_json} failed to load: {str(e)}') + else: + this_engines_name = engine_json_data['engine_name'] + if this_engines_name == engine_name: + return engine_path + + elif isinstance(project_name, str): + enging_projects = get_engine_projects() + projects = json_data['projects'].copy() + projects.extend(engine_object['projects']) + for project_path in projects: + project_path = pathlib.Path(project_path).resolve() + project_json = project_path / 'project.json' + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(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() + for gem_path in gems: + gem_path = pathlib.Path(gem_path).resolve() + gem_json = gem_path / 'gem.json' + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(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): + engine_templates = get_engine_templates() + templates = json_data['templates'].copy() + templates.extend(engine_templates) + for template_path in templates: + template_path = pathlib.Path(template_path).resolve() + template_json = template_path / 'template.json' + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(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): + engine_restricted = get_engine_restricted() + restricted = json_data['restricted'].copy() + restricted.extend(engine_restricted) + for restricted_path in restricted: + restricted_path = pathlib.Path(restricted_path).resolve() + restricted_json = restricted_path / 'restricted.json' + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(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': + default_engines_folder = pathlib.Path(json_data['default_engines_folder']).resolve() + return default_engines_folder + elif default_folder == 'projects': + default_projects_folder = pathlib.Path(json_data['default_projects_folder']).resolve() + return default_projects_folder + elif default_folder == 'gems': + default_gems_folder = pathlib.Path(json_data['default_gems_folder']).resolve() + return default_gems_folder + elif default_folder == 'templates': + default_templates_folder = pathlib.Path(json_data['default_templates_folder']).resolve() + return default_templates_folder + elif default_folder == 'restricted': + default_restricted_folder = pathlib.Path(json_data['default_restricted_folder']).resolve() + return default_restricted_folder + + elif isinstance(repo_name, str): + cache_folder = get_o3de_cache_folder() + for repo_uri in json_data['repos']: + 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: + try: + repo_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{cache_file} failed to load: {str(e)}') + else: + this_repos_name = repo_json_data['repo_name'] + if this_repos_name == repo_name: + return repo_uri + return None diff --git a/scripts/o3de/o3de/print_registration.py b/scripts/o3de/o3de/print_registration.py new file mode 100644 index 0000000000..292f2224bc --- /dev/null +++ b/scripts/o3de/o3de/print_registration.py @@ -0,0 +1,490 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import argparse +import json +import hashlib +import logging +import sys +import urllib.parse + +from o3de import manifest, validation + +logger = logging.getLogger() +logging.basicConfig() + +def print_this_engine(verbose: int) -> None: + engine_data = manifest.get_this_engine() + print(json.dumps(engine_data, indent=4)) + if verbose > 0: + print_engines_data(engine_data) + + +def print_engines(verbose: int) -> None: + engines_data = manifest.get_engines() + print(json.dumps(engines_data, indent=4)) + if verbose > 0: + print_engines_data(engines_data) + + +def print_projects(verbose: int) -> None: + projects_data = manifest.get_projects() + print(json.dumps(projects_data, indent=4)) + if verbose > 0: + print_projects_data(projects_data) + + +def print_gems(verbose: int) -> None: + gems_data = manifest.get_gems() + print(json.dumps(gems_data, indent=4)) + if verbose > 0: + print_gems_data(gems_data) + + +def print_templates(verbose: int) -> None: + templates_data = manifest.get_templates() + print(json.dumps(templates_data, indent=4)) + if verbose > 0: + print_templates_data(templates_data) + + +def print_restricted(verbose: int) -> None: + restricted_data = manifest.get_restricted() + print(json.dumps(restricted_data, indent=4)) + if verbose > 0: + print_restricted_data(restricted_data) + +def print_engine_projects(verbose: int) -> None: + engine_projects_data = manifest.get_engine_projects() + print(json.dumps(engine_projects_data, indent=4)) + if verbose > 0: + print_projects_data(engine_projects_data) + + +def print_engine_gems(verbose: int) -> None: + engine_gems_data = manifest.get_engine_gems() + print(json.dumps(engine_gems_data, indent=4)) + if verbose > 0: + print_gems_data(engine_gems_data) + + +def print_engine_templates(verbose: int) -> None: + engine_templates_data = manifest.get_engine_templates() + print(json.dumps(engine_templates_data, indent=4)) + if verbose > 0: + print_templates_data(engine_templates_data) + + +def print_engine_restricted(verbose: int) -> None: + engine_restricted_data = manifest.get_engine_restricted() + print(json.dumps(engine_restricted_data, indent=4)) + if verbose > 0: + print_restricted_data(engine_restricted_data) + + +def print_engine_external_subdirectories(verbose: int) -> None: + external_subdirs_data = manifest.get_engine_external_subdirectories() + print(json.dumps(external_subdirs_data, indent=4)) + + +def print_all_projects(verbose: int) -> None: + all_projects_data = manifest.get_all_projects() + print(json.dumps(all_projects_data, indent=4)) + if verbose > 0: + print_projects_data(all_projects_data) + + +def print_all_gems(verbose: int) -> None: + all_gems_data = manifest.get_all_gems() + print(json.dumps(all_gems_data, indent=4)) + if verbose > 0: + print_gems_data(all_gems_data) + + +def print_all_templates(verbose: int) -> None: + all_templates_data = manifest.get_all_templates() + print(json.dumps(all_templates_data, indent=4)) + if verbose > 0: + print_templates_data(all_templates_data) + + +def print_all_restricted(verbose: int) -> None: + all_restricted_data = manifest.get_all_restricted() + print(json.dumps(all_restricted_data, indent=4)) + if verbose > 0: + print_restricted_data(all_restricted_data) + + +def print_engines_data(engines_data: dict) -> None: + print('\n') + print("Engines================================================") + for engine_object in engines_data: + # if it's not local it should be in the cache + engine_uri = engine_object['path'] + parsed_uri = urllib.parse.urlparse(engine_uri) + if parsed_uri.scheme == 'http' or \ + parsed_uri.scheme == 'https' or \ + parsed_uri.scheme == 'ftp' or \ + parsed_uri.scheme == 'ftps': + repo_sha256 = hashlib.sha256(engine_uri.encode()) + cache_folder = manifest.get_o3de_cache_folder() + engine = cache_folder / str(repo_sha256.hexdigest() + '.json') + print(f'{engine_uri}/engine.json cached as:') + else: + engine_json = pathlib.Path(engine_uri).resolve() / 'engine.json' + + with engine_json.open('r') as f: + try: + engine_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{engine_json} failed to load: {str(e)}') + else: + print(engine_json) + print(json.dumps(engine_json_data, indent=4)) + print('\n') + + +def print_projects_data(projects_data: dict) -> None: + print('\n') + print("Projects================================================") + for project_uri in projects_data: + # if it's not local it should be in the cache + parsed_uri = urllib.parse.urlparse(project_uri) + if parsed_uri.scheme == 'http' or \ + parsed_uri.scheme == 'https' or \ + parsed_uri.scheme == 'ftp' or \ + parsed_uri.scheme == 'ftps': + repo_sha256 = hashlib.sha256(project_uri.encode()) + cache_folder = manifest.get_o3de_cache_folder() + project_json = cache_folder / str(repo_sha256.hexdigest() + '.json') + else: + project_json = pathlib.Path(project_uri).resolve() / 'project.json' + + with project_json.open('r') as f: + try: + project_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{project_json} failed to load: {str(e)}') + else: + print(project_json) + print(json.dumps(project_json_data, indent=4)) + print('\n') + + +def print_gems_data(gems_data: dict) -> None: + print('\n') + print("Gems================================================") + for gem_uri in gems_data: + # if it's not local it should be in the cache + parsed_uri = urllib.parse.urlparse(gem_uri) + if parsed_uri.scheme == 'http' or \ + parsed_uri.scheme == 'https' or \ + parsed_uri.scheme == 'ftp' or \ + parsed_uri.scheme == 'ftps': + repo_sha256 = hashlib.sha256(gem_uri.encode()) + cache_folder = manifest.get_o3de_cache_folder() + gem_json = cache_folder / str(repo_sha256.hexdigest() + '.json') + else: + gem_json = pathlib.Path(gem_uri).resolve() / 'gem.json' + + with gem_json.open('r') as f: + try: + gem_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{gem_json} failed to load: {str(e)}') + else: + print(gem_json) + print(json.dumps(gem_json_data, indent=4)) + print('\n') + + +def print_templates_data(templates_data: dict) -> None: + print('\n') + print("Templates================================================") + for template_uri in templates_data: + # if it's not local it should be in the cache + parsed_uri = urllib.parse.urlparse(template_uri) + if parsed_uri.scheme == 'http' or \ + parsed_uri.scheme == 'https' or \ + parsed_uri.scheme == 'ftp' or \ + parsed_uri.scheme == 'ftps': + repo_sha256 = hashlib.sha256(template_uri.encode()) + cache_folder = manifest.get_o3de_cache_folder() + template_json = cache_folder / str(repo_sha256.hexdigest() + '.json') + else: + template_json = pathlib.Path(template_uri).resolve() / 'template.json' + + with template_json.open('r') as f: + try: + template_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{template_json} failed to load: {str(e)}') + else: + print(template_json) + print(json.dumps(template_json_data, indent=4)) + print('\n') + + +def print_repos_data(repos_data: dict) -> None: + print('\n') + print("Repos================================================") + cache_folder = manifest.get_o3de_cache_folder() + for repo_uri in repos_data: + repo_sha256 = hashlib.sha256(repo_uri.encode()) + cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') + if validation.valid_o3de_repo_json(cache_file): + with cache_file.open('r') as s: + try: + repo_json_data = json.load(s) + except json.JSONDecodeError as e: + logger.warn(f'{cache_file} failed to load: {str(e)}') + else: + print(f'{repo_uri}/repo.json cached as:') + print(cache_file) + print(json.dumps(repo_json_data, indent=4)) + print('\n') + + +def print_restricted_data(restricted_data: dict) -> None: + print('\n') + print("Restricted================================================") + for restricted_path in restricted_data: + restricted_json = pathlib.Path(restricted_path).resolve() / 'restricted.json' + with restricted_json.open('r') as f: + try: + restricted_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{restricted_json} failed to load: {str(e)}') + else: + print(restricted_json) + print(json.dumps(restricted_json_data, indent=4)) + print('\n') + + +def register_show_repos(verbose: int) -> None: + repos_data = get_repos() + print(json.dumps(repos_data, indent=4)) + if verbose > 0: + print_repos_data(repos_data) + + +def register_show(verbose: int) -> None: + json_data = manifest.load_o3de_manifest() + print(f"{manifest.get_o3de_manifest()}:") + print(json.dumps(json_data, indent=4)) + + if verbose > 0: + print_engines_data(manifest.get_engines()) + print_projects_data(manifest.get_all_projects()) + print_gems_data(manifest.get_gems()) + print_templates_data(manifest.get_all_templates()) + print_restricted_data(manifest.get_all_restricted()) + print_repos_data(manifest.get_repos()) + + +def _run_register_show(args: argparse) -> int: + if args.override_home_folder: + manifest.override_home_folder = args.override_home_folder + + if args.this_engine: + print_this_engine(args.verbose) + return 0 + + elif args.engines: + print_engines(args.verbose) + return 0 + elif args.projects: + print_projects(args.verbose) + return 0 + elif args.gems: + print_gems(args.verbose) + return 0 + elif args.templates: + print_templates(args.verbose) + return 0 + elif args.repos: + register_show_repos(args.verbose) + return 0 + elif args.restricted: + print_restricted(args.verbose) + return 0 + + elif args.engine_projects: + print_engine_projects(args.verbose) + return 0 + elif args.engine_gems: + print_engine_gems(args.verbose) + return 0 + elif args.engine_templates: + print_engine_templates(args.verbose) + return 0 + elif args.engine_restricted: + print_engine_restricted(args.verbose) + return 0 + elif args.engine_external_subdirectories: + print_engine_external_subdirectories(args.verbose) + return 0 + + elif args.all_projects: + print_all_projects(args.verbose) + return 0 + elif args.all_gems: + print_all_gems(args.verbose) + return 0 + elif args.all_templates: + print_all_templates(args.verbose) + return 0 + elif args.all_restricted: + print_all_restricted(args.verbose) + return 0 + + elif args.downloadables: + print_downloadables(args.verbose) + return 0 + if args.downloadable_engines: + print_downloadable_engines(args.verbose) + return 0 + elif args.downloadable_projects: + print_downloadable_projects(args.verbose) + return 0 + elif args.downloadable_gems: + print_downloadable_gems(args.verbose) + return 0 + elif args.downloadable_templates: + print_downloadable_templates(args.verbose) + return 0 + else: + register_show(args.verbose) + return 0 + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python print_registration.py --engine-projects + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=False) + group.add_argument('-te', '--this-engine', action='store_true', required=False, + default=False, + help='Just the local engines.') + + group.add_argument('-e', '--engines', action='store_true', required=False, + default=False, + help='Just the local engines.') + group.add_argument('-p', '--projects', action='store_true', required=False, + default=False, + help='Just the local projects.') + group.add_argument('-g', '--gems', action='store_true', required=False, + default=False, + help='Just the local gems.') + group.add_argument('-t', '--templates', action='store_true', required=False, + default=False, + help='Just the local templates.') + group.add_argument('-r', '--repos', action='store_true', required=False, + default=False, + help='Just the local repos. Ignores repos.') + group.add_argument('-rs', '--restricted', action='store_true', required=False, + default=False, + help='The local restricted folders.') + + group.add_argument('-ep', '--engine-projects', action='store_true', required=False, + default=False, + help='Just the local projects. Ignores repos.') + group.add_argument('-eg', '--engine-gems', action='store_true', required=False, + default=False, + help='Just the local gems. Ignores repos') + group.add_argument('-et', '--engine-templates', action='store_true', required=False, + default=False, + help='Just the local templates. Ignores repos.') + group.add_argument('-ers', '--engine-restricted', action='store_true', required=False, + default=False, + help='The restricted folders.') + group.add_argument('-x', '--engine-external-subdirectories', action='store_true', required=False, + default=False, + help='The external subdirectories.') + + group.add_argument('-ap', '--all-projects', action='store_true', required=False, + default=False, + help='Just the local projects. Ignores repos.') + group.add_argument('-ag', '--all-gems', action='store_true', required=False, + default=False, + help='Just the local gems. Ignores repos') + group.add_argument('-at', '--all-templates', action='store_true', required=False, + default=False, + help='Just the local templates. Ignores repos.') + group.add_argument('-ars', '--all-restricted', action='store_true', required=False, + default=False, + help='The restricted folders.') + + group.add_argument('-d', '--downloadables', action='store_true', required=False, + default=False, + help='Combine all repos into a single list of resources.') + group.add_argument('-de', '--downloadable-engines', action='store_true', required=False, + default=False, + help='Combine all repos engines into a single list of resources.') + group.add_argument('-dp', '--downloadable-projects', action='store_true', required=False, + default=False, + help='Combine all repos projects into a single list of resources.') + group.add_argument('-dg', '--downloadable-gems', action='store_true', required=False, + default=False, + help='Combine all repos gems into a single list of resources.') + group.add_argument('-dt', '--downloadable-templates', action='store_true', required=False, + default=False, + help='Combine all repos templates into a single list of resources.') + + parser.add_argument('-v', '--verbose', action='count', required=False, + default=0, + help='How verbose do you want the output to be.') + + 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) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py register-show --engine-projects + :param subparsers: the caller instantiates subparsers and passes it in here + """ + register_show_subparser = subparsers.add_parser('register-show') + add_parser_args(register_show_subparser) + + +def main(): + """ + Runs print_registration.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/register.py b/scripts/o3de/o3de/register.py new file mode 100644 index 0000000000..68575488dc --- /dev/null +++ b/scripts/o3de/o3de/register.py @@ -0,0 +1,864 @@ + +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +This file contains all the code that has to do with registering engines, projects, gems and templates +""" + +import argparse +import hashlib +import logging +import json +import os +import pathlib +import shutil +import sys +import urllib.parse +import urllib.request + +from o3de import get_registration, manifest, repo, utils, validation + +logger = logging.getLogger() +logging.basicConfig() + + +def register_shipped_engine_o3de_objects(force: bool = False) -> int: + engine_path = manifest.get_this_engine_path() + + ret_val = 0 + + # register anything in the users default folders globally + error_code = register_all_engines_in_folder(manifest.get_registered(default_folder='engines'), force=force) + if error_code: + ret_val = error_code + error_code = register_all_projects_in_folder(manifest.get_registered(default_folder='projects')) + if error_code: + ret_val = error_code + error_code = register_all_gems_in_folder(manifest.get_registered(default_folder='gems')) + if error_code: + ret_val = error_code + error_code = register_all_templates_in_folder(manifest.get_registered(default_folder='templates')) + if error_code: + ret_val = error_code + error_code = register_all_restricted_in_folder(manifest.get_registered(default_folder='restricted')) + if error_code: + ret_val = error_code + error_code = register_all_restricted_in_folder(manifest.get_registered(default_folder='projects')) + if error_code: + ret_val = error_code + error_code = register_all_restricted_in_folder(manifest.get_registered(default_folder='gems')) + if error_code: + ret_val = error_code + error_code = register_all_restricted_in_folder(manifest.get_registered(default_folder='templates')) + if error_code: + ret_val = error_code + + return ret_val + + +def register_all_in_folder(folder_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None, + exclude: list = None) -> int: + if not folder_path: + logger.error(f'Folder path cannot be empty.') + return 1 + + folder_path = pathlib.Path(folder_path).resolve() + if not folder_path.is_dir(): + logger.error(f'Folder path is not dir.') + return 1 + + engines_set = set() + projects_set = set() + gems_set = set() + templates_set = set() + restricted_set = set() + repo_set = set() + + ret_val = 0 + for root, dirs, files in os.walk(folder_path): + if root in exclude: + continue + + for name in files: + if name == 'engine.json': + engines_set.add(root) + elif name == 'project.json': + projects_set.add(root) + elif name == 'gem.json': + gems_set.add(root) + elif name == 'template.json': + templates_set.add(root) + elif name == 'restricted.json': + restricted_set.add(root) + elif name == 'repo.json': + repo_set.add(root) + + for engine in sorted(engines_set, reverse=True): + error_code = register(engine_path=engine, remove=remove) + if error_code: + ret_val = error_code + + for project in sorted(projects_set, reverse=True): + error_code = register(engine_path=engine_path, project_path=project, remove=remove) + if error_code: + ret_val = error_code + + for gem in sorted(gems_set, reverse=True): + error_code = register(engine_path=engine_path, gem_path=gem, remove=remove) + if error_code: + ret_val = error_code + + for template in sorted(templates_set, reverse=True): + error_code = register(engine_path=engine_path, template_path=template, remove=remove) + if error_code: + ret_val = error_code + + for restricted in sorted(restricted_set, reverse=True): + error_code = register(engine_path=engine_path, restricted_path=restricted, remove=remove) + if error_code: + ret_val = error_code + + for repo in sorted(repo_set, reverse=True): + error_code = register(engine_path=engine_path, repo_uri=repo, remove=remove) + if error_code: + ret_val = error_code + + return ret_val + + +def register_all_o3de_objects_of_type_in_folder(o3de_object_path: str or pathlib.Path, + o3de_object_type: str, + remove: bool, + force: bool, + **register_kwargs) -> int: + if not o3de_object_path: + logger.error(f'Engines path cannot be empty.') + return 1 + + o3de_object_path = pathlib.Path(o3de_object_path).resolve() + if not o3de_object_path.is_dir(): + logger.error(f'Engines path is not dir.') + return 1 + + o3de_object_type_set = set() + register_path_kwarg = f'{o3de_object_type}_path' if o3de_object_type != 'repo' else f'{o3de_object_type}_uri' + + ret_val = 0 + for root, dirs, files in os.walk(o3de_object_path): + if f'{o3de_object_type}.json' in files: + o3de_object_type_set.add(root) + # Stop iteration of any subdirectories + # Nested o3de objects of the same type aren't supported(i.e an engine cannot be inside of a engine). + dirs[:] = [] + + for o3de_object_type_root in sorted(o3de_object_type_set, reverse=True): + error_code = register(**{register_path_kwarg: o3de_object_type_root}, + remove=remove, force=force, **register_kwargs) + if error_code: + ret_val = error_code + + return ret_val + + +def register_all_engines_in_folder(engines_path: str or pathlib.Path, + remove: bool = False, + force: bool = False) -> int: + return register_all_o3de_objects_of_type_in_folder(engines_path, 'engine', remove, force) + + +def register_all_projects_in_folder(projects_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_all_o3de_objects_of_type_in_folder(projects_path, 'project', remove, False, engine_path=engine_path) + + +def register_all_gems_in_folder(gems_path: str or pathlib.Path, + remove: bool = False, + engine_path: pathlib.Path = None, + project_path: pathlib.Path = None) -> int: + return register_all_o3de_objects_of_type_in_folder(gems_path, 'gem', remove, False, engine_path=engine_path) + + +def register_all_templates_in_folder(templates_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_all_o3de_objects_of_type_in_folder(templates_path, 'template', remove, False, engine_path=engine_path) + + +def register_all_restricted_in_folder(restricted_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_all_o3de_objects_of_type_in_folder(restricted_path, 'restricted', remove, False, engine_path=engine_path) + + +def register_all_repos_in_folder(repos_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_all_o3de_objects_of_type_in_folder(repos_path, 'repo', remove, force, engine_path=engine_path) + + +def remove_engine_name_to_path(json_data: dict, + engine_path: pathlib.Path) -> int: + """ + Remove the engine at the specified path if it exist in the o3de manifest + :param json_data in-memory json view of the o3de_manifest.json data + :param engine_path path to engine to remove from the manifest data + + returns 0 to indicate no issues has occurred with removal + """ + if engine_path.is_dir() and validation.valid_o3de_engine_json(engine_path): + engine_json_data = manifest.get_engine_json_data(engine_path=engine_path) + if 'engine_name' in engine_json_data and 'engines_path' in json_data: + engine_name = engine_json_data['engine_name'] + try: + del json_data['engines_path'][engine_name] + except KeyError: + # Attempting to remove a non-existent engine_name is fine + pass + return 0 + + +def add_engine_name_to_path(json_data: dict, engine_path: pathlib.Path, force: bool): + # Add an engine path JSON object which maps the "engine_name" -> "engine_path" + engine_json_data = manifest.get_engine_json_data(engine_path=engine_path) + if not engine_json_data: + logger.error(f'Unable to retrieve json data from engine.json at path {engine_path.as_posix()}') + return 1 + engines_path_json = json_data.setdefault('engines_path', {}) + if 'engine_name' not in engine_json_data: + logger.error(f'engine.json at path {engine_path.as_posix()} is missing "engine_name" key') + return 1 + + engine_name = engine_json_data['engine_name'] + if not force and engine_name in engines_path_json and \ + pathlib.PurePath(engines_path_json[engine_name]) != engine_path: + logger.error( + f'Attempting to register existing engine "{engine_name}" with a new path of {engine_path.as_posix()}.' + f' The current path is {pathlib.Path(engines_path_json[engine_name]).as_posix()}.' + f' To force registration of a new engine path, specify the -f/--force option.') + return 1 + engines_path_json[engine_name] = engine_path.as_posix() + return 0 + + +def register_engine_path(json_data: dict, + engine_path: str or pathlib.Path, + remove: bool = False, + force: bool = False) -> int: + if not engine_path: + logger.error(f'Engine path cannot be empty.') + return 1 + engine_path = pathlib.Path(engine_path).resolve() + + for engine_object in json_data.get('engines', {}): + engine_object_path = pathlib.Path(engine_object['path']).resolve() + if engine_object_path == engine_path: + json_data['engines'].remove(engine_object) + + if remove: + return remove_engine_name_to_path(json_data, engine_path) + + if not engine_path.is_dir(): + logger.error(f'Engine path {engine_path} does not exist.') + return 1 + + engine_json = 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 + + engine_object = {} + engine_object.update({'path': engine_path.as_posix()}) + + json_data.setdefault('engines', []).insert(0, engine_object) + + return add_engine_name_to_path(json_data, engine_path, force) + + +def register_o3de_object_path(json_data: dict, + o3de_object_path: str or pathlib.Path, + o3de_object_key: str, + o3de_json_filename: str, + validation_func: callable, + remove: bool = False, + engine_path: pathlib.Path = None, + project_path: pathlib.Path = None) -> int: + # save_path variable is used to save the changes to the store the path to the file to save + # if the registration is for the project or engine + save_path = None + + if not o3de_object_path: + logger.error(f'o3de object path cannot be empty.') + return 1 + + o3de_object_path = pathlib.Path(o3de_object_path).resolve() + + if engine_path and project_path: + logger.error(f'Both a project path: {project_path} and engine path: {engine_path} has been supplied.' + 'A subdirectory can only be registered to either the engine path or project in one command') + + manifest_data = None + if engine_path: + manifest_data = manifest.get_engine_json_data(json_data, engine_path) + if not manifest_data: + logger.error(f'Cannot load engine.json data at path {engine_path}') + return 1 + + save_path = engine_path / 'engine.json' + elif project_path: + manifest_data = manifest.get_project_json_data(json_data, project_path) + if not manifest_data: + logger.error(f'Cannot load project.json data at path {project_path}') + return 1 + + save_path = project_path / 'project.json' + else: + manifest_data = json_data + + paths_to_remove = [o3de_object_path] + if save_path: + try: + paths_to_remove.append(o3de_object_path.relative_to(save_path.parent)) + except ValueError: + pass # It is OK relative path cannot be formed + manifest_data[o3de_object_key] = list(filter(lambda p: pathlib.Path(p) not in paths_to_remove, + manifest_data.setdefault(o3de_object_key, []))) + + if remove: + if save_path: + manifest.save_o3de_manifest(manifest_data, save_path) + return 0 + + if not o3de_object_path.is_dir(): + logger.error(f'o3de object path {o3de_object_path} does not exist.') + return 1 + + manifest_json_path = o3de_object_path / o3de_json_filename + if validation_func and not validation_func(manifest_json_path): + logger.error(f'o3de json {manifest_json_path} is not valid.') + return 1 + + # if there is a save path make it relative the directory containing o3de object json file + if save_path: + try: + o3de_object_path = o3de_object_path.relative_to(save_path.parent) + except ValueError: + pass # It is OK relative path cannot be formed + manifest_data[o3de_object_key].insert(0, o3de_object_path.as_posix()) + if save_path: + manifest.save_o3de_manifest(manifest_data, save_path) + + return 0 + + +def register_external_subdirectory(json_data: dict, + external_subdir_path: str or pathlib.Path, + remove: bool = False, + engine_path: pathlib.Path = None, + project_path: pathlib.Path = None) -> int: + """ + :return An integer return code indicating whether registration or removal of the external subdirectory + completed successfully + """ + return register_o3de_object_path(json_data, external_subdir_path, 'external_subdirectories', '', None, remove, + engine_path, project_path) + + +def register_gem_path(json_data: dict, + gem_path: str or pathlib.Path, + remove: bool = False, + engine_path: pathlib.Path = None, + project_path: pathlib.Path = None) -> int: + return register_o3de_object_path(json_data, gem_path, 'external_subdirectories', 'gem.json', + validation.valid_o3de_gem_json, remove, engine_path, project_path) + + +def register_project_path(json_data: dict, + project_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + result = register_o3de_object_path(json_data, project_path, 'projects', 'project.json', + validation.valid_o3de_project_json, remove, engine_path, None) + + if result != 0: + return result + + # registering a project has the additional step of setting the project.json 'engine' field + this_engine_json = manifest.get_engine_json_data(engine_path=manifest.get_this_engine_path()) + if not this_engine_json: + return 1 + project_json_data = manifest.get_project_json_data(project_path=project_path) + if not project_json_data: + return 1 + + update_project_json = False + try: + update_project_json = project_json_data['engine'] != this_engine_json['engine_name'] + except KeyError as e: + update_project_json = True + + if update_project_json: + project_json_data['engine'] = this_engine_json['engine_name'] + utils.backup_file(project_json) + if not manifest.save_o3de_manifest(project_json_data, project_path): + return 1 + + + return 0 + + +def register_template_path(json_data: dict, + template_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_o3de_object_path(json_data, template_path, 'templates', 'template.json', + validation.valid_o3de_template_json, remove, engine_path, None) + + +def register_restricted_path(json_data: dict, + restricted_path: str or pathlib.Path, + remove: bool = False, + engine_path: str or pathlib.Path = None) -> int: + return register_o3de_object_path(json_data, restricted_path, 'restricted', 'restricted.json', + validation.valid_o3de_restricted_json, remove, engine_path, None) + + +def register_repo(json_data: dict, + repo_uri: str or pathlib.Path, + remove: bool = False) -> int: + if not repo_uri: + logger.error(f'Repo URI cannot be empty.') + return 1 + + url = f'{repo_uri}/repo.json' + parsed_uri = urllib.parse.urlparse(url) + + if parsed_uri.scheme in ['http', 'https', 'ftp', 'ftps']: + while repo_uri in json_data['repos']: + json_data['repos'].remove(repo_uri) + else: + repo_uri = pathlib.Path(repo_uri).resolve() + while repo_uri.as_posix() in json_data['repos']: + json_data['repos'].remove(repo_uri.as_posix()) + + if remove: + logger.warn(f'Removing repo uri {repo_uri}.') + return 0 + + repo_sha256 = hashlib.sha256(url.encode()) + cache_file = manifest.get_o3de_cache_folder() / str(repo_sha256.hexdigest() + '.json') + + result = utils.download_file(url, cache_file) + if result == 0: + json_data['repos'].insert(0, repo_uri.as_posix()) + + result = repo.process_add_o3de_repo(cache_file, repo_set) + + return result + + +def register_default_o3de_object_folder(json_data: dict, + default_o3de_object_folder: str or pathlib.Path, + o3de_object_key: str) -> int: + # make sure the path exists + default_o3de_object_folder = pathlib.Path(default_o3de_object_folder).resolve() + if not default_o3de_object_folder.is_dir(): + logger.error(f'Default o3de object folder {default_o3de_object_folder} does not exist.') + return 1 + + json_data[o3de_object_key] = default_o3de_object_folder.as_posix() + + return 0 + + +def register_default_engines_folder(json_data: dict, + default_engines_folder: str or pathlib.Path, + remove: bool = False) -> int: + return register_default_o3de_object_folder(json_data, + manifest.get_o3de_engines_folder() if remove else default_engines_folder, + 'default_engines_folder', remove) + + +def register_default_projects_folder(json_data: dict, + default_projects_folder: str or pathlib.Path, + remove: bool = False) -> int: + return register_default_o3de_object_folder(json_data, + manifest.get_o3de_projects_folder() if remove else default_projects_folder, + 'default_projects_folder', remove) + + +def register_default_gems_folder(json_data: dict, + default_gems_folder: str or pathlib.Path, + remove: bool = False) -> int: + return register_default_o3de_object_folder(json_data, + manifest.get_o3de_gems_folder() if remove else default_gems_folder, + 'default_gems_folder', remove) + + +def register_default_templates_folder(json_data: dict, + default_templates_folder: str or pathlib.Path, + remove: bool = False) -> int: + return register_default_o3de_object_folder(json_data, + manifest.get_o3de_templates_folder() if remove else default_templates_folder, + 'default_templates_folder', remove) + + +def register_default_restricted_folder(json_data: dict, + default_restricted_folder: str or pathlib.Path, + reset_to_default: bool = False) -> int: + return register_default_o3de_object_folder(json_data, + manifest.get_o3de_restricted_folder() if remove else default_restricted_folder, + 'default_restricted_folder', remove) + + +def register(engine_path: str or pathlib.Path = None, + project_path: str or pathlib.Path = None, + gem_path: str or pathlib.Path = None, + external_subdir_path: str or pathlib.Path = None, + template_path: str or pathlib.Path = None, + restricted_path: str or pathlib.Path = None, + repo_uri: str or pathlib.Path = None, + default_engines_folder: str or pathlib.Path = None, + default_projects_folder: str or pathlib.Path = None, + default_gems_folder: str or pathlib.Path = None, + default_templates_folder: str or pathlib.Path = None, + default_restricted_folder: str or pathlib.Path = None, + external_subdir_engine_path: pathlib.Path = None, + external_subdir_project_path: pathlib.Path = None, + remove: bool = False, + force: bool = False + ) -> int: + """ + Adds/Updates entries to the ~/.o3de/o3de_manifest.json + + :param engine_path: if engine folder is supplied the path will be added to the engine if it can, if not global + :param project_path: project folder + :param gem_path: gem folder + :param external_subdir_path: external subdirectory + :param template_path: template folder + :param restricted_path: restricted folder + :param repo_uri: repo uri + :param default_engines_folder: default engines folder + :param default_projects_folder: default projects folder + :param default_gems_folder: default gems folder + :param default_templates_folder: default templates folder + :param default_restricted_folder: default restricted code folder + :param external_subdir_engine_path: Path to the engine to use when registering an external subdirectory. + The registration occurs in the engine.json file in this case + :param external_subdir_engine_path: Path to the project to use when registering an external subdirectory. + The registrations occurs in the project.json in this case + :param remove: add/remove the entries + :param force: force update of the engine_path for specified "engine_name" from the engine.json file + + :return: 0 for success or non 0 failure code + """ + + json_data = manifest.load_o3de_manifest() + + result = 0 + + # do anything that could require a engine context first + if isinstance(project_path, str) or isinstance(project_path, pathlib.PurePath): + if not project_path: + logger.error(f'Project path cannot be empty.') + return 1 + result = register_project_path(json_data, project_path, remove, engine_path) + + elif isinstance(gem_path, str) or isinstance(gem_path, pathlib.PurePath): + if not gem_path: + logger.error(f'Gem path cannot be empty.') + return 1 + result = register_gem_path(json_data, gem_path, remove, + external_subdir_engine_path, external_subdir_project_path) + elif isinstance(external_subdir_path, str) or isinstance(external_subdir_path, pathlib.PurePath): + if not external_subdir_path: + logger.error(f'External Subdirectory path is None.') + return 1 + result = register_external_subdirectory(json_data, external_subdir_path, remove, + external_subdir_engine_path, external_subdir_project_path) + + elif isinstance(template_path, str) or isinstance(template_path, pathlib.PurePath): + if not template_path: + logger.error(f'Template path cannot be empty.') + return 1 + result = register_template_path(json_data, template_path, remove, engine_path) + + elif isinstance(restricted_path, str) or isinstance(restricted_path, pathlib.PurePath): + if not restricted_path: + logger.error(f'Restricted path cannot be empty.') + return 1 + result = register_restricted_path(json_data, restricted_path, remove, engine_path) + + elif isinstance(repo_uri, str) or isinstance(repo_uri, pathlib.PurePath): + if not repo_uri: + logger.error(f'Repo URI cannot be empty.') + return 1 + result = register_repo(json_data, repo_uri, remove) + + elif isinstance(default_engines_folder, str) or isinstance(default_engines_folder, pathlib.PurePath): + result = register_default_engines_folder(json_data, default_engines_folder, remove) + + elif isinstance(default_projects_folder, str) or isinstance(default_projects_folder, pathlib.PurePath): + result = register_default_projects_folder(json_data, default_projects_folder, remove) + + elif isinstance(default_gems_folder, str) or isinstance(default_gems_folder, pathlib.PurePath): + result = register_default_gems_folder(json_data, default_gems_folder, remove) + + elif isinstance(default_templates_folder, str) or isinstance(default_templates_folder, pathlib.PurePath): + result = register_default_templates_folder(json_data, default_templates_folder, remove) + + elif isinstance(default_restricted_folder, str) or isinstance(default_restricted_folder, pathlib.PurePath): + result = register_default_restricted_folder(json_data, default_restricted_folder, remove) + + # engine is done LAST + # Now that everything that could have an engine context is done, if the engine is supplied that means this is + # registering the engine itself + elif isinstance(engine_path, str) or isinstance(engine_path, pathlib.PurePath): + if not engine_path: + logger.error(f'Engine path cannot be empty.') + return 1 + result = register_engine_path(json_data, engine_path, remove, force) + + if not result: + manifest.save_o3de_manifest(json_data) + + return result + + +def remove_invalid_o3de_objects() -> None: + json_data = manifest.load_o3de_manifest() + + for engine_object in json_data['engines']: + engine_path = engine_object['path'] + if not validation.valid_o3de_engine_json(pathlib.Path(engine_path).resolve() / 'engine.json'): + logger.warn(f"Engine path {engine_path} is invalid.") + register(engine_path=engine_path, remove=True) + + for project in json_data['projects']: + if not validation.valid_o3de_project_json(pathlib.Path(project).resolve() / 'project.json'): + logger.warn(f"Project path {project} is invalid.") + register(project_path=project, remove=True) + + for gem in json_data['gems']: + if not validation.valid_o3de_gem_json(pathlib.Path(gem).resolve() / 'gem.json'): + logger.warn(f"Gem path {gem} is invalid.") + register(gem_path=gem, remove=True) + + for external in json_data['external_subdirectories']: + external = pathlib.Path(external).resolve() + if not external.is_dir(): + logger.warn(f"External subdirectory {external} is invalid.") + register(engine_path=engine_path, external_subdir_path=external, remove=True) + + for template in json_data['templates']: + if not validation.valid_o3de_template_json(pathlib.Path(template).resolve() / 'template.json'): + logger.warn(f"Template path {template} is invalid.") + register(template_path=template, remove=True) + + for restricted in json_data['restricted']: + if not validation.valid_o3de_restricted_json(pathlib.Path(restricted).resolve() / 'restricted.json'): + logger.warn(f"Restricted path {restricted} is invalid.") + register(restricted_path=restricted, remove=True) + + default_engines_folder = pathlib.Path(json_data['default_engines_folder']).resolve() + if not default_engines_folder.is_dir(): + new_default_engines_folder = manifest.get_o3de_folder() / 'Engines' + new_default_engines_folder.mkdir(parents=True, exist_ok=True) + logger.warn( + f"Default engines folder {default_engines_folder} is invalid. Set default {new_default_engines_folder}") + register(default_engines_folder=new_default_engines_folder.as_posix()) + + default_projects_folder = pathlib.Path(json_data['default_projects_folder']).resolve() + if not default_projects_folder.is_dir(): + new_default_projects_folder = manifest.get_o3de_folder() / 'Projects' + new_default_projects_folder.mkdir(parents=True, exist_ok=True) + logger.warn( + f"Default projects folder {default_projects_folder} is invalid. Set default {new_default_projects_folder}") + register(default_projects_folder=new_default_projects_folder.as_posix()) + + default_gems_folder = pathlib.Path(json_data['default_gems_folder']).resolve() + if not default_gems_folder.is_dir(): + new_default_gems_folder = manifest.get_o3de_folder() / 'Gems' + new_default_gems_folder.mkdir(parents=True, exist_ok=True) + logger.warn(f"Default gems folder {default_gems_folder} is invalid." + f" Set default {new_default_gems_folder}") + register(default_gems_folder=new_default_gems_folder.as_posix()) + + default_templates_folder = pathlib.Path(json_data['default_templates_folder']).resolve() + if not default_templates_folder.is_dir(): + new_default_templates_folder = manifest.get_o3de_folder() / 'Templates' + new_default_templates_folder.mkdir(parents=True, exist_ok=True) + logger.warn( + f"Default templates folder {default_templates_folder} is invalid." + f" Set default {new_default_templates_folder}") + register(default_templates_folder=new_default_templates_folder.as_posix()) + + default_restricted_folder = pathlib.Path(json_data['default_restricted_folder']).resolve() + if not default_restricted_folder.is_dir(): + default_restricted_folder = manifest.get_o3de_folder() / 'Restricted' + default_restricted_folder.mkdir(parents=True, exist_ok=True) + logger.warn( + f"Default restricted folder {default_restricted_folder} is invalid." + f" Set default {default_restricted_folder}") + register(default_restricted_folder=default_restricted_folder.as_posix()) + + +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() + elif args.this_engine: + ret_val = register(engine_path=manifest.get_this_engine_path(), force=args.force) + error_code = register_shipped_engine_o3de_objects(force=args.force) + if error_code: + ret_val = error_code + return ret_val + elif args.all_engines_path: + return register_all_engines_in_folder(args.all_engines_path, args.remove, args.force) + elif args.all_projects_path: + return register_all_projects_in_folder(args.all_projects_path, args.remove) + elif args.all_gems_path: + return register_all_gems_in_folder(args.all_gems_path, args.remove) + elif args.all_templates_path: + return register_all_templates_in_folder(args.all_templates_path, args.remove) + elif args.all_restricted_path: + return register_all_restricted_in_folder(args.all_restricted_path, args.remove) + elif args.all_repo_uri: + return register_all_repos_in_folder(args.all_restricted_path, args.remove) + else: + return register(engine_path=args.engine_path, + project_path=args.project_path, + gem_path=args.gem_path, + external_subdir_path=args.external_subdirectory, + template_path=args.template_path, + restricted_path=args.restricted_path, + repo_uri=args.repo_uri, + default_engines_folder=args.default_engines_folder, + default_projects_folder=args.default_projects_folder, + default_gems_folder=args.default_gems_folder, + default_templates_folder=args.default_templates_folder, + default_restricted_folder=args.default_restricted_folder, + external_subdir_engine_path=args.external_subdirectory_engine_path, + external_subdir_project_path=args.external_subdirectory_project_path, + remove=args.remove, + force=args.force) + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python register.py --engine-path "C:/o3de" + :param parser: the caller passes an argparse parser like instance to this method + """ + group = parser.add_mutually_exclusive_group(required=True) + group.add_argument('--this-engine', action='store_true', required=False, + default=False, + help='Registers the engine this script is running from.') + group.add_argument('-ep', '--engine-path', type=str, required=False, + help='Engine path to register/remove.') + group.add_argument('-pp', '--project-path', type=str, required=False, + help='Project path to register/remove.') + group.add_argument('-gp', '--gem-path', type=str, required=False, + help='Gem path to register/remove.') + group.add_argument('-es', '--external-subdirectory', type=str, required=False, + help='External subdirectory path to register/remove.') + group.add_argument('-tp', '--template-path', type=str, required=False, + help='Template path to register/remove.') + group.add_argument('-rp', '--restricted-path', type=str, required=False, + help='A restricted folder to register/remove.') + group.add_argument('-ru', '--repo-uri', type=str, required=False, + help='A repo uri to register/remove.') + group.add_argument('-aep', '--all-engines-path', type=str, required=False, + help='All engines under this folder to register/remove.') + group.add_argument('-app', '--all-projects-path', type=str, required=False, + help='All projects under this folder to register/remove.') + group.add_argument('-agp', '--all-gems-path', type=str, required=False, + help='All gems under this folder to register/remove.') + group.add_argument('-atp', '--all-templates-path', type=str, required=False, + help='All templates under this folder to register/remove.') + group.add_argument('-arp', '--all-restricted-path', type=str, required=False, + help='All templates under this folder to register/remove.') + group.add_argument('-aru', '--all-repo-uri', type=str, required=False, + help='All repos under this folder to register/remove.') + group.add_argument('-def', '--default-engines-folder', type=str, required=False, + help='The default engines folder to register/remove.') + group.add_argument('-dpf', '--default-projects-folder', type=str, required=False, + help='The default projects folder to register/remove.') + group.add_argument('-dgf', '--default-gems-folder', type=str, required=False, + help='The default gems folder to register/remove.') + group.add_argument('-dtf', '--default-templates-folder', type=str, required=False, + help='The default templates folder to register/remove.') + group.add_argument('-drf', '--default-restricted-folder', type=str, required=False, + help='The default restricted folder to register/remove.') + group.add_argument('-u', '--update', action='store_true', required=False, + default=False, + help='Refresh the repo cache.') + + 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.add_argument('-r', '--remove', action='store_true', required=False, + default=False, + help='Remove entry.') + parser.add_argument('-f', '--force', action='store_true', default=False, + help='For the update of the registration field being modified.') + + external_subdir_group = parser.add_argument_group(title='external-subdirectory', + description='path arguments to use with the --external-subdirectory option') + external_subdir_path_group = external_subdir_group.add_mutually_exclusive_group() + external_subdir_path_group.add_argument('-esep', '--external-subdirectory-engine-path', type=pathlib.Path, + help='If supplied, registers the external subdirectory with the engine.json at' \ + ' the engine-path location') + external_subdir_path_group.add_argument('-espp', '--external-subdirectory-project-path', type=pathlib.Path) + parser.set_defaults(func=_run_register) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py register --engine-path "C:/o3de" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + register_subparser = subparsers.add_parser('register') + add_parser_args(register_subparser) + + +def main(): + """ + Runs register.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/repo.py b/scripts/o3de/o3de/repo.py new file mode 100644 index 0000000000..c6b4874b6a --- /dev/null +++ b/scripts/o3de/o3de/repo.py @@ -0,0 +1,160 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import json +import logging +import pathlib +import shutil +import urllib.parse +import urllib.request + +from o3de import manifest, utils, validation + +logger = logging.getLogger() +logging.basicConfig() + + +def process_add_o3de_repo(file_name: str or pathlib.Path, + repo_set: set) -> int: + file_name = pathlib.Path(file_name).resolve() + if not validation.valid_o3de_repo_json(file_name): + return 1 + + cache_folder = manifest.get_o3de_cache_folder() + + with file_name.open('r') as f: + try: + repo_data = json.load(f) + except json.JSONDecodeError as e: + logger.error(f'{file_name} failed to load: {str(e)}') + return 1 + + for o3de_object_uris, manifest_json in [(repo_data['engines'], 'engine.json'), + (repo_data['projects'], 'project.json'), + (repo_data['gems'], 'gem.json'), + (repo_data['template'], 'template.json'), + (repo_data['restricted'], 'restricted.json')]: + for o3de_object_uri in o3de_object_uris: + manifest_json_uri = f'{o3de_object_uri}/{manifest_json}' + manifest_json_sha256 = hashlib.sha256(manifest_json_uri.encode()) + cache_file = cache_folder / str(manifest_json_sha256.hexdigest() + '.json') + if not cache_file.is_file(): + parsed_uri = urllib.parse.urlparse(manifest_json_uri) + download_file_result = utils.download_file(parsed_uri, cache_file) + if download_file_result != 0: + return download_file_result + + repo_set |= repo_data['repos'] + return 0 + + +def refresh_repos() -> int: + json_data = manifest.load_o3de_manifest() + + # clear the cache + cache_folder = manifest.get_o3de_cache_folder() + shutil.rmtree(cache_folder) + cache_folder = manifest.get_o3de_cache_folder() # will recreate it + + result = 0 + + # set will stop circular references + repo_set = set() + + for repo_uri in json_data['repos']: + if repo_uri not in repo_set: + repo_set.add(repo_uri) + + repo_uri = f'{repo_uri}/repo.json' + repo_sha256 = hashlib.sha256(repo_uri.encode()) + cache_file = cache_folder / str(repo_sha256.hexdigest() + '.json') + if not cache_file.is_file(): + parsed_uri = urllib.parse.urlparse(repo_uri) + download_file_result = utils.download_file(parsed_uri, cache_file) + if download_file_result != 0: + return download_file_result + + if not validation.valid_o3de_repo_json(cache_file): + logger.error(f'Repo json {repo_uri} is not valid.') + cache_file.unlink() + return 1 + + last_failure = process_add_o3de_repo(cache_file, repo_set) + if last_failure: + result = last_failure + + return result + + +def search_repo(repo_json_data: dict, + engine_name: str = None, + project_name: str = None, + gem_name: str = None, + template_name: str = None, + restricted_name: str = None) -> dict or None: + + if isinstance(engine_name, str) or isinstance(engine_name, pathlib.PurePath): + o3de_object_uris = repo_json_data['engines'] + manifest_json = 'engine.json' + json_key = 'engine_name' + search_func = lambda: None if manifest_json_data.get(json_key, '') == engine_name else manifest_json_data + elif isinstance(project_name, str) or isinstance(project_name, pathlib.PurePath): + o3de_object_uris = repo_json_data['projects'] + manifest_json = 'project.json' + json_key = 'project_name' + search_func = lambda: None if manifest_json_data.get(json_key, '') == project_name else manifest_json_data + elif isinstance(gem_name, str) or isinstance(gem_name, pathlib.PurePath): + o3de_object_uris = repo_json_data['gems'] + manifest_json = 'gem.json' + json_key = 'gem_name' + search_func = lambda: None if manifest_json_data.get(json_key, '') == gem_name else manifest_json_data + elif isinstance(template_name, str) or isinstance(template_name, pathlib.PurePath): + o3de_object_uris = repo_json_data['template'] + manifest_json = 'template.json' + json_key = 'template_name' + search_func = lambda: None if manifest_json_data.get(json_key, '') == template_name_name else manifest_json_data + elif isinstance(restricted_name, str) or isinstance(restricted_name, pathlib.PurePath): + o3de_object_uris = repo_json_data['restricted'] + manifest_json = 'restricted.json' + json_key = 'restricted_name' + search_func = lambda: None if manifest_json_data.get(json_key, '') == restricted_name else manifest_json_data + else: + return None + + o3de_object = search_o3de_object(manifest_json, o3de_object_uris, search_func) + if o3de_object: + return o3de_object + + # recurse into the repos object to search for the o3de object + o3de_object_uris = repo_json_data['repos'] + manifest_json = 'repo.json' + search_func = lambda: search_repo(manifest_json, engine_name, project_name, gem_name, template_name) + return search_o3de_object(manifest_json, o3de_object_uris, search_func) + + +def search_o3de_object(manifest_json, o3de_object_uris, search_func): + # Search for the o3de object based on the supplied object name in the current repo + cache_folder = manifest.get_o3de_cache_folder() + for o3de_object_uri in o3de_object_uris: + manifest_json_uri = f'{o3de_object_uri}/{manifest_json}' + manifest_json_sha256 = hashlib.sha256(manifest_json_uri.encode()) + cache_file = cache_folder / str(manifest_json_sha256.hexdigest() + '.json') + if cache_file.is_file(): + with cache_file.open('r') as f: + try: + manifest_json_data = json.load(f) + except json.JSONDecodeError as e: + logger.warn(f'{cache_file} failed to load: {str(e)}') + else: + result_json_data = search_func() + if result_json_data: + return result_json_data + return None diff --git a/cmake/Tools/preview.png b/scripts/o3de/o3de/resources/preview.png similarity index 100% rename from cmake/Tools/preview.png rename to scripts/o3de/o3de/resources/preview.png diff --git a/scripts/o3de/o3de/sha256.py b/scripts/o3de/o3de/sha256.py new file mode 100644 index 0000000000..db0a1fe834 --- /dev/null +++ b/scripts/o3de/o3de/sha256.py @@ -0,0 +1,117 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import argparse +import json +import logging +import hashlib +import pathlib +import sys + +from o3de import utils + +logger = logging.getLogger() +logging.basicConfig() + + +def sha256(file_path: str or pathlib.Path, + json_path: str or pathlib.Path = None) -> int: + if not file_path: + logger.error(f'File path cannot be empty.') + return 1 + file_path = pathlib.Path(file_path).resolve() + if not file_path.is_file(): + logger.error(f'File path {file_path} does not exist.') + return 1 + + if json_path: + json_path = pathlib.Path(json_path).resolve() + if not json_path.is_file(): + logger.error(f'Json path {json_path} does not exist.') + return 1 + + sha256 = hashlib.sha256(file_path.open('rb').read()).hexdigest() + + if json_path: + with json_path.open('r') as s: + try: + json_data = json.load(s) + except json.JSONDecodeError as e: + logger.error(f'Failed to read Json path {json_path}: {str(e)}') + return 1 + json_data.update({"sha256": sha256}) + utils.backup_file(json_path) + with json_path.open('w') as s: + try: + s.write(json.dumps(json_data, indent=4) + '\n') + except OSError as e: + logger.error(f'Failed to write Json path {json_path}: {str(e)}') + return 1 + else: + print(sha256) + return 0 + + +def _run_sha256(args: argparse) -> int: + return sha256(args.file_path, + args.json_path) + + +def add_parser_args(parser): + """ + add_parser_args is called to add arguments to each command such that it can be + invoked locally or added by a central python file. + Ex. Directly run from this file alone with: python sha256.py --file-path "C:/TestGem" + :param parser: the caller passes an argparse parser like instance to this method + """ + parser.add_argument('-f', '--file-path', type=str, required=True, + help='The path to the file you want to sha256.') + parser.add_argument('-j', '--json-path', type=str, required=False, + help='optional path to an o3de json file to add the "sha256" element to.') + parser.set_defaults(func=_run_sha256) + + +def add_args(subparsers) -> None: + """ + add_args is called to add subparsers arguments to each command such that it can be + a central python file such as o3de.py. + It can be run from the o3de.py script as follows + call add_args and execute: python o3de.py sha256 --file-path "C:/TestGem" + :param subparsers: the caller instantiates subparsers and passes it in here + """ + sha256_subparser = subparsers.add_parser('sha256') + add_parser_args(sha256_subparser) + + +def main(): + """ + Runs sha256.py script as standalone script + """ + # parse the command line args + the_parser = argparse.ArgumentParser() + + # add subparsers + + # add args to the parser + add_parser_args(the_parser) + + # parse args + the_args = the_parser.parse_args() + + # run + ret = the_args.func(the_args) if hasattr(the_args, 'func') else 1 + + # return + sys.exit(ret) + + +if __name__ == "__main__": + main() diff --git a/scripts/o3de/o3de/utils.py b/scripts/o3de/o3de/utils.py new file mode 100755 index 0000000000..4330de25b8 --- /dev/null +++ b/scripts/o3de/o3de/utils.py @@ -0,0 +1,112 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +This file contains utility functions +""" + +import uuid +import pathlib +import shutil +import urllib.request + +def validate_identifier(identifier: str) -> bool: + """ + Determine if the identifier supplied is valid. + :param identifier: the name which needs to to checked + :return: bool: if the identifier is valid or not + """ + if not identifier: + return False + elif len(identifier) > 64: + return False + elif not identifier[0].isalpha(): + return False + else: + for character in identifier: + if not (character.isalnum() or character == '_' or character == '-'): + return False + return True + + +def validate_uuid4(uuid_string: str) -> bool: + """ + Determine if the uuid supplied is valid. + :param uuid_string: the uuid which needs to to checked + :return: bool: if the uuid is valid or not + """ + try: + val = uuid.UUID(uuid_string, version=4) + except ValueError: + return False + return str(val) == uuid_string + + +def backup_file(file_name: str or pathlib.Path) -> None: + index = 0 + renamed = False + while not renamed: + backup_file_name = pathlib.Path(str(file_name) + '.bak' + str(index)).resolve() + index += 1 + if not backup_file_name.is_file(): + file_name = pathlib.Path(file_name).resolve() + file_name.rename(backup_file_name) + if backup_file_name.is_file(): + renamed = True + + +def backup_folder(folder: str or pathlib.Path) -> None: + index = 0 + renamed = False + while not renamed: + backup_folder_name = pathlib.Path(str(folder) + '.bak' + str(index)).resolve() + index += 1 + if not backup_folder_name.is_dir(): + folder = pathlib.Path(folder).resolve() + folder.rename(backup_folder_name) + if backup_folder_name.is_dir(): + renamed = True + + +def download_file(parsed_uri, download_path: pathlib.Path) -> int: + """ + :param parsed_uri: uniform resource identifier to zip file to download + :param download_path: location path on disk to download file + """ + if download_path.is_file(): + logger.warn(f'File already downloaded to {download_path}.') + elif parsed_uri.scheme in ['http', 'https', 'ftp', 'ftps']: + with urllib.request.urlopen(url) as s: + with download_path.open('wb') as f: + shutil.copyfileobj(s, f) + else: + origin_file = pathlib.Path(url).resolve() + if not origin_file.is_file(): + return 1 + shutil.copy(origin_file, download_path) + + return 0 + + +def download_zip_file(parsed_uri, download_zip_path: pathlib.Path) -> int: + """ + :param parsed_uri: uniform resource identifier to zip file to download + :param download_zip_path: path to output zip file + """ + download_file_result = download_file(parsed_uri, download_zip_path) + if download_file_result != 0: + return download_file_result + + if not zipfile.is_zipfile(download_zip_path): + logger.error(f"File zip {download_zip_path} is invalid.") + download_zip_path.unlink() + return 1 + + return 0 \ No newline at end of file diff --git a/scripts/o3de/o3de/validation.py b/scripts/o3de/o3de/validation.py new file mode 100644 index 0000000000..721b7eae09 --- /dev/null +++ b/scripts/o3de/o3de/validation.py @@ -0,0 +1,102 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# +""" +This file validating o3de object json files +""" +import json +import pathlib + +def valid_o3de_json_dict(json_data: dict, key: str) -> bool: + return key in json_data + + +def valid_o3de_repo_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['repo_name'] + test = json_data['origin'] + except (json.JSONDecodeError, KeyError) as e: + return False + + return True + + +def valid_o3de_engine_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['engine_name'] + except (json.JSONDecodeError, KeyError) as e: + return False + return True + + +def valid_o3de_project_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['project_name'] + except (json.JSONDecodeError, KeyError) as e: + return False + return True + + +def valid_o3de_gem_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['gem_name'] + except (json.JSONDecodeError, KeyError) as e: + return False + return True + + +def valid_o3de_template_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['template_name'] + except (json.JSONDecodeError, KeyError) as e: + return False + return True + + +def valid_o3de_restricted_json(file_name: str or pathlib.Path) -> bool: + file_name = pathlib.Path(file_name).resolve() + if not file_name.is_file(): + return False + with file_name.open('r') as f: + try: + json_data = json.load(f) + test = json_data['restricted_name'] + except (json.JSONDecodeError, KeyError) as e: + return False + return True diff --git a/scripts/o3de/setup.py b/scripts/o3de/setup.py new file mode 100644 index 0000000000..595f477c45 --- /dev/null +++ b/scripts/o3de/setup.py @@ -0,0 +1,42 @@ +""" +All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +its licensors. + +For complete copyright and license terms please see the LICENSE at the root of this +distribution (the "License"). All use of this software is governed by the License, +or, if provided, by the license below or the license accompanying this file. Do not +remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +""" +import os +import platform + +from setuptools import setup, find_packages +from setuptools.command.develop import develop +from setuptools.command.build_py import build_py + +PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__)) + +PYTHON_64 = platform.architecture()[0] == '64bit' + + +if __name__ == '__main__': + if not PYTHON_64: + raise RuntimeError("32-bit Python is not a supported platform.") + + with open(os.path.join(PACKAGE_ROOT, 'README.txt')) as f: + long_description = f.read() + + setup( + name="o3de", + version="1.0.0", + description='O3DE editor Python bindings test tools', + long_description=long_description, + packages=find_packages(where='o3de', exclude=['tests']), + install_requires=[ + ], + tests_require=[ + ], + entry_points={ + }, + ) diff --git a/scripts/o3de/tests/CMakeLists.txt b/scripts/o3de/tests/CMakeLists.txt new file mode 100644 index 0000000000..0526c7740d --- /dev/null +++ b/scripts/o3de/tests/CMakeLists.txt @@ -0,0 +1,36 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +if(NOT PAL_TRAIT_BUILD_TESTS_SUPPORTED) + return() +endif() + +# Add a test to test out the o3de package `o3de.py register` command +ly_add_pytest( + NAME o3de_register + PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_register.py + TEST_SUITE smoke + EXCLUDE_TEST_RUN_TARGET_FROM_IDE +) + +ly_add_pytest( + NAME o3de_cmake + PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_cmake.py + TEST_SUITE smoke + EXCLUDE_TEST_RUN_TARGET_FROM_IDE +) + +ly_add_pytest( + NAME o3de_global_project + PATH ${CMAKE_CURRENT_LIST_DIR}/unit_test_global_project.py + TEST_SUITE smoke + EXCLUDE_TEST_RUN_TARGET_FROM_IDE +) diff --git a/Tests/Atom/windows/__init__.py b/scripts/o3de/tests/__init__.py old mode 100755 new mode 100644 similarity index 98% rename from Tests/Atom/windows/__init__.py rename to scripts/o3de/tests/__init__.py index 36d43bea05..4d5680a30d --- a/Tests/Atom/windows/__init__.py +++ b/scripts/o3de/tests/__init__.py @@ -1,9 +1,10 @@ -# """ +# # All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or # its licensors. - +# # For complete copyright and license terms please see the LICENSE at the root of this # distribution (the "License"). All use of this software is governed by the License, # or, if provided, by the license below or the license accompanying this file. Do not # remove or modify any license notices. This file is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# diff --git a/scripts/o3de/tests/unit_test_cmake.py b/scripts/o3de/tests/unit_test_cmake.py new file mode 100644 index 0000000000..e5ce17dc03 --- /dev/null +++ b/scripts/o3de/tests/unit_test_cmake.py @@ -0,0 +1,69 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import io +import json +import logging +import pytest +import pathlib +from unittest.mock import patch + +from o3de import cmake + + +class TestGetEnabledGems: + @pytest.mark.parametrize( + "enable_gems_cmake_data, expected_set", [ + pytest.param(""" + # Comment + set(ENABLED_GEMS foo bar baz) + """, set(['foo', 'bar', 'baz'])), + pytest.param(""" + # Comment + set(ENABLED_GEMS + foo + bar + baz + ) + """, set(['foo', 'bar', 'baz'])), + pytest.param(""" + # Comment + set(ENABLED_GEMS + foo + bar + baz) + """, set(['foo', 'bar', 'baz'])), + pytest.param(""" + # Comment + set(ENABLED_GEMS + foo bar + baz) + """, set(['foo', 'bar', 'baz'])), + pytest.param(""" + # Comment + set(RANDOM_VARIABLE TestGame, TestProject Test Engine) + set(ENABLED_GEMS HelloWorld IceCream + foo + baz bar + baz baz baz baz baz morebaz lessbaz + ) + Random Text + """, set(['HelloWorld', 'IceCream', 'foo', 'bar', 'baz', 'morebaz', 'lessbaz'])), + ] + ) + def test_get_enabled_gems(self, enable_gems_cmake_data, expected_set): + enabled_gems_set = set() + with patch('pathlib.Path.resolve', return_value=pathlib.Path('enabled_gems.cmake')) as pathlib_is_resolve_mock,\ + patch('pathlib.Path.is_file', return_value=True) as pathlib_is_file_mock,\ + patch('pathlib.Path.open', return_value=io.StringIO(enable_gems_cmake_data)) as pathlib_open_mock: + enabled_gems_set = cmake.get_enabled_gems(pathlib.Path('enabled_gems.cmake')) + + assert enabled_gems_set == expected_set diff --git a/cmake/Tools/unit_test_engine_template.py b/scripts/o3de/tests/unit_test_engine_template.py similarity index 100% rename from cmake/Tools/unit_test_engine_template.py rename to scripts/o3de/tests/unit_test_engine_template.py diff --git a/scripts/o3de/tests/unit_test_global_project.py b/scripts/o3de/tests/unit_test_global_project.py new file mode 100644 index 0000000000..1d3a4dd4f4 --- /dev/null +++ b/scripts/o3de/tests/unit_test_global_project.py @@ -0,0 +1,40 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import io +import json +import logging +import pytest +import pathlib +from unittest.mock import patch + +from o3de import global_project + + +logger = logging.getLogger() +logging.basicConfig() + +DEFAULT_BOOTSTRAP_SETREG = pathlib.Path('~/.o3de/Registry/bootstrap.setreg').expanduser() +PROJECT_PATH_KEY = ('Amazon', 'AzCore', 'Bootstrap', 'project_path') + +class TestSetGlobalProject: + @pytest.mark.parametrize( + "output_path, project_path, force, expected_result", [ + pytest.param(pathlib.Path('~/.o3de/Registry/bootstrap.setreg'), pathlib.Path('A:/'), False, False), + pytest.param(pathlib.Path('~/.o3de/Registry/bootstrap.setreg'), pathlib.Path('A:/'), True, True) + ] + ) + def test_set_global_project_non_existent_project_path(self, output_path, project_path, force, expected_result): + with patch('pathlib.Path.open', return_value=io.StringIO()) as pathlib_open_mock: + result = global_project.set_global_project(output_path, project_path=project_path, force=force) == 0 + + + assert result == expected_result diff --git a/scripts/o3de/tests/unit_test_register.py b/scripts/o3de/tests/unit_test_register.py new file mode 100644 index 0000000000..eb866e76d4 --- /dev/null +++ b/scripts/o3de/tests/unit_test_register.py @@ -0,0 +1,117 @@ +# +# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or +# its licensors. +# +# For complete copyright and license terms please see the LICENSE at the root of this +# distribution (the "License"). All use of this software is governed by the License, +# or, if provided, by the license below or the license accompanying this file. Do not +# remove or modify any license notices. This file is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# + +import argparse +import json +import logging +import pytest +import pathlib +from unittest.mock import patch + +from o3de import register + +string_manifest_data = '{}' + +@pytest.mark.parametrize( + "engine_path, engine_name, force, expected_result", [ + pytest.param(pathlib.PurePath('D:/o3de/o3de'), "o3de", False, 0), + # Same engine_name and path should result in valid registration + pytest.param(pathlib.PurePath('D:/o3de/o3de'), "o3de", False, 0), + # Same engine_name and but different path should fail + pytest.param(pathlib.PurePath('D:/o3de/engine-path'), "o3de", False, 1), + # New engine_name should result in valid registration + pytest.param(pathlib.PurePath('D:/o3de/engine-path'), "o3de-other", False, 0), + # Same engine_name and but different path with --force should result in valid registration + pytest.param(pathlib.PurePath('F:/Open3DEngine'), "o3de", True, 0), + ] +) +def test_register_engine_path(engine_path, engine_name, force, expected_result): + parser = argparse.ArgumentParser() + + # Register the registration script subparsers with the current argument parser + register.add_parser_args(parser) + arg_list = ['--engine-path', str(engine_path)] + if force: + arg_list += ['--force'] + args = parser.parse_args(arg_list) + + def load_manifest_from_string() -> dict: + try: + manifest_json = json.loads(string_manifest_data) + except json.JSONDecodeError as err: + logging.error("Error decoding Json from Manifest file") + else: + return manifest_json + def save_manifest_to_string(manifest_json: dict) -> None: + global string_manifest_data + string_manifest_data = json.dumps(manifest_json) + + engine_json_data = {'engine_name': engine_name} + with patch('o3de.manifest.load_o3de_manifest', side_effect=load_manifest_from_string) as load_manifest_mock, \ + patch('o3de.manifest.save_o3de_manifest', side_effect=save_manifest_to_string) as save_manifest_mock, \ + patch('o3de.manifest.get_engine_json_data', return_value=engine_json_data) as engine_paths_mock, \ + patch('o3de.validation.valid_o3de_engine_json', return_value=True) as valid_engine_mock, \ + patch('pathlib.Path.is_dir', return_value=True) as pathlib_is_dir_mock: + result = register._run_register(args) + assert result == expected_result + + +@pytest.fixture(scope='class') +def init_manifest_data(request): + class ManifestData: + def __init__(self): + self.json_string = json.dumps({'default_engines_folder': '', + 'default_projects_folder': '', 'default_gems_folder': '', + 'default_templates_folder': '', 'default_restricted_folder': ''}) + + request.cls.manifest_data = ManifestData() + + +@pytest.mark.usefixtures('init_manifest_data') +class TestRegisterThisEngine: + @pytest.mark.parametrize( + "engine_path, engine_name, force, expected_result", [ + pytest.param(pathlib.PurePath('D:/o3de/o3de'), "o3de", False, 0), + pytest.param(pathlib.PurePath('F:/Open3DEngine'), "o3de", False, 1), + pytest.param(pathlib.PurePath('F:/Open3DEngine'), "o3de", True, 0) + ] + ) + def test_register_this_engine(self, engine_path, engine_name, force, expected_result): + parser = argparse.ArgumentParser() + + # Register the registration script subparsers with the current argument parser + register.add_parser_args(parser) + arg_list = ['--this-engine'] + if force: + arg_list += ['--force'] + args = parser.parse_args(arg_list) + + def load_manifest_from_string() -> dict: + try: + manifest_json = json.loads(self.manifest_data.json_string) + except json.JSONDecodeError as err: + logging.error("Error decoding Json from Manifest file") + else: + return manifest_json + def save_manifest_to_string(manifest_json: dict) -> None: + self.manifest_data.json_string = json.dumps(manifest_json) + + engine_json_data = {'engine_name': engine_name} + + with patch('o3de.manifest.load_o3de_manifest', side_effect=load_manifest_from_string) as load_manifest_mock, \ + patch('o3de.manifest.save_o3de_manifest', side_effect=save_manifest_to_string) as save_manifest_mock, \ + patch('o3de.manifest.get_engine_json_data', return_value=engine_json_data) as engine_paths_mock, \ + patch('o3de.manifest.get_this_engine_path', return_value=engine_path) as engine_paths_mock, \ + patch('o3de.validation.valid_o3de_engine_json', return_value=True) as valid_engine_mock, \ + patch('pathlib.Path.is_dir', return_value=True) as pathlib_is_dir_mock: + result = register._run_register(args) + assert result == expected_result + diff --git a/cmake/Tools/unit_test_utils.py b/scripts/o3de/tests/unit_test_utils.py similarity index 100% rename from cmake/Tools/unit_test_utils.py rename to scripts/o3de/tests/unit_test_utils.py diff --git a/scripts/project_manager/projects.py b/scripts/project_manager/projects.py index 51db7a6440..f9f40aa4bf 100755 --- a/scripts/project_manager/projects.py +++ b/scripts/project_manager/projects.py @@ -29,12 +29,11 @@ executable_path = '' logger = logging.getLogger() logger.setLevel(logging.INFO) -from cmake.Tools import engine_template -from cmake.Tools import registration +from o3de import disable_gem, enable_gem, cmake, engine_template, manifest, register -o3de_folder = registration.get_o3de_folder() -o3de_logs_folder = registration.get_o3de_logs_folder() -project_manager_log_file_path = o3de_log_folder / "project_manager.log" +o3de_folder = manifest.get_o3de_folder() +o3de_logs_folder = manifest.get_o3de_logs_folder() +project_manager_log_file_path = o3de_logs_folder / "project_manager.log" log_file_handler = RotatingFileHandler(filename=project_manager_log_file_path, maxBytes=1024 * 1024, backupCount=1) formatter = logging.Formatter('%(asctime)s | %(levelname)s : %(message)s') log_file_handler.setFormatter(formatter) @@ -124,7 +123,7 @@ class ProjectManagerDialog(QObject): super(ProjectManagerDialog, self).__init__(parent) self.ui_path = (pathlib.Path(__file__).parent / 'ui').resolve() - self.home_folder = registration.get_home_folder() + self.home_folder = manifest.get_home_folder() self.log_display = None self.dialog_logger = DialogLogger(self) @@ -187,12 +186,8 @@ class ProjectManagerDialog(QObject): self.remove_restricted_button = self.dialog.findChild(QPushButton, 'removeRestrictedButton') self.remove_restricted_button.clicked.connect(self.remove_restricted_handler) - self.manage_runtime_project_gem_targets_button = self.dialog.findChild(QPushButton, 'manageRuntimeGemTargetsButton') - self.manage_runtime_project_gem_targets_button.clicked.connect(self.manage_runtime_project_gem_targets_handler) - self.manage_tool_project_gem_targets_button = self.dialog.findChild(QPushButton, 'manageToolGemTargetsButton') - self.manage_tool_project_gem_targets_button.clicked.connect(self.manage_tool_project_gem_targets_handler) - self.manage_server_project_gem_targets_button = self.dialog.findChild(QPushButton, 'manageServerGemTargetsButton') - self.manage_server_project_gem_targets_button.clicked.connect(self.manage_server_project_gem_targets_handler) + self.manage_project_gem_targets_button = self.dialog.findChild(QPushButton, 'manageRuntimeGemTargetsButton') + self.manage_project_gem_targets_button.clicked.connect(self.manage_project_gem_targets_handler) self.log_display = self.dialog.findChild(QLabel, 'logDisplay') @@ -202,7 +197,7 @@ class ProjectManagerDialog(QObject): self.dialog.show() def refresh_project_list(self) -> None: - projects = registration.get_all_projects() + projects = manifest.get_all_projects() self.project_list_box.clear() for this_slot in range(len(projects)): display_name = f'{os.path.basename(os.path.normpath(projects[this_slot]))} ({projects[this_slot]})' @@ -256,7 +251,7 @@ class ProjectManagerDialog(QObject): return self.project_list_box.itemData(self.project_list_box.currentIndex(), Qt.ToolTipRole) def get_selected_project_name(self) -> str: - project_data = registration.get_project_data(project_path=self.get_selected_project_path()) + project_data = manifest.get_project_json_data(project_path=self.get_selected_project_path()) return project_data['project_name'] def create_project_handler(self): @@ -298,7 +293,7 @@ class ProjectManagerDialog(QObject): return folder_dialog = QFileDialog(self.dialog, "Select a Folder and Enter a New Project Name", - registration.get_o3de_projects_folder().as_posix()) + manifest.get_o3de_projects_folder().as_posix()) folder_dialog.setFileMode(QFileDialog.AnyFile) folder_dialog.setOptions(QFileDialog.ShowDirsOnly) project_count = 0 @@ -314,7 +309,7 @@ class ProjectManagerDialog(QObject): if engine_template.create_project(project_path=project_folder[0], template_path=project_template_path) == 0: # Success - registration.register(project_path=project_folder[0]) + register.register(project_path=project_folder[0]) self.refresh_project_list() msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -360,7 +355,7 @@ class ProjectManagerDialog(QObject): return folder_dialog = QFileDialog(self.dialog, "Select a Folder and Enter a New Gem Name", - registration.get_o3de_gems_folder().as_posix()) + manifest.get_o3de_gems_folder().as_posix()) folder_dialog.setFileMode(QFileDialog.AnyFile) folder_dialog.setOptions(QFileDialog.ShowDirsOnly) gem_count = 0 @@ -376,7 +371,7 @@ class ProjectManagerDialog(QObject): if engine_template.create_gem(gem_path=gem_folder[0], template_path=gem_template_path) == 0: # Success - registration.register(gem_path=gem_folder[0]) + register.register(gem_path=gem_folder[0]) msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") msg_box.setText(f"Gem {gem_folder[0]} created.") @@ -392,13 +387,13 @@ class ProjectManagerDialog(QObject): source_folder = QFileDialog.getExistingDirectory(self.dialog, "Select a Folder to make a template out of.", - registration.get_o3de_folder().as_posix()) + manifest.get_o3de_folder().as_posix()) if not source_folder: return destination_template_folder_dialog = QFileDialog(self.dialog, "Select where the template is to be created and named.", - registration.get_o3de_templates_folder().as_posix()) + manifest.get_o3de_templates_folder().as_posix()) destination_template_folder_dialog.setFileMode(QFileDialog.AnyFile) destination_template_folder_dialog.setOptions(QFileDialog.ShowDirsOnly) destination_folder = None @@ -410,7 +405,7 @@ class ProjectManagerDialog(QObject): if engine_template.create_template(source_path=source_folder, template_path=destination_folder[0]) == 0: # Success - registration.register(template_path=destination_folder[0]) + register.register(template_path=destination_folder[0]) msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") msg_box.setText(f"Template {destination_folder[0]} created.") @@ -454,7 +449,7 @@ class ProjectManagerDialog(QObject): return folder_dialog = QFileDialog(self.dialog, "Select a Folder and Enter a New Gem Name", - registration.get_o3de_gems_folder().as_posix()) + manifest.get_o3de_gems_folder().as_posix()) folder_dialog.setFileMode(QFileDialog.AnyFile) folder_dialog.setOptions(QFileDialog.ShowDirsOnly) gem_count = 0 @@ -483,9 +478,9 @@ class ProjectManagerDialog(QObject): :return: None """ project_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Project Folder", - registration.get_o3de_projects_folder().as_posix()) + manifest.get_o3de_projects_folder().as_posix()) if project_folder: - if registration.register(project_path=project_folder) == 0: + if register.register(project_path=project_folder) == 0: # Success self.refresh_project_list() @@ -502,9 +497,9 @@ class ProjectManagerDialog(QObject): :return: None """ gem_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Gem Folder", - registration.get_o3de_gems_folder().as_posix()) + manifest.get_o3de_gems_folder().as_posix()) if gem_folder: - if registration.register(gem_path=gem_folder) == 0: + if register.register(gem_path=gem_folder) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -519,9 +514,9 @@ class ProjectManagerDialog(QObject): :return: None """ template_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Template Folder", - registration.get_o3de_templates_folder().as_posix()) + manifest.get_o3de_templates_folder().as_posix()) if template_folder: - if registration.register(template_path=template_folder) == 0: + if register.register(template_path=template_folder) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -536,9 +531,9 @@ class ProjectManagerDialog(QObject): :return: None """ restricted_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Restricted Folder", - registration.get_o3de_restricted_folder().as_posix()) + manifest.get_o3de_restricted_folder().as_posix()) if restricted_folder: - if registration.register(restricted_path=restricted_folder) == 0: + if register.register(restricted_path=restricted_folder) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -553,9 +548,9 @@ class ProjectManagerDialog(QObject): :return: None """ project_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Project Folder", - registration.get_o3de_projects_folder().as_posix()) + manifest.get_o3de_projects_folder().as_posix()) if project_folder: - if registration.register(project_path=project_folder, remove=True) == 0: + if register.register(project_path=project_folder, remove=True) == 0: # Success self.refresh_project_list() @@ -572,9 +567,9 @@ class ProjectManagerDialog(QObject): :return: None """ gem_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Gem Folder", - registration.get_o3de_gems_folder().as_posix()) + manifest.get_o3de_gems_folder().as_posix()) if gem_folder: - if registration.register(gem_path=gem_folder, remove=True) == 0: + if register.register(gem_path=gem_folder, remove=True) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -589,9 +584,9 @@ class ProjectManagerDialog(QObject): :return: None """ template_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Template Folder", - registration.get_o3de_templates_folder().as_posix()) + manifest.get_o3de_templates_folder().as_posix()) if template_folder: - if registration.register(template_path=template_folder, remove=True) == 0: + if register.register(template_path=template_folder, remove=True) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -606,9 +601,9 @@ class ProjectManagerDialog(QObject): :return: None """ restricted_folder = QFileDialog.getExistingDirectory(self.dialog, "Select Restricted Folder", - registration.get_o3de_restricted_folder().as_posix()) + manifest.get_o3de_restricted_folder().as_posix()) if restricted_folder: - if registration.register(restricted_path=restricted_folder, remove=True) == 0: + if register.register(restricted_path=restricted_folder, remove=True) == 0: # Success msg_box = QMessageBox(parent=self.dialog) msg_box.setWindowTitle("O3DE") @@ -616,7 +611,7 @@ class ProjectManagerDialog(QObject): msg_box.exec() return - def manage_runtime_project_gem_targets_handler(self): + def manage_project_gem_targets_handler(self): """ Opens the Gem management pane. Waits for the load thread to complete if still running and displays all active gems for the current project as well as all available gems which aren't currently active. @@ -643,121 +638,26 @@ class ProjectManagerDialog(QObject): logger.error(f'Failed to load gems dialog file at {self.manage_project_gem_targets_ui_file_path.as_posix()}') return - self.manage_project_gem_targets_dialog.setWindowTitle(f"Manage Runtime Gem Targets for Project:" + self.manage_project_gem_targets_dialog.setWindowTitle(f"Manage Gems for Project:" f" {self.get_selected_project_name()}") self.add_gem_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, 'addGemTargetsButton') - self.add_gem_button.clicked.connect(self.add_runtime_project_gem_targets_handler) + self.add_gem_button.clicked.connect(self.add_project_gem_targets_handler) self.available_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, 'availableGemTargetsList') - self.refresh_runtime_project_gem_targets_available_list() + self.refresh_project_gem_targets_available_list() self.remove_project_gem_targets_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, 'removeGemTargetsButton') - self.remove_project_gem_targets_button.clicked.connect(self.remove_runtime_project_gem_targets_handler) + self.remove_project_gem_targets_button.clicked.connect(self.remove_project_gem_targets_handler) self.enabled_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, 'enabledGemTargetsList') - self.refresh_runtime_project_gem_targets_enabled_list() + self.refresh_project_gem_targets_enabled_list() self.manage_project_gem_targets_dialog.exec() - def manage_tool_project_gem_targets_handler(self): - """ - Opens the Gem management pane. Waits for the load thread to complete if still running and displays all - active gems for the current project as well as all available gems which aren't currently active. - :return: None - """ - - if not self.get_selected_project_path(): - msg_box = QMessageBox(parent=self.dialog) - msg_box.setWindowTitle("O3DE") - msg_box.setText("Please select a project") - msg_box.exec() - return - - loader = QUiLoader() - self.manage_project_gem_targets_file = QFile(self.manage_project_gem_targets_ui_file_path.as_posix()) - - if not self.manage_project_gem_targets_file: - logger.error(f'Failed to load manage gem targets UI file at {self.manage_project_gem_targets_ui_file_path}') - return - - self.manage_project_gem_targets_dialog = loader.load(self.manage_project_gem_targets_file) - - if not self.manage_project_gem_targets_dialog: - logger.error( - f'Failed to load gems dialog file at {self.manage_project_gem_targets_ui_file_path.as_posix()}') - return - - self.manage_project_gem_targets_dialog.setWindowTitle(f"Manage Tool Gem Targets for Project:" - f" {self.get_selected_project_name()}") - - self.add_gem_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, 'addGemTargetsButton') - self.add_gem_button.clicked.connect(self.add_tool_project_gem_targets_handler) - - self.available_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, - 'availableGemTargetsList') - self.refresh_tool_project_gem_targets_available_list() - - self.remove_project_gem_targets_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, - 'removeGemTargetsButton') - self.remove_project_gem_targets_button.clicked.connect(self.remove_tool_project_gem_targets_handler) - - self.enabled_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, - 'enabledGemTargetsList') - self.refresh_tool_project_gem_targets_enabled_list() - - self.manage_project_gem_targets_dialog.exec() - - def manage_server_project_gem_targets_handler(self): - """ - Opens the Gem management pane. Waits for the load thread to complete if still running and displays all - active gems for the current project as well as all available gems which aren't currently active. - :return: None - """ - - if not self.get_selected_project_path(): - msg_box = QMessageBox(parent=self.dialog) - msg_box.setWindowTitle("O3DE") - msg_box.setText("Please select a project") - msg_box.exec() - return - - loader = QUiLoader() - self.manage_project_gem_targets_file = QFile(self.manage_project_gem_targets_ui_file_path.as_posix()) - - if not self.manage_project_gem_targets_file: - logger.error(f'Failed to load manage gem targets UI file at {self.manage_project_gem_targets_ui_file_path}') - return - - self.manage_project_gem_targets_dialog = loader.load(self.manage_project_gem_targets_file) - - if not self.manage_project_gem_targets_dialog: - logger.error( - f'Failed to load gems dialog file at {self.manage_project_gem_targets_ui_file_path.as_posix()}') - return - - self.manage_project_gem_targets_dialog.setWindowTitle(f"Manage Server Gem Targets for Project:" - f" {self.get_selected_project_name()}") - - self.add_gem_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, 'addGemTargetsButton') - self.add_gem_button.clicked.connect(self.add_server_project_gem_targets_handler) - - self.available_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, - 'availableGemTargetsList') - self.refresh_server_project_gem_targets_available_list() - - self.remove_project_gem_targets_button = self.manage_project_gem_targets_dialog.findChild(QPushButton, - 'removeGemTargetsButton') - self.remove_project_gem_targets_button.clicked.connect(self.remove_server_project_gem_targets_handler) - - self.enabled_gem_targets_list = self.manage_project_gem_targets_dialog.findChild(QListView, - 'enabledGemTargetsList') - self.refresh_server_project_gem_targets_enabled_list() - - self.manage_project_gem_targets_dialog.exec() def manage_project_gem_targets_get_selected_available_gems(self) -> list: selected_items = self.available_gem_targets_list.selectionModel().selectedRows() @@ -767,185 +667,67 @@ class ProjectManagerDialog(QObject): selected_items = self.enabled_gem_targets_list.selectionModel().selectedRows() return [(self.enabled_gem_targets_list.model().data(item)) for item in selected_items] - def add_runtime_project_gem_targets_handler(self) -> None: - gem_paths = registration.get_all_gems() + def add_project_gem_targets_handler(self) -> None: + gem_paths = manifest.get_all_gems() for gem_target in self.manage_project_gem_targets_get_selected_available_gems(): for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.add_gem_to_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - runtime_dependency=True) - self.refresh_runtime_project_gem_targets_available_list() - self.refresh_runtime_project_gem_targets_enabled_list() - return - self.refresh_runtime_project_gem_targets_available_list() - self.refresh_runtime_project_gem_targets_enabled_list() + enable_gem.enable_gem_in_project(gem_path=gem_path, + project_path=self.get_selected_project_path()) + self.refresh_project_gem_targets_available_list() + self.refresh_project_gem_targets_enabled_list() + return + self.refresh_project_gem_targets_available_list() + self.refresh_project_gem_targets_enabled_list() - def remove_runtime_project_gem_targets_handler(self): - gem_paths = registration.get_all_gems() + def remove_project_gem_targets_handler(self): + gem_paths = manifest.get_all_gems() for gem_target in self.manage_project_gem_targets_get_selected_enabled_gems(): for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.remove_gem_from_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - runtime_dependency=True) - self.refresh_runtime_project_gem_targets_available_list() - self.refresh_runtime_project_gem_targets_enabled_list() - return - self.refresh_runtime_project_gem_targets_available_list() - self.refresh_runtime_project_gem_targets_enabled_list() + disable_gem.disable_gem_in_project(gem_path=gem_path, + project_path=self.get_selected_project_path()) + self.refresh_project_gem_targets_available_list() + self.refresh_project_gem_targets_enabled_list() + return + self.refresh_project_gem_targets_available_list() + self.refresh_project_gem_targets_enabled_list() - def add_tool_project_gem_targets_handler(self) -> None: - gem_paths = registration.get_all_gems() - for gem_target in self.manage_project_gem_targets_get_selected_available_gems(): - for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.add_gem_to_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - tool_dependency=True) - self.refresh_tool_project_gem_targets_available_list() - self.refresh_tool_project_gem_targets_enabled_list() - return - self.refresh_tool_project_gem_targets_available_list() - self.refresh_tool_project_gem_targets_enabled_list() - - def remove_tool_project_gem_targets_handler(self): - gem_paths = registration.get_all_gems() - for gem_target in self.manage_project_gem_targets_get_selected_enabled_gems(): - for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.remove_gem_from_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - tool_dependency=True) - self.refresh_tool_project_gem_targets_available_list() - self.refresh_tool_project_gem_targets_enabled_list() - return - self.refresh_tool_project_gem_targets_available_list() - self.refresh_tool_project_gem_targets_enabled_list() - - def add_server_project_gem_targets_handler(self) -> None: - gem_paths = registration.get_all_gems() - for gem_target in self.manage_project_gem_targets_get_selected_available_gems(): - for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.add_gem_to_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - server_dependency=True) - self.refresh_server_project_gem_targets_available_list() - self.refresh_server_project_gem_targets_enabled_list() - return - self.refresh_server_project_gem_targets_available_list() - self.refresh_server_project_gem_targets_enabled_list() - - def remove_server_project_gem_targets_handler(self): - gem_paths = registration.get_all_gems() - for gem_target in self.manage_project_gem_targets_get_selected_enabled_gems(): - for gem_path in gem_paths: - this_gems_targets = registration.get_gem_targets(gem_path=gem_path) - for this_gem_target in this_gems_targets: - if gem_target == this_gem_target: - registration.remove_gem_from_project(gem_path=gem_path, - gem_target=gem_target, - project_path=self.get_selected_project_path(), - server_dependency=True) - self.refresh_server_project_gem_targets_available_list() - self.refresh_server_project_gem_targets_enabled_list() - return - self.refresh_server_project_gem_targets_available_list() - self.refresh_server_project_gem_targets_enabled_list() - - def refresh_runtime_project_gem_targets_enabled_list(self) -> None: + def refresh_project_gem_targets_enabled_list(self) -> None: enabled_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_runtime_gem_targets( - project_path=self.get_selected_project_path()) - for gem_target in sorted(enabled_project_gem_targets): + enabled_project_gems = cmake.get_project_gems(project_path=self.get_selected_project_path()) + for gem_target in sorted(enabled_project_gems): model_item = QStandardItem(gem_target) enabled_project_gem_targets_model.appendRow(model_item) self.enabled_gem_targets_list.setModel(enabled_project_gem_targets_model) - def refresh_runtime_project_gem_targets_available_list(self) -> None: + + def refresh_project_gem_targets_available_list(self) -> None: available_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_runtime_gem_targets( - project_path=self.get_selected_project_path()) - all_gem_targets = registration.get_all_gem_targets() + enabled_project_gem_targets = cmake.get_project_gems(project_path=self.get_selected_project_path()) + all_gem_targets = manifest.get_all_gems() for gem_target in sorted(all_gem_targets): if gem_target not in enabled_project_gem_targets: model_item = QStandardItem(gem_target) available_project_gem_targets_model.appendRow(model_item) self.available_gem_targets_list.setModel(available_project_gem_targets_model) - - def refresh_tool_project_gem_targets_enabled_list(self) -> None: - enabled_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_tool_gem_targets( - project_path=self.get_selected_project_path()) - for gem_target in sorted(enabled_project_gem_targets): - model_item = QStandardItem(gem_target) - enabled_project_gem_targets_model.appendRow(model_item) - self.enabled_gem_targets_list.setModel(enabled_project_gem_targets_model) - def refresh_tool_project_gem_targets_available_list(self) -> None: - available_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_tool_gem_targets( - project_path=self.get_selected_project_path()) - all_gem_targets = registration.get_all_gem_targets() - for gem_target in sorted(all_gem_targets): - if gem_target not in enabled_project_gem_targets: - model_item = QStandardItem(gem_target) - available_project_gem_targets_model.appendRow(model_item) - self.available_gem_targets_list.setModel(available_project_gem_targets_model) - - def refresh_server_project_gem_targets_enabled_list(self) -> None: - enabled_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_server_gem_targets( - project_path=self.get_selected_project_path()) - for gem_target in sorted(enabled_project_gem_targets): - model_item = QStandardItem(gem_target) - enabled_project_gem_targets_model.appendRow(model_item) - self.enabled_gem_targets_list.setModel(enabled_project_gem_targets_model) - - def refresh_server_project_gem_targets_available_list(self) -> None: - available_project_gem_targets_model = QStandardItemModel() - enabled_project_gem_targets = registration.get_project_server_gem_targets( - project_path=self.get_selected_project_path()) - all_gem_targets = registration.get_all_gem_targets() - for gem_target in sorted(all_gem_targets): - if gem_target not in enabled_project_gem_targets: - model_item = QStandardItem(gem_target) - available_project_gem_targets_model.appendRow(model_item) - self.available_gem_targets_list.setModel(available_project_gem_targets_model) def refresh_create_project_template_list(self) -> None: self.create_project_template_model = QStandardItemModel() - for project_template_path in registration.get_project_templates(): + for project_template_path in manifest.get_project_templates(): model_item = QStandardItem(project_template_path) self.create_project_template_model.appendRow(model_item) self.create_project_template_list.setModel(self.create_project_template_model) def refresh_create_gem_template_list(self) -> None: self.create_gem_template_model = QStandardItemModel() - for gem_template_path in registration.get_gem_templates(): + for gem_template_path in manifest.get_gem_templates(): model_item = QStandardItem(gem_template_path) self.create_gem_template_model.appendRow(model_item) self.create_gem_template_list.setModel(self.create_gem_template_model) def refresh_create_from_template_list(self) -> None: self.create_from_template_model = QStandardItemModel() - for generic_template_path in registration.get_generic_templates(): + for generic_template_path in manifest.get_generic_templates(): model_item = QStandardItem(generic_template_path) self.create_from_template_model.appendRow(model_item) self.create_from_template_list.setModel(self.create_from_template_model) diff --git a/scripts/scrubbing/validator.py b/scripts/scrubbing/validator.py index ac7c45554f..4a979da943 100755 --- a/scripts/scrubbing/validator.py +++ b/scripts/scrubbing/validator.py @@ -243,7 +243,7 @@ class Validator(object): validations += 1 counter += 1 - # Trim out whitelisted subdirectories in the current directory if allowed + # Trim out allowlisted subdirectories in the current directory if allowed for name in bypassed_directories: if name in dirnames: dirnames.remove(name) diff --git a/system_android_es3.cfg b/system_android_android.cfg similarity index 93% rename from system_android_es3.cfg rename to system_android_android.cfg index 46ab50f558..d5bfddeb73 100644 --- a/system_android_es3.cfg +++ b/system_android_android.cfg @@ -1,4 +1,4 @@ --- config file used when the android platform is running off 'es3' assets. +-- config file used when the android platform is running off 'android' assets. sys_float_exceptions=0 log_IncludeTime=1 sys_PakLogInvalidFileAccess=1 diff --git a/system_mac_osx_gl.cfg b/system_mac_mac.cfg similarity index 100% rename from system_mac_osx_gl.cfg rename to system_mac_mac.cfg