Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Calling RenderDocument Multiple Times setup once

    SDK Help
    0
    4
    349
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 30/03/2016 at 20:55, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   17 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      Each time I call RenderDocument it goes through a setup phase before it starts rendering. Is it possible to have this setup step occur only once and then for each next call to RenderDocument have it skip this step and just render?

      There could be setup phases such as creating any acceleration data structures, hair setup, GI etc...

      For instance if I was to move a camera manually in the scene and call RenderDocument to render a "frame" for each position then it would be great if any setup phase only occurs on the very first call to RenderDocument and not on any of the following calls.

      Or another example is you might want to render the same scene from multiple cameras, but only have the setup phase happen the first camera that you render.

      Maybe there is some flag I can set or some other call I can make before RenderDocument?

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 31/03/2016 at 02:31, xxxxxxxx wrote:

        Hello,

        I don't think there is a way to achieve what you want. RenderDocument() is – well – a function. When it ends all internal data is released. When rending finished all rendering related internal data is freed. There is no way to tell the renderer that it should continue after a pause; there is no concept  of a "paused" rendering.

        You can of course configure the render settings so that effects like GI use a cache file. But some acceleration structures may depend on the camera position so they have to be re-calcluated for every render job.

        If you want to render a scene with multiple cameras (and the scene is not animated) you could simply animate the camera (or animate a Stage object).

        Best wishes,
        Sebastian

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 31/03/2016 at 14:39, xxxxxxxx wrote:

          Hi Sebastian,

          I didn't think there would be, but was worth checking in case I missed something.

          Perhaps a good feature request would be to add a 2 function to allow for this.

          StartBatchRender(Basedocument *doc,...);
          EndBatchRender(Basedocument *doc,...);

          StartBatchRender would initialize everything required for rendering that document using the currently set camera.

          Then calls to RenderDocument can be made. If the camera changes, or moves and requires recalculation, or something else happens that requires things to be rebuilt, then it will recalculate those. But if the camera move does not affect anything then it can just start rendering.

          Finally call EndBatchRender to free up any caches created.

          This would allow for some complex rendering solutions where you want to render multiple camera angles or locations within an already defined animated file. IE You could render frame 1 from many different locations before moving onto frame 2.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 01/04/2016 at 01:56, xxxxxxxx wrote:

            Hello,

            thanks for your suggestions. We will add it to our internal database so our developers can evaluate the ideas.

            Best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • First post
              Last post