Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::NukeWrapper Class Reference

#include <NukeWrapper.h>

Inheritance diagram for DD::Image::NukeWrapper:
DD::Image::Iop DD::Image::PlanarI DD::Image::Op DD::Image::IopInfoOwner

Public Member Functions

const MetaData::Bundle_fetchMetaData (const char *key) override
 
OpHints opHints () const override
 Return hints to control when and how this op will be evaluated by the top-down system.
 
Iopwrapped_iop () const
 Return Iop passed to constructor.
 
Hash editState () const override
 Calls editState() on the Iop.
 
void setEditState (const Hash &h) override
 Calls setEditState() on the Iop.
 
void _invalidate () override
 
void _validate (bool) override
 
void _open () override
 
void _close () override
 
void knobs (Knob_Callback) override
 
int knob_changed (Knob *k) override
 
bool can_clone () const override
 
HandlesMode doAnyHandles (ViewerContext *viewer) override
 
PrevalidateResult doPreValidate (ViewerContext *ctx=nullptr, PreValidateContext *pvc=nullptr) override
 
void inputsAttached () override
 
int knob_change_finished (Knob *k, bool changedByUser) override
 
bool onAction (const ViewerContext *c, const DD::Image::Flags f, void *d) override
 
void build_handles (ViewerContext *) override
 
void draw_handle (ViewerContext *) override
 
int optional_input () const override
 
int minimum_inputs () const override
 
int maximum_inputs () const override
 
bool test_input (int, Op *) const override
 
void set_input (int, Op *, int, int) override
 
void inputs (int n) override
 
void _knobStorePrep (const OutputContext &) override
 
void _knobStorePost (const OutputContext &, Hash &) override
 
void setOutputContext (const OutputContext &) override
 
void append (Hash &) override
 
Opdefault_input (int) const override
 
int split_input (int n) const override
 
float uses_input (int) const override
 
const OutputContextinputContext (int n, int offset, OutputContext &) const override
 
const char * node_shape () const override
 
unsigned node_color () const override
 
const char * node_help () const override
 
const char * input_label (int, char *) const override
 
const char * Class () const override
 
const char * displayName () const override
 
std::string docsPath () const override
 
void _request (int x, int y, int r, int t, ChannelMask, int count) override
 
void engine (int y, int x, int r, ChannelMask, Row &) override
 
bool pass_transform () const override
 
void in_channels (int, ChannelSet &) const override
 
bool firstEngineRendersWholeRequest () const override
 
void build_splits () override
 
std::vector< DD::Image::OutputContextgetPrevVersionsWanted () const override
 
 NukeWrapper (PixelIop *op)
 
 NukeWrapper (Iop *op)
 
NukeWrappernoMix ()
 
NukeWrappernoChannels ()
 
NukeWrappernoMask ()
 
NukeWrappermixLuminance ()
 
NukeWrappernoUnpremult ()
 
NukeWrapperchannels (ChannelSetInit i)
 
NukeWrapperchannelsRGBoptionalAlpha ()
 
 ~NukeWrapper () override
 
ChannelMask channels () const
 
const char * gpuEngine_decl () const override
 
const char * gpuEngine_body () const override
 
Hash gpuEngine_shader_hash_at (double time) override
 
int gpuEngine_getNumRequiredTexUnits () const override
 
void gpuEngine_GL_begin (GPUContext *context) override
 
void gpuEngine_GL_end (GPUContext *context) override
 
PlanarIgetPlanarI () override
 
void doFetchPlane (DD::Image::ImagePlane &ip) override
 
std::string getLibraryName () const override
 
Op::VersionInfo getLibraryVersion () const override
 
- Public Member Functions inherited from DD::Image::Iop
void fetchPlane (ImagePlane &imagePlane)
 
virtual PlanarIgetPlanarI ()
 
void force_validate (bool for_real=true) override
 
IopImpl * pImpl ()
 
virtual void engine (int y, int x, int r, ChannelMask, Row &)=0
 
Iopiop () override
 Cast to an Iop. This is much cheaper and safer than using dynamic_cast.
 
const Iopiop () const override
 
 ~Iop () override
 
virtual bool isBlackIop () const
 
bool test_input (int, Op *) const override
 
Opdefault_input (int) const override
 
Iopinput (int n) const
 
Iopinput (int n, int m) const
 
Iopinput0 () const
 
Iopinput1 () const
 
Cache * cache () const
 
bool cached () const
 
void cached (bool b)
 
virtual void in_channels (int, ChannelSet &) const
 
ChannelMask out_channels () const
 
int raw_channels_from () const
 
virtual bool pass_transform () const
 
void request (int x, int y, int r, int t, ChannelMask channels, int count)
 
void request (DD::Image::Box box, ChannelMask channels, int count)
 
void request (ChannelMask channels, int count)
 
void _copyState (Iop *input)
 
const BoxrequestedBox () const
 
const BoxunclampedRequestedBox () const
 
ChannelMask requested_channels () const
 
ChannelMask multi_requested_channels () const
 
ChannelMask unclamped_requested_channels () const
 
int requested_count () const
 
virtual void get (int y, int x, int r, ChannelMask, Row &)
 
void at (int x, int y, Pixel &out)
 
float at (int x, int y, Channel)
 
ChannelSet peek (int x, int y, int r, int t, Pixel &out)
 
bool peek (int x, int y, int w, int h, ChannelMask pixelChannels, PixelCallbackI &callback)
 
virtual TransformgetTransform ()
 
virtual bool set_texturemap (ViewerContext *, bool gl=true)
 
virtual TextureImage get_texturemap (ViewerContext *ctx)
 
virtual void unset_texturemap (ViewerContext *)
 
virtual bool shade_GL (ViewerContext *, GeoInfo &)
 
virtual void vertex_shader (VertexContext &)
 
virtual void fragment_shader (const VertexContext &, Pixel &out)
 
virtual void displacement_shader (const VertexContext &vtx, VArray &out)
 
virtual float displacement_bound () const
 
virtual void blending_shader (const Pixel &in, Pixel &out)
 
virtual void render_state (GeoInfoRenderState &state)
 
virtual void sample (float cx, float cy, float w, float h, Filter *, Pixel &out)
 
void sample (float cx, float cy, float w, float h, Pixel &out)
 
virtual void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Filter *filter, Pixel &out)
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Pixel &out)
 
virtual float sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
 
void build_handles (ViewerContext *) override
 
virtual void inputsAttached ()
 
virtual void gpuEngine_useTextureTransform (bool useTransform)
 GPU support code.
 
virtual void gpuEngine_setupTextureTransform (const Matrix4 &postOpTransform)
 
virtual const char * gpuEngine_decl () const
 
virtual const char * gpuEngine_body () const
 
virtual Hash gpuEngine_shader_hash_at (double time)
 
virtual int gpuEngine_getNumRequiredTexUnits () const
 
virtual void gpuEngine_GL_begin (GPUContext *context)
 
virtual void gpuEngine_GL_end (GPUContext *context)
 
virtual IopviewerPassThrough () const
 
OpHints opHints () const override
 Return hints to control when and how this op will be evaluated by the top-down system.
 
virtual void setExtendedOpProperties (std::shared_ptr< ExtendedOpProperties > extendedOpProperties)
 Sets the pointer to object implementing extended properties.
 
virtual std::shared_ptr< ExtendedOpPropertiesgetExtendedOpProperties () const
 Returns the pointer to object implementing extended properties.
 
- Public Member Functions inherited from DD::Image::Op
PrevalidateResult preValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 
OprootOp () const
 
bool preValidateAborted (int treeStartingVersion, PrevalidateResult &result) const
 
const OutputSetgetOutputs () const
 return all the outputs of this node
 
virtual void setInputsValid (bool nowValid)
 set whether the input ops are valid (are for the right context)
 
bool inputsValid () const
 return whether the input ops are valid (are for the right context)
 
virtual bool can_clone () const
 returns whether or not an op can be cloned in the dag
 
bool haveHash () const
 return true if the hash() value is meaningful and globally unique
 
bool varyingOutputHash () const
 
void setVaryingOutputHash (bool varyingHashes)
 Set the varyingOutputHash indicator to a specific state.
 
void enableVaryingOutputHash ()
 Enable the varyingOutputHash indicator.
 
virtual Hash editState () const
 
virtual void setEditState (const Hash &h)
 
virtual std::vector< DD::Image::OutputContextgetPrevVersionsWanted () const
 
virtual const MetaData::Bundle_fetchMetaData (const char *keyname)
 
const MetaData::BundlefetchMetaData (const char *keyname)
 
Node * node () const
 
DD::Image::NodeI * getNode () const
 
void node (Node *v)
 
const char * nodeName () const
 Return NodeI::name() which is the Node's local name with no parent path.
 
std::string nodeFullPath (char separator='.') const
 
Hash nodeTopologyHash () const
 
OpfirstOp () const
 
void firstOp (Op *v)
 
Opparent () const
 
void parent (Op *lpOp)
 
virtual void detach ()
 node has been deleted in DAG
 
virtual void attach ()
 node has been created in DAG
 
virtual void pre_write_knobs ()
 
void knobStorePrep (const OutputContext &storeContext)
 
virtual void knobs (Knob_Callback)
 
void knobStorePost (const OutputContext &storeContext, Hash &hash)
 
int replace_knobs (Knob *afterthis, int n, void(*f)(void *, Knob_Callback), void *, const char *fileExt=nullptr)
 
int add_knobs (void(*f)(void *, Knob_Callback), void *, Knob_Callback)
 
void set_unlicensed ()
 
Knobknob (const char *name) const
 
Knobknob (int) const
 
bool pushed () const
 
bool panel_visible () const
 
bool node_disabled () const
 
bool node_selected () const
 
unsigned node_gl_color () const
 
void * field (const char *name)
 
void * field (const char *name, int &type)
 
void * set_field (const char *name, const void *source, int size)
 
void * get_field (const char *name, void *dest, int size)
 
void beginHandle (HandleType command, ViewerContext *ctx, EventCallback *cb, int index, float x=0, float y=0, float z=0, ViewerContext::Cursor cursor=ViewerContext::kNoCursor)
 
void endHandle (ViewerContext *ctx)
 
virtual int knob_changed (Knob *)
 
virtual int knob_change_finished (Knob *knob, bool changedByUser=true)
 
void addTime (OpTimer::Category category, long long microsecondsCPU, long long microsecondsWall, bool isTopLevel=true)
 
void getPerformanceInfo (OpTimer::Category category, OpTimer::PerformanceInfo &info) const
 return the amount of CPU time taken by this op
 
virtual bool inputs_clockwise () const
 whether unconnected inputs on the DAG should be arranged clockwise or anticlockwise (default)
 
virtual std::vector< int > input_order () const
 
virtual int inputArrows (int nodeInputs) const
 
bool script_command (const char *command, bool py=true, bool eval=true) const
 
bool script_expand (const char *str) const
 
HandlesMode anyHandles (ViewerContext *ctx)
 
virtual void build_handles (ViewerContext *)
 
void add_draw_handle (ViewerContext *)
 
virtual void draw_handle (ViewerContext *)
 
virtual void add_input_handle (int input, ViewerContext *)
 
void add_op_handle (ViewerContext *ctx)
 
void add_knob_handle (Knob *, ViewerContext *)
 
virtual int getViewableModes () const
 
virtual int optional_input () const
 
virtual int minimum_inputs () const
 
virtual int maximum_inputs () const
 
virtual bool test_input (int, Op *) const
 
int inputs () const
 
int node_inputs () const
 
Opnode_input (int, GenerateType=OUTPUT_OP) const
 
Opnode_input (int, GenerateType, const DD::Image::OutputContext *outputContext) const
 
Opinput_op (int n=0) const
 
virtual void inputs (int n)
 
Opinput (int) const
 
int inputNumber (int input, int offset) const
 
Opinput (int input, int offset) const
 
Opinput0 () const
 return the primary input
 
Opinput1 () const
 return the second input, if it exists
 
const std::vector< Op * > & getInputs () const
 
const std::vector< Op * > & getChildren () const
 
virtual void set_input (int i, Op *op, int input, int offset)
 
void set_input0 (Op *op)
 
void set_input (int i, Op *op)
 
void set_input (int i, Op &op)
 
void set_input (int input, int offset, Op *op)
 
const OutputContextoutputContext () const
 
virtual void setOutputContext (const OutputContext &c)
 
virtual void append (Hash &)
 
virtual float uses_input (int) const
 
virtual void build_splits ()
 
virtual int split_input (int) const
 
virtual const OutputContextinputContext (int n, int offset, OutputContext &) const
 
virtual const OutputContextinputUIContext (int n, OutputContext &) const
 
virtual Opdefault_input (int) const
 
const Hashhash () const
 
virtual bool frameTransformImplemented () const
 
virtual bool frameTransformDownstream (const OutputContext &context, unsigned int input, float inFrame, float &outFrame) const
 
virtual bool frameTransformUpstream (const OutputContext &context, unsigned int input, float outFrame, float &inFrame) const
 
virtual DopeItemFlags::Mask getDopeItemFlags () const
 
virtual bool shouldHideInDopeSheet (Knob *knob) const
 
virtual DD::Image::KnobgetDopeItemKnob () const
 
virtual ViewSet viewsProduced () const
 
virtual ViewSet viewsWantOn (int i) const
 
virtual ViewSet splitForViews () const
 
bool requested () const
 
void setRequested ()
 
void forgetRequestShallow ()
 
void forget_request ()
 
void forget_request (std::set< Op * > &forgotten)
 
virtual const char * node_shape () const
 
DD::Image::Hash curveHash () const
 
bool opCurrent () const
 
virtual unsigned node_color () const
 
virtual const char * node_help () const =0
 
virtual const char * input_label (int, char *) const
 
virtual std::string input_longlabel (int) const
 
void node_redraw ()
 
void print_name (std::ostream &o) const
 
NodeContext nodeContext () const
 
std::string node_name () const
 Returns the same string as printed by print_name(ostream).
 
void invalidateSameHash ()
 
bool invalidate ()
 
bool invalidate (const Hash &hash)
 
bool update (const Box *=nullptr)
 
void asapUpdate ()
 
void asapUpdate (const Box &box, int direction=0)
 
void validate (bool for_real=true)
 
virtual void force_validate (bool for_real=true)
 
void update_handles () const
 
bool valid () const
 Returns true if it has been validated - including if there was an error.
 
bool real_valid () const
 Returns true if it has been real-validated - including if there was an error.
 
bool inErrorState () const
 
bool inInvalidState () const
 
bool opened () const
 
void open ()
 
void unopen ()
 
bool running () const
 
void running (bool v)
 
bool not_closed () const
 
void close ()
 
void callCloseAfter (double seconds)
 
void copyState (Op *input)
 
bool cached () const
 
void cached (bool b)
 
virtual bool inUse () const
 
virtual Executableexecutable ()
 
void setKnobsToContext (const OutputContext &, bool force=false)
 
void gotoContext (const OutputContext &, bool update)
 
void progressFraction (double fraction, StatusFlags flags=StatusNone)
 
void progressFraction (int a, int b, StatusFlags flags=StatusNone)
 
void progressMessage (const char *fmt,...)
 
void progressModalMessage (const char *fmt,...)
 
void progressDismiss ()
 
int slowness () const
 
void slowness (int newval)
 
virtual bool firstEngineRendersWholeRequest () const
 
virtual bool updateUI (const OutputContext &context)
 
const Formatinput_format () const
 
const OutputContextuiContext () const
 
void error (const char *fmt,...)
 
void warning (const char *fmt,...)
 
void critical (const char *fmt,...)
 
void debug (const char *fmt,...)
 
void abort () const
 Abort all trees the op is in.
 
bool aborted () const
 True if one of the trees the op is in was aborted; ops should check this while processing and return quickly when true.
 
void cancel () const
 Cancel all trees the op is in. Make sure you also call abort() to stop processing.
 
bool cancelled () const
 True if one of the trees the op is in was cancelled (by user interaction)
 
bool addToTree (OpTree *lpTree)
 Returns true if the op was added to the tree, or false if its reference count increased.
 
bool removeFromTree (OpTree *lpTree)
 Returns false if the op was removed from the tree, or true if its reference count decreased.
 
bool isInTree (OpTree *lpTree) const
 Checks if an op is in a particular tree, for debugging purposes.
 
bool isInAnyTree () const
 Checks if an op is in any tree at all.
 
OpTreeHandlergetTreeHandler () const
 Returns the treeHandler for a given Op.
 
bool hasError () const
 
bool opOrChildHasError () const
 
const OpgetErroredOp () const
 
void setPopUpScheme (PopUpScheme lScheme)
 
PopUpScheme getPopUpScheme () const
 
bool arePopUpsEnabled ()
 Returns whether a pop-up should be enabled for the next message, modifying internal data when necessary.
 
OpMessageHandlergetMsgHandler ()
 
const OpMessageHandlergetMsgHandler () const
 
std::string getDebugInfo () const
 Returns a string of debug information about the op. For internal use.
 
std::string getDetailedDebugInfo () const
 
bool tryValidate (bool for_real=true)
 
virtual Iopiop ()
 Cast to an Iop. This is much cheaper and safer than using dynamic_cast.
 
virtual const Iopiop () const
 
virtual GeoOpgeoOp ()
 Cast to a GeoOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const GeoOpgeoOp () const
 
virtual GeomOpgeomOp ()
 Cast to a GeomOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const GeomOpgeomOp () const
 
virtual ParticleOpparticleOp ()
 Cast to a ParticleOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const ParticleOpparticleOp () const
 
virtual DeepOnlyOpdeepOnlyOp ()
 Cast to a DeepOnlyOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const DeepOnlyOpdeepOnlyOp () const
 
virtual AxisOpaxisOp ()
 Cast to an AxisOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const AxisOpaxisOp () const
 
virtual CameraOpcameraOp ()
 Cast to an CameraOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const CameraOpcameraOp () const
 
virtual LightOplightOp ()
 Cast to an LightOp. This is much cheaper and safer than using dynamic_cast.
 
virtual const LightOplightOp () const
 
virtual std::string getLibraryName () const
 Return a label and version string to display library version info for the Node.
 
virtual VersionInfo getLibraryVersion () const
 
virtual OpHints opHints () const
 Return hints to control when and how this op will be evaluated by the top-down system.
 
virtual const char * Class () const =0
 
const std::string libraryDisplayName () const
 
virtual const char * displayName () const
 
virtual std::string docsPath () const
 
virtual bool onAction (const ViewerContext *c, const DD::Image::Flags f, void *d)
 
Opget (const Description *description)
 
- Public Member Functions inherited from DD::Image::IopInfoOwner
const Infoinfo () const
 
int x () const
 
int y () const
 
int r () const
 
int t () const
 
int w () const
 
int h () const
 
bool is_constant () const
 
int clampx (int x) const
 
int clampy (int y) const
 
const Formatformat () const
 
const Formatfull_size_format () const
 
int ydirection () const
 
bool black_outside () const
 
ChannelMask channels () const
 
const GeneralInfogeneralInfo () const override
 
const Info2Dinfo2D () const override
 
int first_frame () const
 
int last_frame () const
 
void format (const Format &f)
 
void full_size_format (const Format &f)
 

Static Public Member Functions

static Opunwrap (Op *op)
 
- Static Public Member Functions inherited from DD::Image::Iop
static Iopdefault_input (const OutputContext &)
 
static Opdefault_input (const Op *op)
 
static Channel channel (const char *name)
 
static const char * channel_name (Channel c)
 
- Static Public Member Functions inherited from DD::Image::Op
static int treeVersion ()
 
static bool nukeBusy ()
 is nuke processing something on a parallel thread?
 
static Opcreate (Node *node, const char *name, Op *p_op)
 
static Opcreate (const char *name, Op *p_op)
 
static void resetTimers ()
 reset all the performance timers
 
static void setTimingEnabled (bool enabled)
 turn performance timing on or off
 
static bool isTimingEnabled ()
 return whether performance timing is on or not
 
static const char * script_result (bool py=false)
 
static void script_unlock ()
 
static OpretrieveOp (const char *node_path, GenerateType generate_op_type, const OutputContext *generate_op_context=nullptr)
 
static OpretrieveOp (const char *node_path, const Hash &op_hash, int tree_version)
 
static void all_forget_request ()
 
static void new_request_pass ()
 
static double callPendingClose (double seconds)
 
static void clearPendingClose ()
 
static Operror_op ()
 
static const char * error_message ()
 
static void clearAbortAndError ()
 To be removed.
 
static void SetDefaultPopUpEnable (bool lEnable)
 This is used by Nuke to indicate when ops using the default pop-up scheme should show pop-ups. Not recommended for customisation.
 
static std::string getVersionInfoStr (const VersionInfo &versionInfo)
 Helper function to convert a VersionInfo tuple into a string.
 
static const Descriptionfind_description (const char *name, const Op *op_)
 
static int message_f (char t, const char *,...)
 
static int message_vf (char t, const char *, va_list)
 
static void add_timeout (float t, TimeoutHandler, void *v=nullptr)
 
static void repeat_timeout (float t, TimeoutHandler, void *=nullptr)
 
static bool has_timeout (TimeoutHandler, void *=nullptr)
 
static void remove_timeout (TimeoutHandler, void *=nullptr)
 

Protected Types

enum  MaskFrom { FROM_MASK , FROM_INPUT , FROM_OUTPUT }
 

Protected Member Functions

void mix_luminance (const Row &, Row &, ChannelMask, int, int) const
 
void get_from_iop (const Row &, int, int, int, ChannelMask, Row &) const
 
void merge (const float *, const float *, float *, const float *, int, int, int, int) const
 
void mix (const Row &, Row &, ChannelMask, int, int) const
 
void knobsAtTheEnd ()
 
- Protected Member Functions inherited from DD::Image::Iop
 Iop (Node *node)
 
void _invalidate () override
 
void _validate (bool for_real) override
 
virtual void _request (int x, int y, int r, int t, ChannelMask, int count)
 
void _open () override
 
void _close () override
 
virtual void doFetchPlane (ImagePlane &imagePlane)
 
bool inUse () const override
 
void copy_info (int input)
 
void copy_info (int input, ChannelMask)
 
void copy_info ()
 
void clear_info ()
 
void merge_info (int input=0)
 
void merge_info (int input, ChannelMask)
 
void mergeFrameRange (int input)
 
void set_out_channels (ChannelMask m)
 
void set_out_channels (ChannelSetInit m)
 
void set_out_channels (Channel z)
 
void raw_channels_from (int n)
 
void set_out_channels (ChannelMask m, int n)
 
IopasIop (Op *op) const
 
TransformgetDefaultTransform () const
 
template<class TileType >
void doSample (float cx, float cy, float w, float h, Filter *, Pixel &out)
 
template<class TileType >
float do_sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
 
- Protected Member Functions inherited from DD::Image::Op
 Op (Node *node)
 The constructor is protected so only subclasses can create the base class.
 
virtual void _knobStorePrep (const OutputContext &storeContext)
 The subclass-specific portion of knobStorePrep(). See that method for more info.
 
virtual void _knobStorePost (const OutputContext &storeContext, Hash &hash)
 The subclass-specific portion of knobStorePost(). See that method for more info.
 
virtual void _invalidate ()
 
virtual void _validate (bool for_real)
 
virtual void _open ()
 
virtual void _close ()
 
Opcreate (Node *node, const char *name)
 
Opcreate (const char *name)
 
HandlesMode anyInputHandles (ViewerContext *)
 return if any of the inputs (recursively) wish to draw handles
 
HandlesMode anyKnobHandles (ViewerContext *)
 return if any of the knobs on this node wish to draw handles
 
void build_input_handles (ViewerContext *)
 
void build_knob_handles (ViewerContext *)
 
void disallowNoTrees ()
 Call this to tell the op that it should always have op trees for normal behaviour (for internal use)
 
virtual HandlesMode doAnyHandles (ViewerContext *ctx)
 
virtual PrevalidateResult doPreValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
 

Protected Attributes

Iopiop
 
ChannelSet channels_
 
Channel unpremult
 
Channel maskChannelMask_
 
Channel maskChannelInput_
 
bool process_mask
 
bool keep_alpha_pulldown
 
float mix_
 
float mix_luminance_
 
int mix_luminance_colorspace_
 GUI color space index: Only YCbCr although can allow Lab as well (commented out).
 
bool enable_mix_luminance_
 
bool invert_unpremult
 
bool invert_mask
 
bool inject
 
int flags
 
int mask_input
 
ChannelSet outchannels
 
ChannelSet enable_mask
 
Channel maskChannelI
 
enum DD::Image::NukeWrapper::MaskFrom maskFromI
 
Channel maskInjectI
 
int split_mask_input
 
- Protected Attributes inherited from DD::Image::Iop
ChannelSet out_channels_
 protected so validate() can directly modify it
 
int raw_channels_from_
 
- Protected Attributes inherited from DD::Image::Op
bool _haveHash
 whether the _hash actually has been set by a call to invalidate(Hash) ever.
 
bool _varyingOutputHash
 whether the hash value will animate over time
 
Hash _editState
 Op's current edit state, usually the combination of input & knob edit states.
 
- Protected Attributes inherited from DD::Image::IopInfoOwner
Info info_
 

Friends

class NukeWrapperImpl
 

Additional Inherited Members

- Public Types inherited from DD::Image::Op
enum  HandlesMode { eNoHandles , eHandlesUncooked , eHandlesCooked , eHandlesMax }
 
enum  PrevalidateResult { eFinished , eCancelled , eAbandoned }
 This is a tribool return value. Do not extend.
 
enum  HandleType {
  eNone , eMouseLeftClick , eMouseRightClick , eMouseMove ,
  eMouseDrag , eMouseRelease , eSelectionChanged , eSelectionChangeFinished ,
  eHandleDragTranslate , eHandleDragRotate , eHandleDragScale , eHandleDragPivot ,
  eAllHandles
}
 
enum  ViewableModes { eViewableMode2D , eViewableMode3D , eViewableMode3D_2DReference }
 
enum  GenerateType {
  OUTPUT_OP , ANY_CONTEXT , INPUT_OP , INPUT_OP_PEEK ,
  EXECUTABLE , EXECUTABLE_SKIP , EXECUTABLE_INPUT , UICONTEXT_ONLY
}
 
enum  NodeContext { eNodeGraph , eTimeline , eOpGraph }
 
enum  StatusFlags { StatusNone , StatusModal , StatusUseCallback }
 
enum  PopUpScheme {
  ePU_Never , ePU_Done , ePU_Once , ePU_Default ,
  ePU_Always
}
 Pop-up schemes determine when pop-up messages are displayed for op errors. More...
 
enum  VersionComponents { eMajor , eMinor , ePoint , eRevision }
 Enum to help get the desired version component from the VersionInfo tuple.
 
typedef std::pair< int, DD::Image::Op * > Output
 Combination of input number and pointer to Op.
 
typedef std::set< OutputOutputSet
 Set of all outputs from this Op.
 
typedef std::map< Hash, std::vector< unsigned int > > ItemSelectionList
 
typedef bool() EventCallback(Op *op, EventContext eventCtx)
 
using VersionInfo = std::tuple< int, int, int, int >
 Contains version components with each index defined by the VersionComponents enum.
 
- Public Types inherited from DD::Image::IopInfoOwner
typedef IopInfo Info
 
- Public Attributes inherited from DD::Image::Op
const MetaData::BundlemetaCache
 
Hash metaCacheHash
 
- Static Public Attributes inherited from DD::Image::Iop
static bool sPreserveCaches
 
- Static Public Attributes inherited from DD::Image::Op
static unsigned current_request_pass
 
static void(* node_redraw_cb )(const Op *)
 
static void(* print_name_cb )(std::ostream &, const Op *)
 
static void(* status_callback )(const Op *, float, float, const char *, StatusFlags)
 
static const int kInvalidVersion
 
static const VersionInfo kUnsetVersion
 

Detailed Description

Provides user-friendly masking and channel-selection controls to any operator. This makes the implementation of the operators much simpler and allows the basic operators to be much faster when used outside Nuke.

The wrapper uses the in_channels() and out_channels() calls of the subclass to figure out what channels it needs from it, intesects this with the user-settable channel selector, and only asks the subclass to calculate those. All other channels will be copied unchanged from input0(). The user can also select a "mask" channel, this is used to mix the original and final results. It can also do a constant dissolve between the input and result, controlled by the enable knob on the control panel.

Much work is done to avoid calling the inner operator for any data that is not going to be used. Zero channels are detected and skipped, and the mask is checked first and only the region inside it is requested.

Constructor & Destructor Documentation

◆ NukeWrapper() [1/2]

NukeWrapper::NukeWrapper ( PixelIop op)

If the NukeWrapper knows the wrapped Iop is a PixelIop subclass, it will call PixelIop::pixel_engine() directly, as this saves a lot of memory and cache space because it avoids getting the input pixels twice. This also enables the unpremultiply controls.

The op's engine() will not be called, so you should not override the PixelIop::engine(). If the subclass does, be sure to cast back to an Iop so that the Iop constructor is called.

References MAX(), DD::Image::Op::minimum_inputs(), and DD::Image::Op::parent().

◆ NukeWrapper() [2/2]

NukeWrapper::NukeWrapper ( Iop op)

The constructor takes a pointer to the Iop to "wrap". By default the full capabilities of the NukeWrapper are enabled, you can use the noMix(), noChannels(), noMask(), and noPremult() methods to turn off controls immediately after the constructor.

References MAX(), DD::Image::Op::minimum_inputs(), and DD::Image::Op::parent().

◆ ~NukeWrapper()

NukeWrapper::~NukeWrapper ( )
override

This deletes the iop!

Member Function Documentation

◆ _fetchMetaData()

const MetaData::Bundle & NukeWrapper::_fetchMetaData ( const char *  key)
overridevirtual

Reimplemented from DD::Image::Op.

◆ opHints()

OpHints NukeWrapper::opHints ( ) const
overridevirtual

Return hints to control when and how this op will be evaluated by the top-down system.

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::opHints(), and wrapped_iop().

◆ unwrap()

static Op * DD::Image::NukeWrapper::unwrap ( Op op)
inlinestatic

Helper function, which unwraps an Op from a NukeWrapper if it is within one and returns the inner op, or just returns the op.

◆ editState()

Hash NukeWrapper::editState ( ) const
overridevirtual

Calls editState() on the Iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::editState().

◆ setEditState()

void NukeWrapper::setEditState ( const Hash h)
overridevirtual

◆ _invalidate()

void NukeWrapper::_invalidate ( )
overridevirtual

◆ _validate()

◆ _open()

void NukeWrapper::_open ( )
overridevirtual

◆ _close()

void NukeWrapper::_close ( )
overridevirtual

Calls close() on the wrapped Iop.

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::_close(), and DD::Image::Op::close().

◆ knobs()

void NukeWrapper::knobs ( Knob_Callback  f)
overridevirtual

◆ knob_changed()

int NukeWrapper::knob_changed ( Knob k)
overridevirtual

Shows only the relevant maskChannel control depending on whether the mask input is connected and being used. This avoids questions about what happens when you set both of them (the answer is that the maskChannelInput is used and the mask input is ignored).

This also calls knob_changed() on the wrapped Iop.

Reimplemented from DD::Image::Op.

References DD::Image::Knob::enable(), DD::Image::Knob::hide(), DD::Image::Knob::inputChange, DD::Image::Knob::is(), DD::Image::Op::knob(), DD::Image::Op::knob_changed(), DD::Image::Op::node_input(), DD::Image::Knob::show(), and DD::Image::Knob::showPanel.

◆ can_clone()

bool DD::Image::NukeWrapper::can_clone ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ doAnyHandles()

HandlesMode DD::Image::NukeWrapper::doAnyHandles ( ViewerContext viewer)
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ doPreValidate()

PrevalidateResult DD::Image::NukeWrapper::doPreValidate ( ViewerContext ctx = nullptr,
PreValidateContext pvc = nullptr 
)
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ inputsAttached()

void DD::Image::NukeWrapper::inputsAttached ( )
inlineoverridevirtual

Reimplemented from DD::Image::Iop.

◆ knob_change_finished()

int DD::Image::NukeWrapper::knob_change_finished ( Knob k,
bool  changedByUser 
)
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ onAction()

bool DD::Image::NukeWrapper::onAction ( const ViewerContext c,
const DD::Image::Flags  f,
void *  d 
)
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ build_handles()

void NukeWrapper::build_handles ( ViewerContext c)
overridevirtual

Passed through to the iop.

Reimplemented from DD::Image::Iop.

◆ draw_handle()

void NukeWrapper::draw_handle ( ViewerContext c)
overridevirtual

Passed through to the iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::draw_handle().

◆ optional_input()

int NukeWrapper::optional_input ( ) const
overridevirtual

Returns the Iop's result. If the Iop actually has any optional inputs, the NukeWrapper's optional mask input is inserted after them.

Reimplemented from DD::Image::Op.

References DD::Image::Op::optional_input().

◆ minimum_inputs()

int NukeWrapper::minimum_inputs ( ) const
overridevirtual

Returns the result from the iop plus 1 for the mask

Reimplemented from DD::Image::Op.

◆ maximum_inputs()

int NukeWrapper::maximum_inputs ( ) const
overridevirtual

Returns the result from the iop plus 1 for the mask

Reimplemented from DD::Image::Op.

References MAX(), and DD::Image::Op::maximum_inputs().

◆ test_input()

bool NukeWrapper::test_input ( int  n,
Op op 
) const
overridevirtual

Returns the result from the wrapped iop for any input other than 0. For input 0 only Iop's are allowed, make sure you don't wrap an operator that expects something else!

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::test_input().

◆ set_input()

void NukeWrapper::set_input ( int  n,
Op op,
int  base,
int  offset 
)
overridevirtual

Change the corresponding input of the wrapped op.

Reimplemented from DD::Image::Op.

References DD::Image::Op::set_input().

◆ inputs()

void NukeWrapper::inputs ( int  n)
overridevirtual

Reimplemented from DD::Image::Op.

◆ _knobStorePrep()

void NukeWrapper::_knobStorePrep ( const OutputContext storeContext)
overridevirtual

Passed through to the wrapped iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::knobStorePrep().

◆ _knobStorePost()

void NukeWrapper::_knobStorePost ( const OutputContext storeContext,
Hash hash 
)
overridevirtual

Reimplemented from DD::Image::Op.

◆ setOutputContext()

void NukeWrapper::setOutputContext ( const OutputContext context)
overridevirtual

Reimplemented from DD::Image::Op.

◆ append()

void NukeWrapper::append ( Hash hash)
overridevirtual

Reimplemented from DD::Image::Op.

◆ default_input()

Op * NukeWrapper::default_input ( int  n) const
overridevirtual

Returns the result from the wrapped iop for any input other than 0. For input 0 it uses the default Iop input (a black image)

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::default_input().

◆ split_input()

int NukeWrapper::split_input ( int  n) const
overridevirtual

Returns the result from the iop. The Iop must not return < 1 for n == 0! And it currently screws up if anything other than 1 is returned...

Reimplemented from DD::Image::Op.

References DD::Image::Op::split_input().

◆ uses_input()

float NukeWrapper::uses_input ( int  n) const
overridevirtual

Returns the result from the iop, except if the Mix slider is turned off it returns 1 for input 0 and 0 for all others.

Reimplemented from DD::Image::Op.

References lerp(), DD::Image::Op::uses_input(), and DD::Image::IopInfoOwner::x().

◆ inputContext()

const OutputContext & NukeWrapper::inputContext ( int  n,
int  offset,
OutputContext temp 
) const
overridevirtual

Passed through to the iop. Any changes it makes to input 0 will also effect the masked-off area or the turned-off channels, which may not be what the user expects.

Reimplemented from DD::Image::Op.

References DD::Image::Op::inputContext(), and DD::Image::Op::outputContext().

◆ node_shape()

const char * NukeWrapper::node_shape ( ) const
overridevirtual

Passed through to the wrapped iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::node_shape().

◆ node_color()

unsigned NukeWrapper::node_color ( ) const
overridevirtual

Passed through to the wrapped iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::node_color().

◆ node_help()

const char * NukeWrapper::node_help ( ) const
overridevirtual

Passed through to the wrapped iop.

Implements DD::Image::Op.

References DD::Image::Op::node_help().

◆ input_label()

const char * NukeWrapper::input_label ( int  n,
char *  buffer 
) const
overridevirtual

Passed through to the wrapped iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::input_label().

◆ Class()

const char * NukeWrapper::Class ( ) const
overridevirtual

Returns the result from the iop.

Implements DD::Image::Op.

References DD::Image::Op::Class().

◆ displayName()

const char * NukeWrapper::displayName ( ) const
overridevirtual

Returns the result from the iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::displayName().

◆ docsPath()

std::string NukeWrapper::docsPath ( ) const
overridevirtual

Returns the result from the iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::docsPath().

◆ _request()

void NukeWrapper::_request ( int  x,
int  y,
int  r,
int  t,
ChannelMask  channels,
int  count 
)
overridevirtual

Calls request() on the inner Iop, which will usually cause a request() to be done of the inputs to this Iop. If the mask or blending is enabled this will also call request() on input0() and this usually results in a count of 2 and the cache being enabled on the input.

If the op is a PixelIop request() of the input is called with count = 0, which should prevent the cache from being created.

Reimplemented from DD::Image::Iop.

References DD::Image::IopInfoOwner::black_outside(), DD::Image::IopInfoOwner::info(), DD::Image::Iop::input(), DD::Image::Iop::input0(), DD::Image::Box::r(), DD::Image::IopInfoOwner::r(), DD::Image::Iop::request(), DD::Image::Box::t(), DD::Image::IopInfoOwner::t(), DD::Image::Box::x(), DD::Image::IopInfoOwner::x(), DD::Image::Box::y(), and DD::Image::IopInfoOwner::y().

◆ engine()

void NukeWrapper::engine ( int  y,
int  x,
int  r,
ChannelMask  channels,
Row row 
)
overridevirtual

Calls engine() of the Iop, and (depending on the settings) this also reads raw data in from the input and mixes it together with the iop output to produce the final image.

If the operator is a PixelIop, PixelIop::pixel_engine() is called directly to avoid having to read a row twice from the input.

If a mask is enabled and the process-mask flag is off, the mask is looked at first, and only the non-zero region is requested with the x and r arguments to the iop's engine. If the mask is completely blank no line is asked for at all. Make sure your wrapped Iop can handle x and r changing.

Implements DD::Image::Iop.

References DD::Image::Iop::get(), DD::Image::Iop::in_channels(), DD::Image::Iop::input0(), DD::Image::IopInfoOwner::r(), DD::Image::IopInfoOwner::x(), and DD::Image::IopInfoOwner::y().

◆ pass_transform()

bool NukeWrapper::pass_transform ( ) const
overridevirtual

Reimplemented from DD::Image::Iop.

◆ in_channels()

void NukeWrapper::in_channels ( int  n,
ChannelSet channels 
) const
overridevirtual

Fairly complex, this returns the correct set taking into account the in_channels() of the Iop, and the settings of premult, mask, and the mix slider.

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::in_channels().

◆ firstEngineRendersWholeRequest()

bool NukeWrapper::firstEngineRendersWholeRequest ( ) const
overridevirtual

Passed through to the wrapped iop.

Reimplemented from DD::Image::Op.

References DD::Image::Op::firstEngineRendersWholeRequest().

◆ build_splits()

void DD::Image::NukeWrapper::build_splits ( )
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ getPrevVersionsWanted()

std::vector< DD::Image::OutputContext > DD::Image::NukeWrapper::getPrevVersionsWanted ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ noMix()

NukeWrapper * NukeWrapper::noMix ( )

You can call this immediately after the constructor to remove the "mix" control. You don't want this if your operator has a mixing or amplitude control of it's own.

◆ noChannels()

NukeWrapper * NukeWrapper::noChannels ( )

You can call this immediately after the constructor to remove the channel selector controls. You don't want this if your operator does not naturally operate on all channels.

Returns this to allow you to call this in the same statement as the constructor.

◆ noMask()

NukeWrapper * NukeWrapper::noMask ( )

You can call this immediately after the constructor to remove the "mask" control and the extra mask input. You don't want this if your operator has it's own masking or some other way of using a channel to control it's amplitude.

◆ mixLuminance()

NukeWrapper * NukeWrapper::mixLuminance ( )

You can call this immediately after the constructor to enable the "luminance mix" control. The control is a slider. Changing the slider to any value between 0-1 will mix the original luminance channel (i.e. Y) with altered luminance. The value 0 meaning that the altered luminance will be used, and 1 being the original luminance. Note that for conversion it uses YCbCr color space. The default state of this control is off and "mix luminance" value is 0.

◆ noUnpremult()

NukeWrapper * NukeWrapper::noUnpremult ( )

You can call this immediately after the constructor to remove the "unpremult by" control. You don't want this if your operator requires premultiplied images.

◆ gpuEngine_decl()

const char * NukeWrapper::gpuEngine_decl ( ) const
overridevirtual

Reimplemented from DD::Image::Iop.

◆ gpuEngine_body()

const char * NukeWrapper::gpuEngine_body ( ) const
overridevirtual

Reimplemented from DD::Image::Iop.

◆ gpuEngine_shader_hash_at()

Hash NukeWrapper::gpuEngine_shader_hash_at ( double  time)
overridevirtual

Reimplemented from DD::Image::Iop.

◆ gpuEngine_getNumRequiredTexUnits()

int NukeWrapper::gpuEngine_getNumRequiredTexUnits ( ) const
overridevirtual

Reimplemented from DD::Image::Iop.

◆ gpuEngine_GL_begin()

void NukeWrapper::gpuEngine_GL_begin ( GPUContext context)
overridevirtual

Reimplemented from DD::Image::Iop.

◆ gpuEngine_GL_end()

void NukeWrapper::gpuEngine_GL_end ( GPUContext context)
overridevirtual

Reimplemented from DD::Image::Iop.

◆ getPlanarI()

PlanarI * NukeWrapper::getPlanarI ( )
overridevirtual

get the PlanarI for this NukeWrapper; this returns NULL if it prefers row-based access; or a pointer to the PlanarI describing the plane preferences if it prefers planar access

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::getPlanarI().

◆ doFetchPlane()

void NukeWrapper::doFetchPlane ( DD::Image::ImagePlane ip)
overridevirtual

get the image data as a plane; will pass-through if possible, otherwise may fall back to row-based processing.

Reimplemented from DD::Image::Iop.

References DD::Image::Iop::doFetchPlane(), and DD::Image::Iop::fetchPlane().

◆ getLibraryName()

std::string DD::Image::NukeWrapper::getLibraryName ( ) const
inlineoverridevirtual

get a label to display in the library version info for Node

Reimplemented from DD::Image::Op.

References DD::Image::Op::getLibraryName().

◆ getLibraryVersion()

Op::VersionInfo DD::Image::NukeWrapper::getLibraryVersion ( ) const
inlineoverridevirtual

get a version to display in library version info for the Node

Reimplemented from DD::Image::Op.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com