Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    c4d.threading ID for team render

    PYTHON Development
    0
    2
    930
    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 20/07/2018 at 12:02, xxxxxxxx wrote:

      The idea is to switch an instance to have render instance == true in the view but automatically switch to false when I send it to the picture viewer.

      Our current code is as follows:

      import c4d
      def main() :
          global Render
        
          if c4d.threading.GeIsMainThread() == False:
              the_thread = c4d.threading.GeGetCurrentThread()
              Render = c4d.threading.IdentifyThread(the_thread) == c4d.THREADTYPE_RENDEREXTERNAL
      

      The only problem with this is that this only works when my machine renders the file to the picture viewer. This does not work when I send it to team render. I think that this can be fixed with changing the c4d.THREADTYPE_RENDEREXTERNAL to something that will ID the team render thread type.

      Resources: 
      https://developers.maxon.net/docs/py/2023_2/modules/c4d.threading/BaseThread/index.html#
      https://developers.maxon.net/docs/py/2023_2/modules/c4d.modules/net/NetRenderService/index.html?highlight=team render#
      https://developers.maxon.net/docs/py/2023_2/modules/c4d.threading/index.html#

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

        On 23/07/2018 at 05:55, xxxxxxxx wrote:

        Hi, MattEBV, first of all, welcome in PluginCafe.

        Please, try to avoid to post the same question on multiple forums, since people may lose time by investigating and answering a question which is already solved.
        With that said, I just would like to point you to this thread created at the same time than you, with pretty much the same question.

        So basically, there is no way to know if the current scene is used in Team render, the only things usable is to check the current executable, since Team Render Client is used only to render, so it's pretty safe.

        c4d.GeGetVersionType() == c4d.VERSIONTYPE_NET_CLIENT
        

        If you have any question, please let me know,
        Cheers, Maxime

        Edit: Small correction to text.

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