Hey guys. I have a couple of questions.
1. SEQUENCE DATA. I read on this forum that the sequence data is not added to the undo/redo stack. Is that true, or is there any way to do that? I tried many different ways, including making changes inside the undo group, but I failed.
2. ARBITRARY PARAMETER. If there's no way to add the sequence data to the undo/redo stack I have a question about the arbitrary parameters, because I don't really get them.
2.1 I added an arbitrary parameter like this (is it a correct way to do that?):
AEFX_CLR_STRUCT(def);
PF_ADD_ARBITRARY2("Data",
0,
0,
0,
PF_PUI_NO_ECW_UI,
0,
global_data_id,
0);
2.2 Do I have to add any flags to the global setup to inform my plugin that I use arbitrary parameter? I added this code to my EntryPointFunc:
case PF_Cmd_ARBITRARY_CALLBACK:
err = HandleArbitrary(in_data,
out_data,
params,
output,
reinterpret_cast<PF_ArbParamsExtra*>(extra));
break;
but it's never called, that's why I asked about the flags.
2.3 Read/write to arbitrary. I created this structure, my arbitrary parameter was created to be an array of chars:
typedef struct
{
char data[1000];
} arbDataStruct;
I write data to the arbitrary parameter like this:
PF_Err err = PF_Err_NONE;
AEGP_SuiteHandler suites(in_data->pica_basicP);
PF_Handle arbH = suites.HandleSuite1()->host_new_handle(sizeof(arbDataStruct));
arbDataStruct *arbData = reinterpret_cast<arbDataStruct*>(PF_LOCK_HANDLE(arbH));
if (!arbData)
{
printf("setArbData out of memory\n");
err = PF_Err_OUT_OF_MEMORY;
}
else strcpy(arbData->data, "lol");
PF_UNLOCK_HANDLE(arbH);
and read it like this:
PF_Err err = PF_Err_NONE;
AEGP_SuiteHandler suites(in_data->pica_basicP);
PF_Handle arbH = suites.HandleSuite1()->host_new_handle(sizeof(arbDataStruct));
arbDataStruct *arbData = reinterpret_cast<arbDataStruct*>(PF_LOCK_HANDLE(arbH));
if (!arbData)
{
printf("getArbData out of memory\n");
err = PF_Err_OUT_OF_MEMORY;
}
PF_UNLOCK_HANDLE(arbH);
All I get is junk from the memory...
Could you guys help me with that? Thanks in advance!
Dave