I model the function base off the code in specular_node.c and had the same result. It would very nice to have a full example, especially since I model part of code from LW SDK.
I did clone the get and set methods from specular_node.c and had the same results.
Yes inst->vSeed1 is LWVParamID.
LWXPanelID get_xPanel(iMultiRand *inst)
{
static LWXPanelControl xctl[] =
{
{ ID_SEED1, "Seed1", "float-env", },
{ ID_SEED2, "Seed2", "float-env", },
{ ID_SEEDINT, "SeedInt", "float-env", },
{ ID_SEEDFACTOR, "SeedFactor", "float-env", },
{ ID_LOWRANGE1, "LowRange1", "float-env", },
{ ID_HIGHRANGE1, "HighRange1", "float-env", },
{ ID_LOWRANGE2, "LowRange2", "float-env", },
{ ID_HIGHRANGE2, "HighRange2", "float-env", },
{ ID_LOWRANGE3, "LowRange3", "float-env", },
{ ID_HIGHRANGE3, "HighRange3", "float-env", },
{ ID_LOWRANGE4, "LowRange4", "float-env", },
{ ID_HIGHRANGE4, "HighRange4", "float-env", },
{ 0 }
};
static LWXPanelDataDesc xdata[] =
{
{ ID_SEED1, "Seed1", "float-env", },
{ ID_SEED2, "Seed2", "float-env", },
{ ID_SEEDINT, "SeedInt", "float-env", },
{ ID_SEEDFACTOR, "SeedFactor", "float-env", },
{ ID_LOWRANGE1, "LowRange1", "float-env", },
{ ID_HIGHRANGE1, "HighRange1", "float-env", },
{ ID_LOWRANGE2, "LowRange2", "float-env", },
{ ID_HIGHRANGE2, "HighRange2", "float-env", },
{ ID_LOWRANGE3, "LowRange3", "float-env", },
{ ID_HIGHRANGE3, "HighRange3", "float-env", },
{ ID_LOWRANGE4, "LowRange4", "float-env", },
{ ID_HIGHRANGE4, "HighRange4", "float-env", },
{ 0 }
};
static LWXPanelHint xhint[] =
{
XpLABEL(ID_SEED1, "Seed1"),
XpRANGE(ID_SEED1, 0, 255, 1 ),
XpLABEL(ID_SEED2, "Seed2"),
XpRANGE(ID_SEED2, 0, 255, 1 ),
XpLABEL(ID_SEEDINT, "SeedInt"),
XpRANGE(ID_SEEDINT, 0, 255, 1 ),
XpLABEL(ID_SEEDFACTOR, "SeedFactor"),
XpRANGE(ID_SEEDFACTOR, 0, 255, 1 ),
XpLABEL(ID_LOWRANGE1, "LowRange1"),
XpLABEL(ID_HIGHRANGE1, "HighRange1"),
XpLABEL(ID_LOWRANGE2, "LowRange2"),
XpLABEL(ID_HIGHRANGE4, "HighRange2"),
XpLABEL(ID_LOWRANGE3, "LowRange3"),
XpLABEL(ID_HIGHRANGE3, "HighRange3"),
XpLABEL(ID_LOWRANGE4, "LowRange4"),
XpLABEL(ID_HIGHRANGE4, "HighRange4"),
XpGROUP_(TG_SEED),
XpH(ID_SEED1),
XpH(ID_SEED2),
XpH(ID_SEEDINT),
XpH(ID_SEEDFACTOR),
XpH(0),
XpGROUP_(TG_RAN1),
XpH(ID_LOWRANGE1),
XpH(ID_HIGHRANGE1),
XpH(0),
XpGROUP_(TG_RAN2),
XpH(ID_LOWRANGE2),
XpH(ID_HIGHRANGE2),
XpH(0),
XpGROUP_(TG_RAN3),
XpH(ID_LOWRANGE3),
XpH(ID_HIGHRANGE3),
XpH(0),
XpGROUP_(TG_RAN4),
XpH(ID_LOWRANGE4),
XpH(ID_HIGHRANGE4),
XpH(0),
XpCHGNOTIFY(ui_chgnotify),
XpDESTROYNOTIFY(ui_destroynotify),
XpEND
};
LWXPanelID panel;
if(panel = xpanf->create(LWXP_VIEW, xctl))
{
xpanf->hint(panel, 0, xhint);
xpanf->describe(panel, xdata, ui_get, ui_set);
xpanf->viewInst(panel, inst);
xpanf->setData(panel, 0, inst);
}
return panel;
}