Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No cross-prefab reparenting in editor transform component #15889

Conversation

forkercat
Copy link
Contributor

What does this PR do?

Fixes #15260 issue (previous fix did not fix all cases)

This PR blocks users from parenting an entity or a nested prefab to an entity owned by a different prefab in TransformComponent's parent field.

Previously, there was a PR #14411 blocking this, but it was only for drag-and-drop in Entity Outliner.

Change List:

  • Add new check in editor's transform component
  • Improve the existing check in EntityOutlinerListModel (remove InstanceEntityMapperInterface dependency)

How was this PR tested?

  • TransformComponent: Tested in editor (as shown in video)
  • TransformComponent: Tested reparenting for multi-selected entities. It works for selected entities that might belong to different prefabs. Blocking still take effect.
  • EntityOutlinerListModel: Passed reparenting unit tests
ReparentInTransform.mp4

Signed-off-by: Junhao Wang <wjunhao@amazon.com>
Signed-off-by: Junhao Wang <wjunhao@amazon.com>
@forkercat forkercat added the feature/prefabs This item is related to the prefab system label May 5, 2023
@forkercat forkercat requested review from a team as code owners May 5, 2023 20:28
Signed-off-by: Junhao Wang <wjunhao@amazon.com>
@forkercat forkercat merged commit 4e1116d into o3de:development May 10, 2023
3 checks passed
@forkercat forkercat deleted the wjunhao/prefab/fix-reparent-in-transform branch May 10, 2023 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/prefabs This item is related to the prefab system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prefabs and entities can be reparented to other prefabs using Transform component
3 participants