Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
139 stars 2 forks source link

Gizmos on object with a light creating many broken gizmos and exceptions about incompatible component stored in key #2823

Open XDelta opened 2 months ago

XDelta commented 2 months ago

Describe the bug?

Assisting a user with an odd occurrence posted about in discord https://discord.com/channels/1040316820650991766/1277922399916130377 where selecting an object with a Light component was creating many broken gizmos rapidly. Deselecting the object would delete some of the gizmos but several remnants remained of partial gizmos. Digging into it some showed an error being logged repeatedly System.Exception: An incompatible component is stored under the key LightGizmo_Icosphere

To Reproduce

Not super sure how to intentionally reproduce the world state, requested a copy of the world with this occurring from memtx, I'll add it on this post when received.

In an affected world: Create a new slot, in the video a box was used. Attach a light Unselect the slot Reselect the slot Observe multiple additional Gizmos being created

Reproduction world: resrec:///U-1To7mTuhbpA/R-f45f1465-f828-4429-82d9-c4419ec46fae

Expected behavior

Gizmos to be created normally and possibly corrupted keys to be repaired/replaced

Screenshots

https://github.com/user-attachments/assets/c175dedb-8a87-42b3-858d-c4654ae01ad5

Resonite Version Number

Beta 2024.8.5.1341

What Platforms does this occur on?

Windows

Log Files

System.Exception: An incompatible component is stored under the key LightGizmo_Icosphere
Existing: Element: ID6B300, Type: FrooxEngine.SpriteProvider, World: Default Home, IsRemoved: False, IsDestroyed: False, IsDisposed: False, Enabled: True
Element: ID2300, Type: FrooxEngine.Slot, World: Default Home, IsRemoved: False, Slot name: Root, T: [0; 0; 0], R: [0; 0; 0; 1], S: [1; 1; 1], ActiveSelf: True, IsDestroyed: False
Element: ID0, Type: FrooxEngine.World, World: Default Home, IsRemoved: False

  at FrooxEngine.SharedComponents.GetSharedComponentOrCreate[T] (FrooxEngine.World world, System.String sharedKey, System.Action`1[T] onCreate, System.Int32 version, System.Boolean replaceExisting, System.Boolean updateExisting, System.Func`1[TResult] getRoot) [0x00067] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.LightGizmo.GetIcosphereMesh (FrooxEngine.World world) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.LightGizmo.SetupPointIcon (FrooxEngine.Slot slot) [0x00006] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.LightGizmo.OnAttach () [0x0004e] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.ComponentBase`1[C].RunOnAttach () [0x0001a] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 

  at System.Environment.get_StackTrace () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Elements.Core.UniLog.Error (System.String message, System.Boolean stackTrace) [0x00000] in <0fc81716929342ceae57a0bf0dd62654>:0 
  at FrooxEngine.DebugManager.Error (System.Object obj, System.Boolean stackTrace) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.ComponentBase`1[C].RunOnAttach () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.ContainerWorker`1[C].AttachComponentInternal (C component, System.Boolean runOnAttachBehavior, System.Action`1[T] beforeAttach) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.ContainerWorker`1[C].AttachComponent (System.Type type, System.Boolean runOnAttachBehavior, System.Action`1[T] beforeAttach) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.GizmoHelper.GetGizmo (FrooxEngine.Worker worker, System.Type gizmoType, System.Boolean isExplicit) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.GizmoHelper.GetGizmo (FrooxEngine.Worker worker, System.Boolean isExplicit) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.GizmoHelper.GetGizmo (FrooxEngine.Worker worker, System.Type gizmoType, System.Boolean isExplicit) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.GizmoHelper.GetGizmo[T] (FrooxEngine.Worker worker, System.Boolean isExplicit) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.DevTool.OnSecondaryPress () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.ToolMultiplexer.OnSecondaryPress () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.InteractionHandler.StartSecondaryInteraction () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.InputGroup.Update (System.Single deltaTime) [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.InputBindingManager.Update () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.World.Refresh () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.WorldManager.UpdateStep () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.WorldManager.RunUpdateLoop () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.Engine.UpdateStep () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at FrooxEngine.Engine.RunUpdateLoop () [0x00000] in <fd56a75ff6ac403bbb6aeeaa7ec82c26>:0 
  at UnityFrooxEngineRunner.FrooxEngineRunner.UpdateFrooxEngine () [0x00000] in <7c2e4430a1b44da9a9660b0b5f5b1914>:0 
  at UnityFrooxEngineRunner.FrooxEngineRunner.Update () [0x00000] in <7c2e4430a1b44da9a9660b0b5f5b1914>:0 

Additional Context

Similar 'world corruption' state as https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1329 and similar exception to https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1073

Reporters

_deltawolf, memtx

shiftyscales commented 2 months ago

By chance are you aware if "Edit Mode" and specifically "Developer Mode" in the DevTool were ever enabled in the affected world, @XDelta?

That is the only possible reproduction step I can think of off of the top of my head that could lead to the generation of so many gizmos.

Having reproduction steps would help tremendously here to better understand this issue.

shiftyscales commented 2 months ago

Double-checked, and if DevMode has been enabled, there will be a DevMode slot in the root with a DevModeController on it- so that would be a good tell for that, if it's related.

shiftyscales commented 2 months ago

For a quick sanity check- could you also check the root of the world after inspecting any slot- rather than going through the rigamarole of attaching a light component, etc?

I've noticed if I manually delete all of the Gizmos in a world while DevMode is still enabled (DevModeEnabled is true on the DevModeController) even just selecting a slot / creating gizmos will cause all of the other gizmos to be restored as-expected.

XDelta commented 2 months ago

DevMode was not active at the time. Selection of the object creating many gizmos was only occurring on objects that had the Light component on it and were trying to make the a Light gizmo for some reason, in the video and when poking around each gizmo created would make 3 gizmos, the normal one, a MeshRenderer one and a LightGizmo one, all separated. Selecting any other object in the world made a normal gizmo as expected.

XDelta commented 2 months ago

0a59d2ae9e When selecting the box, these 3 gizmo slots are made. Noticed that selecting in the world won't trigger the gizmos to be repeatedly created, just the 3. Selecting the slot from an inspector creates a bunch of them. Normal gizmo MeshRendererGizmo LightGizmo (Starts disabled and can't be re-enabled.)