Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    start rendering in pictureviewer via script

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 250 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 23/09/2015 at 05:55, xxxxxxxx wrote:

      i want to start a rendering without a mouseclick on a remote maschine.

      to archived that i wrote a script which is able to call c4d like:

      ('"C:\Program Files\MAXON\CINEMA 4D R16\CINEMA 4D.exe" -render "'+c4d+'"')

      were c4d = the c4d file

      but i need to see the progress in the picture viewer. is there a sneaky way to get my desired results?

      an alternative is to use the autostart python thing for it.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 24/09/2015 at 07:08, xxxxxxxx wrote:

        Hi,

        I don't think Commandline Renderer has such an option.
        But the "autostart python thing" can be used for it. Simply introduce your own commandline option, like so:

        import sys
        import c4d
          
        def PluginMessage(id, data) :
          if id == c4d.C4DPL_COMMANDLINEARGS:
            for arg in sys.argv:
              if arg.find("-render2pv") == 0:
                argComponents = arg.split(' ')
                c4d.documents.LoadFile(argComponents[1])
                c4d.CallCommand(12099, 12099)
                break
          return True
        

        I suggest to create an render2pv folder in your plugins folder. Then store the above code in a render2pv.pyp file into this folder.
        Then you can call Cinema 4D like so:
        C:\Program Files\MAXON\CINEMA 4D R16\CINEMA 4D.exe "-render2pv myscenefile.c4d"
        Just note, that I wrote the commandline parsing so that you have to pass -render2pv and the scenefile as one argument, thus the quotation marks. Because otherwise C4D would load the scene file automatically and then you run into problems, because C4D will load the file after this code and you'll end up with a requester asking if the identical file should be loaded again.
        Only remaining drawback, there will be a warning about the unknown commandline argument in the console.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 26/09/2015 at 02:10, xxxxxxxx wrote:

          yay this is a quite neat solution for that!

          thank you!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post