How to use NLA in blend4web
11 January 2017 18:58
Hello, I want to use the shape keys to make expressions, so I use the key frame in animation to make the expression action clips editor and add the action clips in NLA editor. Then I export it to json file and use the js to control the play of the action, the code is shown below:
But It can not work, in addition, I have not check the logic editor.
Look forwards to your reply, thanks!
if (obj) {
if(obj.name=="a")
{
m_nla.set_range(0, 100);
m_nla.play();
}
But It can not work, in addition, I have not check the logic editor.
Look forwards to your reply, thanks!
12 January 2017 16:54
Hello, I want to use the shape keys to make expressions, so I use the key frame in animation to make the expression action clips editor and add the action clips in NLA editor. Then I export it to json file and use the js to control the play of the action, the code is shown below:I can't fully understand your question.
if (obj) {
if(obj.name=="a")
{
m_nla.set_range(0, 100);
m_nla.play();
}
But It can not work, in addition, I have not check the logic editor.
Look forwards to your reply, thanks!
Could you please provide more details and attach example project (how to export project)
[UPD]
I have not check the logic editor.I've attached an example of applying shape keys via logic nodes
15 January 2017 08:37
Thank you, dear Konstantin Khomyakov.I upload the exported files here.Make it clear, I want to Control the playback of the action clips in NLA editor. So I write the js code like this:
. I want to realize the function when I hit the object named "a", then the action in the NLA will be played. But now it cannot work, so I need your help, thanks.
function main_canvas_click(e) {
if (e.preventDefault)
e.preventDefault();
var x = m_mouse.get_coords_x(e);
var y = m_mouse.get_coords_y(e);
var obj = m_scenes.pick_object(x, y);
if (obj) {
if(obj.name=="a")
{
m_nla.set_range(0, 25);
m_nla.play();
//m_nla.stop();
}
}
}
15 January 2017 09:18
16 January 2017 19:51
Reply to post of user Konstantin KhomyakovHello, I still can not realize the function, and I don't know how to solve it.
I can't fully understand your question.
Could you please provide more details and attach example project (how to export project)
[UPD]
I've attached an example of applying shape keys via logic nodes
16 January 2017 19:51
Reply to post of user Konstantin KhomyakovHello, I still can not realize the function, and I don't know how to solve it.
I can't fully understand your question.
Could you please provide more details and attach example project (how to export project)
[UPD]
I've attached an example of applying shape keys via logic nodes
16 January 2017 23:37
Hello, I still can not realize the function, and I don't know how to solve it.Hello!
Have you enabled NLA in your scene settings (https://www.blend4web.com/doc/en/scene_settings.html?highlight=nla#nla) ?
Also can be checked in code directly: https://www.blend4web.com/api_doc/module-nla.html#.check_nla
18 January 2017 06:23
18 January 2017 07:34
Reply to post of user Konstantin KhomyakovMaybe I can send a email to you and send the files to you, if that is convenient, dear Khomyakov.
Hello!
Have you enabled NLA in your scene settings (https://www.blend4web.com/doc/en/scene_settings.html?highlight=nla#nla) ?
Also can be checked in code directly: https://www.blend4web.com/api_doc/module-nla.html#.check_nla