Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Sceneform Asset option gives error while generating SFB file using OBJ file

I have an OBJ file for the 3D Object and I'm using Import Sceneform Asset to convert it to SFA but while doing so it is always giving me error stating Failed to find 'sampledata/models/plc.mtl' on disk

enter image description here

You can see red boxes.

In one them you can see gradle has created the background code for sceneform.asset but due to mtl missing it cannot go further.

Also, in the default google's arcore project the SFB file is in raw folder but it is creating in assets folder.

See the below image.

enter image description here

Can anyone please help me out with this. I'm a newbie to ARCore Development.

like image 806
Karthik Saxena Avatar asked Nov 07 '22 04:11

Karthik Saxena


1 Answers

Please follow this, and if have any problem let me know

You need the .obj and .mtl. Create a folder in Android using the Sample Data Directory (to avoid this making part of your project)

enter image description here

Inside this folder add the .obj and .mtl

Go to Android Preferences > Plugins and search for "Google Sceneform Tools (Beta)"

enter image description here

Clicking with the right button on the .obj you can select "Import Sceneform Asset" This will create the .sfb and .sfa file, already ready to use.

And in your App Gradle you should find new lines like this:

sceneform.asset('sampledata/NAME_OF_FILE.obj',
    'default',
    'sampledata/NAME_OF_FILE.sfa',
    'src/main/assets/NAME_OF_FILEl')
like image 60
Canato Avatar answered Nov 14 '22 21:11

Canato