User posts danielsvane
11 May 2016 23:06
I have a file upload system, where the files are renamed to a md5 hash to avoid naming conflicts. My problem is that the .bin file has to be the same name as the .json file (also same location). Is there some way to specify the .bin file location? I am loading the .json using this code:
let m_app = b4w.require("app");
let m_data = b4w.require("data");
m_app.init({
canvas_container_id: "canvas_cont",
callback: init_cb,
physics_enabled: false,
media_auto_activation: false
});
function init_cb(canvas_elem, success) {
m_data.load("../"+jsonFile, load_cb);
}
function load_cb(root) {
m_app.enable_camera_controls();
}
11 May 2016 00:12
Okay I managed to solve it using:
It's a documented feature, though very hard to find:
https://www.blend4web.com/api_doc/module-main.html#.reset
b4w.require("main").reset()
It's a documented feature, though very hard to find:
https://www.blend4web.com/api_doc/module-main.html#.reset
10 May 2016 21:50
The problem is, unlike traditional webpages, the user actually never leaves. HTML is just removed and added using JS. This code is run every time someone visits a page in my app:
Instead of registering "example_main", should I just maybe remove the loaded scene, and load another one when user enters a different page?
b4w.register("example_main", function(exports, require) {
var m_app = require("app");
var m_data = require("data");
exports.init = function() {
m_app.init({
canvas_container_id: "canvas_cont",
callback: init_cb,
physics_enabled: false,
media_auto_activation: false
});
}
function init_cb(canvas_elem, success) {
m_data.load("../"+jsonFile, load_cb);
}
function load_cb(root) {
m_app.enable_camera_controls();
}
});
b4w.require("example_main").init();
Instead of registering "example_main", should I just maybe remove the loaded scene, and load another one when user enters a different page?
07 May 2016 14:36
07 May 2016 04:08
First off, thanks for this great project.
I'm trying to export an animation from Blender, and have it start the whole scene animation when it's loaded. So far I've only been able to start the animation on individual objects using "Apply Default Animation" through Blender.
Any help is appreciated.
I'm trying to export an animation from Blender, and have it start the whole scene animation when it's loaded. So far I've only been able to start the animation on individual objects using "Apply Default Animation" through Blender.
Any help is appreciated.