-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
New marker symbol type for "Animated Marker" #48060
Conversation
image files Allows selection of animated images from formats supported by QMovie, e.g. animated gif, webp and mng animations.
This new marker symbol type allows points to be rendered using an animated marker, sourced from an animated gif, webp or mng animation. Options are present for marker file, size, angle and frame rate. There are two ways in which animated symbols are handled: 1. If the map itself is considered an animation, then the frame rendered for the animated marker is based on the map animation frame and frame rate. This is the case when the temporal controller is set to the Animation mode. In this case the animated markers will follow the temporal controller animation, e.g. pausing when the animation is paused, advancing frames with the animation, etc. The map will also be redrawn using the frame rate set for the temporal animation. This mode also applies when exporting an animation from the temporal controller. It's also the mode used when a plugin specifically sets the frame rate and current frame QgsMapSettings properties, so e.g. @timlinux's QGIS Animation Workbench plugin will dictate the marker animation frame to render. 2. If the map is NOT considered an animation (i.e. it's just a plain old normal QGIS project), then the frame to render will be based on the current timestamp alone. Markers will be animated when their corresponding layer is set to a temporal mode, and a temporal animation is playing.
vector layer renderer, by hunting for any animated symbols in the renderer
…e the layer redrawing without requiring the user to setup these settings themselves.
@nyalldawson A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
Thanks so much for this awesome PR! |
Tested, it is sweeeeet. I love the flawless animation integration in non-temporal (i.e. plain old canvas) context. Nicely done. Haven't looked at the code yet, but my quick testing pointed out at a need to have a selected state rendering here (I think it should be easy to copy paste what we have for the raster marker et al) |
That's already implemented: |
(unrelated test failure) |
I'll give it a try m again. Maybe my large animation marker had me hit too far away from the small hit area for point features. |
@nyalldawson , my bad, it does work: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nyalldawson , brilliant stuff, I ❤️ this contribution to QGIS. And thanks @timlinux for being such a great muse 😉
Thanks for the review @nirvn!
I noticed that you've got the flashing "redraw" indicator happening here. If you want to avoid that you need to check the "deferredUpdate" flag when QgsMapLayer::repaintRequested is emitted, and if it's true then the redraw should happen "silently". |
@nyalldawson |
This new marker symbol type allows points to be rendered using an animated marker, sourced from an animated gif, webp or mng animation.
Options are present for marker file, size, angle and frame rate.
There are two ways in which animated symbols are handled:
frame and frame rate. This is the case when the temporal controller is set to the Animation mode. In this case the
animated markers will follow the temporal controller animation, e.g. pausing when the animation is paused, advancing frames
with the animation, etc. The map will also be redrawn using the frame rate set for the temporal animation.
This mode also applies when exporting an animation from the temporal controller.
It's also the mode used when a plugin specifically sets the frame rate and current frame QgsMapSettings properties, so
e.g. @timlinux's QGIS Animation Workbench plugin will dictate the marker animation frame to render.
Markers will be animated when their corresponding layer is set to a temporal mode, and a temporal animation is playing.
Showcase
Animated marker in a standard map, no temporal animation settings
Animated marker when used with temporal controller in animation mode