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

    MSG_MULTI_CLEARSUGGESTEDFOLDER not called for TeamRender

    Cinema 4D SDK
    c++ r25
    3
    6
    779
    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.
    • T
      till.niese
      last edited by ferdinand

      Hello,

      I have some questions about the messages sent for TeamRendering. I already found these topics, but those don't fully answer my question:

      • Changing Asset References to Absolute
      • Set preference parameters
      • Weird filenames when using make project
      • MSG_GETALLASSETS calls?
      • TeamRender&MSG_MULTI_CLEARSUGGESTEDFOLDER
      • questions about network rendering.

      When TeamRendering is used (Add to Render Queue... and TeamRender to Picture Viewer...) MSG_GETALLASSETS is emmited and the Resources are transferred to the render client(s). But MSG_MULTI_CLEARSUGGESTEDFOLDER does not seem to be emitted (For Save Project with Assets... it is). Due to that, the paths on the render client are absolute referring to the file on the PC initiating TeamRendering.

      Should one expect that this message is not sent? And if so is that due to the possibility to request assets on-demand from the server for which the absolute path would be required? Is there a case for which MSG_MULTI_CLEARSUGGESTEDFOLDER would be sent whenTeamRendering is used?

      Kind regards,
      Till

      1 Reply Last reply Reply Quote 0
      • T
        till.niese
        last edited by till.niese

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand
          last edited by

          fixed 😄

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by Manuel

            Hi,

            When you ask for a teamrender, all asset are copied to a temporary directory on the server. TeamRender do not use MSG_MULTI_CLEARSUGGESTEDFOLDER but when loading the scene, clients will check the assets by only taking the filename into account. If they need to be renamed, the message MSG_RENAMETEXTURES will be broadcast. This message will be forward with RenameTextureMessage data structure. If something was changed, changecnt must be updated.

            So to support teamrender and saveproject command, your plugin should add both message support

            else if (type == MSG_MULTI_CLEARSUGGESTEDFOLDER || type == MSG_RENAMETEXTURES)
            // update the file name
            

            cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • T
              till.niese
              last edited by till.niese

              @m_magalhaes Thank you for your response.

              So on the client-side, I always have to assume that I might get absolute paths that refer to the files on the server (MSG_MULTI_CLEARSUGGESTEDFOLDER is not called and MSG_RENAMETEXTURES is only called in case of name conflicts)?

              If I'm confident that a file that is found on the client-side at such an absolute path matches the one on the server I could use it, but if I want to avoid mismatches of the assets between client and server I should check if net rendering is active for the document and if so only use the file part ( Filename::GetFile) of the file to check if the Asset is in the project directory and if not request it using only that file part through NetRenderGetFileFromServer?

              So a possible implementation of the Asset lookup in the plugin code would look like this?

              Filename filename = /* retrieved e.g. from HyperFile */
              
              // Check if net rendering is active for document
              NetRenderDocumentContent * const context = doc->GetNetRenderDocumentContext();
              if (context != nullptr) {
                 // net rendering: check if file is missing in project directory
                 if (!GeFExists( doc->GetDocumentPath() + filename.GetFile() ) {
                     Filename fnNet;
              
                     // request file from the server
                     if (NetRenderGetFileFromServer(context->_service,  filename.GetFile(), fnNet) {
                          // use path returned by NetRenderGetFileFromServer
                         filename = fnNet;
                     } else {
                         // handle error case
                     }
                 } else {
                     // use the file in the project directory
                     filename =  doc->GetDocumentPath() + filename.GetFile();
                 }
              } else {
                 // no net rendering: regular check if asset exists at path + error handling
              }
              
              1 Reply Last reply Reply Quote 0
              • ManuelM
                Manuel
                last edited by

                hi,

                if I'm correct, you are trying to implement a NodeData plugin right?

                On this node, you are doing some action based on files that you store inside your own structure and not any baselink? Those files must be considered as assets.

                When you start a teamrender render, MSG_GETALLASSETS will broadcast to retrieve all the assets. You must react to the message so your assets will be collected. See this manual for more information.
                While collecting those assets, it can happen that assets have to be renamed if those assets share the same name but are in different directories. This will be done using MSG_RENAMETEXTURES. In that case, RenameTextureMessage will be sent as data and you will have to update the assets filename of your NodeData, either the baselink or your structure.

                Once collected, all the assets will be in the same directory as the .c4d file.

                Now the client will open the project and will try to retrieve the asset, it could happen that the message MSG_RENAMETEXTURES will be triggered again.

                Your code should work if the filename you retrieve from the hyperfile is updated.

                Cheers,
                Manuel

                MAXON SDK Specialist

                MAXON Registered Developer

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