NetRenderGetFileFromServer



  • On 28/07/2017 at 13:27, xxxxxxxx wrote:

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

    ---------
    Hello,

    My shader directly samples a bitmap, which is loaded from a texture file. In TRS when "Client Get Assets
    On Demand" is turned on, this texture can not be found. I've tried to use NetRenderGetFileFromServer()
    but it always returns false.

    I'm doing this in ShaderData::InitRender().

    Filename filename = ...;
    Filename tex_filename = FindTexture(doc, filename);
    NetRenderDocumentContext const* ctx = doc->GetNetRenderDocumentContext();
    if (ctx && ctx->_service && !tex_filename.Content()) {
      Bool res = NetRenderGetFileFromServer(ctx->_service, filename, tex_filename, irs.thread);
    }
    

    However, NetRenderGetFileFromServer() always returns false.

    The scene that I'm testing with was saved using "Save Project with Assets" and the filename that
    is passed for the second argument matches the filename of the texture in the scene's tex/ folder.

    Hints to solve this are appreciated.

    Cheers,



  • On 31/07/2017 at 07:41, xxxxxxxx wrote:

    Hi Niklas,

    the only thing I see, that might cause an issue here is the filename passed to NetRenderGetFileFromServer(). In the end any path can not really be used (as it would need to refer to a path on the server, which may be different from the one in the project), so passing filename.GetFile() could be used to make sure. But with this change (needed here because I used an absolute path for testing) it works fine here.
    Please don't hit me, as it's probably obvious, but the referenced file got uploaded to the server, right?



  • On 01/08/2017 at 03:21, xxxxxxxx wrote:

    Hi Andreas,

    thanks for checking. I don't have any reason to hit you, since your guess was correct. I've never really
    used the TRS and I thought adding a .c4d file will automatically include the files in the tex/ folder as well.
    It works now, after I added the textures to the Render Job!


Log in to reply