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

    Thread breaks inside Execute(...)

    SDK Help
    0
    4
    432
    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 24/01/2017 at 04:47, xxxxxxxx wrote:

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

      ---------
      Hello.

      I was trying to support Render Region in my render engine, but for some reason, I was getting vps->thread->TestBreak() as true inside my VideoPostData::Execute(...). After a lot of investigation, I found that the document I get in vps->doc is the same as in GetActiveDocument(). The problem here is that during my render engine initialization, I have to set to false the Linear Workflow parameter using:
      vps->doc->SetParameter(DOCUMENT_LINEARWORKFLOW, FALSE, DESCFLAGS_SET_0);
      because it would cause the texture baking to create washed out images.

      Removing the above line, vps->thread stops breaking. 
      What does this line do that causes thread break and how can I overpass it ?
      I have noticed that EventAdd(EVENT_FORCEREDRAW); also causes the thread to break.

      Could you please help me understand it or give me a link to any manual ?
      I have checked BaseThread manual, but I couldn't find any reference to this.

      Thank you very much for your time !

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

        On 25/01/2017 at 02:30, xxxxxxxx wrote:

        Hi,

        the point is, if the document gets changed the interactive render region needs to re-evaluate and re-render the scene, so this break condition looks absolutely ok to me.
        You shouldn't modify the scene when rendering.
        Turning off linear workflow feels wrong for me, as it changes the scene against the artists intentions. Instead it's probably better to react correctly to the linear workflow settings. But this should probably be discussed in a separate thread.

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

          On 25/01/2017 at 04:24, xxxxxxxx wrote:

          Hello and thank you very much for your answer.

          I am referring to Render Region command (not IRR).
          The problem is that I have to disable Linear Workflow before rendering in VIDEOPOSTCALL_RENDER. So, I do it in vps->doc, since it is cloned. But, when using Render Region tool, the document is not cloned, but the same as GetActiveDocument().

          Thank you.

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

            On 25/01/2017 at 04:38, xxxxxxxx wrote:

            Sorry, my fault, but it's the same explanation for render region.
            And I still think, disabling LWF is a good choice and it should be discussed in another thread.

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