withGroup

inline fun <T> withGroup(group: NodeGroup?, block: () -> T): T

Executes a block of code within the scope of a node group.

Any NodeGroup created within the block will have their parent set to the given group. The scope is automatically restored when the block completes, even if an exception occurs.

Return

the result of executing the block

Parameters

group

the NodeGroup to make the current scope, or null to clear the scope

block

the code block to execute