Houdini Engine 7.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Utility

Functions

HAPI_DECL HAPI_ConvertTransform (const HAPI_Session *session, const HAPI_TransformEuler *transform_in, HAPI_RSTOrder rst_order, HAPI_XYZOrder rot_order, HAPI_TransformEuler *transform_out)
 Converts the transform described by a HAPI_TransformEuler struct into a different transform and rotation order. More...
 
HAPI_DECL HAPI_ConvertMatrixToQuat (const HAPI_Session *session, const float *matrix, HAPI_RSTOrder rst_order, HAPI_Transform *transform_out)
 Converts a 4x4 matrix into its TRS form. More...
 
HAPI_DECL HAPI_ConvertMatrixToEuler (const HAPI_Session *session, const float *matrix, HAPI_RSTOrder rst_order, HAPI_XYZOrder rot_order, HAPI_TransformEuler *transform_out)
 Converts a 4x4 matrix into its TRS form. More...
 
HAPI_DECL HAPI_ConvertTransformQuatToMatrix (const HAPI_Session *session, const HAPI_Transform *transform, float *matrix)
 Converts HAPI_Transform into a 4x4 transform matrix. More...
 
HAPI_DECL HAPI_ConvertTransformEulerToMatrix (const HAPI_Session *session, const HAPI_TransformEuler *transform, float *matrix)
 Converts HAPI_TransformEuler into a 4x4 transform matrix. More...
 
HAPI_DECL HAPI_PythonThreadInterpreterLock (const HAPI_Session *session, HAPI_Bool locked)
 Acquires or releases the Python interpreter lock. This is needed if HAPI is called from Python and HAPI is in threaded mode (see HAPI_Initialize()). More...
 

Detailed Description

Utility math and other functions

Function Documentation

HAPI_DECL HAPI_ConvertMatrixToEuler ( const HAPI_Session session,
const float *  matrix,
HAPI_RSTOrder  rst_order,
HAPI_XYZOrder  rot_order,
HAPI_TransformEuler transform_out 
)

Converts a 4x4 matrix into its TRS form.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]matrixA 4x4 matrix expressed in a 16 element float array.
[in]rst_orderThe desired transform order of the output.
[in]rot_orderThe desired rotation order of the output.
[out]transform_outUsed for the output.
HAPI_DECL HAPI_ConvertMatrixToQuat ( const HAPI_Session session,
const float *  matrix,
HAPI_RSTOrder  rst_order,
HAPI_Transform transform_out 
)

Converts a 4x4 matrix into its TRS form.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]matrixA 4x4 matrix expressed in a 16 element float array.
[in]rst_orderThe desired transform order of the output.
[out]transform_outUsed for the output.
HAPI_DECL HAPI_ConvertTransform ( const HAPI_Session session,
const HAPI_TransformEuler transform_in,
HAPI_RSTOrder  rst_order,
HAPI_XYZOrder  rot_order,
HAPI_TransformEuler transform_out 
)

Converts the transform described by a HAPI_TransformEuler struct into a different transform and rotation order.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]transform_inThe transform to be converted.
[in]rst_orderThe desired transform order of the output.
[in]rot_orderThe desired rotation order of the output.
[out]transform_outThe converted transform.
HAPI_DECL HAPI_ConvertTransformEulerToMatrix ( const HAPI_Session session,
const HAPI_TransformEuler transform,
float *  matrix 
)

Converts HAPI_TransformEuler into a 4x4 transform matrix.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]transformThe HAPI_TransformEuler you wish to convert.
[out]matrixA 16 element float array that will contain the result.
HAPI_DECL HAPI_ConvertTransformQuatToMatrix ( const HAPI_Session session,
const HAPI_Transform transform,
float *  matrix 
)

Converts HAPI_Transform into a 4x4 transform matrix.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]transformThe HAPI_Transform you wish to convert.
[out]matrixA 16 element float array that will contain the result.
HAPI_DECL HAPI_PythonThreadInterpreterLock ( const HAPI_Session session,
HAPI_Bool  locked 
)

Acquires or releases the Python interpreter lock. This is needed if HAPI is called from Python and HAPI is in threaded mode (see HAPI_Initialize()).

The problem arises when async functions like HAPI_CreateNode() may start a cooking thread that may try to run Python code. That is, we would now have Python running on two different threads - something not allowed by Python by default.

We need to tell Python to explicitly "pause" the Python state on the client thread while we run Python in our cooking thread.

You must call this function first with locked == true before any async HAPI call. Then, after the async call finished, detected via calls to HAPI_GetStatus(), call this method again to release the lock with locked == false.

Parameters
[in]sessionThe session of Houdini you are interacting with. See Sessions for more on sessions. Pass NULL to just use the default in-process session.
[in]lockedTrue will acquire the interpreter lock to use it for the HAPI cooking thread. False will release the lock back to the client thread.