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

    NetRenderGetFileFromServer

    SDK Help
    0
    3
    322
    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 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,

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

        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?

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

          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!

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