mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 03:49:00 +08:00
Ensure that opengl context is available when creating a snapshot
CURA-8723
This commit is contained in:
parent
9f6dacfced
commit
064a845f71
@ -3,6 +3,7 @@
|
|||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
from PyQt5.QtCore import QCoreApplication
|
||||||
from PyQt5.QtGui import QImage
|
from PyQt5.QtGui import QImage
|
||||||
|
|
||||||
from cura.PreviewPass import PreviewPass
|
from cura.PreviewPass import PreviewPass
|
||||||
@ -46,6 +47,7 @@ class Snapshot:
|
|||||||
render_width, render_height = (width, height) if active_camera is None else active_camera.getWindowSize()
|
render_width, render_height = (width, height) if active_camera is None else active_camera.getWindowSize()
|
||||||
render_width = int(render_width)
|
render_width = int(render_width)
|
||||||
render_height = int(render_height)
|
render_height = int(render_height)
|
||||||
|
QCoreApplication.processEvents() # This ensures that the opengl context is correctly available
|
||||||
preview_pass = PreviewPass(render_width, render_height)
|
preview_pass = PreviewPass(render_width, render_height)
|
||||||
|
|
||||||
root = scene.getRoot()
|
root = scene.getRoot()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user