diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b92ab79c..d3f4db0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ Bug #4803: Stray special characters before begin statement break script compilation Bug #4804: Particle system with the "Has Sizes = false" causes an exception Bug #4820: Spell absorption is broken + Bug #4827: NiUVController is handled incorrectly Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis diff --git a/components/nif/controller.cpp b/components/nif/controller.cpp index 49f591b47..26c3f43f0 100644 --- a/components/nif/controller.cpp +++ b/components/nif/controller.cpp @@ -139,7 +139,7 @@ namespace Nif { Controller::read(nif); - nif->getUShort(); // always 0 + uvSet = nif->getUShort(); data.read(nif); } diff --git a/components/nif/controller.hpp b/components/nif/controller.hpp index f22d10622..7a05b0715 100644 --- a/components/nif/controller.hpp +++ b/components/nif/controller.hpp @@ -112,6 +112,7 @@ class NiUVController : public Controller { public: NiUVDataPtr data; + int uvSet; void read(NIFStream *nif); void post(NIFFile *nif); diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 0ed485862..1f2dab6c5 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -648,9 +648,14 @@ namespace NifOsg if (ctrl->recType == Nif::RC_NiUVController) { const Nif::NiUVController *niuvctrl = static_cast(ctrl.getPtr()); + const int uvSet = niuvctrl->uvSet; std::set texUnits; + // UVController should work only for textures which use a given UV Set, usually 0. for (unsigned int i=0; i uvctrl = new UVController(niuvctrl->data.getPtr(), texUnits); setupController(niuvctrl, uvctrl, animflags);