Forum

Can anyone tell me what could I do here? thank u for helping

05 February 2018 07:49
In my project I am using the morphing code snippet. Everything is working great, but i now have a problem that I know the coders over here have the solution:

The code creates a variable "OBJ" to retrieve the object of which the shape keys will be used in the project.
But what if I have a different set of shape keys for two objects??? what happens if i want to get shape keys of two objects? the next line is the variable referring to "body"….how do I go if I have another object with shape keys? what do I change to get both of them??

var obj = m_scenes.get_object_by_name("body");
if (obj)
create_interface(obj);
}

function create_interface(obj) {
if (!m_geom.check_shape_keys(obj))
return;
create_dual_slider(obj, "fatten", "shrink", "Weight");
var shape_keys_names = m_geom.get_shape_keys_names(obj);
for (var i = 0; i < shape_keys_names.length; i++) {
if (shape_keys_names == "fatten" || shape_keys_names == "shrink")
continue;
create_slider(obj, shape_keys_names, shape_keys_names);
}
}

function create_slider(obj, key_name, slider_name) {
var slider = init_slider(slider_name);
var value_label = document.getElementById(slider_name);
var value = m_geom.get_shape_key_value(obj, key_name);

THANK YOU SO MUCH
15 February 2018 18:22
I hope you have managed with this issue with our help in your other topics.
Alexander (Blend4Web Team)
twitter
 
Please register or log in to leave a reply.