Help Creating a NULL in SDK
Hi gang;
So I need to create a Null layer from within my plugin, and link a point parameter to it. I've never done this before but my understanding is that it needs to be done via Javascript. I thought I had the creation part done but it crashes upon execution. This is what I have:
AEGP_SuiteHandler suites(in_data->pica_basicP);
A_Boolean outAvailablePB;
AEGP_MemHandle outResultPH;
AEGP_MemHandle outErrorStringPH;
const char* javascriptCode =
"var comp = app.project.activeItem;\r\n"
"comp.layers.addNull();\r\n";
ERR(suites.UtilitySuite4()->AEGP_IsScriptingAvailable(&outAvailablePB));
ERR(suites.UtilitySuite4()->AEGP_ExecuteScript(NULL, javascriptCode, true, &outResultPH, &outErrorStringPH));
A_char* result = NULL;
ERR(suites.MemorySuite1()->AEGP_LockMemHandle(outResultPH, reinterpret_cast<void**>(&result)));
ERR(suites.MemorySuite1()->AEGP_FreeMemHandle(outResultPH));
ERR(suites.MemorySuite1()->AEGP_FreeMemHandle(outErrorStringPH));
Any suggestions as to what is wrong here?
I haven't done the linking part but I have a question about that too. Is that a separate javascript command that must be sent after creating the Null or can it be combined together with the Null creation?
Thanks in advance.
Richard
