[Feature request] Compact nodes to function

I just stumbled across this and it seems like a great idea:

Select group of nodes -> compact -> replaced with function with correct input and output nodes.

I’d use this a LOT if it existed. It’d be a lot smoother than creating functions in advance or by detaching into a different UI as you need to create a function. Sometimes it’s just nice to maintain your current editor context.

I am not sure this is what you mean but : Select the nodes you want for your function, do right click and : collapse to function. Only thing is to make attention in new function to outputs which need to be set correctly.

Edit : you can collapse nodes and collapse to macro too but to see this you have to right click when mouse is on one of the selected nodes.

So it already exists? Well excellent. :slight_smile: I’ll have a look when I get home.

It does indeed exist although use with care. It won’t always setup the input/outputs how you wanted them, and if you have any branch-ish type nodes in there, not all routes will get properly wired up the final “return node” it’s going to create for you.

If you’re going to use it, I strongly recommend you test everything first, then refactor the new function out, then really give it a good test immediately after, so if you find anything janky going on, you where to look. Anytime I’ve just tried to refactor like this in the middle of a pile of other changes, I’ve always regretted it!