0

I'm trying to load a different obj file in ARSimpleNativeCarsExample project from ARToolKit and I'm getting the following error

E/libeden: gmlReadOBJ() failed: can't open data file "Data/models/object.obj"

E/libARWrapper: Error loading model from file 'Data/models/object.obj'

With default obj file from project (Porche car) it's working as expected.

Lucist
  • 13
  • 6

1 Answers1

0

I think i found the problem. When the application is initialized, we do:

    initializeInstance() {
        // Unpack assets to cache directory so native library can read them.
        // N.B.: If contents of assets folder changes, be sure to increment the
        // versionCode integer in the AndroidManifest.xml file.
        AssetHelper assetHelper = new AssetHelper(getAssets());
        assetHelper.cacheAssetFolder(getInstance(), "Data");
    }

The assets (containing the 3D models) are copied to the cache directory to be used by the native library. But this is done just the first time you install the app. So if you changed the content of your Assets folder, you just have to uninstall your app on your device or just increment the versionCode integer in the Android manifest.

Bruno G
  • 1
  • 1