Replies: 2 comments 4 replies
-
It should be entirely possible- can you post the code? |
Beta Was this translation helpful? Give feedback.
4 replies
-
Hi @DRBAUS Here's a refinement of the panel for more than two buttons - You said you want the same functionality for 45 buttons? This code will scale up nicely. All you need to do is add the button names to the table -- -- Called when a mouse is down on this component -- myMouseDown = function(--[[ CtrlrComponent --]] comp --[[ MouseEvent --]], event) for _,v in ipairs(tab_all) do reset(v) end comp:setProperty("componentLabelColour", "FFA20A0A", false) comp:setProperty("componentVisibleName", "EDIT", false) end -- this loop uses ipairs, not pairs to run through each modulator and reset it -- it would be better to set up lua variables in the init script to make this much faster -- ie _G[control]:getComponent():setProperty("componentLabelColour", "ff000000", false) --see panel for implementation of this function reset(control) local Control=firstToUpper(control) -- panel:getModulatorByName(control):getComponent():setProperty("componentLabelColour", "ff000000", false) -- panel:getModulatorByName(control):getComponent():setProperty("componentVisibleName", Control, false) _G[control]:getComponent():setProperty("componentLabelColour", "ff000000", false) _G[control]:getComponent():setProperty("componentVisibleName", Control, false) end -- global table of all modulator names that will be passed to function tab_all={"TIME1","TIME2","TIME3","TIME4","TIME5","TIME6"} -- renames the label from TIME3 (the modulator name) to Time3 function firstToUpper(str) s=string.lower(str) return (s:gsub("^%l", string.upper)) end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there.....I'm back at it again.
After watching a video on YT I now understand how for i, v in pairs works and I did manage to get a working script upon
Modulator Value Change.
But...I would like to have this function activated with a Mouse Down but somehow this does not seem possible.
Is that correct or has any of you had this working?
Thanks,
Robin.
Beta Was this translation helpful? Give feedback.
All reactions