When creating a Custom DAT Operator in C++ and adding a menu parameter, as such:
void CustomDAT::setupParameters(OP_ParameterManager* manager, void* reserved)
{
{
OP_StringParameter sp;
sp.name = "Shape";
sp.label = "Shape";
sp.defaultValue = "Sine";
const char* names[] = { "Sine", "Square", "Ramp" };
const char* labels[] = { "Sine", "Square", "Ramp" };
OP_ParAppendResult res = manager->appendMenu(sp, 3, names, labels);
assert(res == OP_ParAppendResult::Success);
}
}
And also requiring the DAT to cook every frame, as such:
void CustomDAT::getGeneralInfo(DAT_GeneralInfo* ginfo, const OP_Inputs* inputs, void* reserved)
{
ginfo->cookEveryFrame = true;
}
There is some weird behaviour in the selection of the active menu item in TD. The menu parameter technically does work and returns the correct value with:
inputs->getParString("Shape")
But the active selection is not properly represented in the UI. It does show as selected in the dropdown, but not in the selection box:
I’m not sure if the behaviour is the same with other operator types, but for the DAT it’s fixed when not requiring to cook every frame.
Please find a sample project below:
DAT.zip (17.8 KB)