• Editor
  • How to disable some bones in certain animation


Here is an animation in our game.
Currently, my job is optimizing spine objects. Is there any way to disable some bones in certain animations?

When I added some bones below the hand, This happened.

The unused bones are moving during this animation.

I am going to add some particle systems in certain animations.
The particle systems must be spawned in certain transform. so I have to make animation-dependent bones for spawn point.
But these bones are not used in other situations. and they drop frames.

Is there any way to disable bones in certain animations?

Related Discussions
...

You can setup skins that disable bones. There is also point attachments which I think are lighter weight than bones for particle spawn points.

    SilverStraw
    Harald

    Thanks for answering too!
    I already know that Skin can have bones. But in our game,

    The player can freely customize the character.
    to achieve that, I make a new skin and add skins I selected(eye, hair, dress...)
    and finally apply skin to skeletonanimation.

    In this situation, If I add bones to the skin, do I have to change the skin every time I play the
    animations?There are a lot of animations that need bones.

      • تم التحرير

      meiroo2 In this situation, If I add bones to the skin, do I have to change the skin every time I play the
      animations?There are a lot of animations that need bones.

      Yes, you would need to use e.g. combinedSkin.AddSkin(enableBonesSkin) for the respective dummy-skin which then enables the respective bones.

      If only your animation determines which of these bones should be visible, and not the active attachments, using skin-bones as a solution does not seem ideal. Could you please explain why you have so many bones used for particles? Would it be an option to reduce the number of these bones dramatically and just position them via animation keys by the active animation?

        Harald

        For example, there is no effect in this animation. and here's my plan.

        1. Add Spine events when the brush is shaking.
        2. When the event is called, spawn particle system in bone's position
          (In this case, the bone's position should be the tip of the brush.)

        The first gif's unused bones are currently not in my game. It's just a benchmark test.
        but in the future, I think the bones for effect position will make a lot.

        Is there a good way to achieve this?

        I think setting a skin when you play an animation isn't so bad. Plus there's not really a better way. You could name skins to match animations, runtime code would check for a skin with the same name and use it if it exists.

        It could be interesting to key skin visibility, but skins are often customized at runtime so this would take some careful consideration.

        Having bones per animation (like we have per skin) doesn't make a lot of sense as soon as you need two animations with the same bones.

          Nate
          Thanks! What do you think about these two options?

          1. Setting a skin when I play an animation. (I will follow the bone and spawn particles in the skin.)
          2. Add a point attachment and use point follower. (The point attachment will exist for each animation.
            and disable for others when is not necessary.)

          The point attachment is fine and less overhead than a bone, so it makes sense to use if it reduces the bones you need. Note though that you can't animate its position unless you have a bone.

          Setting a skin when playing an animation makes the most sense IMO. The skin has any bones or constraints needed for that animation. You could even use the same skin for multiple animations.

            Nate
            I'll use the setting a skin method.
            Thanks for your help! Have a good day~