C# Класс HoudiniEngineUnity.HEU_SessionManager

Manages a session for Houdini Engine. Supports all types of sessions.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
_createSessionFromTypeDelegate CreateSessionFromTypeDelegate

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

CheckVersionMatch() публичный статический Метод

Check that the Unity plugin's Houdini Engine version matches with the linked Houdini Engine API version.
public static CheckVersionMatch ( ) : bool
Результат bool

ClearConnectionError() публичный статический Метод

public static ClearConnectionError ( ) : bool
Результат bool

CloseAllSessions() публичный статический Метод

Close all sessions
public static CloseAllSessions ( ) : void
Результат void

CloseDefaultSession() публичный статический Метод

Close the default session.
public static CloseDefaultSession ( ) : bool
Результат bool

ConnectSessionSyncUsingThriftPipe() публичный статический Метод

public static ConnectSessionSyncUsingThriftPipe ( string pipeName, bool autoClose, float timeout, bool logError ) : bool
pipeName string
autoClose bool
timeout float
logError bool
Результат bool

ConnectSessionSyncUsingThriftSocket() публичный статический Метод

public static ConnectSessionSyncUsingThriftSocket ( string hostName, int serverPort, bool autoClose, float timeout, bool logError ) : bool
hostName string
serverPort int
autoClose bool
timeout float
logError bool
Результат bool

ConnectThriftPipeSession() публичный статический Метод

public static ConnectThriftPipeSession ( string pipeName, bool autoClose, float timeout ) : bool
pipeName string
autoClose bool
timeout float
Результат bool

ConnectThriftSocketSession() публичный статический Метод

public static ConnectThriftSocketSession ( string hostName, int serverPort, bool autoClose, float timeout ) : bool
hostName string
serverPort int
autoClose bool
timeout float
Результат bool

CreateCustomSession() публичный статический Метод

Create custom Houdini Engine session.
public static CreateCustomSession ( ) : bool
Результат bool

CreateInProcessSession() публичный статический Метод

Create in-process Houdini Engine session.
public static CreateInProcessSession ( ) : bool
Результат bool

CreateSessionFromType() публичный статический Метод

public static CreateSessionFromType ( System.Type type ) : HEU_SessionBase
type System.Type
Результат HEU_SessionBase

CreateSessionObject() публичный статический Метод

Create new session if specified.
public static CreateSessionObject ( ) : HEU_SessionBase
Результат HEU_SessionBase

CreateThriftPipeSession() публичный статический Метод

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
Результат bool

CreateThriftSocketSession() публичный статический Метод

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
Результат bool

GetComposedChildNodeList() публичный статический Метод

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
Результат bool

GetComposedObjectListMemorySafe() публичный статический Метод

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
Результат bool

GetComposedObjectTransformsMemorySafe() публичный статический Метод

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
Результат bool

GetConnectionError() публичный статический Метод

public static GetConnectionError ( bool clear ) : string
clear bool
Результат string

GetCurrentLicense() публичный статический Метод

Returns the current license value.
public static GetCurrentLicense ( bool bLogError ) : HAPI_License
bLogError bool
Результат HAPI_License

GetDefaultSession() публичный статический Метод

Returns the default session in use. Tries to reconnect to a stored session. Does not create a new session.
public static GetDefaultSession ( ) : HEU_SessionBase
Результат HEU_SessionBase

GetGroupMembership() публичный статический Метод

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
Результат bool

GetGroupNames() публичный статический Метод

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
Результат string[]

GetHoudiniPathOnMacOS() публичный статический Метод

public static GetHoudiniPathOnMacOS ( string houdiniPath ) : string
houdiniPath string
Результат string

GetLastSessionError() публичный статический Метод

Returns last session error.
public static GetLastSessionError ( ) : string
Результат string

GetNodeInputName() публичный статический Метод

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
Результат bool

GetNodeName() публичный статический Метод

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
Результат string

GetOrCreateDefaultSession() публичный статический Метод

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
Результат HEU_SessionBase

GetSessionData() публичный статический Метод

Return the existing session data.
public static GetSessionData ( ) : HEU_SessionData
Результат HEU_SessionData

GetSessionInfo() публичный статический Метод

Return the session info.
public static GetSessionInfo ( ) : string
Результат string

GetSessionWithID() публичный статический Метод

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
Результат HEU_SessionBase

GetString() публичный статический Метод

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
Результат string

GetStringValuesFromStringIndices() публичный статический Метод

public static GetStringValuesFromStringIndices ( Array strIndices ) : string[]
strIndices Array
Результат string[]

GetUniqueMaterialShopName() публичный статический Метод

public static GetUniqueMaterialShopName ( HAPI_NodeId assetID, HAPI_NodeId materialID ) : string
assetID HAPI_NodeId
materialID HAPI_NodeId
Результат string

InitializeDefaultSession() публичный статический Метод

public static InitializeDefaultSession ( ) : bool
Результат bool

IsHARSProcessRunning() публичный статический Метод

public static IsHARSProcessRunning ( int processID ) : bool
processID int
Результат bool

LoadAllSessionData() публичный статический Метод

Load stored session data and recreate the session objects.
public static LoadAllSessionData ( ) : void
Результат void

LoadSessionFromHIP() публичный статический Метод

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
Результат bool

LoadStoredDefaultSession() публичный статический Метод

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
Результат bool

OpenHoudini() публичный статический Метод

public static OpenHoudini ( string args ) : bool
args string
Результат bool

OpenSessionInHoudini() публичный статический Метод

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.
Результат bool

RecreateDefaultSessionData() публичный статический Метод

public static RecreateDefaultSessionData ( ) : void
Результат void

RegisterSession() публичный статический Метод

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
Результат void

RestartSession() публичный статический Метод

Close default (if valid) and open a new session.
public static RestartSession ( ) : bool
Результат bool

SaveAllSessionData() публичный статический Метод

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
Результат void

SaveSessionToHIP() публичный статический Метод

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.
Результат bool

UnregisterSession() публичный статический Метод

Unregister the session (used when closing).
public static UnregisterSession ( long sessionID ) : void
sessionID long Session to remove from registry
Результат void

ValidatePluginSession() публичный статический Метод

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
Результат bool

Описание свойств

_createSessionFromTypeDelegate публичное статическое свойство

public static CreateSessionFromTypeDelegate _createSessionFromTypeDelegate
Результат CreateSessionFromTypeDelegate