After Effects SDK: GetUniqueStreamID returns 0 — safe native keyframe access from custom UI callbacks?
Hi,
I'm developing a native After Effects effect with a custom Effect Controls UI. I need to access the exact native parameter streams belonging to the effect instance receiving a custom UI event, so I can implement stopwatch, keyframe diamond, previous/next-key and expression-aware controls safely.
Environment: After Effects 26.5.0.89, macOS arm64, SDK 25.6.
Using AEGP_StreamSuite6 (kAEGPStreamSuiteVersion6 == 11), AEGP_GetUniqueStreamID(AEGP_StreamRefH, int32_t*) repeatedly returns A_Err_NONE but explicitly writes 0 for distinct effect parameter streams and even built-in layer Opacity.
We confirmed this using two nonzero output sentinels and surrounding canaries. Across DRAW, multiple stream-acquisition routes, duplication/reordering and a separate AEGP command/idle test, 7,652 successful calls returned zero.
Stream values remain readable, and acquired references are disposed within their callbacks. I'm not assuming this behavior occurs in all AE versions.
Ordinary value edits work through the current PF callback's params[index]. However, the installed SDK documents PFInterface / AEGP_GetNewEffectForEffect availability in FRAME_SETUP, RENDER and EVENT/DRAW, not DO_CLICK/DRAG/KEYDOWN. PF_ParamUtilsSuite3 permits some current-effect keyframe inspection but does not provide native key insertion/deletion or expression-state inspection.
My questions:
-
Is
GetUniqueStreamIDexpected to distinguish these streams? Are there additional preconditions, a known issue or a fixed AE version? -
What supported API allows obtaining the exact current effect and parameter streams during custom UI input callbacks, for fresh expression checks and native keyframe operations?
-
What identity/lifetime guarantees apply across effect duplication, reordering, deletion/Undo and project reload? Can stream IDs be reused?
-
What SDK-supported pattern is recommended for custom stopwatch, diamond and previous/next-key controls on existing native effect parameters?
I'd prefer a supported current-callback solution rather than introducing sequence GUIDs, hidden parameters or a separate AEGP mediator.
I can provide a minimal read-only reproducer and logs if helpful.
Thanks!
