• RuntimesUnity
  • Using animation draw order for slot separation with SkeletonRenderSeparator?

In our game, we need to set different rendering orders for different parts of a character. To achieve this, we're using an approach based on the SkeletonRenderSeparator example.

However, I've noticed that when separating based on slots, it seems to rely on the setup pose's draw order. In our project, we need to modify the draw order within animations, but it looks like Spine doesn't use the animation-time draw order for the separation process. As a result, the visual outcome doesn't match what we expected.

Is there a way to make SkeletonRenderSeparator (or any other method) use the draw order from animations when determining how to separate the slots?

    Related Discussions
    ...
    • Editado

    The reply by spinebot was wrong, sorry for the inconvenience, I've removed it.

    Katana In our game, we need to set different rendering orders for different parts of a character. To achieve this, we're using an approach based on the SkeletonRenderSeparator example.

    Note that SkeletonRenderSeparator is for layering other GameObjects between attachments, not for changing draw order.

    Katana However, I've noticed that when separating based on slots, it seems to rely on the setup pose's draw order. In our project, we need to modify the draw order within animations, but it looks like Spine doesn't use the animation-time draw order for the separation process.

    No, current draw order (skeleton.DrawOrder) is used. Your separation slots define the separation points where parts will be sliced into pieces. Note that the order and number of pieces may change when visible attachments or draw order changes.

    Katana As a result, the visual outcome doesn't match what we expected.

    Is there a way to make SkeletonRenderSeparator (or any other method) use the draw order from animations when determining how to separate the slots?

    It already does that. If your animation modifies the draw order so that the position of attachments around your separation slots flips place, or your separation slots are reordered, things may become a bit unintuitive. Note that part 0 contains attachments from the beginning of your draw order up to the first separation slot, part 1 attachments between first and second slot, and so on. In other words: parts are not "re-arranged" magically when draw order flips your attachment order, that's what often confuses users.

      Harald You're correct. Turns out it's caused by the wrong draw order setup in my project. Thanks.

      @Katana Thanks for getting back to us, glad you've figured it out.