How to get effect's parameters in AEGP?
Hi all,
I have a problem when I want to export the parameters from the effect.
(I have checked the sample project "ProjDumper". )
Yellow: layer
Red: one of the effect (Text)
Green: the params of the effect (I want to export those values).

Following is my code:
// 1. use a loop to find the "Text" effect
// 2. get all the params from this effect
A_long iL = 0;
A_long jL = 0;
A_long num_effectsL;
A_long num_paramsL;
A_char effect_nameC[30] = {'\0'};
AEGP_StreamRefH streamH = NULL;
AEGP_EffectRefH effectH = NULL;
PF_ParamType param_type;
PF_ParamDefUnion param_union;
// Get number of effects on this layer
ERR(Suites.EffectSuite2()->AEGP_GetLayerNumEffects(pLayerHandle, &num_effectsL));
for (iL = 0; iL < num_effectsL; iL++)
{
ERR(Suites.EffectSuite2()->AEGP_GetLayerEffectByIndex(g_PluginID, pLayerHandle, iL, &effectH));
if (effectH)
{
AEGP_InstalledEffectKey key;
ERR(Suites.EffectSuite2()->AEGP_GetInstalledKeyFromLayerEffect(effectH, &key));
ERR(Suites.EffectSuite2()->AEGP_GetEffectName(key, effect_nameC));
if (!strcmp(effect_nameC, "Text"))
{
// Get number of effect parameters from Text effect
ERR(Suites.StreamSuite2()->AEGP_GetEffectNumParamStreams(effectH, &num_paramsL));
for (jL = 1; jL < num_paramsL; ++jL) // start at 1 to skip initial layer param
{
ERR(Suites.EffectSuite3()->AEGP_GetEffectParamUnionByIndex(g_PluginID, effectH, jL, ¶m_type, ¶m_union));
switch (param_type)
{
case PF_Param_POPUP:
break;
case PF_Param_SLIDER:
break;
case PF_Param_COLOR:
break;
case PF_Param_CHECKBOX:
break;
default:
break;
}
}
ERR2(Suites.EffectSuite2()->AEGP_DisposeEffect(effectH));
break;
}
}
}
In the SDK document, it says the value of PF_ParamDefUnion should not be used.
So, how can I obtain those params in the effect I set (the green line in the picture)?
And, If there is any wrong of my logic, please let me know.
Thanks.