summaryrefslogtreecommitdiffstats
path: root/generate_params.py
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-09-30 18:44:36 -0700
committeryum <yumfood@airmail.cc>2022-09-30 18:44:36 -0700
commit2fa5bc78b5c4500301327bd6a334ab4fb8e04a17 (patch)
treed03c01d929431320686d61f7091b96f6be3d14ca /generate_params.py
parent73bbba9de5210ae7f895ae82bd2524eb76e3a38c (diff)
Redo FX layer
Apparently the same avatar parameter can only be updated so quickly before VRChat starts dropping messages. So now we divide the board into "groups" of 8 characters. Each group can be updated relatively slowly, but all groups can be updated in parallel. Thus we can update the board group-by-group, pausing between each group. * Fix shader bugs - now there are Row05 parameters, and row00 refers to the topmost row instead of the bottom-most. * Remove outdated layer/group names files * Extend osc_ctrl.py to support encoding & sending messages * Add generate_params.py to handle creating TaSTT_params.asset * Add generate_utils.py for common code generation facilities & parameters.
Diffstat (limited to 'generate_params.py')
-rw-r--r--generate_params.py61
1 files changed, 61 insertions, 0 deletions
diff --git a/generate_params.py b/generate_params.py
new file mode 100644
index 0000000..665a439
--- /dev/null
+++ b/generate_params.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python3
+
+import generate_utils
+
+PARAM_HEADER = """
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: -1506855854, guid: 67cc4cb7839cd3741b63733d5adf0442, type: 3}
+ m_Name: TaSTT_params
+ m_EditorClassIdentifier:
+ parameters:
+"""[1:][0:-1]
+
+INT_PARAM = """
+ - name: %PARAM_NAME%
+ valueType: 0
+ saved: 0
+ defaultValue: 0
+"""[1:][0:-1]
+
+BOOL_PARAM = """
+ - name: %PARAM_NAME%
+ valueType: 2
+ saved: 0
+ defaultValue: 0
+"""[1:][0:-1]
+
+# We're working with an 84-character board, and each FX layer is responsible
+# for 8 of those characters.
+params = {}
+print(generate_utils.replaceMacros(PARAM_HEADER, params))
+
+# Implementation detail. We use this parameter to return from the terminal
+# state of the FX layer to the starting state.
+params["PARAM_NAME"] = "TaSTT_Dummy"
+print(generate_utils.replaceMacros(BOOL_PARAM, params))
+
+for i in range(0, generate_utils.NUM_LAYERS):
+ params["PARAM_NAME"] = generate_utils.getLayerParam(i)
+ print(generate_utils.replaceMacros(INT_PARAM, params))
+
+ params["PARAM_NAME"] = generate_utils.getSelectParam(i, 0)
+ print(generate_utils.replaceMacros(BOOL_PARAM, params))
+
+ params["PARAM_NAME"] = generate_utils.getSelectParam(i, 1)
+ print(generate_utils.replaceMacros(BOOL_PARAM, params))
+
+ params["PARAM_NAME"] = generate_utils.getSelectParam(i, 2)
+ print(generate_utils.replaceMacros(BOOL_PARAM, params))
+
+ params["PARAM_NAME"] = generate_utils.getEnableParam(i)
+ print(generate_utils.replaceMacros(BOOL_PARAM, params))