Copy link to clipboard
Copied
Hi. I have a gradient arb param, and whenever a user deletes a colour I want to delete it from every keyframe. I modify all keyframes like this:
if(numKeyframesL)
{
AEGP_StreamValue tmpValP;
for(int i = 0; i < numKeyframesL; i++)
{
AEFX_CLR_STRUCT(tmpValP);
ERR(suites.KeyframeSuite3()->AEGP_GetNewKeyframeValue(NULL, stream_handle, i, &tmpValP));
GR_ArbData *tmpArbP = reinterpret_cast<GR_ArbData*>(suites.HandleSuite1()->host_lock_handle(PF_Handle(tmpValP.val.arbH)));
AEFX_CLR_STRUCT(tmpArbP->sliders[whichIndexL]); // clear this colour element
ERR(suites.KeyframeSuite3()->AEGP_SetKeyframeValue(stream_handle, i, &tmpValP)); // set the keyframe
suites.HandleSuite1()->host_unlock_handle(PF_Handle(tmpValP.val.arbH));
if(tmpValP.streamH)
{
ERR2(suites.StreamSuite2()->AEGP_DisposeStreamValue(&tmpValP));
}
}
}
On keyframes the result is correct, however in the tween frames the old colour remains. I'm trying to figure out if this is an interp issue, compare issue, or issue with how I'm setting the keyframes. Any ideas?
When I add a new colour element, I do the same process (add the new colour to every keyframe) and it works well. So I'm a bit bamboozled. Thanks.
Copy link to clipboard
Copied
while you are bamboozled, i am befuddled.
i honestly don't know why it would do that. (unless your arb "equal" function always returns "true")
i think you could force solve the problem by feeding the color value in the GuidMixInPtr() function. this will ensure old cached frames won't be used for the in between frames.
Copy link to clipboard
Copied
I had arb compare always returning "not equal" to try and force it to update haha, but thanks for the idea re guid ptr.
I ended up separating things that can't be interpolated into their own discrete params that can't vary so I can set a single stream value and not need to worry about updating all keyframes.
A tricky thing about arb params is there are so many ways to work with params: