google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Can't load local GLTF models in runtime. Arcore 1.16.0 #1028

Closed Sergiioh closed 4 years ago

Sergiioh commented 4 years ago

Good Day. How can i load a local GLTF without the RenderableSource(assets library)?

I tried changing the uri like this(the model is in assets folder):

ModelRenderable.builder() .setSource( this, Uri.parse("model/localmodel.gltf")) .setIsFilamentGltf(true) .build() .thenAccept( modelRenderable -> { GltfActivity activity = weakActivity.get(); if (activity != null) { activity.renderable = modelRenderable; } }) .exceptionally( throwable -> { Toast toast = Toast.makeText(this, "Unable to load Tiger renderable", Toast.LENGTH_LONG); toast.setGravity(Gravity.CENTER, 0, 0); toast.show(); return null; });

But i got this error: `2020-03-25 20:11:10.189 6000-6055/com.google.ar.sceneform.samples.gltf W/native: ransac.cc:696 Exiting without computing LS fit after RANSAC, as minimum of 2 pts are required. 2020-03-25 20:11:10.189 6000-6055/com.google.ar.sceneform.samples.gltf W/native: ransac.cc:696 Exiting without computing LS fit after RANSAC, as minimum of 2 pts are required. 2020-03-25 20:11:10.198 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x14E01C0, l_gain=0x14E01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.234 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x24F01C0, l_gain=0x24F01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244

--------- beginning of crash

2020-03-25 20:11:10.245 6000-6024/com.google.ar.sceneform.samples.gltf A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 6024 (FEngine::loop) 2020-03-25 20:11:10.247 1294-1294/? D/CustomFrequencyManagerService: releaseDVFSLockLocked : Getting Lock type frm List : DVFS_MIN_LIMIT frequency : 1651200 uid : 1000 pid : 1294 tag : AMS_RESUME_TAIL@CPU_MIN@32 2020-03-25 20:11:10.280 777-6086/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x36201C0, l_gain=0x36201C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.305 777-6086/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x54D01C0, l_gain=0x54D01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.336 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x78A01C0, l_gain=0x78A01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.367 777-6086/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x9E201C0, l_gain=0x9E201C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.400 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xB1A01C0, l_gain=0xB1A01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.415 6121-6121/? A/DEBUG: 2020-03-25 20:11:10.416 6121-6121/? A/DEBUG: Build fingerprint: 'samsung/dreamqltesq/dreamqltesq:7.0/NRD90M/G950USQU1AQDE:user/release-keys' 2020-03-25 20:11:10.416 6121-6121/? A/DEBUG: Revision: '12' 2020-03-25 20:11:10.416 6121-6121/? A/DEBUG: ABI: 'arm64' 2020-03-25 20:11:10.416 6121-6121/? A/DEBUG: pid: 6000, tid: 6024, name: FEngine::loop >>> com.google.ar.sceneform.samples.gltf <<< 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x0 0000000000000000 x1 0000007f6861a3a0 x2 0000000000000011 x3 0000000000000010 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x4 0000000000000014 x5 0000000000001790 x6 00000007ff6ba410 x7 0000007f536e3e94 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x8 0000000000000000 x9 0000000000000001 x10 0000000000004000 x11 0000007f525014e8 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x12 0000000000000000 x13 0000007f536e4118 x14 0000000000010000 x15 0000000000001788 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x16 0000000000001788 x17 0000007f75932f28 x18 000000000000ffff x19 0000007f6861a3a0 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x20 0000000000000000 x21 0000000000000002 x22 0000007f52c00820 x23 0000007f4784cc70 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x24 0000007f4784cc80 x25 00000000000fd000 x26 0000007fe6937fc8 x27 43fd63a65881de83 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: x28 43fd63a65881de83 x29 0000007f52501430 x30 0000007f72bcc81c 2020-03-25 20:11:10.417 6121-6121/? A/DEBUG: sp 0000007f525011c0 pc 0000007f72bccc30 pstate 0000000080000000 2020-03-25 20:11:10.420 6121-6121/? A/DEBUG: backtrace: 2020-03-25 20:11:10.420 6121-6121/? A/DEBUG: #00 pc 0000000000092c30 /data/app/com.google.ar.sceneform.samples.gltf-2/lib/arm64/libgltfio-jni.so 2020-03-25 20:11:10.420 6121-6121/? A/DEBUG: #01 pc 0000000000092818 /data/app/com.google.ar.sceneform.samples.gltf-2/lib/arm64/libgltfio-jni.so 2020-03-25 20:11:10.439 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA8401C0, l_gain=0xA8401C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.466 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x99701C0, l_gain=0x99701C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.500 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA0401C0, l_gain=0xA0401C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.536 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA0B01C0, l_gain=0xA0B01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.569 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA5201C0, l_gain=0xA5201C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.599 777-6086/? I/mm-camera: < INFO> 2109: TSAec_process: TSAec_process works: stats' frame_id=19, is_ss_app=0 2020-03-25 20:11:10.603 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA4301C0, l_gain=0xA4301C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.635 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x9DB01C0, l_gain=0x9DB01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.667 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x97601C0, l_gain=0x97601C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.701 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0x96901C0, l_gain=0x96901C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.735 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA0B01C0, l_gain=0xA0B01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.769 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xA9A01C0, l_gain=0xA9A01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 2020-03-25 20:11:10.803 777-6090/? I/mm-camera: < INFO> 1419: sensor_apply_exposure: s_gain=0xABF01C0, l_gain=0xABF01C0, s_linecount=3218,l_linecount=3218, fl_lines=3244 `

tpsiaki commented 4 years ago

Thanks for the report. There is an issue with our gltf/json loading right now that I'm working on fixing.

In the mean time if you load a glb that should work for you. If you need to convert a gltf to a glb in order to make progress I recommend gltf-pipeline. Once installed you can just run gltf-pipeline -i <filename>.gltf -o <filename>.glb and it will convert your gltf to a glb.

I will leave this open until there's a fix available.

tpsiaki commented 4 years ago

This is now fixed in head, please let me know if you run into other issues. Thanks!