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

    InitRender called twice (XMB)

    SDK Help
    0
    6
    434
    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 27/07/2013 at 03:23, xxxxxxxx wrote:

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

      ---------
      Hi,

      When i use my material with the physical renderer, InitRender is called, then FreeRender, then apparently on another instance InitRender and then the rendering starts.

      Does anyone know if this is normal?

      I want to do costly computations before the rendering starts but i don't know how to distinguish the two cases.

      Any advice? Thanks in advance.

      cheers
      Michael

      P.S. i tried it only in r13.

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

        On 28/07/2013 at 10:57, xxxxxxxx wrote:

        Well may be the first InitRender/FreeRender is used for something like Material Preview ?
        Have you tested INITRENDERFLAG_PREVIEWRENDER in flags ?

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

          On 28/07/2013 at 13:43, xxxxxxxx wrote:

          Could also be prepass or video post.

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

            On 29/07/2013 at 01:50, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Well may be the first InitRender/FreeRender is used for something like Material Preview ?Have you tested INITRENDERFLAG_PREVIEWRENDER in flags ?

            I don't think it is the Material Preview because InitRender is called right after hitting the render button.

            Just the INITRENDERFLAG_TEXTURES flag is set. And actually i don't see any difference in the parameters in InitRenderStruct.

            Not sure if it is a prepass or vp thing since it works fine with the normal renderer. Just switching to physical results in two calls afterwards.

            Anyway i think i should implement some sort of caching to disk since it could be relatively easily done and would also work around this problem.

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

              On 29/07/2013 at 01:57, xxxxxxxx wrote:

              I can confirm that it happens (tried in R13, too).

              The actual reason, I'm not sure of. I guess, when the Physical Renderer clones the document, the material preview renderings are kicked off one more time.

              Tips:
              - Check for INITRENDERFLAGS (ok, you already did this)
              - Check for the document in the InitRenderStruct, see what it is

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

                On 01/08/2013 at 02:39, xxxxxxxx wrote:

                Hi Jack. Thanks for checking!
                You are right. The document (InitRenderStruct::doc) is different in the two calls. Also the mat->GetDocument() pointer changes.
                I don't understand why there would be another copy of the document (editor render). Perhaps i should report it as a bug.

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