diff options
| author | yum <yum.food.vr@gmail.com> | 2023-09-10 18:11:08 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2023-09-10 18:11:08 -0700 |
| commit | 4f3b9382068a29731de664eb0810f9eb3a267905 (patch) | |
| tree | d63d6755a42dc14013fd62bcbfcb077186b0fc66 /Scripts/libtastt.py | |
| parent | 3db7723aa5c16358f73e3e8d3bb20a959ce43d5d (diff) | |
Bugfix: eliminate dead-end in certain animator layers
Because the custom chatbox doesn't necessarily have an even multiple of
`sync_params` character slots, some layers in the animator write N
character slots while others write N-1. In the layers with only N-1
slots, they need something to do while slot N is being selected. This
patch creates a return-home transition in that case.
Diffstat (limited to 'Scripts/libtastt.py')
| -rw-r--r-- | Scripts/libtastt.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Scripts/libtastt.py b/Scripts/libtastt.py index 5e216ca..4b4dda9 100644 --- a/Scripts/libtastt.py +++ b/Scripts/libtastt.py @@ -761,7 +761,16 @@ def generateFXLayer(which_layer: int, anim: libunity.UnityAnimator, layer: dummy_param = generate_utils.getDummyParam() anim.addTransitionBooleanCondition(state, home_state_transition, dummy_param, False) - pass + + if generate_utils.config.layerNeedsParity(which_layer): + # There may be layers which never write to the text box. In this case, + # when those layers are turned on to write to that last region, they + # simply transition back to the default (idle) state. + home_state_transition = anim.addTransition(default_state) + select_param = generate_utils.getSelectParam() + i = generate_utils.config.numRegions(0) - 1 + anim.addTransitionIntegerEqualityCondition(active_state, + home_state_transition, select_param, i) # Generic toggle adding utility. # Generates the layer and parameter. |
