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

    Custom Tokens with Team Render Server

    Cinema 4D SDK
    3
    6
    1.3k
    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.
    • J
      Janosch
      last edited by Janosch

      Hello,
      our Cinema 4D plug-in is using custom tokens to generate the render path dynamically. When using Team Render Server for rendering, our tokens are not translated.
      This is the render path we set in "Edit Render Settings":
      /$collectionid/$layoutid/$cameraid/$itemids

      This is the path, where the rendering is put to:
      results/$collectionid/$layoutid/$cameraid/$itemids.0001.png

      We expect the rendering to be put into the following path:
      results/52/1/1/12345_54321.0001.png

      If we use "Render To Picture Viewer" in Cinema 4D, our custom tokens are translated correctly.
      Also, if we use standard tokens (e.g. /$take/$res)​ in our project and render with Team Render Server.

      All machines have installed the necessary plug-ins installed correctly.

      How can we use Team Render Server with our own tokens?

      Thank you for your help.
      Regards,
      Janosch

      1 Reply Last reply Reply Quote 1
      • M
        m_adam
        last edited by m_adam

        Hi @Janosch

        Thanks for reaching us normally they should just work as a normal token, in fact, Cinema 4D ones are built the same way 3rd party does, so normally no difference should happen.

        1. Are they Python Or C++ Token?
        2. Are you sure your tokens are correctly registered even in Team Render Client by printing/logging the result of RegisterToken?
        3. Does your token is executed?
        4. Are you sure your token has everything it needs to works (I guess $layoutid work only on your custom scene)?

        Thanks in advance,
        Cheers,
        Maxie.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • fwilleke80F
          fwilleke80
          last edited by fwilleke80

          Hi,
          I'll just chime in here, as I'm involved in that project, too.

          So the token hook needs to access certain elements of the scene to get their values, and the problem (thankfully) is easily reproducible.

          I wrote a sample plugin that recreates the behaviour by simply returning data from the first object in the scene. Download it from our dropbox: tokenhookbug.zip

          Here is the code:
          tokenhookbug_code.png

          This is the render setting in my example scene (which just contains a Cube):
          tokenhookbug_rendersetting.png

          Here is the render result in the Picture Viewer, notice the correct file name:
          tokenhookbug_result_pv.png

          Uploading and rendering the file on TeamRender produces this:
          tokenhookbug_result_tr.png

          The debugger clearly shows that doc->GetFirstObject() returns nullptr.

          Cheers,
          Frank

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 2
          • M
            m_adam
            last edited by

            Hi, unfortunately, there is an issue in the Team Render Server that prevents your script to work were to speed up things on the team render side only render data are loaded first to setup stuff like filename.

            Nothing that you can fix on your side.

            I've opened a bug report about it.

            I will keep you in touch.
            Cheers,
            Maxime

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • fwilleke80F
              fwilleke80
              last edited by fwilleke80

              Thanks for your reply! Too bad there's nothing we can do on our side to fix this. Is at least the document container loaded, so we could maybe store some information there before exporting saving the scene for TR use?

              Cheers,
              Frank

              www.frankwilleke.de
              Only asking personal code questions here.

              M 1 Reply Last reply Reply Quote 0
              • M
                m_adam @fwilleke80
                last edited by

                @fwilleke80 Yes or the RenderData but that means the data needs to be there before the token evaluation which is done before any scene execution render wise.

                Cheers,
                Maxime

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

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