Houdini Engine 6.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
What's New in HAPI

What's New in HAPI 6.0

Support for Dictionary Attribute Types:

  1. (Added) HAPI_SetAttributeDictionaryData()
  2. (Added) HAPI_SetAttributeDictionaryArrayData()
  3. (Added) HAPI_GetAttributeDictionaryData()
  4. (Added) HAPI_GetAttributeDictionaryArrayData()

What's New in HAPI 5.0

PDG Graph Contexts Count:

  1. (Added) HAPI_GetPDGGraphContextsCount() returns the total number of PDG graph contexts found.
  2. (Modified) HAPI_GetPDGGraphContexts(): this method now requires "start" and "length" parameters to determine the range of context names and ids to return.
  3. (Added) HAPI_CookOptions::preferOutputNodes: if this is set to true, cooking an OBJ node will cook the output nodes of any nested SOP nodes. If none are found or the option is set to false, HAPI will instead cook the display nodes of any nested SOP nodes.

What's New in HAPI 4.2

Versioning Conventions:

Starting with Houdini 19.0, Houdini Engine will be following new conventions for updating the version numbers that are specified in HAPI_Version.h. The main goal of these new conventions is to be able to easily identify whether a Houdini Engine plugin is compatible with a particular Houdini build. For example, you may want to use a newer build of a Houdini Engine plugin without having to upgrade the full Houdini installation across your entire studio. There are three components that comprise the Houdini Engine version:

  1. HAPI_VERSION_HOUDINI_ENGINE_MAJOR
  2. HAPI_VERSION_HOUDINI_ENGINE_MINOR
  3. HAPI_VERSION_HOUDINI_ENGINE_API

HAPI_VERSION_HOUDINI_ENGINE_MAJOR specifies the major version of Houdini Engine and will now be bumped for every major release of Houdini to indicate that there may be fundamental differences or API backwards compatibility breaking changes between Houdini Engine releases. For a Houdini Engine plugin to be compatible with a Houdini installation, the major version must match.

HAPI_VERSION_HOUDINI_ENGINE_MINOR specifies the minor version of Houdini Engine. This number will be bumped whenever a change is made that breaks ABI compatibility and for changes that could result in a serious bug if the Houdini Engine plugin is not recompiled. For a Houdini Engine plugin to be compatible with a Houdini installation, the minor version must match.

HAPI_VERSION_HOUDINI_ENGINE_API specifies the current patch number of Houdini Engine. This number is reset to 0 whenever the HAPI_VERSION_HOUDINI_ENGINE_MINOR version is bumped. The patch number is bumped any time that a change is made within the Houdini Engine libraries. For example, this number would be bumped when adding a new method to HAPI. A Houdini Engine plugin is compatible with Houdini versions that have the same or a higher HAPI_VERSION_HOUDINI_ENGINE_API number.

Support for UInt8, Int8, and Int16 Attribute Types:

  1. (Added) HAPI_SetAttributeUInt8Data()
  2. (Added) HAPI_SetAttributeInt8Data()
  3. (Added) HAPI_SetAttributeInt16Data()
  4. (Added) HAPI_GetAttributeUInt8Data()
  5. (Added) HAPI_GetAttributeInt8Data()
  6. (Added) HAPI_GetAttributeInt16Data()

Set Array Attributes:

  1. (Added) HAPI_SetAttributeFloat64ArrayData()
  2. (Added) HAPI_SetAttributeFloatArrayData()
  3. (Added) HAPI_SetAttributeInt16ArrayData()
  4. (Added) HAPI_SetAttributeInt64ArrayData()
  5. (Added) HAPI_SetAttributeInt8ArrayData()
  6. (Added) HAPI_SetAttributeIntArrayData()
  7. (Added) HAPI_SetAttributeStringArrayData()
  8. (Added) HAPI_SetAttributeUInt8ArrayData()

HAPI_CookOptions Updates:

  1. (Added) HAPI_CookOptions::cacheMeshTopology: if this is set to true, cooking a mesh geometry will update only the topology if the number of points changed. Use this to get better performance on deforming meshes.
  2. (Changed) HAPI_CookOptions::splitGroupSH: added the ability to specify which group(s) the geometry should be split by when splitGeosByGroup is enabled.

Node Lookup:

  1. (Added) HAPI_GetNodeFromPath(): this function can be used to retrieve the HAPI_NodeId of a node given its scene path.
  2. (Added) HAPI_GetOutputGeoCount(): new method which can be used in conjunction with HAPI_GetOutputGeoInfos to locate the main geometry output nodes of an Object or SOP node.
  3. (Added) HAPI_GetOutputGeoInfos(): new method which can be used in conjunction with HAPI_GetOutputGeoCount to locate the main geometry output nodes of an Object or SOP node.

Custom Strings:

  1. (Changed) HAPI_SetCustomString(): multiple custom strings can now be stored with HAPI_SetCustomString.

Support for Edge Groups:

  1. (Added) HAPI_GroupType::HAPI_GROUPTYPE_EDGE: added a new edge group enumerator to the HAPI_GroupType enumeration.
  2. (Added) HAPI_GeoInfo::edgeGroupCount: specifies how many edge groups that the geometry has.
  3. (Added) HAPI_GetEdgeCountOfEdgeGroup(): gets the number of edges that belong to an edge group on a geometry part.
  4. (Changed) HAPI_GetGroupMembership(): this method now supports edge groups.
  5. (Changed) HAPI_SetGroupMembership(): this method now supports edge groups.

Support for Setting Compositor Options:

  1. (Added) HAPI_CompositorOptions struct
  2. (Added) HAPI_GetCompositorOptions()
  3. (Added) HAPI_SetCompositorOptions()
  4. (Added) HAPI_CompositorOptions_Init()
  5. (Added) HAPI_CompositorOptions_Create()

Server Configuration:

  1. (Changed) HAPI_SetServerEnvString(): in addition to setting the environment variable, this method will now update the variable in hscript (if it exists) and Python's os.environ.
  2. (Changed) HAPI_SetServerEnvInt(): in addition to setting the environment variable, this method will now update the variable in hscript (if it exists) and Python's os.environ.

Parameters:

  1. (Added) HAPI_ParmInfo::useMenuItemTokenAsValue: new flag that indicates whether the "Use Menu Item Token As Value" option is enabled on an integer menu item.

Licensing:

  1. (Added) The Houdini Engine for Unity/Unreal license now supports Unreal Engine 5.
  2. (Added) HAPI_License::HAPI_LICENSE_HOUDINI_ENGINE_UNITY_UNREAL: added a new enumerator to the HAPI_License enumeration that specifies the Houdini Engine for Unity/Unreal license.

Input Curves:

Added the concept of “Input Curves”, a set of helper functions aimed to marshall curve data directly into HAPI with validity checking and other functionalities.

  1. (Added) HAPI_CreateInputCurveNode(): Creates and sets up a HAPI input curve
  2. (Added) HAPI_InputCurveInfo struct
  3. (Added) HAPI_GetInputCurveInfo(): Retrieves data regarding the part’s input curve info.
  4. (Added) HAPI_SetInputCurveInfo(): Sets data regarding the part’s input curve info
  5. (Added) HAPI_SetInputCurvePositions(): Sets the curve CV positions for an input curve
  6. (Added) HAPI_SetInputCurvePositionsRotationsScales(): Sets the curve CV positions, as well as adds a specified rot and scale attribute to each CV.

Python Bindings:

  1. (Added) Better API documentation to the official Houdini docs.
  2. (Added) Structs now return a descriptive string when passed to repr(..)
  3. (Added) Structs fields can now be initialized by passing a list of keyword arguments to the constructor that match the field names.

What's New in HAPI 3.3

New Python HAPI Module

Query Array Attributes:

  1. (Added) HAPI_GetAttributeIntArrayData() to query int array attribute data.
  2. (Added) HAPI_GetAttributeInt64ArrayData() to query int64 array attribute data.
  3. (Added) HAPI_GetAttributeFloatArrayData() to query float array attribute data.
  4. (Added) HAPI_GetAttributeFloat64ArrayData() to query float64 array attribute data.
  5. (Added) HAPI_GetAttributeStringArrayData() to query string array attribute data.

SessionSync Updates:

  1. (Added) HAPI_Viewport struct to hold data to synchronize viewports in SessionSync.
  2. (Added) HAPI_GetViewport() will retrieve the HAPI_Viewport that Houdini has set.
  3. (Added) HAPI_SetViewport() will update HAPI_Viewport which Houdini will synchronize with.
  4. (Added) HAPI_SessionSyncInfo struct to hold SessionSync data for synchronizing state and settings.
  5. (Added) HAPI_GetSessionSyncInfo() will retrieve the HAPI_SessionSyncInfo that Houdini has set.
  6. (Added) HAPI_SetSessionSyncInfo() will update HAPI_SessionSyncInfo which Houdini will synchronize with.

Connection Errors:

  1. (Added) HAPI_ClearConnectionError() will clear the connection error.
  2. (Added) HAPI_GetConnectionErrorLength() will return the connection error string length.
  3. (Added) HAPI_GetConnectionError() will return the connection error string.

Save or Load Node:

  1. (Added) HAPI_SaveNodeToFile() saves a node network in current Houdini Engine session. Supports SOP/output, Object/subnet, and SOP/subnet. The node network is saved with all children and parm values.
  2. (Added) HAPI_LoadNodeFromFile() loads a node network in current Houdini Engine session. Supports SOP/output, Object/subnet, and SOP/subnet.

Houdini Time:

  1. (Added) HAPI_GetUseHoudiniTime() returns whether Houdini Engine should use the current Houdini timeline time for cooking.
  2. (Added) HAPI_SetUseHoudiniTime() sets Houdini Engine to use the current Houdini timeline time for cooking

SessionSync:

  1. (Added) HAPI_SetSessionSync() enables or disables SessionSync mode in Houdini Engine. Enabling this will let Houdini Engine know that that the session is being used in Houdini via SessionSync. For example, it will automatically use the Houdini timeline to cook instead of using the Houdini Engine time which defaults to 0, or whatever value the plugin has set via HAPI_SetTime.

Total Cook Count:

  1. (Added) HAPI_GetTotalCookCount() returns the total cook count of a node and its children. This allows to poll from the client side to see if node needs to be recooked in HAPI and its geometry regenerated.

HeightField Sampling:

  1. (Added) HAPI_HeightFieldSampling for specifying center or corner sampling for heightfield.
  2. (Added) HAPI_CreateHeightFieldInput() which takes in HAPI_HeightFieldSampling sampling argument to specify center or corner sampling.
  3. (Deprecated) HAPI_CreateHeightfieldInputNode().

Asset Definition Parms:

  1. (Added) HAPI_GetAssetDefinitionParmCounts(), HAPI_GetAssetDefinitionParmInfos(), and HAPI_GetAssetDefinitionParmValues() to query HAPI_ParmInfo and default parm values from asset definition without needing to create the asset node in session.

Display Flag:

  1. (Added) HAPI_SetNodeDisplay() to set the specified node's display flag.

Instances:

  1. (Deprecated) HAPI_GetInstanceTransforms() is now marked as deprecated. Use HAPI_GetInstanceTransformsOnPart() instead (using Part 0 for previous behaviour).

PDG:

  1. (Modified) HAPI_PDG_EventType has been changed to a non-bitmask integer type.
  2. (Added) HAPI_GetPDGGraphContextId() to get the PDG graph context for the specified TOP node.

What's New in HAPI 3.2

Initialization

  1. (Modified) HAPI_Initialize now tries to set the HFS environment variable if it was not manually setup before.
  2. (Modified) HAPI_CookOptions now has a checkPartChanges member that enables checking if newly refined part data matches the prior part data and will update HAPI_PartInfo.hasChanged accordingly.
  3. (Modified) HAPI_CookOptions now has a splitGeosByAttribute option that enable splitting geos by unique values of a specified attribute.

Asset

  1. (Added) HAPI_AssetInfo now has a geoOutputCount for the number of geometry outputs exposed by the asset.

Nodes

  1. (Modified) Fixed HAPI_DeleteNode destroying the parent OBJ when called on a SOP node. The parent OBJ is now destroyed only if it is empty.
  2. (Modified) Fixed HAPI_RenameNode not updating child nodes nor node-type parameters with the updated parent name in their paths.
  3. (Modified) HAPI_ConnectNodeInput uses an added output_index parameter to select the output to connect from.
  4. (Added) HAPI_DisconnectNodeOutputsAt to disconnect all of a node's output connections at the output index.
  5. (Added) HAPI_QueryNodeOutputConnectedCount and HAPI_QueryNodeOutputConnectedNodes to get the number/the nodes currently connected to the given node at the output index.
  6. (Modified) HAPI_NodeInfo now has the number of outputs that the specific node has in the outputCount member.
  7. (Modified) HAPI_NodeInfo now has a "isTimeDependent" boolean member to describe if the node's results will change over time.
  8. (Modified) Added HAPI_NODEFLAGS_SOP_GUIDE to HAPI_NodeFlags, this allows guide geometry to be queried from an asset when using HAPI_ComposeChildNodeList.

Parameters

  1. (Added) HAPI_ParmHasExpression, HAPI_GetParmExpression, HAPI_SetParmExpression and HAPI_RemoveParmExpression to check, get, set and remove expressions on float and int parms.
  2. (Added) HAPI_RevertParmToDefault/HAPI_RevertParmToDefaults to revert a single/all instances of a parm to its default.
  3. (Modified) Fixed HAPI_GetParmNodeValue throwing error due to checking wrong index.
  4. (Modified) Changed the HAPI_ParmType order so the new HAPI_PARMTYPE_PATH_FILE_DIR type is at the end to avoid serialization issues.
  5. (Modified) Added HAPI_ParmInfo.scriptType and the HAPI_PrmScriptType enum. This corresponds to the houdini-type as shown in the Type Properties window and the tokens used in DialogScript files.
  6. (Modified) Fixed an issue with HAPI treating logarithmic int parms as floats.
  7. (Modified) Fixed HAPI_ParmHasExpression() returning true when the parameter had no expression.

Attributes

  1. (Added) HAPI_DeleteAttribute to delete an attribute on an input geo. (input nodes only).
  2. (Modified) HAPI_ParmInfo now has visibilityConditionSH and disabledConditionSH member to access the parameters "Hide When" and "Disable When" condition strings.
  3. (Modified) It is now possible to add/set attribute on input volumes, HAPI_PartInfo now indicates the proper number of attributes for volumes, as well as their point/vertex/face counts.

Groups

  1. (Added) HAPI_DeleteGroup to remove a group from an input geo.

Packed Primitives

  1. (Added)Added HAPI_GetGroupCountOnPackedInstancePart, HAPI_GetGroupNamesOnPackedInstancePart, HAPI_GetGroupMembershipOnPackedInstancePart for getting the number of groups, their names an membership values in a packed primitive part,

PDG

  1. (Added) HAPI_GetPDGGraphContexts that returns an array of PDG graph context names and ids
  2. (Added) HAPI_CookPDG to start a PDG cooking operation.
  3. (Added) HAPI_GetPDGEvents to returns the PDG events that have been collected.
  4. (Added) HAPI_GetPDGState that returns the state of a PDG graph.
  5. (Added) HAPI_CreateWorkitem to create a new pending workitem for the given node.
  6. (Added) HAPI_GetWorkitemInfo that retrieves the info of a given workitem by id.
  7. (Added) HAPI_SetWorkitemIntData, HAPI_SetWorkitemFloatData and HAPI_SetWorkitemStringData to add integer/float/string data to a pending PDG workitem data member for a given node.
  8. (Added) HAPI_CommitWorkitems to commit any pending workitems.
  9. (Added) HAPI_GetNumWorkitems returns the number of workitems that are available on a given node.
  10. (Added) HAPI_GetWorkitems to return the list of workitem ids for the given node
  11. (Added) HAPI_GetWorkitemDataLength to get the length of the workitem data member.
  12. (Added) HAPI_GetWorkitemIntData, HAPI_GetWorkitemFloatData and HAPI_GetWorkitemStringData to get the int/float/string data from a work item member.
  13. (Added) HAPI_GetWorkitemResultInfo to access the info for workitem results
  14. (Added) HAPI_PausePDGCook and HAPI_CancelPDGCook to respectivelypause or cancel a PDG cooking operation.
  15. (Added) HAPI_DirtyPDGNode to dirty a given node.
  16. (Added) HAPI_PDG_State, HAPI_PDG_EventType, HAPI_PDG_Workitem enums.
  17. (Added) HAPI_PDG_EventInfo, HAPI_PDG_WorkitemInfo, HAPI_PDG_WorkitemResultInfo structs.
  18. (Modified) Added PDG cook event message string handle (msgSH) to HAPI_PDG_EventInfo, that contains the cook event's message/error if it has one.

Environment

  1. (Added) HAPI_GetServerEnvVarCount() to get the number of env vars that are in the server environment's process
  2. (Added) HAPI_GetServerEnvVarList() provides a list of all the environment variables in the server's process

Heightfield

  1. (Added) HAPI_CreateHeightfieldInputNode to create and initialize the nodes needed for Heightfields.
  2. (Added) HAPI_CreateHeightfieldInputVolumeNode to create and initialize an Input volume node that can be used as additional mask for Heightfields.

Instances

  1. (Added) Added HAPI_GetInstanceTransformsOnPart() that works like HAPI_GetInstanceTransforms(), but the partId can be specified.
  2. (Modified) Fixed point instancers sometimes being ignored because HAPI_GetInstanceTransforms() was only looking for point instancer in part 0.

Strings

  1. (Added) HAPI_GetStringBatchSize and HAPI_GetStringBatch allow batching string value queries for effectiveness.
  2. (Added) HAPI_SetCustomString and HAPI_RemoveCustomString to add/remove strings to the string table. Access to the string is the responsibility of the caller. The intended use for custom strings is to allow structs that reference strings to be passed in to HAPI

Utilities

  1. (Modified) Fixed HAPI_ConvertTransformQuatToMatrix returning incorrect values when converting radians to degrees.

Materials

  1. (Modified) Fixed a bug where HAPI_ExtractImageToFile() was writing out corrupt image.
  2. (Added) Added HAPI_GetImageFilePath to get the path that a texture would be extracted to. This avoids doing the actual extract (whic is slow) just to get the path.

Handles

  1. (Modified) added "assetParmIndex" field to the HAPI_HandleBindingInfo that is set to the index of the bound component attribute for int, float vector and color parameters.

What's New in HAPI 3.1

Sessions

  1. (New) HAPI_ThriftServerOptions struct added for better argument management.
  2. (Modified) HAPI_StartThriftSocketServer() and HAPI_StartThriftNamedPipeServer() will now take the new HAPI_ThriftServerOptions struct containing the port and timeout instead of separate parameters.

Initialization

  1. (Modified) HAPI_SetEnvFiles() removed in favor of a new houdini_environment_files parameter on HAPI_Initialize().
  2. (New) HAPI_CookOptions::extraFlags member added for internal use.

Diagnostics

  1. (New) HAPI_ComposeNodeCookResult(), HAPI_GetComposedNodeCookResult(), and HAPI_CheckForSpecificErrors() added to help with getting errors and warnings on specific nodes.
  2. (New) HAPI_ErrorCode enum added for use with HAPI_CheckForSpecificErrors().

Utility

  1. (New) All HAPI transforms now have shear support.
  2. (New) HAPI_SHEAR_VECTOR_SIZE define added for shear support.
  3. (New) HAPI_Transform::shear[] added for shear support.
  4. (New) HAPI_TransformEuler::shear[] added for shear support.

Assets

  1. (Removed) HAPI_AssetId typedef removed since it is now just a HAPI_NodeId.
  2. (Removed) HAPI_AssetInfo::id member since it is now just a HAPI_NodeId and that is already stored in HAPI_AssetInfo::nodeId.
  3. (Removed) HAPI_AssetType enum removed in favor of the HAPI_NodeType enum.
  4. (Removed) HAPI_AssetSubType enum as the distinction is no longer relevant.
  5. (Removed) HAPI_AssetInfo::type and HAPI_AssetInfo::subType remove as they are no longer used.
  6. (Removed) HAPI_AssetInfo::validationId removed in favor of HAPI_NodeInfo::uniqueHoudiniNodeId.
  7. (Removed) HAPI_IsAssetValid() removed in favor of the new HAPI_IsNodeValid().
  8. (Removed) HAPI_InstantiateAsset() removed in favor of HAPI_CreateNode().
  9. (Removed) HAPI_CreateCurve() removed in favor of HAPI_CreateNode().
  10. (Removed) HAPI_CreateInputAsset() removed in favor of HAPI_CreateInputNode().
  11. (Removed) HAPI_DestroyAsset() removed in favor of HAPI_DeleteNode().
  12. (Modified) HAPI_GetAssetInfo() now takes a HAPI_NodeId instead of HAPI_AssetId.
  13. (Removed) HAPI_CookAsset() now removed in favor of HAPI_CookNode().
  14. (Removed) HAPI_GetAssetTransform() removed in favor of HAPI_GetObjectTransform().
  15. (Removed) HAPI_SetAssetTransform() removed in favor of HAPI_SetObjectTransform().
  16. (Removed) HAPI_GetInputName() removed in favor of HAPI_GetNodeInputName() for node inputs and HAPI_GetParmInfo(), then getting the HAPI_ParmInfo::nameSH, for inputs that are actually exposed node path parameters.
  17. (Removed) HAPI_GetEditableNodeNetworks() and HAPI_AssetInfo::editableNodeNetworkCount removed in favor of HAPI_ComposeChildNodeList().
  18. (Modified) HAPI_AssetInfo::geoInputCount only lists node inputs. Object path parameters are not counted in this variable anymore.

HIP Files

  1. (Removed) HAPI_CheckForNewAssets() and HAPI_GetNewAssetIds() have been removed in favor of HAPI_ComposeChildNodeList() and HAPI_GetComposedChildNodeList() called on the HAPI_NODETYPE_OBJ manager node with recursive set to false.

Nodes

  1. (New) HAPI_NodeType enum added to replace the HAPI_AssetType enum.
  2. (New) HAPI_NodeInfo::type member added to store the node type.
  3. (New) HAPI_NodeInfo::parentId member added to easily get a node's parent node id.
  4. (New) HAPI_IsNodeValid() added to replace HAPI_IsAssetValid().
  5. (New) HAPI_GetNodePath() added to more easily get absolute or relative node paths.
  6. (New) HAPI_GetManagerNodeId() added to get the HAPI_NodeId for any top-level manager node (ie. "/obj").
  7. (New) HAPI_ComposeChildNodeList() and HAPI_GetComposedChildNodeList() added to make it easier to get a filtered list of child nodes under any node. Replaces HAPI_GetNodeNetworkChildren().
  8. (Removed) HAPI_GetNodeNetworkChildren() removed in favor of HAPI_ComposeChildNodeList() and HAPI_GetComposedChildNodeList().
  9. (Modified) HAPI_CreateNode():
    1. Is now an asynchronous function.
    2. Will now accept output from HAPI_GetAvailableAssets() which is the fully qualified name of the node and operator table. For this workflow, the parent_node_id should be -1.
  10. (New) HAPI_CreateInputNode() added to replace HAPI_CreateInputAsset().
  11. (New) HAPI_CookNode() added to be able to cook an individual node, which includes asset nodes.
  12. (New) HAPI_GetNodeInputName() added to get the name of a node input.

Parameters

  1. (Modified) HAPI_PARMTYPE_PATH_NODE was changed to HAPI_PARMTYPE_NODE.
  2. (New) HAPI_PARMTYPE_FOLDERLIST_RADIO enum added for the new radio tabs support.
  3. (New) HAPI_ParmInfo::tagCount member added for tags support.
  4. (New) HAPI_GetParmTagName() added to get a parameter tag name on a parameter.
  5. (New) HAPI_GetParmTagValue() added to get a parameter tag value on a parameter tag.
  6. (New) HAPI_ParmHasTag() added to quickly check if a parameter has a specific tag.
  7. (New) HAPI_GetParmWithTag() added to quickly find a parameter with a specific tag.
  8. (New) HAPI_GetParmNodeValue() and HAPI_SetParmNodeValue() added to get/set a HAPI_NodeId given a node path parameter, instead of just getting the node path string. These replace HAPI_ConnectAssetTransform, HAPI_DisconnectAssetTransform, HAPI_ConnectAssetGeometry, and HAPI_DisconnectAssetGeometry.
  9. (New) HAPI_ParmInfo::typeInfoSH member will now also indicate the OP node filter on OP node path parameters.
  10. (New) HAPI_ParmInfo::inputNodeType and HAPI_ParmInfo::inputNodeFlag members added to easily get the node type and flags linked by a OP Node path parameter.

Handles

  1. (Modified) HAPI_GetHandleInfo() and HAPI_GetHandleBindingInfo() now take a HAPI_NodeId instead of a HAPI_AssetId.

Objects

  1. (New) HAPI_ObjectInfo::isInstanced member added to easily tell if an object node is being instanced.
  2. (New) HAPI_ATTRIB_INSTANCE define added for the "instance" attribute name.
  3. (Removed) HAPI_ObjectId typedef removed since it is now just a HAPI_NodeId.
  4. (Removed) HAPI_ObjectInfo::id member since it is now just a HAPI_NodeId and that is already stored in HAPI_ObjectInfo::nodeId.
  5. (Removed) HAPI_GetObjects() removed in favor of HAPI_ComposeObjectList() and HAPI_GetComposedObjectList().
  6. (Removed) HAPI_GetObjectTransforms() removed in favor of HAPI_ComposeObjectList() and HAPI_GetComposedObjectTransforms().
  7. (New) HAPI_GetObjectInfo() added for convenience.
  8. (New) HAPI_GetObjectTransform() added for convenience.
  9. (New) HAPI_ComposeObjectList(), HAPI_GetComposedObjectList(), and HAPI_GetComposedObjectTransforms() added to replace HAPI_GetObjects() and HAPI_GetObjectTransforms().
  10. (New) HAPI_GetInstancedObjectIds() added to get the node ids of the objects being instanced.
  11. (Modified) ::HAPI_GetInstanceTransforms() and HAPI_SetObjectTransform() now just take the node id of the instancer object, instead of asset id, object id, and geo id.

Geos

  1. (Removed) HAPI_GeoId typedef removed since it is now just a HAPI_NodeId.
  2. (Removed) HAPI_GeoInfo::id member since it is now just a HAPI_NodeId and that is already stored in HAPI_GeoInfo::nodeId.
  3. (New) HAPI_GetDisplayGeoInfo() added to quickly give you the display SOP node id inside an object node.
  4. (Modified) HAPI_GetGeoInfo(), HAPI_GetPartInfo(), HAPI_GetFaceCounts(), HAPI_GetVertexList(), HAPI_GetAttributeInfo(), HAPI_GetAttributeNames(), HAPI_GetAttributeIntData(), HAPI_GetAttributeInt64Data(), HAPI_GetAttributeFloatData(), HAPI_GetAttributeFloat64Data(), HAPI_GetAttributeStringData(), HAPI_GetGroupNames(), HAPI_GetGroupMembership(), HAPI_GetInstancedPartIds(), HAPI_GetInstancerPartTransforms(), HAPI_SetPartInfo(), HAPI_SetFaceCounts(), HAPI_SetVertexList(), HAPI_AddAttribute(), HAPI_SetAttributeIntData(), HAPI_SetAttributeInt64Data(), HAPI_SetAttributeFloatData(), HAPI_SetAttributeFloat64Data(), HAPI_SetAttributeStringData(), HAPI_AddGroup(), HAPI_SetGroupMembership(), HAPI_CommitGeo(), and HAPI_RevertGeo() now just take the HAPI_NodeId of the SOP node, instead of the asset, object, geo ids.
  5. (Modified) HAPI_GetAttributeIntData() now takes an extra optional stride argument.
  6. (Modified) HAPI_GetGroupMembership() now takes an extra optional membership_array_all_equal argument.
  7. (Removed) HAPI_SetGeoInfo() removed as it never did anything anyway.
  8. (Modified) HAPI_AddGroup() now takes a HAPI_PartId argument.
  9. (Modified) HAPI_StorageType enum order has changed.
  10. (New) HAPI_CookOptions::splitPointsByVertexAttributes member added to enable face and vertex reduction optimization by creating more points to make attributes unshared.
  11. (Modified) HAPI_PartInfo::pointAttributeCount, HAPI_PartInfo::pointAttributeCount, HAPI_PartInfo::pointAttributeCount, and HAPI_PartInfo::pointAttributeCount have been converted to a single member that is an array of counts, called HAPI_PartInfo::attributeCounts[].

Inter-Asset Connections

  1. (Removed) HAPI_ConnectAssetTransform, HAPI_DisconnectAssetTransform, HAPI_ConnectAssetGeometry, and HAPI_DisconnectAssetGeometry removed in favor of HAPI_GetParmNodeValue(), HAPI_SetParmNodeValue(), HAPI_ConnectNodeInput(), and HAPI_DisconnectNodeInput().
  2. (Removed) HAPI_GeoInputInfo struct removed as it is no longer used.

Materials

  1. (Removed) HAPI_MaterialId typedef removed since it is now just a HAPI_NodeId.
  2. (Removed) HAPI_MaterialInfo::id member since it is now just a HAPI_NodeId and that is already stored in HAPI_MaterialInfo::nodeId.
  3. (Removed) HAPI_GetMaterialIdsOnFaces() in favor of HAPI_GetMaterialNodeIdsOnFaces().
  4. (New) HAPI_GetMaterialNodeIdsOnFaces() added to replace HAPI_GetMaterialIdsOnFaces().
  5. (Modified) HAPI_GetMaterialInfo(), HAPI_RenderTextureToImage(), HAPI_GetImageInfo(), HAPI_SetImageInfo(), HAPI_GetImagePlaneCount(), HAPI_GetImagePlanes(), HAPI_ExtractImageToFile(), HAPI_ExtractImageToMemory(), and HAPI_GetImageMemoryBuffer() now just take the HAPI_NodeId of the material node instead of the asset id and old material id.
  6. (Removed) HAPI_GetMaterialOnPart() removed in favor of HAPI_GetMaterialNodeIdsOnFaces().
  7. (Removed) HAPI_GetMaterialOnGroup() removed in favor of HAPI_GetMaterialNodeIdsOnFaces().
  8. (New) HAPI_RenderCOPToImage() added to allow direct COP node render to an image.
  9. (New) All material APIs now also work with the new VOP-based materials.
  10. (Removed) HAPI_MaterialInfo::assetId removed as the material is no longer specific to an asset.

Simulation/Animation

  1. (Modified) HAPI_ResetSimulation() now takes a HAPI_NodeId instead of a HAPI_AssetId.

Volumes

  1. (Modified) HAPI_GetVolumeInfo(), HAPI_GetFirstVolumeTile(), HAPI_GetNextVolumeTile(), HAPI_GetVolumeVoxelFloatData(), HAPI_GetVolumeTileFloatData(), HAPI_GetVolumeVoxelIntData(), HAPI_GetVolumeTileIntData(), HAPI_SetVolumeInfo(), HAPI_SetVolumeTileFloatData(), and HAPI_SetVolumeTileIntData() now take just a HAPI_NodeId instead of the asset id, object id, and geo id.
  2. (New) HAPI_GetHeightFieldData() and HAPI_SetHeightFieldData() added to easily get/set height field 2D volume data as a flat array.
  3. (New) HAPI_SetVolumeVoxelFloatData(), HAPI_SetVolumeVoxelIntData() added to set individual voxel values on volumes.
  4. (New) HAPI_GetVolumeBounds() added to easily access a volume's minimum, maximum and center bound values.

Curves

  1. (Modified) HAPI_GetCurveInfo(), HAPI_GetCurveCounts(), HAPI_GetCurveOrders(), HAPI_GetCurveKnots(), HAPI_SetCurveInfo(), HAPI_SetCurveCounts(), HAPI_SetCurveOrders(), and HAPI_SetCurveKnots() now take just a HAPI_NodeId instead of the asset id, object id, and geo id.

Basic Primitives

  1. (New) HAPI_PARTTYPE_BOX and HAPI_PARTTYPE_SPHERE part type enums added for the new primitive types.
  2. (New) HAPI_CookOptions::handleBoxPartTypes and HAPI_CookOptions::handleSpherePartTypes members added to enable or disable handling of the new primitive types.
  3. (New) HAPI_GetBoxInfo() added to get information for reproducing a box primitive.
  4. (New) HAPI_GetSphereInfo() added to get information for reproducing a sphere primitive.
  5. (New) HAPI_BoxInfo struct added for box primitive support.
  6. (New) HAPI_SphereInfo struct added for sphere primitive support.

Caching

  1. (Modified) HAPI_SaveGeoToFile(), HAPI_LoadGeoFromFile(), HAPI_GetGeoSize(), HAPI_SaveGeoToMemory(), and HAPI_LoadGeoFromMemory() now take just a HAPI_NodeId instead of the asset id, object id, and geo id.

Atributes

  1. (New) HAPI_AttributeInfo now has a HAPI_AttributeTypeInfo member that can be used to determine the attribute's purpose/type without solely relying on its name.
  2. (New) Added the HAPI_AttributeTypeInfo enum to describe an attribute's type.

Migration from HAPI 2.X to HAPI 3.X

Note
In HAPI3.0, object path parameters are no more considered as inputs and will not be counted with the SOP inputs in HAPI_NodeInfo::inputCount. Instead you should look for them in the asset's parameter list. Object path parameters will have their HAPI_ParmInfo::type set to HAPI_PARMTYPE_NODE type and should have their HAPI_ParmInfo::inputNodeType set to HAPI_NODETYPE_ANY, HAPI_NODETYPE_SOP or HAPI_NODETYPE_OBJ. Since these nodes are already object_merges, it is no longer necessary to connect them using HAPI_ConnectNodeInput(). You should instead connect them using HAPI_SetParmNodeValue() with the node id of the input node you created. See Inter-Asset Connections for more info.

Sessions

// OLD WAY
bool auto_close = true;
int port = 5;
float timout_ms = 1000;
HAPI_ProcessId process_id = 0;
HAPI_StartThriftSocketServer( auto_close, port, timeout_ms, &process_id );
HAPI_StartThriftNamedPipeServer( auto_close, port, timeout_ms, &process_id );
// NEW WAY
HAPI_StartThriftSocketServer( &thrift_server_options, port, &process_id );
HAPI_StartThriftNamedPipeServer( &thrift_server_options, port, &process_id );

Initialization

// Common Variables.
HAPI_Bool use_cooking_thread = true;
int cooking_thread_stack_size = -1;
const char * houdini_environment_files = "~/file1.env:~/file2.env";
const char * otl_search_path = nullptr;
const char * dso_search_path = nullptr;
const char * image_dso_search_path = nullptr;
const char * audio_dso_search_path = nullptr;
// OLD WAY
HAPI_SetEnvFiles( &session, houdini_environment_files );
&session, &cook_options, use_cooking_thread,
cooking_thread_stack_size,
otl_search_path,
dso_search_path,
image_dso_search_path,
audio_dso_search_path
);
// NEW WAY
// HAPI_SetEnvFiles() has been removed!
&session, &cook_options, use_cooking_thread,
cooking_thread_stack_size,
houdini_environment_files,
otl_search_path,
dso_search_path,
image_dso_search_path,
audio_dso_search_path
);

Assets

Checking validity:

// OLD WAY
int answer = 0;
int asset_validation_id = 0; // From the ::HAPI_AssetInfo struct.
HAPI_IsAssetValid( &session, asset_id, asset_validation_id, &answer );
// NEW WAY
int answer = 0;
int unique_node_id = 0; // From the ::HAPI_NodeInfo struct.
HAPI_IsNodeValid( &session, node_id, unique_node_id, &answer );

Instantiating:

// Returned by HAPI_GetAvailableAssets().
const char operator_name = "SOP/HAPI_Test_Assets_SOP";
// OLD WAY
HAPI_InstantiateAsset( nullptr, operator_name, true, &asset_id );
// NEW WAY
HAPI_CreateNode( nullptr, -1, operator_name, nullptr, true, &node_id );

Creating a curve:

// OLD WAY
HAPI_CreateCurve( nullptr, &asset_id );
// NEW WAY
HAPI_CreateNode( nullptr, -1, "SOP/curve", nullptr, true, &node_id );

Creating the input asset:

// OLD WAY
HAPI_CreateInputAsset( nullptr, &asset_id, "input_asset" );
// NEW WAY
HAPI_CreateInputNode( nullptr, &node_id, "input_asset" );

Destroying an asset:

// OLD WAY
HAPI_DestroyAsset( nullptr, asset_id );
// NEW WAY
HAPI_DeleteNode( nullptr, node_id );

Cooking an asset:

// OLD WAY
HAPI_AssetId asset_id = 0; // Returned by HAPI_InstantiateAsset().
HAPI_CookAsset( nullptr, asset_id, nullptr );
// NEW WAY
HAPI_NodeId node_id = 0; // Returned by HAPI_CreateNode().
HAPI_CookNode( nullptr, node_id, nullptr );

Getting and setting asset tranform:

// OLD WAY
HAPI_GetAssetTransform( nullptr, asset_id, rst_order, rot_order, &transform_euler );
HAPI_SetAssetTransform( nullptr, asset_id, &transform_euler );
// NEW WAY
HAPI_GetObjectTransform( nullptr, node_id, -1, rst_order, &transform );
HAPI_SetObjectTransform( nullptr, node_id, &transform );

Getting asset input name:

// Common Variables
int node_input_idx = 0;
int parameter_input_idx = 1; // An input that is actually an exposed node path parameter.
// OLD WAY
HAPI_NodeType input_type;
HAPI_GetInputName( nullptr, asset_id, node_input_idx, (int) input_type, &name );
HAPI_GetInputName( nullptr, asset_id, parameter_input_idx, (int) input_type, &name );
// NEW WAY
HAPI_ParmId parm_id = 0; // Need the parm id of the parameter corresponding to parameter_input_idx.
HAPI_ParmInfo parm_info = HAPI_ParmNode_Create();
HAPI_GetNodeInputName( nullptr, node_id, node_input_idx, &name ) );
HAPI_GetParmInfo( nullptr, node_id, parm_id, &parm_info );
name = parm_info.nameSH;

HIP Files

// OLD WAY
int new_asset_count = 0;
HAPI_CheckForNewAssets( nullptr, &new_asset_count );
std::vector< HAPI_AssetId > asset_ids_array( new_asset_count );
HAPI_GetNewAssetIds( nullptr, asset_ids_array.data(), new_asset_count );
// NEW WAY
int child_node_count = 0;
const bool recursive = false;
HAPI_NodeId obj_manager; HAPI_GetManagerNodeId( nullptr, HAPI_NODETYPE_OBJ, &obj_manager );
HAPI_ComposeChildeNodeList(
nullptr, obj_manager, HAPI_NODETYPE_OBJ, HAPI_NODEFLAGS_DISPLAY, recursive, &child_node_count );
std::vector< HAPI_NodeId > child_nodes( child_node_count );
nullptr, obj_manager, child_nodes.data(), child_node_count );
// Then just go through all the returned node ids and see which ones you know about and which you don't.

Nodes

Getting all editable networks in an asset:

// OLD WAY
HAPI_AssetId asset_id = <Returned by HAPI_InstantiateAsset()>;
HAPI_AssetInfo asset_info;
HAPI_NodeId editable_network_node_id; // Not an array for simplicity.
HAPI_GetAssetInfo( nullptr, asset_id, &asset_info ) );
HAPI_GetEditableNodeNetworks(
nullptr, asset_id, &editable_network_node_id, 1 ) );
// NEW WAY
HAPI_NodeId node_id = <Returned by HAPI_CreateNode()>;
int editable_network_count = 0;
const bool recursive = true;
nullptr, node_id,
recursive,
&editable_network_count );
std::vector< HAPI_NodeId > editable_networks( editable_network_count );
nullptr, node_id, editable_networks.data(), editable_network_count );

Objects

Get all object infos and their transforms in an asset.

// OLD WAY
HAPI_AssetInfo asset_info = <from HAPI_GetAssetInfo()>;
std::vector< HAPI_ObjectInfo > object_infos( asset_info.objectCount );
HAPI_GetObjects(
nullptr, asset_info.id, object_infos.data(), 0, asset_info.objectCount );
std::vector< HAPI_Transform > object_transforms( asset_info.objectCount );
HAPI_GetObjectTransforms(
nullptr, asset_info.id, rst_order, object_transforms.data(), 0, asset_info.objectCount );
// NEW WAY
int object_count = 0;
HAPI_ComposeObjectList( nullptr, asset_node_id, nullptr, &object_count );
std::vector< HAPI_ObjectInfo > object_infos( object_count );
nullptr, asset_node_id, object_infos.data(), 0, object_count );
std::vector< HAPI_Transform > object_transforms( object_count );
nullptr, asset_node_id, rst_order, object_transforms.data(), 0, object_count );

Get object instance transforms from an instancer object.

// OLD WAY
std::vector< HAPI_Transform > instance_transforms( geo_point_count );
HAPI_GetInstanceTransforms(
nullptr, asset_id, object_id, geo_id, rst_order,
instance_transforms.data(), 0, geo_point_count );
// NEW WAY
std::vector< HAPI_Transform > instance_transforms( geo_point_count );
HAPI_GetInstanceTransforms(
nullptr, object_node_id, rst_order,
instance_transforms.data(), 0, geo_point_count );

Geometry

Get and set geometry information (assuming asset has a single object).

// OLD WAY
HAPI_AssetId asset_id;
HAPI_InstantiateAsset( nullptr, ..., &asset_id );
HAPI_ObjectId object_id = 0;
HAPI_GeoId geo_id = 0;
HAPI_GeoInfo geo_info;
HAPI_GetGeoInfo( nullptr, asset_id, object_id, geo_id, &geo_info );
// All other geometry getters and settings will take the asset_id, object_id, geo_id as identifiers.
// NEW WAY
HAPI_NodeId asset_node_id;
HAPI_CreateNode( nullptr, ..., &node_id );
int object_count = 0;
nullptr, asset_node_id, HAPI_NODETYPE_OBJ, HAPI_NODEFLAGS_OBJ_GEOMETRY, &object_count );
HAPI_NodeId object_node_id;
nullptr, asset_node_id, &object_node_id, 0, object_count );
HAPI_GeoInfo geo_info;
HAPI_GetDisplayGeoInfo( nullptr, object_node_id, &geo_info );
// All other geometry getters and setters take just the geo_info.nodeId.

Inter-Asset Connections

// Common Variables
int node_input_idx = 0;
int parameter_input_idx = 1; // Input that is actually an exposed parameter.
// OLD WAY
HAPI_AssetId asset_a = 1;
HAPI_ObjectId asset_a_obj = 0;
HAPI_AssetId asset_b = 2;
// For a node input.
HAPI_ConnectAssetTransform( nullptr, asset_a, asset_b, node_input_idx )
HAPI_DisconnectAssetTransform( nullptr, asset_b, node_input_idx );
HAPI_ConnectAssetGeometry( nullptr, asset_a, asset_a_obj, asset_b, node_input_idx );
HAPI_DisconnectAssetGeometry( nullptr, asset_b, node_input_idx );
// For a parameter input.
HAPI_ConnectAssetTransform( nullptr, asset_a, asset_b, parameter_input_idx )
HAPI_DisconnectAssetTransform( nullptr, asset_b, parameter_input_idx );
HAPI_ConnectAssetGeometry( nullptr, asset_a, asset_a_obj, asset_b, parameter_input_idx );
HAPI_DisconnectAssetGeometry( nullptr, asset_b, parameter_input_idx );
// NEW WAY
HAPI_NodeId node_a = 1;
HAPI_NodeId node_a_obj = 3;
HAPI_NodeId node_b = 2;
// For a node input
HAPI_ConnectNodeInput( nullptr, node_b, node_input_idx, node_a );
HAPI_DisconnectNodeInput( nullptr, node_b, node_input_idx );
HAPI_ConnectNodeInput( nullptr, node_b, node_input_idx, node_a_obj );
HAPI_DisconnectNodeInput( nullptr, node_b, node_input_idx );
// For a parameter input.
// You need to find the equivalent parm name of what used to be parameter_input_idx.
const char * input_parm_name = "coord";
HAPI_SetParmNodeValue( nullptr, node_b, input_parm_name, node_a );
HAPI_SetParmNodeValue( nullptr, node_b, input_parm_name, node_a_obj );
HAPI_SetParmNodeValue( nullptr, node_b, input_parm_name, -1 );

Materials

Getting material assignments and material infos.

// OLD WAY
HAPI_PartInfo part_info = <the part info of the part with the material>;
std::vector< HAPI_MaterialId > materials( part_info.faceCount );
HAPI_GetMaterialIdsOnFaces(
nullptr, asset_id, object_id, geo_id, part_info.id,
&are_all_the_same, materials.data(), 0, part_info.faceCount );
HAPI_MaterialInfo material_info;
HAPI_GetMaterialInfo( nullptr, asset_id, materials[ 0 ], &material_info );
// All other material getters and setters take the asset id and material id as identifiers.
// NEW WAY
HAPI_PartInfo part_info = <the part info of the part with the material>;
std::vector< HAPI_NodeId > materials( part_info.faceCount );
nullptr, sop_node_id, part_info.nodeId, &are_all_the_same,
materials.data(), 0, part_info.faceCount );
HAPI_MaterialInfo material_info;
HAPI_GetMaterialInfo( nullptr, materials[ 0 ], &material_info );
// All other materials getters and setters take just the material node id as the sole identifier.