Hello!
So I've been developing a python script to get render information about my scene. I've been able to create a script which will watch when a render starts and when it's complete, but I've been having trouble with getting current render information such as the frame it is rendering and the time it took, etc.
Anyone know how to write this in python? I'm new to this whole thing so I'm not entirely sure how to code it out. I've looked at documentation but the syntaxes are complicated to me....
Here is the code I've written so far:
import c4d
import os,time,_thread, datetime
def isRendering(time,os) :
RenderData = doc.GetActiveRenderData()
FrameStart = RenderData[c4d.RDATA_FRAMEFROM].GetFrame(doc.GetFps())
FrameEnd = RenderData[c4d.RDATA_FRAMETO].GetFrame(doc.GetFps())
while c4d.CheckIsRunning ( c4d.CHECKISRUNNING_EXTERNALRENDERING ) :
#print(c4d.RENDERRESULT_OK)
#Here I want to check current frame being rendered and and how long the previous frame took to render:
#rdata.GetFrame (Something like this)
time.sleep(1)
print("render complete.")
def main() :
c4d.CallCommand(12099) #Render To PV
if c4d.CheckIsRunning ( c4d.CHECKISRUNNING_EXTERNALRENDERING ) :
_thread.start_new(isRendering,(time,os))
if __name__=='__main__':
main()