Skyrim
0 of 0

File information

Last updated

Original upload

Created by

DarkShenron

Uploaded by

DarkShenron

Virus scan

Safe to use

About this mod

A purpleness fixer for linux gamers. This python script automatically fixes broken texture references due to case mismatches on linux and other systems.

Requirements
Permissions and credits



Announcement


Version 1.2 is out of alpha
!
This script now replaces all absolute texture references automatically, ie.. C:\Games\Skyrim\Data\textures\weapons\xyz.dds gets translated to textures\weapons\xyz.dds.
Broken texture references like C:\GamesSkyrimData\textures\weapons\xyz.dds also get auto-corrected.


NIF TexCase Fixer
A purpleness fixer for linux gamers



What is it?
This is a python script which fixes purple texture caused due to case mismatch between nif and dds. Many mod authors use incorrect case when setting texture paths inside nifs, while this is harmless in windows since its case insensitive but on case sensitive systems like linux this breaks texture referencing causing purple or missing textures. To correct this issue, one has to manually set correct texture path for every reference in every single broken nif by editing it inplace in nifskope.
This script automates this procedure and correct all case mismatches found in nifs based on installed textures. It also generates a list of all references for non-existent textures, so that any missing textures could easily be pinpointed.

This script also replaces all absolute references with relative references. A "C:\Games\Data\textures\xyz\xyz.dds" will get translated to "textures\xyz\xyz.dds". If reference is broken ie.. "C:\GamesDATA\TExtuRes\xyz\xyz.dds"), it will be corrected automatically. This will be especially useful for mod authors as after testing textures in nifskope they won't have to manually change every single texture path.

How does it work?
Script's workflow can basically be divided into four stages:
  • Make a list of all textures present in users texture folder.
  • Scan through all nifs finding all broken texture references.
  • Correct correctable references and make a list of uncorrectable missing references.
  • Generate a log for alll missing textures.


Requirements

This is a python script so yes you need python to run it. I made this on python 3.6 but any version of python 3+ should be fine. I used modules, glob,re and os which should come prepackaged with python on most systems.

How to run it


  • First, put this script in directory where both your meshes and textures folders reside ie.. if you are a MO user put this inside the problematic mod's root folder and in case you use NMM then first extract problematic mod to some folder and then put this in same folder too.
  • Next step, running it from that folder. If on linux, a simple "./nifcasefixer" inside a terminal opened at that location should work. On windows, shift+right click and open command prompt in script's folder and then run "python nifcasefixer" .
  • Let the script run its course, it might take time depending on mod size or system speed.It will correct all case mismatches in paths inside nifs and in end it will generate a log file for all missing textures.


Which mods does this script fix?


The problem originates from different naming scheme in mods.Thus, almost any mod having mesh files is prone to this. A safe bet is if you have a mesh mod run this script in its folder.

FAQ

Q: Does this work in windows?
A: It should, as long as you have right version of python. I can't myself test it in windows so do provide feedback if you encounter any bugs.

Q: Do I need it on windows?
A: For case mismatches you don't, for absolute reference corrections, yes, you do. Absolute references plague both Linux and Windows equally.

Q: I am still encountering purple textures after using this script?
A: Check missing textures log, it should show all those textures that are being referenced but not present in loose files.

Q: Does this scan BSA too?
A: No.

Q: Could I run this from my data folder to fix all my nifs in one run?
A: Yes you could, but running this in a separate directory for each mod is the ideal way.

Changelog

Version 1.2
  • Full support for converting absolute reference to relative one.
  • Auto correction for broken paths


Version 1.2alpha
  • Added support for converting absolute references to relative ones - Thanks rsagris for suggestion
  • Minor changes in workflow

Version 1.0
  • Intial Release