jonadb
04-10-2012, 09:21 AM
I've made a small script that shows only the keys in the trackbar related to the currently selected modifier in the stack. This makes it easy to quickly adjust the right keys when there are a lot of overlapping things happening.
It works as is, but I have to use a #modPanelObjPostChange event to activate the filter each time.. isn't there a way to make the filter just do its jobs without retriggering it all time?
Not that you notice it but it just doesn't feel zen to do it like this :)
fn testCallbackFilterFunction theAnimatable theParent theSubAnimIndex theGrandParent theNode=(
if (superClassof theAnimatable == FloatController ) then
(
a= modPanel.getCurrentObject()
b= theGrandParent
if (a==b) then ( true ) else ( false)
)
else
(
false
)
)
fn testCallbackAdditionFunction arg1 arg2 = (true)
theInterface = maxOps.trackbar
theIndex = theInterface.registerFilter testCallbackFilterFunction callbackAdditionFunction "ModFilter" 8 active:true stopTraversal:false
callbacks.removeScripts id:#trackredraw
callbacks.addScript #modPanelObjPostChange "tbar = maxops.trackbar; ind=0; for i=1 to tbar.filterCount() do ( if ( (tbar.getFilterName i)==\"ModFilter\") do ( ind=i; ) ) ; if (tbar.isFilterActive ind) do ( tbar.setFilterActive ind true) " id:#trackredraw
It works as is, but I have to use a #modPanelObjPostChange event to activate the filter each time.. isn't there a way to make the filter just do its jobs without retriggering it all time?
Not that you notice it but it just doesn't feel zen to do it like this :)
fn testCallbackFilterFunction theAnimatable theParent theSubAnimIndex theGrandParent theNode=(
if (superClassof theAnimatable == FloatController ) then
(
a= modPanel.getCurrentObject()
b= theGrandParent
if (a==b) then ( true ) else ( false)
)
else
(
false
)
)
fn testCallbackAdditionFunction arg1 arg2 = (true)
theInterface = maxOps.trackbar
theIndex = theInterface.registerFilter testCallbackFilterFunction callbackAdditionFunction "ModFilter" 8 active:true stopTraversal:false
callbacks.removeScripts id:#trackredraw
callbacks.addScript #modPanelObjPostChange "tbar = maxops.trackbar; ind=0; for i=1 to tbar.filterCount() do ( if ( (tbar.getFilterName i)==\"ModFilter\") do ( ind=i; ) ) ; if (tbar.isFilterActive ind) do ( tbar.setFilterActive ind true) " id:#trackredraw
