How to add animations in object slots in blender
04 December 2015 14:22
04 December 2015 15:01
Hello,
For example, you've prepared actions in Blender and exported scene. Now you should apply this actions to the object:
And if you want to play the 1th animation, for example, you should call the following code lines:
The "anim_callback" function will be called after animation will have finished.
For example, you've prepared actions in Blender and exported scene. Now you should apply this actions to the object:
function load_cb(data_id) {
m_app.enable_controls();
m_app.enable_camera_controls();
var obj = m_scenes.get_object_by_name("NAME");
if (obj) {
m_anim.apply(obj, "ACTION_NAME_0", 0); // 0 -is slot num
m_anim.apply(obj, "ACTION_NAME_1", 1); // 1 -is slot num
m_anim.apply(obj, "ACTION_NAME_2", 2); // 2 -is slot num
}
}
And if you want to play the 1th animation, for example, you should call the following code lines:
var obj = m_scenes.get_object_by_name("NAME");
var anim_callback = function() {};
m_anim.play(obj, anim_callback, 1); // 1 -is slot num
The "anim_callback" function will be called after animation will have finished.
04 December 2015 15:52
04 December 2015 16:32
05 December 2015 00:12