BlendLuxCore: Save image while render is paused
Posted: Mon Apr 06, 2020 6:21 pm
BYOB please can you help me ? I want to know if blender api allow to save a render while being in pause ?
Show your work, get help, participate in development
https://forums.luxcorerender.org/
You mean image will be saved as Exr. So we can just reload them automatically and save to jpg so they get the ajustment applied.B.Y.O.B. wrote: Mon Apr 06, 2020 6:32 pm Blender API probably not, but LuxCore allows it.
However, it will lack Blender's color management (filmic etc.) and compositing.
After this line, you can insertSharlybg wrote: Mon Apr 06, 2020 6:50 pm But anyway step by step. Can we have the first stage of save while rendering.
Code: Select all
engine.session.GetFilm().SaveOutputs()
I'm not sure if the LuxCore API offers a way to pass a filepath to SaveOutputs(), this is a question for Dade.Sharlybg wrote: Mon Apr 06, 2020 7:13 pm What if i want it to be the blendfile folder to be the automatic output ?
You have to rename the images or move them somewhere else if you want to prevent them from being overwritten.Sharlybg wrote: Mon Apr 06, 2020 7:13 pm I hope the file will not be rewrite each time i hit pause. So i can keep each image file.
I guess you could probably do something like:You have to rename the images or move them somewhere else if you want to prevent them from being overwritten.
Code: Select all
import os
from datetime import datetime
os.rename('a.exr', '{}.exr'.format(datetime.now().strftime('%Y-%m-%d-%H-%M-%S')
There is the "SaveOutput()" for that but Alpistinho's solution is simpler.
I hadn't even seen the code before, but I came up with that:Sharlybg wrote: Mon Apr 06, 2020 7:45 pm The first code line by BYOB seem to not give me any result. there is no file saved and i have to search in all folder as i don't know wich exact folder get the file. but a quick search "exr" inside addon folder show nothing.
Alpistinho can you upload you're working modified final.py file so i can overwritte mine and be sure instruction are the same ?
I'm a bit overhelming.
Code: Select all
if LuxCoreDisplaySettings.paused:
if not engine.session.IsInPause():
engine.session.Pause()
utils_render.update_status_msg(stats, engine, depsgraph.scene, config, time_until_film_refresh=0)
engine.framebuffer.draw(engine, engine.session, depsgraph.scene, render_stopped=False)
engine.update_stats("", "Paused")
# Our crappy patch here
engine.session.GetFilm().SaveOutputs()
import os
from datetime import datetime
os.rename('a.exr', '{}.exr'.format(datetime.now().strftime('%Y-%m-%d-%H-%M-%S')))