expo-three
expo-three copied to clipboard
Possible Unhandled Promise Rejection (id: 0):
Hello. Thanks for the library! I get this error when trying to load 3ds files. Obj files work just fine. Any thoughts why this might be happening
Possible Unhandled Promise Rejection (id: 0):
Object {
"bubbles": false,
"cancelable": false,
"currentTarget": XMLHttpRequest {
"DONE": 4,
"HEADERS_RECEIVED": 2,
"LOADING": 3,
"OPENED": 1,
"UNSENT": 0,
"_aborted": false,
"_cachedResponse": undefined,
"_hasError": true,
"_headers": Object {},
"_incrementalEvents": true,
"_lowerCaseResponseHeaders": Object {},
"_method": "GET",
"_requestId": null,
"_response": "",
"_responseType": "arraybuffer",
"_sent": true,
"_subscriptions": Array [],
"_timedOut": false,
"_trackingName": "unknown",
"_url": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540alexandrius%252FMenuT/ExponentAsset-69b6af9f880511e31e20a76bb1454953.3ds",
"readyState": 4,
"responseHeaders": undefined,
"status": 0,
"timeout": 0,
"upload": XMLHttpRequestEventTarget {
Symbol(listeners): Object {},
},
"withCredentials": true,
Symbol(listeners): Object {
"error": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
"load": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
"progress": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
},
},
"eventPhase": 2,
"isTrusted": false,
"target": XMLHttpRequest {
"DONE": 4,
"HEADERS_RECEIVED": 2,
"LOADING": 3,
"OPENED": 1,
"UNSENT": 0,
"_aborted": false,
"_cachedResponse": undefined,
"_hasError": true,
"_headers": Object {},
"_incrementalEvents": true,
"_lowerCaseResponseHeaders": Object {},
"_method": "GET",
"_requestId": null,
"_response": "",
"_responseType": "arraybuffer",
"_sent": true,
"_subscriptions": Array [],
"_timedOut": false,
"_trackingName": "unknown",
"_url": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540alexandrius%252FMenuT/ExponentAsset-69b6af9f880511e31e20a76bb1454953.3ds",
"readyState": 4,
"responseHeaders": undefined,
"status": 0,
"timeout": 0,
"upload": XMLHttpRequestEventTarget {
Symbol(listeners): Object {},
},
"withCredentials": true,
Symbol(listeners): Object {
"error": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
"load": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
"progress": Object {
"kind": 2,
"listener": [Function anonymous],
"next": null,
},
},
},
"timeStamp": 1553355759835,
"type": "error",
Symbol(stop_immediate_propagation_flag): false,
Symbol(canceled_flag): false,
Symbol(original_event): Object {
"type": "error",
},
}
This is my metro.config.js
module.exports = {
resolver: {
assetExts: ["db", "mp3", "ttf", "obj", "png", "jpg", "otf", "mtl", "3ds"]
}
};
Thanks!
This is my code
const model = {
'guitar.3ds': require(`./assets/models/guitar.3ds`),
'gibson_50th_anniversary_1958_les_paul_bk2.jpg': require('./assets/models/gibson_50th_anniversary_1958_les_paul_bk2.jpg'),
's_aberdeen_oak2222.jpg': require('./assets/models/s_aberdeen_oak2222.jpg'),
's_aberdeen_oak2222bump.jpg': require('./assets/models/s_aberdeen_oak2222bump.jpg'),
};
const mesh = await ExpoTHREE.loadAsync(
model['guitar.3ds'],
null,
name => model[name]
);
const normal = await ExpoTHREE.loadAsync(model['s_aberdeen_oak2222bump.jpg']);
mesh.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.material.normalMap = normal;
}
});
ExpoTHREE.utils.scaleLongestSideToSize(mesh, 3);
ExpoTHREE.utils.alignMesh(mesh, { y: 1 });
this.scene.add(mesh);
this.cube = mesh;
I have the same problem. Did you find a solution?
Unfortunately no
hello any solution?
Same problem with fbx
file
Same with dae , glb and gltf extensions
similar with gltf. any solution yet?
got any solutions for this?
@p4tric see #151 , there are some solutions that worked for me
Tried using asset.uri instead of asset.localUri and Android works in debug mode, but when distributed via APK, it fails to load the uri due to it being local.. (file:///)