Skip to content

Commit 5d96cdb

Browse files
authored
Merge pull request #12 from Float3/dev
Dev 12
2 parents d818a08 + 09d25a8 commit 5d96cdb

4 files changed

Lines changed: 145 additions & 44 deletions

File tree

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
# VRCLauncher
2-
![VRCLauncher_9mqY6RYlZd](https://user-images.githubusercontent.com/86748455/161536489-70a9eed6-f054-47b9-b30e-f19272189316.png)
2+
![VRCLauncher_Ip4QekJZhk](https://user-images.githubusercontent.com/86748455/164448202-0e7d2a48-9a29-4d7e-9c65-d94ab90f261c.png)
3+
4+
For In-Depth explanations for most of the commands go to
5+
6+
https://docs.vrchat.com/docs/launch-options
7+
8+
https://docs.unity3d.com/2019.4/Documentation/Manual/PlayerCommandLineArguments.html
9+
10+
Arguments that aren't covered by those links can be found below
11+
12+
| argument | default value | explanation | source |
13+
|-------------------------------|-----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|
14+
| --osc=inPort:senderIP:outPort | --osc=9000:127.0.0.1:9001 | https://github.com/vrchat-community/osc/wiki#vrchat-ports | https://github.com/vrchat-community/osc/wiki#vrchat-ports |
15+
| | | | |
16+
| vrchat://launch?id= | | Specify launch instance | |
17+
| | | | |
18+
| --log-debug-levels= | | extends logging. know "debug-levls" include (this information is most likely out of date): <br/><br/> --log-debug-levels="Always;API;AssetBundleDownloadManager;ContentCreator;All;NetworkTransport;NetworkData;NetworkProcessing" | |
19+
| | | | |
20+
| --custom-arm-ratio= | --custom-arm-ratio="0.4537" | The IK-Beta Changelog of VRChat 2022.1.1p3 build 11721 states:<br/><br/>- Added --custom-arm-ratio="0.4537" launch option. "0.4537" is default, "0.415" will approximate previous beta arm scale | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/955619620310646814 |
21+
| --disable-shoulder-tracking | | The IK-Beta Changelog of VRChat 2022.1.1p4 build 11731 states:<br/><br/>- Added --disable-shoulder-tracking launch option. Use this to avoid issues with some types of IMU-only based arm trackers. | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/958535824490758144 |
22+
| --calibration-range= | --calibration-range="0.3" | The IK-Beta 2.0 Changelog of VRChat 2022.1.1p5 build 11748 states:<br/><br/>- **Added the --calibration-range="0.3" launch option**. This determines the distance from predicted supported binding points that the calibration will search (in meters)<br/>- The default value is 0.3, corresponding to a 30cm radius sphere around possible binding points | An announcement on the VRChat Discord server: https://discord.com/channels/189511567539306508/503009489486872583/966575806522466305 |

VRCLauncher/Model/Config.cs

Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,43 @@
33
using System.Collections.ObjectModel;
44
using System.Diagnostics;
55
using System.IO;
6-
using System.Linq;
76
using System.Text.Json;
87
using System.Text.Json.Serialization;
98
using System.Windows;
109
using Microsoft.Win32;
1110

12-
// ReSharper disable InconsistentNaming
13-
1411
namespace VRCLauncher.Model;
1512

1613
public class Config
1714
{
1815
public bool NoVR { get; set; }
1916
public int FPS { get; set; }
20-
public bool LegacyFBTCalibrate { get; set; }
2117
public int Profile { get; set; }
18+
2219
public bool WatchWorlds { get; set; }
2320
public bool WatchAvatars { get; set; }
21+
2422
public bool Fullscreen { get; set; }
2523
public int Width { get; set; }
2624

2725
public int Height { get; set; }
26+
public int Monitor { get; set; }
2827

29-
// public int Monitor { get; set; }
3028
public bool UdonDebugLogging { get; set; }
3129
public bool DebugGUI { get; set; }
3230
public bool SDKLogLevels { get; set; }
3331
public bool VerboseLogging { get; set; }
34-
public string MidiDevice { get; set; }
35-
public string OSCPorts { get; set; }
32+
33+
public bool LegacyFBTCalibrate { get; set; }
3634
public string CustomArmRatio { get; set; }
3735
public bool DisableShoulderTracking { get; set; }
36+
public string CalibrationRange { get; set; }
37+
38+
public string MidiDevice { get; set; }
39+
public string OSCPorts { get; set; }
3840
public string LaunchInstance { get; set; }
3941
public string ArbitraryArguments { get; set; }
42+
4043
public ObservableCollection<CompanionApp> CompanionApps { get; set; }
4144
public bool LaunchCompanionApps { get; set; }
4245

@@ -54,18 +57,19 @@ public Config()
5457
WatchAvatars = false;
5558

5659
Fullscreen = true;
57-
Width = 0;
58-
Height = 0;
59-
// Monitor = 0;
60+
Width = 0; // (int) SystemParameters.PrimaryScreenWidth;
61+
Height = 0; // (int) SystemParameters.PrimaryScreenHeight;
62+
Monitor = 1;
6063

6164
UdonDebugLogging = false;
6265
DebugGUI = false;
6366
SDKLogLevels = false;
6467
VerboseLogging = false;
6568

6669
LegacyFBTCalibrate = false;
67-
CustomArmRatio = "0.4537";
70+
CustomArmRatio = "";
6871
DisableShoulderTracking = false;
72+
CalibrationRange = "";
6973

7074
MidiDevice = "";
7175
OSCPorts = "";
@@ -76,7 +80,6 @@ public Config()
7680
LaunchCompanionApps = true;
7781
}
7882

79-
// ReSharper disable once IdentifierTypo
8083
public static string FindVRCexePath()
8184
{
8285
try
@@ -131,21 +134,13 @@ public List<string> GetArgs()
131134

132135
args.Add("--fps=" + FPS);
133136

134-
if (LegacyFBTCalibrate) args.Add("--legacy-fbt-calibrate");
135-
136137
args.Add("--profile=" + Profile);
137138

139+
138140
if (WatchWorlds) args.Add("--watch-worlds");
139141

140142
if (WatchAvatars) args.Add("--watch-avatars");
141143

142-
if (UdonDebugLogging) args.Add("--enable-udon-debug-logging");
143-
144-
if (DebugGUI) args.Add("--enable-debug-gui");
145-
146-
if (SDKLogLevels) args.Add("--enable-sdk-log-levels");
147-
148-
if (VerboseLogging) args.Add("--enable-verbose-logging");
149144

150145
args.Add("-screen-fullscreen");
151146
args.Add(Fullscreen ? "1" : "0");
@@ -162,17 +157,32 @@ public List<string> GetArgs()
162157
args.Add(Height.ToString());
163158
}
164159

165-
// args.Add("-monitor");
166-
// args.Add(Monitor.ToString());
160+
args.Add("-monitor");
161+
args.Add(Monitor.ToString());
167162

168-
if (MidiDevice != "") args.Add("--midi=" + MidiDevice);
169163

170-
if (OSCPorts != "") args.Add("--osc-ports=" + OSCPorts);
164+
if (UdonDebugLogging) args.Add("--enable-udon-debug-logging");
171165

172-
if (CustomArmRatio != "") args.Add("--custom-arm-ratio=" + CustomArmRatio);
166+
if (DebugGUI) args.Add("--enable-debug-gui");
167+
168+
if (SDKLogLevels) args.Add("--enable-sdk-log-levels");
169+
170+
if (VerboseLogging) args.Add("--enable-verbose-logging");
171+
172+
173+
if (LegacyFBTCalibrate) args.Add("--legacy-fbt-calibrate");
174+
175+
if (CustomArmRatio != "") args.Add("--custom-arm-ratio=\"" + CustomArmRatio + "\"");
173176

174177
if (DisableShoulderTracking) args.Add("--disable-shoulder-tracking");
175178

179+
if (CalibrationRange != "") args.Add("--calibration-range=\"" + CalibrationRange + "\"");
180+
181+
182+
if (MidiDevice != "") args.Add("--midi=" + MidiDevice);
183+
184+
if (OSCPorts != "") args.Add("--osc-ports=" + OSCPorts);
185+
176186
if (LaunchInstance != "") args.Add(LaunchInstance);
177187

178188
if (ArbitraryArguments != "")
@@ -187,6 +197,8 @@ public void LaunchApps(List<string> args)
187197
{
188198
if (LaunchCompanionApps)
189199
{
200+
Process[] processes = Process.GetProcesses();
201+
190202
foreach (CompanionApp app in CompanionApps)
191203
{
192204
bool launch = true;
@@ -216,7 +228,7 @@ public void LaunchApps(List<string> args)
216228
}
217229
}
218230

219-
foreach (Process process in Process.GetProcesses())
231+
foreach (Process process in processes)
220232
{
221233
if (process.ProcessName.ToLower() == app.Name.ToLower())
222234
{
@@ -238,7 +250,8 @@ public void LaunchApps(List<string> args)
238250
else if (app.Path.EndsWith(".py"))
239251
{
240252
process.StartInfo.FileName = "cmd.exe";
241-
process.StartInfo.Arguments = app.Path + " " + app.Args;
253+
process.StartInfo.WorkingDirectory = Path.GetDirectoryName(app.Path);
254+
process.StartInfo.Arguments = "";
242255
process.StartInfo.RedirectStandardInput = true;
243256
process.Start();
244257

VRCLauncher/View/MainWindow.xaml

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@
138138
HorizontalAlignment="Center" VerticalAlignment="Center" />
139139
</StackPanel>
140140

141-
<!--<StackPanel Orientation="Horizontal">
142-
<Label Content="-monitor " Width="110" HorizontalContentAlignment="Left" />
143-
<TextBox Text="{Binding Monitor}" Width="80" TextAlignment="Center"
144-
HorizontalContentAlignment="Center"
145-
HorizontalAlignment="Center" VerticalAlignment="Center" />
146-
</StackPanel>-->
141+
<StackPanel Orientation="Horizontal">
142+
<Label Content="-monitor " Width="110" HorizontalContentAlignment="Left" />
143+
<TextBox Text="{Binding Monitor}" Width="80" TextAlignment="Center"
144+
HorizontalContentAlignment="Center"
145+
HorizontalAlignment="Center" VerticalAlignment="Center" />
146+
</StackPanel>
147147

148148
</StackPanel>
149149
</GroupBox>
@@ -235,6 +235,56 @@
235235
HorizontalContentAlignment="Left" />
236236
<CheckBox IsChecked="{Binding DisableShoulderTracking}" />
237237
</StackPanel>
238+
239+
<StackPanel Orientation="Horizontal">
240+
<Label Content="--calibration-range=" Width="120" HorizontalContentAlignment="Left" />
241+
<TextBox Text="{Binding CalibrationRange}" Width="200" TextAlignment="Left"
242+
HorizontalContentAlignment="Center"
243+
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"
244+
PreviewTextInput="ValidateFloatTextBox">
245+
246+
<TextBox.Resources>
247+
<VisualBrush
248+
x:Key="Watermark"
249+
AlignmentX="Left"
250+
Stretch="None"
251+
TileMode="None">
252+
<VisualBrush.Visual>
253+
<TextBlock
254+
FontStyle="Italic"
255+
Foreground="#959595"
256+
Text="default: 0.3" />
257+
</VisualBrush.Visual>
258+
</VisualBrush>
259+
</TextBox.Resources>
260+
261+
<TextBox.Style>
262+
<Style TargetType="TextBox">
263+
<Setter Property="HorizontalContentAlignment" Value="Left" />
264+
<Setter Property="VerticalAlignment" Value="Center" />
265+
<Setter Property="Foreground"
266+
Value="{StaticResource ForegroundColorBrush}" />
267+
<Setter Property="Background"
268+
Value="{StaticResource TextBackgroundColorBrush}" />
269+
<Setter Property="BorderBrush"
270+
Value="{StaticResource TextBackgroundColorBrush}" />
271+
<Style.Triggers>
272+
<Trigger Property="Text" Value="">
273+
<Setter Property="Background"
274+
Value="{StaticResource Watermark}" />
275+
</Trigger>
276+
277+
<Trigger Property="Text" Value="{x:Null}">
278+
<Setter Property="Background"
279+
Value="{StaticResource Watermark}" />
280+
</Trigger>
281+
</Style.Triggers>
282+
</Style>
283+
</TextBox.Style>
284+
285+
</TextBox>
286+
</StackPanel>
287+
238288
</StackPanel>
239289
</GroupBox>
240290
</StackPanel>

VRCLauncher/ViewModel/ViewModel.cs

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public ViewModel()
2222
Fullscreen = Config.Fullscreen;
2323
Width = Config.Width;
2424
Height = Config.Height;
25-
// Monitor = Config.Monitor;
25+
Monitor = Config.Monitor;
2626

2727
UdonDebugLogging = Config.UdonDebugLogging;
2828
DebugGUI = Config.DebugGUI;
@@ -32,12 +32,13 @@ public ViewModel()
3232
LegacyFBTCalibrate = Config.LegacyFBTCalibrate;
3333
CustomArmRatio = Config.CustomArmRatio;
3434
DisableShoulderTracking = Config.DisableShoulderTracking;
35+
CalibrationRange = Config.CalibrationRange;
3536

3637
MidiDevice = Config.MidiDevice;
3738
OSCPorts = Config.OSCPorts;
3839
LaunchInstance = Config.LaunchInstance;
3940
ArbitraryArguments = Config.ArbitraryArguments;
40-
41+
4142
LaunchCompanionApps = Config.LaunchCompanionApps;
4243
CompanionApps = Config.CompanionApps;
4344
}
@@ -128,12 +129,12 @@ public bool WatchAvatars
128129
}
129130
}
130131

131-
private bool _fullscreen;
132-
133132
#endregion
134133

135134
#region Screen
136135

136+
private bool _fullscreen;
137+
137138
public bool Fullscreen
138139
{
139140
get => Config.Fullscreen;
@@ -180,21 +181,22 @@ public int Width
180181
}
181182
}
182183

183-
/*private int _monitor;
184-
184+
private int _monitor;
185+
185186
public int Monitor
186187
{
187188
get => Config.Monitor;
188189
set
189190
{
190191
if (_monitor != value)
191192
{
193+
if (value < 1) value = 1; // Monitor is specified by a 1-based index number
192194
_monitor = value;
193195
Config.Monitor = value;
194196
OnPropertyChanged(nameof(Monitor));
195197
}
196198
}
197-
}*/
199+
}
198200

199201
#endregion
200202

@@ -316,6 +318,22 @@ public bool DisableShoulderTracking
316318
}
317319
}
318320

321+
private string _calibrationRange;
322+
323+
public string CalibrationRange
324+
{
325+
get => Config.CalibrationRange;
326+
set
327+
{
328+
if (_calibrationRange != value)
329+
{
330+
_calibrationRange = value;
331+
Config.CalibrationRange = value;
332+
OnPropertyChanged(nameof(CalibrationRange));
333+
}
334+
}
335+
}
336+
319337
#endregion
320338

321339
#region MISC
@@ -406,7 +424,7 @@ public ObservableCollection<CompanionApp> CompanionApps
406424
}
407425
}
408426
}
409-
427+
410428
private bool _launchCompanionApps;
411429

412430
public bool LaunchCompanionApps
@@ -422,7 +440,7 @@ public bool LaunchCompanionApps
422440
}
423441
}
424442
}
425-
443+
426444
#endregion
427445

428446
public event PropertyChangedEventHandler PropertyChanged;

0 commit comments

Comments
 (0)