Currently I have this:
#include <OP/OP_OTLLibrary.h> #include <OP/OP_OperatorTable.h> #include <OP/OP_Network.h> void readDialogScript(const char* hdaPath) { OP_OTLLibrary lib(hdaPath, ""); // hdaPath == "Something.hda" UT_String table_name, op_name; OP_OperatorTable* table; OP_Operator* op; for (int i = 0; i < lib.getNumDefinitions(); i++) { table_name = lib.getDefinitionOpTableName(i); // table_name == "Sop" table = OP_Network::getOperatorTable(table_name); // table == nullptr. WHY?? op_name = lib.getDefinitionName(i); // op_name == "Something" op = table ? table->getOperator(op_name) : NULL; // op stays nullptr since table is nullptr // check if the library does indeed define this op; // it may be that some other library that does. if (op && &lib != op->getOTLLibrary()) continue; // Crashes because table is nullptr (but should not be). auto& inputLabels = op->getInputLabels(); auto& outputLabels = op->getOutputLabels(); auto* templates = op->getParmTemplates(); } }
I took most of this from HDK doc about HDA. [www.sidefx.com]
I'm using Houdini 18.5.
I don't understand why I'm getting a nullptr when calling OP_Network::getOperatorTable.
This is not mentioned in the docs.
I would want to get to the point where I can call getInputLabels/getOuputLabels on my OP_Operator variable to read the inputs and outputs of my HDA.
Or is it not the right way to achieve this?
Thanks!