SOLVED New User: Question Regarding Render Automation Capabilities.

Hello,

I am a relatively new user to C4D. I have extensive Python experience but have never used it in tandem with C4D. I was just wondering if the below use case is possible using the CLR and Python SDK.

  • Have a base level scene set up in a .c4d file.
  • Run c4d from command line in linux machine and open this base scene file.
  • Using a Python script:
    • Load in an object from an STL/3D format file. Set position of object, texture, color, etc.
    • Have several different cameras set up in the scene and render a shot from each of the cameras.

I am not asking how I could go about doing this, but rather if it is possible to do this with the developer tools provided with C4D. I am working on a personal project that creates a number of STLs, and want to find a good way to render them out in a programmatic fashion using the render engines provided by C4D without having to do so manually in the GUI.

Any info would be greatly appreciated and thank you in advance 🙂

Hi @Spools_Arbuckle,

Cinema runs pretty well under the common Windows compatibility layers like Wine, because Cinema itself is quite OS-agnostic, i.e., does not use to much of exotic OS calls. So, you could try to use that before you try more inconvenient approaches like remote systems or a separate Windows installation.

Cheers,
Ferdinand

Hello @spools_arbuckle,

welcome to the Plugin Café community and thank you for reaching out to us. Please remember to add the required information as tags to your posting as stated in the Forum Guidelines: Tagging. It is required to describe the operating system environment, the programing environment and the revision of Cinema.

What you are trying to achieve is not possible under Linux. While we do offer the command line renderer under Linux, we do not offer the c4dpy interpreter executable for Linux, which would be required for what you want to do. The reason for that requirement is that the CLR does not offer any arguments for passing in a Python script to be executed on the document the CLR is loading.

You can write plugins for Linux, but that would not be scripts in the formal sense and not work in the fashion you want it to. There are some paths with plugins you could try to take via PluginStart() and messing around with the CLR arguments, but that would be very experimental and not really suited for a beginner.

In principle c4dpy can do what you want to do, but to achieve it in the worflow of "provide a .c4d file and .py file and throw them at the CLR executable", you would have to wrap some things yourself. I have shown in Extending the Command Line with Python how this could be done. This will however only work on Windows and MacOS, due to the lack of c4dpy on Linux.

Cheers,
Ferdinand

Hey @ferdinand (fantastic avatar, btw)!

I apologize for the lack of tags; I will abide by said guidelines moving forward.

Also, thank you for the information! The reason I was inquiring about using this with Linux is because I would likely set up this workload to be managed in a cloud environment. Though, I assume if it is possible using a Windows image, that I can likely get it to work by using a Windows-based instance in a cloud environment instead of a Linux-based instance.

Hi @Spools_Arbuckle,

Cinema runs pretty well under the common Windows compatibility layers like Wine, because Cinema itself is quite OS-agnostic, i.e., does not use to much of exotic OS calls. So, you could try to use that before you try more inconvenient approaches like remote systems or a separate Windows installation.

Cheers,
Ferdinand

Hello @Spools_Arbuckle,

without further questions or replies, we will consider this topic as solved by Monday, the 30th and flag it accordingly.

Thank you for your understanding,
Ferdinand