Commit Graph

393 Commits

Author SHA1 Message Date
Mike Balfour 86136ddfa6 Added ability to convert multiply-nested slices (#1239)
* Addressed feedback from previous PR
* Change missing entity aliases to be deterministic.
When converting slices, this helps produce the same results on multiple reconversions of the same data.
* Exposed the asset filter callback.
This allows the slice converter to specifically load nested slices as opposed to not loading *any* referenced assets.
* Added support for multiply-nested slice instance conversion.
2021-06-10 11:53:37 -05:00
srikappa-amzn 20dc47e6d0 Merge pull request #1198 from aws-lumberyard-dev/Prefab/RemoveFileSizeLimits
Remove file size limits when loading prefabs and prefab-based-levels
2021-06-09 10:05:45 -07:00
rhongAMZ 3fd2f1305f Selecting and deleting the level prefab root entity crashes editor (#1179)
Early remove the level instance from the entity id list in the delete function and duplicate function.
2021-06-09 09:15:09 -07:00
srikappa b23c95cab3 Removed the new added flavor of ReadFile and reused existing one 2021-06-08 17:58:59 -07:00
srikappa 9dec723e33 Remove file size limits when loading prefabs and prefab-based-levels 2021-06-08 17:28:23 -07:00
Danilo Aimini 80f62d0523 LYN-3708 | Optimize Prefab instance propagation to stabilize UX (#700)
* Add instanceToIgnore to calls leading to instances being added to the queue for propagation.

* Change PrefabUndoEntityUpdate to make it so that the instance triggering the prefab template change is not reloaded on propagation, since it will already be up to date due to the way we generated the patch to begin with.

* Add FindPrefabDomValue utility function for paths

* Expose the level root prefab template id in the Prefab EOS Interface

* Fix Instance Alias Path generation to work with the new FindValueInPrefabDom function

* Stop reloading ancestors on propagation, and fix instance reloading so that the level dom is used (and overrides are preserved)

* Remove commented out code, refactor FindPrefabDomValue for paths (was handling an edge case incorrectly, and it's not even triggered)

* Fix issue with PathView reference - with PathView already being a reference, this resulted in a copy and triggered a warning during automated review builds.

* Additional fix to the build warning, remove redundant error message

* Revert changes to Instance::GetAbsoluteInstanceAliasPath(), as they were impacting serialization.

* Remove the dependency to the level root prefab template in the propagation code, climb up the hierarchy instead. This allows tests to work despite not using the EOS properly.
Also use PrefabDomPaths to retrieve the instance dom from the root dom instead of iterating.

* Remove now unused PrefabDomUtils function, extend optimization to link updates.

* Trigger a full instance propagation to correctly refresh alias references.
This is an issue in the test because some operations are called from the backend API and will not trigger propagation properly. Tests will soon be rewritten to more properly represent frontend workflows.

* Fixes lingering issues with propagation:
- Restores code that fixes the selection if entityIds have changed;
- Fixes Do() function on link update. Prefab containers will propagate correctly while still being stable during editing.

* Remove GetRootPrefabInstanceTemplateId (no longer necessary after the code has been rewritten)

* Fix optimization code to account for instances being removed and propagation being run out of order in Create Prefab undo.

* Renamed variable, added comments for clarity.

* Restore asserts on instance not being found; Rename Do to Redo for clarity; Add comments.

* Fixed incomplete comment.
2021-06-08 10:44:20 -07:00
Danilo Aimini 2d1e47793d Move Duplicate menu items and shortcuts out of the Prefab Wip flag
Make duplicate prefab workflows available by default in Prefab mode.
2021-06-08 10:06:25 -07:00
Terry Michaels 0fcd6e84ec Added mechanism for viewpanes to request buttons on the main toolbar (#1189) 2021-06-08 12:02:02 -05:00
Esteban Papp 36cb0f6d40 SPEC-7178 Removal of precompiled cpp files (#1171)
* SPEC-7178  Removal of precompiled cpp files

* Missing files...
2021-06-07 15:59:58 -07:00
Nicholas Van Sickle 9e3d472700 Switch EditorContextMenu back to using popup instead of exec (#1158)
Switch EditorContextMenu back to using popup instead of exec

The switch to exec was a deliberate change, but upon further testing with the latest version of our camera input controllers (both the Legacy and Modern variants) it is no longer necessary to call exec, and doing so can cause a bug in which the cursor is still hidden when the context menu appears.
2021-06-07 09:21:10 -07:00
Tom Hulton-Harrop cf8a6761bf Formatting-only change - Update Manipulator and Viewport AzToolsFramework files (#1143)
* formatting changes to AzToolsFramework viewport related types + API comment style updates

* minor format change - include ordering

* improve formatting by moving comment

* fix compile error and switch to use AZ_Printf

* small polish changes after review feedback
2021-06-07 14:50:49 +01:00
Hasareej 5b940e8ed6 Viewport Ui Cluster Locked State Overlay (#1139)
* Viewport Ui Cluster Locked State Overlay

* PR feedback changes.
2021-06-07 13:32:13 +01:00
rgba16f 74f474aae2 Add unit tests for the ViewportScreen ndc <-> worldspace utility functions (#1149)
Add ScreenNdcToWorld function to enable round trip testing.
2021-06-04 18:02:09 -05:00
Tom Hulton-Harrop 05e20803a8 First pass for getting things ready for grid snap button (#1118)
* first pass of change to simplify snapping for snap-to-grid button and fix snapping bug caused by non-uniform scale
2021-06-04 14:32:06 +01:00
cgalvan deb3c5e74a [LYN-2446] Implemented support for duplicating instances. (#1097)
* [LYN-2446] Implemented support for duplicating instances.

* [LYN-2446] Addressed PR feedback.

* [LYN-2446] Addressed additional PR feedback.
2021-06-03 16:20:59 -07:00
Danilo Aimini fda28bb7b2 LYN-1818 | [USE CASE] Reparenting between different prefab instances by drag/drop in the Outliner (#1088)
* Add the last known parent to the prefab undo cache to detect changes in the owning instance.
Still WIP.

* Progress in handling reparenting. Still WIP, need a change in CreateLink that will be addressed in a separate branch and then merged back.

* A few fixes, reparenting now works with entities. Still working on instances.

* Fix assert crashing the Editor because of the arguments being in the wrong order.

* Handle moving the patches when removing and recreating links when reparenting nested instances.

* Rearrange some code to prevent including instance removal in instance update undo node, as it would be redundant and cause errors in some edge cases.

* Reorder instance reparenting to account for correct order of operation during undo/redo

* Fix order of operations to support multiple operations in one edit (reparenting to non-container entities while changing instance)

* Add function to refresh patches on links to allow aliases to be restored correctly on reparenting.

* Removed RefreshEntityPatchOnLink function. Introduced a simpler way of handling porting patches.

* Removing unnecessary code that was left after testing.

* Minor fixes to naming and comments.

* Restore previous error, no longer printing the failed patch.

* Remove unused includes.

* Restore include removed by mistake.

* Simplified patches retrieval by using internal function. Renamed some internal functions and variables to be more accurate.
2021-06-03 14:02:40 -07:00
Mike Balfour d90a3d46a7 Support for nested slice conversions (#1121)
This set of changes enables conversions for singly-nested slices. Multiple nesting hierarchies are only partially supported at this point. Conversion is also significantly more deterministic, which makes it easier to convert single slices without needing to reconvert every slice or level that relies on it as well.
Changes:

- Added version of Instance::AddInstance() that takes in an alias to allow for deterministic aliases
- Added a "SliceConverterEditorEntityContextComponent" that's used to specifically disable entity activation on creation. The disabling is done this way vs adding a new public API, because the disable shouldn't be required in any normal case outside of this tool.
- Disabled more AWS gems for the SliceConverter, as they're unneeded and cause issues if they're around in the tool.
- Added a small null check to the Camera Controller.
- Added the actual support for slice instance conversion. This instantiates the entities, applies the data patches, turns them into a prefab instance, and generates a JSON patch out of the changes.
2021-06-03 15:59:45 -05:00
rgba16f 54fdca353b Fix editor axis gizmo text rendering above gizmo
Add AzToolsFramework utility function to query the display scale for a viewport.
Use new function to fix the text location on the axis gizmo.
2021-06-03 12:54:14 -05:00
srikappa 574563adaf Merge branch 'main' into DetachPrefab 2021-06-02 15:09:40 -07:00
Danilo Aimini 8a7f156e2c LYN-4133 | Prefab Container Transform stores non-default values to template on Create Prefab (#1038)
* Show container transforms, reset container transform to zero before saving a prefab after create.

* Fix order of operations to prevent patching issues

* Reset the entity to the Identity Transform instead of the default constructor to correctly set the scale to 1.0
2021-06-02 14:45:43 -07:00
Hasareej 274e1972f3 Adding a shortcut to hide clusters. (#1071)
Adding the shortcut "U" to hide the TransformModeSelection & SpaceSelection clusters from the viewport.
2021-06-02 15:54:30 +01:00
srikappa 9fd690f004 Changed a function parameter name 2021-06-01 17:03:50 -07:00
srikappa a9d030b454 Merge branch 'main' into DetachPrefab 2021-06-01 11:12:52 -07:00
srikappa e8e9096dda Changed a function name and removed a comment 2021-06-01 11:11:13 -07:00
AMZN-koppersr c0dade8883 Merge branch 'main' into SpawnablePriorityQueue 2021-06-01 09:57:27 -07:00
Mike Balfour 895bbafa9e Fixed CreatePrefab to use correct absolute path (#1044)
The initial CreatePrefab flow was trying to go from absolute -> relative -> absolute path before the file had ever been saved, so the relative -> absolute path conversion generated an error and always produced a project-relative path, even if the initial path was in a gem.  For example, trying to save "c:/o3de/Gems/Camera/Assets/Entity1.prefab" would instead create "c:/o3de/AutomatedTesting/Entity1.prefab".  This change preserves the absolute path throughout the initial creation flow so that the file is saved in the correct location.
2021-06-01 10:50:10 -05:00
michabr aedc270304 Fix path not showing up in asset property control (#1037) 2021-05-28 13:40:08 -07:00
greerdv 2c36d6a19a Merge pull request #1039 from aws-lumberyard-dev/transform-float-scale-3
refactor vector scale in Transform to float scale
2021-05-28 21:20:03 +01:00
sconel 57b961c113 Merge pull request #997 from aws-lumberyard-dev/Spawnable/ScriptCanvas/Integration
Add dynamic spawn node to Script Canvas
2021-05-28 13:09:25 -07:00
Terry Michaels e79c65d454 Clear dirty flag after doing an initial save or save as in Asset Editor (#1033) 2021-05-28 14:28:36 -05:00
chiyteng da0ab84f1c Add helper function to update entity aliases in link patch 2021-05-28 11:42:36 -07:00
chiyteng de4cfdb5d7 Add helper function to update entity aliases in link patch 2021-05-28 11:33:58 -07:00
greerdv 34abf7376e Merge branch 'main' into transform-float-scale-3 2021-05-28 19:14:45 +01:00
chiyteng 984db9c1b4 Remove selection command and update undo batch in DetachPrefab function 2021-05-28 10:56:03 -07:00
sconel 0a32951e7e Merge branch 'main' of https://github.com/aws-lumberyard/o3de into Spawnable/ScriptCanvas/Integration 2021-05-28 10:48:44 -07:00
Terry Michaels e73541c751 Allow selected click to edit entity names in the outliner (#1028) 2021-05-28 12:23:49 -05:00
greerdv 7f8bd83d4a remove SetScale and CreateScale vector scale functions from Transform 2021-05-28 17:54:30 +01:00
greerdv faa2d4ea6a fix initialization of uniform scale in editor transform component 2021-05-28 16:36:48 +01:00
greerdv 8d0051bae9 update editor transform component to uniform scale 2021-05-28 16:25:58 +01:00
greerdv 4442ca5485 remove registration of custom transform scale UI handler 2021-05-28 16:16:21 +01:00
greerdv 1a0152c063 remove custom transform scale UI handler 2021-05-28 16:06:05 +01:00
greerdv fc0a720468 add version converter for editor transform to handle migration to uniform scale 2021-05-28 16:01:03 +01:00
Mike Balfour 96905a26d7 Add support for AP-compliant relative paths (#998)
The method "PrefabLoader::GetRelativePathToProject" has been changed to "PrefabLoader::GenerateRelativePath", and reworked to get a correct relative path.  GetFullPath has also been modified to get correct relative paths too.  This requires an Asset Processor connection - if one isn't available (like during unit tests), the methods have fallback logic to produce project-relative paths.

With this change, SliceConverter can't use SaveTemplate() to save the file any more, because GetFullPath now expects to find an existing path, which doesn't work for not-yet-created files.  Instead, it now has to use the same technique as the Editor and call SaveTemplateToString then save the string out as a file.
2021-05-28 09:57:17 -05:00
greerdv d73566565e remove most vector scale functions from transform bus 2021-05-28 14:18:26 +01:00
greerdv e1b9c4f22e remove some vector scale functions from Transform 2021-05-28 13:44:12 +01:00
srikappa 55e1da64bb Renamed a function and improved comments 2021-05-28 02:29:09 -07:00
srikappa be6cee806d Show detach prefab only when a single instance is selected 2021-05-28 02:14:28 -07:00
srikappa dc4a15628f Remove unused GetNestedInstance method in Prefab Instance class 2021-05-28 00:43:31 -07:00
srikappa 57913d8378 A couple of bug fixes 2021-05-27 18:19:28 -07:00
chiyteng c21a59af50 Remove print dom for debug previously 2021-05-27 17:19:32 -07:00