MAny thanks Ferdinand. I will look into the BatchRender suggestion. That looks promising.
Latest posts made by bee7er
-
RE: subprocess not running in background
-
RE: subprocess not running in background
A test project is supplied in the 'projects' folder. Use that when testing.
-
subprocess not running in background
I am writing a C4D Python plugin to render one or more frames. I am using the 2023 C4D, which uses Python 3. The plugin is working just fine and I can invoke a Python script, which calls a shell script to run the C4D Commandline passing various parameters. All this works fine and the frame images are rendered correctly, except that while the render is running I am unable to continue editing in C4D because the render is running in the foreground thread.
I think the subprocess.run function I am using which submits a Python script to manage the shell script should run in the background allowing me to continue editing my project.
To recreate the problem unzip the attached plugin into the plugins folder. Check the PYTHON_INTERPRETER and COMMANDLINE_EXECUTABLE symbolic constants in the py-srs_test.pyp script to make sure they are correctly set. Then run the plugin and click the OK button in the dialog which pops up. The render will run for about 10 or 15 seconds during which time you will be unable to edit the project.
Thanks
-
RE: urllib.request module is missing
Hi Ilia
Many thanks for the prompt response and btw you were absolutely right, although I don't know why. Of course, I had already imported urllib, but I did indeed have to import the request module, which is strange as I have numerous instances where I am able to access modules from an imported library.I am happy to follow any guidelines in order to engage with this forum. Please check the links you gave me for the guidelines as the above links access a blank page. I am using Chrome on my MAC laptop.
-
urllib.request module is missing
According to the Python 3 libraries documentation I should be able to use a 'urllib.request' object to call an API and get back data. But I am getting an error: module 'urllib' has no attribute 'request'.
The request part of the urllib library is missing. How should I call an API then?
Prior to the 2023 version I was able to use urllib2. My plugin works fine on MAC and PC at earlier versions of the Python implementation.