Copy link to clipboard
Copied
Hi
I have a c++ effect which I'm only using for settings. I would like to be able to add it to a layer and nothing on the layer will change visually. Kind of like a Slider Exp Control, but with more settings.
What would be the simpliest and most processor friendly way of doing that?
I tried to simply not call any prerender and smart render function and leave the render function empty like this. Makes the layer disapear or scrambled.
static PF_Err
Render( PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output)
{
PF_Err err = PF_Err_NONE;
AEGP_SuiteHandler suites(in_data->pica_basicP);
return err;
}
Should I still use the iterate function?
Thanks,
Jakob
there are a few options:
1. you can use AE's utils->Copy() function to copy the input to the output. it's pretty fast.
2. using PF_OutFlag_AUDIO_EFFECT_ONLY should make AE not call your effect for image rendering at all. it will, however call your effect for audio rendering which you'll need to implement (at least copy the input to the output). that should be faster than copying the input image buffer to the output.
3. i remember vaguely that setting the output rect size to either 0 or negavie d
...Copy link to clipboard
Copied
there are a few options:
1. you can use AE's utils->Copy() function to copy the input to the output. it's pretty fast.
2. using PF_OutFlag_AUDIO_EFFECT_ONLY should make AE not call your effect for image rendering at all. it will, however call your effect for audio rendering which you'll need to implement (at least copy the input to the output). that should be faster than copying the input image buffer to the output.
3. i remember vaguely that setting the output rect size to either 0 or negavie during pre-render causes AE to skip the render... can't seem to find the info. i also remember someone here in the forum saying it didn't work for him....
Copy link to clipboard
Copied
Thank you for all the options. Can you be more specific about the "AE's utils->Copy() function"? I realy tried, but I can't figure out how to copy the inData to the outData.
Copy link to clipboard
Copied
i wasn't clear enough. copy the input buffer to the output buffer, not the input/output data.
Copy link to clipboard
Copied
No, it's just me still being a newb at this. Really appreciate your help.
I tried this:
static PF_Err
Render( PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output)
{
PF_Err err = PF_Err_NONE;
PF_Rect srcRect;
AEGP_SuiteHandler suites(in_data->pica_basicP);
srcRect.top = in_data->output_origin_y;
srcRect.left = in_data->output_origin_x;
srcRect.bottom = in_data->output_origin_y+in_data->height;
srcRect.right = in_data->output_origin_x+in_data->width;
PF_EffectWorld* inputP = ¶ms[0]->u.ld;
ERR(suites.PF_WorldTransformSuite1()->copy(inputP, output, srcRect, srcRect));
return err;
}
Is that close or totally wrong? I'm getting an error that PF_WorldTransformSuite1 doesn't exist. How do I get that?
Copy link to clipboard
Copied
looks ok. i don't know why you'd get that error.
try using in_data->utils->copy() instead, or the macro PF_COPY (which is the same, actually)
Copy link to clipboard
Copied
Right. So it should be as simple as this? It still doesn't work, the layers will still be invisible or scrampled.
static PF_Err
Render( PF_InData *in_data,
PF_OutData *out_data,
PF_ParamDef *params[],
PF_LayerDef *output)
{
PF_Err err = PF_Err_NONE;
PF_EffectWorld* inputP = ¶ms[0]->u.ld;
ERR(PF_COPY(inputP, output, NULL, NULL));
return err;
}
Copy link to clipboard
Copied
again, it all looks ok. does the copy function return some error code?
Copy link to clipboard
Copied
In my test aep I deleted the effect from the layers it was on, and then reapplied the effect. And now it works with the code above. So, it does work.
Thanks again.
Copy link to clipboard
Copied
oh, perhaps the bad result was cached. AE had no idea the code has changed so it displayed the previously generated render.
it's a good idea to disable AE's disk caching while developing.
Copy link to clipboard
Copied
Good tip. I'll remember that!