User posts Ivan Lyubovnikov
06 March 2017 19:30
В приложении архив, который формируется после нажатия "build project" и "deploy project".Проект в архиве - некорректный, неполный, и в таком виде он не заработает, возможно, это произошло из-за какой-то ошибки при сборке. Напишите: SDK какой версии используете, какие настройки выставляли при создании проекта и, если делали вручную в нем какие-то изменения, то какие именно. Также был бы полезено привести лог операций deploy и build на предмет наличия ошибок.
06 March 2017 10:31
Well , I dont want to to disturb the main js file. What I would like is create anotherYes, you can write a special b4w module in another file:
JS File and place all the slider constructors and the above slider controls there.
"use strict";
b4w.register("sliders", function(exports, require) {
// load all needed b4w modules
var m_geom = require("geometry");
// "exports" function to be available from outside
exports.init = function() {
// create HTML sliders
// assign callbacks
// $("#slider").slider({
// slide: function(event, ui) {
// m_geom.set_shape_key_value(my_obj, "my_key", ui.value);
// }
// });
}
});
Then in the main file it can be used as follows:
var m_sliders = require("sliders");
m_sliders.init();
02 March 2017 11:16
Hi! Welcome to the forum!
is it possible to use it to make an interactive cutomizable text that will have a boolean operation applied to it, and maybe combined with a box, and will have a color change optionThis depends on what concrete interactivity/customization you want. If you want to create a custom text in runtime, then there's no easy way to do it, only workarounds/dirty tricks, because we don't have an API for generating text objects - they should be created in Blender beforehand. The same is for the Boolean modifier - it can be applied only in Blender, but not in runtime (in fact the API has some methods for low-level geometry modifying, but it's not a simple task). On the other hand, changing the color is a trivial operation and can be easily done via various material API methods. You can learn more here: Material API and here: material.js.
02 March 2017 10:48
Okay ,now I want to know is it possible to control the
webGL with a jQueryUI instead of JS slider as used in
the morphing example. Also what thing should be
kept in mind to do such a task.
Hi! Of course, it's possible. There are no specific requirements here, you just need to call the same API methods to control morphing, for example:
$("#slider").slider({
slide: function(event, ui) {
m_geom.set_shape_key_value(my_obj, "my_key", ui.value);
}
});
02 March 2017 10:14
01 March 2017 13:07
27 February 2017 10:43
22 February 2017 11:26
While exporting my Project the following error comes upGenerally, this error can be solved by performing its export manually choosing the right path for the output json file. It should be enough to do it once.
tried several variations but unable to resolve
If you want to know what it means and why does it happen I can explain it a bit.
This error usually means that Blender performs export of a blend-file at the path that differs from the existed .json file. For example, in your application you use the "BoxWorld.json" file, which corresponds to the "BoxWorld.blend", but the "re-export scenes" command performs its export to some other file with the name, for example, "test.json" instead. So, you expect that after reexport "BoxWorld.json" will be updated, but it won't happen, thereby the process of reexport is kind of broken.
So, why does it use "some_other_file.json" name? A blend-file stores the last export path and use it by default if other isn't specified. You should check what path it offers you when you doing the export and change it to the right one if it's wrong.
21 February 2017 17:17
Here is the link with my blender file, can you take a look and let me know if you find anything strange?Yes, the reason of crash is that you have a high-poly object, which physics cannot handle.
As you can see in Blender this object has ~1600000 vertices. It is too much for browser physics. The upper limit is about 80000-100000 vertices, however the good approach is to keep them 10 times less: below 10000 - but this is a performance issue.
As a solution you can make a duplicate of this object at the same location and apply the Decimate modifier to it until it reaches the appropriate number of vertices. Then you should set the material physics for it and enable the "Do Not Render" flag, hence this object will be used in physics calculations but not in rendering. Also, the physics on the original high-poly mesh should be disabled because we already have that low-poly invisible physics object.
P.S. If you'll watch this scene in the standard Viewer (via the "Fast preview" button) you'll see that it has ~9600000 vertices. This is much more than what Blender indicates for this object. The difference is because of the object's flat shading, for the smooth shading you'll have the same 1600000 vertices as in Blender. This affects total export time, size of the exported bin/json files, application loading time, application performance and so on. So, the "smooth shading" is a better option if you don't mind the changes in the visual appearance.
21 February 2017 15:15
I appended the materials and they are in the assets folder with the right names after exporting. I also manually put them in the folder too.Hmm, it should work if the mat library is copied inside the project and is used for linking, however those console errors mean that the application tries to load textures outside of the project folder. Can you show us the deployed archive? (send by email if you worry about privacy). So, we can look at its structure and check is there something wrong with it.
I also tried to pack them. But these images still cannot be loaded. Other images can be loaded successfully.Did you try reexport after packing? Packed images during the export generate such files like "2444ba67fc8e9a78b62823be2b36be5b.png" in the "assets" folder near the json/bin files. So, after deploying they should be presented in the final archive and should be used by your application.