Search Unity

Vuforia 8.3.8 DataSet.Load always fails

Discussion in 'Vuforia' started by Sithdown, Jul 10, 2019.

  1. Sithdown

    Sithdown

    Joined:
    Aug 8, 2014
    Posts:
    10
    I've been using a script to load datasets on runtime from a known path (Android, iOS).

    It worked fine in Unity 2018.3.0f2, but I had to update because of other errors with Unity and Vuforia that were patched on newer versions.

    If I try

    Code (CSharp):
    1.  
    2. ObjectTracker objectTracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
    3.  
    4. if (objectTracker != null)
    5. {
    6.   objectTracker.Stop();
    7.  
    8.   if(File.Exists(dataSetXMLOutputPath)&&File.Exists(dataSetDatOutputPath))
    9.   {
    10.     Debug.Log("File exists");
    11.     DataSet dataSet = objectTracker.CreateDataSet();
    12.     if(dataSet.Load(dataSetXMLOutputPath, VuforiaUnity.StorageType.STORAGE_ABSOLUTE))
    13.     {
    14.       objectTracker.ActivateDataSet(dataSet);
    15.     }
    16.     else
    17.     {
    18.       Debug.Log("Could not load dataset");
    19.     }
    20.   }
    21.   else
    22.   {
    23.     Debug.Log("XML and/or DAT file does not exist");
    24.   }
    25.  
    26. }
    27.  
    File.Exists returns true, but dataSet.Load always fails. I've checked the files multiple times. The code just stopped working when I updated Unity and Vuforia.

    These are the versions I'm developing my project on:

    Unity 2018.4.3f1
    Vuforia 8.3.8

    Any ideas?

    Thanks
     
  2. Sithdown

    Sithdown

    Joined:
    Aug 8, 2014
    Posts:
    10
    No one? Nothing?
     
  3. meedabit

    meedabit

    Official Vuforia Employee Vuforia

    Joined:
    Dec 8, 2016
    Posts:
    266
    Hello,

    You can find reference code for loading a dataset using Vuforia APIs in the 8.3 version of the Core Samples: /Assets/SamplesResources/SceneAssets/ModelTargets/Scripts/ModelTargetsManager.cs

    The Vuforia Engine Core Samples are available for free on the Unity Asset Store.

    Thanks,
    Vuforia Engine Support