Another idea is you can get one of the inputs to your node, cast that op to your custom op's class, then access data directly from it

Not sure it will work well in your case of an executable note, but we had one node which loaded a file from disc, then downstream there was several nodes which used data from this loader node, like so:

MyLoaderNode* loader = dynamic_cast<MyLoaderNode*>(input(1));
loader->initialise_cache();

On 18/03/15 00:06, Nils Plath wrote:
Hello nuke-dev,

This questions is addressed to developers using C++ and Nuke NDK.

**Context:** Assume a custom Op which implements the interfaces of 
`DD::Image::NoIop` and
`DD::Image::Executable`. The node iterates of a range of frames extracting 
information at
each frame, which is stored in a custom data structure. An custom knob, which 
is a member
variable of the above Op (but invisible in the UI), handles the loading and 
saving
(serialization) of the data structure.

Now I want to exchange that data structure between Ops.

So far I have come up with the following ideas:

1. Expression linking
        
        Knobs can share information (matrices, etc.) using expression linking.
        Can this be used to for custom data as well?

2. Serialization to image data

        The custom data would be serialized and written into a (new) channel. A
        node further down the processing tree could grab that and de-serialize
        again. Of course, the channel must not be altered between serialization
        and de-serialization or else ... this is a hack, I know, but, hey, any 
port
        in a storm!

3. GeoOp + renderer

        In cases where the custom data is purely point-based (which, 
unfortunately,
        it isn't in my case), I could turn the above node into a 3D node and 
pass
        point data to other 3D nodes. At some point a render node would be 
required
        to come back to 2D.

I am going into the correct direction with this? If not, what is a sensible
approach to make this data structure available to other nodes, which rely on the
information contained in it?

This question can also be found here:

     http://stackoverflow.com/q/29100348/1141118


Sincerely,
Nils


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