CesiumGS/obj2gltf

What kind of OBJ? Wavefront OBJ or AliasMesh OBJ or?

Drjacky opened this issue · 4 comments

I used FreeCAD and exported STEP to both, Wavefront OBJ and AliasMesh OBJ.
In the case of Wavefront, it result 107 bytes! and in case of AliasMesh, it could correctly result 160MB but, when I used it In my Android application, it didn't show any model and I got this:

2020-07-30 11:20:29.356 27333-27333/com.google.ar.sceneform.samples.gltf E/rm.samples.glt: Unknown bits set in runtime_flags: 0x8000
2020-07-30 11:20:29.647 27333-27416/com.google.ar.sceneform.samples.gltf E/Perf: Fail to get file list com.google.ar.sceneform.samples.gltf
2020-07-30 11:20:29.647 27333-27416/com.google.ar.sceneform.samples.gltf E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2020-07-30 11:20:29.647 27333-27416/com.google.ar.sceneform.samples.gltf E/Perf: Fail to get file list com.google.ar.sceneform.samples.gltf
2020-07-30 11:20:29.647 27333-27416/com.google.ar.sceneform.samples.gltf E/Perf: getFolderSize() : Exception_1 = java.lang.NullPointerException: Attempt to get length of null array
2020-07-30 11:20:29.899 27333-27440/com.google.ar.sceneform.samples.gltf E/ModelRenderable: Unable to load Renderable registryId='door-AliasMesh.gltf'
    java.util.concurrent.CompletionException: java.io.FileNotFoundException: door-AliasMesh.gltf: open failed: ENOENT (No such file or directory)
        at com.google.ar.sceneform.rendering.LoadRenderableFromFilamentGltfTask.lambda$downloadAndProcessRenderable$1(LoadRenderableFromFilamentGltfTask.java:54)
        at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromFilamentGltfTask$tXLLTvSKfoxkH8DoOYyMb6HFU60.get(Unknown Source:2)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.io.FileNotFoundException: door-AliasMesh.gltf: open failed: ENOENT (No such file or directory)
        at libcore.io.IoBridge.open(IoBridge.java:496)
        at java.io.FileInputStream.<init>(FileInputStream.java:159)
        at com.google.ar.sceneform.utilities.LoadHelper.lambda$fileUriToInputStreamCreator$1(LoadHelper.java:212)
        at com.google.ar.sceneform.utilities.-$$Lambda$LoadHelper$Abl_Zg9gmLSUtxIy48adzUf3F8o.call(Unknown Source:6)
        at com.google.ar.sceneform.utilities.SceneformBufferUtils.inputStreamCallableToByteArray(SceneformBufferUtils.java:118)
        at com.google.ar.sceneform.rendering.LoadRenderableFromFilamentGltfTask.lambda$downloadAndProcessRenderable$1(LoadRenderableFromFilamentGltfTask.java:52)
        at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromFilamentGltfTask$tXLLTvSKfoxkH8DoOYyMb6HFU60.get(Unknown Source:2) 
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
        at libcore.io.Linux.open(Native Method)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
        at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7609)
        at libcore.io.IoBridge.open(IoBridge.java:482)
        at java.io.FileInputStream.<init>(FileInputStream.java:159) 
        at com.google.ar.sceneform.utilities.LoadHelper.lambda$fileUriToInputStreamCreator$1(LoadHelper.java:212) 
        at com.google.ar.sceneform.utilities.-$$Lambda$LoadHelper$Abl_Zg9gmLSUtxIy48adzUf3F8o.call(Unknown Source:6) 
        at com.google.ar.sceneform.utilities.SceneformBufferUtils.inputStreamCallableToByteArray(SceneformBufferUtils.java:118) 
        at com.google.ar.sceneform.rendering.LoadRenderableFromFilamentGltfTask.lambda$downloadAndProcessRenderable$1(LoadRenderableFromFilamentGltfTask.java:52) 
        at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromFilamentGltfTask$tXLLTvSKfoxkH8DoOYyMb6HFU60.get(Unknown Source:2) 
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:9192020-07-30 11:20:30.411 27333-27333/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638402! count 0, type 3
2020-07-30 11:20:30.411 27333-27333/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638403! count 0, type 3
2020-07-30 11:20:30.411 27333-27333/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1835009! count 0, type 3

About the previous error, it was my fault. Wrong path.
But, the problem still exists! I used AliasMesh OBJ to GLB, and it changed the model totally.
And in case of using glTF, it doesn't show the model:

2020-07-30 11:46:47.277 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638408! count 0, type 3
2020-07-30 11:46:47.285 4976-4995/com.google.ar.sceneform.samples.gltf E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-07-30 11:46:47.285 4976-4995/com.google.ar.sceneform.samples.gltf E/libc: Access denied finding property "vendor.camera.aux.packagelist"
2020-07-30 11:46:47.312 4976-4976/com.google.ar.sceneform.samples.gltf E/native: session.cc:2043 Invalid ray produced by view data!
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638402! count 0, type 3
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638403! count 0, type 3
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1835009! count 0, type 3
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1835010! count 0, type 3
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638407! count 0, type 3
2020-07-30 11:46:47.656 4976-5052/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: filterDurations: malformed duration key 1638408! count 0, type 3
2020-07-30 11:46:47.774 4976-5037/com.google.ar.sceneform.samples.gltf E/ModelRenderable: Unable to load Renderable registryId='ps/door-AliasMesh.gltf'
    java.util.concurrent.CompletionException: java.lang.OutOfMemoryError: Failed to allocate a 268435472 byte allocation with 25165824 free bytes and 124MB until OOM, target footprint 163374544, growth limit 268435456
        at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:278)
        at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:284)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1629)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.OutOfMemoryError: Failed to allocate a 268435472 byte allocation with 25165824 free bytes and 124MB until OOM, target footprint 163374544, growth limit 268435456
        at java.util.Arrays.copyOf(Arrays.java:3161)
        at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
        at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153)
        at com.google.ar.sceneform.utilities.SceneformBufferUtils.copy(SceneformBufferUtils.java:75)
        at com.google.ar.sceneform.utilities.SceneformBufferUtils.inputStreamToByteArray(SceneformBufferUtils.java:127)
        at com.google.ar.sceneform.utilities.SceneformBufferUtils.inputStreamCallableToByteArray(SceneformBufferUtils.java:119)
        at com.google.ar.sceneform.rendering.LoadRenderableFromFilamentGltfTask.lambda$downloadAndProcessRenderable$1(LoadRenderableFromFilamentGltfTask.java:52)
        at com.google.ar.sceneform.rendering.-$$Lambda$LoadRenderableFromFilamentGltfTask$tXLLTvSKfoxkH8DoOYyMb6HFU60.get(Unknown Source:2)
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1627)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:9192020-07-30 11:46:47.819 4976-5076/com.google.ar.sceneform.samples.gltf E/ACameraMetadata: getConstEntry: cannot find metadata tag 65578
2020-07-30 11:46:48.284 4976-4976/com.google.ar.sceneform.samples.gltf E/native: hit_test.cc:381 generic::internal: No point hit.
2020-07-30 11:46:48.318 4976-4976/com.google.ar.sceneform.samples.gltf E/native: hit_test.cc:381 generic::internal: No point hit.

@Drjacky have you tried loading the glTF in a different viewer, like https://gltf-viewer.donmccurdy.com/?

Just want to check whether this is a bug in obj2gltf bug or a bug in the Android Application.

@lilleyse You were right! It shows perfectly on the https://gltf-viewer.donmccurdy.com/.