TeamRender - Sending frames back to the server



  • On 12/06/2015 at 15:12, xxxxxxxx wrote:

    [USERFORM][p]User Information:[/p]Cinema 4D Version:   R15, R16 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;   
    [p]---------[/p][/USERFORM] Hi.

    I'm currently in the process of adding TeamRender support to an existing rendering plug-in. The renderer is not capable of distributed rendering of a single frame, so the intended functionality is simply to distribute entire frames between the available TeamRender clients. The rendering portion of the plug-in is implemented as a VideoPostData override.
    By adding VIDEOPOSTINFO_NETCREATEBUFFER and VIDEOPOSTINFO_NETFRAME flags to the result of GetRenderInfo, as well as adding the PLUGINFLAG_VIDEOPOST_ISRENDERER_NET flag when registering the plug-in, and overriding NetFrameInit, NetFrameFree, NetFrameMessage, and NetCreateBuffer (all of these just return true, aside from NetFrameFree which returns nothing, and NetFrameInit which performs some simple logic on the RenderJob object to control which client each frame is sent to and then returns true), the render process defined in the Execute method ran on the configured TeamRender Client. I was however, unable to determine how to send the fully rendered frame buffer back to Cinema4D and display it in the picture viewer using the SDK. As it is, the TeamRender client finishes rendering, and then Cinema 4D just sits and waits forever while displaying a fully transparent image in the picture viewer.
    There doesn't appear to be any documentation available for the Net/TeamRender portions of the sdk aside from a few brief notes on hooks defined in VideoPostData so any help is appreciated.

    For reference, I'm building against the R15 SDK and testing the plug-in using Cinema 4D and TeamRender Client R16.

    Thanks.



  • On 13/06/2015 at 04:19, xxxxxxxx wrote:

    Hello,

    if you don't want to support distributed rendering of single frames than you only have to set the PLUGINFLAG_VIDEOPOST_ISRENDERER_NET flag. Cinema 4D will handle the distribution of the frames of an animation to different render clients and the transfer of the final image data automatically.

    VIDEOPOSTINFO_NETFRAME, NetFrameInit(), NetFrameMessage() etc. is only needed to handle distributed rendering of single frames.

    Also, the API in general and the Team Render API specifically is always improved so there might be problems using a R15 build with R16.

    best wishes,
    Sebastian



  • On 15/06/2015 at 11:22, xxxxxxxx wrote:

    Thanks for the help. Unfortunately, reverting to just add PLUGINFLAG_VIDEOPOST_ISRENDERER_NET and updating to build against the R16 sdk results in an error message stating:

    "Out Of Memory"
    "Details:"
    "Preparing the rendering failed [net_renderservice.cpp(4850)]"

    I've used Visual Studio trace points to determine that this happens after my Message() and Init() hooks are called several times (and only those are called). It still occurs if the content of those hooks is commented out so that they only return true and do nothing else. It happens building against both the R15 and R16 sdks, as well as if I have a TeamRender Client available or not.

    I suspect this isn't an appropriate error message as I'm not coming anywhere near running out of memory.

    Thanks.



  • On 17/06/2015 at 01:10, xxxxxxxx wrote:

    Hello,

    without more information or some snippets of your code it is hard to say anything. If possible please provide some code of the key functions.

    Best wishes,
    Sebastian



  • On 18/06/2015 at 08:20, xxxxxxxx wrote:

    I have to be fairly careful about posting certain parts of the code. Is there something specific you would want to see?



  • On 18/06/2015 at 09:57, xxxxxxxx wrote:

    Hello,

    you could share your RegisterVideoPostPlugin() call, your GetRenderInfo() and how you react to VIDEOPOSTCALL_INNER.

    Best wishes,
    Sebastian



  • On 18/06/2015 at 10:36, xxxxxxxx wrote:

    Thanks. I've included the calls to RegisterVideoPostPlugin() and the GetRenderInfo()method.
    The VIDEOPOSTCALL_INNER stuff makes up a few fairly large sections of the Execute method, and that code is never actually hit on either the client or the server, so I'll leave it out for now.

      
    Bool KRRenderer::Register()   
    {   
    #if API_VERSION >= 15000   
         return RegisterVideoPostPlugin(KR_RENDERER, GeLoadString(KR_RENDERER),   
              PLUGINFLAG_VIDEOPOST_ISRENDERER | PLUGINFLAG_VIDEOPOST_ISRENDERER_NET,   
              KRRenderer::Alloc,   
              "KR_Renderer", 0, 0);   
    #else   
         return RegisterVideoPostPlugin(KR_RENDERER, GeLoadString(KR_RENDERER),   
              PLUGINFLAG_VIDEOPOST_ISRENDERER,   
              KRRenderer::Alloc,   
              "KR_Renderer", 0, 0);   
    #endif   
    }   
      
    VIDEOPOSTINFO KRRenderer::GetRenderInfo(BaseVideoPost* node) {   
         return VIDEOPOSTINFO_0;   
    }   
    


  • On 19/06/2015 at 01:25, xxxxxxxx wrote:

    Hello,

    there seems to be nothing wrong with the code you shared. But in a previous post you said that you implemented the Message() function just to return "true". This might be problematic since you might catch relevant messages. Either remove your implementation or add a call to the base class (e.g. using the "SUPER" macro).

    Best wishes,
    Sebastian



  • On 23/06/2015 at 10:59, xxxxxxxx wrote:

    Thanks. Unfortunately, that still hasn't resolved the issue. I was able to reproduce the same error with a minimal test case however, which I've provided below. Once pointed at the R16 SDK and built, switching the to the "TR Test" 'renderer' this plug-in adds and attempting to "Team Render To Picture Viewer" should immediately result in the error.

    https://thinkboxsoftware.box.com/shared/static/n6jqtkaqo0pxa8nl6b2a4iwnkmh0cg3h.zip



  • On 30/06/2015 at 08:15, xxxxxxxx wrote:

    Hello,

    indeed, it seems that VIDEOPOSTINFO_NETFRAME is expected to be that; the case of a Team Render renderer without single frame support seems to be not well defined.

    You might have to return VIDEOPOSTINFO_NETFRAME and add dummy implementations for NetFrameInit() etc. to avoid that error message.

    Best wishes,
    Sebastia


Log in to reply