JamesTKhan/Mundus

Light component gizmo GO icon from previous projects persist when switching projects.

Closed this issue · 4 comments

Describe the bug

When adding a light component to empty component in one project: if you switch to another project it still renders the light gizmo.

Restarting Mundus fixes the problem.

See screen shots below on multiple projects showing a light at x= 100, y=10,z=100 that was created on a previous project. All I did is open a recent project. Can someone else reproduce @Dgzt @JamesTKhan?

image

image

image

Yeah I can replicate it. Looks like an additional bug is that the gizmo does not come back when switching between scenes in the same project. Scene A has gizmo, Switch to Scene B, all good, switch to Scene A, gizmo not visible.

Probably has to do with the order of the events being called in the Gizmo manager hopefully an easy fix.

On loading of a scene we fire off event ComponentAddedEvent which adds the gizmo to gizmo manager, but, after that event is called, a scene graph changed event is called, which the manager then clears all gizmos. Will have to refactor some things around the gizmo add/removal logic.

This is a tolerable bug. Most people starting out with Mundus just use 1 project and 1 scene, and no additional lights (other than ambient and directional light). Maybe it can be pushed after 0.5.0 release if its a big refactor. Your call.

It is a small fix, can get a PR in for it shortly while the solution is still in my head