[SESI logo]

Houdini Development Toolkit - Version 6.5

Side Effects Software Inc. 2004

General Operators

Classes Hierarchy

Operators are distinct modules which can be hooked together to form networks. The major classes in the OP hierarchy are:
  • OP_Node
  • OP_Parameters
  • OP_Network
  • OP_Director
  • The OP_Node is the base class for all operators. This class manages general operator characteristics such as flags, location, connections to other nodes, etc. It also provides functionality to subclasses via virtual methods. For example, the cook() method tells the operator to cook itself. Each class that is subclassed from the OP_Node must provide its own cook() method because each operator type is unique and will need to be cooked differently.

    The OP_Parameters class exists to handle the parameters associated with every OP_Node. It manages and evaluates the channels associated with the node. It also performs the task of error handling.

    The OP_Network is a subclass of the OP_Node. It is a container class for a network of OP_Nodes. It is important to remember that an OP_Network is also itself an OP_Node. This means it is possible to have a network of networks.

    The OP_Director is a special network. It is the root node of all networks and provides access to other important classes such as the CH_Manager (for managing channels) and the CMD_Manager (for handling Houdini commands). The global function OPgetDirector() can be used to get the root of the hierarchy at any time.

    In Houdini, the OP_Director is the root of the node tree. Under the director are managers (Object, Composite Network, Shader, and Output Drivers). Each manager contains a network of nodes. The object manager contains networks of OBJ_Node nodes which are in turn networks which contain SOP_Node nodes. The output driver manager contains a list of ROP_Node nodes.

    The Houdini Development Toolkit allows you to add custom nodes of any type (except a director).


    Useful Methods

    This document does not cover every method in the OP hierarchy. Rather it provides documentation on some of the more useful methods. These are the methods you may need to write a custom operator.

    Methods defined in OP_Node.h

        nInputs()
    
    Returns the number of inputs which are being used for this operator.

        getInput(int index)
    
    Returns the node which is connected at the input specified.

        getFullPath()
    
    Creates the full Houdini path for this node.

        getNchildren()
    
    Returns the number of nodes contained in this network

        getChild(int index)
        getChild(const char *)
    
    Returns the child specified. You can specify the child either by its index or by its name.

    Methods defined in OP_Network.h

        getDisplayNodePtr()
        getRenderNodePtr()
        getCurrentNodePtr()
    
    Returns a pointer to the display, render or current node of a network.

    Methods defined in OP_Parameter.h

        evalInt(...)
        evalFloat(...)
        evalString(...)
    
    These are defined in OP_Parameters.h. They evaluate parameters and do all the channel evaluation and string expansion. The parameters to the function specify which parameter to evaluate. The first parameter to the function determines which element in the template list is to be evaluated. You can specify this as an integer index (which can be difficult to keep track of), as a string (which is slow to look up), or as a cached string lookup. The cached string lookup is passed the string and a reference to an integer. The first time the parameter is evaluated, the index will be computed and stuffed into the integer reference. After that, the index will be used for fast evaluation.

    Usually, these functions are embedded into in-line functions for easier comprehension in the sub-class code.

    See also Parameters for Operators.

        enableParm(int, int on_off)
        enableParm(const char *, int on_off)
    
    These can be used to enable or disable parameters in the user interface.

    Methods defined in OP_Director.h

        getCwd()
    
    Returns the current working directory. This is the network or node which is currently active. This is usually the result of an opcf command in the textport.

        getCommandManager()
    
    This gives you access to the command manager. Through the command manager, you can find out about animation information. The command manager is also used to execute houdini commands. See also The Command Interface.


    Table of Contents
    Operators | Surface Operations | Particle Operations | Composite Operators | Channel Operators
    Material & Texture | Objects | Command and Expression | Render Output |
    Mantra Shaders | Utility Classes | Geometry Library | Image Library | Clip Library
    Customizing UI | Questions & Answers

    Copyright © 2004 Side Effects Software Inc.
    477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7