The clipping feature lets you define a polygonal area, similar to a bounding box attachment, that will mask other slots in the draw order. The clipping area can be any concave polygon without holes and self-intersection. You can also animate the clipping area vertices. Only one clipping area can be active at a time.
Clipping is implemented CPU-side in all runtimes, as most engines do not support direct stencil buffer access or masking. Clipping can be a very expensive operation, especially if you use dense mesh attachments. Always check the performance of your clipped animations on your target platforms.
To create a new clipping attachment, select a bone or slot in the tree, then choose
Clipping in the properties at the bottom of the tree.
This will create a clipping polygon. Clippings are stored on a slot like any other attachment.
The new clipping attachment appears in the tree and Edit mode is automatically selected.
New mode, clicking in the editor area will create new polygon vertices. Vertices can also be translated by dragging or deleted by double clicking. When the polygon is complete, exit
New mode by clicking the first vertex to close the shape or by clicking the
Edit mode has two tools:
Createallows new vertices to be created along the edges of the polygon by clicking.
Deleteallows vertices or edges to be deleted by clicking.
With either tool, vertices can be translated by dragging or deleted by double clicking. Right click switches tools.
Edit mode can be exited at any time by pressing
escape, by clicking the
Edit button in the properties at the bottom of the tree, or by closing the
Edit Bounding Box dialog.
To delimit the number of slots in a clipping attachment and define where the clipping should start, open
Draw Order and move the clipping to its start spot.
To delimit where a clipping should end, select the clipping attachment and set the
End Slot under its properties.
You can find an example of usage in the updated Spineboy project.
The clipping vertices can be edited outside of
Edit mode by using the transform tools. The entire clipping can be rotated, translated, and scaled like any other attachment.
Individual vertices can be translated with any transform tool by dragging. Multiple vertices can be selected by holding
cmd on Mac), then clicking or dragging to box select. The selected vertices can be deselected by pressing
escape, or by clicking in any empty space.
The origin used for rotation or scaling can be changed. Mouse over the small crosshair at the center of the
Scale tool until a circle appears, then drag the origin to the desired position. The origin will automatically snap to vertices.
Clipping attachments can be automatically deformed when bones are transformed. See Weights for more information.