Has anyone had any luck getting R21's c4dpy.exe to work with the current release of VS Code? I've followed the installation instructions but I'm consistently prompted to "Select Python Interpreter", even though I've set "python.pythonPath": "C:/Program Files/Maxon Cinema 4D R21/c4dpy.exe" in the VS Code application and workspace settings.
"python.pythonPath": "C:/Program Files/Maxon Cinema 4D R21/c4dpy.exe"
I've been able to get it running in PyCharm, but VS Code doesn't seem to recognize c4dpy.exe as a valid python interpreter.
Any suggestions or insights would be greatly appreciated.
@rossc1 Thanks for the inputs, I will for sure add a note in the documentation regarding this issue.
Just as a follow-up from the current status, it is confirmed and while there is a behavior change in our side due to the new licensing mechanism, the issue also comes from Visual Studio Code, reading directly raw string to detect a valid interpreter, and fail if something is not formated as it wants. However, we received the official confirmation from Visual Studio Code that they will not change their implementation, and not support custom interpreters. But we are still on it.
Regarding your needs for an IDE, you can use Pycharm, the only pre-requires is to rename c4dpy to python, unfortunately, we can't officially recommend doing such things since newer OS (Catalina) prevent user changing content of an application package but @dskeith explained everything cleary in How to use c4dpy for Cinema4D R20 SP1.
Hi Donovan, thanks for reporting. Which version of visual studio code you have? If its one of the latest (I don't know exactly which one, but it's seems it only support interpreter named python.exe as PyCharm does).
I've open a bug report about it.
But just in case maybe you have some previous configuration that prevents to work so could you try to do the next things:
If you see the Python Extension Loading task taking forever (more than 10 minutes).
Let me know if it works.
@m_adam Thank you for the prompt and thorough reply. I believe I've followed your instructions exactly, but unfortunately: no luck.
I even went so far as to completely remove all other Python installations and reinstall C4D via installer.
It just doesn't seem to be recognizing C4D's embedded python as a valid python installation for some reason. I have confirmed that c4dpy.exe (renamed python.exe) has successfully logged in and is functioning as an interactive intepreter (and in PyCharm).
Any other ideas?
UPDATE: VS Code does seem to be invoking c4dpy, but I'm ~15min into this process with CPU usage pegged near 75% without visible progress:
Thanks for testing and reporting back.
Could you switch python.jediEnabled. So if you Use Jedi autocompletion, to disable it or vise-versa.
However, note that official answers from the vscode python module dev were that custom interpreters are for the moment not supported. (I know previously it was working...)
And if you look at the visual studio community there are tons of bug reports about hight usage of CPU/RAM for the module loading for a big package.
And I can continue.
Unfortunately, since I'm on a holiday if switching the inspection tool by switching the value of jediEnabled doesn't help I can't help you more and we will need to dive into it when the team comes back in January.
In the meantime, I hope you had a nice Christmas and I wish you a happy new year.
Hey, I run into the same issue on a Mac. I followed the instruction how to use c4dpy in VS Code but when I am pasting the path to c4dpy in the python interpreter settings, it does not accept it. No messages, nothing. I cannot select c4dpy as a python interpreter.
Hi, unfortunately, there is an issue, and my version was working because visual studio code used a cache of the interpreter.
And from visual studio code, there is no official support for custom interpreters, so we will need to fix c4dpy to make it working correctly.
Thanks Maxime for clarifying. So we will wait for your fix
@m_adam could issue be highlighted in installation instructions for the next person who tries it? Would have saved me a few hours yesterday as I followed the documentation then spend a couple of hours trying to figure out what was going wrong.