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

    Extending Python Functions

    SDK Help
    0
    4
    382
    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 27/07/2016 at 15:43, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R17 
      Platform:    Mac  ;  
      Language(s) :     C++  ;

      ---------
      Howdy,

      Well, I tried using the code posted in this thread (thanks) :
      https://developers.maxon.net/forum/topic/9583/12865_how-to-expose-an-object-function-done-in-c

      ... simply copying and pasting it into a test plugin, but I'm getting an error when I try to call the function from python:

      As you can see from the above screen shot, the console is saying that the initilization was successful, but I'm not familiar with python (never used it) so I don't know if I'm calling the added function correctly.

      What am I doing wrong?

      Adios,
      Cactus Dan

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

        On 28/07/2016 at 02:20, xxxxxxxx wrote:

        Hi Cactus,

        seems like your image link is corrupt. At least for me, it displays the "no image" icon.

        For examples on extending the Python API, you might want to look into my APEX plugin.
        It implements a few Python functions from C++ (see the wiki).

        Cheers,
        Niklas

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

          On 28/07/2016 at 02:33, xxxxxxxx wrote:

          Hi,

          The screenshot image displays fine for me.

          I think you're just missing the module name c4d.extendpyapi before HelloPython().
          So to call HelloPython() write c4d.extendpyapi.HelloPython()
          You can also import extendpyapi module with from c4d import extendpyapi and then just write extendpyapi.HelloPython()

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

            On 28/07/2016 at 05:35, xxxxxxxx wrote:

            Howdy,

            AHA! That works! Thank you. 😉

            Adios,
            Cactus Dan

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