Forum

html loader page for json export.

08 August 2018 01:13
Hello
After 3 years of loyal service, I have been obliged to update my blend4web json on my website.
I have made very minor modifications to the blend file in 2.79b with blend4web_ce_18_05_0 and exported the scene as a json file. I thought that just by changer the file name in the html, all would be good, but sadly not. The first part of the page works but as soon as the json is called, the webpage locks up as a blank white page, without any chrome console errors. I figure that maybe the javascript is too old for the latest version of blend4web. Below is the loader html page:

<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />

	<!-- Css -->
	<link rel="stylesheet" type="text/css" href="css/loader.css" media="screen" />

	<!-- Script -->
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


	<script type="text/javascript">
	$(window).load(function() {
		$(".loader").fadeOut("slow");
	})
	</script>
</head>
<body>
	<div class="loader"></div>
	
	<!-- Js -->
	<script src="js/b4w.simple.min.js"></script>

	<script>
		var m_app  = b4w.require("app");
		var m_data = b4w.require("data");
		var m_cam  = b4w.require("camera_anim");

		m_app.init({
			canvas_container_id: "container_id",
				callback: load_cb,
				show_fps: false,
				console_verbose: true,
				autoresize: true
		})

		function load_cb() {
			m_data.load("180806_CL_BOX04_MERGED_BLEND4WEB_WIREFRAME_APPLY.json", loaded_cb);
		}

		function loaded_cb() {
		//    m_app.enable_controls();
			m_app.enable_camera_controls();
			m_cam.auto_rotate(0.15);
		}
	</script>   

	<div id="container_id" style="position: absolute; left: 0px; top: 0px; width:100%; height: 100%;"></div>
</body>
</html>


Any ideas would be most grateful.
Thank you.
14 August 2018 01:05
I found these errors in the firefox dev Tools.
I am under the impression that I have the latest b4w.simple.min.js but maybe I am wrong.
Any help is most welcome.


The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. index.html
B4W LOG: INIT ENGINE 17.04 RELEASE (25.04.2017 18:23:56) b4w.simple.min.js:532:24
B4W LOG: USER AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0 b4w.simple.min.js:532:24
B4W LOG: INIT WEBGL 2 b4w.simple.min.js:532:24
B4W LOG: GET EXTENSION WEBGL_debug_renderer_info b4w.simple.min.js:532:24
B4W LOG: RENDERER INFO: NVIDIA Corporation, NVIDIA GeForce GTX 680 OpenGL Engine b4w.simple.min.js:532:24
B4W WARN: Firefox and WebGL 2 detected, applying framebuffer hack. b4w.simple.min.js:532:491
B4W WARN: Firefox detected, disabling multisample b4w.simple.min.js:532:491
B4W LOG: GET EXTENSION (WebGL 2) ANGLE_instanced_arrays b4w.simple.min.js:532:24
B4W LOG: GET EXTENSION (WebGL 2) OES_vertex_array_object b4w.simple.min.js:532:24
B4W LOG: GET EXTENSION (WebGL 2) WEBGL_depth_texture b4w.simple.min.js:532:24
B4W WARN: OS X detected, applying shadows hack. b4w.simple.min.js:532:491
B4W WARN: Firefox detected, disable workers. b4w.simple.min.js:532:491
B4W LOG: GET EXTENSION WEBGL_compressed_texture_s3tc b4w.simple.min.js:532:24
B4W LOG: SET PRECISION: highp b4w.simple.min.js:532:24
B4W LOG: LOAD METADATA 180806_CL_BOX04_MERGED_BLEND4WEB_WIREFRAME_APPLY.json?v=25042017184719 b4w.simple.min.js:532:24
B4W ERROR: B4W engine version is a bit old relative to JSON. Some compatibility issues can occur. Update your engine version to fix it. b4w.simple.min.js:531:671
B4W LOG: LOAD BINARY 180806_CL_BOX04_MERGED_BLEND4WEB_WIREFRAME_APPLY.bin?v=25042017184719 b4w.simple.min.js:532:24
B4W WARN: material "C MAT" is not assigned to any face (object "CUBE"). b4w.simple.min.js:532:491
B4W WARN: Logic nodes type "SELECT" is deprecated
b4w.simple.min.js:532:491
[Show/hide message details.] TypeError: c is undefined[Learn More] b4w.simple.min.js:1337:85
Source map error: TypeError: NetworkError when attempting to fetch resource.
Resource URL: file:///Volumes/LIFE2/WEB_ARC/fearlesstv/html/js/b4w.simple.min.js
Source Map URL: /deploy/apps/common/b4w.simple.min.js.map[Learn More]
14 August 2018 16:53
Is this jquery still good ? Can I update to a newer version?
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
15 August 2018 10:21
By recopying the js and index.html files and opening them in various web browsers, I notice that for 1 second in Firefox, I see the 3D scene before it disappears, but in chrome, the page is instantly white.
This can all be seen at
http://212.237.31.164/index.html
03 September 2018 23:09
I found the solution. The node structures in blend4web from 2 years ago do not work anymore. I rebuilt with the new node system and all works fine.
 
Please register or log in to leave a reply.