You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Finally catching up with all this! Taking a look at the examples and wondering if this would be the right way to update the canvas in a for or while loop. It works but I'm not sure if this is the way it's intended to be used, without an event loop running.
I'm starting to think about how to implement this for fastplotlib, might help to have a mode where the canvas is updated only when an event occurs or when any buffer in the scene changes? Anyways that will be a separate issue which I'll think about later.
The text was updated successfully, but these errors were encountered:
However, it is meant to be used only in special scenarios because it bypasses the normal event loop and scheduling, which means that there will also be no updates, unless you also flush the events etc. and then you are basically creating your own scheduler ...
In use-cases where you are running a simulation like pygfx/pygfx#667, I think it would be better to use something like:
async def do_my_simulation():
for ....
do whatever you want to do
but from time to time call
asyncio.sleep(0) # allow the window to stay active
and then run that together with the rendercanvas.asyncio.loop.
Would be good to cover this in an example! 🤔
might help to have a mode where the canvas is updated only when an event occurs or when any buffer in the scene changes?
Finally catching up with all this! Taking a look at the examples and wondering if this would be the right way to update the canvas in a for or while loop. It works but I'm not sure if this is the way it's intended to be used, without an event loop running.
related: pygfx/pygfx#667
I'm starting to think about how to implement this for
fastplotlib
, might help to have a mode where the canvas is updated only when an event occurs or when any buffer in the scene changes? Anyways that will be a separate issue which I'll think about later.The text was updated successfully, but these errors were encountered: