Forum

Clarification on webpage structure

This may seem like a simple question, but not being familiar with code or webpages, I will swallow my pride and ask anyway. When a page is loaded up on a commercial hosting site the index.HTML page is coded to call upon the Webplayer.html and the <myproject.JSON> file. The <myproject.JSON> file will, in turn, call upon the <myproject.bin> file and the <myproject.js> file. This <myproject.js> file will then call upon additional .js files as necessary, the <myproject.css> file and holds the additional code necessary to make the scene work …i.e. code that has not already been created in the logic node editor within Blender.

To ultimately load the project on the commercial web server, the location of these files must placed appropriately as per the Project Structure. However, not all of these files are required. If one has opted for the .JSON webplayer and not the HTML webplayer then the <myproject.html> and <myproject_dev.html> files are not required. On the commercial web page, the .blend file is not required as the information is contained in the .JSON file and the .bin file, but all of the media assets must be copied over. Also, on the commercial web page the files should be placed in deploy/apps/myproject folder rather than the apps_dev/myproject/ folder as that was only used for development on ones computer. Is all of this more or less correct?As usual, your help is much appreciated,Cluetrekk

When a page is loaded up on a commercial hosting site the index.HTML page is coded to call upon the Webplayer.html and the <myproject.JSON> file. The <myproject.JSON> file will, in turn, call upon the <myproject.bin> file and the <myproject.js> file. This <myproject.js> file will then call upon additional .js files as necessary, the <myproject.css> file and holds the additional code necessary to make the scene work …i.e. code that has not already been created in the logic node editor within Blender.

To be more exact, the web player application (which consists of html, css and js files) loads the JSON file with scene data. This JSON file in turn loads the corresponding BIN file (with mesh and animation data) and optionally external resources (textures, sounds, videos).

On the commercial web page, the .blend file is not required as the information is contained in the .JSON file and the .bin file, but all of the media assets must be copied over. Also, on the commercial web page the files should be placed in deploy/apps/myproject folder rather than the apps_dev/myproject/ folder as that was only used for development on ones computer.

Thanks very much. Just for further clarification, based on what was discussed above, I was expecting to see the myproject.js file called within the myproject.json file; however, I did not see it there. Should the myproject.js file be called separately from the initial HTML code inserted on the host webpage? Thanks,Cluetrekk

Just for further clarification, based on what was discussed above, I was expecting to see the myproject.js file called within the myproject.json file; however, I did not see it there. Should the myproject.js file be called separately from the initial HTML code inserted on the host webpage?

Hello!If you use .JSON webplayer or HTML webplayer types of projects no .js files are created by default and the only .js file used is webplayer.min.js which contains webplayer app logic and will work with your scene content. So the only way to modify scene logic is to make changes in web player (not useful way of course). You can call other external .js files from the initial HTML for common web page scripting (not within b4w scene).

Hi, Thanks. Your instructions are clear; however, I'm getting an error message in the console log indicating that myproject.js could not be loaded (not found). The file is located here: public_html/deploy/apps/myproject.js (myproject.css is also in this location) The HTML code is written as follows:

Ok. There seems to be some strange stuff going on with the server. I have a web domain hosted by e-Host and am using cPanel to upload the B4W files with a webpage developed with WordPress. Everything is working. I have the page loading. It can be viewed here: Newswears.com/3d; however, there are problems. The scene that loads is not the most current. The obvious solution is to upload the most recent .JSON file and .bin files and it should work…but the scene that loads is old (i.e. objects are not there, in the wrong place, etc.). All files have been confirmed to be the most recent by date, time and size in all locations. Another issue, which may be related, is that I have code in a .js file which does not load as can be seen in the attached console log. You can also see from the log that some audio files do not load. For these audio files, a comma in the name prevented them from loading originally; however, this was corrected, but for some reason it is still looking for them. The newest .json file loads up flawlessly in the fast viewer. I contacted eHost to find out if they had any solutions as it seemed like it was connecting with some historic .json files, but they indicated it must be related to the B4W software?? I've attached the .json file that I was attempting to load up to the website. Your assistance is very much appreciated.Cluetrekk