Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to track the rendering progress programmatically

3 REPLIES 3
Reply
Message 1 of 4
automation.msi
422 Views, 3 Replies

How to track the rendering progress programmatically

Hi,

Within my automation I launch rendering with python.(Open MAX, open project, start rendering, close MAX).

 

Is there a way to see/track progress of rendering programmatically? Or does MAX store somewhere in file system an accessible progress information or rendering(image) preview? Thanks

Labels (1)
3 REPLIES 3
Message 2 of 4
drew.avis
in reply to: automation.msi

You could attach a calback to #preRenderFrame or #postRenderFrame and calculate progress based on the total number of frames.  See https://help.autodesk.com/view/MAXDEV/2022/ENU/?guid=GUID-E5BE0058-2216-4E0B-88AF-680CA58AAC73 for some details.

 

Hope that helps,

Drew



Drew Avis
Content Experience Designer
Message 3 of 4
automation.msi
in reply to: drew.avis

Hi Drew,

thanks for your answer. Can you please help me out how to implement your advice in to my snippet?

Let's say loop every 2 minutes and get values you suggested (#preRenderFrame)

import pymxs
import codecs

pymxs.runtime.loadMaxFile(project_path)
bmp = pymxs.runtime.render(outputFile=output_path)
pymxs.runtime.save
pymxs.runtime.quitMax()

thank a lot!

Message 4 of 4
drew.avis
in reply to: automation.msi

Something like this will print the time for each frame processed during rendering, it might give you a starting point:

 

from pymxs import runtime as mxs

def renderCallback(): 
	a = mxs.callbacks.notificationParam()
	print (f"we're on frame: {a[12]}"
)

mxs.callbacks.removeScripts( id=mxs.name('render_test'))
mxs.callbacks.addScript(mxs.name('preRenderFrame'), renderCallback, id=mxs.name('render_test'))


Drew Avis
Content Experience Designer

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report