Forum Replies Created
-
AuthorPosts
-
i would mean your valueChange methods are read simply because modulators are loaded before the panel loaded method . this is normal .so in the xml text (panel properties ) :
i assume this the loading order .the first modulator with valueChange that use one idenfier should be the good to put all identifiers inif you prefer
to create a method you have to go in the lua editor , chose “none” to method type
to call it in your valueChange methods : ex myMethodName()but i think it’s better to put your Id’s in the first mod loaded
i think this is your methods that call identifiers are read before the panelLoaded callback is loaded so normally you have lua messages at startup : txtParameter is nil value etc…
this is a bad place to create modulator object as identifieryou can use a free script and call it in your methods or create local variables in them…. or put your identifiers in the first modulator that need one : see in the xml the first modulator that need identifier
the panel global variable callback could be a place for ..but it’s better to have something to do with global variables so i don’t know
i had the issue two times some time ago , i lost all LUA code
now i verify when i save if all is there and i do a backup time from timemission tab finished ,that was just copy-paste , possible to compact the method
now you’ve just to replace buttonContent like i’ve done with part1 btn and set colorOn/Off in btn propertiesAttachments:
You must be logged in to view attached files.what’s the vst index of your buttons ?
to affine the method then you could add :
if curmod ~= 0 then
beforeif curmod ==100 then
and add aend
to the end of the method
this will close the chunk directly if current modulator dragged is not concerned by the methodhope this is clearer now
if you don’t get it:
until you copy the method you’ve done all correct so look rigorously at the method in the pic above , your script must be strictly identicalonce the method is working for you (no reason it can’t work)
replace
if curmod >= 300 and curmod <= 303 then
at line 11
byif curmod ==100 then -- body elseif curmod ==101 then -- body elseif curmod >= 200 and curmod <= 203 then -- body elseif curmod >= 300 and curmod <= 303 then
compile and save the panel
then you will have to adapt what I’ve done with part btns (300,303) to the (200,203) btns in body
for the 2 first btns we will seeno, it was the first step (only part buttons)
ps : in the script when I wrote final end it was just to say “this is the final end of the method” 😉 and you didn’t modify it (tab name ,indexes)
ok you have adapted your own custom indexes so you need to to change 100..103 by 300..303 in the klm script
work nice here ^^
good night
Attachments:
You must be logged in to view attached files.soRry about brainstorming 😀 you have to follows steps
“set your custom indexes 100,101,102,103 to “part” buttons”
means set”modulatorCustomIndex” on part1,part2…. buttons in the button propertiesbefore you create the new script and copy klm lines in , you must remove and delete old method and do all first steps
and before COMPILING your new method (you can call it “viewSwitch” again)
you must modify what I wrote post above.I know it could appear complicated but it ‘s simplified in reality !
thank you
opened your panel :
first replace all uibuttoncontent with :
False
True
we will change that once the method is working
-set uibuttonistoogle on
-remove the viewswitch method of ALL button and AFTER then delete ityou have 2 tabs : some btns for one , some others for the other one
so we will do first “part” buttons only .even you have 3 uiTabs
– set your “part” buttons to OFF (false) by clicking them
– set your custom indexes 100,101,102,103 to “part” buttons
-so put the method called “klm” in the other thread( I just updated it 08/08/15 00:24 AM) . put it in “called when ANY modulator value changes ” in the panel prop
in it :
– repace “mytabmodulatorName” by “PrfParts”
– modify “102” by “103”
-done (in theory) 🙂
– save your panel in a new fileyou’re right customcomp is ideal but not for beginner
for the value vs currenttab it’s seems this is not the same : currentTab is a child-like of the modulator value ; set the value of uiTabs seems better for startup because currentTab get now a “solid” state…
urbanspaceman I see in other post that you don’t set uiButtonIsToogle On . you could do that it is mainly better
edit
“But to do this, you have to change tab inside method “called when modulator value changes” with setProperty (“uiTabsCurrentTab”, n), so at the end it’s the same.”
no it is synced afaik . hmm have a doubt now oOedit2 : yes it is synced
normally it would be not needed just to change tabs via several buttons
urbanspaceman wants to do something with the tabs names I don’t getthe script I wrote would be correct even better than radio buttons
normally working at startupimo I prefer set modvalue of uiTabs instead of currentTab there is never issue at startup
Nice to see you here Atom 🙂
it’s seems strange what you do with the modulator Name (uiTabs component)
I don’t understand , you want to get each tabs names ?
-- -- Called when any modulator changes on the panel -- -- @program modulator that changed -- @value new modulator value -- klm = function(--[[ CtrlrModulator --]] modulator, --[[ number --]] value) end local curmod = modulator:getProperty("modulatorCustomIndex") if curmod >= 100 and curmod <= 102 then if value == 1 then panel:getModulatorByName("mytabmodulatorName")setModulatorValue ( curmod - 100 , false, false, false) modulator:getComponent():setProperty("componentDisabled",1,false) for f = 100,102 do h = panel:getModulatorWithProperty("modulatorCustomIndex",f):getValue() if curmod ~= f then if h == 1 then panel:getModulatorWithProperty("modulatorCustomIndex",f):setModulatorValue(0,false,false,false) panel:getModulatorWithProperty("modulatorCustomIndex",f): :getComponent():setProperty("componentDisabled",0,false) end end end end end final end
another method that update button states and keep the button ON state if pushed
change your custom index to 100,101,102 (here for 3 buttons)
because by default there is 0 for all modulators
and apply this method to the right place in the property panel
not tested…note: if you want to try , your button values must be set all off before apply the method .don’t forget to remove old method from buttons especially if you want to delete it (ctrlr crash possible)
I would to use them with child components I tried to add to a custom comp
I thought they are done for components created in lua
as my components was never visibles I give up with these methods
I supposed they are ready callbacks so just call them in scripts you need should work….if you let here the error message we could try to say what happens
generally “if ? ~= nil then” solve error”
the scripts are read in an order when loading you have to always keep in mind thatyou don’t need tabnames just index to trig the tabs so I don’t understand what you want with tabname
the method i writed could work with severals button :
here the logic :
btn1 = “customModulatorIndex” set to 0 (in your panel property buttons)
btn2 = customModulatorIndex” ……..1
btn3 = customModulatorIndex” ……..2
then apply the method to all buttons
when you click on one it will display the corresponding tabOR there is a global callback (when any modulator value change) you can use it
for the tabName you have to get the property as in your method and put it…. where ?
on the button visibleName ? on other mod ?
it depends of your panel organization but you can use a componentListBox too (may be practical) instead of buttons -
AuthorPosts