@@ -233,20 +233,34 @@ def substitute(self, old_path):
233233 return old_path
234234
235235 def datainspect (self ):
236- # only run the spell if there are NiSourceTexture blocks
237- return self .inspectblocktype (NifFormat .NiSourceTexture )
236+ # only run the spell if contains
237+ # NiSourceTexture or BSShaderTextureSet blocks
238+ if self .inspectblocktype (NifFormat .BSShaderTextureSet ):
239+ return True
240+ elif self .inspectblocktype (NifFormat .NiSourceTexture ):
241+ return True
242+ else :
243+ return False
244+
238245
239246 def branchinspect (self , branch ):
240247 # only inspect the NiAVObject branch, texturing properties and source
241248 # textures
242249 return isinstance (branch , (NifFormat .NiAVObject ,
243250 NifFormat .NiTexturingProperty ,
244- NifFormat .NiSourceTexture ))
251+ NifFormat .NiSourceTexture ,
252+ NifFormat .BSLightingShaderProperty ,
253+ NifFormat .BSShaderTextureSet ))
245254
246255 def branchentry (self , branch ):
247256 if isinstance (branch , NifFormat .NiSourceTexture ):
248257 branch .file_name = self .substitute (branch .file_name )
249258 return False
259+
260+ elif isinstance (branch , NifFormat .BSShaderTextureSet ):
261+ for n , tex in enumerate (branch .textures ):
262+ branch .textures [n ] = self .substitute (tex )
263+ return False
250264 else :
251265 return True
252266
@@ -261,7 +275,7 @@ class SpellFixTexturePath(SpellParseTexturePath):
261275 """
262276
263277 SPELLNAME = "fix_texturepath"
264-
278+
265279 def substitute (self , old_path ):
266280 new_path = old_path
267281 new_path = new_path .replace (b'\n ' , b'\\ n' )
0 commit comments