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
    • Recent
    • Tags
    • Users
    • Login
    The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.

    Exposing object functions to python

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 256 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 14/04/2014 at 03:08, xxxxxxxx wrote:

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

      ---------
      Is it possible to expose custom functions from a subclass of ObjectData into python? Or at least create a global function that takes it the object as an argument, so I can handle it in C++ and return the information I need? I need access to the underlying data structures..

      I only found this example for wrapping a global function using ctypes here. But have no idea how I could use it for my purpose.

      Cheers,
      Satara

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

        On 17/04/2014 at 14:54, xxxxxxxx wrote:

        The Python API is not documented, we therefore also don't give much support for it, but you can
        use it. It should not be hard to understand after examining the header a little. Something that you
        should know though (where I failed initially) is that you need to lock the Python GIL before doing any
        Python related stuff. You can use RAII for that purpose with the GePythonGIL class.

        The Python library in the SDK allows you to convert back and forth between GeListNodes, for 
        instance. You can also expose new functions to Python, but it might be easier to just use ctypes
        and then convert the passed PyObjects to a GeListNode.

        Best,
        -Niklas

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