Jump to content

UT_AutoInterrupt is misbehaving

Recommended Posts


I'm working on a big project which uses 3rd party library and I get some strange results if I try to interrupt my nodes. At first i thought that I'm doing something wrong and UT_AutoInterrupt send to callback of this library is not working properly, so I took example node that comes with Houdini SOP_Flatten, removed almost all code from cookMySop() and tried to interrupt it. This is what I get:


There should be only Warning set. But I do get additional Error. And I don't know from where it come from. This is the code I have in cookMySOp():

SOP_Flatten::cookMySop(OP_Context &context)
    OP_AutoLockInputs inputs(this);
    if (inputs.lock(context) >= UT_ERROR_ABORT)
        return error();

    auto progress = UT_AutoInterrupt("");    
    for (auto i = 0; i < 10000; i++)
        if (progress.wasInterrupted())
            this->addWarning(SOP_MESSAGE, "Test interrupted.");
            return error();

        std::cout << "YAY: " << i << "\n";
    return error();

Anybody knows why I do get this additional Error state when interrupting the node?
I'm on H18.0.348.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now