On 14/01/2016 at 09:12, xxxxxxxx wrote:
Cinema 4D Version:
Language(s) : C++ ;
Is there a way to get a command line argument before the rendering process (started with -render)?
Let say I want to add a custom argument to disable all HyperNurbs before rendering:
C4D -nogui -render "scene.c4d" -disable_hn 1
I use PluginMessage() with id == C4DPL_COMMANDLINEARGS to retrieve arguments.
I also have a SceneHookData listening for MSG_MULTI_DOCUMENTIMPORTED in the Message method.
My SceneHookData is correctly called before the render (when the document is loaded) but PluginMessage with id == C4DPL_COMMANDLINEARGS is called after the render.
Thus, I can't access to the command line arguments in the SceneHookData::Message.
And, as the GetCommandLineArgs() is only available for Linux, it is mandatory to use C4DPL_COMMANDLINEARGS to retrieve arguments.
C4D -nogui -render "scene.c4d" -disable_hn 1 Loading project: scene.c4d Debug: SceneHookData::Message: Document imported Rendering frame 0 Progress: 0% Progress: 100% Rendering successful: 1 sec. Debug: GetCommandLineArgs: disable_hn = 1 <- Too late
Do I have to override all the rendering arguments (render, frame, oimage, omultipass, oformat, oresolution, threads) to call a -custom_render which I will process after -disable_hn ?
How do an argument like -take works to be identified before -render?
Thanks for any help in advance!