0

I have a visualisation package, written using pyopengl and pyqt.

When I use Anaconda to create a python environment with python 2.7.11-0 (in OSX Yosemite v10.10.5) everything works fine:

conda create -n dep_test python=2.7.11=0 six numpy scipy matplotlib pandas ipython ipython-notebook pillow pyopengl pyqt
conda list -n dep_test

python          2.7.11        0
numpy           1.11.1        py27_0  
pyopengl        3.1.1a1       np111py27_0  
qt              4.8.7         4  
pyqt            4.11.4        py27_4  
…

However, when I create an environment with the next available version of python 2.7.11-5, I get a frame buffer error:

conda create -n dep_test python=2.7.11=5 six numpy scipy matplotlib pandas ipython ipython-notebook pillow pyopengl pyqt
conda list -n dep_test

python          2.7.11        5
numpy           1.11.1        py27_0  
pyopengl        3.1.1a1       np111py27_0  
qt              4.8.7         4  
pyqt            4.11.4        py27_4  
…

---------------------------------------------------------------------------
GLError                                   Traceback (most recent call last)
<ipython-input-4-bc4aa6ba358d> in <module>()
      1 vis = ipymd.visualise_sim.Visualise_Sim()
      2 vis.add_atoms(df)
----> 3 img1 = vis.get_image(size=400,quality=5)
      4 img1

/Users/cjs14/GitHub/ipymd/ipymd/visualise/visualise_sim.pyc in get_image(self, xrot, yrot, zrot, fov, size, quality, zoom_extents, trim_whitespace)
    433 
    434         # convert scene to image
--> 435         image = w.toimage(int(size*quality), int(size*quality))
    436         image.thumbnail((int(size),int(size)),Image.ANTIALIAS)
    437 

/Users/cjs14/GitHub/ipymd/ipymd/visualise/opengl/qchemlabwidget.pyc in toimage(self, width, height)
    366             height = self.height()
    367 
--> 368         self.paintGL()
    369         self.post_processing.remove(effect)
    370         coltex = effect.texture

/Users/cjs14/GitHub/ipymd/ipymd/visualise/opengl/qchemlabwidget.pyc in paintGL(self)
    214 
    215             else:
--> 216                 self.post_processing[0].render(DEFAULT_FRAMEBUFFER, self.textures)
    217 
    218         # Draw the UI at the very last step

/Users/cjs14/GitHub/ipymd/ipymd/visualise/opengl/postprocessing/noeffect.pyc in render(self, fb, textures)
     41 
     42         glBindFramebuffer(GL_FRAMEBUFFER, fb)
---> 43         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
     44 
     45         glUseProgram(self.quad_program)

//anaconda/envs/dep_test/lib/python2.7/site-packages/OpenGL/error.pyc in glCheckError(self, result, baseOperation, cArguments, *args)
    230                         result,
    231                         cArguments = cArguments,
--> 232                         baseOperation = baseOperation,
    233                     )
    234                 return result

GLError: GLError(
    err = 1286,
    description = 'invalid framebuffer operation',
    baseOperation = glClear,
    cArguments = (16640,)
)

The same error also occurs if trying python 3 versions. All package versions are identical, so what has changed between 2.7.11-0 and 2.7.11-5 to cause this error, and how can I fix it?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Chris Sewell
  • 679
  • 1
  • 7
  • 19
  • It may be related to this question; http://stackoverflow.com/questions/11089561/opengl-invalid-framebuffer-operation-after-glcleargl-color-buffer-bit. Perhaps I can wrap the glClear in a 'try except' and ignore the error? – Chris Sewell Jul 17 '16 at 18:21
  • It sounds like your framebuffer is not complete. You will need to make sure that it is complete before using it. – Dietrich Epp Jul 18 '16 at 13:52
  • It could also be a timing problem, trying to use GL in paintGL before the window has been fully initialized. If you can, I'd suggest replacing self.paintGL() at line 368 with self.update(). If not possible, it's an awful hack but trying sleeping for 100 millsecs after creating the window – Hugh Fisher Jul 18 '16 at 23:16

0 Answers0