-
Notifications
You must be signed in to change notification settings - Fork 2k
[Spine] **供官方参考** 修复迄今为止我反馈的所有spine的 bug. #18638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
finscn
wants to merge
19
commits into
cocos:v3.8.7
Choose a base branch
from
finscn:patch-26
base: v3.8.7
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+81
−56
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
导出 addAnimation 方法
- 添加 addAnimation() 方法; - 删除多余的 _animState->clearTracks(); - 删除多余的 _skeleton->setToSetupPose(); - 删除多余的 _skeleton->updateWorldTransform()
在头文件中添加 addAnimation() 方法的声明
- 统一 setAnimation() 和 addAnimation() 中 判断 animation 是否存在的 逻辑 - 通过新增的 this._instance!.addAnimation() 方法来调用原生的相关逻辑.
- 为 addAnimation() 方法添加 _state->apply(*_skeleton); - 删除 多余的(错误的) setToSetupPose() 调用
删除多余的(错误的) setSlotsToSetupPose() 调用
导出 addAnimation() 方法
确保构建时, 可以通过命令行的 -D 进行传参. 不添加 `CACHE STRING` , 无论-D 后面怎么写, 构建时还是以 文件里写的为准.很不方便.
必须使用 ``` emcmake cmake .. -G "Ninja" ``` 你们官方本机不需要加 -G "Ninja" , 可能是因为你们的机器里之前执行过 `emcmake cmake .. -G "Ninja"`
- 修改 调用update(0) 的逻辑, 通过标志位来延迟调用. - 修正 计算 loopCount 时的 bug. - 在 updateAnimation() 中添加 markForUpdateRenderData() - 添加 /* global globalThis */ 注释, 避免开发工具中报错
同步 upstream .
添加 addAnimation() 方法的声明
添加 ``` // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values ``` 解决 枚举对象 TextureFilter 中有重复值的问题. 这里的重复值 是否可以去掉 ? @bofeng-song @dumganhar
6 tasks
event 不存在时, 不执行 emitListener() 和 emitTrackEntryListener() 中的逻辑.
6 tasks
前一个提交存在 bug ,撤销.
将 clearAnimation 和 setToSetupPose 解耦.
之前的计算方式有错误.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: #
此 PR 并不奢望官方合并 , 只是提供参考.
从我开始用 cocos 3.x , 迄今为止, 反馈了大概 十几个 spine 的bug (有些 bug 的诱因可能是同样的).
经过最近一段时间通宵达旦的研究和学习, 我在自己的自定义引擎里, 尝试解决了目前我自己遇到的所有问题.
期间也合并了官方 一些关于的 spine PR (截止到 上周的 #18581)
最终整理出了这个 PR, 希望能帮助官方解决更多的 spine 的bug.
我的这些方案可能治标不治本 或者 会引出新的 bug.不敢保证百分百正确.
但是至少目前我们的项目运行还 ok .
注意 我们使用的是3.8, 4.2下没有测试, 而且没有使用 缓存模式.
所以 Cache相关的代码都没有改动过.所以我的这个 PR 可能在 4.2 或者 cache模式下有bug.
补充说明:
我们的项目是一个移植项目, 把一个原版用 c++自研引擎的游戏 用cocos 重写.
该项目重度依赖spine 3.8 , spine 动画数量700多个, 而且用法比较复杂, 各种融合、动态换肤、多track 同时播放、自定义播放顺序,自定义播放区间, 倒放, 变速播放 等等。
所以 我可能确实会遇到一些别人不太会遇到的 bug.
处于保密协议等原因, 有些 bug 我也很难提供重现 demo.
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: