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

    Python Integration?

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 452 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 28/09/2012 at 10:44, xxxxxxxx wrote:

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

      ---------
      Hi,

      okay I can load and execute a python script but is there a way to extent the language with global variables or similar (just like for the Coffee engine)?

      Thanks in advance

      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 28/09/2012 at 11:19, xxxxxxxx wrote:

        lib_python is not documented unfortuneately. 😞 Could you please post the code you use to execute a script? 🙂

        Thanks,
        -Niklas

        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 30/09/2012 at 08:13, xxxxxxxx wrote:

          I have no code I only found the example in the docs. Look out for ID_PYTHONSCRIPT.
          I didn't know there was a pylib already. I check that, thanks for the hint. Anyway, at first glance I don't see anything that helps me with my question, so it would be nice if the support could give a direction or info on this.

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

            On 12/02/2013 at 09:26, xxxxxxxx wrote:

            Hi Samir,

            Here's a small code example that shows how to add a global constant to c4d module:

            void RegisterConstant()
            {
                GePythonGIL gil; // gil must be created
                PythonLibrary pylib;
                
                _PyObject* mod = pylib.GetModule("c4d");
                if (mod)
                {
                    pylib.InitConstant(mod, "constant", 30)
                }
            }
              
            Bool PluginMessage(id, data)
            {
                switch (id)
                {
                    case C4DPL_PYINITTYPES:
                    RegisterConstant();
                    break;
                }
                return true;
            }
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 12/02/2013 at 11:23, xxxxxxxx wrote:

              Thanks Yannick!

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