Forum

Javascript Errors

25 August 2015 09:54
I happen to have a exported JSON file loaded by html page. The script and the HTML file are basically taken from this example.

Now, when I load the file in Firefox I get a black rectangle and the following two errors in the console:
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: b.d.Ab.Ti[a.d.wc] is undefined
TypeError: e[h] is undefined
The latter returns all several milliseconds and stacks up in the console.
Even digging through the code, I can't see what could be the cause of this error.
25 August 2015 10:33
OK, after I've discarded exporting the armature the only error I get now is the following
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: a[0].indexOf is not a function
Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…
25 August 2015 11:59
It's means that your textures are out of the engine's repository folders. When you export into HTML file all textures and other resources are packed into HTML container. When you export to the json file and open it in the viewer you will need to place you textures, videos and sounds somewhere in the engine's repository folders.
Blend4web and that kind of thing.
25 August 2015 13:01

Ответ на сообщение пользователя goeck
OK, after I've discarded exporting the armature the only error I get now is the following

Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…

Hi! Can you attach your example? It would be easier to understand what went wrong.
25 August 2015 15:12
OK, sure. Please have a look at the attached blend file… Thanks so much for your support! I really appreciate it.
Also..one question by the way. I can't get the file loaded by the development viewer with the load parameter. Could you point me the way on how to successfully do this?
I used this URL: localhost:6687/apps_dev/viewer/viewer_dev.html?load=C:\MyDataFolder\model.json
25 August 2015 17:38

Also..one question by the way. I can't get the file loaded by the development viewer with the load parameter. Could you point me the way on how to successfully do this?
I used this URL: localhost:6687/apps_dev/viewer/viewer_dev.html?load=C:\MyDataFolder\model.json

The simplest way to do this is using "Run in Viewer" export option. So Blender will launch your default browser after export and will run the scene automatically in Viewer.

One thing, it requires to export your scene inside blend4web sdk folder, because our local development server is configured to serve this directory.

Of course you can edit the "load" parameter manually, but it should start with the same domain "http://localhost:6687/…" or should be a relative path (relative to server root - blend4web sdk folder) for example: "../../deploy/assets/misc/logo.json".

25 August 2015 19:10

OK, after I've discarded exporting the armature the only error I get now is the following
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory
TypeError: a[0].indexOf is not a function
Actually I didn't have to all this when exporting an integrated HTML file from Blender, all this worked fine from the very beginning…

OK, B4W WARN signalizes about incorrect naming of the loaded b4w js library ("b4w.full.js" in your case, but it should be "b4w.full.min.js"). This warning doesn't really affect anything.

The other error is reproduced using b4w15.07 version. But we've made many changes since the last release and it isn't reproduced when using the actual code. So I suggest you to wait for the next release and upgrade to 15.08. Probably it will be out by the weekend.
26 August 2015 09:36
Thank s for the replies.
I am trying out the 15.08 dev preview SDK in some minutes.
Actually using the 15.07 dev viewer, the JSON file gets loaded without any error.
Loading the same JSON from the selfmade viewer HTML results in the a[0].indexOf error…
26 August 2015 11:58
OK, using the 15.08 SDK preview everything worked fine now. No errors.
For debugging reasons, is there a unminified version of the b4w javascript library or do I have to unminify it myself every time I change the SDK version?

Also I happen to have some strange visual errors in the model after export, but I might open another thread for this?
26 August 2015 12:29
OK, visual errors have gone, since I exported the armature with the model. It seems the armature attached parts got lost when I didn't export it with the model.
 
Please register or log in to leave a reply.