由用户创建的信息 Ivan Lyubovnikov
28 September 2015 10:58
Ответ на сообщение пользователя Андрей Юрьевич
На момент написания Вами рекомендации использовать 15.09, на страницу загрузки еще не было этой версии. В общем не суть.
Обновление помогло, Blender 2.76-rc1 и Blend4web 15.09 Release Candidate работает и экспорт производится нормально.
Спасибо
Отлично! Надеюсь больше ломаться не будет.
28 September 2015 10:09
25 September 2015 19:14
А где можно посмотреть подробнее об этом методе????? по моему это супер вариант решения моей проблемы. Я не программист но мне придётся ему ставить задачу и давать материал :) вот собираю информацию
Вообще, рендеринг сцены самой в себя у нас не поддерживается. В NASA модифицировали наш движок и использовали для миникарты 2-ой Canvas, в котором дополнительно рендерится сцена. Это затратнее и оправданно, если нужен динамический обзор. Для миникарты самое оптимальное - это наложить сверху заранее подготовленный HTML элемент. Можно также рендерить в текстуру другую похожую сцену, но создавать 2 сцену ради миникарты тоже хлопотно.
25 September 2015 18:37
25 September 2015 12:08
24 September 2015 17:22
В очередной раз повторилась проблема и не могу ее исправить. В прошлый раз магическим образом исправилось все после переустановки плагина. В этот раз перепробовал уже три последние версии, и даже с версией SDK происходит пустой экспорт.
Суть в чем, на работе не хочет правильно экспортироваться, причем с виртуальной машины этого же компьютера все правильно экспортируется. Дома, все тоже нормально экспортируется.
Экспорт не работает даже с кубиком в сцене, поэтому пока не буду прикреплять саму сценуParket_1.html
Судя по файлам, при ошибке вообще не экспортируется геометрия. С чем это связано, пока не понятно. Скорее всего, влияют особенности системы и версия/сборка Blender'а. Попробуйте поставить обычную версию, а не стимовскую, как 64-х, так и 32-битную.
22 September 2015 18:14
Setting cameras to STATIC solved the problemGood to know! If you have any other questions we're glad to help.
This way we can use our own tweening solution to animate the camera target and the camera. Our API allows us to interchange different 3D rendering methods.
OK. If I understand you correctly, you want to perform tweening through the blend4web low-level API. Am I right?
22 September 2015 14:26
Hi!
Generally, we need to create a sensor manifold to process camera animation:
For this we need to create an elapsed sensor (to slightly move the camera every frame) and a timeline sensor (to count tweening time):
Also we need to define a logic function which checks the total time passed and signalizes us about the animation ending.
Sensor manifold executes a callback depending on the result of the logic function:
A manifold of this type (CT_CONTINUOUS) generates positive pulse every time when a logic function returns true (animating every frame) and a single negative pulse otherwise (finishing the animation).
We need to reset our global variables when the animation starts:
Please, also take a look at the Camera Animation code snippet. Something similar is happening in the "init_camera_animation" function.
How can we get correct camera rotation that is the same as it was in Blender at export?Each camera can change its rotation during the scene initialization. It depends on the "Move Style" property which means different constraints, e.g. vertical aligning. You can set the "STATIC" move style for all of the scene cameras, so they won't be affected at all.
How can we tween camera position and rotation from on-enter-frame-render approach.This can be done by using our sensors system.
Generally, we need to create a sensor manifold to process camera animation:
m_controls.create_sensor_manifold(camobj, "CAMERA_TWEENING", m_controls.CT_CONTINUOUS,
[t_sensor, e_sensor], logic_func, cam_move_cb);
For this we need to create an elapsed sensor (to slightly move the camera every frame) and a timeline sensor (to count tweening time):
var t_sensor = m_controls.create_timeline_sensor();
var e_sensor = m_controls.create_elapsed_sensor();
Also we need to define a logic function which checks the total time passed and signalizes us about the animation ending.
var logic_func = function(s) {
return s[0] - _global_timeline < TWEENING_TIME;
}
Sensor manifold executes a callback depending on the result of the logic function:
var cam_move_cb = function(camobj, id, pulse) {
if (pulse == 1) {
// we're in the middle of the animation
// calculate an amount of time passed since the animation start
var elapsed = m_controls.get_sensor_value(camobj, id, 1);
_delta += elapsed / TWEENING_TIME;
// perform linear intrerpolation beetween starting and ending position/rotation based on the global _delta parameter
// set new transforms
} else {
// finishing the animation: set ending position/rotation to avoid possible calculation errors
}
}
A manifold of this type (CT_CONTINUOUS) generates positive pulse every time when a logic function returns true (animating every frame) and a single negative pulse otherwise (finishing the animation).
We need to reset our global variables when the animation starts:
function start_animation() {
_global_timeline = m_main.global_timeline();
_delta = 0;
}
Please, also take a look at the Camera Animation code snippet. Something similar is happening in the "init_camera_animation" function.
21 September 2015 10:47
15 September 2015 14:13
Hi!
Also some of the material textures (colormap, normalmap, …) can be inherited but only for a stack material.
Apparently, you are passing wrong object in your script:
It should be:
.
link
Also you can try roundabout ways such as instancing, shape keys or overriding geometry if it's suitable in your case.
It seems that Blend4Web can only inherit stack-materials, is that right?You're close to the truth. Material inheritance is partially supported at the moment because it's a rather complicated thing to do. You can inherit some simple material properties, for example, diffuse intensity or specular color. Generally, they are those properties that you can change through the API of the material.js module. So, a node material that takes into account some of them will be affected too but not so much.
Also some of the material textures (colormap, normalmap, …) can be inherited but only for a stack material.
The console is however logging: 'B4W ERROR: Wrong objects for inheriting material!' (for the third row)This error means that the inheritance wasn't being done.
Apparently, you are passing wrong object in your script:
m_mat.inherit_material(sphere_1, "NodeMaterialA", sphere_2, "NodeMaterialB");
It should be:
m_mat.inherit_material(objectA, "NodeMaterialA", objectB, "NodeMaterialB");
Is there any way to transfer/copy/inherit a node-material to another object in runtime via JavaScript?It's impossible to do it directly by now. However you can use set_nodemat_value and set_nodemat_rgb API methods for a node material. It was discussed here:
link
Also you can try roundabout ways such as instancing, shape keys or overriding geometry if it's suitable in your case.