Jump to content

Archived

This topic is now archived and is closed to further replies.

jonmoore

Alembic sequence with .abc per frame

Recommended Posts

  • Topic Author
  • I'm due to get a large particle sim from a client created in X-Particles which I need to bring into Houdini. The problem I have is that they keep on sending monolithic .abc files (the whole sequence in a single .abc file). 

    Does anybody know if it's possible for the C4D Alembic exporter to output the Alembic cache as a sequence of .abc files? This is far friendlier for rendering on the farm as the renderer only has to stream the point cloud on each individual frame. 

    Many thanks in advance.

    Share this post


    Link to post
    Share on other sites

    Take a look here 

    Just and so for abc it give us:

    import c4d
    import os
    
    def get_current_frame():
        frame = int(doc.GetTime().GetFrame(doc.GetFps()))
        return str(frame).zfill(4)
    
    def save_obj():
        save_path = "C:\\Users\graphos\\Desktop\\Nouveau dossier"
        path = str(os.path.join(save_path, "{}.abc".format(get_current_frame())))
        c4d.documents.SaveDocument(doc, path,c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, 1028082)
    
    def main():
        total_frame = 100
    
        for i in xrange(total_frame):
            save_obj()
            c4d.CallCommand(12414) # Go to Next Frame
            c4d.EventAdd()
    
    
    if __name__=='__main__':
        main()

     

    Share this post


    Link to post
    Share on other sites

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×
    ×
    • Create New...