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

    modulate command data plugin

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 339 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 15/10/2014 at 10:52, xxxxxxxx wrote:

      I've been working on a plugin for about a month but it's getting pretty big. How do I go about splitting it up into modular chunks? I've looked up several tutorials haven't really found a clear answer. Just to give you na idea of what I tired I...

      1. created a folder in the root of my plugin folder called "files"
      2. Inside that I created a helloworld.py file
      3. Used "from files import helloworld"

      but my plugin ceased to function once I included the import statement at the top of my document. Can anyone give me an working example that I could build off of?

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

        On 15/10/2014 at 11:30, xxxxxxxx wrote:

        You have to add the path where the "files" directory is to sys.path. But be careful! Don't just
        add it and import and be done. That can give you and your users a hard time when other
        plugins also use third party libraries.

        Check out the section "The correct way to load libraries that are distributed with your plugin"
        on my py4d-tips repository:

        https://github.com/NiklasRosenstein/py4d-tips#the-correct-way-to-load-libraries-that-are-distributed-with-your-plugin

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

          On 16/10/2014 at 12:07, xxxxxxxx wrote:

          There's really no other way to split up my code into MVC type components without doing it this way?

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

            On 16/10/2014 at 14:58, xxxxxxxx wrote:

            Hi,

            this might be a working example of what you need.
            But I would follow niklas suggestion of the correct way to load libraries.

            http://www.smart-page.net/blog/2012/06/24/smart-polychart-cinema-4d-plugin-fun-with-the-userarea/

            I´m not really sure if that helps.
            Best wishes
            Martin

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