LuxCoreRender / LuxCore

LuxCore source repository
Apache License 2.0
1.15k stars 146 forks source link

LuxCore has a image write error after a certain render time #46

Closed neo2068 closed 6 years ago

neo2068 commented 6 years ago

When I start a final render in Blender, LuxCore can't write the output image after a certain render time (approx. 10 minutes).

Blender LuxCore Log:

[...]
[LuxCore][25.531] [LinearToneMap] Kernels compilation time: 47ms
[LuxCore][623.922] Outputting film: RGB_IMAGEPIPELINE.png type: 2
Traceback (most recent call last):
  File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\engine\__init__.py", line 115, in render
    stats = utils_render.refresh(self, scene, config, draw_film, time_until_film_refresh)
  File "F:\Users\Michael\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore\utils\render.py", line 25, in refresh
    engine._session.UpdateStats()
RuntimeError: Error while writing an output type in Film::Output(): e0594766-e2cf-4246-b4ba-84bb197a903c.png
ERROR: Error while writing an output type in Film::Output(): e0594766-e2cf-4246-b4ba-84bb197a903c.png
[LuxCore][624.343] [GeForce GTX 1080 Intersect] Memory used for OpenCL image pipeline: 81076Kbytes
LuxCoreRenderEngine del
Error: Error while writing an output type in Film::Output(): e0594766-e2cf-4246-b4ba-84bb197a903c.png

Test scene: full_export.zip

Dade916 commented 6 years ago

I have introduced recently periodic save support: https://wiki.luxcorerender.org/LuxCore_SDL_Reference_Manual_v2.0#Periodic_save

After 10 minutes, LuxCore is just trying to save the e0594766-e2cf-4246-b4ba-84bb197a903c.png in the current directory (it will than renamed to RGB_IMAGEPIPELINE.png). It works fine here but I guess, in your case, the current directory is just write protected (?)

I have disabled default period save now to avoid problems like this one. I have also added some diagnostic message in case of OpenImageIO error.

Theverat commented 6 years ago

I think it would be good if LuxCore would not throw a runtime error in this case (I guess it ends the rendering?). Just print an error message and continue rendering.

We can check in the exporter if the output directory exists before the render is started, but we can not prevent the user from deleting/renaming/... it in the meantime.

Dade916 commented 6 years ago

If the rendering ends, it depends on the calling code. To avoid to end the rendering, you have just to place session.UpdateStats() between a try/except. Exceptions are not a crash, they are an handy way to report errors. It is up to the application to decide what to do in case of the error.

Theverat commented 6 years ago

Ok, thanks for the explanation.