summaryrefslogtreecommitdiffstats
path: root/osc_ctrl.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-10-02 17:24:17 -0700
committeryum <yum.food.vr@gmail.com>2022-10-02 17:24:17 -0700
commit9222e7e9a21704dd6083adf8f53ce4437ba64a74 (patch)
tree01edac9c00bfa46200a897ebf0a947006a20f13b /osc_ctrl.py
parent704fd9a64fb8a8b1e929700c3e7413f8c3aaa2c2 (diff)
Add 'Do Nothing' animation
Per the VRC docs, state behaviors may not execute if the total length of time in the state is < 0.02 seconds. Adding a 2-frame 'Do Nothing' animation to the top of every layer seems to help with stability. *shrug* More cleanup: * Generate a unique return-home transition for each terminal state instead of reusing the same one. * Use globally unique state names in animator. * All animations are at least 2 frames long.
Diffstat (limited to 'osc_ctrl.py')
-rw-r--r--osc_ctrl.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/osc_ctrl.py b/osc_ctrl.py
index fcb2445..8a7d41c 100644
--- a/osc_ctrl.py
+++ b/osc_ctrl.py
@@ -17,8 +17,9 @@ from generate_utils import NUM_LAYERS
from generate_utils import BOARD_ROWS
from generate_utils import BOARD_COLS
-#CELL_TX_TIME_S=1.0
-CELL_TX_TIME_S=0.6
+#CELL_TX_TIME_S=3.0
+CELL_TX_TIME_S=1.0
+#CELL_TX_TIME_S=0.7
def usage():
print("python3 -m pip install python-osc")
@@ -181,7 +182,7 @@ def splitMessage(msg):
if len(line) + len(" ") + len(word) <= BOARD_COLS:
line += " " + word
continue
-
+
print("append line {}".format(line))
lines.append(line)
line = word
@@ -198,7 +199,7 @@ def sendMessage(msg):
print("Encoded message: {}".format(msg))
- openBoard()
+ #openBoard()
n_cells = ceil(msg_len / NUM_LAYERS)
print("n_cells: {}".format(n_cells))
@@ -209,7 +210,7 @@ def sendMessage(msg):
print("Send cell {}".format(cell))
sendMessageCellDiscrete(cell_msg, cell)
- closeBoard()
+ #closeBoard()
def sendRawMessage(msg):
n_cells = ceil(len(msg) / NUM_LAYERS)
@@ -229,12 +230,12 @@ def openBoard():
addr="/avatar/parameters/" + generate_utils.getResize1Param()
client.send_message(addr, False)
- time.sleep(0.1)
+ time.sleep(0.3)
addr="/avatar/parameters/" + generate_utils.getResizeEnableParam()
client.send_message(addr, True)
- time.sleep(0.1)
+ time.sleep(0.3)
addr="/avatar/parameters/" + generate_utils.getResizeEnableParam()
client.send_message(addr, False)
@@ -257,6 +258,7 @@ def closeBoard():
if __name__ == "__main__":
generateEncoding(state)
+ #openBoard()
clear()
for line in fileinput.input():