pyffi :: spells :: nif :: modify :: SpellSubstituteTexturePath :: Class SpellSubstituteTexturePath
[hide private]
[frames] | no frames]

Class SpellSubstituteTexturePath

source code

       object --+                
                |                
            Spell --+            
                    |            
             NifSpell --+        
                        |        
fix.SpellParseTexturePath --+    
                            |    
      fix.SpellFixTexturePath --+
                                |
                               SpellSubstituteTexturePath
Known Subclasses:

Runs a regex replacement on texture paths.
Instance Methods [hide private]
 
substitute(self, old_path)
Returns modified texture path, and reports if path was modified.
source code

Inherited from fix.SpellParseTexturePath: branchentry, branchinspect, datainspect

Inherited from NifSpell: inspectblocktype

Inherited from NifSpell (private): _datainspect

Inherited from Spell: __init__, branchexit, dataentry, dataexit, recurse

Inherited from Spell (private): _branchinspect

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
bool
toastentry(cls, toaster)
Called just before the toaster starts processing all files.
source code

Inherited from Spell: get_toast_stream, toastexit

Class Variables [hide private]
  SPELLNAME = 'modify_substitutetexturepath'
A str describing how to refer to the spell from the command line.

Inherited from fix.SpellParseTexturePath: READONLY

Inherited from Spell: changed, data, stream, toaster

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

toastentry(cls, toaster)
Class Method

source code 

Called just before the toaster starts processing all files. If it returns False, then the spell is not used. The default implementation simply returns True.

For example, if the spell only acts on a particular block type, but that block type is excluded, then you can use this function to flag that this spell can be skipped. You can also use this function to initialize statistics data to be aggregated from files, to initialize a log file, and so.

Parameters:
  • toaster - The toaster this spell is called from.
Returns: bool
True if the spell applies, False otherwise.
Overrides: Spell.toastentry
(inherited documentation)

substitute(self, old_path)

source code 
Returns modified texture path, and reports if path was modified.
Overrides: fix.SpellParseTexturePath.substitute