Skip to main content
FxFactory
Inspiring
August 8, 2024

Plug-ins unable to set value of parameters whose AEGP_DynStreamFlag_HIDDEN flag is set

  • August 8, 2024
  • 8 replies
  • 389 views

After Effects ignores any changes a plugin makes to a parameter’s value during certain commands, if the parameter in question happens to be hidden in the UI by virtue of having its AEGP_DynStreamFlag_HIDDEN flag set.

 

This bug poses a rather big problem for many of our products, since users are never guaranteed that applying one of the built-in presets will succeed. This should be clear by following the Steps to reproduce below.

 

Steps to reproduce:

- Install the most recent version of FxFactory from our website: https://fxfactory.com/download/  

- Download the FxFactory plugin available through this link: https://files.fxfactory.com/beta/aegpdynstreamflaghidden-1.0.0.zip 

- Once the download is complete, unzip the file and double-click it to have the "AEGP_DynStreamFlag_HIDDEN" plugin be ready for testing in After Effects. The product will be visible in FxFactory as such:

- Launch After Effects

- Open an exising Comp, and apply the "AEGP_DynStreamFlag_HIDDEN Bug" plugin found under the "AEGP_DynStreamFlag_HIDDEN" category:

- Notice that the plugin has its own Presets parameter: 

- Each of the two built-in presets has a Thumbnail. That thumbnail shows you what you’re supposed to see once all parameter values in the preset have been applied. Select the first preset, which should cause all three circles to become filled (rather than stroked) and the Add blend mode to be used:

- As the plugin applies the preset, notice that After Effects has only allowed certain parameter value changes to occur. The blend mode has been changed to Add, but the circles are still Stroked:

Why did After Effects ignore some of the changes? After the RYGCB preset is applied, the Shape is still Stroked:

- The bug is therefore as follows: the plugin has set the parameter value for *all* parameters in the preset, making sure to set the PF_ChangeFlag_CHANGED_VALUE flag, but After Effects simply ignores any such changes if the parameter in question happened to be hidden, i.e. if the parameter had its AEGP_DynStreamFlag_HIDDEN flag set to true.

 

Workaround:

No workaround seems to be available. Even if the plugin sets the AEGP_DynStreamFlag_HIDDEN flag to false just before changing the parameter’s value, this is not enough. It appears that AE will only respect the value change if the parameter had been visible prior to to the invocation of our plugin to handle PF_Cmd_EVENT.

 

For comparison, you can try the same exact plugin running in Premiere Pro:

- Locate the same effect:

- Apply it to a clip and select the same preset:

- Notice that in Premiere, all three circles are correctly set to Filled, and the Add blend mode is used.

 

Additional notes:

This problem has been there for a while (first filed through Pre-release website as #3568517).

 

8 replies

FxFactory
FxFactoryAuthor
Inspiring
October 22, 2025

One more post just to help whoever lands here via search, just so I can collect some karma points.

 

The workaround to AE SDK APIs not letting you set a parameter value when hidden, involving AEGP_SetStreamValue, still seems to have negative side effects. Allocating a new PF_Handle, filling it with some data, and setting it as the stream value does seem to cause crashes at a later point in time rather than exactly at the time the API calls are made.

 

But, there are some good news. If the arbitrary parameter already has a handle associated with it, you can call host_resize_handle() via PF_InData, in order to update the handle even when you may have a different amount of data (which was the case in @octaviosa ’s example). Updating / resizing the existing handle found in PF_ParamDef->u.arb_d.value seems to avoid the crashes. Note that the host_resize_handle() API is designed so that it *may* return a different handle than the one passed in. I have no idea under which circumstances it may or may not do that, nor whether this behavior would affect AE’s "crashability" 🙂

 

It would still be far better if – instead of this repeated trial and error – we could have some clear directions from Adobe... knock knock?

FxFactory
FxFactoryAuthor
Inspiring
October 1, 2025

@octaviosa to the best of my knowledge yes, all callbacks are handled correctly and that code has been running for 20+ years with very little modification. Changing the handle associated with ARB parameters has so far been done via the traditional method:

 

    parameter->u.arb_d.value = handle;
    parameter->uu.change_flags |= PF_ChangeFlag_CHANGED_VALUE;

 

And SetStreamValue() seems to work great for value types. Ideally just knowing how to allocate that A_Handle / void * and when to dispose of it, or whether in fact there is a bug that prevents assigning a whole new handle via SetStreamValue().

Inspiring
October 1, 2025

Are you handling PF_Cmd_ARBITRARY_CALLBACK according to your ARB data struct?

FxFactory
FxFactoryAuthor
Inspiring
September 30, 2025

@octaviosa Thanks for posting that 🙂 It’s hard to come to any good conclusions, but something stands out about your code. You are not setting the stream to a new handle. You are just locking the existing handle and updating it with some new data, without changing its size.

From what I could observe, creating a new PF_Handle and assigning it to AEGP_ArbBlockVal will appear to work, but after a few frames or a few times doing so, it will crash AE. Specifically, AE fails an assertion when attempting to find out the size of said PF_Handle... even though my code wasn't disposing of it (and one would imagine that it should, as ownership is transferred to the host?)

 

It might be tempting to say that the workaround is to always reuse and resize the existing handle as necessary, rather than allocating a new one... but what if there was no prior data associated with the parameter?

 

Truly this boils down to needing documentation on:

- Which API we should use to allocate AEGP_ArbBlockVal?

- Should we dispose of said handle immediately after the call to SetStreamValue()?

 

Hopefully this is not a bug in AE that hasn't surfaced all these years because no one is changing the size of the ARB data via AEGP and/or no one is assigning new data where there was previously none.

Inspiring
September 30, 2025

Here, pulled this from an old project:

void SaveSceneData(AEGP_LayerH layer, AEGP_EffectRefH effectRef, const SpecialData &specialData)
{
	AEGP_SuiteHandler suites(picaBasic);

	AEGP_StreamRefH stream;
	suites.StreamSuite2()->AEGP_GetNewEffectStreamByIndex(gpid, effectRef, SpecialParamIndex, &stream);

	A_Time currentTime;
	suites.LayerSuite6()->AEGP_GetLayerCurrentTime(activeLayer, AEGP_LTimeMode_LayerTime, &currentTime);

	AEGP_StreamValue streamVal;
	suites.StreamSuite2()->AEGP_GetNewStreamValue(gpid, stream, AEGP_LTimeMode_LayerTime, &currentTime, true, &streamVal);

	SpecialData *data = reinterpret_cast<SpecialData*>(suites.HandleSuite1()->host_lock_handle((PF_Handle)streamVal.val.arbH));
	*data = specialData;
	suites.HandleSuite1()->host_unlock_handle((PF_Handle)streamVal.val.arbH);

	suites.StreamSuite2()->AEGP_SetStreamValue(gpid, streamVal.streamH, &streamVal);

	suites.StreamSuite2()->AEGP_DisposeStreamValue(&streamVal);
	suites.StreamSuite2()->AEGP_DisposeStream(stream);
}
FxFactory
FxFactoryAuthor
Inspiring
September 24, 2025

Still no solution to this problem, and found one more problem that affects your workaround. 

 

Among the various types of values you can set via AEGP_StreamSuite->AEGP_SetStreamValue(), is 

AEGP_ArbBlockVal, which is a handle, and one would assume it’s the AEGP equivalent of the following operations:

  1. Allocating and filling up a PF_Handle
  2. Assigning the PF_Handle to PF_ParamDef->u.arb_d_value

 

Except that if you look at how AEGP_ArbBlockVal is defined, it's a A_Handle, itself just a fantastic void *. And there is no suggestion as to how you should allocate and populate this A_Handle. I could find no APIs in the SDK to create, lock, dispose of such a handle.

 

I tried passing the PF_Handle alone to AEGP, but this crashes After Effects – not on the exact invocation of AEGP_SetStreamValue, but later and only sometimes, when AE is calling back into the plugin to have that handle copied via PF_Arbitrary_COPY_FUNC. AE is giving a meaninful error, that

in_data->utils->host_get_handle_size() cannot actually determine the size of the handle that has been passed in to PF_Arbitrary_COPY_FUNC as 

PF_ArbParamsExtra->u.copy_func_params.src_arbH.

 

It seems plausible that the PF_Handle passed in to AEGP_SetStreamValue is manipulated by AE under the wrong assumptions, and by the time ARB callbacks are invoked, the plugin is no longer dealing with a working PF_Handle. Only someone with AE’s sources at hand can let us know what’s happening.

 

Incidentally, if you call both AEGP_SetStreamHandle() and assign PF_ParamDef->u.arb_d_value with the same exact PF_Handle, it seems to work, but also makes no sense and feels like relying on behavior that might change tomorrow.

 

@jenkmeister17177426 it would be great if you could answer a couple things:

- How is one supposed to set an ARB parameter’s "blob" via AEGP_SetStreamHandle()? The workaround isn't really complete without this bit of info. There is no information on how to create that A_Handle/AEGP_ArbBlockVal.

- Are there plans to actually fix the original bug? 

 

 

Inspiring
July 14, 2025

And I just lost almost a day of work trying to understand why I couldn't change my parameter... This is almost 1 year old, it should have been resolved by now!

 

As a workaround, if anyone finds himself in the same situation, just use streams.

Community Manager
August 8, 2024

I've logged this into our bug system for investigation.