我有一个角色,他的某个动画A中会将剪裁附件激活从而进行一段效果的呈现,这个效果在Spine中表现的很好,但是在导入Unity之后,当我从该角色的另一个动画过渡到这个动画A的时候,其他的一切都表现正确,唯独剪裁内部的对象看不到了,请问这个有可能是什么原因导致的。
我目前毫无头绪,也暂时无法提供更多的线索
我有一个角色,他的某个动画A中会将剪裁附件激活从而进行一段效果的呈现,这个效果在Spine中表现的很好,但是在导入Unity之后,当我从该角色的另一个动画过渡到这个动画A的时候,其他的一切都表现正确,唯独剪裁内部的对象看不到了,请问这个有可能是什么原因导致的。
我目前毫无头绪,也暂时无法提供更多的线索
ECG_Kinsey 我发现了新的问题,该角色的动画A需要两个图集进行配合表现,而在播放动画A之前的其他动画的时候,只需要一个图集,当从其他动画过渡到动画A的时候,SkeletonAnimation并没有正确的为MeshRender加载该动画所需的第二个材质,这应该是导致上述裁剪内部对象看不到的原因。
我过渡动画通过调用SkeletonAnimation的SetAnimation的方法,请问我是否遗漏了什么步骤所以导致切换动画的时候没有加载所有所依赖的材质
ECG_Kinsey 我找到原因了,是因为我没有设置除default以外的皮肤,当我设置其他皮肤后,这个问题就得到了解决。
但是为什么default皮肤的表现是异常的,我想知道这个原因,或者default皮肤的初始化逻辑有啥不同呢
ECG_Kinsey 我有一个角色,他的某个动画A中会将剪裁附件激活从而进行一段效果的呈现,这个效果在Spine中表现的很好,但是在导入Unity之后,当我从该角色的另一个动画过渡到这个动画A的时候,其他的一切都表现正确,唯独剪裁内部的对象看不到了,请问这个有可能是什么原因导致的。
我目前毫无头绪,也暂时无法提供更多的线索
I'm afraid I don't understand, or machine translation was incorrect. The whole point of clipping attachments is to clip (remove) anything that's outside the clipping area. Please always share at least a screenshot which shows your expected result and what you are actually receiving, otherwise it's very hard to help.
Also, which version of the Spine Editor are you using?
Which exact version of the spine-unity runtime (name of the unitypackage, also listed in Assets/Spine/version.txt
or version in the Package Manager) are you using?
Always be sure you're using the latest spine-unity unitypackage, as it may be a bug which has already been fixed.
From your other posts, perhaps you're using skin bones and have via one or more disabled skin-bones also disabled attachments which are relevant for clipping.
ECG_Kinsey ECG_Kinsey 我发现了新的问题,该角色的动画A需要两个图集进行配合表现,而在播放动画A之前的其他动画的时候,只需要一个图集,当从其他动画过渡到动画A的时候,SkeletonAnimation并没有正确的为MeshRender加载该动画所需的第二个材质,这应该是导致上述裁剪内部对象看不到的原因。
我过渡动画通过调用SkeletonAnimation的SetAnimation的方法,请问我是否遗漏了什么步骤所以导致切换动画的时候没有加载所有所依赖的材质
SkeletonAnimation
should always display all atlas pages automatically depending on active attachments. Also, there is no loading of atlas pages involved at runtime, all pages are loaded together with the SkeletonDataAsset
when your skeleton is loaded. Could you please again show a screenshot of what you're expecting to see, and what incorrect atlas pages you get instead? Please show a screenshot of the scene result as well as of the SkeletonAnimation
in the Inspector, including the active Materials.
ECG_Kinsey ECG_Kinsey 我找到原因了,是因为我没有设置除default以外的皮肤,当我设置其他皮肤后,这个问题就得到了解决。
但是为什么default皮肤的表现是异常的,我想知道这个原因,或者default皮肤的初始化逻辑有啥不同呢
The default skin works no different than other skins in regards to clipping and atlas pages. I guess that you're using skin bones and are accidentally via a disabled skin-bone disabling attachments that you did not intend to disable.
Harald
Spine版本:4.2.29Professional
Unity版本:2022.3.21f1
Spine-Unity版本:spine-unity-4.2-2024-06-20
同一个对象的同一个动画,当我切换为default皮肤的时候,MeshRender中只加载了其中一个材质
而当我切换为其他皮肤的时候,MeshRender中正确加载了所需的全部材质
上述问题中,裁剪的对象看不到的原因就是在Default皮肤的情况下,裁剪对象所在的材质并未被正确加载
所以我想知道default皮肤和其他用户自定义皮肤的区别
ECG_Kinsey Spine版本:4.2.29Professional
Unity版本:2022.3.21f1
Spine-Unity版本:spine-unity-4.2-2024-06-20
Please note that you're using outdated versions where bugs have been fixed in the meantime.
The latest 4.2 Spine Editor version is 4.2.40.
The spine-unity 4.2 runtime you're using is also almost a year old with several bugs fixed in the meantime.
ECG_Kinsey 上述问题中,裁剪的对象看不到的原因就是在Default皮肤的情况下,裁剪对象所在的材质并未被正确加载
所以我想知道default皮肤和其他用户自定义皮肤的区别
Your assumption is likely incorrect, the Materials are only assigned if an attachments is enabled which requires the respective atlas page texture. If your default skin has no attachment enabled which requires a region of the atlas page with suffix _4
, it won't be assigned at any submesh.
Note that they are always loaded. Perhaps this is a translation issue, "loaded" vs "assigned at a submesh".
Does your mesh display an incorrect atlas page at some triangles? Or does it display any empty triangles when using wireframe-shaded view in the Scene window?
What does the Skeleton Debug
window show you under enabled attachments, are there any requiring atlas page _4
?
Harald 这个问题我想我可能找到了原因,可能是皮肤的设置导致的,我现在的情况和下面图片中的情况一致
Skeleton Debug工具中可以看到,在使用default皮肤的时候,裁剪区域内的对象不可见是因为对应的插槽下面都没有附件
这个问题在我切换为我自定义的皮肤的时候就能得到解决
我想知道在Spine编辑器中,当我取消激活所有的自定义皮肤之后,Spine编辑器预览的内容是否正是default皮肤的内容
另外关于Spine的版本问题,由于项目有了一定体量,所以我们对于升级版本较为慎重,出于对项目稳定性的考虑
ECG_Kinsey 这个问题我想我可能找到了原因,可能是皮肤的设置导致的,我现在的情况和下面图片中的情况一致
Skeleton Debug工具中可以看到,在使用default皮肤的时候,裁剪区域内的对象不可见是因为对应的插槽下面都没有附件
Glad to hear you've figured it out.
ECG_Kinsey 我想知道在Spine编辑器中,当我取消激活所有的自定义皮肤之后,Spine编辑器预览的内容是否正是default皮肤的内容
Yes, in the Spine Editor if you set no skin as active, you see what's the default skin at runtime.
Please make sure both your artists and programmers are familiar with how Skins work in Spine and how to set them up to achieve your goals. This requires coordination and planning. Otherwise you will run into many issues down the road.
ECG_Kinsey 另外关于Spine的版本问题,由于项目有了一定体量,所以我们对于升级版本较为慎重,出于对项目稳定性的考虑
This is absolutely valid. Just be aware that you may be missing bugfixes.