Home › Forums › General › Programming › set modulator opacity through Lua
- This topic has 8 replies, 3 voices, and was last updated 11 years, 5 months ago by atom.
-
AuthorPosts
-
July 18, 2012 at 11:55 pm #657
I don’t see it in the API docs, maybe I’m missing it. I’m looking for an alpha property so I can adjust the transparency of a modulator through Lua.. I seem to recall an older example panel that did this through the animator? I don’t see any transparency or alpha properties in setPropertyInt or setProperty… any help appreciated.
Thanks!
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
July 19, 2012 at 11:48 pm #4547*ping*
Please advise.. is this not possible yet? I was playing with setPropertyColour with no luck.. I’d like to be able to "dim" a combobox if a corresponding knob is rotated. similarly I’d like to dim an imageSlider if a combobox is set.
many thanks!
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
July 20, 2012 at 8:14 am #4548If your panel has a background, you can draw in the background the knobs and combos "dimmed". When you need to display the "dimmed" knob, you simply hide the modulator and the "dimmed" version is on view. Note that in this way you can’t use the modulator when is dimmed.
If you don’t have a background, you can make a a resource of the "dimmed" knob with only one frame, and when you need to deactivate this knob, you must change the image resource of the modulator to this one-frame resource and set it’s maximum value to 0. To activate it again, restore it’s original resource and max value.
Those works if you need to deactivate some modulators from another one (let’s say you have a combo and when you choose the first option of the combo, a modulator became inactive, and any other option make the modulator active).
July 20, 2012 at 8:18 am #4549I had a alpha property for components but i removed it, i’ll re-introduce that in the next nightly.
July 20, 2012 at 5:44 pm #4550"dasfaker":1pbno554 wrote:If your panel has a background, you can draw in the background the knobs and combos "dimmed". When you need to display the "dimmed" knob, you simply hide the modulator and the "dimmed" version is on view. Note that in this way you can’t use the modulator when is dimmed.If you don’t have a background, you can make a a resource of the "dimmed" knob with only one frame, and when you need to deactivate this knob, you must change the image resource of the modulator to this one-frame resource and set it’s maximum value to 0. To activate it again, restore it’s original resource and max value.
[/quote:1pbno554]Thank you Atom for your reply here and the ideas.. great work arounds (fun to find workarounds sometimes to current limitations) I’ll wait until you actually add an alpha property to the modulators, that would be ideal.
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
July 20, 2012 at 7:24 pm #4551You can use the ComponentAnimator
if you attach this to a slider with values 0-127 this will set the alpha of the MODULATOR to the value of the slider
[code:1ekq07vv]
setAlpha = function(modulator, newValue)
anim = CtrlrLuaComponentAnimator()
mod = panel:getModulatorByName("MODULATOR")
rect = mod:getComponent():getLuaBounds()anim:animateComponent (mod:getComponent(), rect, newValue/127, 0, false, 0, 0)
end
[/code:1ekq07vv]July 20, 2012 at 11:13 pm #4552kick ASS. Thank you, Atom!
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
November 19, 2012 at 9:06 pm #4553Is using CtrlrLuaComponentAnimator still the way to do this in 1180?
Its working but it (or possibly something else?) seems to cause the modulator to be very laggy since the latest updates.
Instead of verbally explaining how I was using CtrlrLuaComponentAnimator, here is a very simple panel that demonstrates:
https://www.dropbox.com/s/bvwe7dt4fx1rb … st.bpanelzIt works but I’m just wondering if ComponentAnimator is still the preferred method to simply set the opacity of a modulator.
Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen
November 19, 2012 at 10:44 pm #4554It will work as usual the old API is still there. The new methods will be documented when i finish them. I changed the compiler options a lot as you noticed by the binary size so i might have broken something, need to test the build some more.
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.