-
Notifications
You must be signed in to change notification settings - Fork 52
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
_moderngl.Error: the program belongs to a different context #64
Comments
This is the code that I ran.
|
Yes, that is unfortunately a known problem, see #12 . The cause is that the viewer is not completely cleaned up after the first use, which appears to be related to the from aitviewer.configuration import CONFIG as C
C.update_conf({"window_type": "pyglet"}) Another possibility is to only instantiate the Finally, you can also solve the problem by starting the script as a new process each time you want to render something. For example, you could re-write your script to take import subprocess
npz_files = ["some/path/test1.npz", "some/path/test2.npz"]
for npz_file in npz_files:
command = "python render_something.py --npz_file npz_file --output_path npz_file.replace('.npz', '.mp4')"
subprocess.run(command, shell=True, check=True) |
you should claim "v = HeadlessRenderer()" only once in if name == "main":, it works for me |
Hi, I want to save all videos in the directory.
When I tried to save videos by using HeadlessRenderer(), " _moderngl.Error: the program belongs to a different context " happened.
The first video is saved perfectly, but this error happened on the second video.
What should I do?
Here is the detail of the error code.
The text was updated successfully, but these errors were encountered: