-
Notifications
You must be signed in to change notification settings - Fork 4
Updating in a for or while loop #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, the way to go is to use Lines 44 to 52 in 45843ed
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:
and then run that together with the Would be good to cover this in an example! 🤔
No, that's what the "ondemand" mode is for. |
Hi Almar, Kushal and I are revisiting this to see how we can expose the "ondemand" render mode features in fastplotlib. Our two primary use cases to start would be:
I just wanted to get some clarification on some of the things you mentioned above. It seems like you are saying we should avoid calling Do you have an example of this somewhere? |
In this case, I imagine you either have an offscreen canvas, so you just use
I will create one or two examples for this. |
See #89 |
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: