Notifications
Clear all

[Closed] progressbar difficulty

Hi All,
I’m having a problem getting the progressbar UI item to work…

I have a rollout, which defines a function that is called when the “scene process” button is pressed. The progressbar display is defined within the UI of the rollout.
The progressbar is displayed within the rollout UI, but the progress bar does not work.
I believe the progressbar.value is not getting passed to the UI item.
How do I fix this? global variable?
See below for example of the type of setup I have…
Any help (with an example of the code!) would be appreciated
Mike

Rollout Mike
(
Progressbar pb_numprocess value:0 color:green
fn sceneprocess
(
–Do stuff here
for n in 1 to filteredfiles.count do
(
–execute some kind of code here…bla bla bla…
pb_numprocess.value = 100.*n/filteredfiles.count
n+=1
)
pb_numprocess.value = 0
)
on scene_button pressed do
(
–call function
sceneprocess()
)
)–end rollout

3 Replies

i cant check this with your code but

mike.pb_numprocess.value

would directly access the progressbar ui item.

thanks Pete.
couldn’t see the wood for the trees!

you’re welcome mike – its helpful to be able to access the rollout as you can change element according to what your script does – processing objects could update a text field on the rollout with the object’s name, for example.

and of course, you have


 <rollout name>.controls 

which returns an array of the UI elements on a rollout. this can be used in a loop for globally enabling/disabling the rollout UI.