Houdini Engine for Unity
 All Files Pages
Session

A Houdini Engine session is needed in order to use the Houdini Engine for Unity plug-in. The session will load the necessary Houdini libraries, and setup the environment and preferences for using Houdini Engine.

The plug-in handles creating and closing the session automatically when loading an HDA or creating Houdini assets inside Unity. In most cases, the user does not need to manage the session. For the more advanced user, or if want to debug a session-related issue, there are session tools available via the Houdini Engine Unity > Session menu.

Additionally, the Session can be configured in the Houdini Engine Unity > Plugin Settings window, under the Session section.

Unity_PluginSettings.png

Session Menu

The Session Menu allows to manage the Houdini Engine session from Unity.

Unity_SessionMenu.png
  • Create > Pipe Session Manually create a Pipe session and use as current default session. Closes existing default session. (see Pipe Session).
  • Create > Socket Session Manually create a Socket session and use as current default session. Closes existing default session. (see Socket Session).
  • Connect To Debugger > Pipe Session Connect to a Houdini Engine Debugger Pipe session. This will be set as the default session. (see Houdini Engine Debugger Session).
  • Connect To Debugger > Socket Session Connect to a Houdini Engine Debugger Socket session. This will be set as the default session. (see Houdini Engine Debugger Session).
  • Session Info Open the Session Info panel. Helpful for debugging session-related issues.
  • Close Default Session Close the default session.
  • Close All Sessions Close all open sessions.
  • Reconnect To Session If a session is open and was in use, this can be used to reconnect to it if Unity loses connection to it. This is done automatically after a Unity code recompile (Editor state is reset), and we want to continue using the Houdini session we were using before.
  • Restart Session This will close the current (default) session and re-create it. This is very useful in situations where the Houdini session gets into an error state where it fails to load or cook assets. This will restart the session allowing the user to continue to work without needing to restart Unity.

Session Types

Pipe Session

A named pipe session allows the main Houdini Engine processing to happen in a separate process, outside of the Unity process. The named pipe is used to communicate between the Unity process and the Houdini Engine process. This is the recommended method when using the Houdini Engine for Unity plug-in. This requires a Houdini Engine server to be started, which happens automatically when using the Houdini Engine Unity > Session > Create > Pipe Session option.

Socket Session

A Socket Session allows the main Houdini Engine processing to happen in a separate process, outside of the Unity process. For socket sessions, a TCP socket is used to communicate between the Unity process and the Houdini Engine process. This requires a Houdini Engine server to be started, which happens automatically when using the Houdini Engine Unity > Session > Create > Socket Session option.

This session type can also be used to create and use a Houdini Engine session on another machine. Note that if creating the session on another machine, loading HDA files will require same matching path as on the Unity machine.

Houdini Engine Debugger Session

A Houdini Engine Debugger session can help in debugging issues when using Houdini Engine for Unity. This allows the user to see loaded assets and the session state within Houdini in real-time. The plug-in can connect to an existing Houdini Engine Debugger session via Houdini Engine Unity > Session > Connect To Debugger menu options.

To use the Houdini Engine Debugger session:

  1. First start a Houdini Engine Debugger session in Houdini via Window > Houdini Engine Debugger and start one of session types.
  2. In Unity, select the same session type (Pipe or Socket) via Houdini Engine Unity > Session > Connect To Debugger.

Once connected, any asset instantiated in Unity will also be instantiated in the Houdini session. Parameter values and input geometry will also be reflected in the Houdini scene after cooking. If the user makes a change in Houdini (e.g. parameters, node state, network graph), in order to reflect that change in Unity, the asset must be Recooked from within Unity.


Session Troubleshooting

Restarting Sessions - If the Houdini Engine session is stuck in an error state or produces abnormal behaviour, it can most likely be resolved by restarting the default session (Houdini Engine Unity > Session > Restart Session). This closes the current session and creates a new session without any assets loaded. Once restarted, existing assets in the Unity Scene can be recooked by changing their parameters or by invoking Recook via the Inspector UI. Recooking will automatically load the asset into the new Houdini Engine session.