Separate Pieces
Separate Pieces finds the pieces a mesh is made of and names each one, so a later node can work on a single piece. Every piece becomes a selection (piece_0, piece_1, and so on) and every face gets a piece attribute with its piece number. Use it to keep one part of a model, move just the lid of a box, or paint each loose piece on its own. Turn up Explode to push the pieces apart and see them all at once, or set Output to Some pieces to look at the pieces one at a time, keep a range of them, or keep everything except them.
Inputs
Section titled “Inputs”The mesh whose pieces to find.
Outputs
Section titled “Outputs”The same mesh, each face carrying its piece index in a `piece` attribute and each piece named as a selection `piece_0`, `piece_1` and so on. With Explode above 0, each piece is moved outward from the centre. In Some pieces mode, only the picked pieces (or with Invert all the others), where they were, keeping their numbers.
Parameters
Section titled “Parameters”| Parameter | What it does | Default |
|---|---|---|
By | What makes one piece. Connected: faces joined to each other. Imported part: each part of an imported model, even where parts touch. Options: Connected, Imported part | Connected |
Output | All pieces keeps the whole mesh, labelled. Some pieces keeps only the pieces Piece and Count pick, or with Invert every other piece. Options: All pieces, Some pieces | All pieces |
Piece | The first piece to keep: 0 is the largest. The slider runs over the pieces the mesh has. Shown when Output is Some pieces. | 0 |
Count | How many pieces to keep, from Piece on. 1 keeps just that piece. Shown when Output is Some pieces. | 1 |
Invert | Keeps every piece except the ones Piece and Count pick. Shown when Output is Some pieces. | Off |
Explode | Pushes each piece this far away from the centre of the mesh, to see the parts at once. 0 leaves them in place. Shown when Output is All pieces. | 0 cm |
How pieces are found
Section titled “How pieces are found”- Connected: faces that share a point (an edge or just a corner) belong to the same piece. Three cubes merged together are three pieces.
- Imported part: each part of an imported model (each object in the file) is one piece, even where two parts touch or overlap, and even when a part has several materials. Faces that did not come from the import are split by Connected. Use this right after Import.
How pieces are numbered
Section titled “How pieces are numbered”Pieces are numbered largest first, by how many faces they have. Pieces of the same size are numbered by position: lowest x first, then lowest y, then lowest z (the centre of each piece’s bounding box). The numbers only depend on the pieces themselves, so they stay the same every time the graph cooks, and moving the whole mesh upstream does not change them.
Selections named piece_ plus a number that are already on the mesh are replaced, so a second Separate Pieces after a Delete leaves no stale selections from the first. Every other selection, attribute, UV and material passes through unchanged.
Explode the pieces apart
Section titled “Explode the pieces apart”Explode moves every piece outward from the centre of the mesh, so you can see all the parts of a kit-bashed or imported model at once, or set up an exploded-view render. Each piece moves by the Explode amount, along the line from the centre of the whole mesh’s bounding box to the centre of the piece’s own bounding box. Three cubes in a row with Explode at 20 cm: the outer two each move 20 cm outward, and the middle one stays where it is, because its centre is the mesh’s centre.
Each piece moves whole: its shape, UVs and materials do not change, and the piece_ selections and the piece attribute still name the moved pieces. At 0 (the default) nothing moves and the mesh comes out exactly as it went in. Pieces that share a point (this can only happen with Imported part, when faces that came from elsewhere are welded to a part) move together as one, and the node shows an amber note.
Keep some of the pieces
Section titled “Keep some of the pieces”Set Output to Some pieces and drag the Piece slider. Only that piece comes out, where it was, so you can scrub through a sheet of logs, vines and leaf clumps one at a time. The slider runs from 0 to the number of pieces minus one, and the line under it shows which piece you are on and how many faces it has, for example “Piece 3 of 12 · 1,240 faces”. Explode is hidden in this mode and does nothing.
Raise Count to keep a run of pieces: Piece 2 with Count 4 keeps pieces 2, 3, 4 and 5 (“Pieces 2–5 of 12”). Dragging Piece slides the whole run along. A run that goes past the last piece stops there, so a large Count keeps everything from Piece to the end.
Turn on Invert to keep every piece except the run instead: Piece 0 with Invert removes the largest piece and keeps the rest (“All but piece 0 of 12”). If the run covers every piece, nothing is left and the node shows an amber note.
The kept pieces keep their numbers: a kept piece 3 still has piece = 3 and the piece_3 selection, even when piece 2 was removed. The removed pieces’ piece_ selections are dropped, and any other selection shrinks to the kept faces. UVs and materials come through unchanged. To move a piece to the origin or change its pivot, add a Transform after it. To see the whole sheet again, pin the node before Separate Pieces or switch back to All pieces.
If an upstream edit leaves fewer pieces than the number you picked for Piece, the node uses the last piece and shows an amber note, such as “piece 7 doesn’t exist (5 pieces); using piece 4 instead”. It keeps your number, so the pieces come back when the pieces do.
You can get the same result with two nodes: wire Separate Pieces into a Delete, set its Apply to to the piece you want (say piece_2) and turn on Invert. To pick a piece by number with a Selection node instead, match the piece attribute (for example piece = 2).
See also
Section titled “See also”- Delete: keep or remove one piece by its selection.
- Merge: combines meshes into one; Separate Pieces names them apart again.
- Model nodes: the other hand-modeling edits.