论坛

由用户创建的信息 WillWelker
15 October 2015 14:09
What is the "Best Practice" way to make a new app in the Project Manager?
15 October 2015 07:38
I just finished a "Hello World" project designed to be simple yet show all the basic concepts of a full app.

Project Page
Project Video

It is vary basic, so it won't mean much to those of you who are beyond the basics.
Many thanks to the Blend4Web team for helping me get all the details right.
15 October 2015 07:32
I have to agree with you. This technology is still in the formative stages but this team is building a solid foundation. I think they have their ducks in a row.
15 October 2015 07:12
After changing the css color to white, I see the FPS number in the top right of the screen.
Hmm feels like I am doing something right but still something wrong
15 October 2015 05:57
What are the steps to get a scene to load with a project created in the project manager?

I have created a new bundled project.
Created a .blend and exported the JSON file (default cube). It loads in the viewer.
Then I try to open the HTML file from the project manager link but I get console errors.
Just getting a black screen.

See attached image with screenshots.
No code was changed in the created files.

*Edit* I just needed to get Java added to the Path.
12 October 2015 07:17
Hey, I should also mention there is a way to show the errors in your browser when something isn't working.
Browsers have a console you can open, I just did a post on it HERE.
12 October 2015 07:13
CTRL-SHIFT-J opens the console in Chrome
CTRL-SHIFT-K Opens it in Mozilla

This is one of those cool features that is so basic to professional programmers that they might not think to mention it. I recently discovered this so I wanted to pass it along. There are tons of useful bits you can gain from this.

More info…
Chrome Console
Mozilla Console

Attached is a screenshot of what happens when you open an HTML file that depends on the JSON data as well as b4w.min.js. When opening this file without using your local server, the JS files can't load.
12 October 2015 03:57
So unlike the self contained HTML file, this type of export can not be opened directly. The security settings on your browser do not allow JavaScript files to be executed from your local machine. It must be run from a server. Happily, your SDK comes with one. When you open your SDK with the button inside Blender, you are using the local server. The root directory of your server is the Blend4Web folder. So if you place the Hello_World folder inside your Blend4Web folder then put the address in your browser, it will work.
See my attached image.

This server is running whenever you open Blender (assuming you have the Blend4Web SDK installed). For convenience, I placed a shortcut in my bookmarks bar to localhost:6687.
11 October 2015 18:00
Okay, great. I will put that information in.
11 October 2015 11:46
I am working on commenting the code for a basic app.

"use strict";                                // forces this code to execute in strict mode, no undeclared variables

                                             // The following variables are loaded with abilities from the main blen4web engine. 
                                             // For details, open your SDK from within Blender and plug in the URL provided below

var app = b4w.require("app");                // localhost:6687/deploy/api_doc/module-app.html
var data = b4w.require("data");              // localhost:6687/deploy/api_doc/module-data.html


app.init({                                   // this executes the function to start up the app and loads it into the div with the id of "background_app"
    canvas_container_id: "background_app",
    physics_enabled: false,
    autoresize: true,
    callback: load_cb
});
	
function load_cb() {                         // this creates the function that loads the data from your JSON file
data.load("hello_world.json", loaded_cb);

}
	
function loaded_cb() {                       
		
}

What does that last function, loaded_cb do? Is it to let the player know the app has loaded?