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

    Interfacing Py4D and C++?

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 262 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 21/01/2012 at 04:04, xxxxxxxx wrote:

      Hello,

      I would like to know if there was any possibility to obtain the memory adress of a wrapped object from the C4D-API in Py4D. And if not, why isn't there? This would expand the possibilities of Python in Cinema 4D even more. Writing expensive algorithms in C++ and wrap it all with the ease of Python, that'd like cake (and I really love cake)! Yes, we would loose platform independency when using this technique, and needed to compile the C++ implementation for each platform. But hey, the C++ guys do it the same way, except they don't use Python to interface between the user and C++.

      import c4d  
      import ctypes  
      myextension = ctypes.cdll.myextension  
      op = c4d.BaseObject(c4d.Ocube)  
      myextension.doStuff(op.GetCPointer())
      
      #include <c4d_baseobject.h>  
      DLLEXPORT void doStuff(long ptr) {  
        BaseObject* op = (BaseObject* )ptr;  
        // go on doing c++ stuff  
      }
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 21/01/2012 at 05:02, xxxxxxxx wrote:

        Hi,

        sorry, but the C++-Python API is unfortunately not supported yet.

        Cheers, Seb

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