glBindFramebuffer raise GLError 1280
Describe the error
When i run manimgl xxx.py xxx everything is good
and when there's only code self.wait() and run manimgl xxx.py xxx -w it will be fine too,
but when my code add some mobject in the output screen
and run manimgl xxx.py xxx -w or manimgl xxx.py xxx -o, it raise GLError 1280
Code and Error
Code:
from manimlib import *
class S1(Scene):
def construct(self):
c = Circle()
self.wait()
self.add(c) # error
when i remove the error code and it will run perfectly(but i can't do nothing)
Error:
File "/Library/Frameworks/Python.framework/Versions/3.11/bin/manimgl", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/__main__.py", line 22, in main
scenes = manimlib.extract_scene.main(config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/extract_scene.py", line 140, in main
scenes = get_scenes_to_render(all_scene_classes, scene_config, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/extract_scene.py", line 103, in get_scenes_to_render
fw_config["total_frames"] = compute_total_frames(scene_class, scene_config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/extract_scene.py", line 87, in compute_total_frames
pre_scene.run()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/scene/scene.py", line 94, in run
self.tear_down()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/scene/scene.py", line 111, in tear_down
self.file_writer.finish()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/scene/scene_file_writer.py", line 195, in finish
self.save_final_image(self.scene.get_image())
^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/scene/scene.py", line 164, in get_image
return self.camera.get_image()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/camera/camera.py", line 277, in get_image
self.get_raw_fbo_data(),
^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/camera/camera.py", line 264, in get_raw_fbo_data
gl.glBindFramebuffer(gl.GL_READ_FRAMEBUFFER, self.fbo_msaa.glo)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/OpenGL/platform/baseplatform.py", line 415, in __call__
return self( *args, **named )
^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/OpenGL/error.py", line 230, in glCheckError
raise self._errorClass(
OpenGL.error.GLError: GLError(
err = 1280,
description = b'invalid enumerant',
baseOperation = glBindFramebuffer,
cArguments = (GL_READ_FRAMEBUFFER, 3)
)
Environment
OS System: MacOS Sonoma 14.1.1
Well, I found out what the problem is, just add a line gl.glGetError() to function get_raw_fbo_data in file /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/manimlib/camera/camera.py and it will be solved.
(File locations may change depending on the system environment)
It still doesn't work. I tried doing this and it works when i pass argument -w but normally it doesn't.
It still doesn't work. I tried doing this and it works when i pass argument
-wbut normally it doesn't.
Please show me as many error messages as possible when you try to rendering normally, that can help to determine where to modify the program.
Yeah, this is what I got :
Yeah, this is what I got :
In the error messages, you can find which file and which line raised this error from the bottom to the top, just add gl.glGetError() before this line. And if that won't work, try another error message until it will. XD
@INFO-studio Thanks a lot.
@INFO-studio seems that it works for me, could you help explain why this can fix the issue? Since it is just get the last error from OpenGL
@INFO-studio seems that it works for me, could you help explain why this can fix the issue? Since it is just get the last error from OpenGL
Well, I guess that's just because some non-fatal errors happened, which I didn't find why. OpenGL can just draw it and continue working, but when the code start to clear the cache and prepare to write the next frame, the error was still in the todo queue and OpenGL will stop the script and draw error. That's also why it can work in preview mode(because that needn't to clear the cache).

