HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG/TOPs

Functions

HAPI_DECL HAPI_GetPDGGraphContexts (const HAPI_Session *session, int *num_contexts, HAPI_StringHandle *context_names_array, HAPI_PDG_GraphContextId *context_id_array, int count)
 Return an array of PDG graph context names and ids, the first count names will be returned. These ids can be used with HAPI_GetPDGEvents and HAPI_GetPDGState. The values of the names can be retrieved with HAPI_GetString. More...
 
HAPI_DECL HAPI_GetPDGGraphContextId (const HAPI_Session *session, HAPI_NodeId top_node_id, HAPI_PDG_GraphContextId *context_id)
 Get the PDG graph context for the specified TOP node. More...
 
HAPI_DECL HAPI_CookPDG (const HAPI_Session *session, HAPI_NodeId cook_node_id, int generate_only, int blocking)
 Starts a PDG cooking operation. This can be asynchronous. Progress can be checked with HAPI_GetPDGState() and HAPI_GetPDGState(). Events generated during this cook can be collected with HAPI_GetPDGEvents(). Any uncollected events will be discarded at the start of the cook. More...
 
HAPI_DECL HAPI_CookPDGAllOutputs (const HAPI_Session *session, HAPI_NodeId cook_node_id, int generate_only, int blocking)
 Starts a PDG cooking operation. This can be asynchronous. Progress can be checked with HAPI_GetPDGState() and HAPI_GetPDGState(). Events generated during this cook can be collected with HAPI_GetPDGEvents(). Any uncollected events will be discarded at the start of the cook. More...
 
HAPI_DECL HAPI_GetPDGEvents (const HAPI_Session *session, HAPI_PDG_GraphContextId graph_context_id, HAPI_PDG_EventInfo *event_array, int length, int *event_count, int *remaining_events)
 Returns PDG events that have been collected. Calling this function will remove those events from the queue. Events collection is restarted by calls to HAPI_CookPDG(). More...
 
HAPI_DECL HAPI_GetPDGState (const HAPI_Session *session, HAPI_PDG_GraphContextId graph_context_id, int *pdg_state)
 Gets the state of a PDG graph. More...
 
HAPI_DECL HAPI_CreateWorkitem (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId *workitem_id, const char *name, int index)
 Creates a new pending workitem for the given node. The workitem will not be submitted to the graph until it is committed with HAPI_CommitWorkitems(). The node is expected to be a generator type. More...
 
HAPI_DECL HAPI_GetWorkitemInfo (const HAPI_Session *session, HAPI_PDG_GraphContextId graph_context_id, HAPI_PDG_WorkitemId workitem_id, HAPI_PDG_WorkitemInfo *workitem_info)
 Retrieves the info of a given workitem by id. More...
 
HAPI_DECL HAPI_SetWorkitemIntData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, const int *values_array, int length)
 Adds integer data to a pending PDG workitem data member for the given node. More...
 
HAPI_DECL HAPI_SetWorkitemFloatData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, const float *values_array, int length)
 Adds float data to a pending PDG workitem data member for the given node. More...
 
HAPI_DECL HAPI_SetWorkitemStringData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, int data_index, const char *value)
 Adds integer data to a pending PDG workitem data member for the given node. More...
 
HAPI_DECL HAPI_CommitWorkitems (const HAPI_Session *session, HAPI_NodeId node_id)
 Commits any pending workitems. More...
 
HAPI_DECL HAPI_GetNumWorkitems (const HAPI_Session *session, HAPI_NodeId node_id, int *num)
 Gets the number of workitems that are available on the given node. Should be used with HAPI_GetWorkitems. More...
 
HAPI_DECL HAPI_GetWorkitems (const HAPI_Session *session, HAPI_NodeId node_id, int *workitem_ids_array, int length)
 Gets the list of work item ids for the given node. More...
 
HAPI_DECL HAPI_GetWorkitemDataLength (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, int *length)
 Gets the length of the workitem data member. It is the length of the array of data. More...
 
HAPI_DECL HAPI_GetWorkitemIntData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, int *data_array, int length)
 Gets int data from a work item member. More...
 
HAPI_DECL HAPI_GetWorkitemFloatData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, float *data_array, int length)
 Gets float data from a work item member. More...
 
HAPI_DECL HAPI_GetWorkitemStringData (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, const char *data_name, HAPI_StringHandle *data_array, int length)
 Gets string ids from a work item member. More...
 
HAPI_DECL HAPI_GetWorkitemResultInfo (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, HAPI_PDG_WorkitemResultInfo *resultinfo_array, int resultinfo_count)
 Gets the info for workitem results. The number of workitem results is found on the HAPI_PDG_WorkitemInfo returned by HAPI_GetWorkitemInfo() More...
 
HAPI_DECL HAPI_DirtyPDGNode (const HAPI_Session *session, HAPI_NodeId node_id, HAPI_Bool clean_results)
 Dirties the given node. Cancels the cook if necessary and then deletes all workitems on the node. More...
 
HAPI_DECL HAPI_PausePDGCook (const HAPI_Session *session, HAPI_PDG_GraphContextId graph_context_id)
 Pause the PDG cooking operation. More...
 
HAPI_DECL HAPI_CancelPDGCook (const HAPI_Session *session, HAPI_PDG_GraphContextId graph_context_id)
 Cancel the PDG cooking operation. More...
 

Detailed Description

Functions for working with PDG/TOPs

Function Documentation

HAPI_DECL HAPI_CancelPDGCook ( const HAPI_Session session,
HAPI_PDG_GraphContextId  graph_context_id 
)

Cancel the PDG cooking operation.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]graph_context_idThe id of the graph context
HAPI_DECL HAPI_CommitWorkitems ( const HAPI_Session session,
HAPI_NodeId  node_id 
)

Commits any pending workitems.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id for which the pending workitems have been created but not yet injected.
HAPI_DECL HAPI_CookPDG ( const HAPI_Session session,
HAPI_NodeId  cook_node_id,
int  generate_only,
int  blocking 
)

Starts a PDG cooking operation. This can be asynchronous. Progress can be checked with HAPI_GetPDGState() and HAPI_GetPDGState(). Events generated during this cook can be collected with HAPI_GetPDGEvents(). Any uncollected events will be discarded at the start of the cook.

If there are any $HIPFILE file dependencies on nodes involved in the cook a hip file will be automatically saved to $HOUDINI_TEMP_DIR directory so that it can be copied to the working directory by the scheduler. This means $HIP will be equal to $HOUDINI_TEMP_DIR.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]cook_node_idThe node id of a TOP node for the cook operation.
[in]generate_only1 means only static graph generation will done. 0 means a full graph cook. Generation is always blocking.
[in]blocking0 means return immediately and cooking will be done asynchronously. 1 means return when cooking completes.
HAPI_DECL HAPI_CookPDGAllOutputs ( const HAPI_Session session,
HAPI_NodeId  cook_node_id,
int  generate_only,
int  blocking 
)

Starts a PDG cooking operation. This can be asynchronous. Progress can be checked with HAPI_GetPDGState() and HAPI_GetPDGState(). Events generated during this cook can be collected with HAPI_GetPDGEvents(). Any uncollected events will be discarded at the start of the cook.

If there are any $HIPFILE file dependencies on nodes involved in the cook a hip file will be automatically saved to $HOUDINI_TEMP_DIR directory so that it can be copied to the working directory by the scheduler. This means $HIP will be equal to $HOUDINI_TEMP_DIR.

If cook_node_id is a network / subnet, then if it has output nodes it cooks all of its output nodes and not just output 0. If it does not have output nodes it cooks the node with the output flag.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]cook_node_idThe node id of a TOP node for the cook operation.
[in]generate_only1 means only static graph generation will done. 0 means a full graph cook. Generation is always blocking.
[in]blocking0 means return immediately and cooking will be done asynchronously. 1 means return when cooking completes.
HAPI_DECL HAPI_CreateWorkitem ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId workitem_id,
const char *  name,
int  index 
)

Creates a new pending workitem for the given node. The workitem will not be submitted to the graph until it is committed with HAPI_CommitWorkitems(). The node is expected to be a generator type.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[out]workitem_idThe id of the pending workitem.
[in]nameThe null-terminated name of the workitem. The name will be automatically suffixed to make it unique.
[in]indexThe index of the workitem. The semantics of the index are user defined.
HAPI_DECL HAPI_DirtyPDGNode ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_Bool  clean_results 
)

Dirties the given node. Cancels the cook if necessary and then deletes all workitems on the node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]clean_resultsRemove the results generated by the node.
HAPI_DECL HAPI_GetNumWorkitems ( const HAPI_Session session,
HAPI_NodeId  node_id,
int num 
)

Gets the number of workitems that are available on the given node. Should be used with HAPI_GetWorkitems.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[out]numThe number of workitems.
HAPI_DECL HAPI_GetPDGEvents ( const HAPI_Session session,
HAPI_PDG_GraphContextId  graph_context_id,
HAPI_PDG_EventInfo event_array,
int  length,
int event_count,
int remaining_events 
)

Returns PDG events that have been collected. Calling this function will remove those events from the queue. Events collection is restarted by calls to HAPI_CookPDG().

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]graph_context_idThe id of the graph context
[out]event_arraybuffer of HAPI_PDG_EventInfo of size at least length.
[in]lengthThe size of the buffer passed in.
[out]event_countNumber of events removed from queue and copied to buffer.
[out]remaining_eventsNumber of queued events remaining after this operation.
HAPI_DECL HAPI_GetPDGGraphContextId ( const HAPI_Session session,
HAPI_NodeId  top_node_id,
HAPI_PDG_GraphContextId context_id 
)

Get the PDG graph context for the specified TOP node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]top_node_idThe id of the TOP node to query its graph context.
[out]context_idThe PDG graph context id.
HAPI_DECL HAPI_GetPDGGraphContexts ( const HAPI_Session session,
int num_contexts,
HAPI_StringHandle context_names_array,
HAPI_PDG_GraphContextId context_id_array,
int  count 
)

Return an array of PDG graph context names and ids, the first count names will be returned. These ids can be used with HAPI_GetPDGEvents and HAPI_GetPDGState. The values of the names can be retrieved with HAPI_GetString.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[out]num_contextsTotal number of PDG graph contexts found.
[out]context_names_arrayArray of int (string handles) to house the context names. These handles are valid until the next call to this function.
[out]context_id_arrayArray of graph context ids.
[in]countLength of context_names_array and context_id_array
HAPI_DECL HAPI_GetPDGState ( const HAPI_Session session,
HAPI_PDG_GraphContextId  graph_context_id,
int pdg_state 
)

Gets the state of a PDG graph.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]graph_context_idThe graph context id
[out]pdg_stateOne of HAPI_PDG_State.
HAPI_DECL HAPI_GetWorkitemDataLength ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
int length 
)

Gets the length of the workitem data member. It is the length of the array of data.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the workitem
[in]data_namenull-terminated name of the data member
[out]lengthThe length of the data member array
HAPI_DECL HAPI_GetWorkitemFloatData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
float *  data_array,
int  length 
)

Gets float data from a work item member.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the workitem
[in]data_namenull-terminated name of the data member
[out]data_arraybuffer of at least size length to copy the data into. The required length should be determined by HAPI_GetWorkitemDataLength().
[in]lengthThe length of the data_array
HAPI_DECL HAPI_GetWorkitemInfo ( const HAPI_Session session,
HAPI_PDG_GraphContextId  graph_context_id,
HAPI_PDG_WorkitemId  workitem_id,
HAPI_PDG_WorkitemInfo workitem_info 
)

Retrieves the info of a given workitem by id.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]graph_context_idThe graph context that the workitem is in.
[in]workitem_idThe id of the workitem.
[out]workitem_infoThe returned HAPI_PDG_WorkitemInfo for the workitem. Note that the enclosed string handle is only valid until the next call to this function.
HAPI_DECL HAPI_GetWorkitemIntData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
int data_array,
int  length 
)

Gets int data from a work item member.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the workitem
[in]data_namenull-terminated name of the data member
[out]data_arraybuffer of at least size length to copy the data into. The required length should be determined by HAPI_GetWorkitemDataLength().
[in]lengthThe length of data_array
HAPI_DECL HAPI_GetWorkitemResultInfo ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
HAPI_PDG_WorkitemResultInfo resultinfo_array,
int  resultinfo_count 
)

Gets the info for workitem results. The number of workitem results is found on the HAPI_PDG_WorkitemInfo returned by HAPI_GetWorkitemInfo()

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the workitem
[out]resultinfo_arrayBuffer to fill with info structs. String handles are valid until the next call of this function.
[in]resultinfo_countThe length of resultinfo_array
HAPI_DECL HAPI_GetWorkitems ( const HAPI_Session session,
HAPI_NodeId  node_id,
int workitem_ids_array,
int  length 
)

Gets the list of work item ids for the given node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[out]workitem_ids_arraybuffer for resulting array of HAPI_PDG_WorkitemId
[in]lengthThe length of the workitem_ids buffer
HAPI_DECL HAPI_GetWorkitemStringData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
HAPI_StringHandle data_array,
int  length 
)

Gets string ids from a work item member.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the workitem
[in]data_namenull-terminated name of the data member
[out]data_arraybuffer of at least size length to copy the data into. The required length should be determined by HAPI_GetWorkitemDataLength(). The data is an array of HAPI_StringHandle which can be used with HAPI_GetString(). The string handles are valid until the next call to this function.
[in]lengthThe length of data_array
HAPI_DECL HAPI_PausePDGCook ( const HAPI_Session session,
HAPI_PDG_GraphContextId  graph_context_id 
)

Pause the PDG cooking operation.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]graph_context_idThe id of the graph context
HAPI_DECL HAPI_SetWorkitemFloatData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
const float *  values_array,
int  length 
)

Adds float data to a pending PDG workitem data member for the given node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the pending workitem returned by HAPI_CreateWorkitem()
[in]data_namenull-terminated name of the workitem data member
[in]values_arrayarray of float values
[in]lengthnumber of values to copy from values_array to the parameter
HAPI_DECL HAPI_SetWorkitemIntData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
const int values_array,
int  length 
)

Adds integer data to a pending PDG workitem data member for the given node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the pending workitem returned by HAPI_CreateWorkitem()
[in]data_namenull-terminated name of the data member
[in]values_arrayarray of integer values
[in]lengthnumber of values to copy from values_array to the parameter
HAPI_DECL HAPI_SetWorkitemStringData ( const HAPI_Session session,
HAPI_NodeId  node_id,
HAPI_PDG_WorkitemId  workitem_id,
const char *  data_name,
int  data_index,
const char *  value 
)

Adds integer data to a pending PDG workitem data member for the given node.

Parameters
[in]sessionThe session of Houdini you are interacting with. See HAPI_Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]node_idThe node id.
[in]workitem_idThe id of the created workitem returned by HAPI_CreateWorkitem()
[in]data_namenull-terminated name of the data member
[in]data_indexindex of the string data member
[in]valuenull-terminated string to copy to the workitem data member