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

Editor entity visibility is broken #18469

Open
aefimov3 opened this issue Nov 13, 2024 · 1 comment
Open

Editor entity visibility is broken #18469

aefimov3 opened this issue Nov 13, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/content Categorizes an issue or PR as relevant to SIG Content.

Comments

@aefimov3
Copy link
Contributor

aefimov3 commented Nov 13, 2024

Describe the bug
After turning off an entity visibility in the editor the entity appears in white.

Assets required
A level with a textured multi-entity prefab with LODs. The default level is fine. Add multiple textured complex prefabs with entity hierarchy to have the scroll bar in the entity outliner.

Steps to reproduce

  1. Load a level in the editor
  2. Select an entity with parent entities and material component in the entity outliner
  3. Turn visibility off by clicking the eye icon in the entity outliner

Expected behavior
The entity disappears.
The entity outline scroll position is intact.

Actual behavior
The entity disappears for a brief moment of time, then reappears with white materials.
The entity outliner scroll position is changed.

Screenshots/Video
image

Additional context
It looks like there is a design flaw in the undo system. The problem can be fixed by commenting out this line
AzToolsFramework::ScopedUndoBatch undo("Toggle Entity Visibility");
The undo system recreates dirty entities (affected in the scope of the undo object) and all their components. The material component resets the materials,, which is probably OK, that’s why we have it in white. On the new components activation the entity is set as visible because the mesh component knows nothing about the editor visibility component that keeps the editor visibility flag. I tried adding Activate() to the editor visibility component to apply the editor visibility flag, but that cannot fix the problem because the editor visibility component activates before the others, it cannot change the visibility because there are no bus subscribers yet.

In general the entity reset seems not the best idea to me. In addition to the visibility issue it produces annoying entity outline scroll position change.

@aefimov3 aefimov3 added kind/bug Categorizes issue or PR as related to a bug. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 13, 2024
@aefimov3
Copy link
Contributor Author

I cannot reproduce the issue with the shader ball default object. I believe it needs LODs to repro.

@michalpelka michalpelka added sig/content Categorizes an issue or PR as relevant to SIG Content. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/content Categorizes an issue or PR as relevant to SIG Content.
Projects
None yet
Development

No branches or pull requests

2 participants