[Closed] listbox tabSize error
EDIT: Ahh seem I have found the problem with that part, just needed to add tabSize:1 and not 0 as I thought would be for an empty list.
But still got a problem, the list doesn’t stay when I deselect my object and return to it. All my other values for spinners ect, gets remembered, just not listbox. What do I need to do with that?
That might be, but if I dont have it, I get this error:
– Compile error: UI item array size does not match tabSize: specified in arrPObjectList
And this is how the two lines look like:
arrPObjectList type:#stringTab tabSize:1 animatable:false ui:arrPObjectList enabled:true tabSizeVariable:true
listBox arrPObjectList “” pos:[7,22] width:146 height:8
If I dont have the tabSize, I get that error. Also, the listbox doesn’t remember its content when I leave it. Spinners and others got their value store in parameters but apparently listbox wont have that.
why do you think that you can link stringTab parameter to listBox control? is it your wish? max doesn’t support it. link them yourself using parameter’s set and tabChanged events and listbox’s selected event.
Its not really something I think but more what doesn’t produce an error. Its the first time I ever used the listbox, so don’t know whats the difference is between it and how other elements work like spinners. Would appreciate if you could tell me how you think it should be for it to work and look like, been fumbling with this for a while now.
you have a parameter the type of #stringTab.
- this parameter can’t be linked to listBox control.
see mxs help: The kinds of user-interface items that can be linked to particular parameter types is limited to the following sensible combinations:…
2) param block parameter doesn’t have enabled argument… - tab type parameter can’t be animatable… (animatable argument is FALSE by default)
as I said you have to use the parameter events, and the ui control events to synchronize their updates. MAX doesn’t provide an easy support for that.
see mxs help: Scripted Plug-in Clauses and Listbox UI Control
Thanks a lot, I had a look in those sections and got a lot smarter about it, and managed to fix my problem by not linking the parameter to the listbox, but instead added the items on rollout open.
Cheers
Got my modifier to work as it should, and is now doing a big rewrite of it to make it more efficient. However, my math hasn’t really been used much the past years, so I’m stuck in this little puzzle. How do I translate this little function into a math calculation where I can use a number to get the result instead of having to loop my way to it.
x = 100 as float -- Start procent
p = 110 as float -- increase the number with 10%
for i = 1 to 10 do (
x = x* (p/100)
print x
)
I would like to be able to do result = x * (% * number of times). So if I want to add 10% it 3 times, I would get 133.111. Is there a mathematic function that can do this, or do I have to do loop it?
Ah, all good, someone at IRC came with the solution ( val = ((floatScaling/100)^(xyz)) as float , which works perfectly for me.