sideeffects / HoudiniEngineForUnity_deprecated

Houdini Engine for Unity (deprecated)
http://www.sidefx.com/unity
159 stars 44 forks source link

Houdini Debugger doesn't work out of the box? #14

Open tlaedre opened 6 years ago

tlaedre commented 6 years ago

We had some problem getting the debugger to work from within Unity, and identified a couple of places we had to patch up to get it working.

The first was in initializeSession where a new session (HARS process launched) is always created before trying to connect to it. I'd suggest adding a getSession call above the startProcess call, and return with a useful log entry that connection to existing host was made. https://github.com/sideeffects/HoudiniEngineForUnity/blob/f3cded3b8f8bd18e8fa523891b45e5768c3809e4/Assets/Houdini/Scripts/HoudiniHostSession.cs#L88

The other issues we had were that the paths passed from Unity to HAPI are all relative, which I guess works in the normal case because a spawned server process inherits Unity's environment including working directory. For a debugging session, it doesn't work though. We ended up patching both the getAllFoldersInPath function used for getting dependency search paths, as well as the prAssetPath path passed to loadOTL. https://github.com/sideeffects/HoudiniEngineForUnity/blob/f3cded3b8f8bd18e8fa523891b45e5768c3809e4/Assets/Houdini/Scripts/HoudiniHostLinker.cs#L296 https://github.com/sideeffects/HoudiniEngineForUnity/blob/f3cded3b8f8bd18e8fa523891b45e5768c3809e4/Assets/Houdini/Scripts/HoudiniAssetOTL.cs#L188

Lastly, it looks like the unity plugin isn't too good at cleaning up after itself. When running a debug session attached, it only takes a couple of minutes of active Unity work to end up with hundreds of abandoned, procedurally named nodes in the Houdini scene view - which makes it pretty hard to find the nodes you actually want to inspect.

SeelanV commented 6 years ago

Noted. Will look into this.