-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Global figure time #3299
Global figure time #3299
Conversation
I'd rather have something like this implemented as a (render) tick in Events. In GLMakie that could probably just react to timer = Observable(0)
on(_ -> timer[] = timer[] + time_per_frame, events(fig).tick) to do the same kind of thing as your example. (Or, if we have a frame counter as part of the tick just |
I can indeed sync that on the screen Since I have to add the callback when the screen is known, I add it at each display. It is not super pretty to have those dangling connections, but I don't know how I could avoid them. |
I outlined this somewhere else, not sure where, but I also wanted to have some sort of time accessible to the rendering logic. However, I would not want that to be |
The way I see how it could be done is to have a Something like the following struct Frame
n::Observable # Frame number because why not
dt::Observable # Time from the previous frame
t::Observable # Real time from fig beginning
end Then in record or the render loop, you can ignore However I don't know how it plays with what @ffreyer said, since AFAIK Makie doesn't have a proper "frame" concept right now. |
No, this is pretty much what I want too. After thinking about it some more I don't think there is a meaningful difference between "I tried to render a new frame and realized it wasn't necessary so I didn't" and "I rendered a new frame" for this. It's just time/work saving, and a bit misleading if someone uses it to judge performance. My thoughts on the implementation are that we should add a Lines 41 to 104 in 0329a70
This requires changes to the events interface here: https://github.com/MakieOrg/Makie.jl/blob/master/src/interaction/events.jl And for GLMakie here, where you can grab screen._rendertick :https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/events.jl Regarding naming I would prefer calling the struct something else because For CairoMakie this should probably only trigger when an image is produced. To be compatible with an interactive Cairo backend it should come from actual drawing, maybe here: Makie.jl/CairoMakie/src/infrastructure.jl Lines 10 to 57 in 0329a70
For WGLMakie we would want the same behavior as GLMakie, but I don't know if we have anything set up for that. Maybe the event pipeline is already synced to rendering and you'd just need to add a notification here: Makie.jl/WGLMakie/src/events.jl Lines 51 to 58 in 0329a70
|
If it was added to events we could sync on it inside recipes and blocks right? |
Yes, everything that has access to a scene would have access to to that event. |
Related issue: #3163 |
Closed via #3948 |
Description
Implement a global figure time that is incremented when the figure is displayed. This allow to have some animation shown when the GLMakie windows shows up for example and to have everything in sync across the figure.
For example with this PR
Gives (whenever the figure is displayed)
Documentation will be straightforward once we are set on the semantic, but I have no idea if it would be possible to have the feature tested.
Type of change
Delete options that do not apply:
Checklist