WithZIndex

ABSTRACT

The WithZIndex operation sets the Z-index for meshes within the provided mesh-tree.

PARAMETERS
meshRepresents the mesh-tree containing meshes to apply Z-index. All provided meshes will have their Z-index set.
rootThe root of the mesh-tree, serving as the container for mesh selection.
tag_predicate(tag)Determines whether a mesh should be included in the Z-index setting based on the provided tag.
indexA number value representing the Z-index to assign to the meshes. Lower values position the meshes closer to the background, while higher values position them closer to the foreground.
RETURN

If the complete mesh set is provided, all meshes will have their Z-index set. The return value is the mesh-tree of all the meshes with updated Z-index. However, if only a subset is chosen, the returned value will comprise a mesh-tree of the selected meshes with updated Z-index, while the unselected meshes will remain unchanged. Crucially, all meshes you didn't select will still be included in the result mesh_tree, but be provided as is (i.e. no Z-index assignment).

DECLARATION
func WithZIndex([mesh_tree] {[full] {mesh}, [tag_pred] {root, tag_predicate(tag)}}, index)