Forum

Progress bar in HTML

24 January 2019 23:27
Hey guys its me again,
i was wondering if it is possible to make a progress bar for my nla action. I didnt find anything helpful in the API.
Hope you can help me!
25 January 2019 19:40
a progress bar for my nla action
What do you mean? You want a progress bar which displays how much of a running NLA animation has been played?
27 January 2019 15:10
You want a progress bar which displays how much of a running NLA animation has been played?

Yes indeed! I was hoping that there is a callback of how many frames of my selected frame range i already have been playing.
27 January 2019 20:20
In cases where there is no callback, you define your own callback:

m_main.append_loop_cb(my_frame_callback);

Put this line in the JS file in the load_cb under where it says "Place your code here". And now add your own function underneath the load_cb:

function my_frame_callback() {
// anything you put here will be executed once every frame
}




Then you look for the API methods from the NLA module that read the values you need:

Read current frame: m_nla.get_frame()
Read start frame: m_nla.get_frame_start()
Read end frame: m_nla.get_frame_end()

Now you have the animation length and current position. Progess = position/length. That should do it.
28 January 2019 19:53
Hey Blend4Life,
thats exactly what i was looking for!
Cheers!
 
Please register or log in to leave a reply.