Hi all,

For a project I'm working on, I'm experimenting with making a custom render
with deep output,
similar the the ScanLine renderer.

Unfortunately, Nuke 7 does not recognize my Render subclass as a DeepOp. I
cannot connect
the output of my render node to any other deep node.

I was looking for any example that implemented both the Iop and DeepOp
interfaces,
but I couldn't find any.

Is there anything I'm missing?

Thank you!

Esteban.

Here's my code so far:

-----------------------------------------------

#include<iostream>

#include<DDImage/Render.h>
#include<DDImage/DeepOp.h>
#include<DDImage/NukeWrapper.h>

using namespace DD::Image;

class TestRender : public  Render, public DeepOp
{
public:

    static const Iop::Description description;

    static Iop *build( Node *node)
    {
        return new NukeWrapper( new TestRender( node));
    }

    static const char *HELP;

    const char *Class() const { return description.name;}

    const char *node_help() const { return HELP;}

    int minimum_inputs() const { return 3;}
    int maximum_inputs() const { return 3;}

    const char *input_label( int input, char *buffer) const
    {
        switch( input)
        {
            case 0:
            case 1:
            case 2:
                return "input";
        }

        return 0;
    }

    bool test_input( int index, Op *op) const
    {
        return true;
    }

    virtual Op *op() { return this;}

    virtual GeoOp *render_geo( int sample) { return 0;}

protected:

    // Common interface

    virtual void _open()
    {
        std::cout << "_open called" << std::endl;
    }

    virtual void _validate( bool for_real)
    {
        std::cout << "_validate called" << std::endl;

        info_.set( format());
        info_.channels( Mask_RGBA);

        _deepInfo = DeepInfo( info_);
    }

    virtual void _close()
    {
        std::cout << "_close called" << std::endl;
    }

    // Iop interface

    virtual void _request( int x, int y, int r, int t, ChannelMask mask,
int count)
    {
        std::cout << "_request called" << std::endl;
    }

    virtual void engine( int y, int x, int r, ChannelMask mask, Row& row)
    {
        std::cout << "_engine called" << std::endl;
    }

    // DeepOp interface

    virtual bool doDeepEngine( Box box, const ChannelSet& channels,
DeepOutputPlane& plane)
    {
        std::cout << "doDeepEngine called" << std::endl;
        return true;
    }

    virtual void getDeepRequests( Box box,
                                  const ChannelSet& channels,
                                 int count,
                                 std::vector<RequestData> &reqData)
    {
        std::cout << "getDeepRequests called" << std::endl;
    }

private:

    TestRender( Node *node) : BaseClassType( node) {}
};

const char *TestRender::HELP = "No help yet";

const Iop::Description TestRender::description
(
    "TestRender",
    "Tests/TestRender",
    TestRender::build
);

--------------------------------------------------------------------
_______________________________________________
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