- Modifié
Unityでループ再生した場合のスケルトンリロードについて
UnityでSpineを再生しています。
Obj.GetComponent<SkeletonAnimation>().state.SetAnimation(10, Anim, Loop);
で再生しているのですが、正常に同じアニメーションをループしません。
回転か、スケールの情報が引き継がれてしまうようです。
別のアニメーションを呼び出した時も情報が引き継がれてしまうので、
引き継ぎをしないで、「デフォルトの状態から再生する」方法を教えてください。
スクリーンショットのリロードをコード上で押す方法とか良い知恵をください。
忙しい中お手数ですがよろしくおねがいします。
それは意図的な動作と思います.. キーしていませんなのなら何もしなくて続きます
そのSetAnimationの前に state.SetEmptyAnimation(10, 0) はどうですか?
(.Skeleton.SetToSetupPose(); もあるけど 結果が同じかも?)
謝罪する必要はありません。
No need to apologize.
どのバージョンのSpineエディタとSpine-Unityランタイム(unitypackageの名前)を使用していますか?
一般に、キーフレームの残りのスケールまたは回転値は、次のループ反復に影響を与えるべきではありません。
Which version of the Spine Editor and the Spine-Unity runtime (the name of the unitypackage) are your using?
In general, there should not be any leftover scale or rotation values of keyframes affecting the next loop iteration.
意図的にトラック10のアニメーションを再生していますか?
他のトラック(トラック0〜9)のアニメーションがスケール/回転を変更しているのでしょうか。
これは、ループするアニメーションだけを再生し、他のトラックで他のアニメーションを再生しない場合にも発生するかどうかを試すことができます。
Are you intentionally playing the animation on track 10?
Could it be that animations on other tracks (track 0-9) are modifying scale/rotation?
You can try if this also happens when only playing the looping animation and no other animations on other tracks.
多分私はあなたの質問を誤解しました:
Maybe I misunderstood your question:
- 同じトラックから(たとえば、トラック10のアニメーションの終わりから、次のループの繰り返しの開始に影響を与えるまでの)残りのスケールや回転があってはいけません。
- トラック10にスケール/回転キーフレームがない場合、他のトラック(0-9など)のキーフレームはスケール/回転に影響します。これは意図的な動作です。
- There should be no leftover scale/rotation from the same track (e.g. from the end of animation on track 10 affecting the beginning of the next loop iteration).
- Keyframes on other tracks (e.g. 0-9) will affect scale/rotation if there is no scale/rotation keyframe on track 10. This is intended behaviour.
あなたの場合あなたは上記のどれを見ますか?
Which of the above do you see in your case?
お二方、ご回答ありがとうございます。
アニメーションの前に
state.SetEmptyAnimation(10, 0)
.Skeleton.SetToSetupPose()
共に試しましたが、状況は変わらず、ダメでした。
バージョンに関しては
SpineVer
3.7.94
Spine-Unityランタイムは
「This Spine-Unity runtime works with data exported from Spine Editor version: 3.7.xx」
と記載されているものを使っています。
トラック10を利用しているのは意図的になります。
ただ、1~9も、11以降も使っておらず、トラック10のみで使用しているので、別のアニメーションが動作をしているということはないと思います。
「最初は右を向いていて、アニメーションの途中で左を向く」アニメーションをループ再生場合、2回目以降のアニメーションは最初から左を向いているなどの症状が出てしまっております。
前回再生時のボーンの影響を受け継いでしまっていると思うのですが……なにかわかりますでしょうか。
どういたしまして。
You're welcome.
Spine-Unityランタンタイムは
「このSpine-Unityランタイムは、Spine Editorのバージョン3.7.xxからエクスポートされたデータで動作します」
と記載されているものを使っています。
以下のversion.txtファイルに行が表示されますか
This Spine-Unity runtime works with data exported from Spine Editor version: 3.7.xx
このような:
Package version: spine-unity-3_7-2019-06-17.unitypackage
この行がない場合は、その間にいくつかのバグが修正されたので、プロジェクトのバックアップを作成してunitypackageを更新してみてください。
Do you see a line in the version.txt file below
This Spine-Unity runtime works with data exported from Spine Editor version: 3.7.xx
like this:
Package version: spine-unity-3_7-2019-06-17.unitypackage
If this line is not there, then you could try making a backup of your project and updating the unitypackage, as some bugs have been fixed in the meantime.
「最初は右を向いていて、アニメーションの途中で左を向く」アニメーションをループ再生場合、2回目以降のアニメーションは最初から左を向いているなどの症状が出てしまっております。
In the case of looping an animation that "First turns to the right and turns to the left in the middle of the animation", the second and subsequent animations have symptoms such as pointing to the left from the beginning.
あなたのセットアップポーズはどのようなものですか? アニメーションと一緒に適用されているのはセットアップポーズなのでしょうか。
What does your setup pose look like? Could it be that it's the setup pose that is being applied together with your animation?
あなたはまだcontact@esotericsoftware.comにzipファイルとしてあなたの問題を示している最小限のプロジェクトを我々に送ることができます、それから我々は見ることができます。
You can send us a minimal project that still shows your problem as a zip file to contact@esotericsoftware.com, then we can have a look.
ありがとうございます!
指摘してもらった通り、最新のunitypackageに更新しました!
07-10Updateのものに更新したら、問題になっていたことが解決されました!
どう直せばよいか見当が付かず、凄く困っていましたので、とても助かりました!
Haraldさん、すごく感謝します!ありがとうございます!
それが今動作することを聞いてとてもうれしいです! お知らせいただきありがとうございます。
Very glad to hear that it works now! Thank you very much for letting us know!