Spine U3D整合流程问题

What:

公司2d项目开发,动画外包的spine。本来在spine里面一切正常,但是导入u3d运行库的时候动画切换的时候原来的动画是好的,一旦切换了就乱帧了。

如下结果:

Why:


看了一上午资料,发现了来自官网的解释,恍然大悟:

If no key is set at all for a value, the animation won't change that value. In Spine the skeleton is always reset to the setup pose before an animation is applied. This means if no key is set then skeleton will have the value from the setup pose.

At runtime, the programmer decides if the skeleton will be reset to the setup pose before applying an animation. If not, it means that if no key is set then the skeleton will keep whatever value was set last.

For an example where this can be beneficial, an animation is used make a sword attachment visible for the weapon slot. The sword attachment will remain visible even when subsequent animations are played.

For an example where this can be undesirable, an animation rotates the root bone and leaves it at 45 degrees. The next animation plays and doesn't key the root bone, so the root bone is still rotated 45 degrees. Even if the first animation ended with the root bone rotation at zero, the same situation could occur if the first animation ended prematurely because another animation was played.

One solution to this is to key every value at frame 0 for every animation. This is tedious for the animator. It is also inefficient at runtime because every value will get set every time the animation is applied (usually 60 times per second). Each value that is keyed has a small cost which is usually negligible (attachment keys slightly more than others). When all values are keyed the costs add up and may be an issue if there are many skeletons being animated on-screen at once.

It is most efficient to have the programmer reset the skeleton's bones to the setup pose before applying an animation. For attachments, the programmer could reset some or all of the slots to the setup pose when an animation changes.

看了一下 ComparePorject/has_error/spine 工程,果然是这个原因

这根骨骼在冲锋动画初始的时候k了flip 然后在别的动画的时候没有重新K这个flip

How:

SkeletonAnimation.cs:

public String AnimationName {
get {
TrackEntry entry = state.GetCurrent(0);
return entry == null ? null : entry.Animation.Name;
}
set {
if (_animationName == value)
return;
_animationName = value; this.Reset(); if (value == null || value.Length == 0)
state.ClearTrack(0);
else
state.SetAnimation(0, value, loop);
}
}

关于我的spine的学习笔记我都统一在git 公共云上记录

oschina : https://git.oschina.net/daao/SpineLearnNote.git

github : https://github.com/daaoling/SpineLearnNote.git

最新文章

  1. .Net Core CLI windows安装
  2. git使用记录
  3. Gson简要使用
  4. Linux下cron的使用
  5. volley(2) 参数code : or_barcode, pr_ismsd:false , method:GET
  6. Android 高仿豌豆荚 一键安装app 功能 实现
  7. (CodeForces 510C) Fox And Names 拓扑排序
  8. Android 常用网站
  9. Windows无需CygWin 使用NDK开发
  10. javascript笔记整理(事件)
  11. 基于visual Studio2013解决面试题之0303数组求和
  12. OpenCV在矩阵上的卷积
  13. ECJTUACM16 Winter vacation training #5 题解&源码
  14. 带着新人学springboot的应用09(springboot+异步任务)
  15. typecho视频播放插件JWPlayer
  16. python爬虫之初始scrapy
  17. Python学习笔记-解释器和中文编码
  18. A Statistical Model for Scientific Readability-paper
  19. 洛谷P1063 能量项链(区间DP)(环形DP)
  20. [django]django查询最佳实战

热门文章

  1. DRF的认证与权限功能
  2. IOS UITableViewUITableView小技巧--实现cell向左滑动删除,编辑等功能
  3. vue学习记录:vue引入,validator验证,数据信息,vuex数据共享
  4. Django基础之路由系统
  5. (一)mysql基础和安装mysql5.7
  6. (一)安装openvpn服务器端
  7. HDU 多校1.4
  8. 8、Django实战第8天:session和cookie自动登录机制
  9. [HNOI2018]道路(DP)
  10. POJ 2082 Terrible Sets(单调栈)