• Editor
  • 对于具有相同骨骼结构的不同骨架,如何使用同一套动画

ECG_Kinsey I don't think the IK constraint has anything to do with this case in particular, the only issue is when you set the parent of the image attachment to a corresponding bone. The following is a very simple example, but I am assuming you are looking for a rig like this, is my understanding correct?:

Here is the Spine project files:

skinconstraints.zip
192kB

What I did should be almost identical to what you were trying to do. I imported images of another character and adjusted the transform of the bones to match that character's arms using transform constraints, then added the constraints to the character's skin. I then set the parent of the images to the corresponding bones. This allows you to place another character's attachments without affecting the position of the first character's attachments.
I hope this will be of help to you.

  • ECG_Kinsey がこの投稿に返信しました。
    Related Discussions
    ...

    Misaki 这看起来和我们想要的效果很接近,我们因为角色的手臂长度不同,在变换约束中额外做了缩放处理,不过这个应该不是导致问题的原因,可能是哪个步骤没做对。

    所以想请教一下您制作的步骤细节,如果角色B作为皮肤导入,那么角色B的手臂附件和角色A 的手臂附件应该是共用一个插槽,在通过变换约束调整B的手臂骨骼和网格相匹配的过程中,角色B的手臂附件会随着骨骼移动而跟着移动,这个时候,您是如何处理这个问题的呢,是否先将手臂插槽的父节点设置为其他骨骼来避免手臂骨骼的移动造成的影响呢,然后等调整完骨骼并且将约束添加到皮肤后再将插槽的父级设置回手臂骨骼,是否是我理解的这个样子呢?

    感谢您的耐心解答,期待您的回复

    Misaki 我是否在调整变换约束的过程中不应该去移动插槽,而是去移动插槽下的附件,这个貌似是我出现问题的根本原因?

    • Misaki がこの投稿に返信しました。

      Nate 有关之前您提到的附件缩放的处理办法

      我们遇到了新的问题

      目前通过变化约束缩放骨骼和在IK控制的骨骼节点下新增新的骨骼禁用缩放,我们让骨骼尺寸适配了新角色的附件尺寸,可是当我通过IK去控制这部分骨骼变换的时候,IK所控制的骨骼长度发生了变化,导致骨骼和附件又一次的匹配不上了。


      不确定这个问题是否和变换约束缩放IK骨骼长度有关,求助

      • Misaki がこの投稿に返信しました。

        ECG_Kinsey (Except for the IK issue you just posted, this is an answer to your earlier question on the matter.)
        I think your understanding that you need to move the attachment is correct, but it's hard to explain well in words, so I've recorded the process of setting up the example I just posted above and uploaded it below so you can take a look at it:

        ECG_Kinsey Hmmm, as far as I have tried on my end, changing the bone scale in the transform constraint does not produce that result. I've attached a updated Spine project with the results of my own testing (in skin B I scale the arm bones via the transform constraint UpperArm_Position_B):

        skinconstraintswithbonescale.zip
        35kB

        Perhaps the quickest way to confirm your problem is to see your Spine project in person. A minimal Spine project with irrelevant parts removed would be fine, so could you email it to us?: contact@esotericsoftware.com

        • ECG_Kinsey がこの投稿に返信しました。

          Bone and attachment (Images) compensation affects manipulating bones in the viewport. It does not affect applying constraints. It is not applied when adjusting a transform constraint.

          You are fine up to this step:

          If I understand, you parent the slot to the root bone, apply the transform constraint, then parent the slot back. That puts the arm in the right position, but in your original skin the arm moves. Is the arm that moves in the same slot? If so, then you can't use parenting the slot to the root to move your attachment. Instead, parent only the attachments in the second skin to the root bone in a new slot, apply the transform constraint, then parent them back and delete the temporary slots on the root bone.

          As a simpler test, instead of changing the parent of attachments in the tree, just manually move the attachments to be in the right place in the viewport. Each attachment has its own position. Moving one doesn't affect other attachments in the slot or in other skins. (Except for linked meshes, which share the vertex positions.)

          For your IK scaling problem, you probably need to set the transform constraint to local and possibly relative. In general it's not possible to tell what is going on from an image or GIF. If you can send a .spine file it would be easier to provide guidance.

          • ECG_Kinsey がこの投稿に返信しました。

            Misaki 已经准备了一个工程通过邮件发至对应邮箱,可以复现这个问题,我的Spine版本是4.1.24

            Nate

            test.zip
            126kB

            这是我模拟的工程,删除了无关的骨骼,可以复现这个问题

            • 編集済み

            Thank you for the simplified project. The first thing we will do is delete everything that doesn't affect the problem, so I appreciate that you have done that.

            The problem is here, the constraint [FIX]F-arm:
             Loading Image

            When scale X and scale Y are different values, it is called non-uniform scale. This constraint applies non-uniform scale to bone F-arm. The bone F-wrist is a child so it inherits scale from its parent. That scale from the parent is applied in the direction of the parent. When F-wrist points in the same direction as the parent, F-wrist is scaled shorter. When F-wrist is rotated 90 degrees from the parent, it is no longer shorter, it is instead made wider. As your IK target is moved, F-wrist is rotated and the scale from the parent changes its length.

            To fix it, use uniform scale, where scale X and scale Y have the same values:
             Loading Image
            With this, no matter what rotation F-wrist has, it will always be the same length.

            You probably want to use uniform scale in other areas. I also suggest turning off transform constraint mixes you don't need, eg rotation and shear.

            I forgot to mention, my earlier project was saved with 4.2, so it won't open in 4.1. It's probably not useful now anyway.

            • ECG_Kinsey がこの投稿に返信しました。

              Nate 就是这个导致的,我这边按照你的指点调整了以后也顺利解决了,非常感谢你和Misaki的耐心讲解,我学习到很多,感谢有你们的帮助!

              • Misaki が「いいね」しました。

              Sure, we're glad to help!

              It is a little unfortunate to need to disable inherit scale to change bone lengths for skins, and to have to introduce intermediary bones for attachments. We'll consider other ways to change the bone length. For it to be in the skin, it'd need to be a constraint.

              • ECG_Kinsey がこの投稿に返信しました。
              • Misaki が「いいね」しました。

                Nate 期待未来有这么个功能,这样子的话会方便很多。

                请教个问题,之前您提及到建议关闭不需要的变换约束混合,哪怕我当前开启的变换约束混合没有发生作用,这也会有额外开销或者其他影响吗

                如下图所示

                Nate 之前提及的问题一切都解决的很顺利,等我们绑定完骨骼开始预览动画的时候,出现了新的问题。
                我们发现通过变换约束缩放的骨骼在父节点旋转的时候,无法保持固定的相对位置,会随着旋转产生偏移量。
                请关注下面图中肩膀的位置

                这是通过普通的骨骼绑定产生的效果,也是我们期望得到的效果。

                这是通过变换约束调整不同尺寸骨架绑定的效果,这种方式在旋转的过程中,产生了异常。

                testrotate.zip
                94kB

                我们准备了一个工程文件,可以复现这个问题。在这个工程中,有两个骨架,分别命名为“Wrong”和“Correct”,他们一个表现正常,一个表现出了我上面所述的问题。

                我们已经做了很多检查,不知道我们做错了什么,希望能得到帮助

                • 編集済み

                You mentioned before that it is recommended to turn off unnecessary transformation constraint blending. Even if the transformation constraint blending I currently enable does not take effect, will there be any additional overhead or other effects?

                Yes, the transform constraint does extra work for rotation and shearY. Set the mixes to 0 for transform properties you don't need to affect.

                Thank you for the reproduction Spine project. The behavior occurs because you are using the transform constraint in the world coordinate system. When doing that "up" is always toward the top of your monitor. When the bones rotate, moving the bones toward the top of your monitor becomes the wrong direction.

                To fix it, check Local. This moves the bones in their local coordinate system, where "up" is in relation to the parent bone. That way when everything rotates, the up direction also rotates, and the shoulder stays in the correct place in relation to the other bones and attachments.

                After changing to Local you likely need to reposition your bones.

                • ECG_Kinsey がこの投稿に返信しました。

                  Nate 感谢,这个很有帮助

                  • Nate が「いいね」しました。