[SESI logo]

Houdini Development Toolkit - Version 6.5

Side Effects Software Inc. 2004

Houdini

Version Notes for Houdini2.0

This document covers some of the changes which may be required to convert code written for Houdini1.2 to operate correctly with Houdini2.0.

Customization
Area
Changes
Functions The header file for custom functions was changed from libExpr.h> to EXPR.h. This reflects an internal change of the location of the expression library.
Functions The structure defining EV_FUNCTION was changed to a C++ class. This allows sub-classing of the function declaration class to allow for additional data to be allocated. This means that all tables of custom functions must have their signature changed.

Example:

EV_FUNCTION functions[] { { 0, "myfunc", NARGS, RETURN_TYPE, ARG_TYPES, CALLBACK, 0 }, { 0 } }; ... for (i = 0; functions[i].name; i++) ev_AddFunction(&functions[i]); Should be changed to: EV_FUNCTION functions[] { EV_FUNCTION(0, "myfunc", NARGS, RETURN_TYPE, ARG_TYPES, CALLBACK), EV_FUNCTION(), }; ... for (i = 0; functions[i].getName(); i++) ev_AddFunction(&functions[i]);
Functions There is an additional callback available on the EV_FUNCTION class. This allows "per-instance" data to be allocated. Each time the function is referenced in an expression, data can be allocated for that instance. The callbacks to allocate/free data can be accessed through the static member function:
&nbsb; EV_FUNCTION::setInstanceAllocator
Which takes the name of the function and two pointers to functions to allocate and free the memory.

Each time the expression is edited by the user, this data will be cleared and re-allocated (if needed).

This per-instance data can be used to optimize function evaluation (by caching pre-computed information).

If data for the function is needed, this can be built by sub-classing the EV_FUNCTION class (or by having static data in the C file).

Caveat: Be careful when caching information per function since the arguments to the function may be animated.

Functions There are additional data types supported in the expression library. It is possible to add custom vector and matrix expression functions now. Please see updated documentation for how to use this.
OPs The addNongraphInput method has been changed to addExtraInput. This method allows you to specify an interest in certain types of changes to another node. These changes are picked up automatically by most expressions, however, there are many cases where the OP cooking must find out about changes to another node somewhere in the graph.

Using addExtraInput, it is possible to express interests to have yourself re-cooked when:

  • OP_INTEREST_PARM: A parameter is changed. This includes animating parameters.
  • OP_INTEREST_DATA: The node is re-cooked.
  • OP_INTEREST_FLAG: A flag changes in the node.
  • OP_INTEREST_NAME: The node is re-named.
  • Example: If a SOP references a COP via parameters, you would want to add an extra input for the SOP indicating that it's interested in the COP. As a minimum, you would be interested in a name change (if the COP is re-named, you want your parameters to be updated and have the reference change its name). Typically, you would also be interested in the data (if the COP cooks, you would want to re-cook also).

    sop->addExtraInput(cop, OP_INTEREST_NAME|OP_INTEREST_DATA)

    OPs With the advent of OP sub-networks, some code becomes unsafe. If you have a SOP and ask for the parent of the SOP, it is no longer guaranteed that the parent is an object.

    Previously: obj = (OBJ_Node *)(sop->getParent());

    A new method OP_Node::getCreator has been added to climb through any intervening sub-network nodes and find the original creator of the given operator type. For sops getCreator returns the object, for tops it returns the shader and for cops it returns the composite network. So the new version of the above becomes:

    Now: obj = (OBJ_Node *)(sop->getCreator());

    Mantra Documentation has been added for creation of custom light shaders for mantra.


    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