1. sayfa (Toplam 1 sayfa)
dinhhai
Hi, after adjust skeleton (in spine-ts), can we export Json file from spine.Skeleton or convert spine.SkeletonData to Json? Thank you.
Bu mesaja eklenen dosyaları görüntülemek için gerekli yetkilere sahip değilsiniz.
1 year ago
- dinhhai
- Mesajlar: 4
Mario
No, that is not possible I'm afraid and we have no plans to add this functionality. What are you trying to achieve? What is your use case?
1 year ago
-
Mario - Mesajlar: 3283
dinhhai
Hi @Mario, I adjusted bones and changed skins, I want to keep current pose by saving JSON for each pose.Mario yazdı:No, that is not possible I'm afraid and we have no plans to add this functionality. What are you trying to achieve? What is your use case?
1 year ago
- dinhhai
- Mesajlar: 4
Mario
If you are using AnimationState, there's no reason tomsave out the poses. See our dress-up example here:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-webgl/example/dress-up.html#L112
If you programmatically modify one or more bones, you can simply save their transform:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-core/src/Bone.ts#L53
You can iterate all bones in the skeleton via
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
Once you are done modifying the skeleton, i.e. skin changes and set to setup pose, you can apply the
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-webgl/example/dress-up.html#L112
If you programmatically modify one or more bones, you can simply save their transform:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-ts/spine-core/src/Bone.ts#L53
You can iterate all bones in the skeleton via
skeleton.bones
and save out their transforms (which are just properties) via Object.assign()
to temporary objects:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
Once you are done modifying the skeleton, i.e. skin changes and set to setup pose, you can apply the
AnimationState
and the saved transforms again. 1 year ago
-
Mario - Mesajlar: 3283
dinhhai
Cool. Thank you @Mario
1 year ago
- dinhhai
- Mesajlar: 4
Mark topic unread
• 1. sayfa (Toplam 1 sayfa)
Dön Runtimes
- Tüm zamanlar UTC