whiteye11

你们好,我们项目是个2d项目,里面一个人物有许多时装,需要能实现多个spine使用同一套骨骼+动作数据,这样日后加一个动作,只需要在一个spine项目中添加,不然需要所有spine项目都实现一遍,请问有什么好的方案

---

please someone help me!!
whiteye11
  • 帖子: 4

Erika

Hello, from what I could understand from the automatic translation, it seems like you are looking for the skins feature in spine:
您好,据我从自动翻译中了解的内容,您似乎在寻找spine的皮肤功能:

Skins - Spine User Guide
头像
Erika

Erikari
  • 帖子: 2754

whiteye11

Erika 写道:Hello, from what I could understand from the automatic translation, it seems like you are looking for the skins feature in spine:
您好,据我从自动翻译中了解的内容,您似乎在寻找spine的皮肤功能:

Skins - Spine User Guide
多谢回复,有点类似,但是出于加载和内存的考虑,希望能将skin拆成多个文件导出,骨骼和动作只保存一份文件,然后在游戏运行过程中,可以动态地通过setskin方法加载其他skeletonDataAsset的skin,
但是这边试过,动作无法正常播放,因为slots数据全部都变了
whiteye11
  • 帖子: 4

Harald

请注意,在使用spine-unity时,您还可以附加来自原始Spine项目不包含的图集资产的附件。

我建议您看一下spine-unity unitypackage随附的“ Spine示例/其他示例/ AtlasRegionAttacher”示例场景,并在“ FootSoldier” GameObject处检查“ AtlasRegionAttacher”脚本。

这个最近的论坛主题还涉及相同的主题(不幸的是英文):
Can there be "Modular Assets"?

这个较旧的线程可能对您也很有趣,因为它可以在运行时加载和卸载Spine资产(尽管这涉及更多的编码):
How to dynamically load/unload Skeleton Data Assets
-----
Please note that when using spine-unity, you can also attach Attachments from atlas assets that were not part of the original Spine project.

I can recommend to have a look at the Spine Examples/Other Examples/AtlasRegionAttacher example scene that comes with the spine-unity unitypackage, and check out the AtlasRegionAttacher script at the FootSoldier GameObject.

This recent forum thread also deals with the same topic (unfortunately in English):
Can there be "Modular Assets"?

This older thread might also be interesting for you, as it deals with loading and unloading Spine assets at runtime (this involves more coding though):
How to dynamically load/unload Skeleton Data Assets
头像
Harald

Harri
  • 帖子: 2585

whiteye11

---

Harald 写道:请注意,在使用spine-unity时,您还可以附加来自原始Spine项目不包含的图集资产的附件。

我建议您看一下spine-unity unitypackage随附的“ Spine示例/其他示例/ AtlasRegionAttacher”示例场景,并在“ FootSoldier” GameObject处检查“ AtlasRegionAttacher”脚本。

这个最近的论坛主题还涉及相同的主题(不幸的是英文):
Can there be "Modular Assets"?

这个较旧的线程可能对您也很有趣,因为它可以在运行时加载和卸载Spine资产(尽管这涉及更多的编码):
How to dynamically load/unload Skeleton Data Assets
-----
Please note that when using spine-unity, you can also attach Attachments from atlas assets that were not part of the original Spine project.

I can recommend to have a look at the Spine Examples/Other Examples/AtlasRegionAttacher example scene that comes with the spine-unity unitypackage, and check out the AtlasRegionAttacher script at the FootSoldier GameObject.

This recent forum thread also deals with the same topic (unfortunately in English):
Can there be "Modular Assets"?

This older thread might also be interesting for you, as it deals with loading and unloading Spine assets at runtime (this involves more coding though):
How to dynamically load/unload Skeleton Data Assets
感谢回复,但不是很符合我的需求。这边是由一个包含通用骨骼和通用动画的spine工程,加上几十个保护纹理数据和slot数据的spine工程,然后在游戏运行中组合生成一个skeletonAnimation。这边测试发现,如果替换掉skeleton.slots,动画播放会异常。
whiteye11
  • 帖子: 4

Harald

我是否正确理解您想要将动画分离到单独的项目中并作为单独的.json(或.skel.bytes)文件导出的信息?

该主题已在论坛上进行了简要讨论:
请问Spine用脚本载入时怎么才能不载入图集只取动画

基本上,我在这里看到两个选项:
1)将动画导入每个角色,然后将其导出。 不幸的是,尚不支持通过Spine命令行界面从项目中导入动画。 它计划用于Spine 4.1,可在此发行通知下进行跟踪:
https://github.com/EsotericSoftware/spine-editor/issues/379
2)您可以编写自定义加载代码,以加载仅包含动画的 SkeletonData,然后将动画附加到角色骨架上。 如上面论坛线程中所述,您必须确保骨骼索引,附件索引等匹配。 当您不修改骨架骨骼,插槽等而仅添加动画时,应该是这种情况。
-----
Did I understand you correctly that you want to separate Animations into separate Projects and exported as separate .json (or .skel.bytes) files?

This topic has been discussed here on the forum briefly:
请问Spine用脚本载入时怎么才能不载入图集只取动画

Basically I see two options here:
1) Importing animations to each character, then exporting it. Unfortunately importing animations from a project is not yet supported via the Spine command line interface. It is planned for Spine 4.1, it's tracked under this issue ticket: https://github.com/EsotericSoftware/spine-editor/issues/379
2) You can write custom loading code that loads the animation-only SkeletonData and then append the animations to a character skeleton. As noted in the forum thread above, you have to make sure that the bone indices, attachment indices, etc match up. This should be the case when you don't modify the skeleton bones, slots, etc and only add an animation.
头像
Harald

Harri
  • 帖子: 2585

whiteye11

Harald 写道:我是否正确理解您想要将动画分离到单独的项目中并作为单独的.json(或.skel.bytes)文件导出的信息?

该主题已在论坛上进行了简要讨论:
请问Spine用脚本载入时怎么才能不载入图集只取动画

基本上,我在这里看到两个选项:
1)将动画导入每个角色,然后将其导出。 不幸的是,尚不支持通过Spine命令行界面从项目中导入动画。 它计划用于Spine 4.1,可在此发行通知下进行跟踪:
https://github.com/EsotericSoftware/spine-editor/issues/379
2)您可以编写自定义加载代码,以加载仅包含动画的 SkeletonData,然后将动画附加到角色骨架上。 如上面论坛线程中所述,您必须确保骨骼索引,附件索引等匹配。 当您不修改骨架骨骼,插槽等而仅添加动画时,应该是这种情况。
-----
Did I understand you correctly that you want to separate Animations into separate Projects and exported as separate .json (or .skel.bytes) files?

This topic has been discussed here on the forum briefly:
请问Spine用脚本载入时怎么才能不载入图集只取动画

Basically I see two options here:
1) Importing animations to each character, then exporting it. Unfortunately importing animations from a project is not yet supported via the Spine command line interface. It is planned for Spine 4.1, it's tracked under this issue ticket: https://github.com/EsotericSoftware/spine-editor/issues/379
2) You can write custom loading code that loads the animation-only SkeletonData and then append the animations to a character skeleton. As noted in the forum thread above, you have to make sure that the bone indices, attachment indices, etc match up. This should be the case when you don't modify the skeleton bones, slots, etc and only add an animation.
差不多,其实是希望骨骼,动作,皮肤,都单独导出成一个二进制文件。或者spine-unity中能否提供二进制的写入方法,由我们自行去实现这种功能
whiteye11
  • 帖子: 4

Harald

恐怕我不能完全理解您的帖子(很可能自动翻译无法正确翻译所有内容)。

无论使用.json还是二进制.skel.bytes导出,都可以相同地导入它们。 从任何格式加载后,必须将加载的动画数据附加到角色的骨骼数据中。

如果这不是您的意思,请用更多的文字描述您想要实现的目标。
-----
I'm afraid I don't completely understand your posting (most likely automatic translation failed to translate everything correctly).

It does not matter whether you are using .json or binary .skel.bytes export, you can import them just the same. After loading from any format, you have to append the loaded animation data to your character's skeleton data.

If this is not what you mean, please describe in more words what you want to achieve.
头像
Harald

Harri
  • 帖子: 2585


回到 中国Spine用户