diff --git a/AutomatedTesting/Assets/Prefabs/LandscapeCanvasTerrain.prefab b/AutomatedTesting/Assets/Prefabs/LandscapeCanvasTerrain.prefab new file mode 100644 index 000000000000..cdf5b0adc6a8 --- /dev/null +++ b/AutomatedTesting/Assets/Prefabs/LandscapeCanvasTerrain.prefab @@ -0,0 +1,933 @@ +{ + "ContainerEntity": { + "Id": "ContainerEntity", + "Name": "LandscapeCanvasTerrain", + "Components": { + "Component_[12657151604007309357]": { + "$type": "EditorLockComponent", + "Id": 12657151604007309357 + }, + "Component_[13154631477460224595]": { + "$type": "EditorOnlyEntityComponent", + "Id": 13154631477460224595 + }, + "Component_[14746036701470251839]": { + "$type": "EditorVisibilityComponent", + "Id": 14746036701470251839 + }, + "Component_[16286721386348954109]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 16286721386348954109 + }, + "Component_[1855942963417532997]": { + "$type": "EditorInspectorComponent", + "Id": 1855942963417532997 + }, + "Component_[2025407883828931865]": { + "$type": "EditorEntityIconComponent", + "Id": 2025407883828931865 + }, + "Component_[2856757559904782054]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 2856757559904782054, + "Parent Entity": "" + }, + "Component_[4979898252223811562]": { + "$type": "EditorPendingCompositionComponent", + "Id": 4979898252223811562 + }, + "Component_[6792364165643047871]": { + "$type": "EditorEntitySortComponent", + "Id": 6792364165643047871, + "Child Entity Order": [ + "Entity_[8967538284090]" + ] + }, + "Component_[7570298768221973070]": { + "$type": "EditorPrefabComponent", + "Id": 7570298768221973070 + } + } + }, + "Entities": { + "Entity_[8967538284090]": { + "Id": "Entity_[8967538284090]", + "Name": "LandscapeCanvas", + "Components": { + "Component_[11852456938602844960]": { + "$type": "EditorEntityIconComponent", + "Id": 11852456938602844960 + }, + "Component_[13016030239941916988]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 13016030239941916988, + "Parent Entity": "ContainerEntity" + }, + "Component_[13226815871456542974]": { + "$type": "EditorLockComponent", + "Id": 13226815871456542974 + }, + "Component_[14045415690931579181]": { + "$type": "EditorOnlyEntityComponent", + "Id": 14045415690931579181 + }, + "Component_[14080467479023875277]": { + "$type": "EditorInspectorComponent", + "Id": 14080467479023875277, + "ComponentOrderEntryArray": [ + { + "ComponentId": 13016030239941916988 + }, + { + "ComponentId": 4708062978254253926, + "SortIndex": 1 + } + ] + }, + "Component_[17247097822908296702]": { + "$type": "EditorVisibilityComponent", + "Id": 17247097822908296702 + }, + "Component_[2015669226299749759]": { + "$type": "EditorEntitySortComponent", + "Id": 2015669226299749759, + "Child Entity Order": [ + "Entity_[8976128218682]" + ] + }, + "Component_[4708062978254253926]": { + "$type": "EditorLandscapeCanvasComponent", + "Id": 4708062978254253926, + "Graph": { + "m_nodes": [ + { + "Key": 1, + "Value": { + "$type": "AxisAlignedBoxShapeNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "TerrainSpawner" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 8819450740393318541 + } + }, + { + "Key": 2, + "Value": { + "$type": "TerrainLayerSpawnerNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "TerrainSpawner" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 14553822160321729606 + } + }, + { + "Key": 3, + "Value": { + "$type": "ReferenceShapeNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "HeightmapGradient" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "InboundShape" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8971833251386]", + "m_componentId": 16666166640248911163 + } + }, + { + "Key": 4, + "Value": { + "$type": "PerlinNoiseGradientNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "HeightmapGradient" + } + } + } + ], + "m_inputDataSlots": [ + { + "Key": { + "m_name": "PreviewBounds" + }, + "Value": { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8971833251386]", + "m_componentId": 9860922145923378589 + } + }, + { + "Key": 5, + "Value": { + "$type": "TerrainMacroMaterialNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "TerrainSpawner" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 12237656071967086793 + } + }, + { + "Key": 6, + "Value": { + "$type": "TerrainSurfaceMaterialsListNode", + "m_propertySlots": [ + { + "Key": { + "m_name": "EntityName" + }, + "Value": { + "m_value": { + "$type": "{03AAAB3F-5C47-5A66-9EBC-D5FA4DB353C9} AZStd::string", + "Value": "TerrainSpawner" + } + } + } + ], + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 9767928792067928389 + } + }, + { + "Key": 7, + "Value": { + "$type": "TerrainHeightGradientListNode", + "m_extendableSlots": { + "InboundGradient": [ + { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + ] + }, + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 13382680504164912560 + } + }, + { + "Key": 8, + "Value": { + "$type": "TerrainSurfaceGradientListNode", + "m_extendableSlots": { + "InboundGradient": [ + { + "m_value": { + "$type": "EntityId", + "Value": "" + } + } + ] + }, + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 8637726408847485680 + } + }, + { + "Key": 9, + "Value": { + "$type": "TerrainPhysicsHeightfieldColliderNode", + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 2591738885157621431 + } + }, + { + "Key": 10, + "Value": { + "$type": "PhysXHeightfieldColliderNode", + "m_vegetationEntityId": "Entity_[8976128218682]", + "m_componentId": 11504704613097751760 + } + } + ], + "m_connections": [ + { + "m_sourceEndpoint": [ + 1, + { + "m_name": "Bounds" + } + ], + "m_targetEndpoint": [ + 3, + { + "m_name": "InboundShape" + } + ] + } + ], + "m_uiMetadata": { + "m_sceneMetadata": { + "ComponentData": { + "{5F84B500-8C45-40D1-8EFC-A5306B241444}": { + "$type": "SceneComponentSaveData", + "ViewParams": { + "Scale": 0.6596368600125972, + "AnchorX": -645.8098754882813, + "AnchorY": -66.703369140625 + } + } + } + }, + "m_nodeMetadata": [ + { + "Key": 2, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 600.0, + 440.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{FA76A168-D431-4F47-A5F6-8F2440F28174}" + } + } + } + }, + { + "Key": 3, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "ShapeNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 440.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{D5525B3F-3F19-48F4-B726-C783C02C684D}" + } + } + } + }, + { + "Key": 4, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "GradientNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 100.0, + 800.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{66BC8728-E773-4B2A-9543-7C175C50B3BA}" + } + } + } + }, + { + "Key": 5, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 133.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{95574DE2-DE95-4F60-99CE-F903F7EE8D79}" + } + } + } + }, + { + "Key": 6, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 288.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{3EC9BC80-2C7C-40D9-B33B-D3A5BDA53773}" + } + } + } + }, + { + "Key": 7, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 34.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{05ED84DD-5232-411C-8453-04CDBBEE17E9}" + } + } + } + }, + { + "Key": 8, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 189.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{AE293A29-FB79-416C-8D4D-034012B87137}" + } + } + } + }, + { + "Key": 9, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 161.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{B0DDCBCA-45C6-4B17-9F62-125EED7A3EA8}" + } + } + } + }, + { + "Key": 10, + "Value": { + "ComponentData": { + "{24CB38BB-1705-4EC5-8F63-B574571B4DCD}": { + "$type": "NodeSaveData" + }, + "{328FF15C-C302-458F-A43D-E1794DE0904E}": { + "$type": "GeneralNodeTitleComponentSaveData", + "PaletteOverride": "TerrainNodeTitlePalette" + }, + "{7CC444B1-F9B3-41B5-841B-0C4F2179F111}": { + "$type": "GeometrySaveData", + "Position": [ + 6.0, + 6.0 + ] + }, + "{B0B99C8A-03AF-4CF6-A926-F65C874C3D97}": { + "$type": "StylingComponentSaveData" + }, + "{B1F49A35-8408-40DA-B79E-F1E3B64322CE}": { + "$type": "PersistentIdComponentSaveData", + "PersistentId": "{060C4DC7-CFEE-413C-B714-366C1438BECB}" + } + } + } + } + ] + }, + "m_nodeWrappings": [ + { + "Key": 5, + "Value": [ + 2, + 29 + ] + }, + { + "Key": 6, + "Value": [ + 2, + 32 + ] + }, + { + "Key": 7, + "Value": [ + 2, + 27 + ] + }, + { + "Key": 8, + "Value": [ + 2, + 31 + ] + }, + { + "Key": 9, + "Value": [ + 2, + 30 + ] + }, + { + "Key": 10, + "Value": [ + 2, + 26 + ] + } + ] + } + }, + "Component_[8115176397670100058]": { + "$type": "EditorPendingCompositionComponent", + "Id": 8115176397670100058 + }, + "Component_[9300954258942736751]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9300954258942736751 + } + } + }, + "Entity_[8971833251386]": { + "Id": "Entity_[8971833251386]", + "Name": "HeightmapGradient", + "Components": { + "Component_[10804014024059187598]": { + "$type": "EditorEntityIconComponent", + "Id": 10804014024059187598 + }, + "Component_[10863702004979251180]": { + "$type": "EditorLockComponent", + "Id": 10863702004979251180 + }, + "Component_[1198636646362192517]": { + "$type": "EditorGradientTransformComponent", + "Id": 1198636646362192517, + "Configuration": { + "ShapeReference": "", + "Bounds": [ + 512.0, + 512.0, + 32.0 + ] + } + }, + "Component_[12874589598216868875]": { + "$type": "EditorPendingCompositionComponent", + "Id": 12874589598216868875 + }, + "Component_[13331234453650528420]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 13331234453650528420 + }, + "Component_[15138908446330453178]": { + "$type": "EditorVisibilityComponent", + "Id": 15138908446330453178 + }, + "Component_[16666166640248911163]": { + "$type": "EditorReferenceShapeComponent", + "Id": 16666166640248911163, + "Configuration": { + "ShapeEntityId": "Entity_[8976128218682]" + } + }, + "Component_[2503706768435266627]": { + "$type": "EditorEntitySortComponent", + "Id": 2503706768435266627 + }, + "Component_[3237215681394319820]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 3237215681394319820, + "Parent Entity": "Entity_[8976128218682]" + }, + "Component_[4791690504997970203]": { + "$type": "EditorOnlyEntityComponent", + "Id": 4791690504997970203 + }, + "Component_[6547039796446024939]": { + "$type": "EditorInspectorComponent", + "Id": 6547039796446024939, + "ComponentOrderEntryArray": [ + { + "ComponentId": 3237215681394319820 + }, + { + "ComponentId": 9860922145923378589, + "SortIndex": 1 + }, + { + "ComponentId": 1198636646362192517, + "SortIndex": 2 + }, + { + "ComponentId": 16666166640248911163, + "SortIndex": 3 + } + ] + }, + "Component_[9860922145923378589]": { + "$type": "EditorPerlinGradientComponent", + "Id": 9860922145923378589, + "Configuration": { + "frequency": 0.009999999776482582 + }, + "Previewer": { + "BoundsEntity": "Entity_[8971833251386]" + } + } + } + }, + "Entity_[8976128218682]": { + "Id": "Entity_[8976128218682]", + "Name": "TerrainSpawner", + "Components": { + "Component_[11504704613097751760]": { + "$type": "EditorHeightfieldColliderComponent", + "Id": 11504704613097751760, + "ColliderConfiguration": { + "MaterialSlots": { + "Slots": [ + {}, + { + "MaterialAsset": { + "assetId": { + "guid": "{00880607-87E1-5178-8C30-37B3220D6149}", + "subId": 1 + }, + "assetHint": "assets/physics/glass.physicsmaterial" + } + } + ] + } + } + }, + "Component_[12237656071967086793]": { + "$type": "EditorTerrainMacroMaterialComponent", + "Id": 12237656071967086793, + "Configuration": { + "MacroColor": { + "assetId": { + "guid": "{AC3219AA-A747-5C09-BA1A-29A76BF8C1DE}", + "subId": 1000 + }, + "assetHint": "materials/presets/macbeth/15_red_srgb.tif.streamingimage" + } + } + }, + "Component_[13226441898179426794]": { + "$type": "EditorPendingCompositionComponent", + "Id": 13226441898179426794 + }, + "Component_[13382680504164912560]": { + "$type": "EditorTerrainHeightGradientListComponent", + "Id": 13382680504164912560, + "Configuration": { + "GradientEntities": [ + "Entity_[8971833251386]" + ] + } + }, + "Component_[13751693355705175002]": { + "$type": "EditorEntityIconComponent", + "Id": 13751693355705175002 + }, + "Component_[1379723664066449576]": { + "$type": "{27F1E1A1-8D9D-4C3B-BD3A-AFB9762449C0} TransformComponent", + "Id": 1379723664066449576, + "Parent Entity": "Entity_[8967538284090]" + }, + "Component_[14553822160321729606]": { + "$type": "EditorTerrainLayerSpawnerComponent", + "Id": 14553822160321729606 + }, + "Component_[15346299279434745079]": { + "$type": "EditorInspectorComponent", + "Id": 15346299279434745079, + "ComponentOrderEntryArray": [ + { + "ComponentId": 1379723664066449576 + }, + { + "ComponentId": 14553822160321729606, + "SortIndex": 1 + }, + { + "ComponentId": 8819450740393318541, + "SortIndex": 2 + }, + { + "ComponentId": 13382680504164912560, + "SortIndex": 3 + }, + { + "ComponentId": 9767928792067928389, + "SortIndex": 4 + }, + { + "ComponentId": 8637726408847485680, + "SortIndex": 5 + }, + { + "ComponentId": 12237656071967086793, + "SortIndex": 6 + }, + { + "ComponentId": 2591738885157621431, + "SortIndex": 7 + }, + { + "ComponentId": 11504704613097751760, + "SortIndex": 8 + } + ] + }, + "Component_[1552598088843956046]": { + "$type": "EditorOnlyEntityComponent", + "Id": 1552598088843956046 + }, + "Component_[18013841206766463186]": { + "$type": "EditorVisibilityComponent", + "Id": 18013841206766463186 + }, + "Component_[255603483110562554]": { + "$type": "EditorLockComponent", + "Id": 255603483110562554 + }, + "Component_[2591738885157621431]": { + "$type": "EditorTerrainPhysicsColliderComponent", + "Id": 2591738885157621431, + "Configuration": { + "Mappings": [ + { + "Surface": { + "SurfaceTagCrc": 2062838596 + }, + "MaterialAsset": { + "assetId": { + "guid": "{00880607-87E1-5178-8C30-37B3220D6149}", + "subId": 1 + }, + "assetHint": "assets/physics/glass.physicsmaterial" + } + } + ] + } + }, + "Component_[374541837907923278]": { + "$type": "EditorEntitySortComponent", + "Id": 374541837907923278, + "Child Entity Order": [ + "Entity_[8971833251386]" + ] + }, + "Component_[8637726408847485680]": { + "$type": "EditorTerrainSurfaceGradientListComponent", + "Id": 8637726408847485680, + "Configuration": { + "Mappings": [ + { + "Gradient Entity": "Entity_[8971833251386]", + "Surface Tag": { + "SurfaceTagCrc": 2062838596 + } + } + ] + } + }, + "Component_[8819450740393318541]": { + "$type": "EditorAxisAlignedBoxShapeComponent", + "Id": 8819450740393318541, + "AxisAlignedBoxShape": { + "Configuration": { + "Dimensions": [ + 512.0, + 512.0, + 32.0 + ] + } + } + }, + "Component_[9605085643614868271]": { + "$type": "EditorDisabledCompositionComponent", + "Id": 9605085643614868271 + }, + "Component_[9767928792067928389]": { + "$type": "EditorTerrainSurfaceMaterialsListComponent", + "Id": 9767928792067928389, + "Configuration": { + "Mappings": [ + { + "Surface": { + "SurfaceTagCrc": 2062838596 + }, + "MaterialAsset": { + "assetId": { + "guid": "{82346ED7-D369-5EF0-A7E0-70C1082EE073}" + }, + "assetHint": "materials/presets/macbeth/14_green.azmaterial" + } + } + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/TerrainNodes_EntityRemovedOnNodeDelete.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/TerrainNodes_EntityRemovedOnNodeDelete.py new file mode 100644 index 000000000000..3144eae7e9c3 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/TerrainNodes_EntityRemovedOnNodeDelete.py @@ -0,0 +1,121 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + entity_deleted = ( + "Entity was deleted when node was removed", + "Entity was not deleted as expected when node was removed" + ) + + +created_entity_id = None +deleted_entity_id = None + + +def TerrainNodes_EntityRemovedOnNodeDelete(): + """ + Summary: + This test verifies that entities created automatically by Landscape Canvas are properly removed when the node + that created them is removed. + + Expected Behavior: + Entities are properly deleted when corresponding nodes are removed. + + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Drag each of the terrain nodes to the graph area, and ensure the newly created entity is deleted when the node + is removed. + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + + editor_id = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID + + def on_entity_created(parameters): + global created_entity_id + created_entity_id = parameters[0] + + def on_entity_deleted(parameters): + global deleted_entity_id + deleted_entity_id = parameters[0] + + # Open an existing simple level + hydra.open_base_level() + + # Open Landscape Canvas tool and verify + general.open_pane("Landscape Canvas") + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible("Landscape Canvas")) + + # Create a new graph in Landscape Canvas + new_graph_id = graph.AssetEditorRequestBus(bus.Event, "CreateNewGraph", editor_id) + Report.critical_result(Tests.new_graph_created, new_graph_id is not None) + + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, "ContainsGraph", editor_id, new_graph_id) + Report.result(Tests.graph_registered, graph_registered) + + # Listen for entity creation/deletion notifications, so we can check if the entity created + # from adding terrain nodes is appropriately removed along with the node + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback("OnEditorEntityCreated", on_entity_created) + handler.add_callback("OnEditorEntityDeleted", on_entity_deleted) + + # All the unwrapped Terrain nodes that can be added to a graph + areas = [ + "TerrainMacroMaterialNode", + "TerrainLayerSpawnerNode", + "TerrainSurfaceMaterialsListNode" + ] + + # Create nodes for all the terrain components we support and check if the Entity is created and then deleted when + # the node is removed + new_graph = graph.GraphManagerRequestBus(bus.Broadcast, "GetGraph", new_graph_id) + x = 10.0 + y = 10.0 + for node_name in areas: + node_position = math.Vector2(x, y) + node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, "CreateNodeForTypeName", new_graph, node_name) + graph.GraphControllerRequestBus(bus.Event, "AddNode", new_graph_id, node, node_position) + + removed = graph.GraphControllerRequestBus(bus.Event, "RemoveNode", new_graph_id, node) + + # Verify that the created Entity for this node matches the Entity that gets + # deleted when the node is removed + Report.info(f"Node: {node_name}") + Report.result(Tests.entity_deleted, removed and created_entity_id.invoke("Equal", deleted_entity_id)) + + # Stop listening for entity creation notifications + handler.disconnect() + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(TerrainNodes_EntityRemovedOnNodeDelete) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_ExistingSetups_GraphSuccessfully.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_ExistingSetups_GraphSuccessfully.py new file mode 100644 index 000000000000..e57923b8ede8 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_ExistingSetups_GraphSuccessfully.py @@ -0,0 +1,146 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +class Tests: + prefab_instantiated = ( + "Test prefab instantiated properly", + "Failed to instantiate test prefab" + ) + lc_entity_found = ( + "LandscapeCanvas entity found", + "Failed to find LandscapeCanvas entity" + ) + spawner_entity_found = ( + "TerrainSpawner entity found", + "Failed to find TerrainSpawner entity" + ) + heightmap_entity_found = ( + "HeightmapGradient entity found", + "Failed to find HeightmapGradient entity" + ) + existing_graph_opened = ( + "Successfully opened graph from existing spawner setup", + "Failed to open graph from existing spawner setup" + ) + + +def Terrain_ExistingSetups_GraphSuccessfully(): + """ + Summary: + This test verifies that a Terrain Spawner that is manually setup and saved to a prefab is graphed properly in + Landscape Canvas once opened. + + Expected Behavior: + All expected nodes are present, expected nodes are wrapped, and all expected node connections are present/accurate. + + Test Steps: + 1) Open a simple level. + 2) Instantiate an existing Terrain spawner prefab. + 3) Open the prefab's Landscape Canvas graph. + 4) Validate the contents of the graph. + """ + + import os + + import azlmbr.bus as bus + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.prefab as prefab + import azlmbr.entity as entity + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.editor_entity_utils import EditorEntity + from editor_python_test_tools.utils import Report + + # Open a simple level and instantiate LandscapeCanvasTerrain.prefab + hydra.open_base_level() + position = math.Vector3(256.0, 256.0, 16.0) + test_prefab_path = os.path.join("Assets", "Prefabs", "LandscapeCanvasTerrain.prefab") + prefab_result = prefab.PrefabPublicRequestBus(bus.Broadcast, "InstantiatePrefab", test_prefab_path, + entity.EntityId(), position) + Report.critical_result(Tests.prefab_instantiated, prefab_result.IsSuccess()) + + # Find the necessary entities/components to open the LC graph and validate nodes are graphed properly + prefab_root_entity = EditorEntity.find_editor_entity("LandscapeCanvas", must_be_unique=True) + Report.critical_result(Tests.lc_entity_found, prefab_root_entity.id.IsValid()) + terrain_spawner_entity = EditorEntity.find_editor_entity("TerrainSpawner", must_be_unique=True) + Report.critical_result(Tests.spawner_entity_found, terrain_spawner_entity.id.IsValid()) + heightmap_entity = EditorEntity.find_editor_entity("HeightmapGradient", must_be_unique=True) + Report.critical_result(Tests.heightmap_entity_found, heightmap_entity.id.IsValid()) + + terrain_spawner_component = terrain_spawner_entity.get_components_of_type(["Terrain Layer Spawner"])[0] + aabb_component = terrain_spawner_entity.get_components_of_type(["Axis Aligned Box Shape"])[0] + shape_ref_component = heightmap_entity.get_components_of_type(["Shape Reference"])[0] + gradient_component = heightmap_entity.get_components_of_type(["Perlin Noise Gradient"])[0] + surf_grad_list_component = terrain_spawner_entity.get_components_of_type(["Terrain Surface Gradient List"])[0] + height_grad_list_component = terrain_spawner_entity.get_components_of_type(["Terrain Height Gradient List"])[0] + + # Open the existing Landscape Canvas graph + general.open_pane("Landscape Canvas") + open_graph = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, "OnGraphEntity", prefab_root_entity.id) + Report.critical_result(Tests.existing_graph_opened, open_graph.IsValid()) + + # Validate the proper nodes are present + spawner_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, "GetAllNodesMatchingEntityComponent", + terrain_spawner_component.id) + aabb_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, "GetAllNodesMatchingEntityComponent", + aabb_component.id) + shape_ref_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, "GetAllNodesMatchingEntityComponent", + shape_ref_component.id) + gradient_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, "GetAllNodesMatchingEntityComponent", + gradient_component.id) + surf_grad_list_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, + "GetAllNodesMatchingEntityComponent", + surf_grad_list_component.id) + height_grad_list_nodes = landscapecanvas.LandscapeCanvasRequestBus(bus.Broadcast, + "GetAllNodesMatchingEntityComponent", + height_grad_list_component.id) + nodes = { + "ReferenceShapeNode": shape_ref_nodes, + "AxisAlignedBoxShapeNode": aabb_nodes, + "TerrainSurfaceGradientListNode": surf_grad_list_nodes, + "TerrainHeightGradientListNode": height_grad_list_nodes, + "TerrainLayerSpawnerNode": spawner_nodes, + "PerlinNoiseGradientNode": gradient_nodes + } + for node_name in nodes.keys(): + node_found = ( + f"{node_name} found", + f"Failed to find {node_name}" + ) + Report.result(node_found, len(nodes[node_name]) == 1) + + # Get the necessary slot ids for validating node connections + bounds_slot = graph.GraphModelSlotId("Bounds") + inbound_shape_slot = graph.GraphModelSlotId("InboundShape") + inbound_grad_slot = graph.GraphModelSlotId("InboundGradient") + outbound_grad_slot = graph.GraphModelSlotId("OutboundGradient") + + # Validate the proper connections exist between nodes + def are_slots_connected(node_1, node_1_slot, node_2, node_2_slot): + connected = graph.GraphControllerRequestBus(bus.Event, "AreSlotsConnected", open_graph, nodes[node_1][0], + node_1_slot, nodes[node_2][0], node_2_slot) + connection_found = ( + f"Found connection between {node_1} and {node_2}", + f"Failed to find connection between {node_1} and {node_2}" + ) + Report.result(connection_found, connected) + + are_slots_connected("PerlinNoiseGradientNode", outbound_grad_slot, "TerrainHeightGradientListNode", + inbound_grad_slot) + are_slots_connected("PerlinNoiseGradientNode", outbound_grad_slot, "TerrainSurfaceGradientListNode", + inbound_grad_slot) + are_slots_connected("AxisAlignedBoxShapeNode", bounds_slot, "ReferenceShapeNode", inbound_shape_slot) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Terrain_ExistingSetups_GraphSuccessfully) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_NodeConstruction.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_NodeConstruction.py new file mode 100644 index 000000000000..ad24ec8ebac2 --- /dev/null +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/EditorScripts/Terrain_NodeConstruction.py @@ -0,0 +1,171 @@ +""" +Copyright (c) Contributors to the Open 3D Engine Project. +For complete copyright and license terms please see the LICENSE at the root of this distribution. + +SPDX-License-Identifier: Apache-2.0 OR MIT +""" + + +class Tests: + lc_tool_opened = ( + "Landscape Canvas tool opened", + "Failed to open Landscape Canvas tool" + ) + new_graph_created = ( + "Successfully created new graph", + "Failed to create new graph" + ) + graph_registered = ( + "Graph registered with Landscape Canvas", + "Failed to register graph" + ) + level_components_added = ( + "Level components added correctly", + "Failed to create level components" + ) + aabb_configured = ( + "Successfully configured terrain bounds", + "Failed to configure terrain bounds" + ) + terrain_found = ( + "Found terrain at expected locations", + "Failed to find terrain at expected locations" + ) + + +created_entity_id = None + + +def Terrain_NodeConstruction(): + """ + Summary: + This test verifies that a Terrain Layer Spawner area can be constructed via Terrain nodes in Landscape Canvas. + + Expected Behavior: + Terrain nodes/connections can construct a valid Terrain area. + + Test Steps: + 1) Open a simple level + 2) Open Landscape Canvas and create a new graph + 3) Add required Terrain Level components. + 4) Add a Terrain Layer Spawner and configure its Axis Aligned Box Shape. + 5) Add a new Constant Gradient node and configure. + 6) Add Terrain Height Gradient List/Terrain Surface Gradient List wrapped nodes to the Spawner node. + 7) Connect the Gradient List wrapped nodes to the configured Constant Gradient node. + 8) Validate terrain exists as constructed via nodes. + """ + + import azlmbr.bus as bus + import azlmbr.editor as editor + import azlmbr.editor.graph as graph + import azlmbr.landscapecanvas as landscapecanvas + import azlmbr.legacy.general as general + import azlmbr.math as math + import azlmbr.terrain as terrain + + import editor_python_test_tools.hydra_editor_utils as hydra + from editor_python_test_tools.utils import Report + from editor_python_test_tools.wait_utils import PrefabWaiter + from editor_python_test_tools.editor_entity_utils import EditorEntity, EditorLevelEntity + + editor_id = azlmbr.globals.property.LANDSCAPE_CANVAS_EDITOR_ID + + def on_entity_created(parameters): + global created_entity_id + created_entity_id = parameters[0] + + # Open an existing simple level + hydra.open_base_level() + + # Listen for entity creation notifications + handler = editor.EditorEntityContextNotificationBusHandler() + handler.connect() + handler.add_callback("OnEditorEntityCreated", on_entity_created) + + # Open Landscape Canvas tool and verify + general.open_pane("Landscape Canvas") + Report.critical_result(Tests.lc_tool_opened, general.is_pane_visible("Landscape Canvas")) + + # Create a new graph in Landscape Canvas + new_graph_id = graph.AssetEditorRequestBus(bus.Event, "CreateNewGraph", editor_id) + Report.critical_result(Tests.new_graph_created, new_graph_id is not None) + + # Reposition the automatically created entity to origin + root_entity = EditorEntity(created_entity_id) + root_entity.set_world_translation(math.Vector3(0.0, 0.0, 0.0)) + + # Make sure the graph we created is in Landscape Canvas + graph_registered = graph.AssetEditorRequestBus(bus.Event, "ContainsGraph", editor_id, new_graph_id) + Report.result(Tests.graph_registered, graph_registered) + + # Add the required Terrain level components + terrain_world_component = EditorLevelEntity.add_component("Terrain World") + terrain_world_renderer = EditorLevelEntity.add_component("Terrain World Renderer") + Report.critical_result(Tests.level_components_added, + terrain_world_component is not None and terrain_world_renderer is not None) + + # Add a Terrain Layer Spawner node to the graph + new_graph = graph.GraphManagerRequestBus(bus.Broadcast, "GetGraph", new_graph_id) + node_position = math.Vector2(10.0, 10.0) + layer_spawner_node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, "CreateNodeForTypeName", + new_graph, "TerrainLayerSpawnerNode") + graph.GraphControllerRequestBus(bus.Event, "AddNode", new_graph_id, layer_spawner_node, node_position) + + # Get component type Ids for all expected Terrain components + component_names = ["Terrain Layer Spawner", "Axis Aligned Box Shape", "Terrain Height Gradient List", + "Terrain Surface Gradient List", "Constant Gradient"] + component_type_ids = hydra.get_component_type_id_map(component_names) + + # Get Axis Aligned Box Shape component info + aabb_type_id = component_type_ids["Axis Aligned Box Shape"] + aabb_component_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "GetComponentOfType", created_entity_id, + aabb_type_id) + assert aabb_component_outcome.IsSuccess(), "Failed to get Axis Aligned Box Shape component info" + aabb_component = aabb_component_outcome.GetValue() + + # Adjust the bounds of the Axis Aligned Box Shape + box_shape_dimensions = math.Vector3(512.0, 512.0, 64.0) + aabb_outcome = editor.EditorComponentAPIBus(bus.Broadcast, "SetComponentProperty", aabb_component, + "Axis Aligned Box Shape|Box Configuration|Dimensions", + box_shape_dimensions) + Report.result(Tests.aabb_configured, aabb_outcome.IsSuccess()) + PrefabWaiter.wait_for_propagation() + + # Add a Constant Gradient node to the graph + node_position = math.Vector2(110.0, 110.0) + constant_gradient_node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, + "CreateNodeForTypeName", new_graph, + "ConstantGradientNode") + graph.GraphControllerRequestBus(bus.Event, "AddNode", new_graph_id, constant_gradient_node, node_position) + + # Add Terrain Height Gradient List and Terrain Surface Gradient List wrapped nodes to the Terrain Spawner + height_grad_list_node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, "CreateNodeForTypeName", + new_graph, + "TerrainHeightGradientListNode") + surface_grad_list_node = landscapecanvas.LandscapeCanvasNodeFactoryRequestBus(bus.Broadcast, "CreateNodeForTypeName", + new_graph, + "TerrainSurfaceGradientListNode") + graph.GraphControllerRequestBus(bus.Event, "WrapNode", new_graph_id, layer_spawner_node, height_grad_list_node) + graph.GraphControllerRequestBus(bus.Event, "WrapNode", new_graph_id, layer_spawner_node, surface_grad_list_node) + + # Connect the Constant Gradient node to the Height and Surface Gradient Lists + inbound_grad_slot = graph.GraphModelSlotId("InboundGradient") + outbound_grad_slot = graph.GraphModelSlotId("OutboundGradient") + + graph.GraphControllerRequestBus(bus.Event, "AddConnectionBySlotId", new_graph_id, constant_gradient_node, + outbound_grad_slot, height_grad_list_node, inbound_grad_slot) + graph.GraphControllerRequestBus(bus.Event, "AddConnectionBySlotId", new_graph_id, constant_gradient_node, + outbound_grad_slot, surface_grad_list_node, inbound_grad_slot) + + # Query 2 points we expect terrain to exist and one we don"t and validate + terrain_exists = not terrain.TerrainDataRequestBus(bus.Broadcast, "GetIsHole", math.Vector3(128.0, 128.0, 0.0), 2) + terrain_exists2 = not terrain.TerrainDataRequestBus(bus.Broadcast, "GetIsHole", math.Vector3(-64.0, -64.0, 0.0), 2) + terrain_exists3 = not terrain.TerrainDataRequestBus(bus.Broadcast, "GetIsHole", math.Vector3(512.0, 512.0, 0.0), 2) + + Report.result(Tests.terrain_found, terrain_exists and terrain_exists2 and not terrain_exists3) + + +if __name__ == "__main__": + + from editor_python_test_tools.utils import Report + Report.start_test(Terrain_NodeConstruction) diff --git a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py index 0936aa5ab08f..f0a8b0c761fd 100644 --- a/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py +++ b/AutomatedTesting/Gem/PythonTests/largeworlds/landscape_canvas/TestSuite_Main.py @@ -84,6 +84,12 @@ class test_LandscapeCanvas_ShapeNodes_EntityRemovedOnNodeDelete(EditorSharedTest class test_LandscapeCanvas_SlotConnections_UpdateComponentReferences(EditorSharedTest): from .EditorScripts import SlotConnections_UpdateComponentReferences as test_module + class test_LandscapeCanvas_ExistingTerrainSetups_GraphSuccessfully(EditorSharedTest): + from .EditorScripts import Terrain_ExistingSetups_GraphSuccessfully as test_module + + class test_LandscapeCanvas_Terrain_NodeConstruction(EditorSharedTest): + from .EditorScripts import Terrain_NodeConstruction as test_module + class test_LandscapeCanvas_TerrainExtenderNodes_ComponentEntitySync(EditorSharedTest): from .EditorScripts import TerrainExtenderNodes_ComponentEntitySync as test_module @@ -92,3 +98,6 @@ class test_LandscapeCanvas_TerrainNodes_DependentComponentsAdded(EditorSharedTes class test_LandscapeCanvas_TerrainNodes_EntityCreatedOnNodeAdd(EditorSharedTest): from .EditorScripts import TerrainNodes_EntityCreatedOnNodeAdd as test_module + + class test_LandscapeCanvas_TerrainNodes_EntityRemovedOnNodeDelete(EditorSharedTest): + from .EditorScripts import TerrainNodes_EntityRemovedOnNodeDelete as test_module