Replies: 4 comments 1 reply
-
As a secondary test, I tried the same thing with a different plugin and that seemed to work, so this may be some issue with bevy_egui / EguiPlugin and not with Bevy itself. But looking at the EguiPlugin build function in bevy_egui so far nothing jumps out as to why this would be an issue. |
Beta Was this translation helpful? Give feedback.
-
I have posted this in the issues page at bevy_egui |
Beta Was this translation helpful? Give feedback.
-
could one of your dependencies be adding a EguiPlugin? |
Beta Was this translation helpful? Give feedback.
-
It looks to me that Looking at bevy_app...
which calls but |
Beta Was this translation helpful? Give feedback.
-
I have a plugin that is using EguiPlugin in my app, and I also have some dependencies that use it (bevy_editor_pls).
It's wrapped in a guard (with some added debug logging not shown in the code but you can see the output in the logs below) so that it should not be added more than once
However this guard doesn't seem to be working. When I pull in my dependency
bevy_editor_pls
that I know also includes the plugin with the same kind of guardhttps://github.com/jakobhellermann/bevy_editor_pls/blob/main/crates/bevy_editor_pls_core/src/lib.rs#L65
and I run my app, I get a panic with a message indicating it has tried to duplicate the loading of
EguiPlugin
I have looked at the bevy code for how the plugin is loaded and detected and it retrieves a boxed ref for the plugin and checks a downcast_ref of the trait obj inside the box and in this case that is somehow returning false (I logged it above).
I do see that the add_plugin doesn't add the plugin right away. It adds a placeholder then has the plugin build itself, and then adds it back if that succeeds. I have no idea if that is relevant. But it seems clear that the plugin_name_added HashSet has the plugin name in it, but the plugin_registry doesn't think it has the plugin yet.
That's as far as I've gotten, I hope someone has an idea what is going on?
Beta Was this translation helpful? Give feedback.
All reactions