Vorion Posted February 3, 2018 Share Posted February 3, 2018 Hi, I've been trying to load a json file using the assetmanagers textfile task, but this only returns an arraybuffer. I would have expected that the task returns a simple string which I then can parse to a json object. When loading the file directly through an xmlhttprequest, I get the string which can be parsed without a problem. Here's an example: http://www.babylonjs-playground.com/#GIKDTN#3 You can see in the console log, that the textfile task returns an arraybuffer and then fails to parse it as a json object. What am I doing wrong here? Thanks EDIT: I guess this is a bug in Babylon.js 3.2.0, when I switch to stable version in the playground, it works as I expected. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted February 3, 2018 Share Posted February 3, 2018 Hi Vorion... sorry to hear you are having problems. I did some testing/playing... https://www.babylonjs-playground.com/#GP88V#6 As you can see, I "hijacked" some of the BJS core TextFileAssetTask functionality... into the playground. See that 'false' in line 73? That is the useArrayBuffer parameter... as seen in line 3. For some reason, BABYLON.Tools.LoadFile (possibly line 24) is ignoring or over-riding that parameter. So, just like you, I get an arrayBuffer, but no text... in my tests. Sorry, I have no solution, but I'm studying it. Hopefully, smarter people than I... will comment soon. I'm also wondering... if a recent security situation... which is rumored to cause trouble with shared memory... has affected this situation. See this post and its follow-up. Maybe... related. Not sure. https://blog.barkly.com/meltdown-spectre-patches-list-windows-update-help Sorry I don't have good answers yet, but I can smell something nearby. Something is stinky... in this dumpster that I'm currently exploring. heh. XMLHttpRequestObject is a "reach out and touch someone" (groping) thing (just like the current USA president and other mostly-male decadents). It has been a "house of ill-repute" for its entire existence. Some changes in XHR about 12 years ago... killed a 7 year marriage between me and a multimedia chat client I was developing. So, I don't trust it. It is like a seaport or bus depot - slimy things ooze in/out of it. Virus coders and sandbox/firewall hackers... are also "slimy" and hang-out around ports. Smell 'em? *nod* Can't back-up the text truck and load any parse-able json into it. Hacker poop... making the loading ramps and docks... too slippery. (Wingy watching Saturday morning cartoons... being goofy-minded) Quote Link to comment Share on other sites More sharing options...
Vorion Posted February 5, 2018 Author Share Posted February 5, 2018 On 3.2.2018 at 3:34 PM, Wingnut said: Thanks for the answer (and your message), guess I'll have to wait for other devs to also look into this Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2018 Share Posted February 6, 2018 Good catch! It was a bug. It will be fixed by next commit in a couple of hours Thanks a lot Vorion and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.