• 日本語
  • 出力したJSONのスキン名を変更して読み込ませるとエラーが発生する

Related Discussions
...
14 jours plus tard

毎度お世話になっております。
今回は出力したJSONに問題が発生したため、お問い合わせさせていただきました。

これは特定のスケルトン(JSON)だけ発生します。
手順は以下の通りになります。

  1. SpineプロジェクトからJSONを出力(スキンはdefaultのみ)
  2. テキストエディタで"skins"の"default"を"test"に変更して保存する
  3. 変更したJSONをSpineエディタにドラッグで読み込ませる
  4. エラーが発生して読み込まれないというダイアログが表示される

他のスケルトンのJSONで同様の事を行っても問題なくエディタにロードされるので、
スキン名を変えただけでは、JSONファイルが破損するわけではないようです。
また、skins名を変更せずに、出力したJOSNをそのまま読み込ませる場合、エラーは発生しません。

JSONからディレクトリ構造にしたがってスキンを自動生成する自作のPythonスクリプトを実行させたところ、
1つだけうまく動かないスケルトンがあり、調べたところ上記手順で問題が発生する事がわかりました。

このような問題が発生した場合の解決策がありましたら、お教えいただけないでしょうか。
よろしくお願いいたします。

Spine Pro ver3.6.52


If you change the skin name of the output JSON and load it, an error will occur

thanks for the care from you every time.
Since problems occurred in the output JSON this time, I contacted you.

This happens only for certain skeletons (JSON).
The procedure is as follows.

  1. Output JSON from Spine project (skin only default)
  2. In the text editor, change "default" of "skins" to "test" and save
  3. Drag the modified JSON into the Spine editor by dragging
  4. A dialog saying that an error occurred and can not be loaded appears

Even if you do the same thing with other skeleton's JSON, it loads into the editor without problem,
Just changing the skin name does not seem to corrupt the JSON file.
Also, if you do not change the skins name and you want to load the output JOSN as it is, no error will occur.

When I made my own Python script that automatically generated skins according to the directory structure from JSON,
There was a skeleton that only one did not work, and when I examined it turned out that the problem occurred in the above procedure.

If there is a solution in case of such a problem, would you please teach me?
Thank you.


Before exporting, there was a possibility that we could tamper with the path string with regular expression, so the output JSON may not have been normal. :whew:
As we could deal with this problem manually, if you have any problems, I would like to contact you.


エクスポートする前に正規表現でパスの文字列をいじった可能性があったので、出力されたJSONが正常ではなかったかもしれません。
本件に関しては手動で対応出来たので、また何か問題がありましたらお問い合わせさせていただきたく存じます。

In the JSON data the skin named "default" is special: it gets loaded as SkeletonData defaultSkin. Any other skin name will be fine. The "default" skin contains attachments which are not under skin placeholders in the editor.

JSONデータでは、「default」という名前のスキンは特別です:SkeletonData defaultSkinとしてロードされます。 他の肌の名前は問題ありません。「default」スキンには、エディタのスキンプレースホルダの下にない添付ファイルが含まれています。

原因が判明しました。
それは"animations"の"Deform"のkeyが"default"のままでした。

頂点アニメーションのキーフレームが打ってあるJSONを見たところ、
"Deform"はスキン単位で保持していたので、そのまま出力した場合は"default"になっていました。

デフォームが存在しないデフォルトのスキンを読もうとして、エラーが発生します。
スキン名を変えた場合はデフォーム名も変更しなければなりませんでした。

これは、私がSpineの構造を正しく把握していなかった事で起きた問題でした。
お騒がせしました。


The cause was found out.
That was the key of "Deform" of "animations" was "default".

When I saw JSON with keyframes of vertex animation,
"Deform" was kept in skin unit, so if you output it as it is it was "default".

An error occurs when trying to read the default skin without deform.
If you changed the skin name, you had to change the deform name as well.

This was a problem that occurred because I was not grasping the structure of Spine correctly.
I'm sorry for confusing you.