I can't seem to get LW to call my Activation function for a LWMeshDeformerHandler plugin. Here's the relevant code. Does anyone know what I'm doing wrong. Thanks
Code:
int ActivateMeshDeformer(long version, GlobalFunc * global, LWMeshDeformerHandler * local, void * data)
{
if (version != LWMESHMODIFIER_VERSION)
return AFUNC_BADVERSION;
}
ServerRecord ServerDesc[] =
{
{ LWMESHDEFORMER_HCLASS, pluginName.c_str(), (ActivateFunc*)ActivateMeshDeformer },
{ nullptr }
};
m->lw->util.applyPlugin(itemState.lwItemID, LWMESHDEFORMER_HCLASS, pluginName);
// applyPlugin
void LW::applyPlugin(LWItemID item, const std::string& pluginClass, const std::string& pluginName)
{
const char* plugName = itemInfo_->server(item, pluginClass.c_str(), 1);
if (!plugName)
{
std::string id = ToString<LWItemID>(item);
std::string addPlugin("ApplyServerByItemID ");
addPlugin += id + " " + pluginClass + " " + pluginName;
runCmd_(addPlugin.c_str());
}
}