c4d.threading ID for team render

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/Cinema4DPythonSDK/html/modules/c4d.threading/BaseThread/index.html#
https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.modules/net/NetRenderService/index.html?highlight=team render#
https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d.threading/index.html#

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.