论坛

由用户创建的信息 mikejamesbelanger
21 September 2016 23:08
Alright so the canvas renders now. The trick was to get uranium.js, **and** uranium.mem.js in the same directory as index.html. It appears the clojurescript-generated js works!

But I'm a little confused. From what the manual says, uranium is the physics engine for blend4web. And, from what the [manual states](https://www.blend4web.com/doc/en/developers.html#loading-scenes-in-apps), isn't necessary for a minimal blend4web project. I didn't have any physics in my scene either, just a cube, light and material.

I have no problem including uranium, I'm just trying to understand how it all works. The more I understand, the better!
21 September 2016 16:11
I had another thought about this problem.

When I created the bindings for blend4web, I *only* used ../tools/closure-compiler/externs_modules.js. Of course, there's other externs files in that subdir.

I feel silly even asking this, but I'm guessing you use all the files the closure-compiler subdir to produce b4w.min.js? Or are some of those for different kinds of builds?
16 September 2016 20:25
Sorry to bump this guys, I had another thought.

After googling this error
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory


I came across this thread where someone encounters a similar error. In that case, it looked like the files weren't sitting in the proper blend4web deploy directory.

So I tried moving my project over to the deploy directory, so that the index.html sits in ../deploy/assets/blend4web_test/target/index.html. Still doesn't load. Am I getting warm though? Do I have to re-export the .blends for the right subdir?

Thanks
14 September 2016 19:34
Hi guys,

I'm attempting to integrate clojurescript with a blend4web. The idea is to get Clojurescript to compile down into javascript code, which in turn controls an existing blend4web scene. This javascript code is similar to the code that's usually used to control blend4web. I say 'similar' code, because Clojurescript's code is (like blend4web) optimized through Google Closure, and it looks a little different than hand-written javascript.

To test this integration out, I'm making a simple blend4web scene to test out the clojurescript bindings. It's just a simple cube, with no materials, images, or (I think) any external data linked to it. I've exported this cube scene with the blend4web exports, using the .json option. I've linked stuff up into the html.

While it appears that clojurescript is loading up the basic b4web modules, B4W is giving the following feedback:
B4W WARN: Couldn't determine path to ancillary resources, fallback to the current page directory


There's a bunch of other warnings after the above, but I suspect they're all a result of the first error. It looks like this error is about not loading some external resources, but my scene is just a cube, with no materials or anything. So I'm not sure what resource my .blend is missing.

I'm pretty sure I'm invoking blend4web improperly, but I can't quite see how. Here's the JS output that is ultimately expected to control the blend4web scene:
// Compiled by ClojureScript 1.7.228 {}
goog.provide('cube_test.core');
goog.require('cljs.core');
cube_test.core.check_version = (function cube_test$core$check_version(){
var m_version = b4w.require("version");
return console.log(m_version.version());
});
cube_test.core.check_version.call(null);
cube_test.core.hello = (function cube_test$core$hello(){
var m_main = b4w.require("main");
var m_data = b4w.require("data");
var canvas = document.getElementById("container");
m_main.init(canvas);

return m_data.load("cube_test.json");
});


You can see this code in it's context in the repo here: https://github.com/mikebelanger/blend4web_test/blob/master/target/main.out/cube_test/core.js

Now, there's obviously an html file, json, .bin, and of course, a .blend. I've uploaded all this stuff to https://github.com/mikebelanger/blend4web_test

If you're just interested in the blend4web side of it, you can see the outputted code in: https://github.com/mikebelanger/blend4web_test/tree/master/target

Thanks for checking this out, I know its a wacky idea.
04 May 2016 15:39
Hi guys,

I started messing around with blend4web a few days ago – really impressed by how easy it is!

I'd like to find some way of driving some blend4web animations(or even just an animation channel) with audio. Probably with Chrome's WebAudio API.

Looking through the source code, I'm unsure how feasible this would be. Everything seems accessible through function calls, so I'm guessing it wouldn't be too hard. But what do you guys think? Is this possible, or am I just doing something that blend4web isn't really meant to do, and this won't work?

Thanks