Spine U3D整合流程问题
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
Spine U3D整合流程问题的更多相关文章
- ssm框架搭建和整合流程
Spring + SpringMVC + Mybatis整合流程 1 需求 1.1 客户列表查询 1.2 根据客户姓名模糊查询 2 整合思路 第一步:整合dao层 ...
- FreeMarker与SSH项目整合流程
FreeMarker与SSH项目整合流程 学习了SSH之后,一般为了减少数据库的压力,会使用FreeMarker来生成静态HTML页面.下面简单说一下FreeMarker与SSH项目的整合全过程~ 前 ...
- Dubbo与SpringBoot整合流程(从实例入手,附代码下载)
场景 Dubbo环境搭建-管理控制台dubbo-admin实现服务监控: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10362 ...
- Spring+Struts2+Hibernate框架整合流程
一:基本步骤 新建Maven项目,导入相关依赖(推荐) 在WEB-INF的web.xml中进行配置 ————–Hibernate配置 —————- 创建entity包,创建数据库相关实体类 根据实体类 ...
- Spring+SpringMVC+Mybatis框架整合流程
一:基本步骤 新建Maven项目,导入相关依赖.(推荐) ————–Mybatis配置 —————- 新建entity包,并根据数据库(表)新建相关实体类. 新建dao包,并根据业务创建必要的mapp ...
- SSM三大框架详细整合流程
1.基本概念 1.1.Spring Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java 开发框架,由Rod Johnson 在其著作Expert One-On-One ...
- JAVA SSM整合流程以及注意点
1.搭建整合环境 整合说明:SSM整合可以使用多种方式,咱们会选择XML + 注解的方式 先搭建整合的环境 先把Spring的配置搭建完成 再使用Spring整合SpringMVC框架 最后使用Spr ...
- 01-vue和api整合流程、CORS
1.后端代码 1.项目结构 2.项目代码 主url from django.contrib import admin from django.urls import path, include url ...
- S2SH三大框架整合(配置及思想)
花了一下午,终于将struts2.18+hibernate3.5.6+spring2.5.5进行整合,完成功能:在Oracle数据库的TCourse表中插入一条数据. Ⅰ,整合流程:web启动———— ...
随机推荐
- django自带的orm之查询
一.filter条件查询 用法: 模型类.objects.filter(模型类属性名__查询操作符 = 值) 判等: exact # 例:查询id为1的员工 select * from employe ...
- 《Java编程思想》笔记 第二十章 注解
1.注解 注解也称元数据,是在代码中添加信息的一种方式添加的信息提供给编译器或者工具类框架使用. SE5引入,可以提供用来完整描述程序所需要的信息,往往这些信息是无法用Java来表达的. 注解可以在编 ...
- redis 数据类型的使用场景
value为对应的数据类型. String 应用场景: String是最常用的一种数据类型,普通的key/value存储都可以归为此类,value其实不仅是String,也可以是数字. Hash 应用 ...
- python 判断平年还是闰年
while 1: s = input('请填入一个年份:') s = int(s) year = False if s % 100 == 0 and s % 400 == 0: year = True ...
- python算法:LinkedList(双向线性链表)的实现
LinkedList是一个双向线性链表,但是并不会按线性的顺序存储数据,而是在每一个节点里存到下一个节点的指针(Pointer).由于不必须按顺序存储,链表在插入的时候可以达到O(1)的复杂度,比另一 ...
- vs code 体验
今天用了一下 vs code, 第一感觉非常棒.用过 sublime text 和 vs 的经验.对vs code有一种曾相识的感觉. 在界面体验上,比目前用的 sublime text的感觉要好,比 ...
- AC日记——[SCOI2012]喵星球上的点名 bzoj 2754
2754 思路: AC自动机暴力处理匹配: 强大的ac自动机,强大的fail树,强大的map,强大的vector,强大的指针: 代码: #include <map> #include &l ...
- CodeForces 669B
链接:http://codeforces.com/problemset/problem/669/B 本文链接:http://www.cnblogs.com/Ash-ly/p/5443086.html ...
- Spring中BeanFactory和ApplicationContext的区别
1. BeanFactory负责读取bean配置文档,管理bean的加载,实例化,维护bean之间的依赖关系,负责bean的生命周期. 2. ApplicationContext除了提供上述BeanF ...
- 【旋转卡壳】poj3608 Bridge Across Islands
给你俩凸包,问你它们的最短距离. 咋做就不讲了,经典题,网上一片题解. 把凸包上的点逆时针排序.可以取它们的平均点,然后作极角排序. 旋转卡壳其实是个很模板化的东西…… 先初始化分别在凸包P和Q上取哪 ...