• Editor
  • 创建动画文件夹是否能像骨骼加到皮肤里一样省资源

由于一个角色有多个职业动作,程序导出要求拆分很多文件,有多少职业动作就要拆分多少个文件,有办法不拆分多个文件导出吗?创建动画文件夹把动作分类后,能像皮肤里的骨骼一样不调用就不会占用资源吗?

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

    Sunny 我不敢说,但我不确定您所说的 "职业动作 "是什么意思,我也不确定您想实现什么样的目标。您能告诉我们您目前的Spine项目结构是怎样的吗?另外,您的游戏项目使用的是什么Spine运行时?


    I am afraid to say but I am not sure what you mean by "career actions" and I'm not sure what kind of things you would like to achieve. Could you please tell us what your current Spine project structure is like? Also, what Spine runtime are you using for your game project?

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

      Misaki 职业动作是同一个角色有不同的武器动作,想实现目标是不用每次制作更新,要把骨骼文件和动作按不同武器动作拆分成多个文件,因为动作很多程序要求拆分成多个文件,spine高版本4.0.63可以创建动画文件夹将动画分类,这种分类是不是和皮肤里放骨骼一样,不调用就可以屏蔽。每次新增一个武器就要多拆分一个骨骼文件,这种拆分文件的方式是最省资源的方式吗?有没有更好的办法?

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

        Sunny 感谢您的补充解释。我想我还没有完全理解您的要求,但最好先知道您使用的是哪个运行时,以便回答您想做什么。您能告诉我们您使用的是哪个运行时的版本信息吗?


        Thank you for the additional explanation. I think I still don't fully understand your requirements yet, but it would be good to know which runtime you are using first in order to answer about what you want to do. Could you tell us what runtime you are using with the version information?

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

          Misaki unity 2020.348

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

            Sunny 您能否告诉我们您使用的是哪个版本的spine-unity运行时?spine-unity运行时的版本可以在Spine文件夹下的version.txt中找到。例如,您可以在version.txt中找到如下信息:

            This Spine-Unity runtime works with data exported from Spine Editor version: 3.8.xx
            Package version: spine-unity-3.8-2021-11-10.unitypackage

            Could you please also tell us what version of the spine-unity runtime you are using? The version of the spine-unity runtime can be found in version.txt in the Spine folder. For example, within version.txt you should find like the following information:

            This Spine-Unity runtime works with data exported from Spine Editor version: 3.8.xx
            Package version: spine-unity-3.8-2021-11-10.unitypackage
            • Sunny ответили на это сообщение.

              Misaki spine-unity 4.0.0,unity 2020.3.48f1c1

              请注意,这不是 Misaki 要求的完整版本信息。 spin-unity包的版本完整版本号是unity包的名称,包括日期。 正如 Misaki 上面发布的那样,这也列在“Assets/Spine/version.txt”文件中。 如果您通过Unity包管理器和git而不是通过.unitypackage文件使用spine-unity包,则包管理器中的版本在您的情况下始终显示为4.0.0(在4.1之前,补丁版本号始终为0)。 在这种情况下,版本日期将是您上次从 git 存储库中提取的日期。

              关于你的问题:
              我不确定我是否正确理解你的问题。 我假设您在问如何将 Spine 项目和导出的文件拆分为多个文件,用动画(或动画集)分隔,然后通过 spin-unity 运行时加载和合并它们,对吗? 如果是这样,那么一种工作流程是复制 Spine 项目并保持所有骨骼、插槽和附件名称完全相同。 然后像往常一样处理动画并将项目导出到“.skel.bytes”(或“.json”,如果您可以接受更大的文件和更长的加载时间),而不打包任何图集。 然后,您可以在 Unity 中加载主骨架以及其他仅动画骨架。 然后从仅动画的骨架中,附加 SkeletonData.Animations 的列表 到主骨架的“SkeletonData.Animations”。

              当使用“.json”而不是“.skel.bytes”时,您还可以以编程方式将纯动画文件的“Animations”部分附加到文本级别的主骨架文件中。

              如果您不需要将动画集保留在单独导出的“.skel.bytes”文件中,您还可以自动将动画 Spine 项目合并到主骨架 Spine 项目,并将项目重新导出到单个“.skel”。 字节`文件。 这仍然允许您将动画工作拆分给多个同事,然后在导入到 Unity 之前将它们合并到一个骨架中。



              Please note that this is not the full version information that Misaki requested. The version full version number of the spine-unity package is the name of the unitypackage, including the date. This is also listed in the Assets/Spine/version.txt file, as Misaki has posted above. If you use the spine-unity package via the Unity Package Manager and git instead of via the .unitypackage file, the version in the Package Manager always reads 4.0.0 in your case (before 4.1 the patch version number was always 0). In this case the version date would be the date that you last pulled from the git repository.

              Regarding your question:
              I'm not sure I understand your question correctly. I assume you are asking how you can split your Spine project and exported files into multiple files, separated by animations (or sets of animations) and then load and merge them via the spine-unity runtime, is that correct? If so, then one workflow is to duplicate the Spine project and keep all bone, slot and attachment names exactly the same. Then work on your animations and export the project to .skel.bytes (or .json, if you can live with larger files and longer load times) as usual, without packing any atlas. Then you can load the main skeleton plus your additional animation-only skeletons in Unity. Then from the animation-only skeleton, append the list of SkeletonData.Animations to the main skeleton's SkeletonData.Animations.

              When using .json instead of .skel.bytes, you could also programmatically append the Animations section of the animation-only files to the main skeleton file on the text level.

              If you don't need to keep the animation sets in separately exported .skel.bytes files, you could also automate merging your animation Spine projects to your main skeleton Spine project and re-export your project to a single .skel.bytes file. This still allows you to split animation work across multiple co-workers, and then merge them to a single skeleton before importing in Unity.

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

                Harald 感谢您的回答。如果不按武器皮肤和动作拆分骨骼文件的话,所有动画集和所有皮肤都存在于主骨骼里只导出一个骨骼文件最后另外打包图片,会比拆分多个骨骼文件节省资源吗?这里拆分的多个骨骼文件,里面的骨骼、插槽和附件名称是一样,但骨骼数量和插槽数量不同。

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

                  与导出单独的骨架文件然后从中合并动画相比,导出单个骨架可以节省内存。 但是,骨架文件大小通常并不重要,因为图集纹理在空间中会大得多。 您能否描述一下您想要解决什么问题,为什么要拆分您的项目?

                  这里分割的多个骨骼文件中,骨骼、槽位、配件的名称是相同的,但是骨骼的数量和槽位的数量不同。

                  然后,简单地附加“骨骼数据.动画”列表的内容,并将插槽和骨骼添加到相应的列表中,将无法开箱即用。 当您在要合并的骨架导出中添加不同的插槽和骨骼时,事情会变得更加复杂,因为动画引用诸如“slotIndex”和“boneIndex”之类的索引,除非进行相应调整,否则这将是错误的。



                  Sunny Having a single skeleton export will save memory compared to having separate skeleton files exported and then merging animations from them. However, skeleton file size usually won't matter, as it's the atlas textures which will be much larger in space. Can you please describe what problem you want to solve, why you want to split your project?

                  这里分割的多个骨骼文件中,骨骼、槽位、配件的名称是相同的,但是骨骼的数量和槽位的数量不同。
                  In the multiple derivative files divided here, the names of derivatives, slots, and accessories are the same, but the number of derivatives and the number of slots are different.

                  Then simply appending the contents of the skeletonData.Animations list, and adding slots and bones to the respective lists as well, will not work out of the box. Things get much more complicated when you add different slots and bones at your to-be-merged skeleton exports, because animations reference indices like slotIndex and boneIndex, which will then be wrong unless adjusted accordingly.

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

                    Harald 这个项目早期是spine2.17版本升级到spine4.0版本制作的,由于动画数量多,需要拆分多个文件,拆分是按角色使用的武器拆分及性别拆分,每个拆分的骨骼文件包含相同数量的角色套装皮肤及同种类型的武器皮肤系列。每次导出要删掉其他不同类型的武器皮肤系列及武器骨骼,制作流程繁琐,男女角色早期版本没有合并制作, 由于骨骼和插槽数量不完全一致,导致动作数据也不能完全公用,制作效率不高。例如:男角色按时装和武器拆分成10个,每个拆分的骨骼文件还有40个的动作,女角色也要拆分成10个同样每个文件也有40个动作。先导出二进制骨骼文件,再另外按文件夹打包图片集。

                       spine4.0版本工作效率高,可以把武器骨骼加入到皮肤中,不显示就不占用资源,也可以把男女角色合并在一个spine文件中,大大提高效率,由于项目是程序在引擎里控制换装,而不是像spine3.8那样通过皮肤路径换装,目前想了解的是合并了男女角色到一个骨骼文件中,武器骨骼也能加入到皮肤中,动画也能创建动画集分类,这样还需要拆分那么多骨骼文件导出吗?还有随着项目的更新还会不断增加套装皮肤和武器皮肤的数量,按多边形打包图片集的话,由于每个文件夹里存在的图片过多,计算量大,无法正常导出。

                    选择多边形打包图集,是为了图集的UV能一致,一个皮肤能公用多个图片,但由于图片过多,导出异常有解决的方法吗?如果把一个文件夹里的图片再拆分成多个文件夹存放会提高多边形打包图集的效率吗?

                    您可以通过 Spine 编辑器菜单项“Spine”-“导入项目...”将多个 Spine 项目合并为一个项目。
                    http://esotericsoftware.com/spine-import
                    关于皮肤骨骼:将多个骨架项目导入到单个项目后,您可以将特定武器专用的骨骼分配给相应的皮肤。 您可以将皮肤骨骼用于女性和男性皮肤和皮肤骨骼,以及武器皮肤和皮肤骨骼。

                    关于多边形封装:
                    我不确定我是否正确理解了你的问题。 您的意思是多边形打包失败,但您必须使用多边形打包来保持图集区域布局相同? 您是否需要仅切换 atlas 纹理,但使用相同的“.atlas.txt”描述文件? 一般来说,当使用相同或足够相似的输入附件图像集重复时,矩形和多边形打包都应产生完全相同的布局。 当启用空白剥离时,这需要相同数量的空白。 您是否遇到过矩形打包问题,导致相似的输入图像集产生不同的结果?



                    You can merge multiple Spine projects to a single project via the Spine Editor menu entry Spine - Import project ...
                    http://esotericsoftware.com/spine-import
                    Regarding skin bones: Once your multiple skeleton projects are imported to a single project, you could then assign bones exclusive to a certain weapon to the respective skin. You could utilize skin-bones for female and male skins and skin-bones, as well as weapon skins and skin-bones.

                    Regarding polygon packing:
                    I'm not sure I understood your question correctly. Do you mean that polygon packing failed, but you have to use polygon packing to keep the atlas region layout the same? Do you need to switch out only the atlas texture but use the same .atlas.txt description file? In general, both rectangle and polygon packing should lead to the exact same layout when repeated with the same or a similar enough set of input attachment images. This requires the same amount of whitespace when whitespace stripping is enabled. Did you encounter problems with rectangle packing, leading to different results for similar sets of input images?

                    • Sunny ответили на это сообщение.
                      • Изменено

                      我想我现在可能明白你第一个问题的意思了。您注意到升级到Spine4.0后可以为动画创建文件夹,您认为这将允许您以一种特殊的方式将动画应用到骨架上,对吗?如果是这样,那么很不幸您误解了这个功能。它只是方便了在编辑器中管理动画,并且可以作为前缀使用,因为文件夹名称将作为运行时调用的动画名称的前缀。例如,在 male 文件夹中名为 idle 的动画在运行时将会是 male/idle。这不是像皮肤骨骼那样的高级功能。

                      一般来说,合并骨架并不容易,需要做大量工作。也许您提出这个问题是想寻找一种更有效的方法,因为这项工作看起来太复杂了,但根据您的情况,我不认为有任何解决方案可以神奇地让它立即消失。这需要时间和精力,但手动修复每个骨架使其更易于处理可能是最短的路径。


                      I think I now might understand what you meant by your very first question. You noticed that upgrading to Spine 4.0 would allow you to create folders for your animations, and you thought that this would allow you to apply animations to your skeletons in a special way, right? If so, then unfortunately you have misunderstood that feature. It only makes it easier to manage animations in the editor, and can be used as a prefix since the folder name will be prefixed to the name of the animation to be called at runtime. For example, an animation named “idle” in the "male" folder will be "male/idle" at runtime. It is not an advanced feature like skin bones.

                      In general, merging skeletons is not that easy and involves a lot of work. Perhaps you asked the question in search of a more efficient way because the task seems too complicated, but based on your case, I don't think there is any solution that will magically make it go away instantly. It will take time and effort, but manually fixing each skeleton to make it easier to handle may be the shortest path after all.

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

                        Misaki 是的,这是我想知道的,感谢您的回答。

                        Harald

                        Harald 您是否遇到过矩形打包问题,导致相似的输入图像集产生不同的结果?

                        您的理解是正确的,我能确保多边形打包输出的图片集结果一致。但打包所有项目图片时,可能图片数量过大,导致导出时间很长,一直读进度条,无法完成所有图片打包。如果把打包路径里的图片文件夹删除大部分数量,可以顺利导出。但这样无法将整个项目的图片一起打包,是否要减少每个文件夹里的图片,多分文件夹存放图片,以提高打包图片速度及成功率,这个可能需要测试,提出这个问题是想提前验证我的想法是否正确,或是spine高版本有更好的图片打包是我不知道。


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

                          Sunny

                          是的,这是我想知道的,感谢您的回答。

                          我很高兴我的理解是对的!
                          I am glad that my understanding was correct!


                          但这样无法将整个项目的图片一起打包

                          不,这不准确。多个骨骼的图像可以打包到一个纹理图集中。在导出窗口中选择 单个图集 选项. 有关该选项的更多信息,请参阅用户指南的以下部分: 纹理打包 - 导出数据时打包

                          No, that is not accurate. Multiple skeleton's images can be packed into a single texture atlas. Choose the Single atlas option on the export window. For more information on this option, please see the following section of the user guide: 纹理打包 - 导出数据时打包

                          @Sunny 不幸的是,我不明白你的回复的机器翻译为什么用模式矩形而不是多边形打包会引起问题。 多边形包装和矩形包装都应该产生可用的结果。 多边形包装需要更长的时间才能完成,而矩形包装速度更快,但包装不那么紧密。

                          如果打包图片的时间对您来说太长,您可以通过选择模式图片文件夹 而不是附件



                          Unfortunately I did not understand the machine translation of your reply why packing with mode rectangles instead of polygons caused problems. Both polygon packing and rectangle packing should lead to a usable result. Polygon packing takes much longer to complete, while rectangle packing is faster but does not pack as tight.

                          If the time it takes to pack your images is too long for you, you could pack by image folder instead of by attachments by selecting mode 图片文件夹 instead of 附件.

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

                            Harald 好的,感谢您的回答。