For a school project I have to use ArCore for displaying a .obj that was given to me by a client I am doing the project for. I have tried at first with a random .obj that I have found in a license free website and it works quite well, but whenever I try with the .obj of the client, it tells me that it cannot be loaded and I don't really know what to do.
Here is the error in the logcat :
2020-04-10 21:08:28.745 28542-29004/com.example.artest E/ModelRenderable: Unable to load Renderable registryId='sebastien.sfb'
java.util.concurrent.CompletionException: java.io.FileNotFoundException: sebastien.sfb (No such file or directory)
at com.google.ar.sceneform.utilities.SceneformBufferUtils.inputStreamToByteBuffer(SourceFile:48)
And here is my code :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
arFragment = (ArFragment) getSupportFragmentManager().findFragmentById(R.id.ux_fragment);
createScene();
}
private void createScene() {
mScene = arFragment.getArSceneView().getScene();
ModelRenderable.builder()
.setSource(this, Uri.parse("sebastien.sfb"))
.build()
.thenAccept(renderable -> onRenderableLoaded(renderable))
.exceptionally(throwable -> {
Log.i("Sceneform", "failed to load model");
return null;
});
}
void onRenderableLoaded(ModelRenderable model) {
Node modelNode = new Node();
modelNode.setRenderable(model);
modelNode.setParent(mScene);
modelNode.setLocalPosition(new Vector3(0, 0, 0));
mScene.addChild(modelNode);
}
Thank you in advance for your help.