Skip to content

Commit

Permalink
Catch exception for emulator tool not being installed
Browse files Browse the repository at this point in the history
- Try/except for attempting to use the gamepad tool without the program installed.
- Added info to readme info for controller emulation
- Fixed spelling mistake fixes that would disappoint everyone everywhere.
  • Loading branch information
ZenithVal committed Aug 25, 2022
1 parent fd949a3 commit d254ab9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 7 additions & 3 deletions OSCLeash.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from pythonosc.dispatcher import Dispatcher
from pythonosc.udp_client import SimpleUDPClient
from dataclasses import dataclass
import vgamepad as vg
import json
import os
import sys
Expand Down Expand Up @@ -69,8 +68,13 @@ def resource_path(relative_path):
print("Delays of {:.0f}".format(ActiveDelay*1000),"& {:.0f}".format(InactiveDelay*1000),"ms")
#print("Inactive delay of {:.0f}".format(InactiveDelay*1000),"ms")
if XboxJoystickMovement:
gamepad = vg.VX360Gamepad()
print("Emulating Xbox 360 Controller for input instead of OSC")
try:
import vgamepad as vg
gamepad = vg.VX360Gamepad()
print("Emulating Xbox 360 Controller for input instead of OSC")
except Exception as e:
print(e)
print('\x1b[1;31;40m' + 'Tool required for controller emulation not installed. Check the docs.' + '\x1b[0m')

@dataclass
class LeashParameters:
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OSCLeash

Hi, sorry, I swear I'm not a dissapointment to my parents. This is NOT user friendly yet. <br />
Hi, sorry, I swear I'm not a disappointment to my parents. This is NOT user friendly yet. <br />
A "simple" system to make a functional "Leash" in VRchat using OSC as an input controller. <br />
Could be adapted to any pullable physbone; EG: A tail. <br />
If you're smarter and want to improve this code, by all means, PLEASE do so.
Expand Down Expand Up @@ -29,7 +29,8 @@ Output those two values back to VRC and boom, you're moving in the direction of

As with RavenBuilds's take on the OSCLeash, using OSC as an input for movement causes you arms to be locked into desktop pose, please slap some support onto this canny! https://feedback.vrchat.com/feature-requests/p/osc-locks-arms

**TEMPORARY WORKAROUND**: Set "XboxJoystickMovement" to true in the config file. Instead of outputting movement with OSC, this will emulate an Xbox controller joystick! Skipping over the above issue enitely. Might break, dunno. This will probably be removed when VRC fixes the issue. You'll hear a little windows connect noise if you've done it right. Make sure to select the VRC window so the inputs are output correctly.
**TEMPORARY WORKAROUND**: Set "XboxJoystickMovement" to true in the config file. Instead of outputting movement with OSC, this will emulate an Xbox controller joystick! Skipping over the above issue enitely. This will probably be removed when VRC fixes the issue. Check the extra steps in setup for this.


##

Expand All @@ -55,10 +56,15 @@ Requires VRC3 Avatar SDK.
5. The position constrain source on `Aim Target` should be assigned to the last bone of your leash.
6. If your phybone is off center, copy the constraint from above and paste it on the root of the prefab. The source should be the origin of your leash.
7. Make sure to reset OSC in the radial menu if this is being retrofit as an update to an avatar.
8. Run program & enjoy. If using the temporary xbox input workaround, make sure to select the VRC window.
8. Run program & enjoy.

There will be a setup guide later.

**If using executable with temporary xbox input workaround**
- You need this installed https://github.com/ViGEm/ViGEmBus/releases
- Make sure the VRC window is selected


#

### Config
Expand Down

0 comments on commit d254ab9

Please sign in to comment.