User posts Evgeny Rodygin
19 November 2016 19:56
Hi!
Of course, this can be done. But this functionality is not really related to Blend4Web itself. The example above also just uses a custom format to remember transformations of particular objects.
Say, you've placed a chair to a position with coordinates: X: 12.5, Y: 10, Z: 0.
When you press the "Save" button you need to get its position with corresponding API and write it to a text file which can be later used to restore the state.
It might look like this:
"Chair: Position: [12.5, 10, 0]"
You can use this information and assign this transformation to the Chair object with this method.
Of course, this can be done. But this functionality is not really related to Blend4Web itself. The example above also just uses a custom format to remember transformations of particular objects.
Say, you've placed a chair to a position with coordinates: X: 12.5, Y: 10, Z: 0.
When you press the "Save" button you need to get its position with corresponding API and write it to a text file which can be later used to restore the state.
It might look like this:
"Chair: Position: [12.5, 10, 0]"
You can use this information and assign this transformation to the Chair object with this method.
18 November 2016 14:22
Reply to post of user zhangchuanjiaHi!
I'm sorry, my English is not good, as in figure, the problem, I have a case that has been baked into action, but there is such a problem, I do not know whether vertex causes too much, or else. I hope you can help me solve it, thanks again
This can be caused by several reasons.
1) Some of the vertices in the model use to many bones for skinning. Blend4Web supports only 4 bones per vertex.
2) Armature object has an animation which uses IK or some other complex constraint. If this is the case - you need to bake it.
18 November 2016 14:03
Reply to post of user HotGoblinsActually, we have already started adding some examples.
I don't know Dash Docset and I'm not here to answer to sciremedia but I benefit this post on the documentation to propose something.
Your module doc is complete but lacks examples. In the Unity doc, there is example for each function, attributs and it's very helpful to vizualise how works differents function. Personnaly, I have many difficulty using sensor, and other function in camera module, etc
Sorry to use this post and thanks for your job.
18 November 2016 14:02
Have you considered contributing the Blend4Web API reference as a Dash docset so that it is accesible from these platforms?Hi! This sounds like a good idea. There is a tool for generating docsets from JsDoc comments (which are used by Blend4Web). We'll discuss this possibility and let you know in this thread.
18 November 2016 13:52
Currently, logic nodes are not capable of using mouse position.
Honestly, I don't see a really straightforward way to implement such feature.
I think, two approaches can be used both of which require some coding.
1) Particles can be represented as an object with a descent amount of vertices. After calculating the required positions you need to pass them to the override_geometry function.
2) Create several billboard objects and move all them according to the mouse position.
Which method is preferable depends on how many particles you need in the scene.
Honestly, I don't see a really straightforward way to implement such feature.
I think, two approaches can be used both of which require some coding.
1) Particles can be represented as an object with a descent amount of vertices. After calculating the required positions you need to pass them to the override_geometry function.
2) Create several billboard objects and move all them according to the mouse position.
Which method is preferable depends on how many particles you need in the scene.
18 November 2016 13:36
What you say is wrong in my case :
If I activate Enable Physics in Blender and don't reference physics_enabled, I have the bug, so physics is activate.
If I deactivate Enable Physics in Blender and don't reference physics_enabled, I have the bug, so physics is activate.
If I activate Enable Physics in Blender and reference false for physics_enabled, It's ok, so physics is not activate.
If I deactivate Enable Physics in Blender and reference false for physics_enabled, It's ok, so physics is not activate.
If I deactivate Enable Physics in Blender and reference true for physics_enabled, I have the bug, so physics is activate.
I have tested the described cases and wasn't able to reproduce any of these bugs. Could you please attach a small project where this behavior is reproduced?
17 November 2016 10:10
您好,
您可以在加载场景后修改3D物体的形状。 使用相应的Blend4Web API
在运行时修改几何体。
https://www.blend4web.com/api_doc/module-geometry.html#.override_geometry
以此代码段为例:
https://www.blend4web.com/apps/code_snippets/code_snippets.html?scene=dynamic_geometry
此方法比解析和修改.bin檔更方便。
希望这可以帮助到您!
您可以在加载场景后修改3D物体的形状。 使用相应的Blend4Web API
在运行时修改几何体。
https://www.blend4web.com/api_doc/module-geometry.html#.override_geometry
以此代码段为例:
https://www.blend4web.com/apps/code_snippets/code_snippets.html?scene=dynamic_geometry
此方法比解析和修改.bin檔更方便。
希望这可以帮助到您!
15 November 2016 15:47
Без Blend-файла не так просто анализировать сцену. Тем не менее, из JSON-а я вижу, что на объекте "Camera" нет анимации, но есть анимация "CameraAction" в NLA треках этого объекта. Она не идёт в список стандартных анимаций объекта, поэтому ни get_anim_names ни apply_def с ней не работают.
Если вы примените эту анимацию на самом объекте "Camera", то её можно будет использовать с описанными выше API.
Если вы примените эту анимацию на самом объекте "Camera", то её можно будет использовать с описанными выше API.
15 November 2016 12:17
15 November 2016 10:56
Ответ на сообщение пользователя stilistВ Blender вы можете назначить анимацию на любой объект, выбрав её имя из списка анимаций. То же самое вы видите и в Blend4Web. Можно применить любую анимацию к любому объекту. Не факт правда, что она будет на что-то влиять, но сделать это можно.
Добрый вечер, благодарю за предыдущие ответы.
По поводу анимации: щупаю сейчас методы для работы с ней.
Подскажите, во всех функциях модуля animation первой идет ссылка на объект, но есть также функции удаления слотов, назначения анимации на слот. Насколько я понимаю, анимация не представлена как отдельный объект и находится через объект, к которому привязана. Зачем тогда операции со слотами? Можно ли её скопировать и применить к другому объекту? Её назначение на объект идет по имени, а если имя не помнишь и не хочешь искать в исходниках, как найти какая вообще анимация имеется в модели?
Слоты нужны, чтобы комбинировать анимации разных типов на одном объекте. Можно навесить объектную анимацию на один слот, скелетную анимацию на другой и анимацию материала на третий.
Если вы хотите применить ту анимацию, которая уже была на модели в Blender - можете просто вызвать функцию animation.apply_def(obj)
и запустить её с помощью animation.play(obj)
Чтобы получить имена доступных для запуска анимаций можно воспользоваться функцией get_anim_names.