Based on my knowledge, Spine's clipping attachments can't directly clip to the shape of another mesh attachment. Clipping attachments use their own polygon vertices to define the clipping area, and they clip slots based on draw order - from the clipping attachment's slot to a specified end slot.
For your specific case with the shadow on the ball, here are some possible approaches:
1. Manual Clipping Attachment
Create a clipping attachment that matches the shape of your red ball. The clipping polygon would need to be manually created to follow the ball's circular shape. If the ball deforms or moves, you'd need to:
- Weight the clipping attachment vertices to the same bones as the ball
- Key the clipping attachment's deform if needed to match the ball's shape changes
2. Separate Shadow Mesh
Instead of having a single shadow that spans multiple areas:
- Create a separate shadow mesh specifically for the ball
- Place this shadow mesh in the ball's slot (or adjacent in draw order)
- Weight it to react to the leg movement
- The shadow would naturally be contained within the ball's area
3. Use Multiple Shadow Pieces
Break your shadow into separate pieces:
- One shadow piece for the ball (stays within ball boundaries)
- Other shadow pieces for the ground/other surfaces
- Each piece can be independently weighted and positioned
Important note: Clipping can be expensive performance-wise, especially with complex meshes. If possible, using separate mesh pieces (option 2 or 3) is often more efficient than clipping.
The limitation you're experiencing - wanting to clip to a mesh shape dynamically - is a known feature request, but it's not currently available in Spine.