call Python script from Command Line



  • On 27/02/2015 at 04:40, xxxxxxxx wrote:

    Hi,

    I wonder if it is possible to call python script from Command Line like in Blender. With Blender you can launch Command Line and type this:

    blender_path --background --python myPythonScript.py
    _<_o:_<_o:p_>_o:p>
    It launches Blender without GUI and executes python script. We would like to do some batch operations on c4d multiple files. I know you can lauch C4D from Command Line and there are several options, but could not find an option for running Python scripts.

    Best regards,

    Stan



  • On 27/02/2015 at 06:37, xxxxxxxx wrote:

    Hello and welcome,

    there is no such option in Cinema 4D.

    Depending on what you want to do there may be different alternatives. But why can't you just use a simple script from the script manager?

    Best wishes,
    Sebastian



  • On 27/02/2015 at 07:10, xxxxxxxx wrote:

    Hey Stan,
    you can create a python script that listens to command line arguments given to Cinema 4D. Have a look at the python docs.

    Then you can call Cinema 4D with --nogui and --parallel parameters to make it run in background (CINEMA 4D and the Command Line).



  • On 27/02/2015 at 07:25, xxxxxxxx wrote:

    Well, we want to do some batch conversions and scene modifications on the server, so we do not have to launch CINEMA 4D with GUI at all. It works fine in Blender, but we need to modify C4D files as well. If you cannot call Python script directly, can you open C4D file with python script, which executes itself on scene open event?

    Cheers, Stan



  • On 27/02/2015 at 08:50, xxxxxxxx wrote:

    Hi Satara,

    thanks for a hint, I will try it.

    Stan



  • On 02/03/2015 at 00:21, xxxxxxxx wrote:

    Hi guys,

    thanks for help, I was able to create a script, put it to Plugins folder and launch it from Commandline. It is a bit tricky and has some limitations, but it actually works. It would be really nice idea to have the option of running the script directly from Commandline as you can do in Blender.

    regards, Stan



  • On 05/01/2016 at 11:11, xxxxxxxx wrote:

    Hi

    And how have you done it?

    PS: Yes, running a python script like with every other app would be really nice.


Log in to reply