Additional information will now be provided when Houdini Engine for Maya cannot connect to a HAPI session.
@@ -211,7 +211,7 @@ initializeSession(const OptionVars &optionVars)
}
Util::theHAPISession.reset(new Util::HAPISession);
- HAPI_Result sessionResult = HAPI_RESULT_FAILURE;
+ HAPI_Result sessionResult = HAPI_ClearConnectionError();
switch (actualSessionType)
{
@@ -244,6 +244,19 @@ initializeSession(const OptionVars &optionVars)
msgHostPort + ".");
}
else
+ {
+ int errorLength = 0;
+
+ HAPI_GetConnectionErrorLength(&errorLength);
+
+ if (errorLength > 0)
+ {
+ char *msg = new char[errorLength];
+ HAPI_GetConnectionError(msg, errorLength, true);
+ MGlobal::displayError(msg);
+ delete[] msg;
+ }
+ else
{
MGlobal::displayInfo(
"Failed to connected to Houdini Engine server using "
@@ -251,6 +264,7 @@ initializeSession(const OptionVars &optionVars)
msgHostPort + ".");
}
}
+ }
break;
case SessionType::ST_THRIFT_PIPE:
@@ -308,10 +322,25 @@ initializeSession(const OptionVars &optionVars)
#endif
if (HAPI_FAIL(sessionResult))
+ {
+ int errorLength = 0;
+
+ HAPI_GetConnectionErrorLength(&errorLength);
+
+ if (errorLength > 0)
+ {
+ char *msg = new char[errorLength];
+ HAPI_GetConnectionError(msg, errorLength, true);
+ MGlobal::displayError(msg);
+ delete[] msg;
+ }
+ else
{
MGlobal::displayError(
"Failed to automatically start Houdini Engine "
"server using named pipe.");
+ }
+
return HAPI_RESULT_FAILURE;
}
@@ -339,6 +368,19 @@ initializeSession(const OptionVars &optionVars)
msgPipe + "\".");
}
else
+ {
+ int errorLength = 0;
+
+ HAPI_GetConnectionErrorLength(&errorLength);
+
+ if (errorLength > 0)
+ {
+ char *msg = new char[errorLength];
+ HAPI_GetConnectionError(msg, errorLength, true);
+ MGlobal::displayError(msg);
+ delete[] msg;
+ }
+ else
{
MGlobal::displayInfo(
"Failed to connected to Houdini Engine server using "
@@ -346,6 +388,7 @@ initializeSession(const OptionVars &optionVars)
msgPipe + "\".");
}
}
+ }
break;
}
