On 05/02/2015 at 16:14, xxxxxxxx wrote:
Hi guys!
First timer here, so I'd like to thank you all for learning a lot just from searching the forum :)
Reasons aside, I try to render each frame to picture viewer separately, one by one. I'm trying to do this all evening and I close but still can't figure out why it's not just working as I'd like it to. I'm gonna describe my two trials:
Trial 1:
In the script manager I tried to do a simple while loop but it ain't working, just looping endlessly. I tried adding some time delay, but still nothing.
> import c4d
>
> from c4d import gui
>
>
>
> def main() :
>
> rd = doc.GetActiveRenderData()
>
> i=0
>
> while i<3:
>
> if c4d.CheckIsRunning (c4d.CHECKISRUNNING_EXTERNALRENDERING) == False:
>
> rd[c4d.RDATA_PATH] = r'/Volumes/Dwojka/test/test00' + str(i) #Iterate Render Path
>
> c4d.CallCommand(12099) #render to pictview
>
> c4d.CallCommand(12414) #goto next frame
>
> c4d.EventAdd()
>
> print i, " done"
>
> i=i+1
>
>
>
>
> if __name__=='__main__':
>
> main()
>
>
>
Trial 2:
I tried the Python Tag approach, and it's a lo0t better, but still too brute and I've got to be lucky just to render all the frames without a fuss. When I press play in the timeline, C4D plays all frames in the loop and whatever frame it is at the moment when rendering stops, it starts again. So it's just rendering random frames. I hacked it adding the delay time, but it only works well when the delay time (X) is greater than rendering one frame time. So it's kinda pointless for animations where stuff change all the time.
> import c4d
>
> import time
>
>
>
>
> def main() :
>
> pass #put in your code here
>
> rd = doc.GetActiveRenderData()
>
> i=doc.GetTime().GetFrame(doc.GetFps())
>
>
>
> if c4d.CheckIsRunning (c4d.CHECKISRUNNING_EXTERNALRENDERING) == False:
>
> rd[c4d.RDATA_PATH] = r'/Volumes/Dwojka/test/test00' + str(i) #Iterate Render Path
>
> c4d.CallCommand(12099) #render to pictview
>
> c4d.CallCommand(12414) #goto next frame
>
> c4d.EventAdd()
>
> time.sleep( X )
>
>
>
> c4d.EventAdd()
>
>
>
Any help appreciated!
All the best,
John Alabama