All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
14.0: Major Changes In The HDK

General Geometry Library Changes

Many deprecated functions and classes have been deleted, especially many functions using GEO_Point or GEO_Vertex. GEO_Point objects are no longer ever stored on the detail. Some functions that should have already been deprecated are now deprecated, especially attribute access functions that are holdovers from Houdini 11.1's geometry library. Deletion of deprecated functions and classes will continue in the next major version of Houdini.

GU_Primitive no longer exists, saving 8 bytes on every primitive in Houdini, avoiding the casting problems associated with multiple superclasses having virtual functions, and avoiding the need for primitive types to have separate classes in GU. The tetprim HDK example has been updated for this, with GU_PrimTetra being eliminated. Built-in primitive types still have their GU classes for now, but these may be merged into their GEO classes in the next major version. Most functions from GU_Primitive that weren't deprecated or rendered unnecessary were moved to GEO_Primitive. A few that were only relevant for particular classes were moved to those classes, e.g. GEO_Face. GU_Curve and GU_TPSurf now only contain static functions, so are effectively just namespaces.

Header files have been partly optimized to reduce including hefty header file trees when including other header files. For example, UT_ParallelUtil.h and GA_SplittableRange.h are no longer brought in when GA_Detail.h is included, so if you use them, you must include them yourself. GEO_AttributeHandle.h and GEO_Point.h, containing the deprecated GEO_AttributeHandle and GEO_Point, still exist, but are not included in GEO_Detail.h anymore.

Existing functions for computing normals have been moved to GEO_Detail, and have been unparallelized for the moment, because the parallelism introduced nondeterministic roundoff. There is also now GEOcomputeNormals in GEO_Normal.h, which allows more accurate, but slower, computation of point, vertex, primitive, or detail normals, optionally for just a point, vertex, primitive, or edge group, (independent of the type of normals).

Functions on GA_Detail previously returning GA_ROAttributeRef or GA_RWAttributeRef now return const GA_Attribute* or GA_Attribute*, so any calls to getAttribute(), get(), or isValid() directly on the return value will now result in a compile error, but thankfully, these calls have been rendered redundant by this change.

See Data IDs for information on data IDs, if you choose to use them. Most HDK SOP examples have been updated to support them, but extreme caution is recommended if you decide to use them, because small mistakes may cause the viewport to not update properly, and may cause mysterious issues with cooking in the near future.

UT_Array Changes

For better consistency with naming in other software, UT_Array now has size() to get the number of elements in the array, setSize() to set the number of elements in the array, capacity() to get the number of elements for which memory has been allocated, and setCapacity() to preallocate memory. entries() has not yet been deprecated, since it is still so heavily used, but will probably eventually be deprecated. The previous resize() has been deleted to avoid confusion; it had the behaviour of setCapacity().

operator[] hasn't been eliminated yet, but the current long-term plan is still to eliminate it, go a major version without it to make sure that it's eliminated by all HDK users, and then reintroduce it with the current behaviour of operator(). If you need the current resizing or out-of-bounds reading behaviour of operator[], use forcedGet() or forcedRef() instead.

Can now write custom pixel filters for Mantra

It is now possible to write a custom pixel filter for Mantra. VRAY_DemoEdgeDetectFilter is provided as an example, which should be the same as the edgedetect filter that's new in 14.0.

Pixel filters take a source rectangle of primary ray samples for a particular image plane, and reduce these to a destination rectangle of pixel values. They are often used to significantly reduce noise or artifacts, by making assumptions about the nature of the image being rendered, such as that adjacent pixels of sufficiently similar colour should only vary smoothly.

These filters can optionally request that certain special image planes be present, like the z-depth and operator ID, as shown in the example, and can also check for other image planes by name, using VRAY_PixelFilter::getChannelIdxByName(), which returns -1 if the channel isn't present.

UT_StringMap and UT_StringSet Changes

UT_StringMap and UT_StringSet (along with UT_SortedStringMap and UT_SortedStringSet) now use UT_StringHolder instead of UT_StringKey, and the SAFE_STRINGS template parameter has been removed. UT_StringHolder makes a copy of the string by default, and UT_StringRef can be used to construct a UT_StringHolder that is a shallow reference to a const char *. This allows a map to contain a mix of shallow references and copied strings.

Channel Evaluation Context Changes

The following methods related to channel evaluation context have been removed:

  • CH_Collection::setEvalChannel()
  • CH_Collection::getEvalChannel()
  • CH_Collection::getEvalChannelName()
  • CH_Channel::setLocalEvalTime()
  • CH_Manager::getEvalCollection()

These have been replaced by the CH_EvalContext class obtained via CHgetManager()->evalContext() method. Some helper classes can be used for common patterns related to changing the channel evaluation context:

The CH_Collection::getGlueIV(), CH_Collection::getGlueTime(), CH_Collection::getGlueSlope() methods have been moved from CH_Collection to CH_Channel so that they can be inlined without adding header dependencies.

UT_RefCount Removed

The class UT_RefCount has been removed. The replacement for it is to use UT_IntrusivePtr and UT_IntrusiveRefCounter in the calling code. Please see UT_IntrusivePtr.h.

GT_PrimTube and GT_PrimQuadric Changes

The GT_TransformHandle members have been removed from GT_PrimTube and GT_PrimQuadric, and those classes now use the GT_TransformHandle from their base class (GT_Primitive). Calls to getTransform() on a GT_PrimTube or a subclass of GT_PrimQuadric should be replaced by a call to getPrimitiveTransform().

GEO_IOTranslator Interface Changes

The GEO_IOTranslator interface has changed virtual method signatures that subclasses must adhere to. The changed methods are:

OP_AutoLockInputs Changes

The interface for OP_AutoLockInputs has changed, and all HDK SOP examples that have inputs have been updated to use it, to reduce problems with forgetting to unlock inputs. One example uses the lockInput() function, to lock a single input at a time, namely SOP_TimeCompare. The rest use lock(), to lock all inputs at once.