Skip to main content
Inspiring
November 9, 2023
Question

Premiere doesn't handle SeqData Flattening properly like AE does

  • November 9, 2023
  • 2 replies
  • 741 views

Hi there,

 

I believe I have found a bug in Premiere. In our plugin, we store a part of sequence data on the heap and have a pointer to it in sequence data. We implement FLATTEN commands to save this to disk, which works great in AE.

 

However, in Premiere, the FLATTEN command is never sent, unless during the session the user has clicked on the UI (CUI or a button). If not, then when the project is saved and closed, instead of giving us a flatten command, Premiere saves the unflat sequence data to disk as if it didn't need flattening. Then, when we re-open the project and it calls SEQUENCE_RESETUP, the stuff that was on the heap is now junk data, and reading from it sometimes gives a bad access error (which crashes Premiere).

 

This really seems like a bug to me, but maybe I'm doing something wrong. I set

PF_OutFlag_SEQUENCE_DATA_NEEDS_FLATTENING, 

PF_OutFlag2_PPRO_DO_NOT_CLONE_SEQUENCE_DATA_FOR_RENDER, and 

PF_OutFlag2_SUPPORTS_GET_FLATTENED_SEQUENCE_DATA

in GlobalSetup.

 

To reiterate- we do get a flatten command (GetFlattenedSequenceData) if we have clicked on the plugin's UI during the session. Then it flattens fine and works great. The only problem is when we don't click on the plugin's UI during the session - in that case, any data we had stored on the heap is lost/not saved to the project file.

 

Also, removing PF_OutFlag2_SUPPORTS_GET_FLATTENED_SEQUENCE_DATA alone or removing it and PF_OutFlag2_PPRO_DO_NOT_CLONE_SEQUENCE_DATA_FOR_RENDER (which we need anyway since we have a really slow Resetup) didn’t make a difference.

 

Also, it's not just this plugin- I could recreate this with the 2023 SDK's HistoGrid example - again, in Premiere, we only get a FLATTEN command if the user has clicked on the UI since the last save, while in AE we get a FLATTEN command every time we save the project.

 

Any help would be greatly appreciated.

 

Thanks!

Jonah

This topic has been closed for replies.

2 replies

bbb_999
Community Manager
Community Manager
November 10, 2023

>...the FLATTEN command is never sent, unless during the session the user has clicked on the UI (CUI or a button).

What do you do to your sequence data, while responding to UI clicks? 

jonah.c.lAuthor
Inspiring
November 10, 2023

We do nothing to sequence data when responding to UI clicks. We do modify sequence data in SEQUENCE_RESETUP and EVENT->DRAW, but neither of those things trigger Premiere to treat sequence data as if it needs flattening on save.

 

So to me it seems Premiere is not monitoring whether we modified sequence data during the session, it's simply looking at "did the user click on the UI this session?" and if not, treat the sequence data as if it doesn't need flattening. Again, this is reproducible with the AE SDK example HistoGrid (which uses pointers in seqData/flattening and unflattening), it's not just our plugin.

bbb_999
Community Manager
Community Manager
November 10, 2023

I'm looking at HistoGrid; it doesn't do a lot of flattening. 

 

 

static PF_Err
SequenceFlatten(
				PF_InData		*in_data,
				PF_OutData		*out_data,
				PF_ParamDef		*params[],
				PF_LayerDef		*output)
{
	PF_Err		err = A_Err_NONE;
	
	if (in_data->sequence_data)
	{
		out_data->sequence_data = in_data->sequence_data;
	}
	
	return err;
}

 

 

  
I also see that, for all draw or click events, HistoGrid unflattens its sequence data: 

 

 

static PF_Err 
HandleEvent(
	PF_InData		*in_data,
	PF_OutData		*out_data,
	PF_ParamDef		*params[],
	PF_LayerDef		*output,
	PF_EventExtra	*extra)
{

	PF_Err			err 	= PF_Err_NONE;
	
	AEGP_SuiteHandler	suites(in_data->pica_basicP);
	
	if (in_data->sequence_data == NULL &&
		(extra->e_type == PF_Event_DO_CLICK ||
		 extra->e_type == PF_Event_DRAW)) {
			err = SequenceResetup(in_data, out_data, params);
                        //...
		}
	

 

 

 

Does your plugin 'inflate' its sequence data, in response to (both draw and click) event calls?

Community Expert
November 10, 2023

I asked the adobe dev team. either they'll chime in back here, or i'll let you know what they said.