Open janhohenheim opened 1 year ago
Thanks! I totally forgot about that, thanks for reminding me! 👍
Hi there, I just tried to derive Reflect for the Rig when preparing for the 0.14 crate release. However, I hit the wall of the underlying Box<dyn RigDriverTraits>
not easily being able to be reflected, TypePath yes, but not for reflection, maybe there is a way to do manual reflection definition? I'm very much a noob on this topic, so input is appreciated.
Since you are forking dolly anyways, can't you make t he underlying types Reflect
?
That was what I tried. When adding Reflect to RigDriverTraits I hit compiler errors I wasn't sure how to fix.
What happens when you add : Reflect
as a trait bound? Or is that what you tried?
I get:
`Box<(dyn RigDriverTraits + 'static)>` does not have a type path
consider annotating `Box<(dyn RigDriverTraits + 'static)>` with `#[derive(Reflect)]` or `#[derive(TypePath)]`
Impl. TypePath is not enough work for inspection.
I'll create a branch so you can check
Hmm. Ping @MrGVSV, maybe you can help? I'm not deep enough into reflection to help much.
What if you tried changing it to Arc<dyn RigDriverTraits>
? We don't support reflecting Box
yet, but we do make an exception for Arc
.
Although, Arc
is treated as a "reflect value" meaning that it loses all knowledge about its internal types, including the structure of the underlying dyn RigDriverTraits
, so it may not work properly with the inspector.
I don't really know how the inspector works under the hood, but maybe there's a way to register the "actual" type for "reflect value" types like this?
This improves runtime debugging, since reflection is not available for these types right now: (Screenshot shows
bevy_editor_pls
)