I want a gizmo/group to error in certain circumstances (based on something happening in knobChanged callback, most likely)

Normally I'd do this by having an Assert node just before Output, and give it an expression like so:

[string length [value parent.errormsg]] == 0

..then set the hidden "errormsg" knob to something (or clear it)

This works fine for a node which outputs an image.. but the node can output anything (2D/deep/3D), while the Assert node forces the output ot be a 2D op (meaning the group cannot output, say, a camera)


So, my plan was to create a node like the NoOp, which calls the Op::error() with a supplied string.. but I'm not sure how to go about creating a NoOp like node. Just inheriting from Op seems like the right starting point, but I'm not sure what else I need to do to make it connectible to "anything"?


#include "DDImage/Op.h"
#include "DDImage/Description.h"

using namespace DD::Image;


static const char* const CLASS = "Errorify";
static const char* const HELP = "...";


class Errorify : public Op
{
public:
    Errorify(Node* node)
        : Op(node)
    {
    }

    void _validate(bool for_real)
    {
        error("Testing!");
    }

    static const Op::Description d;
    const char* Class() const { return d.name; }
    const char* node_help() const { return HELP; }
};



static DD::Image::Op* build(Node* node) { return new Errorify(node); }
const Op::Description Errorify::d(CLASS, 0, build);


--
ben dickson
2D TD | [email protected]
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to