Trouble exporting media using playertool's record option

I’m focusing on enhancing the player tool now to better support MD trajectories, and I’m facing some trouble in media exporting using the player tool; I could not get the existing record movie tool to work properly. The rendered png images are kind of corrupt:
zzz08
These were similar looking to the ones reported in this thread. The solution suggested in the thread requires a class from the QOpenGL module (which as far as I have seen, is not included in avogadro by default?). I couldn’t understand the exact problem, and since I dont have much exposure to OpenGL, I am not able to think of how to fix it. Am I missing out on something, or is there a more reliable way of implementing this?

I guess the first question is whether the File ⇒ Export ⇒ Graphics… command works or not? (The code is a little different, so I’m not sure whether there’s an underlying problem or something specific to the playertool.)

What version of Qt are you using?

Avogadro2 does use the QOpenGL classes. See, for example the header to playertool.cpp:

#include <QtGui/QOpenGLFramebufferObject>

My guess is the clue in that thread about multi-sampling. Try going into avogadroapp/avogadro/avogadro.cpp and comment out:

defaultFormat.setSamples(4);

My guess is that the multi-sampling is a problem.

The export graphics option also is having the same problem as above.
Removing the setSamples line seems to have fixed the problem: The export graphics option as well as the playertool’s record movie option seem to be doing the stuff correctly now.

Great, please submit a pull request to avogadroapp and I’ll merge it.

(I’d love to see multi-sampling back, but this is a good workaround.)

Just back from vacation… It sounds like you got to the bottom of it, but for some historic context. I wrote the code for QGL* based classes, then I converted everything to use the new QOpenGL* based classes but don’t remember how much testing I did on export at the time. Focused on getting it to compile, and verifying base functionality. I haven’t gone through my backlog of GitHub emails, but will happily review at some point soon, all of our code is using QOpenGL based classes now - we no longer link to the QGL module. It is possible I missed things when porting, such as this.