# How to Mute Animation Nodes Subprogram

Just wonder whether subprograms can be totally muted in ways other than just deleting it. I ask bacause:

For example, I tried to setup a loop in another nodetree, Then disable auto execution for that nodetree. However, it can still be invoked in other nodetrees, because subprograms seem to be kinda "global" data.

In some cases I want to mute the subprogram to improve overall performance by disabling the execution. Is that helpful? Can I do that? Or other better solutions? Thanks!

• I think there is no good solution to this yet.. I'm thinking about an additional boolean input in the Invoke Subprogram node that tells the node wether to execute the subprogram or not. Will see. – Jacques Lucke Nov 2 '16 at 14:33
• Oh I bet that can be helpful especially for complex setups, you know, I mean those with hundreds of nodes, though not sure whether it can make enough sense for a performance leap. – Leon Cheung Nov 2 '16 at 15:42
• I thought it might have been possible with the "loop break", but I just tried it out and it does not cause the loop to stop. Which makes me wonder: what is the "loop break" node for and how it is used? but i"ll open another question for that :) – Kristof Meirlaen Nov 2 '16 at 23:09
• @KristofMeirlaen There was a discussion on loop break between Jacques and me. FYI – Leon Cheung Nov 3 '16 at 0:53

EDIT: New Version

Same Principle, but how about ditching additional Subprogram and using Get List Element instead:

Old Version

I put actual Subprogram(red) inside another one (blue) as a Parameter to get ability to dynamically change number of iterations. Condition is controling execution of blue Subprogram

New:

Old:

• 0 iteration, interesting, quite dirty huh. X-D @JacquesLucke Your opinion here? – Leon Cheung Jan 29 at 16:04
• Tried to combine both Subprograms inside one – Serge L Jan 30 at 11:18