Where Can I Find Documentation for Licensing a Python Plugin?

  • Hello,
    I'm looking for information on licensing a Cinema 4D plugin written in Python. I'd like to understand how to register the plugin in Cinema 4D's registration screen (similar to others I've used like X-Particles, UV Vonc, Riptide Pro, etc.)

    I have a few questions:

    • Can this be done with a Python plugin?
    • If so, does a guide exist somewhere online explaining how this is done in Python? I found this article from 2012, but the code samples are in C++:
      Licensing Plugins – Part I – Basics. I also found this, but it's in C++ too:
      Plugin Licensing Manual
    • Do Python code samples for licensing exist somewhere?
    • I see that there were changes to the Python API for getting the user's product information (c4d.ExportLicenses(), c4d.GetGeneralLicensingInformation()). To support R20 and below, will I need to implement two methods for getting the user's licensing details?
    • For those with experience in this, is there a more friction-less plugin licensing model where you don't need to generate tons of new serial numbers every time a new version of Cinema 4D is released?

    Thanks for reading!

  • Hi,

    I cannot say much about licensing, because I have never done it. But there is a R21 example on github [1]. And if I am not mistaken, you are binding your plugin to user IDs (at least that is an option) now and not serials, which should be persistent.


    [1] https://github.com/PluginCafe/cinema4d_py_sdk_extended/blob/c7116c37eb7bb357294d60dd009aebb7e044153f/plugins/py-licensing_example_r21/py-licensing_example_r21.pyp

  • Hello,

    The screen you are showing was only available in c++ using SNHookClass

    With R21 we introduced a new licence system for Cinema4D and we have included new functions to retrieve the user information about his licence.

    We have this manual about the new licencing system.
    Functions exist also in python like ExportLicences

    As @zipit said we have a simple example on github, but you have to come with your own solution, it could be a licence file, a dialog box with a simple serial etc.

    If you have any questions feel free to ask of course.


  • Hi all,
    Thank you for your responses. @zipit , thank you for this example! That was very helpful. I am on R20, though, so I will need a solution that works for it too.

    @m_magalhaes , I appreciate you letting me know that I cannot use the registration view with Python. I don't know if you saw in my original post, but I was already aware of the Plugin Licensing manual and ExportLicenses.

    One of my questions is still unanswered: I'd like to develop a Python licensing system that works for both R21 and R20 and below. Would I be able to use the user's C4D serial number to create a plugin serial by this method? GeGetSerialInfo

    The documentation says not to use it, but I don't have R21.

    Thank you.

  • Hi,

    Yes you can create a system that works for R20 and R21. For R20 just create a hash key against the serial number, the last 5 digits is usually good enough, which you can get from the call you mentioned GeGetSerialInfo. Then for R21 just use their UserID or SystemID as mentioned in the other docs.

    You can then create a license file for each user if they manually send you these keys (serial or user id), and they could place it in the folder for their plugin. You could also automate the generation of this license file depending on who you are selling with.

    Most important however is that you encrypt your plugins so that they can't see how you are licensing them. I am not sure how well this works with python however.


  • @kbar Thank you for your response. That's really helpful, thank you.

Log in to reply