FloatFluctuationDetector / Floatの変化を検出するアニメーターギミック
- 0 JPY
アニメーターで遊んでいるときに作ったものをついでに配布しておきます。あくまでも見本であり、直接使うことは想定しておりませんので不親切な内容物になっています。 特定のFloatパラメーターが変化している間だけIsFluctuationパラメーターを1にする…という、なにかに使えるかもしれない検出ギミックです。4枚目の画像で仕組みを解説しておりますが、画像が小さいので保存して各々で拡大してご利用ください。どちらかというと黒魔術的なことをしたい方にむけたギミックだと思います。 用途としては、たとえば、TemporaryPoseSpaceを用いてアバターの高さ変更等を行う場合、高さ調整用のラジアルメニューにBoolパラメーターを追加しておけば、メニューを開いている間だけTrueになり、Trueの間だけ視点更新をループさせることでシームレスな高さ調整を行うという黒魔術的手法があります。が、実はこれではメニューを閉じ忘れたり、バグでTrueになり続けるケースがあり、不要に視点更新がループしてしまいます。とくに、ループさせるステートにTrackingControlがあればどんどん重くなります。そこで、本ギミックを用いれば、メニューを実際に動かしている間以外はループを止める事ができます。 そのほか、ラジアルメニューのようにFloatを動的に変化させる場合以外にも、たとえばIntのようにスイッチ代わりとしてFloatを使用する際、スイッチを切り替えたかどうかを検出することが可能です。別配布しているEmoteCollectorの場合、BlendTreeでエモートの切り替えを行っていますが、ステートの遷移をはさむことなくBlendTree内のみで切り替えを行うと、途中からモーションが再生されてしまいます。そこで、エモートを切り替えるたびに一瞬だけステートを遷移させてリロードするためにこの手法を用いています。 注意点として、このアニメーターではタイムラグをなくすためInterruptionSourceによって遷移の割り込みを行っていますが、実はこれがWD=Offと相性が悪い…という旨の情報を確認しました。ハッキリとそのメカニズムは理解しておりませんが、心配であればNoneにするか、HasExitTimeで待機時間をつける方式に改変して下さい。しばらく忙しいため、手が空いたら編集します。 ■雑記 バグや分からない箇所があればお答えしますが、対応の優先度はかなり低いです。また、本ギミックの改良版を作成された場合は、必須では有りませんがご連絡いただけると嬉しいです。ライセンス的な意味ではなく、参考にしたいので。 ■English About the fourth image. ①Proceed only in the case of local.The "IsLocal" parameter is not used.IsLocal parameters are registered in different formats, such as Float, Int, etc., depending on the gimmick. This confuses the automatic merge tool, so i dare to use our own parameters for discrimination. ②In states after Standby, a BlendTree for subtraction is set. In this BlendTree, FFD/Parameter - FFD/Copy is subtracted and the result is output to the FFD/Difference parameter. ③Using the ParameterDriver, copy the values of FFD/Parameter to FFD/Copy. Once the copy is made, the values of the two parameters will be the same and the result of the subtraction will be zero.However, if Float changes after being copied, a difference is created. If a difference is created, a transition is made to the next state. ④In this state, copying is again performed. Then set FFD/IsFluctuation to True. Immediately move to the next state. ⑤The copying in the previous state again eliminates the difference between the two parameters. If there is no difference, a transition to the next state is made. However, if the Float is manipulated again and a difference is created, it returns to the previous state and the copying is performed again. ⑥The transition takes 0.1 second. This value can be changed; it is a state to create a time lag between when the Float parameter stops operating and when the FFD/IsFluctuation value returns to False. This is a countermeasure to the fact that a short time lag would cause the transition between True and False to be very quick.Feel free to change it. As a point to note, this animator uses InterruptionSource to interrupt transitions in order to eliminate time lag, but we have confirmed information that this is actually incompatible with WD=Off. I do not understand the mechanism clearly, but if you are concerned, please set it to None or change the method to add a lag with HasExitTime.