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

    Best Practice For Imports?

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 780 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 14/08/2018 at 18:20, xxxxxxxx wrote:

      When I attempt to use the code

      with _localimport('') :
          import script_two

      an error occurs:
      "name _localimport is not defined"

      Perhaps there's a library I need to import beforehand.

      (I realize this is a very old post but I'm desperate!)

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

        On 16/08/2018 at 02:20, xxxxxxxx wrote:

        Hi Hfeist!

        First of all welcome in plugin cafe community!

        localimport is a module made by Niklas. So you have to download it from github, then import it to your python script.
        Niklas also provide a minified version which can be directly used more easily.
        Note that you should use localimport instead of _localimport

        And finally, if you post any code on the forum, please make sure to use [ code] [ /code] markdown.

        Cheers,
        Maxime

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