I have created a Visual Gesture Builder database file TestGestures4.gdb and put it in my Assets folder, in a subfolder named StreamingAssets.
I have code to load this database into my game:
_gestureDatabase = VisualGestureBuilderDatabase.Create(Application.streamingAssetsPath + @"/" + GestureDatabaseFile);
However, when I run my game, and step through the debugger to this point:
namespace Microsoft.Kinect.VisualGestureBuilder
{
public sealed partial class VisualGestureBuilderDatabase
{
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor([MarshalAs(UnmanagedType.LPWStr)]string path);
public static VisualGestureBuilderDatabase Create(string path)
{
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor(path);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase>(
objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase(n));
}
}
I am always returned a NULL pointer.
Here is what the debugger shows as the path my TestGestures4.gdb file is located:
What am I doing wrong here?
Solved it. I spelt the name of my visual gesture builder database file wrong:
I put “TestGestures4.gdb”.
It should be:
TestGestures4.gbd