Rendering each frame to picture viewer separately



  • 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



  • On 05/02/2015 at 16:50, xxxxxxxx wrote:

    A tag approach wont work for something like this. Either a script or a plugin is what you will need to use. You will also need to look up threading and use a separate thread to run CheckIsRunning while you have your render going. I wrote something similar for my studio to do pre-post scripts and as a fail safe when team-render pooped out and other things that TR or Deadline couldn't do.

    Take a look here and this should help you get going.



  • On 06/02/2015 at 06:42, xxxxxxxx wrote:

    Hello,

    as Shawn pointed out, a Python Tag is not meant to do such tasks. You can render a document yourself using RenderDocument(). To display an image in the Picture Viewer you can use ShowBitmap(). To control the rendering process you may use a thread or a MessageData plugin.

    Best wishes,
    Sebastian



  • On 13/02/2015 at 08:21, xxxxxxxx wrote:

    Hello John Alabama,

    was your question answered?

    Best wishes,
    Sebastian


Log in to reply