C# Class HoudiniEngineUnity.HEU_SessionManager

Manages a session for Houdini Engine. Supports all types of sessions.
Afficher le fichier Open project: sideeffects/HoudiniEngineForUnity Class Usage Examples

Méthodes publiques

Свойство Type Description
_createSessionFromTypeDelegate CreateSessionFromTypeDelegate

Méthodes publiques

Méthode Description
CheckVersionMatch ( ) : bool

Check that the Unity plugin's Houdini Engine version matches with the linked Houdini Engine API version.

ClearConnectionError ( ) : bool
CloseAllSessions ( ) : void

Close all sessions

CloseDefaultSession ( ) : bool

Close the default session.

ConnectSessionSyncUsingThriftPipe ( string pipeName, bool autoClose, float timeout, bool logError ) : bool
ConnectSessionSyncUsingThriftSocket ( string hostName, int serverPort, bool autoClose, float timeout, bool logError ) : bool
ConnectThriftPipeSession ( string pipeName, bool autoClose, float timeout ) : bool
ConnectThriftSocketSession ( string hostName, int serverPort, bool autoClose, float timeout ) : bool
CreateCustomSession ( ) : bool

Create custom Houdini Engine session.

CreateInProcessSession ( ) : bool

Create in-process Houdini Engine session.

CreateSessionFromType ( System.Type type ) : HEU_SessionBase
CreateSessionObject ( ) : HEU_SessionBase

Create new session if specified.

CreateThriftPipeSession ( string pipeName, bool autoClose, float timeout, bool logError ) : bool

Create pipe session for Houdini Engine.

CreateThriftSocketSession ( string hostName, int serverPort, bool autoClose, float timeout, bool logError ) : bool

Create socket session for Houdini Engine.

GetComposedChildNodeList ( HEU_SessionBase session, HAPI_NodeId parentNodeID, HAPI_NodeTypeBits nodeTypeFilter, HAPI_NodeFlagsBits nodeFlagFilter, bool bRecursive, Array &childNodeIDs, bool bLogIfError = true ) : bool

Get the composed list of child node IDs.

GetComposedObjectListMemorySafe ( HEU_SessionBase session, HAPI_NodeId nodeID, Array objectInfos, int start, int length ) : bool

Fill an array of HAPI_ObjectInfo list. Use for large arrays where marshalling is done in chunks.

GetComposedObjectTransformsMemorySafe ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_RSTOrder rstOrder, Array transforms, int start, int length ) : bool

Fill in array of HAPI_Transform list. Use for large arrays where marshalling is done in chunks.

GetConnectionError ( bool clear ) : string
GetCurrentLicense ( bool bLogError ) : HAPI_License

Returns the current license value.

GetDefaultSession ( ) : HEU_SessionBase

Returns the default session in use. Tries to reconnect to a stored session. Does not create a new session.

GetGroupMembership ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_PartId partID, HAPI_GroupType groupType, string groupName, Array &membership, bool isInstanced ) : bool

Get group membership

GetGroupNames ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_PartId partID, HAPI_GroupType groupType, bool isInstanced ) : string[]

Gets the group names for given group type.

GetHoudiniPathOnMacOS ( string houdiniPath ) : string
GetLastSessionError ( ) : string

Returns last session error.

GetNodeInputName ( HAPI_NodeId nodeID, int inputIndex, string &inputName ) : bool

Get the name of the given node's input.

GetNodeName ( HAPI_NodeId nodeID, HEU_SessionBase session = null ) : string

Returns the name of the specified node.

GetOrCreateDefaultSession ( bool bNotifyUserError = true ) : HEU_SessionBase

Returns a valid session by either reconnecting to an existing session, or creating a new session. Note that this will display error (once) if unable to get a valid session.

GetSessionData ( ) : HEU_SessionData

Return the existing session data.

GetSessionInfo ( ) : string

Return the session info.

GetSessionWithID ( long sessionID ) : HEU_SessionBase

Get the session associated with this session ID. As long as the session was registered, this will return it.

GetString ( int stringHandle, HEU_SessionBase session = null ) : string

Get the string value of the given string handle.

GetStringValuesFromStringIndices ( Array strIndices ) : string[]
GetUniqueMaterialShopName ( HAPI_NodeId assetID, HAPI_NodeId materialID ) : string
InitializeDefaultSession ( ) : bool
IsHARSProcessRunning ( int processID ) : bool
LoadAllSessionData ( ) : void

Load stored session data and recreate the session objects.

LoadSessionFromHIP ( bool bCookNodes, HEU_SessionBase session = null ) : bool

Load a HIP file into given session. The user will be prompted to choose a HIP file via Unity's file dialog.

LoadStoredDefaultSession ( ) : bool

Tries to load a stored default session. This would be after a code refresh or if the Houdini session is still running but Unity hasn't connected to it.

OpenHoudini ( string args ) : bool
OpenSessionInHoudini ( HEU_SessionBase session = null ) : bool

Open given session in a new Houdini instance.

RecreateDefaultSessionData ( ) : void
RegisterSession ( long sessionID, HEU_SessionBase session ) : void

Register the given session so that it can be retrieved via its session ID. This guarantees persistence reconnectiong across code refresh/compiles.

RestartSession ( ) : bool

Close default (if valid) and open a new session.

SaveAllSessionData ( ) : void

Save given list of sessions (HEU_SessionData) into storage for retrieval later. A way to persist current session information through code refresh/compiles.

SaveSessionToHIP ( bool bLockNodes, HEU_SessionBase session = null ) : bool

Save given session to a HIP file. The user will be prompted with Unity's file dialog to choose HIP file location.

UnregisterSession ( long sessionID ) : void

Unregister the session (used when closing).

ValidatePluginSession ( HEU_SessionBase session = null ) : bool

Returns true if the plugin is installed properly, and that a session (new or existing) can be established. Notifies user if either fails. This can be called before each operation into Houdini Engine to establish or reconnect to session.

Private Methods

Méthode Description
CheckAndCloseExistingSession ( ) : void

Closes session if one exists and is valid. Trying to close invalid session might throw error so this bypasses it.

InternalValidateSceneAssets ( ) : void

Goes through all assets in scene, and re-registers them with the scene they were originally created in. If their session is not valid, the asset is invalidated so it will be created again in the default session.

Method Details

CheckVersionMatch() public static méthode

Check that the Unity plugin's Houdini Engine version matches with the linked Houdini Engine API version.
public static CheckVersionMatch ( ) : bool
Résultat bool

ClearConnectionError() public static méthode

public static ClearConnectionError ( ) : bool
Résultat bool

CloseAllSessions() public static méthode

Close all sessions
public static CloseAllSessions ( ) : void
Résultat void

CloseDefaultSession() public static méthode

Close the default session.
public static CloseDefaultSession ( ) : bool
Résultat bool

ConnectSessionSyncUsingThriftPipe() public static méthode

public static ConnectSessionSyncUsingThriftPipe ( string pipeName, bool autoClose, float timeout, bool logError ) : bool
pipeName string
autoClose bool
timeout float
logError bool
Résultat bool

ConnectSessionSyncUsingThriftSocket() public static méthode

public static ConnectSessionSyncUsingThriftSocket ( string hostName, int serverPort, bool autoClose, float timeout, bool logError ) : bool
hostName string
serverPort int
autoClose bool
timeout float
logError bool
Résultat bool

ConnectThriftPipeSession() public static méthode

public static ConnectThriftPipeSession ( string pipeName, bool autoClose, float timeout ) : bool
pipeName string
autoClose bool
timeout float
Résultat bool

ConnectThriftSocketSession() public static méthode

public static ConnectThriftSocketSession ( string hostName, int serverPort, bool autoClose, float timeout ) : bool
hostName string
serverPort int
autoClose bool
timeout float
Résultat bool

CreateCustomSession() public static méthode

Create custom Houdini Engine session.
public static CreateCustomSession ( ) : bool
Résultat bool

CreateInProcessSession() public static méthode

Create in-process Houdini Engine session.
public static CreateInProcessSession ( ) : bool
Résultat bool

CreateSessionFromType() public static méthode

public static CreateSessionFromType ( System.Type type ) : HEU_SessionBase
type System.Type
Résultat HEU_SessionBase

CreateSessionObject() public static méthode

Create new session if specified.
public static CreateSessionObject ( ) : HEU_SessionBase
Résultat HEU_SessionBase

CreateThriftPipeSession() public static méthode

Create pipe session for Houdini Engine.
public static CreateThriftPipeSession ( string pipeName, bool autoClose, float timeout, bool logError ) : bool
pipeName string
autoClose bool
timeout float
logError bool
Résultat bool

CreateThriftSocketSession() public static méthode

Create socket session for Houdini Engine.
public static CreateThriftSocketSession ( string hostName, int serverPort, bool autoClose, float timeout, bool logError ) : bool
hostName string Network name of the host.
serverPort int Network port of the host.
autoClose bool
timeout float
logError bool
Résultat bool

GetComposedChildNodeList() public static méthode

Get the composed list of child node IDs.
public static GetComposedChildNodeList ( HEU_SessionBase session, HAPI_NodeId parentNodeID, HAPI_NodeTypeBits nodeTypeFilter, HAPI_NodeFlagsBits nodeFlagFilter, bool bRecursive, Array &childNodeIDs, bool bLogIfError = true ) : bool
session HEU_SessionBase
parentNodeID HAPI_NodeId Parent node ID
nodeTypeFilter HAPI_NodeTypeBits Node type by which to filter the children
nodeFlagFilter HAPI_NodeFlagsBits Node flags by which to filter the children
bRecursive bool Whether or not to compose the list recursively
childNodeIDs Array
bLogIfError bool
Résultat bool

GetComposedObjectListMemorySafe() public static méthode

Fill an array of HAPI_ObjectInfo list. Use for large arrays where marshalling is done in chunks.
public static GetComposedObjectListMemorySafe ( HEU_SessionBase session, HAPI_NodeId nodeID, Array objectInfos, int start, int length ) : bool
session HEU_SessionBase
nodeID HAPI_NodeId The parent node ID
objectInfos Array Array to fill. Should atleast be size of length
start int At least 0 and at most object count returned by ComposeObjectList
length int Object count returned by ComposeObjectList. Should be at least 0 and at most object count - start
Résultat bool

GetComposedObjectTransformsMemorySafe() public static méthode

Fill in array of HAPI_Transform list. Use for large arrays where marshalling is done in chunks.
public static GetComposedObjectTransformsMemorySafe ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_RSTOrder rstOrder, Array transforms, int start, int length ) : bool
session HEU_SessionBase
nodeID HAPI_NodeId The parent node ID
rstOrder HAPI_RSTOrder Transform order
transforms Array Array to fill. Should at least be size of length
start int At least 0 and at most object count returned by ComposeObjectList
length int Object count returned by ComposeObjectList. Should be at least 0 and at most object count - start
Résultat bool

GetConnectionError() public static méthode

public static GetConnectionError ( bool clear ) : string
clear bool
Résultat string

GetCurrentLicense() public static méthode

Returns the current license value.
public static GetCurrentLicense ( bool bLogError ) : HAPI_License
bLogError bool
Résultat HAPI_License

GetDefaultSession() public static méthode

Returns the default session in use. Tries to reconnect to a stored session. Does not create a new session.
public static GetDefaultSession ( ) : HEU_SessionBase
Résultat HEU_SessionBase

GetGroupMembership() public static méthode

Get group membership
public static GetGroupMembership ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_PartId partID, HAPI_GroupType groupType, string groupName, Array &membership, bool isInstanced ) : bool
session HEU_SessionBase
nodeID HAPI_NodeId
partID HAPI_PartId
groupType HAPI_GroupType
groupName string
membership Array Array of ints representing the membership of this group
isInstanced bool
Résultat bool

GetGroupNames() public static méthode

Gets the group names for given group type.
public static GetGroupNames ( HEU_SessionBase session, HAPI_NodeId nodeID, HAPI_PartId partID, HAPI_GroupType groupType, bool isInstanced ) : string[]
session HEU_SessionBase
nodeID HAPI_NodeId The node ID
partID HAPI_PartId
groupType HAPI_GroupType The group type to query
isInstanced bool
Résultat string[]

GetHoudiniPathOnMacOS() public static méthode

public static GetHoudiniPathOnMacOS ( string houdiniPath ) : string
houdiniPath string
Résultat string

GetLastSessionError() public static méthode

Returns last session error.
public static GetLastSessionError ( ) : string
Résultat string

GetNodeInputName() public static méthode

Get the name of the given node's input.
public static GetNodeInputName ( HAPI_NodeId nodeID, int inputIndex, string &inputName ) : bool
nodeID HAPI_NodeId Node's ID
inputIndex int Index of the input
inputName string Input name string
Résultat bool

GetNodeName() public static méthode

Returns the name of the specified node.
public static GetNodeName ( HAPI_NodeId nodeID, HEU_SessionBase session = null ) : string
nodeID HAPI_NodeId Node ID of the node to find the name of
session HEU_SessionBase Session that the node should be in
Résultat string

GetOrCreateDefaultSession() public static méthode

Returns a valid session by either reconnecting to an existing session, or creating a new session. Note that this will display error (once) if unable to get a valid session.
public static GetOrCreateDefaultSession ( bool bNotifyUserError = true ) : HEU_SessionBase
bNotifyUserError bool
Résultat HEU_SessionBase

GetSessionData() public static méthode

Return the existing session data.
public static GetSessionData ( ) : HEU_SessionData
Résultat HEU_SessionData

GetSessionInfo() public static méthode

Return the session info.
public static GetSessionInfo ( ) : string
Résultat string

GetSessionWithID() public static méthode

Get the session associated with this session ID. As long as the session was registered, this will return it.
public static GetSessionWithID ( long sessionID ) : HEU_SessionBase
sessionID long Session ID to use for matching to session
Résultat HEU_SessionBase

GetString() public static méthode

Get the string value of the given string handle.
public static GetString ( int stringHandle, HEU_SessionBase session = null ) : string
stringHandle int String handle to query.
session HEU_SessionBase
Résultat string

GetStringValuesFromStringIndices() public static méthode

public static GetStringValuesFromStringIndices ( Array strIndices ) : string[]
strIndices Array
Résultat string[]

GetUniqueMaterialShopName() public static méthode

public static GetUniqueMaterialShopName ( HAPI_NodeId assetID, HAPI_NodeId materialID ) : string
assetID HAPI_NodeId
materialID HAPI_NodeId
Résultat string

InitializeDefaultSession() public static méthode

public static InitializeDefaultSession ( ) : bool
Résultat bool

IsHARSProcessRunning() public static méthode

public static IsHARSProcessRunning ( int processID ) : bool
processID int
Résultat bool

LoadAllSessionData() public static méthode

Load stored session data and recreate the session objects.
public static LoadAllSessionData ( ) : void
Résultat void

LoadSessionFromHIP() public static méthode

Load a HIP file into given session. The user will be prompted to choose a HIP file via Unity's file dialog.
public static LoadSessionFromHIP ( bool bCookNodes, HEU_SessionBase session = null ) : bool
bCookNodes bool True if nodes should be cooked on load
session HEU_SessionBase Session to load into. If null, will use default session
Résultat bool

LoadStoredDefaultSession() public static méthode

Tries to load a stored default session. This would be after a code refresh or if the Houdini session is still running but Unity hasn't connected to it.
public static LoadStoredDefaultSession ( ) : bool
Résultat bool

OpenHoudini() public static méthode

public static OpenHoudini ( string args ) : bool
args string
Résultat bool

OpenSessionInHoudini() public static méthode

Open given session in a new Houdini instance.
public static OpenSessionInHoudini ( HEU_SessionBase session = null ) : bool
session HEU_SessionBase Session to open. If null, will use default session.
Résultat bool

RecreateDefaultSessionData() public static méthode

public static RecreateDefaultSessionData ( ) : void
Résultat void

RegisterSession() public static méthode

Register the given session so that it can be retrieved via its session ID. This guarantees persistence reconnectiong across code refresh/compiles.
public static RegisterSession ( long sessionID, HEU_SessionBase session ) : void
sessionID long
session HEU_SessionBase
Résultat void

RestartSession() public static méthode

Close default (if valid) and open a new session.
public static RestartSession ( ) : bool
Résultat bool

SaveAllSessionData() public static méthode

Save given list of sessions (HEU_SessionData) into storage for retrieval later. A way to persist current session information through code refresh/compiles.
public static SaveAllSessionData ( ) : void
Résultat void

SaveSessionToHIP() public static méthode

Save given session to a HIP file. The user will be prompted with Unity's file dialog to choose HIP file location.
public static SaveSessionToHIP ( bool bLockNodes, HEU_SessionBase session = null ) : bool
bLockNodes bool Whether to lock nodes in HIP file so as not to recook them on load
session HEU_SessionBase Session to save out. If null, uses default session.
Résultat bool

UnregisterSession() public static méthode

Unregister the session (used when closing).
public static UnregisterSession ( long sessionID ) : void
sessionID long Session to remove from registry
Résultat void

ValidatePluginSession() public static méthode

Returns true if the plugin is installed properly, and that a session (new or existing) can be established. Notifies user if either fails. This can be called before each operation into Houdini Engine to establish or reconnect to session.
public static ValidatePluginSession ( HEU_SessionBase session = null ) : bool
session HEU_SessionBase
Résultat bool

Property Details

_createSessionFromTypeDelegate public_oe static_oe property

public static CreateSessionFromTypeDelegate _createSessionFromTypeDelegate
Résultat CreateSessionFromTypeDelegate