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.