Skip to content

Commit 97894a3

Browse files
InfernioSharlikran
authored andcommitted
Improve and expand model hash exclusions
Squashed commit consisting of these 3 commits: 1. Drop MelModelHash in favor of MelNull MelNull already does what we want - the definitions are almost identical! The only real difference is that MelModelHash also saves the texture hashes as an attribute of the record. This is obviously totally unnecessary - we don't want to do anything with those hashes. To that end, let's just drop those classes and use MelNull. 2. [SSE] Drop PROJ/NAM2 and BPDT/NAM5 These are texture hashes as well! zilav pointed this out [1], but it looks like this got missed when the texture hash changes were originally made. I don't know if WB actually patches or writes these, but better safe than sorry. [1] wrye-bash#403 (comment). 3. Correct texture hash explanation - TO BE SQUASHED The actual explanation, as provided by zilav, is that texture hashes are just an optimization and are totally optional - plenty of records in Skyrim.esm don't have them.
1 parent 0cea470 commit 97894a3

2 files changed

Lines changed: 13 additions & 24 deletions

File tree

Mopy/bash/game/fallout4/records.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,14 @@ class _MelModel(MelGroup):
4040
# Destructible
4141
'DMDL': ('DMDL', 'DMDT', 'DMDC', 'DMDS'), }
4242

43-
class MelModelHash(MelBase):
44-
"""See game.skyrim.records._MelModel.MelModelHash"""
45-
def loadData(self, record, ins, sub_type, size_, readId):
46-
MelBase.loadData(self, record, ins, sub_type, size_, readId)
47-
def getSlotsUsed(self):
48-
return ()
49-
def setDefault(self,record): return
50-
def dumpData(self,record,out): return
51-
5243
def __init__(self, attr='model', subType='MODL'):
5344
"""Initialize."""
5445
types = self.__class__.typeSets[subType]
5546
MelGroup.__init__(
5647
self, attr, MelString(types[0], 'modPath'),
57-
self.MelModelHash(types[1], 'textureHashes'),
48+
# Ignore texture hashes - they're only an optimization, plenty
49+
# of records in Skyrim.esm are missing them
50+
MelNull(types[1]),
5851
MelOptStruct(types[2], 'f', 'colorRemappingIndex'),
5952
MelOptStruct(types[3], 'I', (FID,'materialSwap')),
6053
MelBase(types[3], 'modf_p'),

Mopy/bash/game/skyrim/records.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,14 @@ class _MelModel(brec.MelGroup):
5050
'MOD5': ('MOD5', 'MO5T', 'MO5S'),
5151
'DMDL': ('DMDL', 'DMDT', 'DMDS'), }
5252

53-
class MelModelHash(MelBase):
54-
"""TextureHashes are not used for loose files and there is never a
55-
Bashed Patch.bsa. So we read the record if present and then
56-
discard it."""
57-
def loadData(self, record, ins, sub_type, size_, readId):
58-
MelBase.loadData(self, record, ins, sub_type, size_, readId)
59-
def getSlotsUsed(self):
60-
return ()
61-
def setDefault(self, record): return
62-
def dumpData(self, record, out): return
63-
6453
def __init__(self, attr='model', subType='MODL'):
6554
"""Initialize."""
6655
types = self.__class__.typeSets[subType]
6756
MelGroup.__init__(self, attr, MelString(types[0], 'modPath'),
68-
self.MelModelHash(types[1], 'textureHashes'),
57+
# Ignore texture hashes - they're only an
58+
# optimization, plenty of records in Skyrim.esm
59+
# are missing them
60+
MelNull(types[1]),
6961
MelMODS(types[2], 'alternateTextures'), )
7062

7163
def debug(self, on=True):
@@ -1637,7 +1629,9 @@ def loadData(self, record, ins, sub_type, size_, readId):
16371629
'limbReplacementScale'),
16381630
MelString('NAM1','limbReplacementModel'),
16391631
MelString('NAM4','goreEffectsTargetBone'),
1640-
MelBase('NAM5','textureFilesHashes'),
1632+
# Ignore texture hashes - they're only an optimization, plenty of
1633+
# records in Skyrim.esm are missing them
1634+
MelNull('NAM5'),
16411635
),
16421636
)
16431637
__slots__ = melSet.getSlotsUsed()
@@ -5050,7 +5044,9 @@ def loadData(self, record, ins, sub_type, size_, readId):
50505044
),
50515045
MelGroup('models',
50525046
MelString('NAM1','muzzleFlashPath'),
5053-
MelBase('NAM2','nam2_p'),
5047+
# Ignore texture hashes - they're only an optimization, plenty of
5048+
# records in Skyrim.esm are missing them
5049+
MelNull('NAM2'),
50545050
),
50555051
MelStruct('VNAM','I','soundLevel',),
50565052
)

0 commit comments

Comments
 (0)