Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set an expression 'thisLayer.time' as a default value for Time property #4

Open
baku89 opened this issue Aug 10, 2022 · 0 comments
Open

Comments

@baku89
Copy link
Owner

baku89 commented Aug 10, 2022

As discarding the 'Use Layer Time' checkbox,
it'd be useful if the remaining 'Time' slider automatically refers the layer time that the effect is applied.

Since PF_AD_PARAM only supports non-expression values as a default,
I tried to use AEGP suites to modify a parameter like the below code at the timing PF_Cmd_SEQUENCE_SETUP has called:

// Set the default expression to parameters
AEGP_EffectRefH effectH = NULL;
AEGP_StreamRefH streamH = NULL;

ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(G_my_plugin_id, in_data->effect_ref, &effectH));
ERR(suites.StreamSuite5()->AEGP_GetNewEffectStreamByIndex(G_my_plugin_id, effectH, FILTER_TIME_ID, &streamH));
ERR(suites.StreamSuite2()->AEGP_SetExpressionState(G_my_plugin_id, streamH, true));
ERR(suites.StreamSuite2()->AEGP_SetExpression(G_my_plugin_id, streamH, "thisLayer.time"));
    
if (effectH) ERR(suites.EffectSuite3()->AEGP_DisposeEffect(effectH));
if (streamH) ERR(suites.StreamSuite2()->AEGP_DisposeStream(streamH));    

But it raises an error, which says ”internal verification failure, sorry! {child not found in parent} (20::0)”.
Does any guru know how to handle this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant