Trackbar filter

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2012   #1
Trackbar filter

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
 
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl

Last edited by jonadb : 04 April 2012 at 09:23 AM.
 
Old 04 April 2012   #2
Originally Posted by jonadb:

 fn testCallbackFilterFunction theAnimatable theParent theSubAnimIndex theGrandParent theNode=
( 
   superClassof theAnimatable == FloatController and modPanel.getCurrentObject() == theGrandParent
)


Sorry, I couldn't help myself

I don't think you can trigger it without utilizing the modpanel callback, but you might not have to keep reregistering the filter each time. Have you tried to force a redraw of it?
 
Old 04 April 2012   #3
Thx for cleaning the code up!

I did try a forced .redraw method but that didn't help.. it does redraw but it does not seem to run the keys trough a filter again.

edit: btw, I doesn't re-register it self, it just sets itself to the active filter, even when it's already active, that triggers the filtering.
__________________
The GPU revolution will not be rasterized! - http://www.jdbgraphics.nl

Last edited by jonadb : 04 April 2012 at 11:12 AM.
 
Old 04 April 2012   #4
you could try to broadcast a #selectionSetChanged callback but I suspect that will take more time than what you are already doing.
 
Old 04 April 2012   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:58 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.