├── src ├── gui │ ├── requirements.txt │ ├── gui_exceptions.py │ ├── build.bat │ ├── build-cx_freeze.bat │ ├── PluginData.py │ ├── InstallerParams.py │ ├── app.spec │ ├── setup.py │ ├── ProcessingDialog.py │ ├── DeletePathThread.py │ ├── templates.json │ ├── WorkerThread.py │ └── app.py ├── data │ ├── FalloutNV.esm │ │ ├── materials │ │ │ └── new_vegas │ │ │ │ ├── .gitkeep │ │ │ │ ├── clutter │ │ │ │ ├── casino │ │ │ │ │ └── slot_machine01 │ │ │ │ │ │ ├── Reel01#5.BGSM │ │ │ │ │ │ ├── Reel02#5.BGSM │ │ │ │ │ │ ├── Reel03#5.BGSM │ │ │ │ │ │ ├── TopLight#0.BGSM │ │ │ │ │ │ ├── TopLight#2.BGSM │ │ │ │ │ │ └── SilverPlate#4.BGSM │ │ │ │ ├── jukebox │ │ │ │ │ ├── jukeboxclean01 │ │ │ │ │ │ ├── JukeBox01#0.BGSM │ │ │ │ │ │ └── Computer Screen.BGSM │ │ │ │ │ ├── jukeboxdirtynv │ │ │ │ │ │ ├── JukeBox01#0.BGSM │ │ │ │ │ │ └── Computer Screen.BGSM │ │ │ │ │ └── jukeboxdirty01 │ │ │ │ │ │ ├── GlassTubes#2.BGEM │ │ │ │ │ │ ├── D_Midbrace01#0.BGSM │ │ │ │ │ │ ├── D_Midbrace02#0.BGSM │ │ │ │ │ │ ├── DirtyJukeBox01#0.BGSM │ │ │ │ │ │ └── Computer Screen#3.BGSM │ │ │ │ ├── questitems │ │ │ │ │ ├── nukaclock01 │ │ │ │ │ │ └── Object01#0.BGSM │ │ │ │ │ └── nukavendingmachineclean01 │ │ │ │ │ │ └── VendingMachine#0.BGSM │ │ │ │ ├── vendingmachine │ │ │ │ │ └── vendingmachine │ │ │ │ │ │ └── VendingMachine#0.BGSM │ │ │ │ ├── vintageradio │ │ │ │ │ └── vintageradio01 │ │ │ │ │ │ ├── VintageRadioBody#0.BGSM │ │ │ │ │ │ ├── VintageRadioNeedle01.BGSM │ │ │ │ │ │ └── VintageRadioGlassDial#0.BGSM │ │ │ │ ├── ssvendingmachine │ │ │ │ │ ├── ssvendingmachine │ │ │ │ │ │ ├── ScreenFlicker#0.BGSM │ │ │ │ │ │ └── ScreenLarge#0.BGSM │ │ │ │ │ └── ssvendingmachinestatic │ │ │ │ │ │ ├── ScreenLarge#0.BGSM │ │ │ │ │ │ ├── ScreenFlicker#0.BGSM │ │ │ │ │ │ └── ssVendingMachine1#0.BGSM │ │ │ │ └── open_24hours_sign │ │ │ │ │ └── nv_open-24-hours_sign │ │ │ │ │ ├── Object02#0.BGSM │ │ │ │ │ └── Sign_24hr#0.bgsm │ │ │ │ ├── architecture │ │ │ │ └── goodsprings │ │ │ │ │ ├── nv_gs-saloon-sign │ │ │ │ │ ├── Sign#0.BGEM │ │ │ │ │ ├── Chain1#0.BGEM │ │ │ │ │ ├── Frame#0.BGEM │ │ │ │ │ ├── Object01#0.BGEM │ │ │ │ │ └── Object02#0.BGEM │ │ │ │ │ ├── nv_watertank │ │ │ │ │ └── DieselTankNV#2.BGEM │ │ │ │ │ ├── nv_prospectorsaloon_lights │ │ │ │ │ ├── Object03#3.bgsm │ │ │ │ │ ├── Object04#3.bgsm │ │ │ │ │ └── Object0433#3.bgsm │ │ │ │ │ └── nv_prospectorsaloon-neon_lights │ │ │ │ │ └── Shape1#2.BGSM │ │ │ │ └── dungeons │ │ │ │ └── nv_goodsprings │ │ │ │ └── nvgsrmwindowseparate │ │ │ │ ├── NVGSRmWindowSeparate#13.BGEM │ │ │ │ └── NVGSRmWindowSeparate#14.BGEM │ │ └── textures │ │ │ └── new_vegas │ │ │ └── landscape │ │ │ └── no_spec_s.dds │ └── LODSettings │ │ └── WastelandNV.LOD ├── sound │ ├── readme.txt │ └── ConvertSound.bat ├── models-and-animations │ ├── Elric.bat │ ├── BatchArchive.bat │ ├── elric │ │ └── Settings │ │ │ ├── PCFilter.cs │ │ │ └── PCMeshes.esf │ └── BSExportBatch.bat ├── tweaks │ ├── enable_cast_shadows_all.ps1 │ └── enable_cast_shadows.ps1 └── convert.ps1 ├── convert.bat ├── bin └── bsab │ ├── mw_hash_table.bin │ ├── Pfim.dll │ ├── bsab.exe │ ├── BSA Browser.exe │ ├── Sharp.BSA.BA2.dll │ ├── lz4.AnyCPU.loader.dll │ ├── ICSharpCode.TextEditor.dll │ ├── ICSharpCode.SharpZipLib.dll │ ├── System.Management.Automation.dll │ ├── Licenses │ ├── Pfim.txt │ ├── SharpZipLib.txt │ ├── CoreFX.txt │ ├── IonKiwi.lz4.net.txt │ └── ICSharpCode.TextEditor.Extended.txt │ ├── BSA Browser.exe.config │ └── LICENSE.txt ├── images ├── screenshot-1.jpg ├── screenshot-2.jpg ├── screenshot-3.jpg ├── screenshot-4.jpg ├── screenshot-5.jpg ├── screenshot-6.jpg └── gamebryo-creation-engine.png ├── .gitattributes ├── .gitmodules ├── .gitignore ├── nexus.bbcode ├── README.md └── .github └── workflows └── main.yml /src/gui/requirements.txt: -------------------------------------------------------------------------------- 1 | PySide6 2 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gui/gui_exceptions.py: -------------------------------------------------------------------------------- 1 | class InterruptException(Exception): 2 | pass 3 | -------------------------------------------------------------------------------- /src/gui/build.bat: -------------------------------------------------------------------------------- 1 | .\venv\Scripts\activate.bat && pyinstaller --noconsole app.py 2 | pause -------------------------------------------------------------------------------- /src/gui/build-cx_freeze.bat: -------------------------------------------------------------------------------- 1 | .\venv\Scripts\activate.bat && python setup.py build 2 | pause -------------------------------------------------------------------------------- /convert.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Powershell.exe -ExecutionPolicy Bypass -File src\convert.ps1 4 | pause 5 | -------------------------------------------------------------------------------- /bin/bsab/mw_hash_table.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/bin/bsab/mw_hash_table.bin -------------------------------------------------------------------------------- /src/sound/readme.txt: -------------------------------------------------------------------------------- 1 | Copy extracted sound and music folder to this folder. Set paths to programs in batch file. -------------------------------------------------------------------------------- /src/data/LODSettings/WastelandNV.LOD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/LODSettings/WastelandNV.LOD -------------------------------------------------------------------------------- /bin/bsab/Pfim.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a54b25d702824cd3b353263a459130accd61733a61e4daf5cb5229c2100b480b 3 | size 90112 4 | -------------------------------------------------------------------------------- /bin/bsab/bsab.exe: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7d68de359fce561ea014dadfd527352dd38bdc203e60074e3ff00836410dde28 3 | size 2753024 4 | -------------------------------------------------------------------------------- /bin/bsab/BSA Browser.exe: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88655877cf48bc516eca2c719fab2f9248db3a60eba099432fc57d22b8590bfd 3 | size 1537024 4 | -------------------------------------------------------------------------------- /bin/bsab/Sharp.BSA.BA2.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:660d3a6201586d41a631811d41a752d9b554d766caac900f037555b1ec78ea82 3 | size 44544 4 | -------------------------------------------------------------------------------- /images/screenshot-1.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:214c92dfcf05bcb5531000f48f2277e733bc3e22ed0b5f50b38d2d8beccc5640 3 | size 857297 4 | -------------------------------------------------------------------------------- /images/screenshot-2.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9d082223fa40701eb8b2e47b9065101ce8e242599a25598e241854cd35adc90d 3 | size 1809702 4 | -------------------------------------------------------------------------------- /images/screenshot-3.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3cb8696ad8c2d52176dc5076a9846dfa7b77452194a2d921b9679965957d6aa8 3 | size 588504 4 | -------------------------------------------------------------------------------- /images/screenshot-4.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7cbdd14455640340eec1bcd8c8046fa8c17d90d9dbc3a134f22aefd5d3499008 3 | size 182913 4 | -------------------------------------------------------------------------------- /images/screenshot-5.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33b02c9d5721b0fae279987f41a7be012ff22f4f264edc464b1719366df3e28f 3 | size 647822 4 | -------------------------------------------------------------------------------- /images/screenshot-6.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b975e8b8d8fb3977d8fbdb2f4d65dcc26b5e19155d8f7393032583e2b5a96ff8 3 | size 859331 4 | -------------------------------------------------------------------------------- /bin/bsab/lz4.AnyCPU.loader.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9816279cf69b5b7c757b93d1ce16bb640c460cd65e369e34ab63085beb52921a 3 | size 956928 4 | -------------------------------------------------------------------------------- /bin/bsab/ICSharpCode.TextEditor.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2843dd520ea0df1bc9d1eb36d6eb7f014c10177ccfa9a174653abe98128bfb19 3 | size 368640 4 | -------------------------------------------------------------------------------- /bin/bsab/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2c32b22249ca820844cb40305e6353e8ca2f52737e5f5ee13f6bb8b36ade7263 3 | size 198656 4 | -------------------------------------------------------------------------------- /images/gamebryo-creation-engine.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce8f3fb2cc1a7d1b110ab55c6a88d8db8a3f80b8251a8790799be050b302afbc 3 | size 1871263 4 | -------------------------------------------------------------------------------- /bin/bsab/System.Management.Automation.dll: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0e9dfbf5f9dbd536a0c8f2f0ba7a11816e36b973504b0fd9ac5849cd39a22a98 3 | size 7154176 4 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/textures/new_vegas/landscape/no_spec_s.dds: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1a67b6b2e7ad527e873876d0f36702253a25f147ce159d0275d39029351aceae 3 | size 349700 4 | -------------------------------------------------------------------------------- /src/gui/PluginData.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from pathlib import Path 3 | 4 | 5 | @dataclass 6 | class PluginData: 7 | name: str 8 | path: Path 9 | resources: list[Path] 10 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel01#5.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel01#5.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel02#5.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel02#5.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel03#5.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/Reel03#5.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/TopLight#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/TopLight#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/TopLight#2.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/TopLight#2.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxclean01/JukeBox01#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxclean01/JukeBox01#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirtynv/JukeBox01#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirtynv/JukeBox01#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/questitems/nukaclock01/Object01#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/questitems/nukaclock01/Object01#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/SilverPlate#4.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/casino/slot_machine01/SilverPlate#4.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/GlassTubes#2.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/GlassTubes#2.BGEM -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.jpg filter=lfs diff=lfs merge=lfs -text 2 | *.png filter=lfs diff=lfs merge=lfs -text 3 | *.dll filter=lfs diff=lfs merge=lfs -text 4 | *.exe filter=lfs diff=lfs merge=lfs -text 5 | *.dds filter=lfs diff=lfs merge=lfs -text 6 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxclean01/Computer Screen.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxclean01/Computer Screen.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/D_Midbrace01#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/D_Midbrace01#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/D_Midbrace02#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/D_Midbrace02#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/DirtyJukeBox01#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/DirtyJukeBox01#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirtynv/Computer Screen.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirtynv/Computer Screen.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Sign#0.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Sign#0.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/Computer Screen#3.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/jukebox/jukeboxdirty01/Computer Screen#3.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Chain1#0.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Chain1#0.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Frame#0.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Frame#0.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_watertank/DieselTankNV#2.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_watertank/DieselTankNV#2.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Object01#0.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Object01#0.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Object02#0.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_gs-saloon-sign/Object02#0.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/vendingmachine/vendingmachine/VendingMachine#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/vendingmachine/vendingmachine/VendingMachine#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioBody#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioBody#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachine/ScreenFlicker#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachine/ScreenFlicker#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachine/ScreenLarge#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachine/ScreenLarge#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioNeedle01.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioNeedle01.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/open_24hours_sign/nv_open-24-hours_sign/Object02#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/open_24hours_sign/nv_open-24-hours_sign/Object02#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/open_24hours_sign/nv_open-24-hours_sign/Sign_24hr#0.bgsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/open_24hours_sign/nv_open-24-hours_sign/Sign_24hr#0.bgsm -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioGlassDial#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/vintageradio/vintageradio01/VintageRadioGlassDial#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object03#3.bgsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object03#3.bgsm -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object04#3.bgsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object04#3.bgsm -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/questitems/nukavendingmachineclean01/VendingMachine#0.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/clutter/questitems/nukavendingmachineclean01/VendingMachine#0.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object0433#3.bgsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon_lights/Object0433#3.bgsm -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon-neon_lights/Shape1#2.BGSM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/architecture/goodsprings/nv_prospectorsaloon-neon_lights/Shape1#2.BGSM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/dungeons/nv_goodsprings/nvgsrmwindowseparate/NVGSRmWindowSeparate#13.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/dungeons/nv_goodsprings/nvgsrmwindowseparate/NVGSRmWindowSeparate#13.BGEM -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/dungeons/nv_goodsprings/nvgsrmwindowseparate/NVGSRmWindowSeparate#14.BGEM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/terry-haire/fnv-to-fo4/HEAD/src/data/FalloutNV.esm/materials/new_vegas/dungeons/nv_goodsprings/nvgsrmwindowseparate/NVGSRmWindowSeparate#14.BGEM -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/models-and-animations/nifskope_converter"] 2 | path = src/models-and-animations/nifskope_converter 3 | url = git@github.com:terry-haire/nifskope.git 4 | [submodule "src/plugins/xEdit-fork"] 5 | path = src/plugins/xEdit-fork 6 | url = git@github.com:terry-haire/TES5Edit.git 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.ba2 2 | **/__history 3 | *.identcache 4 | *.local 5 | *.stat 6 | *.res 7 | .vscode 8 | 9 | src/*.txt 10 | 11 | /extracted 12 | /output 13 | /temp 14 | /tmp 15 | /build 16 | /log.txt 17 | /log-*.txt 18 | 19 | # GUI. 20 | /src/gui/.idea 21 | /src/gui/__pycache__ 22 | /src/gui/build 23 | /src/gui/dist 24 | -------------------------------------------------------------------------------- /src/models-and-animations/Elric.bat: -------------------------------------------------------------------------------- 1 | set ElricLoc=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Tools\Elric\ 2 | set Input=C:\Users\TheHa\projects\fallout-related\converter_output\ 3 | cd /d "%ElricLoc%" 4 | "%ElricLoc%Elrich.exe" "%ElricLoc%Settings\PCMeshes.esf" -ElricOptions.ConvertTarget="%Input%Meshes\new_vegas" -ElricOptions.OutputDirectory="%Input%ElricProcessed" -------------------------------------------------------------------------------- /src/gui/InstallerParams.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from typing import TextIO 3 | 4 | 5 | @dataclass 6 | class InstallerParams: 7 | skip_bsas: bool = False 8 | skip_meshes: bool = False 9 | skip_optimize: bool = False 10 | skip_data: bool = False 11 | skip_plugin_convert: bool = False 12 | skip_plugin_move: bool = False 13 | ignore_existing_files: bool = False 14 | debug: bool = False 15 | skip_lod_settings: bool = False 16 | log_file: TextIO = None 17 | all_objects_cast_shadows: bool = True 18 | skip_ba2_creation: bool = False 19 | -------------------------------------------------------------------------------- /src/gui/app.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | 4 | a = Analysis( 5 | ['app.py'], 6 | pathex=[], 7 | binaries=[], 8 | datas=[], 9 | hiddenimports=[], 10 | hookspath=[], 11 | hooksconfig={}, 12 | runtime_hooks=[], 13 | excludes=[], 14 | noarchive=False, 15 | ) 16 | pyz = PYZ(a.pure) 17 | 18 | exe = EXE( 19 | pyz, 20 | a.scripts, 21 | [], 22 | exclude_binaries=True, 23 | name='app', 24 | debug=False, 25 | bootloader_ignore_signals=False, 26 | strip=False, 27 | upx=True, 28 | console=False, 29 | disable_windowed_traceback=False, 30 | argv_emulation=False, 31 | target_arch=None, 32 | codesign_identity=None, 33 | entitlements_file=None, 34 | ) 35 | coll = COLLECT( 36 | exe, 37 | a.binaries, 38 | a.datas, 39 | strip=False, 40 | upx=True, 41 | upx_exclude=[], 42 | name='app', 43 | ) 44 | -------------------------------------------------------------------------------- /src/tweaks/enable_cast_shadows_all.ps1: -------------------------------------------------------------------------------- 1 | # List of root paths 2 | $rootPaths = @( 3 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas" 4 | ) 5 | 6 | $extension = "*.BGSM" 7 | $fieldName = "bCastShadows" 8 | $newValue = $true 9 | 10 | foreach ($rootPath in $rootPaths) { 11 | Get-ChildItem -Path $rootPath -Recurse -File -Filter $extension | ForEach-Object { 12 | Write-Host "Processing file: $_" 13 | 14 | # Read the file content and convert from JSON 15 | $jsonContent = Get-Content $_.FullName | ConvertFrom-Json 16 | 17 | # Modify the field 18 | if ($jsonContent.PSObject.Properties.Name -contains $fieldName) { 19 | $jsonContent.$fieldName = $newValue 20 | 21 | # Convert the object back to JSON and overwrite the file 22 | $jsonContent | ConvertTo-Json | Set-Content $_.FullName 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/gui/setup.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from cx_Freeze import setup, Executable 3 | 4 | 5 | # Dependencies are automatically detected, but it might need fine-tuning. 6 | build_exe_options = { 7 | # "packages": ["PySide6.QtCore", "PySide6.QtWidgets"], 8 | "zip_include_packages": ["PySide6"], 9 | "excludes": [ 10 | "tkinter", 11 | "numpy", 12 | "test", 13 | ], # Exclude packages that are not needed 14 | "optimize": 2, # 0, 1, or 2 representing no optimization, basic optimization, and full optimization 15 | } 16 | 17 | base = None 18 | if sys.platform == "win32": 19 | base = "Win32GUI" # Use this for GUI applications to not show a console window on Windows 20 | 21 | setup( 22 | name="FNV to FO4", 23 | version="0.1", 24 | description="FNV to FO4", 25 | options={"build_exe": build_exe_options}, 26 | executables=[Executable("app.py", base=base, target_name="fnv-to-fo4.exe")], 27 | ) 28 | -------------------------------------------------------------------------------- /bin/bsab/Licenses/Pfim.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /bin/bsab/Licenses/SharpZipLib.txt: -------------------------------------------------------------------------------- 1 | Copyright © 2000-2018 SharpZipLib Contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this 4 | software and associated documentation files (the "Software"), to deal in the Software 5 | without restriction, including without limitation the rights to use, copy, modify, merge, 6 | publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons 7 | to whom the Software is furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in all copies or 10 | substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 13 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 14 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 15 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 16 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 17 | DEALINGS IN THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /bin/bsab/Licenses/CoreFX.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/gui/ProcessingDialog.py: -------------------------------------------------------------------------------- 1 | import PySide6.QtWidgets as QtWidgets 2 | import PySide6.QtCore as QtCore 3 | 4 | 5 | class ProcessingDialog(QtWidgets.QDialog): 6 | def __init__(self, worker): 7 | super().__init__() 8 | self.worker = worker 9 | self.init_ui() 10 | 11 | def init_ui(self): 12 | layout = QtWidgets.QVBoxLayout() 13 | self.label = QtWidgets.QLabel("Processing...") 14 | self.label.setMinimumWidth(200) 15 | self.label.setMinimumHeight(100) 16 | self.label.setWordWrap(True) 17 | layout.addWidget(self.label) 18 | 19 | # Add Cancel button and connect its slot 20 | cancel_button = QtWidgets.QPushButton("Cancel") 21 | cancel_button.clicked.connect(self.cancel_task) 22 | layout.addWidget(cancel_button) 23 | 24 | self.setLayout(layout) 25 | 26 | # Start the worker thread 27 | self.worker.task_done.connect(self.on_task_done) 28 | self.worker.output_received.connect(self.update_output) 29 | 30 | self.worker.start() 31 | 32 | @QtCore.Slot() 33 | def cancel_task(self): 34 | self.worker.stop() 35 | 36 | @QtCore.Slot() 37 | def on_task_done(self): 38 | self.close() 39 | 40 | @QtCore.Slot(str) 41 | def update_output(self, text): 42 | self.label.setText(text) 43 | -------------------------------------------------------------------------------- /bin/bsab/Licenses/IonKiwi.lz4.net.txt: -------------------------------------------------------------------------------- 1 | LZ4 Library 2 | Copyright (c) 2011-2014, Yann Collet 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /src/tweaks/enable_cast_shadows.ps1: -------------------------------------------------------------------------------- 1 | # List of root paths 2 | $rootPaths = @( 3 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\ammo", 4 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\architecture", 5 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\clutter", 6 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\furniture", 7 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\landscape", 8 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\scol", 9 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\trees", 10 | "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Data\materials\new_vegas\vehicles" 11 | ) 12 | 13 | $extension = "*.BGSM" 14 | $fieldName = "bCastShadows" 15 | $newValue = $true 16 | 17 | foreach ($rootPath in $rootPaths) { 18 | Get-ChildItem -Path $rootPath -Recurse -File -Filter $extension | ForEach-Object { 19 | Write-Host "Processing file: $_.FullName" 20 | 21 | # Read the file content and convert from JSON 22 | $jsonContent = Get-Content $_.FullName | ConvertFrom-Json 23 | 24 | # Modify the field 25 | if ($jsonContent.PSObject.Properties.Name -contains $fieldName) { 26 | $jsonContent.$fieldName = $newValue 27 | 28 | # Convert the object back to JSON and overwrite the file 29 | $jsonContent | ConvertTo-Json | Set-Content $_.FullName 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/models-and-animations/BatchArchive.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | 4 | rem If Laptop 5 | rem set Archive2Loc=C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Tools\Archive2\ 6 | rem set Input=C:\Users\TheHa\Desktop\FNVConvExtracted 7 | 8 | rem If Desktop 9 | set Archive2Loc=E:\SteamLibrary\steamapps\common\Fallout 4\Tools\Archive2\ 10 | rem don't forget to remove the last "\" 11 | set Input=D:\Games\Fallout New Vegas\FNVFo4 Converted\Data 12 | 13 | rem set rootFolder="Input" 14 | 15 | rem Change to input folder so that archives while be created there (does not seem to work) 16 | cd %Input% 17 | for /D %%f in ("%Input%\*") do ( 18 | set bProcess=False 19 | set Format=General 20 | set Compression=None 21 | echo "FalloutNV - %%~nxf.ba2" 22 | echo %%~nxf 23 | if /i "%%~nxf"=="Materials" ( 24 | echo %%~nxf 25 | set Format=General 26 | set Compression=Default 27 | set bProcess=True 28 | ) 29 | if /i "%%~nxf"=="Meshes" ( 30 | echo %%~nxf 31 | set Format=General 32 | set Compression=Default 33 | set bProcess=True 34 | ) 35 | if /i "%%~nxf"=="Music" ( 36 | echo %%~nxf 37 | set Format=General 38 | set Compression=None 39 | set bProcess=True 40 | ) 41 | if /i "%%~nxf"=="Sound" ( 42 | echo %%~nxf 43 | set Format=General 44 | set Compression=None 45 | set bProcess=True 46 | ) 47 | if /i "%%~nxf"=="Textures" ( 48 | echo %%~nxf 49 | set Format=DDS 50 | set Compression=Default 51 | set bProcess=True 52 | ) 53 | echo !Format! 54 | if !bProcess!==True ( 55 | "%Archive2Loc%Archive2.exe" "%Input%\%%~nxf" -create="FalloutNV - %%~nxf.ba2" -root="%Input%" -format=!Format! -compression=!Compression! -maxSizeMB=1500 -tempFiles 56 | ) 57 | ) 58 | pause 59 | -------------------------------------------------------------------------------- /src/models-and-animations/elric/Settings/PCFilter.cs: -------------------------------------------------------------------------------- 1 | var eprocess = FilterScript.Result.Process; 2 | var filePath = asFile.ToLower(); 3 | var filename = Path.GetFileName(filePath); 4 | 5 | if(aeType == FileConverter.ConvertType.Mesh) 6 | { 7 | if (filePath.Contains(".nif")) 8 | { 9 | if(File.Exists(filePath.Replace(".nif", ".egm")) || filePath.Contains("facegendata")) 10 | { 11 | aMeshConverter.LogMessage(aLoggerID, InfoType.Info, "Turning off mesh optimization for Facegen file"); 12 | aMeshConverter.OptimizeMeshes = false; 13 | } 14 | if(filename.Contains("head") || filePath.Contains("facegendata")) 15 | { 16 | aMeshConverter.ProcessAsHead = true; 17 | } 18 | if(filename.Contains("_facebones") && File.Exists(filePath.Replace("_facebones", ""))) 19 | eprocess = FilterScript.Result.Skip; // these are exported with the non-facebones nif 20 | } 21 | else if(filePath.Contains("SwitchNodeChildren\\")) 22 | eprocess = FilterScript.Result.Skip; // these are combined into the switch node parent nif 23 | } 24 | else if(aeType == FileConverter.ConvertType.Texture) 25 | { 26 | if(filePath.Contains(".tga") && File.Exists(filePath.Replace(".tga", ".dds").Replace("tgatextures", "ddstextures"))) 27 | { 28 | aTextureConverter.LogMessage(aLoggerID, InfoType.Info, "DDS override: TGA not processed."); 29 | eprocess = FilterScript.Result.SkipAndCopy; 30 | } 31 | if(filePath.Contains("interface\\") && !filePath.Contains("interface\\objects\\")) 32 | { 33 | aTextureConverter.LogMessage(aLoggerID, InfoType.Info, "Turning off mipmap generation for interface texture."); 34 | aTextureConverter.GenerateMipMaps = false; 35 | } 36 | if(filePath.Contains(".dds")) 37 | { 38 | if(filePath.Contains("\\effects\\") || filePath.Contains("\\cubemaps\\") || filePath.Contains("\\tintmasks\\")) 39 | eprocess = FilterScript.Result.SkipAndCopy; 40 | } 41 | } 42 | 43 | return eprocess; -------------------------------------------------------------------------------- /src/models-and-animations/BSExportBatch.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set cnt=0 3 | 4 | rem LAPTOP 5 | rem set FNVExtracted=C:\Games\FalloutNV\Extracted\Data\ 6 | rem set FNVConverted=C:\Games\FalloutNV\Converted\Data\ 7 | 8 | rem DESKTOP 9 | set FNVExtracted=D:\Games\Fallout New Vegas\FNVExtracted\Data\ 10 | set FNVConverted=D:\Games\Fallout New Vegas\FNVFo4 Converted\Data\ 11 | 12 | for /R "%FNVExtracted%meshes" %%A in (*.nif) do set /a cnt+=1 13 | set /a cnt = cnt/483 14 | echo File count = %cnt% 15 | 16 | rem set iStart to 0 for normal operation 17 | rem set iStart to 30 for object lods 18 | set iStart=0 19 | 20 | rem delete lodlist only if starting from 0 21 | IF %iStart%==0 ( 22 | echo "Deleting LODList.csv..." 23 | del "%FNVConverted%Meshes\Terrain\LODList.csv" 24 | echo "Deleting LOD Groups..." 25 | FOR /D %%f in ("%FNVConverted%Meshes\Terrain\*") DO ( 26 | rem rmdir /q /s "%%f\objects\groups" 27 | rmdir /q /s "%%f\objects" 28 | ) 29 | ) 30 | 31 | FOR /L %%B IN (%iStart%,1,%cnt%) DO ( 32 | ECHO %%B 33 | rem -silent might be the cause of crashes 34 | rem 35 | rem -mi 36 | rem Starts 3ds Max in a minimized mode – but never allows you to open the window for interactive usage. 37 | rem 38 | rem -silent 39 | rem Comparable to the MAXScript command, setSilentMode, this switch suppresses all MAXScript and 3ds Max UI dialogs so that batch scripts specified by the –U command do not get interrupted. 40 | rem 41 | rem -q 42 | rem Suppresses the splash screen 43 | rem 44 | "C:\Program Files\Autodesk\3ds Max 2013\3dsmax.exe" -q -mi -mxs "batchstart = @\"%%B\";global outputdir = @\"c:\\tttobj\\export\";filein @\"C:\\Program Files\\Autodesk\\3ds Max 2013\\scripts\\autoexportnif3_noprompt.ms\"" 45 | ) 46 | rem "C:\Program Files\Autodesk\3ds Max 2013\3dsmax.exe" -mxs "global batchstart = @"%cnt%";filein @"\C:\Program Files\Autodesk\3ds Max 2013\scripts\autoexportnif3_noprompt.ms\"" 47 | rem "C:\Program Files\Autodesk\3ds Max 2013\3dsmax.exe" -mxs "batchstart = @\"%cnt%\";global outputdir = @\"c:\\tttobj\\export\";filein @\"C:\\Program Files\\Autodesk\\3ds Max 2013\\scripts\\autoexportnif3_noprompt.ms\"" 48 | pause -------------------------------------------------------------------------------- /src/sound/ConvertSound.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem fuzer may work with ogg 3 | rem Voice 4 | set ffmpegloc=%UserProfile%\OneDrive\Portable Programs\ffmpeg\bin 5 | set fo4loc=E:\SteamLibrary\steamapps\common\Fallout 4 6 | for /R "sound\voice\" %%f in ("*.ogg") do ( 7 | "%ffmpegloc%\ffmpeg.exe" -loglevel warning -hide_banner -y -i "%%~f" "%%~pf%%~nf.wav" 8 | "%fo4loc%\Tools\Audio\xwmaencode.exe" "%%~pf%%~nf.wav" "%%~pf%%~nf.xwm" 9 | rem "%fo4loc%\Tools\LipGen\LipFuzer\LIPFuzer.exe" -"%%~pf%%~nf.xwm" "%%~pf%%~nf.fuz" 10 | del "%%~pf%%~nf.ogg" 11 | del "%%~pf%%~nf.wav" 12 | rem del "%%~pf%%~nf.xwm" 13 | rem del "%%~pf%%~nf.lip" 14 | ) 15 | "%fo4loc%\Tools\LipGen\LipFuzer\LIPFuzer.exe" -s "%cd%\sound\voice" -d "%cd%\sound\voice" -v 0 16 | for /R "sound\voice\" %%f in ("*.lip") do ( 17 | del "%%~pf%%~nf.lip" 18 | ) 19 | for /R "sound\voice\" %%f in ("*.xwm") do ( 20 | del "%%~pf%%~nf.xwm" 21 | ) 22 | rem "%fo4loc%\Tools\LipGen\LipFuzer\LIPFuzer.exe" "%%~pf%%~nf.xwm" "%%~pf%%~nf.fuz" 23 | 24 | rem Music And Songs 25 | for /R "sound\songs\" %%f in ("*.ogg") do ( 26 | "%ffmpegloc%\ffmpeg.exe" -loglevel warning -hide_banner -y -i "%%~f" "%%~pf%%~nf.wav" 27 | "%fo4loc%\Tools\Audio\xwmaencode.exe" "%%~pf%%~nf.wav" "%%~pf%%~nf.xwm" 28 | del "%%~pf%%~nf.ogg" 29 | del "%%~pf%%~nf.wav" 30 | ) 31 | for /R "sound\songs\" %%f in ("*.mp3") do ( 32 | IF EXIST "%%~pf%%~nf.wav" ( 33 | "%fo4loc%\Tools\Audio\xwmaencode.exe" "%%~pf%%~nf.wav" "%%~pf%%~nf.xwm" 34 | del "%%~pf%%~nf.mp3" 35 | ) ELSE ( 36 | "%ffmpegloc%\ffmpeg.exe" -loglevel warning -hide_banner -y -i "%%~f" "%%~pf%%~nf.wav" 37 | "%fo4loc%\Tools\Audio\xwmaencode.exe" "%%~pf%%~nf.wav" "%%~pf%%~nf.xwm" 38 | del "%%~pf%%~nf.mp3" 39 | del "%%~pf%%~nf.wav" 40 | ) 41 | ) 42 | for /R "Music\" %%f in ("*.mp3") do ( 43 | "%ffmpegloc%\ffmpeg.exe" -loglevel warning -hide_banner -y -i "%%~f" "%%~pf%%~nf.wav" 44 | "%fo4loc%\Tools\Audio\xwmaencode.exe" "%%~pf%%~nf.wav" "%%~pf%%~nf.xwm" 45 | del "%%~pf%%~nf.mp3" 46 | del "%%~pf%%~nf.wav" 47 | ) 48 | rem fx 49 | for /R "sound\fx\" %%f in ("*.ogg") do ( 50 | "%ffmpegloc%\ffmpeg.exe" -loglevel warning -hide_banner -y -i "%%~f" "%%~pf%%~nf.wav" 51 | del "%%~pf%%~nf.ogg" 52 | ) 53 | pause -------------------------------------------------------------------------------- /nexus.bbcode: -------------------------------------------------------------------------------- 1 | [center][size=4][b]Fallout 3 / Fallout: New Vegas to Fallout 4 converter[/b][/size][/center] 2 | 3 | [center] 4 | [img width=400,height=40%]https://media.githubusercontent.com/media/terry-haire/fnv-to-fo4/main/images/screenshot-6.jpg[/img][img width=400,height=40%]https://media.githubusercontent.com/media/terry-haire/fnv-to-fo4/main/images/screenshot-5.jpg[/img] 5 | [img width=400,height=40%]https://media.githubusercontent.com/media/terry-haire/fnv-to-fo4/main/images/screenshot-2.jpg[/img][img width=400,height=40%]https://media.githubusercontent.com/media/terry-haire/fnv-to-fo4/main/images/screenshot-3.jpg[/img] 6 | [/center] 7 | 8 | [size=4][b]Features[/b][/size] 9 | [list] 10 | [*] Convert any models made for Fallout 3 / Fallout: New Vegas to Fallout 4. 11 | [*] Partially convert plugin files (.esp/.esm) from Fallout 3 / Fallout: New Vegas to Fallout 4. (NPCs and creatures are not supported at this time.) 12 | [/list] 13 | 14 | [size=4][b]What it can convert[/b][/size] 15 | [list] 16 | [*] All objects. 17 | [*] The worldspace and all cells, including the landscape and the placement of every single object. 18 | [/list] 19 | 20 | [size=4][b]What it can not convert (yet)[/b][/size] 21 | [list] 22 | [*] NPCs and creatures. 23 | [*] Weapons and armor will appear in the world but can’t be equipped. 24 | [*] Quests. 25 | [*] Scripts. 26 | [/list] 27 | 28 | [size=4][b]Usage[/b][/size] 29 | Follow the instructions below to convert the Fallout: New Vegas base game to Fallout 4. Be aware that the result will have a lot of rough edges. 30 | [list=1] 31 | [*] Download the latest release (from nexus or [url=https://github.com/terry-haire/fnv-to-fo4/releases]GitHub[/url]) and unzip it. 32 | [*] Install Fallout: New Vegas and launch it at least once. 33 | [*] Install Fallout 4 and launch it at least once. 34 | [*] Install Fallout 4: Creation Kit. 35 | [*] Run `convert.bat` to convert New Vegas models and plugin files. The converted files are saved in the `output` directory. This takes around 1-2 hours. 36 | [*] Copy over the contents of the `output` directory to the Fallout 4 Data directory. Or create a zip file of the `output` directory and open it with a mod manager. 37 | [*] Allow mods in Fallout 4 ([url=https://wiki.nexusmods.com/index.php/Fallout_4_Mod_Installation]source[/url]). 38 | [*] Activate the FalloutNV.esm plugin in Fallout 4. 39 | [*] Launch Fallout 4, open the console and type `coc Goodsprings` to teleport to Fallout New Vegas. 40 | [/list] 41 | 42 | [size=4][b]GitHub[/b][/size] 43 | [list] 44 | [*] Follow the project on GitHub to get the latest updates: [url=https://github.com/terry-haire/fnv-to-fo4]https://github.com/terry-haire/fnv-to-fo4[/url] 45 | [*] This project is 100% open source. Anyone is welcome and invited to contribute. 46 | [/list] 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Fallout 3 / Fallout: New Vegas to Fallout 4 converter

2 | 3 |
4 | 5 | [![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/terry-haire/fnv-to-fo4/total)](https://github.com/terry-haire/fnv-to-fo4/releases) 6 | [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/terry-haire/fnv-to-fo4/main.yml)](https://github.com/terry-haire/fnv-to-fo4/actions) 7 | [![Discord](https://img.shields.io/discord/1179975442275500122?link=https%3A%2F%2Fdiscord.gg%2F5VcMTMVzgb&logo=discord)](https://discord.gg/5VcMTMVzgb) 8 | [![License: GPL v3](https://img.shields.io/badge/license-GPLv3-blue.svg)](LICENSE) 9 | [![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCPHhhWa28pUJQ-7TCaP2q7g?link=https%3A%2F%2Fwww.youtube.com%2F%40FNVtoFO4)](https://www.youtube.com/@FNVtoFO4) 10 | 11 |
12 | 13 | Image 1 description 14 | 15 | # Nexus 16 | https://www.nexusmods.com/fallout4/mods/75425 17 | 18 | # Features 19 | * Fully convert most models from Fallout 3 / Fallout: New Vegas to Fallout 4. 20 | * Partially convert plugin files (.esp/.esm) from Fallout 3 / Fallout: New Vegas to Fallout 4. 21 | 22 | # Usage 23 | 24 | 1. Download the latest release from https://github.com/terry-haire/fnv-to-fo4/releases and unzip it. 25 | 1. Install Fallout: New Vegas and launch it at least once. 26 | 1. Install Fallout 4 and launch it at least once. 27 | 1. Install Fallout 4: Creation Kit. 28 | 1. Run `fnv-to-fo4.exe` to convert New Vegas models and plugin files. The converted files are saved in the `output` directory. 29 | 1. Copy over the contents of the `output` directory to the Fallout 4 Data directory. Or create a zip file of the `output` directory and open it with a mod manager. 30 | 1. Allow mods in Fallout 4 (https://wiki.nexusmods.com/index.php/Fallout_4_Mod_Installation). 31 | 1. Activate the esm in Fallout 4. 32 | 1. Launch Fallout 4, open the console and type `coc Goodsprings` to teleport to Fallout New Vegas. 33 | 34 | # Development setup 35 | 36 | Make sure all submodules are present: 37 | ``` 38 | git submodule update --init --recursive 39 | ``` 40 | 41 | ## TES5Edit 42 | * Follow instructions from the TES5Edit discord to set up the IDE: https://gist.github.com/flayman/24b4326fd451f1200d2c199a1bf62fa1 43 | 44 | ## Nifskope 45 | * Follow the instructions here: https://github.com/niftools/nifskope/wiki/Compiling-with-Qt-Creator-(Windows) 46 | * Make sure to download the latest Qt5.* and not Qt6+ when using the online installer. 47 | 48 | ## Creation Kit 49 | 50 | Add the following to CreationKit.ini in the Fallout 4 directory to allow multiple masters to load. 51 | ```ini 52 | [General] 53 | bAllowMultipleMasterFiles=1 54 | bAllowMultipleMasterLoads=1 55 | ``` 56 | 57 | ## Debugging Tools 58 | * Buffout 4 (https://www.nexusmods.com/fallout4/mods/64880) 59 | -------------------------------------------------------------------------------- /src/gui/DeletePathThread.py: -------------------------------------------------------------------------------- 1 | import PySide6.QtCore as QtCore 2 | from pathlib import Path 3 | import traceback 4 | from gui_exceptions import InterruptException 5 | import os 6 | 7 | 8 | class DeletePathThread(QtCore.QThread): 9 | task_done = QtCore.Signal() 10 | output_received = QtCore.Signal(str) 11 | 12 | def __init__(self, paths: list[Path]): 13 | super().__init__() 14 | 15 | self.paths = paths 16 | self._stop_flag = False 17 | self.failed = False 18 | self.interrupted = False 19 | self.mutex = QtCore.QMutex() 20 | 21 | def run(self): 22 | try: 23 | for path in self.paths: 24 | self.stop_if_requested() 25 | 26 | self.output_received.emit(f"Deleting \"{path}\"...") 27 | 28 | if path.is_file(): 29 | # noinspection PyBroadException 30 | try: 31 | path.unlink() 32 | except Exception: 33 | traceback.print_exc() 34 | 35 | self.failed = True 36 | 37 | continue 38 | 39 | self.delete_all_in_directory(path) 40 | 41 | if path.exists(): 42 | # noinspection PyBroadException 43 | try: 44 | path.rmdir() 45 | except Exception: 46 | traceback.print_exc() 47 | 48 | self.failed = True 49 | except InterruptException: 50 | self.interrupted = True 51 | 52 | pass 53 | 54 | self.task_done.emit() 55 | 56 | def stop(self): 57 | self.mutex.lock() 58 | self._stop_flag = True 59 | self.mutex.unlock() 60 | 61 | def stop_if_requested(self): 62 | self.mutex.lock() 63 | 64 | if self._stop_flag: 65 | self.mutex.unlock() 66 | 67 | raise InterruptException() 68 | 69 | self.mutex.unlock() 70 | 71 | def delete_all_in_directory(self, root_dir): 72 | if not Path(root_dir).is_dir(): 73 | return 74 | 75 | # List all files and directories in the current directory 76 | for item in os.listdir(root_dir): 77 | self.stop_if_requested() 78 | 79 | item_path = os.path.join(root_dir, item) 80 | 81 | # If it's a directory, recursively delete its contents 82 | if os.path.isdir(item_path): 83 | self.delete_all_in_directory(item_path) 84 | 85 | # Once all contents of the directory are deleted, delete the 86 | # directory itself 87 | # noinspection PyBroadException 88 | try: 89 | os.rmdir(item_path) 90 | except Exception: 91 | traceback.print_exc() 92 | 93 | self.failed = True 94 | else: 95 | # Delete the file 96 | # noinspection PyBroadException 97 | try: 98 | os.remove(item_path) 99 | except Exception: 100 | traceback.print_exc() 101 | 102 | self.failed = True 103 | -------------------------------------------------------------------------------- /src/models-and-animations/elric/Settings/PCMeshes.esf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | 7 | Both 8 | LeaveAll 9 | 100 10 | 0.0001 11 | true 12 | false 13 | true 14 | false 15 | false 16 | true 17 | false 18 | true 19 | false 20 | true 21 | true 22 | false 23 | false 24 | true 25 | false 26 | false 27 | false 28 | false 29 | true 30 | true 31 | false 32 | true 33 | false 34 | true 35 | false 36 | true 37 | 38 | true 39 | false 40 | 41 | 42 | PC 43 | NONE 44 | true 45 | false 46 | true 47 | NONE 48 | 1024 49 | false 50 | false 51 | 52 | 53 | .\Processed\ 54 | true 55 | .\Settings\PCFilter.cs 56 | false 57 | .\Logs\PCMeshes-%m-%d-%y_%h-%n-%s.elf 58 | true 59 | true 60 | true 61 | false 62 | true 63 | .\Source\Meshes\ 64 | PC 65 | 66 | 67 | -------------------------------------------------------------------------------- /bin/bsab/BSA Browser.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | C:\ 15 | 16 | 17 | 30 18 | 19 | 20 | True 21 | 22 | 23 | True 24 | 25 | 26 | FilePath 27 | 28 | 29 | True 30 | 31 | 32 | False 33 | 34 | 35 | 36 | 37 | 38 | False 39 | 40 | 41 | 65000 42 | 43 | 44 | True 45 | 46 | 47 | FileList, FolderTree 48 | 49 | 50 | False 51 | 52 | 53 | False 54 | 55 | 56 | True 57 | 58 | 59 | True 60 | 61 | 62 | True 63 | 64 | 65 | True 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | .dds 76 | .bmp 77 | .png 78 | .jpg 79 | .txt 80 | .bat 81 | .xml 82 | .lst 83 | .psc 84 | .json 85 | 86 | 87 | 88 | 89 | False 90 | 91 | 92 | 1024, 1024 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachinestatic/ScreenLarge#0.BGSM: -------------------------------------------------------------------------------- 1 | { 2 | "UnkInt1": 0, 3 | "bAlphaTest": false, 4 | "bAnisoLighting": false, 5 | "bAssumeShadowmask": false, 6 | "bBackLighting": false, 7 | "bCastShadows": true, 8 | "bCustomPorosity": false, 9 | "bDecal": false, 10 | "bDecalNoFade": false, 11 | "bDepthBias": false, 12 | "bDissolveFade": false, 13 | "bEmitEnabled": false, 14 | "bEnableEditorAlphaRef": false, 15 | "bEnvironmentMapping": false, 16 | "bEnvironmentMappingEye": false, 17 | "bEnvironmentMappingWindow": false, 18 | "bExternalEmittance": false, 19 | "bFacegen": false, 20 | "bGlowmap": false, 21 | "bGrayscaleToPaletteColor": false, 22 | "bHair": false, 23 | "bHideSecret": false, 24 | "bModelSpaceNormals": false, 25 | "bNonOccluder": false, 26 | "bPBR": false, 27 | "bReceiveShadows": false, 28 | "bRefraction": false, 29 | "bRimLighting": false, 30 | "bScreenSpaceReflections": false, 31 | "bSkewSpecularAlpha": false, 32 | "bSkinTint": false, 33 | "bSpecularEnabled": false, 34 | "bSubsurfaceLighting": false, 35 | "bTerrain": false, 36 | "bTessellate": false, 37 | "bTileU": true, 38 | "bTileV": true, 39 | "bTranslucency": false, 40 | "bTranslucencyMixAlbedoWithSubsurfaceColor": false, 41 | "bTranslucencyThickObject": false, 42 | "bTree": false, 43 | "bTwoSided": false, 44 | "bUseAdaptativeEmissive": false, 45 | "bWetnessControl_ScreenSpaceReflections": false, 46 | "bWriteMaskAlbedo": false, 47 | "bWriteMaskAmbientOcclusion": false, 48 | "bWriteMaskEmissive": false, 49 | "bWriteMaskGloss": false, 50 | "bWriteMaskNormal": false, 51 | "bWriteMaskSpecular": false, 52 | "bZBufferTest": true, 53 | "bZBufferWrite": true, 54 | "cEmittanceColor": "#000000", 55 | "cHairTintColor": "#808080", 56 | "cSpecularColor": "#ffffff", 57 | "cTranslucencySubsurfaceColor": "#000000", 58 | "eAlphaBlendMode": "None", 59 | "fAdaptativeEmissive_ExposureOffset": 0, 60 | "fAdaptativeEmissive_FinalExposureMax": 0, 61 | "fAdaptativeEmissive_FinalExposureMin": 0, 62 | "fAlpha": 1, 63 | "fAlphaTestRef": 128, 64 | "fBackLightPower": 0, 65 | "fDisplacementTextureBias": 0, 66 | "fDisplacementTextureScale": 1, 67 | "fEmittanceMult": 1, 68 | "fEnvironmentMappingMaskScale": 1, 69 | "fFresnelPower": 5, 70 | "fGrayscaleToPaletteScale": 0, 71 | "fLumEmittance": 0, 72 | "fPorosityValue": 0, 73 | "fRefractionFalloff": 0, 74 | "fRefractionPower": 0, 75 | "fRimPower": 0, 76 | "fSmoothness": 1, 77 | "fSpecularMult": 0, 78 | "fSubsurfaceLightingRolloff": 0.30000001192092896, 79 | "fTerrainRotationAngle": 0, 80 | "fTerrainThresholdFalloff": 0, 81 | "fTerrainTilingDistance": 0, 82 | "fTessellationBaseFactor": 0, 83 | "fTessellationFadeDistance": 0, 84 | "fTessellationPnScale": 0, 85 | "fTranslucencyTransmissiveScale": 0, 86 | "fTranslucencyTurbulence": 0, 87 | "fUOffset": 0, 88 | "fUScale": 1, 89 | "fVOffset": 0, 90 | "fVScale": 1, 91 | "fWetnessControl_EnvMapScale": -1, 92 | "fWetnessControl_FresnelPower": -1, 93 | "fWetnessControl_Metalness": -1, 94 | "fWetnessControl_SpecMinvar": -1, 95 | "fWetnessControl_SpecPowerScale": -1, 96 | "fWetnessControl_SpecScale": -1, 97 | "sDiffuseTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine.dds", 98 | "sDisplacementTexture": "", 99 | "sDistanceFieldAlphaTexture": "", 100 | "sEnvmapTexture": "", 101 | "sFlowTexture": "", 102 | "sGlowTexture": "", 103 | "sGreyscaleTexture": "", 104 | "sInnerLayerTexture": "", 105 | "sLightingTexture": "", 106 | "sNormalTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine_n.dds", 107 | "sRootMaterialPath": "", 108 | "sSmoothSpecTexture": "", 109 | "sSpecularTexture": "", 110 | "sWrinklesTexture": "" 111 | } 112 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachinestatic/ScreenFlicker#0.BGSM: -------------------------------------------------------------------------------- 1 | { 2 | "UnkInt1": 0, 3 | "bAlphaTest": false, 4 | "bAnisoLighting": false, 5 | "bAssumeShadowmask": false, 6 | "bBackLighting": false, 7 | "bCastShadows": true, 8 | "bCustomPorosity": false, 9 | "bDecal": false, 10 | "bDecalNoFade": false, 11 | "bDepthBias": false, 12 | "bDissolveFade": false, 13 | "bEmitEnabled": false, 14 | "bEnableEditorAlphaRef": false, 15 | "bEnvironmentMapping": false, 16 | "bEnvironmentMappingEye": false, 17 | "bEnvironmentMappingWindow": false, 18 | "bExternalEmittance": false, 19 | "bFacegen": false, 20 | "bGlowmap": false, 21 | "bGrayscaleToPaletteColor": false, 22 | "bHair": false, 23 | "bHideSecret": false, 24 | "bModelSpaceNormals": false, 25 | "bNonOccluder": false, 26 | "bPBR": false, 27 | "bReceiveShadows": false, 28 | "bRefraction": false, 29 | "bRimLighting": false, 30 | "bScreenSpaceReflections": false, 31 | "bSkewSpecularAlpha": false, 32 | "bSkinTint": false, 33 | "bSpecularEnabled": false, 34 | "bSubsurfaceLighting": false, 35 | "bTerrain": false, 36 | "bTessellate": false, 37 | "bTileU": true, 38 | "bTileV": true, 39 | "bTranslucency": false, 40 | "bTranslucencyMixAlbedoWithSubsurfaceColor": false, 41 | "bTranslucencyThickObject": false, 42 | "bTree": false, 43 | "bTwoSided": false, 44 | "bUseAdaptativeEmissive": false, 45 | "bWetnessControl_ScreenSpaceReflections": false, 46 | "bWriteMaskAlbedo": false, 47 | "bWriteMaskAmbientOcclusion": false, 48 | "bWriteMaskEmissive": false, 49 | "bWriteMaskGloss": false, 50 | "bWriteMaskNormal": false, 51 | "bWriteMaskSpecular": false, 52 | "bZBufferTest": true, 53 | "bZBufferWrite": true, 54 | "cEmittanceColor": "#000000", 55 | "cHairTintColor": "#808080", 56 | "cSpecularColor": "#ffffff", 57 | "cTranslucencySubsurfaceColor": "#000000", 58 | "eAlphaBlendMode": "None", 59 | "fAdaptativeEmissive_ExposureOffset": 0, 60 | "fAdaptativeEmissive_FinalExposureMax": 0, 61 | "fAdaptativeEmissive_FinalExposureMin": 0, 62 | "fAlpha": 1, 63 | "fAlphaTestRef": 128, 64 | "fBackLightPower": 0, 65 | "fDisplacementTextureBias": 0, 66 | "fDisplacementTextureScale": 1, 67 | "fEmittanceMult": 1, 68 | "fEnvironmentMappingMaskScale": 1, 69 | "fFresnelPower": 5, 70 | "fGrayscaleToPaletteScale": 0, 71 | "fLumEmittance": 0, 72 | "fPorosityValue": 0, 73 | "fRefractionFalloff": 0, 74 | "fRefractionPower": 0, 75 | "fRimPower": 0, 76 | "fSmoothness": 1, 77 | "fSpecularMult": 0, 78 | "fSubsurfaceLightingRolloff": 0.30000001192092896, 79 | "fTerrainRotationAngle": 0, 80 | "fTerrainThresholdFalloff": 0, 81 | "fTerrainTilingDistance": 0, 82 | "fTessellationBaseFactor": 0, 83 | "fTessellationFadeDistance": 0, 84 | "fTessellationPnScale": 0, 85 | "fTranslucencyTransmissiveScale": 0, 86 | "fTranslucencyTurbulence": 0, 87 | "fUOffset": 0, 88 | "fUScale": 1, 89 | "fVOffset": 0, 90 | "fVScale": 1, 91 | "fWetnessControl_EnvMapScale": -1, 92 | "fWetnessControl_FresnelPower": -1, 93 | "fWetnessControl_Metalness": -1, 94 | "fWetnessControl_SpecMinvar": -1, 95 | "fWetnessControl_SpecPowerScale": -1, 96 | "fWetnessControl_SpecScale": -1, 97 | "sDiffuseTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine.dds", 98 | "sDisplacementTexture": "", 99 | "sDistanceFieldAlphaTexture": "", 100 | "sEnvmapTexture": "", 101 | "sFlowTexture": "", 102 | "sGlowTexture": "", 103 | "sGreyscaleTexture": "", 104 | "sInnerLayerTexture": "", 105 | "sLightingTexture": "", 106 | "sNormalTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine_n.dds", 107 | "sRootMaterialPath": "", 108 | "sSmoothSpecTexture": "", 109 | "sSpecularTexture": "", 110 | "sWrinklesTexture": "" 111 | } 112 | -------------------------------------------------------------------------------- /src/data/FalloutNV.esm/materials/new_vegas/clutter/ssvendingmachine/ssvendingmachinestatic/ssVendingMachine1#0.BGSM: -------------------------------------------------------------------------------- 1 | { 2 | "UnkInt1": 0, 3 | "bAlphaTest": false, 4 | "bAnisoLighting": false, 5 | "bAssumeShadowmask": false, 6 | "bBackLighting": false, 7 | "bCastShadows": true, 8 | "bCustomPorosity": false, 9 | "bDecal": false, 10 | "bDecalNoFade": false, 11 | "bDepthBias": false, 12 | "bDissolveFade": false, 13 | "bEmitEnabled": false, 14 | "bEnableEditorAlphaRef": false, 15 | "bEnvironmentMapping": false, 16 | "bEnvironmentMappingEye": false, 17 | "bEnvironmentMappingWindow": false, 18 | "bExternalEmittance": false, 19 | "bFacegen": false, 20 | "bGlowmap": false, 21 | "bGrayscaleToPaletteColor": false, 22 | "bHair": false, 23 | "bHideSecret": false, 24 | "bModelSpaceNormals": false, 25 | "bNonOccluder": false, 26 | "bPBR": false, 27 | "bReceiveShadows": false, 28 | "bRefraction": false, 29 | "bRimLighting": false, 30 | "bScreenSpaceReflections": false, 31 | "bSkewSpecularAlpha": false, 32 | "bSkinTint": false, 33 | "bSpecularEnabled": false, 34 | "bSubsurfaceLighting": false, 35 | "bTerrain": false, 36 | "bTessellate": false, 37 | "bTileU": true, 38 | "bTileV": true, 39 | "bTranslucency": false, 40 | "bTranslucencyMixAlbedoWithSubsurfaceColor": false, 41 | "bTranslucencyThickObject": false, 42 | "bTree": false, 43 | "bTwoSided": false, 44 | "bUseAdaptativeEmissive": false, 45 | "bWetnessControl_ScreenSpaceReflections": false, 46 | "bWriteMaskAlbedo": false, 47 | "bWriteMaskAmbientOcclusion": false, 48 | "bWriteMaskEmissive": false, 49 | "bWriteMaskGloss": false, 50 | "bWriteMaskNormal": false, 51 | "bWriteMaskSpecular": false, 52 | "bZBufferTest": true, 53 | "bZBufferWrite": true, 54 | "cEmittanceColor": "#000000", 55 | "cHairTintColor": "#808080", 56 | "cSpecularColor": "#ffffff", 57 | "cTranslucencySubsurfaceColor": "#000000", 58 | "eAlphaBlendMode": "None", 59 | "fAdaptativeEmissive_ExposureOffset": 0, 60 | "fAdaptativeEmissive_FinalExposureMax": 0, 61 | "fAdaptativeEmissive_FinalExposureMin": 0, 62 | "fAlpha": 1, 63 | "fAlphaTestRef": 128, 64 | "fBackLightPower": 0, 65 | "fDisplacementTextureBias": 0, 66 | "fDisplacementTextureScale": 1, 67 | "fEmittanceMult": 1, 68 | "fEnvironmentMappingMaskScale": 1, 69 | "fFresnelPower": 5, 70 | "fGrayscaleToPaletteScale": 0, 71 | "fLumEmittance": 0, 72 | "fPorosityValue": 0, 73 | "fRefractionFalloff": 0, 74 | "fRefractionPower": 0, 75 | "fRimPower": 0, 76 | "fSmoothness": 1, 77 | "fSpecularMult": 0, 78 | "fSubsurfaceLightingRolloff": 0.30000001192092896, 79 | "fTerrainRotationAngle": 0, 80 | "fTerrainThresholdFalloff": 0, 81 | "fTerrainTilingDistance": 0, 82 | "fTessellationBaseFactor": 0, 83 | "fTessellationFadeDistance": 0, 84 | "fTessellationPnScale": 0, 85 | "fTranslucencyTransmissiveScale": 0, 86 | "fTranslucencyTurbulence": 0, 87 | "fUOffset": 0, 88 | "fUScale": 1, 89 | "fVOffset": 0, 90 | "fVScale": 1, 91 | "fWetnessControl_EnvMapScale": -1, 92 | "fWetnessControl_FresnelPower": -1, 93 | "fWetnessControl_Metalness": -1, 94 | "fWetnessControl_SpecMinvar": -1, 95 | "fWetnessControl_SpecPowerScale": -1, 96 | "fWetnessControl_SpecScale": -1, 97 | "sDiffuseTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine.dds", 98 | "sDisplacementTexture": "", 99 | "sDistanceFieldAlphaTexture": "", 100 | "sEnvmapTexture": "", 101 | "sFlowTexture": "", 102 | "sGlowTexture": "", 103 | "sGreyscaleTexture": "", 104 | "sInnerLayerTexture": "", 105 | "sLightingTexture": "", 106 | "sNormalTexture": "new_vegas\\clutter\\ssvendingmachine\\ssVendingMachine_n.dds", 107 | "sRootMaterialPath": "", 108 | "sSmoothSpecTexture": "", 109 | "sSpecularTexture": "", 110 | "sWrinklesTexture": "" 111 | } 112 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | on: 2 | workflow_dispatch: 3 | push: 4 | branches: 5 | - 'main' 6 | pull_request: 7 | branches: 8 | - 'main' 9 | 10 | env: 11 | SOURCE_DIR: ${{ github.workspace }} 12 | QT_VERSION: 5.9.9 13 | ARTIFACT: build-assets 14 | 15 | name: Create Release 16 | 17 | jobs: 18 | build: 19 | runs-on: windows-latest 20 | 21 | steps: 22 | - name: Checkout code 23 | uses: actions/checkout@v2 24 | 25 | - name: Set up Python 26 | uses: actions/setup-python@v2 27 | with: 28 | python-version: 3.11 29 | 30 | - name: Install dependencies 31 | working-directory: "${{ env.SOURCE_DIR }}/src/gui" 32 | run: | 33 | pip install cx-Freeze 34 | pip install -r requirements.txt 35 | 36 | - name: Freeze the application 37 | working-directory: "${{ env.SOURCE_DIR }}/src/gui" 38 | run: python setup.py build 39 | 40 | - name: Upload Artifact 41 | uses: actions/upload-artifact@v2 42 | with: 43 | name: windows-app 44 | path: "${{ env.SOURCE_DIR }}/src/gui/build/exe.win-amd64-3.11" 45 | 46 | release: 47 | name: Release 48 | runs-on: ubuntu-latest 49 | needs: [build] 50 | 51 | steps: 52 | - name: Checkout repo 53 | uses: actions/checkout@v2 54 | with: 55 | submodules: false 56 | lfs: true 57 | 58 | - id: download-nifskope-converter 59 | uses: robinraju/release-downloader@v1.8 60 | with: 61 | repository: "terry-haire/nifskope" 62 | latest: true 63 | out-file-path: "${{ env.SOURCE_DIR }}/build/nifskope_converter/release/" 64 | extract: true 65 | 66 | - id: download-xedit-converter 67 | uses: robinraju/release-downloader@v1.8 68 | with: 69 | repository: "terry-haire/TES5Edit" 70 | latest: true 71 | out-file-path: "${{ env.SOURCE_DIR }}/build/xedit_converter/" 72 | extract: true 73 | 74 | - name: Download windows-app artifact 75 | uses: actions/download-artifact@v2 76 | with: 77 | name: windows-app 78 | path: ${{ runner.temp }}/windows-app 79 | 80 | - name: Zip Folder 81 | shell: bash 82 | working-directory: ${{ env.SOURCE_DIR }} 83 | run: | 84 | rm "${{ fromJson(steps.download-nifskope-converter.outputs.downloaded_files)[0] }}" 85 | rm "${{ fromJson(steps.download-xedit-converter.outputs.downloaded_files)[0] }}" 86 | 87 | mkdir ${{ runner.temp }}/assets 88 | 89 | cd ${{ runner.temp }}/windows-app 90 | zip -r ${{ runner.temp }}/assets/${{ env.ARTIFACT }}.zip ./* 91 | 92 | cd ${{ env.SOURCE_DIR }} 93 | zip -r ${{ runner.temp }}/assets/${{ env.ARTIFACT }}.zip \ 94 | ./build/nifskope_converter/release/ \ 95 | ./build/xedit_converter/ \ 96 | ./src/models-and-animations/elric/ \ 97 | ./src/data/ \ 98 | ./src/plugins/xEdit/ \ 99 | ./src/gui/templates.json \ 100 | ./LICENSE \ 101 | ./README.md \ 102 | ./images/ \ 103 | ./bin/ 104 | 105 | - name: Save build artifact 106 | uses: actions/upload-artifact@v3 107 | with: 108 | name: ${{ env.ARTIFACT }} 109 | path: | 110 | ${{ runner.temp }}/assets/${{ env.ARTIFACT }}.zip 111 | 112 | # - name: Conventional Changelog Action 113 | # uses: TriPSs/conventional-changelog-action@v3 114 | # with: 115 | # github-token: ${{ secrets.github_token }} 116 | 117 | - name: Create Release 118 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' 119 | id: create-release 120 | uses: actions/create-release@v1 121 | # if: ${{ steps.changelog.outputs.skipped == 'false' }} 122 | env: 123 | GITHUB_TOKEN: ${{ secrets.github_token }} 124 | with: 125 | # tag_name: ${{ steps.changelog.outputs.tag }} 126 | # release_name: ${{ steps.changelog.outputs.tag }} 127 | # body: ${{ steps.changelog.outputs.clean_changelog }} 128 | tag_name: v${{ github.run_number }} 129 | release_name: v${{ github.run_number }} 130 | draft: false 131 | prerelease: true 132 | 133 | - name: Upload Release Asset 134 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' 135 | uses: actions/upload-release-asset@v1 136 | env: 137 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 138 | with: 139 | upload_url: ${{ steps.create-release.outputs.upload_url }} 140 | asset_path: ${{ runner.temp }}/assets/${{ env.ARTIFACT }}.zip 141 | asset_name: fnv-to-fo4-v${{ github.run_number }}.zip 142 | asset_content_type: application/zip 143 | -------------------------------------------------------------------------------- /src/gui/templates.json: -------------------------------------------------------------------------------- 1 | { 2 | "Base game": { 3 | "plugins": [ 4 | { 5 | "name": "FalloutNV.esm", 6 | "resources": [ 7 | "Fallout - Meshes.bsa", 8 | "Fallout - Textures.bsa", 9 | "Fallout - Textures2.bsa", 10 | "Fallout - Misc.bsa", 11 | "Fallout - Sound.bsa", 12 | "Update.bsa", 13 | "Fallout - Voices1.bsa" 14 | ] 15 | } 16 | ] 17 | }, 18 | "Base game + DLC": { 19 | "plugins": [ 20 | { 21 | "name": "FalloutNV.esm", 22 | "resources": [ 23 | "Fallout - Meshes.bsa", 24 | "Fallout - Textures.bsa", 25 | "Fallout - Textures2.bsa", 26 | "Fallout - Misc.bsa", 27 | "Fallout - Sound.bsa", 28 | "Update.bsa", 29 | "Fallout - Voices1.bsa" 30 | ] 31 | }, 32 | { 33 | "name": "CaravanPack.esm", 34 | "resources": [ 35 | "CaravanPack.nam", 36 | "CaravanPack - Main.bsa" 37 | ] 38 | }, 39 | { 40 | "name": "ClassicPack.esm", 41 | "resources": [ 42 | "ClassicPack.nam", 43 | "ClassicPack - Main.bsa" 44 | ] 45 | }, 46 | { 47 | "name": "DeadMoney.esm", 48 | "resources": [ 49 | "DEADMONEY.NAM", 50 | "DeadMoney - Main.bsa", 51 | "DeadMoney - Sounds.bsa" 52 | ] 53 | }, 54 | { 55 | "name": "GunRunnersArsenal.esm", 56 | "resources": [ 57 | "GunRunnersArsenal - Main.bsa", 58 | "GunRunnersArsenal - Sounds.bsa" 59 | ] 60 | }, 61 | { 62 | "name": "HonestHearts.esm", 63 | "resources": [ 64 | "HonestHearts - Main.bsa", 65 | "HonestHearts - Sounds.bsa" 66 | ] 67 | }, 68 | { 69 | "name": "LonesomeRoad.esm", 70 | "resources": [ 71 | "LonesomeRoad - Main.bsa", 72 | "LonesomeRoad - Sounds.bsa" 73 | ] 74 | }, 75 | { 76 | "name": "MercenaryPack.esm", 77 | "resources": [ 78 | "MercenaryPack - Main.bsa" 79 | ] 80 | }, 81 | { 82 | "name": "OldWorldBlues.esm", 83 | "resources": [ 84 | "OldWorldBlues - Main.bsa", 85 | "OldWorldBlues - Sounds.bsa" 86 | ] 87 | }, 88 | { 89 | "name": "TribalPack.esm", 90 | "resources": [ 91 | "TribalPack - Main.bsa" 92 | ] 93 | } 94 | ] 95 | }, 96 | "Tale of Two Wastelands": { 97 | "plugins": [ 98 | { 99 | "name": "FalloutNV.esm", 100 | "resources": [ 101 | "Fallout - Meshes.bsa", 102 | "Fallout - Textures.bsa", 103 | "Fallout - Textures2.bsa", 104 | "Fallout - Misc.bsa", 105 | "Fallout - Sound.bsa", 106 | "Update.bsa", 107 | "Fallout - Voices1.bsa" 108 | ] 109 | }, 110 | { 111 | "name": "CaravanPack.esm", 112 | "resources": [ 113 | "CaravanPack.nam", 114 | "CaravanPack - Main.bsa" 115 | ] 116 | }, 117 | { 118 | "name": "ClassicPack.esm", 119 | "resources": [ 120 | "ClassicPack.nam", 121 | "ClassicPack - Main.bsa" 122 | ] 123 | }, 124 | { 125 | "name": "DeadMoney.esm", 126 | "resources": [ 127 | "DEADMONEY.NAM", 128 | "DeadMoney - Main.bsa", 129 | "DeadMoney - Sounds.bsa" 130 | ] 131 | }, 132 | { 133 | "name": "GunRunnersArsenal.esm", 134 | "resources": [ 135 | "GunRunnersArsenal - Main.bsa", 136 | "GunRunnersArsenal - Sounds.bsa" 137 | ] 138 | }, 139 | { 140 | "name": "HonestHearts.esm", 141 | "resources": [ 142 | "HonestHearts - Main.bsa", 143 | "HonestHearts - Sounds.bsa" 144 | ] 145 | }, 146 | { 147 | "name": "LonesomeRoad.esm", 148 | "resources": [ 149 | "LonesomeRoad - Main.bsa", 150 | "LonesomeRoad - Sounds.bsa" 151 | ] 152 | }, 153 | { 154 | "name": "MercenaryPack.esm", 155 | "resources": [ 156 | "MercenaryPack - Main.bsa" 157 | ] 158 | }, 159 | { 160 | "name": "OldWorldBlues.esm", 161 | "resources": [ 162 | "OldWorldBlues - Main.bsa", 163 | "OldWorldBlues - Sounds.bsa" 164 | ] 165 | }, 166 | { 167 | "name": "TribalPack.esm", 168 | "resources": [ 169 | "TribalPack - Main.bsa" 170 | ] 171 | }, 172 | { 173 | "name": "Fallout3.esm", 174 | "resources": [ 175 | "Fallout3 - MenuVoices.bsa", 176 | "Fallout3 - Meshes.bsa", 177 | "Fallout3 - Sound.bsa", 178 | "Fallout3 - Textures.bsa", 179 | "Fallout3 - Voices.bsa", 180 | "Fallout3.NAM" 181 | ] 182 | }, 183 | { 184 | "name": "Anchorage.esm", 185 | "resources": [ 186 | "Anchorage - Main.bsa", 187 | "Anchorage - Sounds.bsa", 188 | "Anchorage.NAM" 189 | ] 190 | }, 191 | { 192 | "name": "ThePitt.esm", 193 | "resources": [ 194 | "ThePitt - Main.bsa", 195 | "ThePitt - Sounds.bsa", 196 | "ThePitt.NAM" 197 | ] 198 | }, 199 | { 200 | "name": "BrokenSteel.esm", 201 | "resources": [ 202 | "BrokenSteel - Main.bsa", 203 | "BrokenSteel - Sounds.bsa", 204 | "BrokenSteel.NAM" 205 | ] 206 | }, 207 | { 208 | "name": "PointLookout.esm", 209 | "resources": [ 210 | "PointLookout - Main.bsa", 211 | "PointLookout - Sounds.bsa", 212 | "PointLookout.NAM" 213 | ] 214 | }, 215 | { 216 | "name": "Zeta.esm", 217 | "resources": [ 218 | "Zeta - Main.bsa", 219 | "Zeta - Sounds.bsa", 220 | "Zeta.NAM" 221 | ] 222 | }, 223 | { 224 | "name": "TaleOfTwoWastelands.esm", 225 | "resources": [ 226 | "TaleOfTwoWastelands - Main.bsa", 227 | "TaleOfTwoWastelands.NAM" 228 | ] 229 | }, 230 | { 231 | "name": "YUPTTW.esm", 232 | "resources": [ 233 | "YUPTTW - Main.bsa", 234 | "YUPTTW - Sounds.bsa", 235 | "YUPTTW.NAM" 236 | ] 237 | } 238 | ] 239 | } 240 | } -------------------------------------------------------------------------------- /src/convert.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$game 3 | ) 4 | 5 | Write-Host "Get / create paths... " -NoNewline 6 | 7 | # Initialize an ArrayList 8 | $argumentListMeshes = New-Object 'System.Collections.ArrayList' 9 | $argumentListTextures = New-Object 'System.Collections.ArrayList' 10 | 11 | # Add static items 12 | [void]$argumentListMeshes.Add("-e") 13 | [void]$argumentListMeshes.Add("-f") 14 | [void]$argumentListMeshes.Add("meshes") 15 | 16 | [void]$argumentListTextures.Add("-e") 17 | [void]$argumentListTextures.Add("-f") 18 | [void]$argumentListTextures.Add("textures") 19 | 20 | # Get paths. 21 | $fo4Path = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Wow6432Node\Bethesda Softworks\Fallout4" -Name "installed path" -ErrorAction Stop 22 | 23 | # FO3. 24 | if ($game -eq "fo3") { 25 | $gamePath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Wow6432Node\Bethesda Softworks\fallout3" -Name "installed path" -ErrorAction Stop 26 | $xEditMode = "-FO3" 27 | $xEditPlugin = "Fallout3.esm" 28 | 29 | [void]$argumentListMeshes.Add("`"$gamePath\Data\Fallout - Meshes.bsa`"") 30 | 31 | [void]$argumentListTextures.Add("`"$gamePath\Data\Fallout - Textures.bsa`"") 32 | # FNV. 33 | } else { 34 | $gamePath = Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Wow6432Node\Bethesda Softworks\falloutnv" -Name "installed path" -ErrorAction Stop 35 | $xEditMode = "-FNV" 36 | $xEditPlugin = "FalloutNV.esm" 37 | 38 | [void]$argumentListMeshes.Add("`"$gamePath\Data\Fallout - Meshes.bsa`"") 39 | [void]$argumentListMeshes.Add("`"$gamePath\Data\Update.bsa`"") 40 | 41 | [void]$argumentListTextures.Add("`"$gamePath\Data\Fallout - Textures.bsa`"") 42 | [void]$argumentListTextures.Add("`"$gamePath\Data\Fallout - Textures2.bsa`"") 43 | [void]$argumentListTextures.Add("`"$gamePath\Data\Update.bsa`"") 44 | } 45 | 46 | $elricWorkingDirectory = Resolve-Path -Path "${PSScriptRoot}\models-and-animations\elric\" -ErrorAction Stop 47 | $nifSkopeConverterPath = "${PSScriptRoot}\..\build\nifskope_converter\release\NifSkope.exe" 48 | $nifSkopeConverterDebugPath = "${PSScriptRoot}\..\build\nifskope_converter\debug\NifSkope.exe" 49 | 50 | # if (Test-Path $nifSkopeConverterDebugPath) { 51 | # $nifSkopeConverterPath = $nifSkopeConverterDebugPath 52 | # } 53 | 54 | # Create paths. 55 | $tempPath = New-Item -Path "${PSScriptRoot}\..\temp" -ItemType Directory -Force 56 | $extractedPath = New-Item -Path "${PSScriptRoot}\..\extracted" -ItemType Directory -Force 57 | $outputPath = New-Item -Path "${PSScriptRoot}\..\output" -ItemType Directory -Force 58 | $outputPathTextures = New-Item -Path "${PSScriptRoot}\..\output\textures" -ItemType Directory -Force 59 | $elricOutputPath = New-Item -Path "$outputPath\meshes" -ItemType Directory -Force 60 | 61 | [void]$argumentListMeshes.Add("`"$extractedPath`"") 62 | [void]$argumentListTextures.Add("`"$outputPathTextures`"") 63 | 64 | Write-Host "[DONE]" -ForegroundColor Green 65 | 66 | Write-Host "Extracting meshes... " -NoNewline 67 | Start-Process ` 68 | -FilePath "${PSScriptRoot}\..\bin\bsab\bsab.exe" ` 69 | -ArgumentList $argumentListMeshes ` 70 | -Wait ` 71 | -NoNewWindow ` 72 | -ErrorAction Stop 73 | Write-Host "Extracting meshes... " -NoNewline 74 | Write-Host "[DONE]" -ForegroundColor Green 75 | 76 | Write-Host "Extracting textures... " -NoNewline 77 | Rename-Item -Path "$outputPathTextures\new_vegas" -NewName "textures" -ErrorAction Ignore 78 | Start-Process ` 79 | -FilePath "${PSScriptRoot}\..\bin\bsab\bsab.exe" ` 80 | -ArgumentList $argumentListTextures ` 81 | -Wait ` 82 | -NoNewWindow ` 83 | -ErrorAction Stop 84 | takeown /f "$outputPathTextures\textures" 85 | Rename-Item -Path "$outputPathTextures\textures" -NewName "new_vegas" 86 | Write-Host "Extracting textures... " -NoNewline 87 | Write-Host "[DONE]" -ForegroundColor Green 88 | 89 | Write-Host "Converting meshes... " -NoNewline 90 | Start-Process ` 91 | -FilePath $nifSkopeConverterPath ` 92 | -ArgumentList ` 93 | "--convert", ` 94 | "`"$tempPath`"", ` 95 | "`"$extractedPath`"", ` 96 | "`"$extractedPath`"" ` 97 | -Wait ` 98 | -ErrorAction Stop 99 | Write-Host "[DONE]" -ForegroundColor Green 100 | 101 | # Remove meshes which crash elric. 102 | if ($game -eq "fo3") { 103 | $files = @( 104 | "meshes\new_vegas\architecture\megaton\megatonrampstraightreg.nif", 105 | "meshes\new_vegas\architecture\megaton\megatonrampstraightreg02.nif", 106 | "meshes\new_vegas\architecture\megaton\megatonrampstraightsml.nif", 107 | "meshes\new_vegas\architecture\megaton\megatonrampturn180reg.nif", 108 | "meshes\new_vegas\architecture\urban\streetdressing\busshelter01.nif", 109 | "meshes\new_vegas\architecture\urban\streetdressing\busshelter02.nif", 110 | "meshes\new_vegas\armor\eulogyjones\hateulogyjonesgo.nif", 111 | "meshes\new_vegas\armor\headgear\antagonizer\helmetantagonizergo.nif", 112 | "meshes\new_vegas\armor\headgear\chinesecommando\hatchinesecommandogo.nif", 113 | "meshes\new_vegas\armor\headgear\clownmask\m\clownmaskgo.nif", 114 | "meshes\new_vegas\armor\headgear\enclaveofficer\hatenclaveofficergo.nif", 115 | "meshes\new_vegas\armor\headgear\eyebothelmet\m\eyebothelmetgo.nif", 116 | "meshes\new_vegas\armor\headgear\hat1950slady\hat1950sladygo.nif", 117 | "meshes\new_vegas\armor\headgear\helmetraider02\helmetraider02go.nif", 118 | "meshes\new_vegas\armor\headgear\hat1950scap\hat1950sadultcapgo.nif", 119 | "meshes\new_vegas\armor\headgear\hockeymask\m\hockeymaskgo.nif", 120 | "meshes\new_vegas\armor\headgear\hoodoasisdruid\hoodoaisisdruidgo.nif", 121 | "meshes\new_vegas\armor\headgear\mechanist\helmetmechanistgo.nif", 122 | "meshes\new_vegas\armor\headgear\metalarmor\helmetmetalarmorfgo.nif", 123 | "meshes\new_vegas\armor\headgear\metalarmor\helmetmetalarmormgo.nif", 124 | "meshes\new_vegas\armor\headgear\partyhat\m\partyhatgo.nif", 125 | "meshes\new_vegas\armor\headgear\wastelandchild05\hatbaseballcapadultgo.nif", 126 | "meshes\new_vegas\armor\headgear\wastelandclothing01\helmetwastelandclothing01go.nif", 127 | "meshes\new_vegas\armor\headgear\wastelandclothing02\hatwastelandclothing02fgo.nif", 128 | "meshes\new_vegas\armor\headgear\wastelandclothing03\m\goggleswastelandclothing03go.nif", 129 | "meshes\new_vegas\armor\headgear\wastelandclothing04\f\goggleswastelandclothing04fgo.nif", 130 | "meshes\new_vegas\armor\headgear\wastelandclothing04\m\goggleswastelandclothing04mgo.nif", 131 | "meshes\new_vegas\armor\headgear\wastelandmerchant\hatwastelandmerchantgo.nif", 132 | "meshes\new_vegas\characters\hair\glassesblackrimmedgo.nif", 133 | "meshes\new_vegas\characters\hair\glassesdrligo.nif", 134 | "meshes\new_vegas\characters\hair\glassestortoiseshellgo.nif", 135 | "meshes\new_vegas\characters\hair\powderedwiggo.nif", 136 | "meshes\new_vegas\clutter\operatinglight01.nif", 137 | "meshes\new_vegas\clutter\babycarriage\babycarriageclean01.nif", 138 | "meshes\new_vegas\clutter\babycarriage\babycarriagedirty01.nif", 139 | "meshes\new_vegas\clutter\billiards\triangle.nif", 140 | "meshes\new_vegas\clutter\food\apple01.nif", 141 | "meshes\new_vegas\clutter\questitems\mq04tranquilitypod01.nif", 142 | "meshes\new_vegas\dungeons\metro\exterior\metrotunneltransdoorload01.nif", 143 | "meshes\new_vegas\dungeons\vault\halls\vdoor01.nif", 144 | "meshes\new_vegas\dungeons\vault\room\vrmoverseerdesk01.nif", 145 | "meshes\new_vegas\dungeons\vaultruined\clutter\operatinglightr01.nif", 146 | "meshes\new_vegas\dungeons\vaultruined\doors\vdoorr01.nif", 147 | "meshes\new_vegas\dungeons\vaultruined\room\vrmoverseerdeskr01.nif", 148 | "meshes\new_vegas\vehicles\truck01.nif", 149 | "meshes\new_vegas\vehicles\truck02.nif", 150 | "meshes\new_vegas\vehicles\truck03.nif", 151 | "meshes\new_vegas\vehicles\truck04.nif", 152 | "meshes\new_vegas\vehicles\truck05.nif", 153 | "meshes\new_vegas\vehicles\truck06.nif", 154 | "meshes\new_vegas\weapons\1handminedrop\minefrag.nif" 155 | ) 156 | 157 | foreach ($file in $files) { 158 | if (Test-Path -Path "$tempPath\$file") { 159 | Remove-Item -Path "$tempPath\$file" 160 | } 161 | } 162 | } 163 | 164 | Write-Host "Optimizing meshes... " -NoNewline 165 | 166 | for ($i=0; $i -lt 100; $i++) { 167 | Start-Process ` 168 | -FilePath "${fo4Path}\Tools\Elric\Elrich.exe" ` 169 | -ArgumentList ` 170 | "`".\Settings\PCMeshes.esf`"", ` 171 | "-ElricOptions.ConvertTarget=`"$tempPath\meshes`"", ` 172 | "-ElricOptions.OutputDirectory=`"$elricOutputPath`"" ` 173 | -WorkingDirectory $elricWorkingDirectory ` 174 | -Wait ` 175 | -ErrorAction Stop 176 | 177 | $sourceFiles = Get-ChildItem -Path "$tempPath\meshes" -Recurse -File 178 | $failed = $false 179 | 180 | $existingFiles = @() 181 | 182 | # Loop through each file and check if it exists in the destination directory 183 | foreach ($file in $sourceFiles) { 184 | $relativePath = $file.FullName.Substring("$tempPath\meshes".Length) 185 | $destPath = Join-Path -Path "$outputPath\meshes" -ChildPath $relativePath 186 | 187 | if (-not (Test-Path -Path $destPath -PathType Leaf)) { 188 | if (-not $failed) { 189 | Write-Host "[FAILED]" -ForegroundColor Red 190 | } 191 | 192 | Write-Host "meshes$relativePath" -ForegroundColor Red 193 | 194 | Remove-Item -Path $file 195 | 196 | $failed = $true 197 | 198 | Break 199 | } 200 | 201 | $existingFiles += $file 202 | } 203 | 204 | foreach ($file in $existingFiles) { 205 | Remove-Item -Path $file.FullName 206 | } 207 | 208 | if (-not $failed) { 209 | break 210 | } 211 | } 212 | 213 | Write-Host "[DONE]" -ForegroundColor Green 214 | 215 | Write-Host "Moving materials... " -NoNewline 216 | Move-Item -Path "$tempPath\materials" -Destination "$outputPath\materials" 217 | Write-Host "[DONE]" -ForegroundColor Green 218 | 219 | Write-Host "Copying data files... " -NoNewline 220 | Copy-Item -Path "${PSScriptRoot}\data\*" -Destination "$outputPath" -Recurse -Force 221 | Write-Host "[DONE]" -ForegroundColor Green 222 | 223 | Write-Host "Export FNV data... " -NoNewline 224 | Start-Process ` 225 | -FilePath "${PSScriptRoot}\..\build\xedit_converter\xEdit.exe" ` 226 | -ArgumentList ` 227 | $xEditMode, ` 228 | "-script:Extract", ` 229 | "-plugin:$xEditPlugin", ` 230 | "-nobuildrefs", ` 231 | "-autoload", ` 232 | "-autoexit", ` 233 | "-IKnowWhatImDoing" ` 234 | -WorkingDirectory "${PSScriptRoot}\..\build\xedit_converter" ` 235 | -Wait ` 236 | -ErrorAction Stop 237 | Write-Host "[DONE]" -ForegroundColor Green 238 | 239 | Write-Host "Import FNV data... " -NoNewline 240 | Start-Process ` 241 | -FilePath "${PSScriptRoot}\..\build\xedit_converter\xEdit.exe" ` 242 | -ArgumentList ` 243 | "-FO4", ` 244 | "-script:Import", ` 245 | "-plugin:Fallout4.esm", ` 246 | "-nobuildrefs", ` 247 | "-autoload", ` 248 | "-autoexit", ` 249 | "-IKnowWhatImDoing" ` 250 | -WorkingDirectory "${PSScriptRoot}\..\build\xedit_converter" ` 251 | -Wait ` 252 | -ErrorAction Stop 253 | Write-Host "[DONE]" -ForegroundColor Green 254 | 255 | Move-Item -Path "$fo4Path\Data\FalloutNV.esm" -Destination $outputPath 256 | 257 | $file = "$outputPath\FalloutNV.esm" 258 | $fileInfo = Get-Item $file 259 | 260 | if ($fileInfo.Length -lt 10MB) { 261 | Write-Host "FalloutNV.esm is not the right size. Please check the Fallout 4 Data folder for another esm file and rename it to FalloutNV.esm" -ForegroundColor Red 262 | } else { 263 | Write-Host "All steps completed" 264 | } 265 | -------------------------------------------------------------------------------- /bin/bsab/Licenses/ICSharpCode.TextEditor.Extended.txt: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | -------------------------------------------------------------------------------- /src/gui/WorkerThread.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import subprocess 4 | import time 5 | from pathlib import Path 6 | import sys 7 | from dataclasses import dataclass 8 | import json 9 | import select 10 | import queue 11 | import threading 12 | from typing import Callable 13 | import hashlib 14 | 15 | import PySide6.QtCore as QtCore 16 | 17 | from InstallerParams import InstallerParams 18 | from ProcessingDialog import ProcessingDialog 19 | from DeletePathThread import DeletePathThread 20 | from gui_exceptions import InterruptException 21 | from PluginData import PluginData 22 | 23 | # Create a STARTUPINFO object 24 | STARTUPINFO_NO_CONSOLE = subprocess.STARTUPINFO() 25 | STARTUPINFO_NO_CONSOLE.dwFlags |= subprocess.STARTF_USESHOWWINDOW 26 | STARTUPINFO_NO_CONSOLE.wShowWindow = subprocess.SW_HIDE 27 | 28 | LOOSE_FILES_PLUGIN_NAME = "Loose Files" 29 | 30 | 31 | @dataclass 32 | class ArchiveSettings: 33 | compression: str 34 | maxSizeMB: int 35 | _format: str 36 | name: str 37 | dir_names: list[str] 38 | 39 | 40 | class WorkerThread(QtCore.QThread): 41 | output_received = QtCore.Signal(str) 42 | exception_occurred = QtCore.Signal(Exception, type, object) 43 | task_done = QtCore.Signal() 44 | 45 | def __init__( 46 | self, 47 | fnv_path: Path, 48 | fo4_path: Path, 49 | extracted_path: Path, 50 | temp_path: Path, 51 | output_path: Path, 52 | resources: list[PluginData], 53 | installer_params: InstallerParams, 54 | ): 55 | super().__init__() 56 | 57 | # self.archives = [ 58 | # resource for resource in resources if resource.suffix == ".bsa"] 59 | # self.plugins = [ 60 | # resource for resource in resources 61 | # if resource.suffix in {".esp", ".esm"} 62 | # ] 63 | self.plugins = resources 64 | 65 | self.cwd = Path(os.getcwd()) 66 | self.output_path = output_path 67 | self.extracted_path = extracted_path 68 | self.temp_path = temp_path 69 | self.mutex = QtCore.QMutex() 70 | self.failed = False 71 | self.interrupted = False 72 | self._stop_flag = False 73 | self.installer_params = installer_params 74 | self.fnv_path = fnv_path 75 | self.fo4_path = fo4_path 76 | 77 | self.x_edit_converter_path = self.cwd / "build\\xedit_converter" 78 | self.x_edit_data_path = self.x_edit_converter_path / "data" 79 | self.x_edit_exe_path = self.x_edit_converter_path / "xEdit.exe" 80 | self.x_convert_exe_path = self.x_edit_converter_path / "xConvert.exe" 81 | 82 | def run(self): 83 | try: 84 | for plugin in self.plugins: 85 | if (self.fo4_path / "data" / plugin.name).exists(): 86 | continue 87 | 88 | if not self.installer_params.skip_bsas: 89 | bsas = [] 90 | loose_files = [] 91 | 92 | for path in plugin.resources: 93 | if path.suffix == ".bsa": 94 | bsas.append(path) 95 | else: 96 | loose_files.append(path) 97 | 98 | self.extract_bsas(bsas) 99 | 100 | self.extract_loose_files(loose_files) 101 | 102 | self.remove_crash_causing_files() 103 | 104 | if (self.extracted_path / "meshes").exists(): 105 | if not self.installer_params.skip_lod_settings: 106 | self.copy_lod_settings() 107 | 108 | if not self.installer_params.skip_meshes: 109 | self.convert_meshes() 110 | 111 | if self.installer_params.all_objects_cast_shadows: 112 | self.set_cast_shadows() 113 | 114 | if not self.installer_params.skip_optimize: 115 | self.optimize_meshes() 116 | 117 | self.move_materials() 118 | 119 | self.replace_data_files(plugin) 120 | 121 | if plugin.name != LOOSE_FILES_PLUGIN_NAME: 122 | # TODO: If loose files are used create a dummy esp so the 123 | # resources get loaded. 124 | if not self.installer_params.skip_ba2_creation: 125 | self.create_archive(name=plugin.path.stem) 126 | 127 | self.clear_temp_and_extracted() 128 | 129 | # if not self.installer_params.skip_data: 130 | # self.copy_data_files() 131 | 132 | if not self.installer_params.skip_plugin_convert: 133 | self.convert_plugin_data(plugin) 134 | 135 | if (not self.installer_params.skip_plugin_move and 136 | not self.installer_params.skip_plugin_convert): 137 | for plugin in self.plugins: 138 | if plugin.name == LOOSE_FILES_PLUGIN_NAME: 139 | continue 140 | 141 | self.move_plugin_to_output(plugin) 142 | except InterruptException: 143 | self.interrupted = True 144 | except Exception as e: 145 | self.failed = True 146 | 147 | exc_type, exc_value, tb = sys.exc_info() 148 | self.exception_occurred.emit(e, exc_type, tb) 149 | 150 | if self.installer_params.debug: 151 | raise 152 | 153 | self.task_done.emit() 154 | 155 | def stop(self): 156 | self.mutex.lock() 157 | self._stop_flag = True 158 | self.mutex.unlock() 159 | 160 | def stop_requested(self): 161 | self.mutex.lock() 162 | 163 | if self._stop_flag: 164 | self.mutex.unlock() 165 | 166 | return True 167 | 168 | self.mutex.unlock() 169 | 170 | return False 171 | 172 | def stop_if_requested(self): 173 | if self.stop_requested(): 174 | raise InterruptException() 175 | 176 | def set_cast_shadows(self): 177 | self.output_received.emit("Making all objects cast shadows...\n") 178 | 179 | path = self.temp_path / "materials" 180 | 181 | if not path.exists(): 182 | self.output_received.emit( 183 | "Making all objects cast shadows... [SKIPPED (no materials to process)]\n" 184 | ) 185 | 186 | return 187 | 188 | for root, dirs, files in os.walk(path): 189 | for file in files: 190 | self.stop_if_requested() 191 | 192 | with open(os.path.join(root, file), "r") as f: 193 | try: 194 | _dict = json.load(f) 195 | except json.JSONDecodeError: 196 | continue 197 | 198 | _dict["bCastShadows"] = True 199 | 200 | with open(os.path.join(root, file), "w") as f: 201 | json.dump(_dict, f, indent=4) 202 | 203 | self.output_received.emit("Making all objects cast shadows... [DONE]\n") 204 | 205 | def create_archive(self, name: str): 206 | self.output_received.emit("Creating archives...\n") 207 | 208 | archive2_path = self.fo4_path / "Tools" / "Archive2" / "Archive2.exe" 209 | 210 | # TODO: Create ba2 archives. 211 | # Change cwd to output directory when running. 212 | # & "C:\Program Files (x86)\Steam\steamapps\common\Fallout 4\Tools\Archive2\Archive2.exe" "C:\Users\TheHa\projects\fallout-related\FNV_to_FO4\output\meshes" -create="FalloutNV.ba2" -root="C:\Users\TheHa\projects\fallout-related\FNV_to_FO4\output" -format=General -compression=Default -maxSizeMB=1500 -tempFiles 213 | 214 | for archive_settings in [ 215 | ArchiveSettings( 216 | name="Main", 217 | compression="Default", 218 | maxSizeMB=4095, 219 | _format="General", 220 | dir_names=["meshes", "materials"], 221 | ), 222 | ArchiveSettings( 223 | name="Textures", 224 | compression="Default", 225 | maxSizeMB=4095, 226 | _format="DDS", 227 | dir_names=["textures"], 228 | ), 229 | ]: 230 | file_name = f"{name} - {archive_settings.name}.ba2" 231 | 232 | folder_paths_str = ",".join([ 233 | f"\"{str(self.output_path / dir_name)}\"" for dir_name in 234 | archive_settings.dir_names 235 | ]) 236 | 237 | cmd = ( 238 | f"\"{str(archive2_path)}\" " 239 | f"{folder_paths_str} " 240 | f"-create=\"{file_name}\" " 241 | f"-root=\"{str(self.output_path)}\" " 242 | f"-format={archive_settings._format} " 243 | f"-compression={archive_settings.compression} " 244 | f"-maxSizeMB={archive_settings.maxSizeMB} " 245 | "-tempFiles " 246 | ) 247 | 248 | self.run_frequent_output_task(cmd=cmd, cwd=self.output_path) 249 | 250 | self.output_received.emit("Creating archives... [DONE]\n") 251 | 252 | def delete_all_in_directory(self, root_dir): 253 | if not Path(root_dir).is_dir(): 254 | return 255 | 256 | # List all files and directories in the current directory 257 | for item in os.listdir(root_dir): 258 | self.stop_if_requested() 259 | 260 | item_path = os.path.join(root_dir, item) 261 | 262 | # If it's a directory, recursively delete its contents 263 | if os.path.isdir(item_path): 264 | self.delete_all_in_directory(item_path) 265 | 266 | os.rmdir(item_path) 267 | else: 268 | os.remove(item_path) 269 | 270 | def remove_paths(self, paths): 271 | for path in paths: 272 | self.stop_if_requested() 273 | 274 | self.output_received.emit(f"Deleting \"{path}\"...\n") 275 | 276 | if path.is_file(): 277 | path.unlink() 278 | 279 | self.delete_all_in_directory(path) 280 | 281 | if path.exists(): 282 | # noinspection PyBroadException 283 | path.rmdir() 284 | 285 | 286 | def clear_temp_and_extracted(self): 287 | self.output_received.emit("Clearing temp directories...\n") 288 | 289 | paths_to_remove = [ 290 | self.temp_path, 291 | self.extracted_path, 292 | ] 293 | 294 | if not self.installer_params.skip_ba2_creation: 295 | paths_to_remove.extend([ 296 | self.output_path / "textures", 297 | self.output_path / "Materials", 298 | self.output_path / "meshes", 299 | self.output_path / "Music", 300 | self.output_path / "Sound", 301 | ]) 302 | 303 | self.remove_paths(paths_to_remove) 304 | 305 | # Recreate the directories. 306 | self.temp_path.mkdir(exist_ok=True) 307 | self.extracted_path.mkdir(exist_ok=True) 308 | self.output_path.mkdir(exist_ok=True) 309 | 310 | # processing_dialog = ProcessingDialog(DeletePathThread([ 311 | # self.temp_path, 312 | # self.extracted_path, 313 | # self.output_path / "textures", 314 | # self.output_path / "Materials", 315 | # self.output_path / "meshes", 316 | # self.output_path / "Music", 317 | # self.output_path / "Sound", 318 | # ])) 319 | # 320 | # processing_dialog.exec() 321 | # 322 | # if processing_dialog.worker.interrupted: 323 | # raise InterruptException 324 | # 325 | # if processing_dialog.worker.failed: 326 | # self.output_received.emit("Failed to clear directories.\n") 327 | # 328 | # raise InterruptException 329 | 330 | self.output_received.emit("Clearing temp directories... [DONE]\n") 331 | 332 | def run_frequent_output_task(self, cmd: list[str] | str, cwd: Path = None): 333 | process = subprocess.Popen( 334 | cmd, 335 | stdout=subprocess.PIPE, 336 | stderr=subprocess.STDOUT, 337 | # text=True, 338 | shell=False, 339 | startupinfo=STARTUPINFO_NO_CONSOLE, 340 | cwd=cwd, 341 | ) 342 | 343 | for line in process.stdout: 344 | try: 345 | s = line.decode("utf-8") 346 | except UnicodeDecodeError: 347 | s = line.decode("cp1252") 348 | 349 | self.output_received.emit(s) 350 | 351 | if self.stop_requested(): 352 | process.kill() 353 | 354 | raise InterruptException 355 | 356 | def rename_textures( 357 | self, nested_textures_path: Path, output_path_textures: Path): 358 | n_tries = 100 359 | 360 | for i in range(n_tries): 361 | try: 362 | nested_textures_path.rename(output_path_textures / "new_vegas") 363 | except PermissionError: 364 | if i == n_tries - 1: 365 | raise 366 | 367 | self.output_received.emit( 368 | "WARNING: Failed to rename textures directory. " 369 | "Retrying...\n") 370 | else: 371 | self.output_received.emit( 372 | "Renamed textures directory to \"new_vegas\"\n") 373 | 374 | break 375 | 376 | time.sleep(1) 377 | 378 | def remove_fnv_path(self, sub_path: Path): 379 | base_path = self.fnv_path / "data" 380 | 381 | if not self.fnv_path / "data" in sub_path.parents: 382 | raise ValueError( 383 | f"Resource {sub_path} is not in the Fallout " 384 | f"New Vegas data directory") 385 | 386 | # Get the parts of both paths 387 | base_parts = base_path.parts 388 | sub_parts = sub_path.parts 389 | 390 | # Reconstruct the sub_path without the base_path 391 | relative_path = Path(*sub_parts[len(base_parts):]) 392 | 393 | return relative_path 394 | 395 | def remove_crash_causing_files(self): 396 | crash_causing_files = [ 397 | ( 398 | self.output_path / r"textures\new_vegas\Clutter\junk\wooddetails_n.dds", 399 | '9c48e1658dc235dd8be8bf2b55b247cb98964e44759ba17632d43a33383fbf22' 400 | ) 401 | ] 402 | 403 | for path, crash_digest in crash_causing_files: 404 | if not path.exists(): 405 | continue 406 | 407 | with open(path, 'rb', buffering=0) as f: 408 | digest = hashlib.file_digest(f, 'sha256').hexdigest() 409 | 410 | if digest == crash_digest: 411 | os.remove(path) 412 | 413 | def extract_loose_files(self, loose_files: list[Path]): 414 | self.output_received.emit("Copying loose files...\n") 415 | 416 | for path in loose_files: 417 | relative_path = self.remove_fnv_path(path) 418 | 419 | root_dir = relative_path.parts[0].lower() 420 | 421 | if root_dir == "textures": 422 | path_dst = (self.output_path / "textures" / "new_vegas" / 423 | Path(*relative_path.parts[1:])) 424 | elif root_dir == "meshes": 425 | path_dst = self.extracted_path / relative_path 426 | 427 | copy_file_or_dir(path, path_dst) 428 | # TODO: 429 | elif path.suffix.lower() == ".nam": 430 | continue 431 | else: 432 | raise NotImplementedError( 433 | f"Resource {path} is not supported") 434 | 435 | copy_file_or_dir(path, path_dst) 436 | 437 | self.output_received.emit("Copying loose files... [DONE]\n") 438 | 439 | def extract_bsas(self, archives: list[Path]): 440 | if not archives: 441 | return 442 | 443 | path_bsab = self.cwd / "bin" / "bsab" / "bsab.exe" 444 | 445 | argument_list_meshes = [path_bsab, "-e", "-f", "meshes"] 446 | argument_list_textures = [path_bsab, "-e", "-f", "textures"] 447 | 448 | for archive in archives: 449 | if (str(archive)).lower().endswith(".nam"): 450 | continue 451 | 452 | argument_list_meshes.append(str(archive)) 453 | argument_list_textures.append(str(archive)) 454 | 455 | output_path_textures = self.output_path / "textures" 456 | 457 | output_path_textures.mkdir(parents=True, exist_ok=True) 458 | 459 | argument_list_meshes.append(str(self.extracted_path)) 460 | argument_list_textures.append(str(output_path_textures)) 461 | 462 | self.output_received.emit("Extracting meshes...\n") 463 | 464 | self.run_frequent_output_task(argument_list_meshes) 465 | 466 | self.output_received.emit("Extracting meshes... [DONE]\n") 467 | 468 | self.output_received.emit("Extracting textures...\n") 469 | 470 | self.run_frequent_output_task(argument_list_textures) 471 | 472 | self.output_received.emit("Extracting textures... [DONE]\n") 473 | 474 | try: 475 | subprocess.run( 476 | ["takeown", "/f", str(output_path_textures)], 477 | startupinfo=STARTUPINFO_NO_CONSOLE, 478 | check=True, 479 | ) 480 | except subprocess.CalledProcessError: 481 | self.output_received.emit( 482 | "WARNING: Failed to take ownership of textures directory\n") 483 | 484 | nested_textures_path = output_path_textures / "textures" 485 | 486 | if nested_textures_path.exists(): 487 | self.rename_textures(nested_textures_path, output_path_textures) 488 | 489 | def run_long_task(self, cmd: list[str] | str, cwd: Path = None, 490 | shell=False): 491 | process = subprocess.Popen( 492 | cmd, 493 | cwd=cwd, 494 | shell=shell, 495 | stdout=subprocess.PIPE, 496 | stderr=subprocess.PIPE, 497 | text=True 498 | ) 499 | 500 | while True: 501 | retcode = process.poll() 502 | 503 | # Process has finished. 504 | if retcode is not None: 505 | break 506 | 507 | if self.stop_requested(): 508 | process.kill() 509 | 510 | raise InterruptException 511 | 512 | time.sleep(0.2) 513 | 514 | def run_long_task_with_output( 515 | self, cmd: list[str] | str, cwd: Path = None, shell=False, 516 | line_callback: Callable = None): 517 | # Start the subprocess 518 | process = subprocess.Popen( 519 | cmd, 520 | cwd=cwd, 521 | shell=shell, 522 | stdout=subprocess.PIPE, 523 | stderr=subprocess.STDOUT, 524 | startupinfo=STARTUPINFO_NO_CONSOLE, 525 | text=True 526 | ) 527 | 528 | # Create a queue to hold the output 529 | q = queue.Queue() 530 | 531 | def enqueue_output(out, queue): 532 | try: 533 | for line in iter(out.readline, ''): 534 | queue.put(line) 535 | finally: 536 | out.close() 537 | 538 | # Start a thread to read the output 539 | t = threading.Thread(target=enqueue_output, args=(process.stdout, q)) 540 | t.daemon = True 541 | t.start() 542 | 543 | # Read line without blocking 544 | while True: 545 | if process.poll() is not None: 546 | break 547 | 548 | if self.stop_requested(): 549 | process.kill() 550 | t.join() 551 | 552 | raise InterruptException 553 | 554 | try: 555 | line = q.get(timeout=.2) 556 | except queue.Empty: 557 | pass 558 | else: 559 | if line_callback is not None: 560 | try: 561 | line_callback(line) 562 | except InterruptException: 563 | process.kill() 564 | t.join() 565 | 566 | raise InterruptException 567 | 568 | # Process the line 569 | self.output_received.emit(line) 570 | 571 | def convert_meshes(self): 572 | self.output_received.emit("Converting meshes...\n") 573 | 574 | path_nifskope = ( 575 | self.cwd / "build\\nifskope_converter\\release\\NifSkope.exe") 576 | 577 | cmd = [ 578 | path_nifskope, 579 | "--convert", 580 | str(self.temp_path), 581 | str(self.extracted_path), 582 | str(self.extracted_path), 583 | ] 584 | 585 | self.run_long_task(cmd) 586 | 587 | self.output_received.emit("Converting meshes... [DONE]\n") 588 | 589 | def optimize_meshes(self): 590 | self.output_received.emit("Optimizing meshes...\n") 591 | 592 | elric_path = self.fo4_path / "Tools" / "Elric" / "Elrich.exe" 593 | convert_target = self.temp_path / "meshes" 594 | elric_output_path = self.output_path / "meshes" 595 | 596 | # Remove meshes that are known to cause problems. 597 | for rel_path in [ 598 | "Terrain\\nvdlc03bigmt\\nvdlc03bigmt.16.-32.-32.BTR", 599 | ]: 600 | path = self.temp_path / rel_path 601 | 602 | if path.exists(): 603 | self.output_received.emit(f"Skipping {rel_path}\n") 604 | 605 | os.remove(path) 606 | 607 | for _ in range(100): 608 | failed = False 609 | 610 | self.stop_if_requested() 611 | 612 | command = [ 613 | '"' + str(elric_path) + '"', 614 | ".\\Settings\\PCMeshes.esf", 615 | f"-ElricOptions.ConvertTarget=\"{str(convert_target)}\"", 616 | f"-ElricOptions.OutputDirectory=\"{str(elric_output_path)}\"", 617 | ] 618 | command = " ".join(command) 619 | 620 | self.run_long_task( 621 | command, 622 | cwd=self.cwd / "src\\models-and-animations\\elric\\", 623 | ) 624 | 625 | source_files_path = os.path.join(str(self.temp_path), "meshes") 626 | source_files = [os.path.join(dp, f) for dp, dn, filenames in 627 | os.walk(source_files_path) for f in filenames] 628 | existing_files = [] 629 | 630 | for file in source_files: 631 | self.stop_if_requested() 632 | 633 | relative_path = file.removeprefix(str(self.temp_path) + "\\") 634 | dest_path = self.output_path / relative_path 635 | 636 | if not os.path.isfile(dest_path): 637 | if not failed: 638 | self.output_received.emit("[FAILED]\n") 639 | 640 | self.output_received.emit(f"Failed: {relative_path}\n") 641 | 642 | os.remove(file) 643 | failed = True 644 | 645 | break 646 | 647 | existing_files.append(file) 648 | 649 | for file in existing_files: 650 | self.stop_if_requested() 651 | 652 | os.remove(file) 653 | 654 | if not failed: 655 | break 656 | 657 | self.output_received.emit("Optimizing meshes... [DONE]\n") 658 | 659 | def move_materials(self): 660 | self.output_received.emit("Moving materials...\n") 661 | 662 | if not (self.temp_path / "materials").exists(): 663 | print("No materials to move") 664 | 665 | self.output_received.emit("Moving materials... [DONE]\n") 666 | 667 | return 668 | 669 | shutil.move( 670 | src=str(self.temp_path / "materials"), 671 | dst=str(self.output_path / "materials"), 672 | ) 673 | 674 | self.output_received.emit("Moving materials... [DONE]\n") 675 | 676 | def copy_data_files(self): 677 | self.output_received.emit("Copying data files...\n") 678 | 679 | data_files_dir = self.cwd / "src" / "data" 680 | 681 | # Iterate over the files and subdirectories in the source directory 682 | for item in data_files_dir.iterdir(): 683 | source_item = os.path.join(data_files_dir, item) 684 | 685 | destination_item = self.output_path / item.name 686 | 687 | if os.path.isdir(source_item): 688 | shutil.copytree( 689 | source_item, destination_item, dirs_exist_ok=True) 690 | else: 691 | shutil.copy(source_item, destination_item) 692 | 693 | self.output_received.emit("Copying data files... [DONE]\n") 694 | 695 | def copy_lod_settings(self): 696 | self.output_received.emit("Copying LOD settings...\n") 697 | 698 | lod_settings_path = Path("src\\data\\LODSettings\\WastelandNV.LOD") 699 | terrain_path = self.extracted_path / "meshes" / "landscape" / "lod" 700 | 701 | if terrain_path.exists(): 702 | lod_settings_dir_new = self.output_path / "LODSettings" 703 | 704 | if not lod_settings_dir_new.exists(): 705 | lod_settings_dir_new.mkdir() 706 | 707 | for path in terrain_path.iterdir(): 708 | if not path.is_dir(): 709 | continue 710 | 711 | lod_settings_path_new = ( 712 | lod_settings_dir_new / f"{path.name}.LOD") 713 | 714 | shutil.copy(lod_settings_path, lod_settings_path_new) 715 | 716 | self.output_received.emit("Copying LOD settings... [DONE]\n") 717 | 718 | def extract_plugin_data(self, plugin: PluginData): 719 | self.output_received.emit("Clearing extracted plugin data...\n") 720 | 721 | self.remove_paths([self.x_edit_exe_path.parent / "data"]) 722 | 723 | self.output_received.emit("Clearing extracted plugin data... [DONE]\n") 724 | 725 | self.output_received.emit("Extract plugin data...\n") 726 | 727 | if not self.plugins: 728 | self.output_received.emit("No plugins to convert\n") 729 | self.output_received.emit("Extract plugin data... [DONE]\n") 730 | 731 | return 732 | 733 | x_edit_mode = "-FNV" 734 | 735 | x_edit_plugin = plugin 736 | 737 | command = [ 738 | self.x_edit_exe_path, 739 | x_edit_mode, 740 | "-hideForm", 741 | "-dontBackup", 742 | "-convert", 743 | "-script:Extract", 744 | "-nobuildrefs", 745 | "-autoload", 746 | "-autoexit", 747 | "-IKnowWhatImDoing", 748 | x_edit_plugin.name, 749 | ] 750 | 751 | working_directory = self.x_edit_converter_path 752 | 753 | if self.x_edit_data_path.exists(): 754 | shutil.rmtree(self.x_edit_data_path) 755 | 756 | self.x_edit_data_path.mkdir(exist_ok=True) 757 | 758 | self.run_long_task_with_output(command, cwd=working_directory) 759 | 760 | self.output_received.emit("Extract plugin data... [DONE]\n") 761 | 762 | def get_plugin_masters(self, plugin: PluginData) -> list[str]: 763 | path = self.x_edit_exe_path.parent / "data" / f"{plugin.name}.json" 764 | 765 | with open(path) as file: 766 | data = json.load(file) 767 | 768 | result = [] 769 | 770 | for master in data["masters"]: 771 | result.append(master["name"]) 772 | 773 | return result 774 | 775 | def import_plugin_data(self, plugin: PluginData): 776 | self.output_received.emit("Import plugin data...\n") 777 | 778 | if not self.plugins: 779 | self.output_received.emit("No plugins to import\n") 780 | 781 | return 782 | 783 | x_edit_mode = "-FO4" 784 | 785 | command = [ 786 | self.x_edit_exe_path, 787 | x_edit_mode, 788 | "-hideForm", 789 | "-dontBackup", 790 | "-convert", 791 | "-script:Import", 792 | "-nobuildrefs", 793 | "-autoload", 794 | "-autoexit", 795 | "-IKnowWhatImDoing", 796 | "Fallout4.esm", 797 | ] + self.get_plugin_masters(plugin) + [plugin.name] 798 | 799 | working_directory = self.x_edit_converter_path 800 | 801 | self.run_long_task_with_output(command, cwd=working_directory) 802 | 803 | self.output_received.emit("Import plugin data... [DONE]\n") 804 | 805 | def convert_plugin_data(self, plugin: PluginData): 806 | self.output_received.emit("Import plugin data...\n") 807 | 808 | if not self.plugins: 809 | self.output_received.emit("No plugins to import\n") 810 | 811 | return 812 | 813 | command = [ 814 | self.x_convert_exe_path, 815 | plugin.name, 816 | ] 817 | 818 | working_directory = self.x_edit_converter_path 819 | 820 | self.run_long_task_with_output(command, cwd=working_directory) 821 | 822 | self.output_received.emit("Import plugin data... [DONE]\n") 823 | 824 | def move_plugin_to_output(self, plugin: PluginData): 825 | shutil.move( 826 | src=str(self.fo4_path / "Data" / plugin.name), 827 | dst=str(self.output_path / plugin.name), 828 | ) 829 | 830 | self.output_received.emit(f"Moved {plugin.name} to output path\n") 831 | 832 | def replace_data_files(self, plugin: PluginData): 833 | data_files_dir = Path("src\\data") 834 | 835 | plugin_dir = data_files_dir / plugin.name 836 | 837 | if not plugin_dir.exists(): 838 | return 839 | 840 | for source_item in plugin_dir.iterdir(): 841 | destination_item = self.output_path / source_item.name 842 | 843 | if source_item.is_dir(): 844 | shutil.copytree( 845 | source_item, destination_item, dirs_exist_ok=True) 846 | else: 847 | shutil.copy(source_item, destination_item) 848 | 849 | 850 | def copy_file_or_dir(path : Path, path_dst: Path): 851 | if path.is_file(): 852 | path_dst.parent.mkdir(exist_ok=True, parents=True) 853 | 854 | shutil.copyfile( 855 | src=path, 856 | dst=path_dst, 857 | ) 858 | else: 859 | path_dst.mkdir(exist_ok=True, parents=True) 860 | 861 | shutil.copytree( 862 | src=path, 863 | dst=path_dst, 864 | dirs_exist_ok=True, 865 | ) 866 | -------------------------------------------------------------------------------- /src/gui/app.py: -------------------------------------------------------------------------------- 1 | import itertools 2 | import os 3 | import sys 4 | import traceback 5 | import winreg 6 | from pathlib import Path 7 | import json 8 | import time 9 | 10 | import PySide6.QtCore as QtCore 11 | import PySide6.QtGui as QtGui 12 | import PySide6.QtWidgets as QtWidgets 13 | from PySide6.QtCore import Qt 14 | from PySide6.QtWidgets import ( 15 | QApplication, QWidget, QVBoxLayout, QListWidget, QStackedWidget, 16 | QPushButton, QHBoxLayout, QFileDialog, QLabel, QLineEdit, QGroupBox 17 | ) 18 | 19 | from InstallerParams import InstallerParams 20 | from WorkerThread import WorkerThread, LOOSE_FILES_PLUGIN_NAME 21 | from ProcessingDialog import ProcessingDialog 22 | from DeletePathThread import DeletePathThread 23 | from PluginData import PluginData 24 | 25 | PAGE_NAME_OPTIONS = "Options" 26 | # PAGE_NAME_OPTIONS_CUSTOM = "Options" 27 | PAGE_NAME_CONVERT = "Convert" 28 | PAGE_NAME_FINISH = "Finish" 29 | 30 | REQUIRED_PATHS = [ 31 | Path("build\\nifskope_converter\\release\\NifSkope.exe"), 32 | Path("build\\xedit_converter\\xConvert.exe"), 33 | Path("bin\\bsab\\bsab.exe"), 34 | ] 35 | 36 | SIDEBAR_ITEMS = [PAGE_NAME_OPTIONS, PAGE_NAME_CONVERT, PAGE_NAME_FINISH] 37 | 38 | DEBUG = False 39 | 40 | 41 | def get_game_path(game: str): 42 | try: 43 | registry_key = winreg.OpenKey( 44 | winreg.HKEY_LOCAL_MACHINE, 45 | f"SOFTWARE\\Wow6432Node\\Bethesda Softworks\\{game}" 46 | ) 47 | 48 | game_path, _ = winreg.QueryValueEx( 49 | registry_key, "installed path") 50 | winreg.CloseKey(registry_key) 51 | return game_path 52 | except FileNotFoundError: 53 | # Handle the error if the key or value does not exist 54 | print("Registry key or value not found.") 55 | return None 56 | except Exception as e: 57 | # Handle other possible exceptions 58 | print(f"An error occurred: {e}") 59 | return None 60 | 61 | 62 | def check_fallout4_installation(path_str: str): 63 | path = Path(path_str) 64 | 65 | if not path.exists(): 66 | return False, f"Path {path_str} does not exist." 67 | 68 | fallout4_exe_path = path / "Fallout4.exe" 69 | 70 | if not fallout4_exe_path.exists(): 71 | return False, f"Fallout4.exe not found at \"{fallout4_exe_path}\"." 72 | 73 | elric_path = path / "Tools\\Elric\\Elrich.exe" 74 | 75 | if not elric_path.exists(): 76 | return ( 77 | False, 78 | f"Elrich.exe not found at \"{elric_path}\". " 79 | f"Is the Fallout 4 Creation Kit installed?" 80 | ) 81 | 82 | archive2_path = path / "Tools" / "Archive2" / "Archive2.exe" 83 | 84 | if not archive2_path.exists(): 85 | return ( 86 | False, 87 | f"Archive2.exe not found at \"{archive2_path}\". " 88 | f"Is the Fallout 4 Creation Kit installed?" 89 | ) 90 | 91 | return True, "Successfully verified Fallout 4 installation" 92 | 93 | 94 | def check_falloutnv_installation(path_str: str): 95 | path = Path(path_str) 96 | 97 | if not path.exists(): 98 | return False, f"Path {path_str} does not exist." 99 | 100 | fallout_nv_path = path / "FalloutNV.exe" 101 | 102 | if not fallout_nv_path.exists(): 103 | return False, f"FalloutNV.exe not found at \"{fallout_nv_path}\"." 104 | 105 | return True, "Successfully verified Fallout: New Vegas installation" 106 | 107 | 108 | class PageData: 109 | name: str 110 | goto: callable 111 | index: int 112 | 113 | def __init__(self, name: str): 114 | self.name = name 115 | self.index = SIDEBAR_ITEMS.index(name) 116 | 117 | 118 | class Installer(QWidget): 119 | def __init__(self, params: InstallerParams = None): 120 | super().__init__() 121 | 122 | self.params = params 123 | 124 | self.setWindowTitle("FNV to FO4") 125 | 126 | # Main layout 127 | layout = QHBoxLayout(self) 128 | 129 | # Sidebar 130 | self.sidebar = QListWidget(self) 131 | 132 | self.sidebar.addItems(SIDEBAR_ITEMS) 133 | self.sidebar.setCurrentRow(0) 134 | self.sidebar.setMaximumWidth(150) 135 | self.sidebar.setEnabled(False) # Make sidebar non-interactable 136 | layout.addWidget(self.sidebar) 137 | 138 | # Content area 139 | self.pages = QStackedWidget(self) 140 | layout.addWidget(self.pages) 141 | 142 | self.page_options = PageData( 143 | name=PAGE_NAME_OPTIONS, 144 | ) 145 | 146 | # self.page_options_custom = PageData("Options") 147 | 148 | self.page_convert = PageData( 149 | name=PAGE_NAME_CONVERT, 150 | ) 151 | 152 | self.page_finish = PageData( 153 | name=PAGE_NAME_FINISH, 154 | ) 155 | 156 | self.page_options_custom = PageData( 157 | name=PAGE_NAME_OPTIONS, 158 | ) 159 | self.page_options_custom.index = len(SIDEBAR_ITEMS) 160 | 161 | self.templates = self.load_templates() 162 | 163 | # First step page 164 | self.pages.addWidget(self.create_welcome_page()) 165 | self.pages.addWidget(self.create_config_page()) 166 | self.pages.addWidget(self.create_finish_page()) 167 | self.pages.addWidget(self.create_custom_options_page()) 168 | 169 | # Connect sidebar selection change to update displayed page 170 | self.sidebar.currentRowChanged.connect(self.pages.setCurrentIndex) 171 | 172 | def create_directory_selector(self, label_text, line_edit_text=None, 173 | input_check_func=None): 174 | """Utility function to create a directory selector.""" 175 | layout = QVBoxLayout() 176 | 177 | status_label = QLabel() 178 | status_label.setAlignment(Qt.AlignmentFlag.AlignTop) 179 | status_label.setContentsMargins(0, 0, 0, 0) 180 | status_label.setWordWrap(True) 181 | 182 | def update_status(line_edit_text_value): 183 | if (input_check_func is not None and 184 | line_edit_text_value is not None): 185 | success, error_message = input_check_func(line_edit_text_value) 186 | 187 | status_label.setText(error_message) 188 | 189 | if success: 190 | status_label.setStyleSheet("color: green;") 191 | else: 192 | status_label.setStyleSheet("color: red;") 193 | 194 | update_status(line_edit_text) 195 | 196 | h_layout = QHBoxLayout() 197 | label = QLabel(label_text) 198 | label.setFixedWidth(100) 199 | line_edit = QLineEdit(line_edit_text) 200 | line_edit.textChanged.connect(lambda: update_status(line_edit.text())) 201 | button = QPushButton("Browse") 202 | button.clicked.connect( 203 | lambda: self.browse_directory(line_edit, update_status)) 204 | h_layout.addWidget(label) 205 | h_layout.addWidget(line_edit) 206 | h_layout.addWidget(button) 207 | 208 | layout.addLayout(h_layout) 209 | layout.addWidget(status_label) 210 | 211 | return layout, line_edit 212 | 213 | def browse_directory(self, line_edit, update_status): 214 | """ 215 | Open a directory dialog and update the line edit with the selected 216 | directory. 217 | """ 218 | directory = QFileDialog.getExistingDirectory(self, "Select Directory") 219 | if directory: 220 | line_edit.setText(directory) 221 | 222 | update_status(directory) 223 | 224 | def create_param_checkbox( 225 | self, param_name: str, title: str, layout=None, tooltip=None): 226 | checkbox = QtWidgets.QCheckBox(title) 227 | 228 | if tooltip: 229 | checkbox.setToolTip(tooltip) 230 | 231 | checkbox.setChecked(self.params.__getattribute__(param_name)) 232 | 233 | def on_change(state): 234 | self.params.__setattr__( 235 | param_name, state == QtCore.Qt.CheckState.Checked.value) 236 | 237 | checkbox.stateChanged.connect(on_change) 238 | 239 | if layout is not None: 240 | layout.addWidget(checkbox) 241 | 242 | return checkbox 243 | 244 | def create_extra_options(self): 245 | groupBox = QGroupBox("Options") 246 | 247 | h_layout = QHBoxLayout() 248 | 249 | layout = QVBoxLayout() 250 | 251 | self.create_param_checkbox( 252 | param_name="skip_bsas", 253 | title="Skip BSAs", 254 | layout=layout, 255 | ) 256 | 257 | self.create_param_checkbox( 258 | param_name="skip_meshes", 259 | title="Skip mesh conversion", 260 | layout=layout, 261 | ) 262 | 263 | self.create_param_checkbox( 264 | param_name="skip_optimize", 265 | title="Skip mesh optimization", 266 | layout=layout, 267 | ) 268 | 269 | self.create_param_checkbox( 270 | param_name="skip_ba2_creation", 271 | title="Skip BA2 creation", 272 | layout=layout, 273 | ) 274 | 275 | self.create_param_checkbox( 276 | param_name="skip_data", 277 | title="Skip data files", 278 | layout=layout, 279 | ) 280 | 281 | self.create_param_checkbox( 282 | param_name="skip_plugin_convert", 283 | title="Skip plugin conversion", 284 | layout=layout, 285 | ) 286 | 287 | self.create_param_checkbox( 288 | param_name="skip_lod_settings", 289 | title="Skip LOD settings", 290 | layout=layout, 291 | ) 292 | 293 | self.create_param_checkbox( 294 | param_name="ignore_existing_files", 295 | title="Ignore existing files", 296 | layout=layout, 297 | ) 298 | 299 | layout2 = QVBoxLayout() 300 | 301 | self.create_param_checkbox( 302 | param_name="all_objects_cast_shadows", 303 | title="Make all objects cast shadows", 304 | layout=layout2, 305 | tooltip="Most objects in Fallout: New Vegas do not cast shadows. This option will make all objects cast shadows." 306 | ) 307 | 308 | h_layout.addLayout(layout) 309 | h_layout.addLayout(layout2) 310 | 311 | groupBox.setLayout(h_layout) 312 | 313 | return groupBox 314 | 315 | def create_welcome_page(self): 316 | page = QWidget() 317 | layout = QVBoxLayout() 318 | 319 | welcome_label = QLabel("Welcome to FNV to FO4") 320 | welcome_label.setAlignment(Qt.AlignmentFlag.AlignTop) 321 | 322 | layout.addWidget(welcome_label) 323 | 324 | self.next_btn = QPushButton("Start") 325 | self.next_btn.clicked.connect(self.goto_convert_page) 326 | 327 | group_box = QGroupBox("Installation / output paths") 328 | group_box_layout = QVBoxLayout() 329 | 330 | falloutnv_path = get_game_path("falloutnv") 331 | 332 | self.directory1, self.directory1_line_edit = ( 333 | self.create_directory_selector( 334 | "Fallout: New Vegas", 335 | line_edit_text=falloutnv_path, 336 | input_check_func=check_falloutnv_installation, 337 | ) 338 | ) 339 | 340 | fallout4_path = get_game_path("Fallout4") 341 | 342 | self.directory2, self.directory2_line_edit = ( 343 | self.create_directory_selector( 344 | "Fallout 4", 345 | line_edit_text=fallout4_path, 346 | input_check_func=check_fallout4_installation, 347 | ) 348 | ) 349 | self.directory3, self.directory3_line_edit = ( 350 | self.create_directory_selector( 351 | "Output", 352 | line_edit_text=str(Path(os.getcwd()) / "output") 353 | ) 354 | ) 355 | 356 | group_box_layout.addLayout(self.directory1) 357 | group_box_layout.addLayout(self.directory2) 358 | group_box_layout.addLayout(self.directory3) 359 | 360 | group_box.setLayout(group_box_layout) 361 | 362 | layout.addWidget(group_box) 363 | 364 | layout.addWidget(self.create_extra_options()) 365 | 366 | self.install_mode_selector = self.create_install_mode_selector() 367 | layout.addWidget(self.install_mode_selector) 368 | 369 | layout.addWidget(self.next_btn) 370 | 371 | page.setLayout(layout) 372 | 373 | return page 374 | 375 | def get_fnv_data_path(self): 376 | fnv_data_path = Path(self.directory1_line_edit.text()) / "Data" 377 | 378 | if not fnv_data_path.exists(): 379 | raise FileNotFoundError( 380 | f"Path \"{fnv_data_path}\" does not exist.") 381 | 382 | return fnv_data_path 383 | 384 | def open_file_dialog(self): 385 | fnv_data_path = self.get_fnv_data_path() 386 | 387 | files, _ = QFileDialog.getOpenFileNames( 388 | self, 'Open File', 389 | dir=str(fnv_data_path), 390 | filter="*.bsa *.esm *.esp *.nif *.dds" 391 | ) 392 | 393 | if files: 394 | for file in files: 395 | self.list_widget.addItem(file) 396 | 397 | def open_folder_dialog(self): 398 | fnv_data_path = self.get_fnv_data_path() 399 | 400 | folder = QFileDialog.getExistingDirectory( 401 | self, 'Open Folder', dir=str(fnv_data_path)) 402 | if folder: 403 | self.list_widget.addItem(folder) 404 | 405 | def clear_list(self): 406 | self.list_widget.clear() 407 | 408 | def create_custom_options_page(self): 409 | page = QWidget() 410 | layout = QVBoxLayout() 411 | 412 | welcome_label = QLabel("Custom conversion") 413 | welcome_label.setAlignment(Qt.AlignmentFlag.AlignTop) 414 | 415 | layout.addWidget(welcome_label) 416 | 417 | file_options_layout = QHBoxLayout() 418 | 419 | # Create buttons for file/folder selection and list clearing 420 | self.btn_select_files = QPushButton('Select Files') 421 | self.btn_select_folders = QPushButton('Select Folders') 422 | self.btn_clear_list = QPushButton('Clear List') 423 | 424 | # Create a list widget to display selected files/folders 425 | self.list_widget = QListWidget() 426 | 427 | # Connect buttons to their respective functions 428 | self.btn_select_files.clicked.connect(self.open_file_dialog) 429 | self.btn_select_folders.clicked.connect(self.open_folder_dialog) 430 | self.btn_clear_list.clicked.connect(self.clear_list) 431 | 432 | # Add widgets to the layout 433 | file_options_layout.addWidget(self.btn_select_files) 434 | file_options_layout.addWidget(self.btn_select_folders) 435 | file_options_layout.addWidget(self.btn_clear_list) 436 | layout.addLayout(file_options_layout) 437 | layout.addWidget(self.list_widget) 438 | 439 | navbox_layout = QHBoxLayout() 440 | 441 | self.custom_options_back_btn = QPushButton("Back") 442 | self.custom_options_back_btn.clicked.connect(self.goto_start_page) 443 | self.custom_options_next_btn = QPushButton("Start") 444 | self.custom_options_next_btn.clicked.connect( 445 | lambda: self.goto_convert_page(using_custom_options=True)) 446 | 447 | # checkbox_skip_bsas = QtWidgets.QCheckBox("Skip BSAs") 448 | # # checkbox_skip_bsas.stateChanged.connect( 449 | # 450 | # layout.addWidget(QtWidgets.QCheckBox("Skip BSAs")) 451 | # layout.addWidget(QtWidgets.QCheckBox("Skip mesh conversion")) 452 | # layout.addWidget(QtWidgets.QCheckBox("Skip mesh optimization")) 453 | # layout.addWidget(QtWidgets.QCheckBox("Skip plugin extract")) 454 | # layout.addWidget(QtWidgets.QCheckBox("Skip plugin import")) 455 | # layout.addWidget(QtWidgets.QCheckBox("Ignore existing files")) 456 | 457 | navbox_layout.addWidget(self.custom_options_back_btn) 458 | navbox_layout.addWidget(self.custom_options_next_btn) 459 | 460 | layout.addLayout(navbox_layout) 461 | 462 | 463 | page.setLayout(layout) 464 | 465 | return page 466 | 467 | def load_templates(self): 468 | with open("src/gui/templates.json") as f: 469 | templates = json.load(f) 470 | 471 | return templates 472 | 473 | def create_template_options(self): 474 | self.template_selector = QtWidgets.QComboBox() 475 | self.template_selector.addItems(self.templates.keys()) 476 | self.template_selector.currentTextChanged.connect(self.template_selected) 477 | 478 | # Initialize current template. 479 | self.template_selected(self.template_selector.currentText()) 480 | 481 | return self.template_selector 482 | 483 | def template_selected(self, selected): 484 | self.current_template = self.templates[selected] 485 | 486 | def create_install_mode_selector(self): 487 | group_box = QGroupBox("Mode") 488 | 489 | layout = QVBoxLayout() 490 | 491 | express_layout = QHBoxLayout() 492 | 493 | # Radio button for male 494 | self.radio_button_express = ( 495 | QtWidgets.QRadioButton(text="Use template", checked=True)) 496 | 497 | combobox1 = self.create_template_options() 498 | 499 | # adding signal and slot 500 | self.radio_button_express.toggled.connect(self.express_mode_selected) 501 | 502 | express_layout.addWidget(self.radio_button_express) 503 | express_layout.addWidget(combobox1) 504 | 505 | # Radio button for female 506 | self.radio_button_custom = ( 507 | QtWidgets.QRadioButton(text="Custom conversion")) 508 | # self.radio_button_custom.setCheckable(False) 509 | # self.radio_button_custom.setEnabled(False) 510 | 511 | # adding signal and slot 512 | self.radio_button_custom.toggled.connect(self.custom_mode_selected) 513 | 514 | layout.addLayout(express_layout) 515 | layout.addWidget(self.radio_button_custom) 516 | 517 | group_box.setLayout(layout) 518 | 519 | return group_box 520 | 521 | def express_mode_selected(self, selected): 522 | if selected: 523 | self.next_btn.setText("Start") 524 | self.next_btn.clicked.disconnect(self.goto_custom_options_page) 525 | self.next_btn.clicked.connect(self.goto_convert_page) 526 | 527 | 528 | def custom_mode_selected(self, selected): 529 | if selected: 530 | self.next_btn.setText("Next") 531 | self.next_btn.clicked.disconnect(self.goto_convert_page) 532 | self.next_btn.clicked.connect(self.goto_custom_options_page) 533 | 534 | def create_config_page(self): 535 | page = QWidget() 536 | layout = QVBoxLayout() 537 | layout.addWidget(QLabel("Conversion logs")) 538 | 539 | self.text_length = 0 540 | self.text_edit = QtWidgets.QTextEdit() 541 | layout.addWidget(self.text_edit) 542 | 543 | # You'd typically have configuration input widgets here 544 | 545 | self.conversion_next_btn = QPushButton() 546 | self.conversion_next_btn_connections = [] 547 | 548 | layout.addWidget(self.conversion_next_btn) 549 | 550 | page.setLayout(layout) 551 | return page 552 | 553 | def cancel_conversion(self): 554 | self.thread.stop() 555 | 556 | def on_conversion_done(self): 557 | if self.thread.interrupted: 558 | self.conversion_next_btn.setText("Back") 559 | self.add_conversion_next_button_connection(self.goto_start_page) 560 | else: 561 | self.conversion_next_btn.setText("Next") 562 | self.add_conversion_next_button_connection(self.goto_finish_page) 563 | 564 | def create_finish_page(self): 565 | page = QWidget() 566 | layout = QVBoxLayout() 567 | layout.addWidget(QLabel("Conversion complete")) 568 | 569 | close_btn = QPushButton("Close") 570 | close_btn.clicked.connect(self.close) 571 | layout.addWidget(close_btn) 572 | 573 | page.setLayout(layout) 574 | return page 575 | 576 | def convert_not_ready(self, reason: str): 577 | QtWidgets.QMessageBox.critical(self, "Error", reason) 578 | 579 | def clear_output_directories( 580 | self, extracted_path: Path, temp_path: Path, output_path: Path): 581 | dlg = QtWidgets.QMessageBox(self) 582 | dlg.setWindowTitle("Files from a previous conversion exist") 583 | dlg.setText( 584 | f"The following directories need to be empty:\n" 585 | f"- Extracted: {extracted_path}\n" 586 | f"- Temp: {temp_path}\n" 587 | f"- Output: {output_path}\n" 588 | "Clear these directories now?" 589 | ) 590 | dlg.setStandardButtons( 591 | QtWidgets.QMessageBox.StandardButton.Yes | 592 | QtWidgets.QMessageBox.StandardButton.No 593 | ) 594 | dlg.setIcon(QtWidgets.QMessageBox.Icon.Question) 595 | button = dlg.exec() 596 | 597 | if button == QtWidgets.QMessageBox.StandardButton.Yes: 598 | paths = [] 599 | 600 | for path in itertools.chain( 601 | extracted_path.iterdir(), 602 | temp_path.iterdir(), 603 | output_path.iterdir() 604 | ): 605 | if path.name.lower() not in { 606 | "meshes", 607 | "textures", 608 | "lodsettings", 609 | "materials", 610 | } and path.suffix.lower() not in { 611 | ".esm", 612 | ".esp", 613 | ".ba2", 614 | }: 615 | self.convert_not_ready( 616 | f"Unexpected file or directory found in output path: " 617 | f"\"{path}\". Please clear the output directory " 618 | f"manually and try again.") 619 | 620 | paths.append(path) 621 | 622 | processing_dialog = ProcessingDialog(DeletePathThread(paths)) 623 | 624 | processing_dialog.exec() 625 | 626 | if processing_dialog.worker.interrupted: 627 | return False 628 | 629 | if processing_dialog.worker.failed: 630 | self.convert_not_ready( 631 | "Failed to clear output directory. " 632 | "Please clear the output directory manually and try again." 633 | ) 634 | 635 | return False 636 | 637 | return True 638 | else: 639 | return False 640 | 641 | def add_conversion_next_button_connection(self, connection): 642 | self.conversion_next_btn_connections.append(connection) 643 | self.conversion_next_btn.clicked.connect(connection) 644 | 645 | def clear_conversion_next_button_connections(self): 646 | for connection in self.conversion_next_btn_connections: 647 | self.conversion_next_btn.clicked.disconnect(connection) 648 | 649 | self.conversion_next_btn_connections.clear() 650 | 651 | def goto_convert_page(self, using_custom_options=False): 652 | self.clear_conversion_next_button_connections() 653 | 654 | self.add_conversion_next_button_connection(self.cancel_conversion) 655 | 656 | self.conversion_next_btn.setText("Cancel") 657 | 658 | fnv_path = Path(self.directory1_line_edit.text()) 659 | fo4_path = Path(self.directory2_line_edit.text()) 660 | output_path = Path(self.directory3_line_edit.text()) 661 | extracted_path = Path(os.getcwd()) / "extracted" 662 | temp_path = Path(os.getcwd()) / "temp" 663 | 664 | output_path.mkdir(parents=True, exist_ok=True) 665 | extracted_path.mkdir(parents=True, exist_ok=True) 666 | temp_path.mkdir(parents=True, exist_ok=True) 667 | 668 | for success, msg in [ 669 | check_falloutnv_installation(str(fnv_path)), 670 | check_fallout4_installation(str(fo4_path)), 671 | ]: 672 | if not success: 673 | self.convert_not_ready(msg) 674 | 675 | return 676 | 677 | # resources = [] 678 | plugins: list[PluginData] = [] 679 | 680 | if using_custom_options: 681 | # Create a plugin for loose files. 682 | no_bsa_plugin = PluginData( 683 | name=LOOSE_FILES_PLUGIN_NAME, 684 | path=fnv_path / "Data" / LOOSE_FILES_PLUGIN_NAME, 685 | resources=[] 686 | ) 687 | 688 | item_paths = [ 689 | Path(self.list_widget.item(i).text()) 690 | for i in range(self.list_widget.count()) 691 | ] 692 | 693 | item_paths.sort(key=lambda p: p.suffix.lower() not in {".esm", ".esp"}) 694 | 695 | plugin = None 696 | 697 | for item_path in item_paths: 698 | if item_path.suffix.lower() in {".esm", ".esp"}: 699 | if plugin is not None: 700 | raise Exception( 701 | "Only one plugin can be selected at a time.") 702 | 703 | plugin = PluginData( 704 | name=item_path.name, 705 | path=item_path, 706 | resources=[] 707 | ) 708 | 709 | plugins.append(plugin) 710 | elif plugin is not None: 711 | plugin.resources.append(item_path) 712 | else: 713 | no_bsa_plugin.resources.append(item_path) 714 | 715 | if no_bsa_plugin.resources: 716 | plugins.append(no_bsa_plugin) 717 | else: 718 | for _dict in self.current_template["plugins"]: 719 | plugin_data = PluginData( 720 | name=_dict["name"], 721 | path=fnv_path / "Data" / _dict["name"], 722 | resources=[ 723 | fnv_path / "Data" / v 724 | for v in _dict["resources"] 725 | ] 726 | ) 727 | 728 | plugins.append(plugin_data) 729 | 730 | # PluginData() 731 | # 732 | # resources = [ 733 | # fnv_path / "Data" / v 734 | # for v in self.current_template["resources"] 735 | # ] 736 | 737 | # plugins = [ 738 | # path.name for path in resources 739 | # if path.suffix.lower() in {".esm", ".esp"} 740 | # ] 741 | 742 | for plugin in plugins: 743 | plugin_path = fo4_path / "Data" / plugin.name 744 | 745 | if plugin_path.exists(): 746 | if not self.params.ignore_existing_files: 747 | self.convert_not_ready( 748 | f"Plugin \"{plugin.name}\" already exists in " 749 | f"\"{plugin_path}\". " 750 | f"Please remove it and try again." 751 | ) 752 | 753 | return 754 | else: 755 | print(f"Ignoring existing plugin \"{plugin_path}\".") 756 | 757 | if (list(extracted_path.iterdir()) or 758 | list(temp_path.iterdir()) or 759 | list(output_path.iterdir())): 760 | if not self.params.ignore_existing_files: 761 | if not self.clear_output_directories( 762 | extracted_path=extracted_path, 763 | temp_path=temp_path, 764 | output_path=output_path, 765 | ): 766 | return 767 | else: 768 | print("Ignoring existing files.") 769 | 770 | # Change page. 771 | self.pages.setCurrentIndex(self.page_convert.index) 772 | self.sidebar.setCurrentRow(self.page_convert.index) 773 | 774 | # Start worker thread. 775 | self.start_subprocess( 776 | fnv_path=fnv_path, 777 | fo4_path=fo4_path, 778 | extracted_path=extracted_path, 779 | temp_path=temp_path, 780 | output_path=output_path, 781 | resources=plugins, 782 | ) 783 | 784 | def goto_start_page(self): 785 | self.pages.setCurrentIndex(self.page_options.index) 786 | self.sidebar.setCurrentRow(self.page_options.index) 787 | 788 | def goto_finish_page(self): 789 | self.pages.setCurrentIndex(self.page_finish.index) 790 | self.sidebar.setCurrentRow(self.page_finish.index) 791 | 792 | def goto_custom_options_page(self): 793 | self.pages.setCurrentIndex(self.page_options_custom.index) 794 | self.sidebar.setCurrentRow(self.page_options.index) 795 | 796 | def start_subprocess( 797 | self, 798 | fnv_path: Path, 799 | fo4_path: Path, 800 | extracted_path: Path, 801 | temp_path: Path, 802 | output_path: Path, 803 | resources: list[PluginData] 804 | ): 805 | self.text_edit.clear() 806 | 807 | self.thread = WorkerThread( 808 | fnv_path=fnv_path, 809 | fo4_path=fo4_path, 810 | extracted_path=extracted_path, 811 | temp_path=temp_path, 812 | output_path=output_path, 813 | resources=resources, 814 | installer_params=self.params, 815 | ) 816 | 817 | self.thread.output_received.connect(self.update_output) 818 | self.thread.exception_occurred.connect(self.handle_exception) 819 | self.thread.task_done.connect(self.on_conversion_done) 820 | 821 | self.thread.start() 822 | 823 | def update_output(self, text): 824 | if self.text_length > 100000: 825 | new_text = self.text_edit.toPlainText()[-50000:] 826 | self.text_edit.setPlainText(new_text) 827 | self.text_length = len(new_text) 828 | 829 | self.text_length += len(text) 830 | 831 | self.text_edit.insertPlainText(text) 832 | 833 | self.params.log_file.write(text) 834 | 835 | self.text_edit.moveCursor(QtGui.QTextCursor.MoveOperation.End) 836 | 837 | def handle_exception(self, exception, exc_type=None, tb=None): 838 | # Convert traceback to a string if it's provided 839 | tb_string = "".join(traceback.format_exception(exc_type, exception, tb)) if tb else "" 840 | 841 | # Display the exception and the traceback (if available) in the QMessageBox 842 | QtWidgets.QMessageBox.critical( 843 | self, 844 | "Error", 845 | f"An exception occurred:\n{exception}\n\nTraceback:\n{tb_string}" 846 | ) 847 | self.thread.quit() 848 | 849 | 850 | def error_handler(type_, value, tb): 851 | traceback.print_exception(type_, value, tb) 852 | 853 | # Convert traceback to a string 854 | tb_string = "".join(traceback.format_exception(type_, value, tb)) 855 | 856 | # Display the exception and the traceback in the QMessageBox 857 | QtWidgets.QMessageBox.critical( 858 | None, 859 | "Error", 860 | f"An exception occurred:\n{value}\n\nTraceback:\n{tb_string}" 861 | ) 862 | 863 | 864 | def pre_startup_check(): 865 | error_msg = ( 866 | "Failed to find the required files. " 867 | "Did you run the application from the correct working directory?" 868 | ) 869 | 870 | failed = False 871 | 872 | for path in REQUIRED_PATHS: 873 | if path.exists(): 874 | continue 875 | 876 | error_msg += f"\n - {path.absolute()}" 877 | 878 | failed = True 879 | 880 | if not failed: 881 | return True 882 | 883 | QtWidgets.QMessageBox.critical(None, "Error", error_msg) 884 | 885 | return False 886 | 887 | 888 | if __name__ == '__main__': 889 | sys.excepthook = error_handler 890 | 891 | import argparse 892 | 893 | parser = argparse.ArgumentParser() 894 | 895 | parser.add_argument("--skip_bsas", action="store_true") 896 | parser.add_argument("--skip_meshes", action="store_true") 897 | parser.add_argument("--skip_optimize", action="store_true") 898 | parser.add_argument("--skip_data_files", action="store_true") 899 | parser.add_argument("--skip_plugin_convert", action="store_true") 900 | parser.add_argument("--skip_lod_settings", action="store_true") 901 | parser.add_argument("--ignore_existing_files", action="store_true") 902 | parser.add_argument("--debug", action="store_true") 903 | 904 | args = parser.parse_args() 905 | 906 | if args.debug: 907 | DEBUG = True 908 | 909 | app = QApplication(sys.argv) 910 | 911 | if not pre_startup_check(): 912 | sys.exit(1) 913 | 914 | with open(f"log-{int(time.time())}.txt", "w") as f: 915 | window = Installer(params=InstallerParams( 916 | skip_bsas=args.skip_bsas, 917 | skip_meshes=args.skip_meshes, 918 | skip_optimize=args.skip_optimize, 919 | skip_data=args.skip_data_files, 920 | skip_plugin_convert=args.skip_plugin_convert, 921 | ignore_existing_files=args.ignore_existing_files, 922 | skip_lod_settings=args.skip_lod_settings, 923 | debug=args.debug, 924 | log_file=f, 925 | )) 926 | 927 | window.resize(600, 400) 928 | window.show() 929 | sys.exit(app.exec()) 930 | -------------------------------------------------------------------------------- /bin/bsab/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | --------------------------------------------------------------------------------