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

    Trouble compiling

    Scheduled Pinned Locked Moved PYTHON Development
    13 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

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

      On 08/07/2012 at 01:04, xxxxxxxx wrote:

      The

      .pyp
      

      extension is Py4D specific. To protect Py thon P lugins, you habe to use the Source Protector plugin from the Python Plugins Menu (R12) or the Scripting Menu (R13).

      .py | .pyw | .pyc | .pyo
      

      files are simply Python source/nowindow/compiled/object files and Py4D doesn't assume they're plugin-files.

      -Nik

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

        Thank you for the reply, Nik 🙂

        So, there isn't any way to compile my .pyp files?
        Is there even any advantage of compiling python files?

        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 08/07/2012 at 21:47, xxxxxxxx wrote:

          > So, there isn't any way to compile my .pyp files?

          Originally posted by xxxxxxxx

          To protect Py thon P lugins, you habe to use the Source Protector plugin from the Python Plugins Menu (R12) or the Scripting Menu (R13).

          _
          > Is there even any advantage of compiling python files?_
          Well, I'd say to protect your source? 🙂
          You can both, protect your .pyp and your .py files. (You can outsource your code to .py files and compile those to .pyc)

          Cheers,
          -Nik

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

            I was asking this because "protecting" is not the same as compiling.
            Usually, compiling speeds things up.
            Does this means that compiling (not protecting) has no advantage whatsoever?

            Rui Batista

            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 09/07/2012 at 04:09, xxxxxxxx wrote:

              I think the .pyc files are faster to load yes.

              so protect the .pyp file using the source protector in c4d, then compile all your .py files

              you can get rid of the .py files once compiled, just leave the .pyc in there

              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 09/07/2012 at 04:22, xxxxxxxx wrote:

                Well, I didn't know that this was your point. Actually the only thing that speeds up is loading, as mchaloner already said.
                I don't know about the implementation details of the "protected" .pyp files (.pype) but I'm pretty sure they're not just obfuscated but compiled.

                -Nik

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

                  really if you're using .py packages your .pyp should be pretty small in terms of code, so the protected .pype should run pretty quick!

                  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 09/07/2012 at 06:01, xxxxxxxx wrote:

                    @mchaloner: I don't think "run pretty quick" is the correct term, here. The code doesn't run faster because the code-size is small. It just loads faster, and loading is done at Cinema 4D startup.
                    Also, outsourcing of code should be done in a "senseful way". Don't seperate each function to another source file. Importing does take it's take, too (when you want to decrease loading time).

                    When you know where your source-files are (and you usually do, because they're in your plugin folder), instead of appending the path of the plugin's directory, rather insert it at the beginning of the sys.path list.
                    In the former case, the Python Interpreter would walk through each folder in sys.path and finally gets to your plugin's path after it has traversed a number of other directories. In the latter, it will find your module at the first path in sys.path.

                    -Nik

                    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 09/07/2012 at 06:09, xxxxxxxx wrote:

                      excuse the poor choice of words, but that's essentially what I meant 🙂

                      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 09/07/2012 at 07:23, xxxxxxxx wrote:

                        So, that means that a compiled Python plugin runs no faster than a protected non-compiled plugin?

                        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 09/07/2012 at 07:33, xxxxxxxx wrote:

                          no, I was just saying that if you are using .py packages - your .pye wouldn't have much code in it, therefore Cinema 4D's loading of that plugin should be faster.

                          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 09/07/2012 at 07:33, xxxxxxxx wrote:

                            > So, that means that a compiled Python plugin runs no faster than a protected non-compiled plugin?
                            Nope. It just speeds up the start-up of cinema 4d. If that is even noticeable..

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