Open Hannnes1 opened 2 months ago
At the moment only a single FilamentWidget is supported, so to load multiple models, you just load them into the same scene/view and translate them (or the camera) as necessary.
I could restructure things to accommodate multiple FilamentWidget (on the backend we would create a texture/view/camera for each new widget). What use case did you have in mind for multiple widgets?
The end goal I'm looking for is something like this, where the yellow squares will be 3D models.
https://github.com/nmfisher/flutter_filament/assets/47989573/96002a5f-6e19-4662-a54b-6a9aef45b9fe
The grid I can probably solve with only one FilamentWidget
, but the Hero animation to the second screen is trickier. Even two FilamentWidgets
on different screens causes the error, since the first screen is still in the navigation stack.
Although. Now that I think about it, I might be able to use one widget for everything, and do a hero animation entirely in the 3D viewer. Will require more math though.
That's possible, but would need quite a bit of work to implement on both the C++ and Dart sides. Everything so far has been written with the assumption of a single engine/scene/view/render target (texture)/render loop, so we'd need to go back in and refactor some things to allow creating new views/textures/etc. If you need something now, you're probably better off doing the animation in the viewer itself - I've done similar things (basically hard-coding animations in Blender then just triggering them in the app). That might be an easier short term solution.
Okay, I get it. I will see what I can do within the viewer itself instead.
Hi, I tried to display multiple models at once, by creating multiple
FilamentWidget
s, but it seems like that is not possible at the moment. All widgets except the first throws the following error:I also got the same error after hot restarting, if
.createViewer()
is called ininitState()
. Not entirely sure if the cause is the same though.createViewer()
has the doc comment "You do not need to call this yourself.", so I tried removing it. However that caused the exception "No viewer available". I guess that the documentation isn't entirely up to date in the development branch?Thanks for a great package!