-
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 escapeManually 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!
-
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,
FerdinandI.e., your script will then be as follows where there is an
rin 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 ) -
F ferdinand moved this topic from General Talk