Does anyone know how can I get velocity parameter?
I tried as follows. However, the error sometimes AEGP_GetLayerStreamValue ruturn "error 512".The problem occurs if the expression is used.
Code:
A_Err err = A_Err_NONE,err2 = A_Err_NONE;
A_Time timeT;
A_FpLong fps;
AEGP_CompH compH = NULL;
AEGP_LayerH layerH = NULL;
AEGP_LTimeMode LTimeMode = AEGP_LTimeMode_CompTime;
AEGP_SuiteHandler suites(in_data->pica_basicP);
ERR(suites.PFInterfaceSuite1()->AEGP_GetEffectLayer( in_data->effect_ref, &layerH));
ERR(suites.LayerSuite5()->AEGP_GetLayerCurrentTime(layerH, LTimeMode, &timeT));
ERR(suites.LayerSuite5()->AEGP_GetLayerParentComp(layerH, &compH));
ERR(suites.CompSuite6()->AEGP_GetCompFramerate(compH,&fps));
timeT.value = (timeT.value * A_u_long(fps) / timeT.scale) - 1;
if(timeT.value < 0) timeT.value = 0;
timeT.scale = A_u_long(fps);
AEGP_StreamVal val;
AEFX_CLR_STRUCT(val);
ERR(suites.StreamSuite2()->AEGP_GetLayerStreamValue(layerH,
AEGP_LayerStream_POSITION,
LTimeMode,
&timeT,
FALSE,
&val,
NULL));