Module which contains all spells that check something in a nif file.
Spells for dumping particular blocks from nifs.
Module which contains all spells that fix something in a nif.
Bases: pyffi.spells.nif.NifSpell
Delete tangentspace if it is present.
Bases: pyffi.spells.nif.NifSpell
Add tangentspace if none is present.
Bases: pyffi.spells.nif.NifSpell
Create or update skin partition, with settings that work for Freedom Force vs. The 3rd Reich.
Bases: pyffi.spells.nif.fix.SpellParseTexturePath
Fix the texture path. Transforms 0x0a into n and 0x0d into r. This fixes a bug in nifs saved with older versions of nifskope. Also transforms / into . This fixes problems when packing files into a bsa archive. Also if the version is 20.0.0.4 or higher it will check for bad texture path form of e.g. c:program filesbethsoftobtexturesfilepath.dds and replace it with e.g. texturesfilepath.dds.
Bases: pyffi.spells.nif.NifSpell
For NiTriStrips if their NiTriStripsData also occurs in a bhkNiTriStripsShape, make deep copy of data in havok. This is mainly useful as a preperation for other spells that act on NiTriStripsData, to ensure that the havok data remains untouched.
Bases: pyffi.spells.nif.NifSpell
Clamp corrupted material alpha values.
Bases: pyffi.spells.nif.SpellVisitSkeletonRoots
Transform skinned geometries so similar bones have the same bone data, and hence, the same bind position, over all geometries.
Bases: pyffi.spells.nif.SpellVisitSkeletonRoots
Transform geometries so each set of geometries that shares bones is aligned with the transform of the root bone of that set.
Bases: pyffi.spells.nif.SpellVisitSkeletonRoots
Transform bones so bone data agrees with bone transforms, and hence, all bones are in bind position.
Bases: pyffi.spells.nif.NifSpell
Merges skeleton roots in the nif file so that no skeleton root has another skeleton root as child. Warns if merge is impossible (this happens if the global skin data of the geometry is not the unit transform).
Bases: pyffi.spells.nif.NifSpell
Apply skin deformation to nif.
Bases: pyffi.spells.nif.NifSpell
Scale a model.
Bases: pyffi.spells.nif.check.SpellCheckCenterRadius
Recalculate geometry centers and radii.
Bases: pyffi.spells.nif.check.SpellCheckSkinCenterRadius
Recalculate skin centers and radii.
Bases: pyffi.spells.nif.check.SpellCheckMopp
Recalculate mopp data from collision geometry.
Bases: pyffi.spells.nif.NifSpell
Remove unused strings from string palette.
Parses string palette of either a single controller sequence, or of all controller sequences in a controller manager.
>>> seq = NifFormat.NiControllerSequence()
>>> seq.string_palette = NifFormat.NiStringPalette()
>>> block = seq.add_controlled_block()
>>> block.string_palette = seq.string_palette
>>> block.set_variable_1("there")
>>> block.set_node_name("hello")
>>> block.string_palette.palette.add_string("test")
12
>>> seq.string_palette.palette.get_all_strings()
['there', 'hello', 'test']
>>> SpellCleanStringPalette().branchentry(seq)
pyffi.toaster:INFO:parsing string palette
False
>>> seq.string_palette.palette.get_all_strings()
['hello', 'there']
>>> block.get_variable_1()
'there'
>>> block.get_node_name()
'hello'
Helper function to substitute strings in the string palette, to allow subclasses of this spell can modify the strings. This implementation returns string unmodified.
Bases: pyffi.spells.nif.NifSpell
Remove root branches that shouldn’t be root branches and are unused in the file such as NiProperty branches that are not properly parented.
Bases: pyffi.spells.nif.NifSpell
Fix empty skeleton roots in an as sane as possible way.
Spells for optimizing nif files.
Bases: pyffi.spells.nif.NifSpell
Remove empty and duplicate entries in reference lists.
Return a cleaned copy of the given list of references.
Bases: pyffi.spells.nif.NifSpell
Remove duplicate branches.
Bases: pyffi.spells.nif.NifSpell
Optimize all geometries: - remove duplicate vertices - triangulate - recalculate skin partition - recalculate tangent space
Bases: pyffi.spells.SpellCleanFarNifSpellDelUnusedRootsSpellCleanRefListsSpellDetachHavokTriStripsDataSpellFixTexturePathSpellClampMaterialAlphaSpellFixBhkSubShapesSpellFixEmptySkeletonRootsSpellMergeDuplicatesSpellOptimizeGeometrySpellOptimizeCollisionBoxSpellOptimizeCollisionGeometry
Global fixer and optimizer spell.
Bases: pyffi.spells.nif.NifSpell
Remove nodes that are not used for anything.
Module which contains all spells that modify a nif.
Bases: pyffi.spells.nif.fix.SpellParseTexturePath
Changes the texture path while keeping the texture names.
Bases: pyffi.spells.nif.fix.SpellFixTexturePath
Runs a regex replacement on texture paths.
Returns modified texture path, and reports if path was modified.
Bases: pyffi.spells.nif.modify.SpellSubstituteTexturePath
Changes the texture path by replacing ‘textures*’ with ‘textureslowres*’ - used mainly for making _far.nifs
Bases: pyffi.spells.nif.NifSpell
Sets the object collision to be a different type
Bases: pyffi.spells.nif.NifSpell
Sets the object’s collision material to be a different type
Bases: pyffi.spells.nif.NifSpell
Scales the animation time.
Bases: pyffi.spells.nif.NifSpell
Reverses the animation by reversing datas in relation to the time.
Bases: pyffi.spells.nif.fix.SpellCleanStringPalette
Substitute strings in a string palette.
Returns modified string, and reports if string was modified.
Bases: pyffi.spells.nif.NifSpell
Changes controlled block priorities based on controlled block name.
Bases: pyffi.spells.nif.NifSpell
Changes specified bone(s) translations/rotations in their NiTransformInterpolator.
Bases: pyffi.spells.nif.NifSpell
Deletes the specified bone(s) NiTransformData(s).
Bases: pyffi.spells.nif.NifSpell
Delete blocks that match the exclude list.
Strip branch if it is flagged for deletion.
Returns True for those branches that must be deleted. The default implementation returns True for branches that are not admissible as specified by include/exclude options of the toaster. Override in subclasses that must delete specific branches.
Bases: pyffi.spells.nif.modify.SpellDelBranches
Delete blocks that match a given list. Only useful as base class for other spells.
List of branch classes that have to be deleted.
Bases: pyffi.spells.nif.modify.SpellDelBranches
Delete any geometries with a material name of ‘skin’
Bases: pyffi.spells.nif.NifSpell
Disable parallax shader (for Oblivion, but may work on other nifs too).
Bases: pyffi.spells.nif.NifSpell
Adds a NiStencilProperty to each geometry if it is not present.
Bases: pyffi.spells.nif.modify.SpellDelBranches
Delete vertex color properties and vertex color data.
Bases: pyffi.spells.SpellDelSkinShapesSpellAddStencilProperty
Spell to make fleshless CMR (Custom Model Races) clothing/armour type nifs.
Bases: pyffi.spells.SpellDelVertexColorPropertySpellDelAlphaPropertySpellDelSpecularPropertySpellDelBSXFlagsSpellDelStringExtraDatasSpellDelTangentSpaceSpellDelCollisionDataSpellDelAnimationSpellDisableParallax
Spell to clean _far type nifs (for even more optimizations, combine this with the optimize spell).
Bases: pyffi.spells.SpellDelVertexColorPropertySpellDelAlphaPropertySpellDelSpecularPropertySpellDelBSXFlagsSpellDelStringExtraDatasSpellDelTangentSpaceSpellDelCollisionDataSpellDelAnimationSpellDisableParallaxSpellLowResTexturePath
Spell to make _far type nifs (for even more optimizations, combine this with the optimize spell).