User posts Juha Saarinen
29 April 2016 20:01
29 April 2016 16:16
Here is my code (little part of it): I have made my own "cube object" that have object in cube_obj.obj and name in cube_obj.name.
When I click "cube"-object it does only HEILAHDUS-anim and if I click "cube1"-object "cube1" do HEILAHDUS-anim and "cube" do PYORAHDYS-anim same time.
So its doing "end_function" but right away.
Juha
function main_canvas_click(e) {
....
if (obj_clicked_name == cube_obj.name) {
m_anim.play(cube_obj.obj, end_function(), SLOT_HEILAHDUS);
}
if (obj_clicked_name==cube1_obj.name) {
m_anim.play(cube1_obj.obj, end_function(), SLOT_HEILAHDUS);
}
}
function object_anim(obj, anim_slot){
m_anim.play(obj, lopetus_funktio(), anim_slot);
}
function end_function(){
m_anim.play(cube_obj.obj, null, SLOT_PYORAHDYS);
}
When I click "cube"-object it does only HEILAHDUS-anim and if I click "cube1"-object "cube1" do HEILAHDUS-anim and "cube" do PYORAHDYS-anim same time.
So its doing "end_function" but right away.
Juha
28 April 2016 16:15
Hello everybody,
I have just started with Blend4web and have little problem with animation. I'm trying to make animations play in a row. But I just cant get it to work.
If I just put two different m_anim.play(obj) functions one after another they will play in same time. Even with m_anim.play(obj, finish_callback, slot) its seems to call that finish_callback() funktion right in start (not in the end like I assumed).
I have tried for and while loops with m_anim.isPlay() and m_anim.get_frame() functions, but same problem there. Loops keep going but frame number (and isPlay boolean) do not change while looping.
Any ideas how can I get this working?
Juha
I have just started with Blend4web and have little problem with animation. I'm trying to make animations play in a row. But I just cant get it to work.
If I just put two different m_anim.play(obj) functions one after another they will play in same time. Even with m_anim.play(obj, finish_callback, slot) its seems to call that finish_callback() funktion right in start (not in the end like I assumed).
I have tried for and while loops with m_anim.isPlay() and m_anim.get_frame() functions, but same problem there. Loops keep going but frame number (and isPlay boolean) do not change while looping.
Any ideas how can I get this working?
Juha