Notifications
Clear all
[Closed] Dynamic Spinner Value + Properties
May 01, 2012 4:55 am
Ok so I know we can change the spinner properties even after the rollout has been created, my question is how can we do this and get it to update automatically.
Like how can we use a variable (float) for a spinner.value. I have been trying this but unsucessfull.
6 Replies
1 Reply
May 01, 2012 4:55 am
Maybe you want this:
rollout rol_ ""
(
local cnt01 = 0
local cnt02 = 0.0
local cnt03 = 0.0
spinner spn_01 " " range:[0,100000,0] type:#integer
spinner spn_02 " " range:[0,100000,0] type:#float
spinner spn_03 " " range:[0,100000,0] type:#worldunits
timer t_01 "timer" interval:1000
on t_01 tick do
(
cnt01 += 1
cnt02 += 0.1
cnt03 += 0.01
spn_01.value = cnt01
spn_02.value = cnt02
spn_03.value = cnt03
)
)
createdialog rol_
May 01, 2012 4:55 am
yep miauu something like that but have the default value for the spinner be a variable.
rollout rol_ ""
(
local default_value = $.render_viewport_angle -- angle of selected spline
local cnt01 = 0
local cnt02 = 0.0
local cnt03 = 0.0
spinner spn_01 " " range:[0,100000,default_value] type:#integer -- default being angle of selected spline
spinner spn_02 " " range:[0,100000,default_value] type:#float -- default being angle of selected spline
spinner spn_03 " " range:[0,100000,0] type:#worldunits
timer t_01 "timer" interval:1000
on t_01 tick do
(
cnt01 += 1
cnt02 += 0.1
cnt03 += 0.01
spn_01.value = cnt01
spn_02.value = cnt02
spn_03.value = cnt03
)
)
createdialog rol_
May 01, 2012 4:55 am
Where is the problem?
The type of the first spinner I set to type:#float, if it is #integer the value will be 17.
May 01, 2012 4:55 am
mmm… I’m not getting the same result, can you post the script your using? mine will update once changed but when first opened it wont show proper angle.