Commit Graph

18 Commits (ffdd3e85acf468dfcf34f02817d1bcf75d0b7f64)

Author SHA1 Message Date
AMZN-Igarri bb14675db7
Fix tests Debug (#6405)
Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>
4 years ago
Tom Hulton-Harrop d065eb9498
Initial improvements to fix viewport icon selection and draw order (#6284)
* wip fixes for entity viewport icons displaying in the correct order and handling selection correctly

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add additional comment about z value

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* move manual sorting and some small tidy-up

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update comment

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* updates following initial round of PR feedback

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* additional changes to support tests for entity icon intersection

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* add support to enable/disable icons separately from helpers

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* final tests added and small tidy-up to display EntityId correctly

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update some manipulator test framework calls after utility functions were moved

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix for implicit cast

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* move icon scale values to AZ_CVARS

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* fix failing tests caught in AR and update some naming conventions for tests

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update naming convention for members of ProjectedViewportRay

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update other references to ProjectedViewportRay

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update more references to ProjectedViewportRay change

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>

* update menus for python tests

Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
4 years ago
Esteban Papp cd5306febf Merging from development
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Esteban Papp bb685ee40b Merge branch 'development' into redcode/driller_removal
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
srikappa-amzn 625fca71ab
Prefab/unit tests for deletion (#6034)
* Added tests for deleting entity under level and other prefabs

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>

* Added class comments and improved variable names

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>

* Called the reflect function of PrefabFocusHandler from PrefabSystemComponent

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>

* Added couple of unit tests around entity and prefab deletion

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>

* Used engine root path from settings registry as fake path for prefab creation

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>

* Added 2 unit tests around deleting prefabs

Signed-off-by: srikappa-amzn <82230713+srikappa-amzn@users.noreply.github.com>
4 years ago
Esteban Papp 47de333e94 Removes m_enableDrilling
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Nicholas Van Sickle 8d5dd4e35f Merge remote-tracking branch 'upstream/stabilization/2110' into nvsickle/StabToDevNov21
Signed-off-by: Nicholas Van Sickle <nvsickle@amazon.com>
4 years ago
Mikhail Naumov e1d53395fe
Propagation Optimization (#5355)
* Merge changes

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>

* removing leftover immediate flag

Signed-off-by: Mikhail Naumov <mnaumov@amazon.com>
4 years ago
lumberyard-employee-dm 5fc4551ac0
[LYN-8041] Enable relocation of the Project Game Release Layout (#5380)
* Enable relocation of the Project Game Release Layout

Relocating the Project Game Release Layout to another directory on the file system failed due to the querying of the engine root failing due to the ComponentApplication::m_engineRoot not using the project path stored in the SettingsRegisry if the engine root cannot be detected

Removed the ApplicationRequestBus GetEngineRoot function.
The ComponentApplicationRequestBus has a function of the same name that returns the same path.

Removed the deprecated GetAppRoot function.
The path it returns has no defined value. It was not the engine root or the project root.
Removed unused CFileUtil and CFileUtil_impl functions that were invoking the ApplicationREquestBus GetEngineRoot function.
On the way to update the functions it was discovered that they aren't called

Added a CalculateBranchToken overload that can populate a fixed_string to avoid heap allocations

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>

* Protect against an empty list of artifacts to remove when generating the
engine.pak

Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
4 years ago
AMZN-Igarri a1d9a2cc58
Asset Browser Tests (#4948)
* Added AssetBrowser Tests

Signed-off-by: igarri <igarri@amazon.com>

* Added Entries to test AssetBrowser

Signed-off-by: igarri <igarri@amazon.com>

* Added Print info.

Signed-off-by: igarri <igarri@amazon.com>

* Added more folders

Signed-off-by: igarri <igarri@amazon.com>

* Added Asset Browser Tests for the Search View

Signed-off-by: igarri <igarri@amazon.com>

* Fixed Entry creation

Signed-off-by: igarri <igarri@amazon.com>

* Removed optimize

Signed-off-by: igarri <igarri@amazon.com>

* Cleanup AssetBrowserModel

Signed-off-by: igarri <igarri@amazon.com>

* RowCount made public

Signed-off-by: igarri <igarri@amazon.com>

* Delegated entry creation to RootAssetBrowserEntry and added Code review feedback

Signed-off-by: igarri <igarri@amazon.com>

* removed unused helper class and fixed demo tests

Signed-off-by: igarri <igarri@amazon.com>

* Fixed bus connections

Signed-off-by: igarri <igarri@amazon.com>

* Refactored test environment and added basic tests

Signed-off-by: igarri <igarri@amazon.com>

* Applied some code review feedback and added basic tests

Signed-off-by: igarri <igarri@amazon.com>

* fixed naming

Signed-off-by: igarri <igarri@amazon.com>

* Refactored Tests

Signed-off-by: igarri <igarri@amazon.com>

* removed pointer reset, now handled by the AssetBrowserComponent

Signed-off-by: igarri <igarri@amazon.com>

* Fixed conversion unsigned-signed

Signed-off-by: igarri <igarri@amazon.com>

* Cleaned includes

Signed-off-by: igarri <igarri@amazon.com>

* fixed test setup

Signed-off-by: igarri <igarri@amazon.com>

* Fixed unused variables

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Added printer function

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* cleaned up code

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Added Test to check the correctness of the setup

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Fixed basic tests

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>

* Fixed Tests

Signed-off-by: AMZN-Igarri <82394219+AMZN-Igarri@users.noreply.github.com>
4 years ago
Nicholas Van Sickle 3485bc08b1
Fix EntityOutlinerTest (#4771)
The test was relying on immediate updates from the prefab system which are now scheduled for a later tick - this reworks the tests to wait for deferred updates before validating state

Signed-off-by: nvsickle <nvsickle@amazon.com>
4 years ago
nvsickle f0e6841ca8 Fix issues with invalid Outliner entries
The EntityOutlinerListModel was violating the QAbstractItemModel contract in a few cases, as reported by `QAbstractItemModelTester`. The important ones causing issues were:
- Entry order was not guaranteed, leading to model indices pointing at invalid data
- Parent/child relationships could be temporarily invalid due to a change I made in EditorEntityModel::RemoveEntity to try to avoid an unnecessary reparent operation - as it turned out, the parent/child data was being cached even for recreated entities and not clearing child data could cause issues
- `EntityOutlinerListModel::ProcessEntityUpdates` was emitting data changed between two indices that didn't necessarily share a parent, which is [undefined behavior](https://doc.qt.io/qt-5/qabstractitemmodel.html#dataChanged)

The other reported issues (that weren't really causing issues with `QTreeView`) were:
- The root index had flags other than `Qt::ItemIsDropEnabled`
- `rowCount` showed all columns as having children
- `parent` showed indices as being parented to a non-0 column

This change introduces fixes for the above issues, namely:
- Reverts my change to `EditorEntityModel::RemoveEntity` to ensure we don't have invalid parent/child references sitting in the cache
- Ensures `EditorEntityModelEntry` child ordering is guaranteed sorted by EntityId, to prevent the `EntityOutlinerListModel` from having indices pointed at invalid data*.
- Fixes various model sanity issues, such as `rowCount` being 0 for indices with a non-0 column

Two unit tests were added to reproduce the invalid behavior and validate the fix: TestCreateFlatHierarchyUndoAndRedoWorks and TestCreateNestedHierarchyUndoAndRedoWorks
This change focuses on correctness over performance. My subjective in-Editor outliner experience is about the same, but it may be worthwhile to expand the test coverage with a benchmarking suite to look into areas for optimization.

*As a rough illustration of the previous child ordering behavior, consider the following entity hierarchy:
```
Root (EID 9999)
|_ Child1 (EID 2)
|_ Child2 (EID 3)
|_ Child3 (EID 4)
```
With an representations like the following pseudocode:
```
// EditorEntityModel representation
EditorEntityModelEntry root;
root.children[0] = 2;
root.children[1] = 3;
root.children[2] = 4;

// EditorOutlinerListModel representation
// row, column, user data (64 bit uint)
child1 = QModelIndex(0, 0, 2)
child2 = QModelIndex(1, 0, 3)
child3 = QModelIndex(2, 0, 4)
```

When removing a child, the `EditorEntityModel` used to do roughly the following:
```
// Swap and pop the last child
int indexToRemove = 0;
swap(root.children[indexToRemove], root.children[root.children.size() - 1]);
root.children.resize(root.children.size() - 1);
model.notifyRemoved(root, indexToRemove); // model removes the row indicated

// Leading to this EditorEntityModel state
root.children[0] = 4;
root.children[1] = 3;

// And this EntityOutlinerListModel state, note that the row indices are swapped from the indices in the backing storage
child2 = QModelIndex(0, 0, 3)
child3 = QModelIndex(1, 0, 4)
```

A QModelIndex having a row that doesn't match its underlying data is undefined behavior, and was the source of an intermittent crash in our `QSortFilterProxyModel` as subsequent updates to the wrong row led to an invalid proxy state.

Signed-off-by: nvsickle <nvsickle@amazon.com>
4 years ago
Steve Pham 38261d0800
Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
4 years ago
Esteban Papp 1dec9d4a9a Fix tests in AzToolsFramework now that the Trace bus is hooked
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
4 years ago
Steve Pham b4a2edec6a
Final update copyright headers to reference license files at the repo root (#1693)
* Final update copyright headers to reference license files at the repo root

Signed-off-by: spham <spham@amazon.com>

* Fix copyright validator unit tests to support the stale O3DE header scenario

Signed-off-by: spham <spham@amazon.com>
5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
greerdv 3817c05d81 fixing unit test 5 years ago
alexpete a10351f38d Initial commit 5 years ago