I'm not sure if the DeepPixelOp subclass is meant to handle that
automatically when you implement in_channels(), but you could try also
implementing getDeepRequests and explicitly request Chan_Z from your input.

That wouldn't necessarily make it so "channels" inside processSample
contain Chan_Z (it will depend on whether the output of this Op is trying
to fill in Chan_Z), but it SHOULD make it so you can access Chan_Z from the
input.

Have not tried this myself, but following the analogy of non-deep Ops this
seems worth trying...




On Thu, Feb 4, 2016 at 9:22 AM, Anders Langlands <
ander...@moving-picture.com> wrote:

> Hi guys, I'm struggling a bit with the examples in the docs. I have a node
> where I'm processing for RGB but in order to do so I need the depth of each
> sample.
>
> The pertinent parts of my code look like this:
>
>    virtual void in_channels(int, ChannelSet& channels)
>    {
>       if (channels & Mask_RGB)
>       {
>          channels += Mask_RGB;
>          channels += Chan_Z;
>       }
>    }
>
>    virtual void processSample(/* args... */) const
>    {
>       RGB attenuation, inscattering;
>       bool processed = false;
>       foreach(z, channels)
>       {
>          if ((z == Chan_Red || z == Chan_Green || z == Chan_Blue) &&
> channels.contains(Chan_Z))
>          {
>             // do stuff...
>          }
>          else
>          {
>             output.push_back(deep_pixel.getUnorderedSample(sample_no, z));
>          }
>       }
>    }
>
> My trouble is the channels I'm given never seem to contain the Z channel.
> Trying to access it anyway causes an abort (obviously). How do I tell Nuke
> that I absolutely need depth along with the r, g, b channels?
>
> Cheers,
>
> Anders
>
>
>
> *Anders Langlands VFX Supervisor *
> *MPC Film*
> *C: *+1 514 882 6247
> London - Vancouver - Los Angeles - Bangalore  - Montréal
> moving-picture.com/film
>
> _______________________________________________
> Nuke-dev mailing list
> Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>
_______________________________________________
Nuke-dev mailing list
Nuke-dev@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to