Example Nuke Plugins¶DeepToImage¶![]() A Nuke plugin to flatten deep pixel samples into a 2D flat image with subpixel mask and varying surface type support. This is a customized version of the stock Foundry node and provides support for subpixel sampling via subpixel-mask channels (spmask layer by default). Note: If no subpixel mask channels exist on the input then the standard flattening (legacy) behavior is performed, providing backwards-compatibility for older deep images. If non-spmask images are merged with spmask images then the non-spmask samples will have spmask channels containing zeros (0). Zero spmask values are interpreted by the flattener as a legacy sample and a full-coverage mask is then used, with the possible result of some aliasing at pixel edges. Note Nuke silently inserts a DeepToImage node into the Viewer’s input stream when the Viewer is connected directly to a Deep node. Because of this behavior this plugin MUST override the stock Foundry DeepToImage plugin otherwise the spmask/flag data will be ignored for deep samples that contain it, likely producing aliased and unpremulted images. Nuke ships with the DeepToImage code (Documentation/NDK/examples/DeepToImage.cpp) so to compare the output of the stock plugin and the Dcx plugin you can compile the stock plugin with a different node and dso name like ‘DeepToImageFn’ so both plugins can coexist in the same script. DeepMatte, DeepSurfaceType¶![]() ![]() An example Nuke plugin that sets or clears the per-sample flags. DeepMatte defaults to setting the DeepSurfaceType exposes all the flag controls allowing the hard-surface, matte-object and additive flags to be changed. DeepTransform¶![]() An example Nuke plugin that applies a 2D affine transformation to all deep pixels in the image. If the source deep samples have subpixel masks then they are spatially resampled using the supersampling rate. If the filter is not impulse and a deep sample has a partial subpixel contribution resulting from the transform then multiple copies of the sample are written to the output deep pixel (which may get combined with another sample) - one with the full subpixel coverage contribution and one or more with the partially-weighted subpixel contributions. The subpixel masks of these partial samples are mutually exclusive with the full-coverage
sample so they never overlap, and are flagged with The flattener algorithm accumulates these partial samples additively when combining with full-coverage samples. Warning This node can replace the stock DeepTransform node with the caveat that the stock node uses an XYZ knob for translate which does not map directly to the new node’s Transform2d_knob XY translate, causing saved Z-translate values to be LOST from pre-existing scripts! There is no current method (that I’m aware of) to translate a single knob into
two separate knobs using the Obsolete_knob mechanism, so these scripts may need to be
manually edited to change the DeepTransform {
translate {10.2 0 -23}
name DeepTransform_Foundry
}
DeepTransform {
translate {10.2 0}
ztranslate -23
name DeepTransform_OpenDCX
}
DeepSubpixelMask¶![]() An example Nuke plugin which displays a deep sample’s subpixel mask pattern and also allows it to be set. Depth, flags and color values for the selected sample are also displayed but cannot be set. This plugin is primarily intended for debugging purposes. |