Skip to content

Commit 605e9e0

Browse files
committed
patcher OSC config clear
Made it so that patcher now clears the OSC config
1 parent 6154f44 commit 605e9e0

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

PythonPatcher.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ def resource_path(relative_path):
3131

3232
return os.path.join(base_path, relative_path)
3333

34+
def delete_files_in_directory(directory_path):
35+
try:
36+
# Check if the directory exists
37+
if os.path.exists(directory_path):
38+
# Iterate over all files and subdirectories in the directory
39+
for root, dirs, files in os.walk(directory_path, topdown=False):
40+
for file_name in files:
41+
file_path = os.path.join(root, file_name)
42+
os.remove(file_path) # Delete the file
43+
for dir_name in dirs:
44+
dir_path = os.path.join(root, dir_name)
45+
shutil.rmtree(dir_path) # Delete the subdirectory and its contents
46+
print(f"OSC Config cleared.")
47+
else:
48+
print(f"no OSC config found")
49+
except Exception as e:
50+
print(f"An error occurred while clearing OSC conifg: {e}")
51+
52+
3453
def patch_model(original_model_path, original_meta_file_path, diff_file_path, meta_diff_file_path, output_name):
3554
script_directory = resource_path(os.path.dirname(os.path.abspath(__file__)))
3655
original_model = resource_path(original_model_path)
@@ -83,6 +102,8 @@ def main():
83102
meta_diff_file_path="data/DiffFiles/NameOfYourMetaDiffFile.hdiff", # Change the name to the name of the MetaHdiff file you generated
84103
output_name = "MyCoolAvatar_FT" # Change this to your desired output name # Change this to your desired output name
85104
)
105+
106+
delete_files_in_directory(os.path.join(os.path.expanduser("~"), "AppData", "LocalLow", "VRChat", "VRChat", "OSC"))
86107

87108
print("Patch complete! Please read the documentation and instructions.")
88109
input("Press Enter to exit...")

0 commit comments

Comments
 (0)