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
    • Register
    • Login

    Plugin Manager "Create Reload Script" generates invalid Python string path on Windows

    Scheduled Pinned Locked Moved Bugs
    programmingoff-topic-question
    2 Posts 2 Posters 97 Views 2 Watching
    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.
    • AnlvA Offline
      Anlv
      last edited by

      Hi Community,

      I noticed a small issue with Plugin Manager → Create Reload Script on Windows.

      I often use Reload Python Plugins while developing Python plugins, but it reloads all Python plugins. In some cases, especially with renderer-related plugins, this can also trigger viewport/material refreshes.

      Create Reload Script is very useful because it allows reloading a specific plugin only. However, on Windows, the generated script uses an unescaped path with backslashes:

      plugins.ReloadPythonPlugin(
          path="C:\Users\<user>\AppData\Roaming\Maxon\Maxon Cinema 4D 2026_XXXXXXXX\plugins\PluginName\PluginName.pyp",
          reloadDocumentAfterReload=False,
          reloadOnlyActiveDocument=False
      )
      

      Running the generated script in the Script Manager causes:

      SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
      

      Manually replacing \ with /, using a raw string, or escaping the backslashes fixes the issue.

      It would be great if Create Reload Script could generate a Python-safe path automatically on Windows.

      Thanks!

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF Offline
        ferdinand @Anlv
        last edited by ferdinand

        Hey @Anlv,

        Thank you for reaching out to us and reporting this. I just changed it so that the path is always a raw string. This will be shipped with an upcoming (but not the next) public release.

        Cheers,
        Ferdinand

        I.e., your script will then be as follows where there is an r in front of the string, which should fix the issue on Windows.

        plugins.ReloadPythonPlugin(
            path = r"C:\Users\<user>\AppData\Roaming\Maxon\Maxon Cinema 4D 2026_XXXXXXXX\plugins\PluginName\PluginName.pyp",
            reloadDocumentAfterReload=False,
            reloadOnlyActiveDocument=False
        )
        

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 1
        • ferdinandF ferdinand moved this topic from General Talk
        • First post
          Last post