Nuke binary plugins 16.1.1
 
Loading...
Searching...
No Matches
DD::Image::Op::Description Class Reference

#include <Op.h>

Inheritance diagram for DD::Image::Op::Description:
DD::Image::Description DD::Image::GeomOp::Description DD::Image::SceneOpI::Description

Public Member Functions

Opconstructor (Node *node) const
 Nuke calls this to create an Op instance.
 
 Description (const char *n, OpConstructor c, License *lic=nullptr)
 
 Description (const char *n, OpConstructor c, NodeBuilder nodeBuilder)
 Same but for internal Nuke Nodes with no license requirements.
 
 Description (const char *opClassName, OpConstructor c, const char *nodeBaseName, License *lic=nullptr)
 
 mFnDeprecatedInNuke17 ("Description(menu, OpConstructor) has been deprecated, use Description(OpConstructor) instead") Description(const char *n
 
const char OpConstructor name (n)
 
const char OpConstructor nodeBase (nullptr)
 

Static Public Member Functions

static const Descriptionfind (int i)
 

Public Attributes

const char * name
 Nuke script command name.
 
const char * nodeBase
 Base Node (OpNode subclass) name.
 
const char OpConstructor c: constructor_(c)
 
- Public Attributes inherited from DD::Image::Description
const char * compiled
 
const char * plugin
 
Licenselicense
 

Protected Types

using OpConstructor = std::function< Op *(Node *)>
 

Static Protected Member Functions

static void add (DD::Image::Description *)
 

Protected Attributes

OpConstructor constructor_
 

Static Protected Attributes

static const Descriptioncurrent_
 

Additional Inherited Members

- Public Types inherited from DD::Image::Description
using DescriptionList = std::vector< Description * >
 
using NodeBuilder = std::function< Node *(void *)>
 
- Protected Member Functions inherited from DD::Image::Description
void ctor (void(*f)(Description *))
 
void ctor (void(*f)(Description *), NodeBuilder nodeBuilder)
 

Detailed Description

A subclass of Op that wants to appear on Nuke's menu or be created by a Nuke script command must create one or more static instances of this structure. The constructor adds itself to a list which Nuke scans to find all the possible operators.

The code that goes into a plugin to create the entry looks like this:

static const char* const MYCLASS = "MyOp";
class MyOp : public Op {
static const Description description;
public:
const char* Class() const {return MYCLASS;}
...
};
static Op* build(Node* node) {return new MyOp(node);}
const Op::Description MyOp::description(MYCLASS, build);
Definition: Op.h:2318
Base class of all the things that can be created by Nuke nodes.
Definition: Op.h:127
Node * node() const
Definition: Op.cpp:1499

It is required that the string inside the description and returned by Op::Class() be the exact same pointer. This is checked by Nuke. It is also required that this string is the same as base name of the plugin file, or the name of a .tcl file that says "load foo" where foo is the name of this plugin file. Nuke only stores the name in the saved script, so this is necessary for it to find the plugin again.

Constructor & Destructor Documentation

◆ Description() [1/2]

DD::Image::Op::Description::Description ( const char *  n,
OpConstructor  c,
License lic = nullptr 
)
inline

The constructor adds this Op to the internal table of available script commands.

If the License is not null then it is tested and if the test fails the description is not added to the table, making it impossible to call the constructor. You should check the license pointer when your constructor is called to make sure some cracker has not changed it or cleared it.

◆ Description() [2/2]

DD::Image::Op::Description::Description ( const char *  opClassName,
OpConstructor  c,
const char *  nodeBaseName,
License lic = nullptr 
)
inline

Same but with a separate base Node (OpNode subclass) class to create for this Op type. In this mode the Nuke script command name remains the Op's name (Grade, Blur, etc) but allows the constructed Op to be a child of a specific Node class.

If the Node class is not found a warning is output and the Node constructor falls back to creating a generic OpNode.

Member Function Documentation

◆ add()

void Op::Description::add ( DD::Image::Description p)
staticprotected

Internals of the constructor, adds the description to the internal array and calls add_callback.

◆ find()

const Op::Description * Op::Description::find ( int  i)
static

Return the i'th Op::Description known about, or return a null pointer for the last one. This does not load any plugins, it only returns the ones that have been loaded so far.



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