Skip to content

Commit

Permalink
Updating method used for finding necessary entity for Terrain_NodeCon…
Browse files Browse the repository at this point in the history
…struction test

Signed-off-by: jckand-amzn <[email protected]>
  • Loading branch information
jckand committed Sep 26, 2022
1 parent 4ffe9b0 commit 696cd4d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def on_entity_created(parameters):
# 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"))
Expand All @@ -86,18 +91,13 @@ def on_entity_created(parameters):
Report.critical_result(Tests.new_graph_created, new_graph_id is not None)

# Reposition the automatically created entity to origin
root_entity = EditorEntity.find_editor_entity("Entity1")
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)

# Listen for entity creation notifications
handler = editor.EditorEntityContextNotificationBusHandler()
handler.connect()
handler.add_callback("OnEditorEntityCreated", on_entity_created)

# Add the required Terrain level components
terrain_world_component = EditorLevelEntity.add_component("Terrain World")
terrain_world_renderer = EditorLevelEntity.add_component("Terrain World Renderer")
Expand Down

0 comments on commit 696cd4d

Please sign in to comment.