Notifications
Clear all

[Closed] write a text file after render each frame

hi Guys,

i need help. How can i write a textfile, if the last images render finish.

i try

if currenttime == animationsRange.End then ()

but this code don´t work for each frame.

mfg
hot chip

2 Replies

Maxscript has tools to execute scripts before or after render (each frame or whole sequence).

Launched via callbacks it can do what you want

fn createLog = (		
		f = ( (getdir #scripts) + "\\log.txt"	)		
		if doesFileExist f then
		(
		  st = openFile f mode:"a"
		)else(
		  st = createFile f
		)
		format "- TimeStamp [%] %
" currenttime timestamp() to:st
		close st
	)--end fn
	
	
	-- #preRender			--Sent before rendering is started.
	-- #preRenderFrame		--Sent just before each frame is rendered by the renderer.
	
	-- #postRenderFrame		--Sent just after each frame is rendered by the renderer.
	-- #PostRender			--Sent after rendering has finished.
	
	callbacks.removeScripts id:#doLog
	callbacks.addScript #postRender "createLog()" id:#doLog

ah cool, thank you for you help. i will test it.

edit: Yes it works!