Forum

Clarification on webpage structure

09 February 2016 21:17
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
11 February 2016 15:05
Hi,
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.
That's correct.
As usual, your help is much appreciated,
You're welcome!
The Founder | Twitter | Facebook | Linkedin
13 February 2016 19:18
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
15 February 2016 13:15

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).

Hope i was clear
Blend4Web Team - developer
Twitter
LinkedIn
18 February 2016 05:30
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:
<!DOCTYPE html>
<html>
<head>
    <title>3D Experience</title>
<script type="text/javascript" src="/deploy/apps/myproject.js"></script>
</head>
<body>
    <iframe width="800" height="600" allowfullscreen src="/deploy/apps/webplayer/webplayer.html?load=../../assets/New_Swears_Room/myprojecct.json"></iframe>
</body>
</html>


I also tried "../../deploy/apps/myproject.js" but that did not work.
If you can help, it would be much appreciated.
Thanks,
Cluetrekk
18 February 2016 14:47
Hi,
I'm getting an error message in the console log
Could you please provide a screenshot of that console message?
The Founder | Twitter | Facebook | Linkedin
19 February 2016 04:07
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
19 February 2016 10:48
just in case : you've got lot of "B4W WARN: non-uniform scale for object".
Dont forget to check "Apply Scale and modifiers" on "Export Options" of objects.
19 February 2016 18:16
like it was connecting with some historic .json files,
Can't it be browser cache?
The Founder | Twitter | Facebook | Linkedin
20 February 2016 01:41
It worked. Simple as that.
Thanks very much.
 
Please register or log in to leave a reply.