Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Arb interpolation issue

Contributor ,
May 17, 2021 May 17, 2021

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.

TOPICS
SDK

Views

124

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 17, 2021 May 17, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
May 19, 2021 May 19, 2021

Copy link to clipboard

Copied

LATEST

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:

  • access the value via params array (has to be at the current time, read only)
  • checkout the param value (can be any time, still can't set it)
  • get the stream and modify the struct manually (can get value at any time, can set it)
  • use SetStream (says it's illegal if keyed, but seems it's still possible)
  • get the keys and set them

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines