I am implementing an OpenGL based rendering engine and came up with a little inconvenience, that the blender UI gets frozen when rendering. As a side effect, this does not allow me to show actual progress of the rendering. So I wonder if this is a bug or an expected behavior as maybe OpenGL interfere with blender’s UI rendering somehow?
Just to demonstrate here’s a little script that you can run.
import bpy
import time
class CustomRenderEngine(bpy.types.RenderEngine):
bl_idname = 'CustomRenderEngine'
bl_label = 'Progress Bar Bug'
bl_use_gpu_context = True
def render(self, scene):
for i in range(100):
time.sleep(0.025)
self.update_progress(float(i) / 100.)
bpy.utils.register_class(CustomRenderEngine)
And if you set bl_use_gpu_context = False
you will see the render progress bar when invoking render with F12 for example. If you leave bl_use_gpu_context = True
the UI freezes during render.
A small update. In case bl_use_gpu_context = True
the UI freezes after any input from the user, e.g. rotating the camera