Houdini Solaris Custom HDK

Hi Team ,

I have a question , I’ve build a custom hdk lop that read from two inputs , when I read from second inputs

Ive used this way

OP_Node *   second_node = getInput(1);
UT_String   path;
HUSD_AutoReadLock        readlock(getLOPNode(path)->getCookedDataHandle(context));

but this is required to recook the node every time there is any update happened from input 2

my question, is there any way two read from second inputs without need to recook ?

That’s a very round-about way of doing things :slight_smile: But given the complete lack of documentation on how to write a LOP node it is perfectly understandable… To quickly answer your question, no, there is no way to read from any LOP node without cooking it. But Houdini nodes are pretty smart. If they haven’t changed, and their inputs haven’t changed, then they won’t actually recook, they’ll just return their last cooked result. If they did change, then you probably want the node to recook, so it’s good that it does…

So with that out of the way, to access the data from a secondary input, you’ll want to do something like this:

    OP_AutoLockInputs    auto_lock_inputs(this);
    if (auto_lock_inputs.lockInput(1, context) >= UT_ERROR_ABORT)
        return error();
    const HUSD_DataHandle &datahandle = lockedInputData(context, 1);
    HUSD_AutoReadLock readlock(datahandle);
    // Read from the stage.

Hope that helps,

1 Like

Thanks Mark that’s help a lot