Plugs

See also

The C++ Plug and Python rumba.Plug documentation.

Plugs can be input or output plugs. Input plugs can contain a Value, or be connected to another plug. In that case they get their value from the input plug.

Plugs have a name, a default value, some flags and an optional user interface descriptor.

The default value is used to define the accepted plug value type. The Value value type can be used as a generic type accepting any kind of values. For example, the Points value type can be used to accept any kind of geometry values with vertices.

Output Plug

An output plug computes a value using a static evaluation function. The output plug has dependances on other plugs of the node. The evaluation function and the dependances are provided during the node registration.

Example of an evaluation function:

  • c++
  • python
// The evaluation function
static Value eval_result( EvalContext& ctx )
{
    return ctx.as_float(0) + ctx.as_float(1);
}
# The evaluation function
def eval_result(ctx):
    return ctx.as_float(0) + ctx.as_float(1)

See also

The C++ EvalContext and Python rumba.EvalContext documentation.

Warning

An evaluation function might be called by any available thread. Multiple functions may be called in parallel, the same evaluation function may be called at the same time in different threads.

Warning

It is not recommended to develop node plug-ins in Python. Python node plug-ins are drastically slower and not parallelizable. Python support for plug-ins is proposed only to port existing Maya Python plugins. A scripting node will be soon available in Rumba 2.0 to generate fast evaluation code using the Python syntax.