On 04/11/2014 at 13:28, xxxxxxxx wrote:
You can't add commandline parameters there.
All you can do, is parse the given args. And you are right argv is an array. argc provides you with the size of the array (depending on the number of arguments passed by the user). Then you can run over the array and do string comparisons for parameters and arguments. Just like varargs...This is from R15 SDK examples (in main.cpp) :
case C4DPL_COMMANDLINEARGS:
//sample implementation of command line rendering:
//void CommandLineRendering(C4DPL_CommandLineArgs* args);
//CommandLineRendering((C4DPL_CommandLineArgs* )data);
//react to this message to react to command line arguments on startup
{
C4DPL_CommandLineArgs *args = (C4DPL_CommandLineArgs* )data;
Int32 i;
for (i=0;i<args->argc;i++)
{
if (!args->argv[i]) continue;
if (!strcmp(args->argv[i],"--help") || !strcmp(args->argv[i],"-help"))
{
// do not clear the entry so that other plugins can make their output!!!
GePrint("\x01-SDK is here :-)");
}
else if (!strcmp(args->argv[i],"-SDK"))
{
args->argv[i] = nullptr;
GePrint("\x01-SDK executed:-)");
}
else if (!strcmp(args->argv[i],"-plugincrash"))
{
args->argv[i] = nullptr;
*((Int32* )0) = 1234;
}
}
}
break;
So the real question seems to be, how to load a layout from within your plugin, right?
I need to learn it myself first. I'll keep you updated.