Forum

Push/Pull controlled by JS

24 May 2017 10:14
Hi all,
first of all - thank you very much for the development of b4w. It has amazing capabilties!

I have a question regarding the morphing tutorial for another application:
I have a model, where I move a set of objects with the push/pull feature. Is it possible to have this interaction as in the morphing tutorial in b4w - with a JS? However, I think my problem right now is even before it comes to b4w as I cannot have the variable as shape key of all my objects?!

To explain it in little more detail:
What I manually do, is to select all the objects. Then, I set the cursor to center of mass. Next I call the push/pull function and control the movement of the objects by mouse or keyboard input.

It would be great to have this as a slider in the html-version.

Thank you very much in advance!
25 May 2017 19:00
Hello and welcome to the forum!

Could you elaborate your question, please?

What I manually do, is to select all the objects.
On Javascript side or in Blender?
Blend4Web developer
29 May 2017 11:42
Hi - thank you!

blender. no javascript at all yet.
30 May 2017 10:39
Hi, if you want to move objects away from a certain point you can do it without shape keys. For a set of objects you can just use get_translation/set_translation API methods and translate every object in a slider callback.
Blend4Web Team
30 May 2017 15:39
Hi Ivan,

thanks for your answer. Ok, I will give it a try this way. I just thought I could recreate it the way I used to do it in the viewport. Thanks!
 
Please register or log in to leave a reply.