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

    Script manager and python modules

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 534 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 30/07/2012 at 08:18, xxxxxxxx wrote:

      Hi everybody,

      I'm quite new to python and C4D programming.

      I use C4D's script manager to write my code. As my script grew big, I created a second file in which I put a couple of functions.
      My files look like that :
      main.py
      mymodule.py

      I import the functions using :
      from mymodule import function1, function2

      It seems that I need to restart C4D to get the changes made to mymodule.py taken into account.
      Is is the expected behavior or am I making a mistake somewhere ?

      Alex

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

        Hi,

        I think you should reload your modified module at the beginning of your script with the standard Python function: reload(mymodule)

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

          Thanks ! That was it.

          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 03/12/2012 at 14:00, xxxxxxxx wrote:

            Hi there Al3d and Yannick,

            I was wondering if you could help as you seem to have cracked the problem.

            I want to make my own modules for C4d in python but I dont know where to put them.

            I keep getting the error message:
            Import Error: No Module named xxxx

            Any help would be great. I am using Windows.

            Thanks!

            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 04/12/2012 at 01:45, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              I want to make my own modules for C4d in python but I dont know where to put them.

              I keep getting the error message:
              Import Error: No Module named xxxx

              Any help would be great. I am using Windows.

              Hi,
               
              You have to copy your own module to:

              {USER_FOLDER}/library/python/packages/{osx/win32/win64}

              This information is included in the docs' FAQ page ("Where do I store 3rd party modules for Python?" question).

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