-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathazure2femto.bat
More file actions
58 lines (46 loc) · 1.7 KB
/
azure2femto.bat
File metadata and controls
58 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
echo Making femto files...
setlocal enabledelayedexpansion
:: Input and output folders
set "helpInFolder=.\help"
set "helpOutFolder=.\help-femto"
set "vlInFolder=."
set "vlOutFolder=.\vl-femto"
:: Create output folder if it doesn't exist
if not exist "%helpOutFolder%" (
mkdir "%helpOutFolder%"
)
if not exist "%vlOutFolder%" (
mkdir "%vlOutFolder%"
)
powershell Copy-Item -Path "%helpInFolder%\help.xml", "%helpInFolder%\lankydude.fbx" -Destination "%helpOutFolder%"
:: Loop through all .vl files and change references
for %%f in ("%helpInFolder%\*.vl") do (
set "filename=%%~nxf"
powershell -NoProfile -Command ^
"$text = Get-Content -Raw '%%f';" ^
"$text = $text -replace 'Location=\"VL.Devices.AzureKinect\"', 'Location=\"VL.Devices.AzureKinect.Femto\"';" ^
"Set-Content -Encoding UTF8 '%helpOutFolder%\!filename!' $text"
)
:: Loop through all .vl files and change references
for %%f in ("%vlInFolder%\*.vl") do (
set "filename=%%~nxf"
rem Default newname
set "newname="
rem Check if the filename ends with .HDE.vl
if /I "!filename:~-7!"==".HDE.vl" (
rem Remove the last 7 characters (.HDE.vl) and append .Femto.HDE.vl
set "base=!filename:~0,-7!"
set "newname=!base!.Femto.HDE.vl"
) else (
rem Remove the last 3 characters (.vl) and append .Femto.vl
set "base=!filename:~0,-3!"
set "newname=!base!.Femto.vl"
)
powershell -NoProfile -Command ^
"$text = Get-Content -Raw '%%f';" ^
"$text = $text -replace 'Location=\"VL.Devices.AzureKinect\"', 'Location=\"VL.Devices.AzureKinect.Femto\"';" ^
"Set-Content -Encoding UTF8 '%vlOutFolder%\!newname!' $text"
)
echo Done.
pause