• Runtimes
  • 合并皮肤之后,新的Spine形象的清晰度降低了

  • Изменено

Misaki 目前我的A和B是使用的同一个骨骼,我是在运行时加载的三个导出的资源,类似与这样的代码,以便保证我获得的SkeletonGraphics都是使用的同样的骨骼,每个对象都包含三个皮肤attach,body,head。我现在的需求是,希望能够在运行时加载的A的皮肤attach和body,与B的皮肤head进行组合。这样是否可行?事实上,我已经实现了这样的功能,但是对于简单的比如待机的动作可以,但是复杂一些的攻击动作,涉及到层级变化的,动画效果就乱了。` // 创建资源
SpineAtlasAsset atlasAsset = SpineAtlasAsset.CreateRuntimeInstance(part.atlasText, part.textures, materialPropertySource, true);
SkeletonDataAsset skeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(part.skeletonJson, atlasAsset, true);

            // 创建SkeletonGraphic
            SkeletonGraphic skeletonGraphic = SkeletonGraphic.NewSkeletonGraphicGameObject(skeletonDataAsset, this.gameObject.transform, skeletonGraphicMaterial);
            skeletonGraphic.gameObject.name = $"SkeletonGraphic_{part.partName}";
            skeletonGraphic.Initialize(false);`
    Related Discussions
    ...

    mingjava ` // 创建资源
    SpineAtlasAsset atlasAsset = SpineAtlasAsset.CreateRuntimeInstance(part.atlasText, part.textures, materialPropertySource, true);
    SkeletonDataAsset skeletonDataAsset = SkeletonDataAsset.CreateRuntimeInstance(part.skeletonJson, atlasAsset, true);

                // 创建SkeletonGraphic
                SkeletonGraphic skeletonGraphic = SkeletonGraphic.NewSkeletonGraphicGameObject(skeletonDataAsset, this.gameObject.transform, skeletonGraphicMaterial);
                skeletonGraphic.gameObject.name = $"SkeletonGraphic_{part.partName}";
                skeletonGraphic.Initialize(false);`

    mingjava I realized that maybe what you're really looking for is to use Multiple CanvasRenders, Separator Slot Names and Enable Separation. Have you tried using those parameters?:
    spine-unity 运行时文档 主要组件 SkeletonGraphic组件 #参数
    (Although I have linked to the relevant section, this section is quite long, so it may be difficult to find the relevant item. Please scroll down to find the sections.)

    You can use them to separate the rendering of the skeleton into any number of CanvasRenderers in a single instance. If your needs do not necessarily require two instances, this method is much easier to handle in terms of animation synchronization and other aspects. (Rendering is separate, but animation is managed by a single AnimationState.)

    If you haven't tried it yet, it's worth giving it a try to see if it meets your needs.
    The following thread may also be helpful:
    https://esotericsoftware.com/forum/d/11375-separator-with-skeletongraphics/5

    • mingjava ответили на это сообщение.

      Misaki 不是这个需求,我的目的是,通过将两个同样骨骼的对象,拼接他们的皮肤,组合出新的骨骼动画来是否可行,对于一个骨骼对象,预置在这个骨骼里面的皮肤进行拼接是可行的,Spine的例子也是这么用的,那么对于两个同样骨骼的对象,加载到程序里面之后,组合他们的皮肤拼接是否可行?

      • Misaki ответили на это сообщение.

        mingjava It is likely that we will not be able to understand what you are trying to convey through text alone, so it would be best if you could send us a Unity project that reproduces the issue. Please create a minimal Unity project and send it to us via email: contact@esotericsoftware.com

        Also, please explain the expected results with images or videos and attach them to the email.

        • mingjava ответили на это сообщение.

          Misaki 你好,misaki,感谢您的耐心解答,先不发邮件了,应该是spine的动作处理的有问题,程序上从两个同骨骼的项目去组合皮肤应该是可行的。

          9 дней спустя

          @mingjava I'm afraid your postings are not translating clearly via machine translation. Could you please describe in more words and more detail what you were saying in the last posting?

          • mingjava ответили на это сообщение.

            Harald 感谢您得热心回复,我希望能够使用一套骨骼数据,能够在运行时支持角色更换比如头部,身体,目前这两个部分是做成了皮肤head和body,目前我对于组合在一起得head和body,导出两套到unity,然后在程序里面通过组合head和body,可以组合出来四套角色。这些是我已经实现的功能,我想进一步研究,是否可以只导出两套head和两套body,然后还是两两组合,这样比head和body一起导更灵活,如何head和body都是单独导出,他们还能共享一套.skel.bytes导出文件吗?

            @mingjava Thanks for the explanation, it is a bit clearer now. I'm unfortunately not sure why you want to export skins separately and how many skeleton file you would like it exported as. What is currently bad with exporting 2 head and 2 body skins normally as a single skeleton, resulting in e.g. 2 atlas page textures (2 .png files), 1 .atlas.txt file, and one skeleton file .skel.bytes? What problem are you trying to solve?

            • mingjava ответили на это сообщение.

              @mingjava More precisely: what problem do you want to solve, is it to improve development of multiple people working on a single skeleton to support a split workflow better? Or do you want to improve runtime efficiency, and what precisely do you want to improve?

              Harald 我想让所有的角色都共享一个完全一样的.skel.bytes,每个角色现在包含三个皮肤body,head和attach,运行时会将三个皮肤组装成一个皮肤,为了使用一样的.skel.bytes,应该需要把所有的三个皮肤和对应的附件都导出才可以,这样的话,body和head就必须完整的导出,我运行时是可以使用A角色的body,attach与B角色的head进行皮肤组装的,那么我的A角色可以只导出body和attach,B角色只导出head吗,如果这样导出的话,A和B角色的skel.bytes就不一致了吧。

              @mingjava I'm afraid you've described a problem you've encountered in your attempted solution, but not what initial problem you want to solve. Could you please answer this question:

              What problem do you want to solve, is it to improve development of multiple people working on a single skeleton to support a split workflow better? Or do you want to improve runtime efficiency, and what precisely do you want to improve?