Skip to content
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

Export doesn't wait for rendering to finish #62

Closed
Bescu opened this issue Jul 9, 2014 · 10 comments
Labels
bug

Comments

@Bescu
Copy link
Contributor

@Bescu Bescu commented Jul 9, 2014

I have a problem with the export, a little like the issue #58 but it's not only the timestramp labels that are not exported : in my test-project, my 3 vectors layers aren't exported, and sometimes the rasters basemaps neither.
I've tested the same project on QGis 1.8 and it works.
It looks like a problem with the function "waitAfterRenderComplete" in timemanagercontrol.py.

@anitagraser

This comment has been minimized.

Copy link
Owner

@anitagraser anitagraser commented Jul 9, 2014

Can you share a test project with data to reproduce the problem? Have you tried deactivating render caching in rendering options?

Sometimes, I can see some weird behavior, i.e. skipping of waiting times, but I cannot see why it appears sometimes and the next run afterwards behaves fine ...

@Bescu

This comment has been minimized.

Copy link
Contributor Author

@Bescu Bescu commented Jul 10, 2014

Yes my test project is here : https://github.com/Bescu/TimeManagerProjectTest

I try to deactivate render caching but it doesn't work either.

The raster layers are from the same raster with differents options of brightness.

With QGis 1.8 the similar project works well : https://www.youtube.com/watch?v=_U5CLCy5JGc
(for the QGis 1.8 project, I had to work with 5 differents rasters because there were no brightness option for the rasters).

@anitagraser

This comment has been minimized.

Copy link
Owner

@anitagraser anitagraser commented Jul 20, 2014

Sorry it took a while for me to check the project. I cannot reproduce the problem with the vector layers. They behave properly here and are exported as expected. I can however reproduce the issue that sometimes the rasters are not rendered thus resulting in a white background.

@quimby5

This comment has been minimized.

Copy link

@quimby5 quimby5 commented Oct 22, 2014

I also found today where parts of a vector layer weren't being rendered in the export. It was as if the image was saved before the rendering was complete, as it was the "last" features to be rendered that weren't making it into all the PNGs.
I tried the render cache settings, plugin settings (intervals, etc), shapefiles and postgis views and tables as datasources, with or without indexes on the timestamp field, etc. Ultimately, I just reduced the number of points being rendered, and it worked fine. Postgis table had ~130,000 points. Reduced this to ~13,000 to make it work. This leads me to believe it is an issue with local resources.
Hope that helps, Cheers!

@anitagraser anitagraser changed the title Export don't wait the end of the render Export doesn't wait for rendering to finish Oct 27, 2014
@riggsd

This comment has been minimized.

Copy link

@riggsd riggsd commented Dec 5, 2014

I have a very complex project which adds more and more vector objects to the canvas with each tick of of the clock. Towards the end of my exported video frames, I'd find more and more of them -- eventually all of them -- missing certain symbology, incompletely rendered layers, and even Time Manager's own timestamp label.

I fixed the problem locally by modifying fimemanagercontrol.py so that the function waitAfterRenderComplete() no longer checks the saveAnimation flag, but now always enables the single-shot timer between frames. I think just select a sane length of time to ensure everything gets rendered in realtime between frames. Of course, this means you must choose a time large enough for your worst-case render time.

    def waitAfterRenderComplete(self, painter=None):
        """when the map canvas signals rendercomplete, wait defined millisec until next animation step"""
        # we no longer check self.saveAnimation and don't *directly) call playAnimation(painter)
        QTimer.singleShot(self.animationFrameLength, self.playAnimation)

I'm not able to provide my giant project to you, but it seems like there must be some signal fired before rendering is truly complete. Or perhaps the signal from rendering doesn't take into account a finite time required to actually paint the final rendered layers?

@anitagraser

This comment has been minimized.

Copy link
Owner

@anitagraser anitagraser commented Dec 6, 2014

Thanks, that basically reverts 2e88bb4

I would prefer a solution which makes the export run as fast as possible while still ensuring that everything is rendered ... but I haven't found the solution yet ...

@macrojames

This comment has been minimized.

Copy link

@macrojames macrojames commented Dec 9, 2014

I have changed

self.iface.mapCanvas().renderComplete.connect(self.waitAfterRenderComplete)

to

self.iface.mapCanvas().mapCanvasRefreshed.connect(self.waitAfterRenderComplete)

And that seems to work so far.

@anitagraser anitagraser added the bug label Dec 18, 2014
@vansman

This comment has been minimized.

Copy link

@vansman vansman commented Jan 14, 2015

I had the same issue in QGIS 2.6.1. A raster background, two timed vector layers, one with labels, and the frame start time on map. Missing labels, remnants from previous frames/frame skipping, and the frame start time would not always appear. macrojames' solution seemed to solve the problem for me

@carolinux

This comment has been minimized.

Copy link
Collaborator

@carolinux carolinux commented Jan 16, 2015

@vansman, @macrojames Since you have investigated this issue, why do you think mapCanvasRefreshed is better than renderComplete? renderComplete seems to betray its name from what you're saying. :)

anitagraser added a commit that referenced this issue Jan 17, 2015
@carolinux

This comment has been minimized.

Copy link
Collaborator

@carolinux carolinux commented Jan 27, 2015

This seems to work well.

@carolinux carolinux closed this Jan 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.