Hi @nathanwolek - I’m always glad to hear the pieces I’ve made help. If only there were more hours in the day
So given your description of a more layer based system you could think of a few different approaches here that might help.
TouchDesigner Centric Op Approach
A more op based approach would be to use something like the switch TOP set to “blend between inputs”. This only cooks the current index and the next index. For example, an index value of 0 cooks the 0 and 1 inputs. 0 and 1 will continue to cook until we get to an index value of 1, then inputs 1 and 2 will cook. So You could do something like this:
Here a button simulates the active value, and a filter CHOP is used for your easing / transition between switch inputs. Setting the null’s cook type to be selective will prevent the null from updating the value of the index par every frame. This effectively stops the first input to the switch from cooking.
base_switch_top_approach.tox (1.3 KB)
That might be enough, but if that’s not totally enough rails for your process, you might think about locking a top.
Scripting the Lock Attribute
This other approach is a little more pythonic, and uses two scripts to make this work. The trick here is that you can “lock” any operator. This creates a cached “frozen” state of the data in an operator. This is more efficient than bypassing un-bypassing because it preserves the memory of your chain of operators - bypassing and un-bypassing or turning cooking on / off can sometimes cause your ops to re-cook or re-initialize. This usually ends up in looking like frame drops and performance stutters - which is why I only use that approach if there are no other viable alternatives.
In this example we use one script to turn off the lock property of our level TOP… anytime our active value changes we’ll want to unlock the TOP so changes can push. Another script locks the TOP only when the state of active goes from 1 to 0 - or when the opacity is turned all the way off. We similarly use a filter CHOP for the easing, and our script to lock the level TOP happens based on values after filtering.
base_script_gate.tox (1.6 KB)
This is kind of gating in TouchDesigner that is a little more flexible, but also means you need a few more handles manage the state of your ops.
Hopefully one of these approaches should help do the trick. I think either of these should be fairly straight forward to integrate for a refactor - though you can always hold off on making that decision if your frame rates still look good.
Hope this helps!