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

    How to "include" .pyp filies inside a .pyp file?

    Scheduled Pinned Locked Moved PYTHON Development
    12 Posts 0 Posters 1.2k 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 29/05/2013 at 15:05, xxxxxxxx wrote:

      Is this what you want?: https://developers.maxon.net/forum/topic/6150/6395_additional-files-for-plugin-dev&KW=classes&PID=27008#27008

      -ScottA

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

        On 29/05/2013 at 15:31, xxxxxxxx wrote:

        YES!!! 🙂
        Thank you.
        However, when I tried to run the "Source Protector..." command on the .py file that is the file that I'm importing, the protection fails.
        Is it possible to protect the source code of the imported module?

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

          On 29/05/2013 at 16:27, xxxxxxxx wrote:

          I think I remember someone asking that same question. And the answer was it's not possible.
          But I could be wrong.

          -ScottA

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

            On 29/05/2013 at 16:28, xxxxxxxx wrote:

            I hope you are wrong 😉

            I thought that python was more powerful than COFFEE. If this is not possible it is a major drawback 😞

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

              On 29/05/2013 at 17:36, xxxxxxxx wrote:

              You can compile Python code to .pyc files. Hit google for it, there's plenty of information about it.
              The compilation of .pyp to .pype files differs from this, the Source Protector can not be used interchangibly
              with the normal Python bytecode translator.

              Best,
              -Nik

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

                On 30/05/2013 at 04:47, xxxxxxxx wrote:

                I finally managed to compile a .pyc file from the .py file.
                But, when starting Cinema4D, I get a Bad Magic Number error.
                I believe this is due to the version of the compiler.
                So, how can I compile the .py file in a version that is compatible with the version that Cinema4D uses?

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

                  On 30/05/2013 at 04:53, xxxxxxxx wrote:

                  Have you used CPython 2.6? Use this version or you can even use the python binary in the Cinema
                  resource folder under modules/python/Python.<Your OS>.Framework/.

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

                    On 30/05/2013 at 05:08, xxxxxxxx wrote:

                    Oh, I used the version that comes with Mac OS 10.8

                    So, I went to the Terminal, changed to the directory where my .py file is. Then I dragged the Python.osx into the Terminal prompt to execute it. But I got a Permission denied error 😞
                    Am I doing something wrong?

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

                      On 30/05/2013 at 05:24, xxxxxxxx wrote:

                      I'm not a Unixman, but my guess is that your Python binary is not executable. You can change this
                      via the right click > properties or use    sudo chmod +x ThePythonExecutableFileName   .

                      -Nik

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

                        On 30/05/2013 at 05:37, xxxxxxxx wrote:

                        It worked.
                        And I was able to compile the .py file into a .pyc file.
                        But when I try to start Cinema4D, it crashes 😞

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

                          On 30/05/2013 at 10:33, xxxxxxxx wrote:

                          If it crashes, pls send maxon the crash report with some background information.

                          Thx!

                          Cheers, Sebastian

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