public static GetSessionWithID ( long sessionID ) : HEU_SessionBase | ||
sessionID | long | Session ID to use for matching to session |
return | HEU_SessionBase |
public HEU_SessionBase GetTaskSession() { if(_forceSessionID == HEU_SessionData.INVALID_SESSION_ID) { return HEU_SessionManager.GetOrCreateDefaultSession(); } else { return HEU_SessionManager.GetSessionWithID(_forceSessionID); } }
// LOGIC ----------------------------------------------------------------------------------------------------- private void Awake() { #if HOUDINIENGINEUNITY_ENABLED if (_sessionID != HEU_SessionData.INVALID_SESSION_ID) { HEU_SessionBase session = HEU_SessionManager.GetSessionWithID(_sessionID); if (session == null || !HEU_HAPIUtility.IsNodeValidInHoudini(session, _fileNodeID)) { // Reset session and file node IDs if these don't exist (could be from scene load). _sessionID = HEU_SessionData.INVALID_SESSION_ID; _fileNodeID = HEU_Defines.HEU_INVALID_NODE_ID; } } #endif }
public HEU_SessionBase GetHoudiniSession(bool bCreateIfNotFound) { HEU_SessionBase session = (_sessionID != HEU_SessionData.INVALID_SESSION_ID) ? HEU_SessionManager.GetSessionWithID(_sessionID) : null; if (session == null || !session.IsSessionValid()) { if (bCreateIfNotFound) { session = HEU_SessionManager.GetOrCreateDefaultSession(); if (session != null && session.IsSessionValid()) { _sessionID = session.GetSessionData().SessionID; } } } return session; }