ousnius / BodySlide-and-Outfit-Studio

BodySlide and Outfit Studio, a tool to convert, create, and customize outfits and bodies for Bethesda games.
GNU General Public License v3.0
286 stars 63 forks source link

Fallout 76 #451

Closed Lapig closed 2 years ago

Lapig commented 2 years ago

It would be nice to just allow meshes from FO76 to be opened even if it's not officially supported or anything like that. As is the meshes' themselves can be edited with almost no issue that I've seen, materials caused problems but even with no material support it would still be very useful

diff --git a/src/NifFile.cpp b/src/NifFile.cpp
index c2274da..e187841 100644
--- a/src/NifFile.cpp
+++ b/src/NifFile.cpp
@@ -206,7 +206,7 @@ int NifFile::Load(std::istream& file, const NifLoadOptions& options) {
        }

        NiVersion& version = stream.GetVersion();
-       if (!(version.IsOB() || version.IsFO3() || version.IsSK() || version.IsSSE() || version.IsFO4() || version.IsSpecial())) {
+       if (!(version.IsOB() || version.IsFO3() || version.IsSK() || version.IsSSE() || version.IsFO4() || version.IsSpecial() || version.IsFO76())) {
            // Unsupported file version
            Clear();
            return 2;

diff --git a/src/program/OutfitProject.cpp b/src/program/OutfitProject.cpp
index 755085c..054a53d 100644
--- a/src/program/OutfitProject.cpp
+++ b/src/program/OutfitProject.cpp
@@ -1300,7 +1300,7 @@ void OutfitProject::SetTextures(NiShape* shape, const std::vector<std::string>&
        NiShader* shader = workNif.GetShader(shape);
        if (shader) {
            // Find material file
-           if (workNif.GetHeader().GetVersion().User() == 12 && workNif.GetHeader().GetVersion().Stream() >= 130) {
+           if (workNif.GetHeader().GetVersion().User() == 12 && workNif.GetHeader().GetVersion().Stream() >= 130 && workNif.GetHeader().GetVersion().Stream()<150) {
                matFile = shader->name.get();
                if (!matFile.empty())
                    hasMat = true;

This was my hackjob patch set that I used and then running outfitstudio in FO4 mode, loading a FO76 outfit, editing and exporting it, results in valid usable fo76 nifs. Currently trying to open a nif from 76 just errors out with unsupported version.

ousnius commented 2 years ago

@Lapig The reason FO76 NIFs aren't loading isn't a technical one, I made a decision not to support modding a multiplayer game, potentially causing issues.

Lapig commented 2 years ago

That's understandable, I don't see much of a potential for malicious or harmful use to the point that it should be explicitly disabled but if that's your decision and you're deadset on it I'll respect that, appreciate all your work regardless cheers

ousnius commented 2 years ago

The required pieces for this should all be in place now.