Skip to main content
Inspiring
January 4, 2022
Answered

changing a plugin parameter doesn't invalidate cached frames

  • January 4, 2022
  • 1 reply
  • 1464 views

Dear AE fellows,

I have the following peculiar problem,

as is stated in the title, changing the essential parameter of the plugin (changing the text of the animated inscription) the cached frames are not invalidated. The keep accumulating in the RAM.

 

I checked that changing the parameter, the "PF_Cmd_USER_CHANGED_PARAM" does get  triggered.

In this callback I save the new inscription text  in sequenceData. When the render function is called it gets this newly saved text from the saved sequenceData.

 

Do you have some idea of what could be the reason for such a behavior?

 

Yaroslav.

 

This topic has been closed for replies.
Correct answer shachar carmi

THanks for suggestion.

I made a 110 sec video demonstration of the problem.

Here it is:

 

https://youtu.be/QN_Acadu3xM


excellent! that makes it a lot more clear!

 

from what i see in the video, that's actually the normal AE behaviour. the comp render cache is invalidated and the dispalyed resolt is correct.

however, AE doesn't release the ram of the previously cached frames. that too is the normal AE behavior. AE keeps old results around in case the user undoes the changes, until it needs the ram for something else.

 

repeat this experiment, but then purge AE's ram. you'll see it drop back to the original level. that would validate that teh ram accumulation is AE's choice and not some memory leak.

1 reply

Community Expert
January 4, 2022

chanigng text? is it an arb param?

if so, perpas it's a matter if implementing the arb compare function correctly.

Inspiring
January 4, 2022

I don't think it is an arb param.

It is impemented as follows:

case PF_Cmd_USER_CHANGED_PARAM:
err = HandleEvent(in_data, out_data, params, output, reinterpret_cast<const PF_UserChangedParamExtra*>(extra));
    break;

Then the HandleEvent is implemented with opening of a script text input window:

static PF_Err HandleEvent(
	PF_InData* in_data,
	PF_OutData* out_data,
	PF_ParamDef* params[],
	PF_LayerDef* output, const PF_UserChangedParamExtra* which_hitP)
{
	AEGP_SuiteHandler		suites(in_data->pica_basicP);
         ...
	if (which_hitP->param_index == SKELETON_FLAVOR)
	{
	 ....	
	}
	else
	{
      std::string  script = "prompt('Enter your text ', '" + current_text + "', '');";
		AEGP_MemHandle nameHandle = NULL;
		suites.UtilitySuite5()->AEGP_ExecuteScript(NULL, script.c_str(), true, &nameHandle, NULL);
		AEGP_MemSize size = 0;
		A_UTF16Char* namePointer = NULL;

		suites.MemorySuite1()->AEGP_LockMemHandle(nameHandle, (void**)&namePointer);
		suites.MemorySuite1()->AEGP_GetMemHandleSize(nameHandle, &size);

		char* res3 = (char*)namePointer;
		std::string res4(res3);
		global_string = res4;
		sequenceSetup(in_data, out_data, res4, current_font, false);
		out_data->out_flags = out_data->out_flags | PF_OutFlag_FORCE_RERENDER;
	}
	return err;
}

At the end I PF_OutFlag_FORCE_RERENDER

Community Expert
January 4, 2022

then what sort of param is it?

is the supervision flag set for that param during param setup?