rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
742 stars 93 forks source link

Myra.Stride won't stay assigned in the Graphics Composter on recompile. #434

Closed ulrichanthony closed 11 months ago

ulrichanthony commented 1 year ago

I went through the documentation and followed the steps to get Myra working in my Stride project. Everything works fine when building the project. The problem is that when I change any code and Stride refreshes the assemblies it removes the MyraRenderer reference in the Graphics Composter.

Here you can see the Graphics Composter configured the same way as the tutorial. graphics

Myra.Stride is marked as a dependency using NuGet (version 1.5.1 of Myra.Stride) dependancies

As soon as I update some code and Stride reloads, the reference gets cleared: graphics_broken

(GraphicsCompositor.sdgfxcomp diff)

Children:
            d39c5ddbf8b7d5ca02bafb6496b1cc3c: !Stride.Rendering.Compositing.ForwardRenderer,Stride.Engine ref!! 4a5f037c-28e4-40cc-ab93-ccfc942b4cfb
            01d338078e9b21121ead0868932613dd: !Stride.Rendering.Compositing.DebugRenderer,Stride.Rendering ref!! 24284074-c3a5-47f9-86e4-50fda471dea4
            79d3aa9f5d78b4b1b33234992d6053a4*: !SpaceMiner.MyraRenderer,SpaceMiner
                Id: 3e70c134-9c0b-4be9-87a8-7821f2bb5abe
            c8955ef334acdd184308a009fbf21dda*: null

And after adding it back manually I looks like the GUID for the MyraRenderer has changed causing the reference to be lost in the first place.

Children:
            d39c5ddbf8b7d5ca02bafb6496b1cc3c: !Stride.Rendering.Compositing.ForwardRenderer,Stride.Engine ref!! 4a5f037c-28e4-40cc-ab93-ccfc942b4cfb
            01d338078e9b21121ead0868932613dd: !Stride.Rendering.Compositing.DebugRenderer,Stride.Rendering ref!! 24284074-c3a5-47f9-86e4-50fda471dea4
            79d3aa9f5d78b4b1b33234992d6053a4*: !SpaceMiner.MyraRenderer,SpaceMiner
                Id: 3e70c134-9c0b-4be9-87a8-7821f2bb5abe
            c8955ef334acdd184308a009fbf21dda*: !SpaceMiner.MyraRenderer,SpaceMiner
                Id: e87704fe-668c-4238-bc94-7fdc091af97c

What could be causing this?

rds1983 commented 11 months ago

Seems like a Stride Engine bug. There's a workaround though: MyraRenderer could be added to the GraphicsCompositor via Startup Script. I've updated the tutorial accordingly: https://github.com/rds1983/Myra/wiki/Using-Myra-in-Stride-Engine-Tutorial The new way is described starting from the step 8.

ulrichanthony commented 11 months ago

Thanks.