Houdini Development Toolkit - Version 9.0
Side Effects Software Inc. 2007
Compositing Operators
Guidelines for coding COPs
Here are some guidelines you should follow when creating a new COP.
- Do not evaluate parameters in cookMyTile(). It is a threaded
method, and parameter evaluation is not threadsafe.
- Do not use static data in cookMyTile(), as more than one thread
may be executing there.
- Never call inputTile() or inputRegion() from anything other than
a cookMyTile()/doCookMyTile() method (or a method called by these
methods).
- Always release the tiles and regions returned by inputTile() or
inputRegion() with releaseTile() or releaseRegion() (even if an error
occurs during the cook). Failure to do this will result in that memory
staying allocated until the end of the cook.
- Never delete TIL_Regions or TIL_Tiles returned from inputRegion()
or inputTile(); use the release...() methods.
- If a method returns a pointer to you, always check it against
NULL before proceeding. Many COP methods can return NULL as a valid
result.
- Do not delete COP2_ContextData objects. They are automatically
cleaned up by the cook engine.
Hints
- Before designing a node in the HDK, prototype it in VEX (if
possible). It is much faster to do design iterations in VEX than in C++
(you don't even need to restart Houdini). You also may find that the
VEX code is fast enough, and avoid writing an HDK node altogether.
- Always use the COP family subclasses wherever possible. They will
not only save you work, but provide extra features to your COP (like
scoping and masking) for free.
- When designing an algorithm that can be optimized for
constant-valued areas, always check if the input TIL_Tile or TIL_Region
is constant (TIL_Tile::isConstantTile(), TIL_Region::isConstant()).
Algorithms like blurs or kernel functions can be almost completely
optimized out, and mattes tend to have many constant tiles in them.
- If you can implement your image algorithm as a Pixel Operation (derived from COP2_PixelOp,
using an RU_PixelFunction), do so. It is highly optimized, and also
much easier to write a Pixel Operation COP than other COPs.
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 © 2007 Side Effects Software Inc.
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7