Unity3D will not load a VisualGestureBuilderDatabase file.
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?
BTW...here is a screenshot of where my Visual Gesture Builder database file is located:
I just noticed above that the directory path used forward slashes '/' ins$$anonymous$$d of backslashes '\'. Since backslashes are traditional to Windows, I tried this:
string gestureDatabasePath = Path.Combine(Application.strea$$anonymous$$gAssetsPath, GestureDatabaseFile);
gestureDatabasePath = gestureDatabasePath.Replace(@"/", @"\");
_gestureDatabase = VisualGestureBuilderDatabase.Create(gestureDatabasePath);
Still no luck. Still null pointer returned to _gestureDatabase from the Create() call.
Answer by DerrickLau · Apr 08, 2017 at 03:18 AM
Solved it. I spelt the name of my visual gesture builder database file wrong:
I put "TestGestures4.gdb".
It should be:
TestGestures4.gbd
Your answer
![](https://koobas.hobune.stream/wayback/20220612114902im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rotation doesn't work with JointOrientation from kinect in Unity3D 5 1 Answer
How to send Kinect skeleton data through Unity networks (multiplayer) 0 Answers
KINECT attach an array of objects to array of bodies 0 Answers
How to convert 2D texture to JEPG format ? 1 Answer
Add reference of Kinect V2.0 to Unitiy 5.4.1f1 professional correctly 0 Answers