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

    Custom Tokens with Python?

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 827 Views
    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 Offline
      Helper
      last edited by

      On 29/03/2017 at 07:36, xxxxxxxx wrote:

      Hey Guys,

      I've been lurking on here for some time and always found an answer to what i needed, so a massive thank you to all who provide their knowledge on here for free, it's an amazing forum!

      I'm looking to create some custom render tokens to use through the Python implementation in Cinema. I had a quick look and i see that it is well documented in the C++ SDK, using RegisterToken() and TokenEntry().

      My question is, are we able to get at this with the Python SDK? I don't have any experience with C++ so can't go down that route (for the time being).

      Is anybody able to provide any info or point me in the right direction?

      Cheers,

      Cez

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

        On 29/03/2017 at 07:40, xxxxxxxx wrote:

        Take a look at https://github.com/PluginCafe/cinema4d_py_sdk/tree/master/scripts/tokensystem I think you get everything what you need.

        And for more informations https://developers.maxon.net/docs/py/2023_2/modules/c4d.modules/tokensystem/index.html?highlight=token#module-c4d.modules.tokensystem.

        Anyway thanks you I didn't know this class exist I always did this kind of stuff manually with os module and some regex.

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

          On 30/03/2017 at 06:10, xxxxxxxx wrote:

          Thanks for the reply gr4ph0s, much appreciated.

          I still need to properly dig through the documentation on this topic, one thing that isn't clear is that if it's possible to register my own custom tokens through Python (which are shown with the command tokensystem.GetAllTokenEntries(), i would like my token to show up here).

          Essentially I want to register a custom token: $PT, which references the parent output filepath so it can be used in the child render setting.

          Let me know if this is possible with Python to begin with, if not i don't want to waste time barking up the wrong tree!

          Cheers,

          Cez

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

            On 30/03/2017 at 07:45, xxxxxxxx wrote:

            Hi Cez,

            welcome to the Plugin Café forums 🙂

            Unfortunately currently our Python SDK is lacking the means to register new tokens. We have added it to our list of needed additions.

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

              On 30/03/2017 at 07:50, xxxxxxxx wrote:

              Hey Andreas,

              Thanks for the reply, that saved me some time!

              Is it something you plan on including in future updates to the Python SDK, or will it be kept for C++?

              Cheers,

              Cez

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

                On 30/03/2017 at 07:54, xxxxxxxx wrote:

                Hi Cez,

                I probably was too slow with my edit of the last post. While I can't tell, when we will add it, I'm pretty sure we will. We are constantly working on improving the coverage of the Python SDK.

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

                  On 30/03/2017 at 07:57, xxxxxxxx wrote:

                  Ha no worries, was eager to find out! 🙂

                  That's really cool, thank you, will keep an eye out for it in future releases.

                  Cheers,

                  Cez

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