Beispiel #1
0
        public static bool GetWorkitemStringData(this HEU_SessionBase session, HAPI_NodeId node_id, HAPI_PDG_WorkitemId workitem_id, string data_name, [Out] HAPI_StringHandle[] values, int length)
        {
            Debug.AssertFormat(values.Length >= length, "StringBuilder must be atleast of size {0}.", length);
            HAPI_Result result = HEU_HAPIFunctions.HAPI_GetWorkitemStringData(ref session.GetSessionData()._HAPISession, node_id, workitem_id, data_name.AsByteArray(), values, length);

            session.HandleStatusResult(result, "Getting Workitem String Data", false, true);
            return(result == HAPI_Result.HAPI_RESULT_SUCCESS);
        }
	public static bool ClearConnectionError()
	{
#if HOUDINIENGINEUNITY_ENABLED
	    HAPI_Result result = HEU_HAPIImports.HAPI_ClearConnectionError();
	    return (result == HAPI_Result.HAPI_RESULT_SUCCESS);
#else
	    return true;
#endif
	}
Beispiel #3
0
    private static bool getSession(out HAPI_Session session, string pipe_name)
    {
#if (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || (UNITY_METRO && UNITY_EDITOR))
        HAPI_Result status_code = HAPI_CreateThriftNamedPipeSession(out session, prPipeName);
        if (status_code != HAPI_Result.HAPI_RESULT_SUCCESS)
        {
            prLastInitializationError =
                "Could not create the RPC pipe session.\n" +
                "Make sure " + prServerExecutablePath + " exists.";
            return(false);
        }
        prSessionID = session.id;
#else
        session.id   = 0;
        session.type = HAPI_SessionType.HAPI_SESSION_INPROCESS;
#endif // UNITY_EDITOR
        return(true);
    }
Beispiel #4
0
    private static bool startProcess(string server_executable_path, string pipe_name)
    {
#if (HAPI_ENABLE_RUNTIME)
        try
        {
            Debug.Log(
                "Houdini Engine: Starting HARS process.\n" +
                "    Executable: " + prServerExecutablePath + "\n" +
                "    Pipe Name: " + pipe_name);

            int process_id = 0;
            HAPI_ThriftServerOptions server_options = new HAPI_ThriftServerOptions();
            server_options.autoClose = true;
            server_options.timeoutMs = 2000.0f;
            HAPI_Result result = HAPI_StartThriftNamedPipeServer(
                ref server_options,
                pipe_name,
                out process_id);
            if (result != HAPI_Result.HAPI_RESULT_SUCCESS)
            {
                prLastInitializationError =
                    "Could not start the RPC server process.\n" +
                    "Make sure " + prServerExecutablePath + " exists.";
                return(false);
            }

            prProcessID = process_id;

            return(true);
        }
        catch (System.Exception e)
        {
            prLastInitializationError =
                "Could not start the RPC server process because: " + e.Message + "\n" +
                "Make sure " + prServerExecutablePath + " exists.";
            return(false);
        }
#else
        return(false);
#endif // ( HAPI_ENABLE_RUNTIME )
    }
Beispiel #5
0
    private static bool startProcess(string server_executable_path, string pipe_name)
    {
#if (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || (UNITY_METRO && UNITY_EDITOR))
        try
        {
#if UNITY_EDITOR
            Debug.Log(
                "Houdini Engine: Starting HARS process.\n" +
                "    Executable: " + prServerExecutablePath + "\n" +
                "    Pipe Name: " + pipe_name);
#endif // UNITY_EDITOR
            int         process_id = 0;
            HAPI_Result result     = HAPI_StartThriftNamedPipeServer(true, pipe_name, 2000.0f, out process_id);
            if (result != HAPI_Result.HAPI_RESULT_SUCCESS)
            {
                prLastInitializationError =
                    "Could not start the RPC server process.\n" +
                    "Make sure " + prServerExecutablePath + " exists.";
                return(false);
            }

            prProcessID = process_id;

            return(true);
        }
        catch (System.Exception e)
        {
            prLastInitializationError =
                "Could not start the RPC server process because: " + e.Message + "\n" +
                "Make sure " + prServerExecutablePath + " exists.";
            return(false);
        }
#else
        return(false);
#endif // ( UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX || ( UNITY_METRO && UNITY_EDITOR ) )
    }
		public virtual bool HandleStatusResult(HAPI_Result result, string prependMsg, bool bThrowError, bool bLogError)
		{
			return false;
		}