Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Register
    • Login

    Python Plugin: numpy + scipy - Cinema4D R20

    Cinema 4D SDK
    4
    6
    1.4k
    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.
    • G
      Guglie
      last edited by

      Hello, how can I install and import numpy and scipy in python27 environment?
      Is there a portable way to ship the modules with the plugin?

      Sorry if there's already an answer, but I can find only legacy and unclear posts on this topic with mostly broken links. Is there a drive with precompiled packages?

      How can I support also windows?

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by

        Hi,

        1. numpy has no external dependencies in its vanilla package and can be "drag and drop" installed when absolutely necessary.
        2. scipy on the other hand is an ever growing pile of dependencies and therefore needs pip to be installed properly.
        3. You will have to install pip manually on Cinema's Python. There are multiple threads here in the forum on how to do that.
        4. Although I would not hold my breath for things working perfectly, since c4dpy is not just a rebranded vanilla CPython, but is also missing other stuff.
        5. You also would have to jump through all these hoops on the machine of a user. Which is not very practical.
        6. I would just run a vanilla CPython interpreter of your choice with the packages of your choice and establish a sever-client interface between this CPython and Cinema's c4dpy to do what you want.
        7. This will obviously come with quite a hefty performance penalty, but is IMHO the only reliable way to use said packages in a "not just dicking around locally"-scenario.

        Cheers,
        zipit

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by

          While zipit is almost all corrected, I just wanted to point:
          NumPy rely on some CPython dll, that need to be compatible with the python executable for more information see Building NumPy for Cinema 4D on Windows.
          However, that's being said, with c4dpy (in R20 it was not included in the regular c4d installation you need to download it from Downloads Page[URL-REMOVED]. Then normally you can just run the usual pip -install NumPy it should work (take care to check NumPy have a tendency to break quite often).

          For SciPy you can also install it via pip, but Cinema 4D doesn't officially support any Qt porting, so while it's possible to make it work you may encounter some weird behavior (like closing SciPy windows may close Cinema 4D, SciPy windows can't be docked, etc)

          For the moment there is no easy way to share these modules with your plugin, the easiest is probably to have a script that will run c4dpy and install the needed dependencies.

          Hope this answers your question,
          Cheers,
          Maxime.


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

          1 Reply Last reply Reply Quote 0
          • G
            Guglie
            last edited by

            Thanks zipit and m_adam!

            BTW I just need scientific functions, not Qt UI

            1 Reply Last reply Reply Quote 0
            • I
              iluxa7k
              last edited by

              I do not use c4dpy with older version than R23.
              I simply unpack wheels or compile, for example - scipy

              1 Reply Last reply Reply Quote 0
              • ferdinandF
                ferdinand
                last edited by

                Hi,

                without further feedback, we will consider this thread as solved by tomorrow and flag it accordingly.

                Cheers,
                Ferdinand

                MAXON SDK Specialist
                developers.maxon.net

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