• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

SDK Render layer as is

Engaged ,
May 11, 2023 May 11, 2023

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

TOPICS
SDK

Views

580

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , May 11, 2023 May 11, 2023

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

...

Votes

Translate

Translate
Community Expert ,
May 11, 2023 May 11, 2023

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....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 11, 2023 May 11, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 11, 2023 May 11, 2023

Copy link to clipboard

Copied

i wasn't clear enough. copy the input buffer to the output buffer, not the input/output data.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2023 May 12, 2023

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 = &params[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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2023 May 12, 2023

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)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2023 May 12, 2023

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 = &params[0]->u.ld;

	ERR(PF_COPY(inputP, output, NULL, NULL));

	return err;
}

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2023 May 12, 2023

Copy link to clipboard

Copied

again, it all looks ok. does the copy function return some error code?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2023 May 12, 2023

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 12, 2023 May 12, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 12, 2023 May 12, 2023

Copy link to clipboard

Copied

LATEST

Good tip. I'll remember that!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines