When running the code I keep getting HAPI_RESULT_INVALID_SESSION as result. I know the .dll is correctly
set up since I can call other functions correctly (such as HAPI_GetEnvInt()). How should I initialize Houdini
Engine with the default in-process session?
[DllImport(HoudiniVersion.HAPI_LIBRARY, CallingConvention = CallingConvention.Cdecl)]
private static unsafe extern HAPI_Result
HAPI_Initialize(
HAPI_Session* session,
ref HAPI_CookOptions cook_options,
[MarshalAs(UnmanagedType.U1)] bool use_cooking_thread,
int cooking_thread_stack_size,
string houdini_environment_files,
string otl_search_path,
string dso_search_path,
string image_dso_search_path,
string audio_dso_search_path);
public struct HAPI_Session
{
public HAPI_SessionType type;
public HAPI_SessionId id;
};
private static bool initialize()
{
...
HAPI_CookOptions cook_options = getCookOptions();
unsafe
{
status_code = HAPI_Initialize(
null, ref cook_options, true, -1, "", null, null, null, null);
}
...
}