Blend4life or anyone willing to help..

17 February 2019 00:42
im weak with javascript and this is what the matter for me is on this problem below.
I was able to accomplish the monkey in the attached project to work out of one slide using as basis, the morphing code.
One of the monkeys is good to go. The question for me is what kind of modifications i need to do in the code (i know it might not be too many) to add the other monkey or more objects having more sliders to each?????

I have tried many many times in the most multiple ways and researched so much I am so tired and frustrated…
One time i asked the question overhere and alex answered me good but i couldnt get it to work because of my javascript skills that are weak. Check it below please…

If anyone wd be so kind to edit the code on the blend file and email it back I wd be so grateful!!!!!!
17 February 2019 21:06
The example code comes from the "morphing" code snippet. It's pretty cool, especially how the shapekeys are read and sliders for them created dynamically, but I would guess that's a rather difficult example to grasp for a javascript newbie.

Give some details about your goals:

* How many objects do you have?

* Does each object have its own number and "nature" of shapekeys, or do they all have the same?

* Do you only have "simple" shapekeys (one slider -> one shapekey) or do you also have the case where you want to control (mix) several shapekeys with one slider?

Also, is there an alternative for you to using shapekeys? Shapekeys are very slow. Just watch how the framerate drops when you drag the sliders in the morphing example. It has only 8,500 verts and yet FPS is nearly cut in half even on a fast PC.

Also, rename your thread to reflect the topic you are addressing, like "How to control shapekeys with javascript?". This helps other people looking for answers a lot, especially because the titles are processed by Google etc.

I'm honored, but "Blend4life or anyone willing to help.." is a stupid thread title.
17 February 2019 21:42
I'm honored, but "Blend4life or anyone willing to help.." is a stupid thread title.
my apologies about that.

i just want for the .blend attached to the prior message, thats all. In other words, another slider for the other monkey, and im done. Thats all i need. …for that .blend attached. And i wanted to follow this suggestion:

Yes, of course.
Or you can put the names into an array and then create an array of the objects from this array.
var names = ["obj1", "obj2"];
var objs = [];
for (var i = 0; i < names.length; i++) {
objs.push(m_scenes.get_object_by_name (names))

Then use check_shape_keys and get_shape_keys_names for each element. The question is more about the basics of programming with javascript, there is no Blend4Web specifics.

i tested in multiple computers and for my purpose they worked better even better then logic nodes responding to clicks, to be honest.

i attached the wrong picture and the correct one is above. The aaray idea solves it, i just dont know how to apply in the code. Thank you so much for your help.
17 February 2019 22:19
i just want for the .blend attached to the prior message, thats all.
Sorry, but I got no sliders with your attached project. Only a file dialog box and two monkeys.
Please register or log in to leave a reply.