Bases: pyffi.object_models.xml.FileFormat
This class contains the generated classes from the xml.
Bases: pyffi.formats.nif._ATextureRenderData, builtins.object
Save image as DDS file.
Bases: pyffi.object_models.xml.struct_.StructBase
Used in NiDefaultAVObjectPalette.
Object reference.
Object name.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.object_models.xml.struct_.StructBase
Unknown
Size of Block
Unknown
Unknown
Has data
Unknown
Unknown
Bases: pyffi.object_models.xml.struct_.StructBase
Unsure. The block in which this channel is stored? Usually there is only one block, and so this is zero.
Offset (in bytes) of this channel. Sum of all num channel bytes per element of all preceeding block infos.
Type of data in this channel
Total number of bytes of this channel (num vertices times num bytes per element)
Number of bytes per element of this channel
Number of bytes per element in all channels together. Sum of num channel bytes per element over all block infos.
Unknown, usually equal to 2.
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, describing how transparency is handled in a texture.
Bases: pyffi.object_models.xml.enum.EnumBase
Animation type used on this position. This specifies the function of this position.
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, describing the apply mode of a texture.
Bases: pyffi.object_models.xml.struct_.StructBase
A texture reference used by NiArkTextureExtraData.
Bases: pyffi.formats.nif.NiNode
Morrowind specific?
Bases: pyffi.formats.nif.NiObject
Bethesda-specific node.
Unknown
Bases: pyffi.formats.nif.NiExtraData
Links a nif with a Havok Behavior .hkx animation file
Name of the hkx file.
Unknown, has to do with blending appended bones onto an actor.
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node.
Unknown
Unknown
Bases: pyffi.formats.nif.NiExtraData
Unknown
Number of bone entries
Bone Entry
Bases: pyffi.formats.nif._BSBound, builtins.object
Scale data.
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node.
Unknown
Unknown
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node.
Unknown
Unknown
Bases: pyffi.formats.nif.NiExtraData
Bethesda-specific node. (for dynamic decal projection?)
Number of groups
Unknown
Number of Blocks
Bases: pyffi.object_models.xml.enum.EnumBase
Biped bodypart data used for visibility control of triangles. Options are Fallout 3, except where marked for Skyrim (uses SBP prefix)Skyrim BP names are listed only for vanilla names, different creatures have different defnitions for naming.
Bases: pyffi.formats.nif._BSDismemberSkinInstance, builtins.object
Return triangles and body part indices.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node.
Bases: pyffi.formats.nif.NiProperty
Skyrim non-PP shader model, used primarily for transparency effects.
Emissive color
Multipled Emissive Colors
Texture will fade in within this proximity.
points to an external texture.
points to an external texture.
How to handle texture borders.
Offset UVs
Offset UV Scale to repeat tiling textures
Bases: pyffi.formats.nif.NiFloatInterpController
Unkown
Unknown
Bases: pyffi.formats.nif.NiFloatInterpController
This controller is used to animate variables in BSEffectShaderPropertyFloatController, target is a number in order they appear:0: Visibility?1:2:3:4: Emissive or Saturation?5: Alpha Transparency6: U Offset7: U Scale8: V Offset9: V Scale
Unknown
Bases: pyffi.formats.nif.NiNode
Bethesda-specific fade node.
Bases: pyffi.formats.nif.NiTimeController
Bethesda-specific node.
Frustrum field of view animation interpolater and data.
Bases: pyffi.formats.nif.NiExtraData
Unknown. Marks furniture sitting positions?
Number of positions.
Unknown. Probably has something to do with the furniture positions?
Bases: pyffi.formats.nif.BSFurnitureMarker
Furniture Marker for actors
Bases: pyffi.formats.nif.NiExtraData
Orientation marker for Skyrim’s inventory view.How to show the nif in the player’s inventory.Typically attached to the root node of the nif tree.If not present, then Skyrim will still show the nif in inventory,using the default values.Name should be ‘INV’ (without the quotes).For rotations, a short of “4712” appears as “4.712” but “959” appears as “0.959” meshesweaponsdaedricdaedricbowskinned.nif
Zoom factor.
Bases: pyffi.formats.nif.NiKeyframeController
An extended keyframe controller.
A link to more keyframe data.
Bases: pyffi.formats.nif.NiTriBasedGeom
A variation on NiTriShape, for visibility control over vertex groups.
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiTimeController
A controller that trails a bone behind an actor.
How the bone lags rotation
How long it takes to rotate about an actor back to rest position.
How far bone will tail an actor.
Bases: pyffi.formats.nif.NiNode
Unknown, related to trees.
Bases: pyffi.formats.nif.NiProperty
Skyrim PP shader for assigning material/shader/texture.
The materials opacity (1=non-transparent).
Glow color and alpha
Multiplied emissive colors
Scales the environment/cube map. (0-??)
Eye cubemap scale
The material’s specular power, or glossiness (0-999).
Tints the base texture. Overridden by game settings.
Offset to set center for left eye cubemap
Controls strength for envmap/backlight/rim/softlight lighting effect?
Controls strength for envmap/backlight/rim/softlight lighting effect?
Max Passes
How strong the environment/cube map is. (0-??)
Scales the inner parallax layer texture.
How far from the surface the inner layer appears to be.
Depth of inner parallax layer effect.
Offset to set center for right eye cubemap
Scale
Skyrim Shader Flags for setting render/shader options.
Skyrim Shader Flags for setting render/shader options.
Tints the base texture. Overridden by game settings.
Unknown/unused? CK lists “snow material” when used.
Adds a colored highlight.
Brightness of specular highlight. (0=not visible) (0-999)
How to handle texture borders.
Texture Set, can have override in an esm/esp
Unknown
Offset UVs
Offset UV Scale to repeat tiling textures, see above.
Bases: pyffi.formats.nif.NiFloatInterpController
Which variable in the shader to animate.
Bases: pyffi.formats.nif.NiFloatInterpController
This controller is used to animate variables in BSLightingShaderPropertyFloatController, target is a number in order they appear:5: U Offset6: V Offset7: U Scale8: V Scale
Which variable in the shader to animate.
Bases: pyffi.object_models.xml.enum.EnumBase
Values for configuring the shader type in a BSLightingShaderProperty
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node.
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiFloatInterpController
Bethesda-Specific node.
Bases: pyffi.formats.nif.NiObject
Bethesda-specific node.
Unknown.
Bases: pyffi.formats.nif.BSMultiBoundData
Bethesda-specific node.
Extent of the AABB in all directions
Position of the AABB’s center
Bases: pyffi.formats.nif.NiObject
Abstract base type for bounding data.
Bases: pyffi.formats.nif.NiNode
Bethesda-specific node.
Unknown.
Unknown
Bases: pyffi.formats.nif.BSMultiBoundData
Oriented bounding box.
Center of the box.
Rotation of the bounding box.
Size of the box along each axis.
Bases: pyffi.formats.nif.BSMultiBoundData
Bethesda-specific node.
Radius
Unknown Flag
Unknown Flag
Unknown Flag
Bases: pyffi.formats.nif.NiAlphaController
Unkown
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node.
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysVolumeEmitter
Particle emitter that uses a node, its children and subchildren to emit from. Emission will be evenly spread along points from nodes leading to their direct parents/children only.
Bases: pyffi.formats.nif.NiPSysModifier
Unknown
Group of target NiNodes?
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Particle system (multi?) emitter controller.
This controller’s data
Unknown
Unknown
Links to a bool interpolator. Controls emitter’s visibility status?
Bases: pyffi.formats.nif.NiPSysModifier
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Bethesda-Specific Particle node.
Unknown
Unknown
Unknown
Unknown
Colors
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Bethesda-Specific (mesh?) Particle System Modifier.
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Similar to a Flip Controller, this handles particle texture animation on a single texture atlas
Ending frame/position on atlas
Unknown
Unknown
Frame to start looping
Starting frame/position on atlas
Random chance to start on a different frame?
Bases: pyffi.object_models.xml.struct_.StructBase
The sum of all of these equal num total bytes per element, so this probably describes how each data element breaks down into smaller chunks (i.e. atoms).
Block offsets in the data? Usually equal to zero.
Unknown
Has data
Number of atoms?
Number of blocks? Usually equal to one.
Total number of bytes (over all channels and all elements, equals num total bytes per element times num vertices).
Unsure, but this seems to correspond again to the number of total bytes per element.
Bases: pyffi.formats.nif.AbstractAdditionalGeometryData
Number of additional data blocks
Number of additional data blocks
Information about additional data blocks
Number of additional data blocks. Usually there is exactly one block.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that adds a blend of object space translation and rotation to particles born in world space.
Amount of blending?
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.formats.nif.NiFloatInterpController
Skyrim, Paired with dummy TriShapes, this controller generates lightning shapes for special effects.First interpolator controls Generation.
Unknown
Unknown
Unknown
How far lightning will stretch to.
Unknown
Unknown
Influences forking behavior
Unknown, unsure if this is actually another interpolator link.
References interpolator for Mutation of strips
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
References interpolator for Amplitutde control. 0=straight, 50=wide
How wide the bolt will be
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiTimeController
Bethesda-specific node.
Link to Interpolator.
Bases: pyffi.formats.nif.NiFloatInterpController
Bethesda-Specific node.
Bases: pyffi.formats.nif.NiTransformInterpolator
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Geometry present in the segment
Index multiplied by 1536 (0x0600)
Unknown
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.formats.nif.NiTriShape
Bethesda-specific node.
Number of segments in the square grid
Configuration of each segment
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific property.
Unknown
Bases: pyffi.formats.nif.BSShaderLightingProperty
Bethesda-specific property.
The texture glow map.
Unknown
Normally what appears to be a junk value (0xB33BBD2E). Appears to be related to glow when Unk Flags is (0x82000148).
Unknown
Unknown
Bases: pyffi.formats.nif.BSShaderLightingProperty
Bethesda-specific Shade node.
Glow color and alpha
Rate of texture movement for refraction shader.
Texture Set
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiProperty
Bethesda-specific Property node
Unknown
Unknown
Shader Property Flags
Unknown (Set to 0x21 for NoLighting, 0x11 for Water)
Unknown
Bases: pyffi.formats.nif.NiObject
Bethesda-specific Texture Set.
Number of Textures
Textures.0: Diffuse1: Normal/Gloss2: Glow/Skin/Hair3: Height/Parallax4: Environment5: Environment Mask
Bases: pyffi.object_models.xml.enum.EnumBase
The type of animation interpolation (blending) that will be used on the associated key frames.
Bases: pyffi.formats.nif.NiProperty
Skyrim Sky shader block.
Sky Object Type
points to an external texture.
Offset UVs. Seems to be unused, but it fits with the other Skyrim shader properties.
Offset UV Scale to repeat tiling textures, see above.
Bases: pyffi.formats.nif.NiPSysData
Bethesda-Specific (mesh?) Particle System Data.
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiParticleSystem
Bethesda-Specific (mesh?) Particle System.
Bases: pyffi.formats.nif.NiInterpolator
Bethesda-specific node.
Unknown float data.
Unknown.
Unknown.
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Name of affected node?
Transform data.
Transform data.
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Rotation.
Scale (usually float_min).
Translation.
Bases: pyffi.formats.nif.NiNode
Node for handling Trees, Switches branch configurations for variation?
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiNode
Bethesda-Specific node. Found on fxFire effects
Unknown
Value
Bases: pyffi.formats.nif.NiExtraData
Bethesda-specific node.
Unknown
Unknown
Bases: pyffi.formats.nif.NiProperty
Skyrim water shader property, different from “WaterShaderProperty” seen in Fallout.
Unknown, flag?
Offset UVs. Seems to be unused, but it fits with the other Skyrim shader properties.
Offset UV Scale to repeat tiling textures, see above.
A bitflag, only the first/second bit controls water flow positive or negative along UVs.
Defines attributes for the water shader (will use SkyrimWaterShaderFlags)
Bases: pyffi.formats.nif.NiPSysModifier
Particle Modifier that uses the wind value from the gamedata to alter the path of particles.
The amount of force wind will have on particles.
Bases: pyffi.formats.nif.NiIntegerExtraData
Controls animation and collision. Integer holds flags:Bit 0 : enable havok, bAnimated(Skyrim)Bit 1 : enable collision, bHavok(Skyrim)Bit 2 : is skeleton nif?, bRagdoll(Skyrim)Bit 3 : enable animation, bComplex(Skyrim)Bit 4 : FlameNodes present, bAddon(Skyrim)Bit 5 : EditorMarkers presentBit 6 : bDynamic(Skyrim)Bit 7 : bArticulated(Skyrim)Bit 8 : bIKTarget(Skyrim)Bit 9 : Unknown(Skyrim)
Bases: pyffi.object_models.xml.enum.EnumBase
Determines the way the billboard will react to the camera.
alias of UShort
Bases: pyffi.object_models.xml.struct_.StructBase
Body part list for DismemberSkinInstance
Body Part Index
Flags related to the Body Partition
Bases: pyffi.object_models.xml.struct_.StructBase
Stores Bone Level of Detail info in a BSBoneLODExtraData
The bones name
Distance to cull?
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
Bounding box.
Radius, per direction.
Rotation matrix.
Translation vector.
Usually 1.
Bases: pyffi.object_models.xml.struct_.StructBase
Box
Capsule
Type of collision data.
Half Space
Sphere
Union
Bases: pyffi.object_models.xml.struct_.StructBase
Box Bounding Volume
Axis
Center
Extent
Bases: pyffi.object_models.xml.basic.BasicBase
Array (list) of bytes. Implemented as basic type to speed up reading and also to prevent data to be dumped by __str__.
Bases: pyffi.object_models.xml.struct_.StructBase
A color without alpha (red, green, blue).
Blue color component.
Green color component.
Red color component.
Bases: pyffi.object_models.xml.struct_.StructBase
A color with alpha (red, green, blue, alpha).
Alpha color component.
Blue color component.
Green color component.
Red color component.
Bases: pyffi.object_models.xml.basic.BasicBase
Matrix of bytes. Implemented as basic type to speed up reading and to prevent data being dumped by __str__.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.object_models.xml.struct_.StructBase
Capsule Bounding Volume
Center
Origin
Unknown.
Unknown.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
Channel data
Bits per channel
Data Storage Convention
Channel Type
Unknown
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.enum.EnumBase
Sets how objects are to be cloned.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
A color without alpha (red, green, blue).
Blue color component.
Green color component.
Red color component.
Bases: pyffi.object_models.xml.struct_.StructBase
A color with alpha (red, green, blue, alpha).
Alpha.
Blue component.
Green component.
Red component.
Bases: pyffi.object_models.xml.enum.EnumBase
The data format of components.
Bases: pyffi.object_models.xml.enum.EnumBase
Used by NiGeometryData to control the volatility of the mesh. While they appear to be flags they behave as an enum.
Bases: pyffi.formats.nif._ControllerLink, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.node_name_offset
-1
>>> link.set_node_name("Bip01")
>>> link.node_name_offset
0
>>> link.get_node_name()
b'Bip01'
>>> link.node_name
b'Bip01'
>>> link.set_node_name("Bip01 Tail")
>>> link.node_name_offset
6
>>> link.get_node_name()
b'Bip01 Tail'
>>> link.node_name
b'Bip01 Tail'
Return the node name.
>>> # a doctest
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.string_palette = NifFormat.NiStringPalette()
>>> palette = link.string_palette.palette
>>> link.node_name_offset = palette.add_string("Bip01")
>>> link.get_node_name()
b'Bip01'
>>> # another doctest
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.node_name = "Bip01"
>>> link.get_node_name()
b'Bip01'
Bases: pyffi.object_models.xml.enum.EnumBase
Determines the way that UV texture coordinates are generated.
Bases: pyffi.object_models.xml.enum.EnumBase
The animation cyle behavior.
Bases: pyffi.object_models.Data
A class to contain the actual nif data.
Note that L{header} and L{blocks} are not automatically kept in sync with the rest of the nif data, but they are resynchronized when calling L{write}.
Variables: |
|
---|
Bases: pyffi.object_models.common.UInt
Quickly checks whether the stream appears to contain nif data, and read the nif header. Resets stream to original position.
Call this function if you only need to inspect the header of the nif.
Parameters: | stream (file) – The file to inspect. |
---|
This function checks the version only, and is faster than the usual inspect function (which reads the full header). Sets the L{version} and L{user_version} instance variables if the stream contains a valid nif file.
Call this function if you simply wish to check that a file is a nif file without having to parse even the header.
Raises ValueError: | |
---|---|
If the stream does not contain a nif file. | |
Parameters: | stream (file) – The stream from which to read. |
Read a nif file. Does not reset stream position.
Parameters: | stream (file) – The stream from which to read. |
---|
Write a nif file. The L{header} and the L{blocks} are recalculated from the tree at L{roots} (e.g. list of block types, number of blocks, list of block types, list of strings, list of block sizes etc.).
Parameters: | stream (file) – The stream to which to write. |
---|
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.object_models.xml.enum.EnumBase
Determines how a data stream is used?
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
Array of Vectors for Decal placement in BSDecalPlacementVectorExtraData.
Vector Normals
Number of sets
Vector XYZ coords
Bases: pyffi.object_models.xml.enum.EnumBase
Determines decay function. Used by NiPSysBombModifier.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node.
Bases: pyffi.object_models.xml.enum.EnumBase
The type of information that’s store in a texture used by a NiTextureEffect.
Bases: pyffi.object_models.xml.struct_.StructBase
Whether or not to normalize the data.
The element semantic.
Bases: pyffi.object_models.xml.enum.EnumBase
Controls which parts of the mesh that the particles are emitted from.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
Information about how the file was exported
Could be the name of the creator of the NIF file?
Unknown. Can be something like’TriStrip Process Script’.
Unknown. Possibly the selected option of the export script. Can be something like’Default Export Script’.
Probably the number of strings that follow.
Bases: pyffi.object_models.xml.struct_.StructBase
Bases: pyffi.object_models.xml.struct_.StructBase
Bases: pyffi.object_models.xml.enum.EnumBase
This enum lists the different face culling options.
Bases: pyffi.object_models.xml.enum.EnumBase
The force field’s type.
Bases: pyffi.formats.nif.string
A file path.
Returns a case insensitive hash value.
Bases: pyffi.object_models.common.UInt
Bases: pyffi.object_models.common.UShort
Bases: pyffi.formats.nif._Footer, builtins.object
Bases: pyffi.object_models.xml.enum.EnumBase
The type of force? May be more valid values.
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.object_models.xml.struct_.StructBase
Describes a furniture position?
Unknown
Unknown/unused in nif?
Similar to Orientation, in float form.
Offset of furniture marker.
Furniture marker orientation.
Refers to a furnituremarkerxx.nif file. Always seems to be the same as Position Ref 2.
Refers to a furnituremarkerxx.nif file. Always seems to be the same as Position Ref 1.
Bases: pyffi.formats.nif.FxWidget
Unknown.
Bases: pyffi.formats.nif.FxWidget
Unknown.
Unknown pointers to other buttons. Maybe other buttons in a group so they can be switch off if this one is switched on?
Number of unknown links.
Unknown.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiNode
Firaxis-specific UI widgets?
Looks like 9 links and some string data.
Unknown.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node.
Bases: pyffi.object_models.xml.struct_.StructBase
Center
Normal
Bases: pyffi.object_models.xml.enum.EnumBase
A material, used by havok shape objects.
Bases: pyffi.formats.nif._Header, builtins.object
Check if header has a particular block type.
Raises ValueError: | |
---|---|
If number of block types is zero (only nif versions 10.0.1.0 and up store block types in header). | |
Parameters: | block_type (L{NifFormat.NiObject}) – The block type. |
Returns: | True if the header’s list of block types has the given block type, or a subclass of it. False otherwise. |
Return type: | bool |
Bases: pyffi.object_models.xml.basic.BasicBase
Transforms version number into a version string.
>>> NifFormat.HeaderString.version_string(0x03000300)
'NetImmerse File Format, Version 3.03'
>>> NifFormat.HeaderString.version_string(0x03010000)
'NetImmerse File Format, Version 3.1'
>>> NifFormat.HeaderString.version_string(0x0A000100)
'NetImmerse File Format, Version 10.0.1.0'
>>> NifFormat.HeaderString.version_string(0x0A010000)
'Gamebryo File Format, Version 10.1.0.0'
>>> NifFormat.HeaderString.version_string(0x0A010000,
... modification="neosteam")
'NS'
>>> NifFormat.HeaderString.version_string(0x14020008,
... modification="ndoors")
'NDSNIF....@....@...., Version 20.2.0.8'
>>> NifFormat.HeaderString.version_string(0x14030009,
... modification="jmihs1")
'Joymaster HS1 Object Format - (JMI), Version 20.3.0.9'
Bases: pyffi.object_models.xml.struct_.StructBase
This constraint allows rotation about a specified axis.
Axis of rotation.
Axle A in second entity coordinate system.
Vector in the rotation plane which defines the zero angle.
Vector in the rotation plane, orthogonal on the previous one, which defines the positive direction of rotation. This is always the vector product of Axle A and Perp2 Axle In A1.
Perp2 Axle In A1 in second entity coordinate system.
Perp2 Axle In A2 in second entity coordinate system.
Pivot point around which the object will rotate.
Pivot A in second entity coordinate system.
Bases: pyffi.object_models.xml.enum.EnumBase
Determines how the raw image data is stored in NiRawImageData.
Bases: pyffi.formats.nif._InertiaMatrix, builtins.object
Return matrix as 3x3 list.
Return matrix as 3x3 tuple.
Return a copy of the matrix.
Return True if the matrix is close to identity.
Set to identity matrix.
Bases: pyffi.object_models.xml.struct_.StructBase
A generic key with support for interpolation. Type 1 is normal linear interpolation, type 2 has forward and backward tangents, and type 3 has tension, bias and continuity arguments. Note that color4 and byte always seem to be of type 1.
The key backward tangent.
Key forward tangent.
The key’s TBC.
Time of the key.
The key value.
Bases: pyffi.object_models.xml.struct_.StructBase
Array of vector keys (anything that can be interpolated, except rotations).
The key type.
The keys.
Number of keys in the array.
Bases: pyffi.object_models.xml.enum.EnumBase
The type of animation interpolation (blending) that will be used on the associated key frames.
Bases: pyffi.object_models.xml.struct_.StructBase
The distance range where a specific level of detail applies.
End of Range.
Begining of range.
Unknown (0,0,0).
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, describing how vertex colors influence lighting.
Bases: pyffi.formats.nif.BSShaderPPLightingProperty
Bethesda-specific node.
Bases: pyffi.formats.nif._LimitedHingeDescriptor, builtins.object
Update B pivot and axes from A using the given transform.
Bases: pyffi.object_models.xml.basic.BasicBase
Basic type for strings ending in a newline character (0x0a).
>>> from tempfile import TemporaryFile
>>> f = TemporaryFile()
>>> l = NifFormat.LineString()
>>> f.write('abcdefg\x0a'.encode())
8
>>> f.seek(0)
0
>>> l.read(f)
>>> str(l)
'abcdefg'
>>> f.seek(0)
0
>>> l.set_value('Hi There')
>>> l.write(f)
>>> f.seek(0)
0
>>> m = NifFormat.LineString()
>>> m.read(f)
>>> str(m)
'Hi There'
Bases: pyffi.object_models.xml.struct_.StructBase
Rotation.
Scale.
Translation.
Bases: pyffi.object_models.xml.struct_.StructBase
Group of vertex indices of vertices that match.
Number of vertices in this group.
The vertex indices.
Bases: pyffi.object_models.xml.struct_.StructBase
Data stored per-material by NiRenderObject
Extra data associated with the material?
The name of the material.
Bases: pyffi.object_models.xml.struct_.StructBase
A 2x2 matrix of float values. Stored in OpenGL column-major format.
Member 1,1 (top left)
Member 1,2 (top right)
Member 2,1 (bottom left)
Member 2,2 (bottom right)
Bases: pyffi.formats.nif._Matrix33, builtins.object
Return matrix as 3x3 list.
Return matrix as 3x3 tuple.
Return a copy of the matrix.
Return determinant.
Get inverse (assuming is_scale_rotation is true!).
Gets the scale (assuming is_scale_rotation is true!).
Decompose matrix into scale and quaternion.
Decompose the matrix into scale and rotation, where scale is a float and rotation is a C{Matrix33}. Returns a pair (scale, rotation).
Get transposed of the matrix.
Return True if the matrix is close to identity.
Returns True if the matrix is a rotation matrix (a member of SO(3)).
Returns true if the matrix decomposes nicely into scale * rotation.
Set to identity matrix.
Compose the matrix as the product of scale * rotation.
Calculate supremum norm of matrix (maximum absolute value of all entries).
Bases: pyffi.formats.nif._Matrix44, builtins.object
Return matrix as 4x4 list.
Return matrix as 4x4 tuple.
Create a copy of the matrix.
Calculates inverse (fast assumes is_scale_rotation_translation is True).
Returns upper left 3x3 part.
Returns lower left 1x3 part.
Return True if the matrix is close to identity.
Set to identity matrix.
Sets upper left 3x3 part.
Set matrix from rows.
Returns lower left 1x3 part.
Calculate supremum norm of matrix (maximum absolute value of all entries).
Bases: pyffi.object_models.xml.struct_.StructBase
Describes the semantic of each component.
Sets whether this stream data is per-instance data for use inhardware instancing.
The number of submesh-to-region mappings that this data streamhas.
Reference to a data stream object which holds the data used bythis reference.
A lookup table that maps submeshes to regions.
Bases: pyffi.object_models.xml.enum.EnumBase
Describes the type of primitives stored in a mesh object.
Bases: pyffi.object_models.xml.struct_.StructBase
Description of a MipMap within a NiPixelData object.
Height of the mipmap image.
Offset into the pixel data array where this mipmap starts.
Width of the mipmap image.
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, describing how mipmaps are handled in a texture.
Bases: pyffi.object_models.xml.struct_.StructBase
Geometry morphing data component.
Name of the frame.
Unlike most objects, the presense of this value is not conditional on there being keys.
The morph key frames.
The number of morph keys that follow.
Unknown.
Morph vectors.
Bases: pyffi.object_models.xml.struct_.StructBase
Interpolator
Weight
Bases: pyffi.object_models.xml.enum.EnumBase
The motion type. Determines quality of motion?
Bases: pyffi.object_models.xml.enum.EnumBase
The motion system. 4 (Box) is used for everything movable. 7 (Keyframed) is used on statics and animated stuff.
Bases: pyffi.object_models.xml.struct_.StructBase
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.object_models.xml.struct_.StructBase
May be texture clamp mode.
May be texture filter mode.
Looks like a memory address, so probably a bool.
Link to the texture image.
-75?
0?
Unknown. Usually 0 but sometimes 257
This may be the UV set counting from 1 instead of zero.
Bases: pyffi.formats.nif.NiObject
Unknown.
Unknown.
Unknown.
The parent?
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiObject
Unknown. Only found in 2.3 nifs.
Child?
A count.
Unknown.
Name of this object.
Unknown.
Unknown. Matrix?
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiObject
Unknown!
Unknown.
Bases: pyffi.formats.nif.NiObject
Unknown!
Unknown.
Bases: pyffi.formats.nif.NiObject
Unknown!
Unknown.
Bases: pyffi.formats.nif.NiObject
Unknown!
Unknown.
Bases: pyffi.formats.nif._NiAVObject, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> prop1 = NifFormat.NiProperty()
>>> prop1.name = "hello"
>>> prop2 = NifFormat.NiProperty()
>>> prop2.name = "world"
>>> node.get_properties()
[]
>>> node.set_properties([prop1, prop2])
>>> [prop.name for prop in node.get_properties()]
[b'hello', b'world']
>>> [prop.name for prop in node.properties]
[b'hello', b'world']
>>> node.set_properties([])
>>> node.get_properties()
[]
>>> # now set them the other way around
>>> node.set_properties([prop2, prop1])
>>> [prop.name for prop in node.get_properties()]
[b'world', b'hello']
>>> [prop.name for prop in node.properties]
[b'world', b'hello']
>>> node.remove_property(prop2)
>>> [prop.name for prop in node.properties]
[b'hello']
>>> node.add_property(prop2)
>>> [prop.name for prop in node.properties]
[b'hello', b'world']
Add the given property to the property list.
Parameters: | prop (L{NifFormat.NiProperty}) – The property block to add. |
---|
Apply scale factor on data.
Parameters: | scale – The scale factor. |
---|
Return a list of the properties of the block.
Returns: | The list of properties. |
---|---|
Return type: | list of L{NifFormat.NiProperty} |
Return scale, rotation, and translation into a single 4x4 matrix, relative to the C{relative_to} block (which should be another NiAVObject connecting to this block). If C{relative_to} is None, then returns the transform stored in C{self}, or equivalently, the target is assumed to be the parent.
Parameters: | relative_to – The block relative to which the transform must be calculated. If None, the local transform is returned. |
---|
Remove the given property to the property list.
Parameters: | prop (L{NifFormat.NiProperty}) – The property block to remove. |
---|
Set the list of properties from the given list (destroys existing list).
Parameters: | proplist (list of L{NifFormat.NiProperty}) – The list of property blocks to set. |
---|
Set rotation, translation, and scale, from a 4x4 matrix.
Parameters: | m – The matrix to which the transform should be set. |
---|
Bases: pyffi.formats.nif.NiObject
Unknown.
Bases: pyffi.formats.nif.AbstractAdditionalGeometryData
Number of additional data blocks
Number of additional data blocks
Information about additional data blocks
Number of additional data blocks
Number of vertices
Bases: pyffi.formats.nif.NiFloatInterpController
Time controller for transparency.
Alpha controller data index.
Bases: pyffi.formats.nif.NiProperty
Transparency. Flags 0x00ED.
Bit 0 : alpha blending enableBits 1-4 : source blend modeBits 5-8 : destination blend modeBit 9 : alpha test enableBit 10-12 : alpha test modeBit 13 : no sorter flag ( disables triangle sorting )blend modes (glBlendFunc):0000 GL_ONE0001 GL_ZERO0010 GL_SRC_COLOR0011 GL_ONE_MINUS_SRC_COLOR0100 GL_DST_COLOR0101 GL_ONE_MINUS_DST_COLOR0110 GL_SRC_ALPHA0111 GL_ONE_MINUS_SRC_ALPHA1000 GL_DST_ALPHA1001 GL_ONE_MINUS_DST_ALPHA1010 GL_SRC_ALPHA_SATURATEtest modes (glAlphaFunc):000 GL_ALWAYS001 GL_LESS010 GL_EQUAL011 GL_LEQUAL100 GL_GREATER101 GL_NOTEQUAL110 GL_GEQUAL111 GL_NEVER
Threshold for alpha testing (see: glAlphaFunc)
Unknown
Unknown
Bases: pyffi.formats.nif.NiLight
Ambient light source.
Bases: pyffi.formats.nif.NiExtraData
Unknown node.
Bases: pyffi.formats.nif.NiExtraData
Unknown node.
Contains a string like”Gamebryo_1_1”or”4.1.0.12”
Bases: pyffi.formats.nif.NiExtraData
Unknown node.
Bases: pyffi.formats.nif.NiExtraData
Unknown node.
Bases: pyffi.formats.nif.NiExtraData
Unknown node.
Bases: pyffi.formats.nif.NiParticles
Unknown.
Bases: pyffi.formats.nif.NiParticlesData
Particle system data object (with automatic normals?).
Bases: pyffi.formats.nif.NiNode
Bethesda-specific extension of Node with animation properties stored in the flags, often 42?
Bases: pyffi.formats.nif.NiBoneLODController
A simple LOD controller for bones.
Bases: pyffi.formats.nif.NiParticleSystemController
A particle system controller, used by BS in conjunction with NiBSParticleNode.
Bases: pyffi.formats.nif.NiNode
Unknown.
Bases: pyffi.formats.nif.NiObject
Stores the number of control points of a B-spline.
The number of control points of the B-spline (number of frames of animation plus degree of B-spline minus one).
Bases: pyffi.formats.nif.NiBSplineFloatInterpolator
Unknown.
Base value when curve not defined.
Bias
Multiplier
Starting offset for the data. (USHRT_MAX for no data.)
Bases: pyffi.formats.nif.NiBSplinePoint3Interpolator
Unknown.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif._NiBSplineCompTransformInterpolator, builtins.object
Apply scale factor on data.
Return an iterator over all rotation keys.
Return an iterator over all scale keys.
Return an iterator over all translation keys.
Bases: pyffi.formats.nif._NiBSplineData, builtins.object
>>> # a doctest
>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiBSplineData()
>>> block.num_short_control_points = 50
>>> block.short_control_points.update_size()
>>> for i in range(block.num_short_control_points):
... block.short_control_points[i] = 20 - i
>>> list(block.get_short_data(12, 4, 3))
[(8, 7, 6), (5, 4, 3), (2, 1, 0), (-1, -2, -3)]
>>> offset = block.append_short_data([(1,2),(4,3),(13,14),(8,2),(33,33)])
>>> offset
50
>>> list(block.get_short_data(offset, 5, 2))
[(1, 2), (4, 3), (13, 14), (8, 2), (33, 33)]
>>> list(block.get_comp_data(offset, 5, 2, 10.0, 32767.0))
[(11.0, 12.0), (14.0, 13.0), (23.0, 24.0), (18.0, 12.0), (43.0, 43.0)]
>>> block.append_float_data([(1.0,2.0),(3.0,4.0),(0.5,0.25)])
0
>>> list(block.get_float_data(0, 3, 2))
[(1.0, 2.0), (3.0, 4.0), (0.5, 0.25)]
>>> block.append_comp_data([(1,2),(4,3)])
(60, 2.5, 1.5)
>>> list(block.get_short_data(60, 2, 2))
[(-32767, -10922), (32767, 10922)]
>>> list(block.get_comp_data(60, 2, 2, 2.5, 1.5))
[(1.0, 2.00...), (4.0, 2.99...)]
Append data as compressed list.
Parameters: | data – A list of elements, where each element is a tuple of integers. (Note: cannot be an interator; maybe this restriction will be removed in a future version.) |
---|---|
Returns: | The offset, bias, and multiplier. |
Append data.
Parameters: | data – A list of elements, where each element is a tuple of floats. (Note: cannot be an interator; maybe this restriction will be removed in a future version.) |
---|---|
Returns: | The offset at which the data was appended. |
Append data.
Parameters: | data – A list of elements, where each element is a tuple of integers. (Note: cannot be an interator; maybe this restriction will be removed in a future version.) |
---|---|
Returns: | The offset at which the data was appended. |
Get an interator to the data, converted to float with extra bias and multiplication factor. If C{x} is the short value, then the returned value is C{bias + x * multiplier / 32767.0}.
Parameters: |
|
---|---|
Returns: | A list of C{num_elements} tuples of size C{element_size}. |
Get an iterator to the data.
Parameters: |
|
---|---|
Returns: | A list of C{num_elements} tuples of size C{element_size}. |
Get an iterator to the data.
Parameters: |
|
---|---|
Returns: | A list of C{num_elements} tuples of size C{element_size}. |
Bases: pyffi.formats.nif.NiBSplineInterpolator
Unknown.
Bases: pyffi.formats.nif._NiBSplineInterpolator, builtins.object
Return an iterator over all key times.
@todo: When code for calculating the bsplines is ready, this function will return exactly self.basis_data.num_control_points - 1 time points, and not self.basis_data.num_control_points as it is now.
Bases: pyffi.formats.nif.NiBSplineInterpolator
Unknown.
Unknown.
Bases: pyffi.formats.nif._NiBSplineTransformInterpolator, builtins.object
Apply scale factor on data.
Return an iterator over all rotation keys.
Return an iterator over all scale keys.
Return an iterator over all translation keys.
Bases: pyffi.formats.nif.NiAVObject
Unknown
unknown
Data count.
data count 2.
data count.
references.
data.
data.
Unknown.
Unknown.
Unknown (illegal link?).
unknown
Bases: pyffi.formats.nif.NiObject
Sub data of NiBezierMesh
unknown
unknown
unknown
unknown
unknown
unknown
unknown
unknown
unknown
Bases: pyffi.formats.nif.NiNode
These nodes will always be rotated to face the camera creating a billboard effect for any attached objects.In pre-10.1.0.0 the Flags field is used for BillboardMode.Bit 0: hiddenBits 1-2: collision modeBit 3: unknown (set in most official meshes)Bits 5-6: billboard modeCollision modes:00 NONE01 USE_TRIANGLES10 USE_OBBS11 CONTINUEBillboard modes:00 ALWAYS_FACE_CAMERA01 ROTATE_ABOUT_UP10 RIGID_FACE_CAMERA11 ALWAYS_FACE_CENTER
The way the billboard will react to the camera.
Bases: pyffi.formats.nif.NiExtraData
Binary extra data object. Used to store tangents and bitangents in Oblivion.
The binary data.
Bases: pyffi.formats.nif.NiObject
Voxel data object.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown. Always a multiple of 7.
Unknown.
Unknown.
Unknown.
Unknown. Is this^3 the Unknown Bytes 1 size?
Vectors on the unit sphere.
Bases: pyffi.formats.nif.NiExtraData
Voxel extra data object.
Link to binary voxel data.
Unknown. 0?
Bases: pyffi.formats.nif.NiBlendInterpolator
An interpolator for a bool.
The interpolated bool?
Bases: pyffi.formats.nif.NiBlendInterpolator
An interpolator for a float.
The interpolated float?
Bases: pyffi.formats.nif.NiInterpolator
An extended type of interpolater.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiBlendInterpolator
Interpolates a point?
The interpolated point?
Bases: pyffi.formats.nif.NiBlendInterpolator
Unknown.
Bases: pyffi.formats.nif.NiNode
A NiNode used as a skeleton bone?
Bases: pyffi.formats.nif.NiTimeController
Level of detail controller for bones. Priority is arranged from low to high.
A list of node groups (each group a sequence of bones).
Number of node groups.
Number of node groups.
Number of shape groups.
The size of the second list of shape groups.
List of shape groups.
Group of NiTriShape indices.
Unknown.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiObject
Timed boolean data.
The boolean keys.
Bases: pyffi.formats.nif.NiSingleInterpController
A controller that interpolates floating point numbers?
Bases: pyffi.formats.nif.NiKeyBasedInterpolator
Unknown.
Value when posed? At time 0?
Refers to a NiBoolData object.
Bases: pyffi.formats.nif.NiBoolInterpolator
Unknown.
Bases: pyffi.formats.nif.NiExtraData
Boolean extra data.
The boolean extra data value.
Bases: pyffi.formats.nif.NiAVObject
Camera object.
Frustrum bottom.
Frustrum far.
Frustrum left.
Frustrum near.
Frustrum right.
Frustrum top.
Level of detail adjust.
Unknown. Changing value crashes viewer.
Unknown. Changing value crashes viewer.
Unknown.
Unknown.
Unknown.
Determines whether perspective is used. Orthographic means no perspective.
Viewport bottom.
Viewport left.
Viewport right.
Viewport top.
Bases: pyffi.formats.nif.NiTriBasedGeom
A shape node that holds continuous level of detail information.Seems to be specific to Freedom Force.
Bases: pyffi.formats.nif.NiTriBasedGeomData
Holds mesh data for continuous level of detail shapes.Pesumably a progressive mesh with triangles specified by edge splits.Seems to be specific to Freedom Force.The structure of this is uncertain and highly experimental at this point.No file with this data can currently be read properly.
Bases: pyffi.formats.nif.NiSkinInstance
A copy of NISkinInstance for use with NiClod meshes.
Bases: pyffi.formats.nif.NiCollisionObject
Collision box.
Collision data.
Collision Mode
Propagation Mode
Use Alternate Bounding Volume.
Bases: pyffi.formats.nif.NiObject
This is the most common collision object found in NIF files. It acts as a real object thatis visible and possibly (if the body allows for it) interactive. The node itselfis simple, it only has three properties.For this type of collision object, bhkRigidBody or bhkRigidBodyT is generally used.
Index of the AV object referring to this collision object.
Bases: pyffi.formats.nif.NiObject
Color data for material color controller.
The color keys.
Bases: pyffi.formats.nif.NiExtraData
Unknown.
RGBA Color?
Bases: pyffi.formats.nif.NiTimeController
Unknown. Root of all controllers?
Refers to a list of NiControllerSequence object.
Designates whether animation sequences are cumulative?
The number of controller sequence objects.
Refers to a NiDefaultAVObjectPalette.
Bases: pyffi.formats.nif._NiControllerSequence, builtins.object
Create new controlled block, and return it.
>>> seq = NifFormat.NiControllerSequence()
>>> seq.num_controlled_blocks
0
>>> ctrlblock = seq.add_controlled_block()
>>> seq.num_controlled_blocks
1
>>> isinstance(ctrlblock, NifFormat.ControllerLink)
True
Bases: pyffi.formats.nif.NiObject
The format of each component in this data stream.
The size in bytes of this data stream.
Number of components of the data (matches corresponding field in MeshData).
Number of regions (such as submeshes).
The regions in the mesh. Regions can be used to mark off submeshes which are independent draw calls.
Bases: pyffi.formats.nif.NiAVObjectPalette
Unknown. Refers to a list of objects. Used by NiControllerManager.
Number of objects.
The objects.
Unknown.
Bases: pyffi.formats.nif.NiLight
Directional light source.
Bases: pyffi.formats.nif.NiProperty
Unknown.
1’s Bit: Enable dithering
Bases: pyffi.formats.nif.NiAVObject
A dynamic effect such as a light or environment map.
This is probably the list of affected nodes. For some reason i do not know the max exporter seems to write pointers instead of links. But it doesn’t matter because at least in version 4.0.0.2 the list is automagically updated by the engine during the load stage.
The list of affected nodes?
The number of affected nodes referenced.
The number of affected nodes referenced.
Turns effect on and off? Switches list to list of unaffected nodes?
Bases: pyffi.formats.nif.NiObjectNET
Unknown
unknown
unknown
List of child node object indices.
The number of child objects.
unknown (=4 - 5)
unknown
Bases: pyffi.formats.nif.NiTriShapeData
Holds mesh data using a list of singular triangles.
Bases: pyffi.formats.nif.NiObject
A generic extra data object.
Name of this object.
Block number of the next extra data object.
Bases: pyffi.formats.nif.NiSingleInterpController
An controller for extra data.
Bases: pyffi.formats.nif.NiFloatInterpController
Texture flipping controller.
Time between two flips.delta = (start_time - stop_time) / sources.num_indices
The image sources
The number of source objects.
The texture sources.
Target texture slot (0=base, 4=glow).
0?
Bases: pyffi.formats.nif.NiObject
Possibly the 1D position along a 3D path.
The keys.
Bases: pyffi.formats.nif.NiExtraData
Float extra data.
The float data.
Bases: pyffi.formats.nif.NiExtraDataController
Unknown.
Refers to a NiFloatExtraData name.
Number of extra bytes.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiSingleInterpController
A controller that interpolates floating point numbers?
Bases: pyffi.formats.nif.NiKeyBasedInterpolator
Unknown.
Float data?
Value when posed? At time 0?
Bases: pyffi.formats.nif.NiExtraData
Unknown.
Float data.
Number of floats in the next field.
Bases: pyffi.formats.nif.NiProperty
Describes... fog?
1’s bit: Enables Fog2’s bit: Sets Fog Function to FOG_RANGE_SQ4’s bit: Sets Fog Function to FOG_VERTEX_ALPHAIf 2’s and 4’s bit are not set, but fog is enabled, Fog function is FOG_Z_LINEAR.
The color of the fog.
The thickness of the fog? Default is 1.0
Bases: pyffi.formats.nif.NiTimeController
List of all armature bones.
List of all armature bones.
The number of node bones referenced as influences.
The number of node bones referenced as influences.
Bases: pyffi.formats.nif.NiInterpController
Time controller for geometry morphing.
Always Update
Geometry morphing data index.
Unknown.
Weighted Interpolators?
List of interpolators.
The number of interpolator objects.
A count.
Unknown.
Unknown.
Bases: pyffi.formats.nif._NiGeometry, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> id44 = NifFormat.Matrix44()
>>> id44.set_identity()
>>> skelroot = NifFormat.NiNode()
>>> skelroot.name = 'skelroot'
>>> skelroot.set_transform(id44)
>>> bone1 = NifFormat.NiNode()
>>> bone1.name = 'bone1'
>>> bone1.set_transform(id44)
>>> bone2 = NifFormat.NiNode()
>>> bone2.name = 'bone2'
>>> bone2.set_transform(id44)
>>> bone21 = NifFormat.NiNode()
>>> bone21.name = 'bone21'
>>> bone21.set_transform(id44)
>>> bone22 = NifFormat.NiNode()
>>> bone22.name = 'bone22'
>>> bone22.set_transform(id44)
>>> bone211 = NifFormat.NiNode()
>>> bone211.name = 'bone211'
>>> bone211.set_transform(id44)
>>> skelroot.add_child(bone1)
>>> bone1.add_child(bone2)
>>> bone2.add_child(bone21)
>>> bone2.add_child(bone22)
>>> bone21.add_child(bone211)
>>> geom = NifFormat.NiTriShape()
>>> geom.name = 'geom'
>>> geom.set_transform(id44)
>>> geomdata = NifFormat.NiTriShapeData()
>>> skininst = NifFormat.NiSkinInstance()
>>> skindata = NifFormat.NiSkinData()
>>> skelroot.add_child(geom)
>>> geom.data = geomdata
>>> geom.skin_instance = skininst
>>> skininst.skeleton_root = skelroot
>>> skininst.data = skindata
>>> skininst.num_bones = 4
>>> skininst.bones.update_size()
>>> skininst.bones[0] = bone1
>>> skininst.bones[1] = bone2
>>> skininst.bones[2] = bone22
>>> skininst.bones[3] = bone211
>>> skindata.num_bones = 4
>>> skindata.bone_list.update_size()
>>> [child.name for child in skelroot.children]
[b'bone1', b'geom']
>>> skindata.set_transform(id44)
>>> for bonedata in skindata.bone_list:
... bonedata.set_transform(id44)
>>> affectedbones = geom.flatten_skin()
>>> [bone.name for bone in affectedbones]
[b'bone1', b'bone2', b'bone22', b'bone211']
>>> [child.name for child in skelroot.children]
[b'geom', b'bone1', b'bone21', b'bone2', b'bone22', b'bone211']
Add bone with given vertex weights. After adding all bones, the geometry skinning information should be set from the current position of the bones using the L{update_bind_position} function.
Parameters: |
|
---|
Reposition all bone blocks and geometry block in the tree to be direct children of the skeleton root.
Returns list of all used bones by the skin.
Returns a list of vertices and normals in their final position after skinning, in geometry space.
Return the skin partition block.
Get vertex weights in a convenient format: list bone and weight per vertex.
Returns True if geometry is skinned.
Send all bones to their bind position.
Set skin partition block.
Make current position of the bones the bind position for this geometry.
Sets the NiSkinData overall transform to the inverse of the geometry transform relative to the skeleton root, and sets the NiSkinData of each bone to the geometry transform relative to the skeleton root times the inverse of the bone transform relative to the skeleton root.
Bases: pyffi.formats.nif._NiGeometryData, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> geomdata = NifFormat.NiGeometryData()
>>> geomdata.num_vertices = 3
>>> geomdata.has_vertices = True
>>> geomdata.has_normals = True
>>> geomdata.has_vertex_colors = True
>>> geomdata.num_uv_sets = 2
>>> geomdata.vertices.update_size()
>>> geomdata.normals.update_size()
>>> geomdata.vertex_colors.update_size()
>>> geomdata.uv_sets.update_size()
>>> geomdata.vertices[0].x = 1
>>> geomdata.vertices[0].y = 2
>>> geomdata.vertices[0].z = 3
>>> geomdata.vertices[1].x = 4
>>> geomdata.vertices[1].y = 5
>>> geomdata.vertices[1].z = 6
>>> geomdata.vertices[2].x = 1.200001
>>> geomdata.vertices[2].y = 3.400001
>>> geomdata.vertices[2].z = 5.600001
>>> geomdata.normals[0].x = 0
>>> geomdata.normals[0].y = 0
>>> geomdata.normals[0].z = 1
>>> geomdata.normals[1].x = 0
>>> geomdata.normals[1].y = 1
>>> geomdata.normals[1].z = 0
>>> geomdata.normals[2].x = 1
>>> geomdata.normals[2].y = 0
>>> geomdata.normals[2].z = 0
>>> geomdata.vertex_colors[1].r = 0.310001
>>> geomdata.vertex_colors[1].g = 0.320001
>>> geomdata.vertex_colors[1].b = 0.330001
>>> geomdata.vertex_colors[1].a = 0.340001
>>> geomdata.uv_sets[0][0].u = 0.990001
>>> geomdata.uv_sets[0][0].v = 0.980001
>>> geomdata.uv_sets[0][2].u = 0.970001
>>> geomdata.uv_sets[0][2].v = 0.960001
>>> geomdata.uv_sets[1][0].v = 0.910001
>>> geomdata.uv_sets[1][0].v = 0.920001
>>> geomdata.uv_sets[1][2].v = 0.930001
>>> geomdata.uv_sets[1][2].v = 0.940001
>>> for h in geomdata.get_vertex_hash_generator():
... print(h)
(1000, 2000, 3000, 0, 0, 1000, 99000, 98000, 0, 92000, 0, 0, 0, 0)
(4000, 5000, 6000, 0, 1000, 0, 0, 0, 0, 0, 310, 320, 330, 340)
(1200, 3400, 5600, 1000, 0, 0, 97000, 96000, 0, 94000, 0, 0, 0, 0)
Apply scale factor on data.
Generator which produces a tuple of integers for each (vertex, normal, uv, vcol), to ease detection of duplicate vertices. The precision parameters denote number of significant digits behind the comma.
Default for uvprecision should really be high because for very large models the uv coordinates can be very close together.
For vertexprecision, 3 seems usually enough (maybe we’ll have to increase this at some point).
Parameters: |
|
---|---|
Returns: | A generator yielding a hash value for each vertex. |
Recalculate center and radius of the data.
Bases: pyffi.formats.nif.NiParticleModifier
A particle modifier; applies a gravitational field on the particles.
The direction of the applied acceleration.
The strength/force of this gravity.
The position of the mass point relative to the particle system. (TODO: check for versions<= 3.1)
The force field’s type.
Unknown.
Bases: pyffi.formats.nif.NiObject
The filepath to the texture.
Link to the internally stored image data.
Unknown. Perhaps fImageScale?
Unknown. Often seems to be 7. Perhaps m_uiMipLevels?
0 if the texture is internal to the NIF file.
Bases: pyffi.formats.nif.NiMeshModifier
Bases: pyffi.formats.nif.NiExtraData
Extra integer data.
The value of the extra data.
Bases: pyffi.formats.nif.NiExtraData
Integers data.
Integers.
Number of integers.
Bases: pyffi.formats.nif.NiTimeController
A controller capable of interpolation?
Bases: pyffi.formats.nif.NiObject
Interpolator objects - function unknown.
Bases: pyffi.formats.nif.NiInterpolator
Interpolator objects that use keys?
Bases: pyffi.formats.nif.NiSingleInterpController
A time controller object for animation key frames.
Keyframe controller data index.
Bases: pyffi.formats.nif._NiKeyframeData, builtins.object
Apply scale factor on data.
Bases: pyffi.formats.nif.NiObject
Abstract class used for different types of LOD selections.
Bases: pyffi.formats.nif.NiSwitchNode
Level of detail selector. Links to different levels of detail of the same model, used to switch a geometry at a specified distance.
Point to calculate distance from for switching?
Refers to LOD level information, either distance or screen size based.
The ranges of distance that each level of detail applies in.
Number of levels of detail.
Bases: pyffi.formats.nif.NiDynamicEffect
Light source.
Ambient color.
Diffuse color.
Dimmer.
Specular color.
Bases: pyffi.formats.nif.NiPoint3InterpController
Light color animation controller.
Bases: pyffi.formats.nif.NiFloatInterpController
Unknown controller.
Bases: pyffi.formats.nif.NiFloatInterpController
Unknown controller
Bases: pyffi.formats.nif.NiTriBasedGeom
Wireframe geometry.
Bases: pyffi.formats.nif.NiGeometryData
Wireframe geometry data.
Is vertex connected to other (next?) vertex?
Bases: pyffi.formats.nif.NiTimeController
Unknown. Start time is 3.4e+38 and stop time is -3.4e+38.
Link to the node to look at?
Unknown.
Bases: pyffi.formats.nif.NiInterpolator
Unknown.
Refers to a Node to focus on.
Rotation.
Scale.
Target node name.
Translate.
Refers to NiPoint3Interpolator.
Refers to a NiFloatInterpolator.
Refers to a NiFloatInterpolator.
Unknown.
Bases: pyffi.formats.nif._NiMaterialColorController, builtins.object
Get target color (works for all nif versions).
Set target color (works for all nif versions).
Bases: pyffi.formats.nif._NiMaterialProperty, builtins.object
Are the two material blocks interchangeable?
Bases: pyffi.formats.nif.NiRenderObject
The combined bounding volume of all submeshes.
Sets whether hardware instancing is being used.
The number of submeshes contained in this mesh.
The primitive type of the mesh, such as triangles or lines.
Unknown.
Unknown.
Size of additional data.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiObject
Base class for mesh modifiers.
The complete points used by this mesh modifier
The number of complete points used by this mesh modifier.
The number of submit points used by this mesh modifier.
The submit points used by this mesh modifier
Bases: pyffi.formats.nif.NiPSysData
Particle meshes data.
Unknown.
Unknown. 0?
Unknown. Possible vertex count but probably not.
Unknown integers
Unknown NiNode.
Bases: pyffi.formats.nif.NiParticleSystem
Particle system.
Bases: pyffi.formats.nif.NiInterpController
Unknown! Used by Daoc->’healing.nif’.
Bases: pyffi.formats.nif._NiMorphData, builtins.object
Apply scale factor on data.
Bases: pyffi.formats.nif.NiMeshModifier
Performs linear-weighted blending between a set of target data streams.
Semantics and normalization of the morphing data stream elements.
FLAG_RELATIVETARGETS = 0x01FLAG_UPDATENORMALS = 0x02FLAG_NEEDSUPDATE = 0x04FLAG_ALWAYSUPDATE = 0x08FLAG_NEEDSCOMPLETION = 0x10FLAG_SKINNED = 0x20FLAG_SWSKINNED = 0x40
The number of morphing data stream elements.
The number of morph targets.
Bases: pyffi.formats.nif.NiInterpController
The number of morph targets.
Name of each morph target.
Bases: pyffi.formats.nif.NiInterpController
Unknown! Used by Daoc.
This controller’s data.
Bases: pyffi.formats.nif.NiInterpController
Unknown.
NiNode Targets to be controlled.
The number of target pointers that follow.
Bases: pyffi.formats.nif.NiProperty
(note: not quite complete yet... but already reads most of the DAoC ones)
Property flags.
Describes the various textures used by this mutli-texture property. Each slot probably has special meaning like thoes in NiTexturingProperty.
Unknown. Always 5 for DAoC files, and always 6 for Bridge Commander. Seems to have nothing to do with the number of Texture Element slots that follow.
Bases: pyffi.formats.nif._NiNode, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> x = NifFormat.NiNode()
>>> y = NifFormat.NiNode()
>>> z = NifFormat.NiNode()
>>> x.num_children =1
>>> x.children.update_size()
>>> y in x.children
False
>>> x.children[0] = y
>>> y in x.children
True
>>> x.add_child(z, front = True)
>>> x.add_child(y)
>>> x.num_children
2
>>> x.children[0] is z
True
>>> x.remove_child(y)
>>> y in x.children
False
>>> x.num_children
1
>>> e = NifFormat.NiSpotLight()
>>> x.add_effect(e)
>>> x.num_effects
1
>>> e in x.effects
True
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> child1 = NifFormat.NiNode()
>>> child1.name = "hello"
>>> child_2 = NifFormat.NiNode()
>>> child_2.name = "world"
>>> node.get_children()
[]
>>> node.set_children([child1, child_2])
>>> [child.name for child in node.get_children()]
[b'hello', b'world']
>>> [child.name for child in node.children]
[b'hello', b'world']
>>> node.set_children([])
>>> node.get_children()
[]
>>> # now set them the other way around
>>> node.set_children([child_2, child1])
>>> [child.name for child in node.get_children()]
[b'world', b'hello']
>>> [child.name for child in node.children]
[b'world', b'hello']
>>> node.remove_child(child_2)
>>> [child.name for child in node.children]
[b'hello']
>>> node.add_child(child_2)
>>> [child.name for child in node.children]
[b'hello', b'world']
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> effect1 = NifFormat.NiSpotLight()
>>> effect1.name = "hello"
>>> effect2 = NifFormat.NiSpotLight()
>>> effect2.name = "world"
>>> node.get_effects()
[]
>>> node.set_effects([effect1, effect2])
>>> [effect.name for effect in node.get_effects()]
[b'hello', b'world']
>>> [effect.name for effect in node.effects]
[b'hello', b'world']
>>> node.set_effects([])
>>> node.get_effects()
[]
>>> # now set them the other way around
>>> node.set_effects([effect2, effect1])
>>> [effect.name for effect in node.get_effects()]
[b'world', b'hello']
>>> [effect.name for effect in node.effects]
[b'world', b'hello']
>>> node.remove_effect(effect2)
>>> [effect.name for effect in node.effects]
[b'hello']
>>> node.add_effect(effect2)
>>> [effect.name for effect in node.effects]
[b'hello', b'world']
Add block to child list.
Parameters: |
|
---|
Add an effect to the list of effects.
Parameters: | effect (L{NifFormat.NiDynamicEffect}) – The effect to add. |
---|
Return a list of the children of the block.
Returns: | The list of children. |
---|---|
Return type: | list of L{NifFormat.NiAVObject} |
Return a list of the effects of the block.
Returns: | The list of effects. |
---|---|
Return type: | list of L{NifFormat.NiDynamicEffect} |
This function yields all skinned geometries which have self as skeleton root.
Attach skinned geometry to self (which will be the new skeleton root of the nif at the given skeleton root). Use this function if you move a skinned geometry from one nif into a new nif file. The bone links will be updated to point to the tree at self, instead of to the external tree.
This function will look for other geometries whose skeleton root is a (possibly indirect) child of this node. It will then reparent those geometries to this node. For example, it will unify the skeleton roots in Morrowind’s cliffracer.nif file, or of the (official) body skins. This makes it much easier to import skeletons in for instance Blender: there will be only one skeleton root for each bone, over all geometries.
The merge fails for those geometries whose global skin data transform does not match the inverse geometry transform relative to the skeleton root (the maths does not work out in this case!)
Returns list of all new blocks that have been reparented (and added to the skeleton root children list), and a list of blocks for which the merge failed.
Remove a block from the child list.
Parameters: | child (L{NifFormat.NiAVObject}) – The child to remove. |
---|
Remove a block from the effect list.
Parameters: | effect (L{NifFormat.NiDynamicEffect}) – The effect to remove. |
---|
This function will send all bones of geometries of this skeleton root to their bind position. For best results, call L{send_geometries_to_bind_position} first.
Returns: | A number quantifying the remaining difference between bind positions. |
---|---|
Return type: | float |
Some nifs (in particular in Morrowind) have geometries that are skinned but that do not share bones. In such cases, send_geometries_to_bind_position cannot reposition them. This function will send such geometries to the position of their root node.
Examples of such nifs are the official Morrowind skins (after merging skeleton roots).
Returns list of detached geometries that have been moved.
Call this on the skeleton root of geometries. This function will transform the geometries, such that all skin data transforms coincide, or at least coincide partially.
Returns: | A number quantifying the remaining difference between bind positions. |
---|---|
Return type: | float |
Set the list of children from the given list (destroys existing list).
Parameters: | childlist (list of L{NifFormat.NiAVObject}) – The list of child blocks to set. |
---|
Set the list of effects from the given list (destroys existing list).
Parameters: | effectlist (list of L{NifFormat.NiDynamicEffect}) – The list of effect blocks to set. |
---|
Bases: pyffi.formats.nif._NiObject, builtins.object
Scale data in this block. This implementation does nothing. Override this method if it contains geometry data that can be scaled.
Finds a chain of blocks going from C{self} to C{block}. If found, self is the first element and block is the last element. If no branch found, returns an empty list. Does not check whether there is more than one branch; if so, the first one found is returned.
Parameters: |
|
---|
Are the two blocks interchangeable?
@todo: Rely on AnyType, SimpleType, ComplexType, etc. implementation.
A generator for parsing all blocks in the tree (starting from and including C{self}).
Parameters: |
|
---|
Bases: pyffi.formats.nif._NiObjectNET, builtins.object
Add block to controller chain and set target of controller to self.
Add block to extra data list and extra data chain. It is good practice to ensure that the extra data has empty next_extra_data field when adding it to avoid loops in the hierarchy.
Add a particular extra integer data block.
Get a list of all controllers.
Get a list of all extra data blocks.
Remove block from extra data list and extra data chain.
>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiNode()
>>> block.num_extra_data_list = 3
>>> block.extra_data_list.update_size()
>>> extrablock = NifFormat.NiStringExtraData()
>>> block.extra_data_list[1] = extrablock
>>> block.remove_extra_data(extrablock)
>>> [extra for extra in block.extra_data_list]
[None, None]
Set all extra data blocks from given list (erases existing data).
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> extra1 = NifFormat.NiExtraData()
>>> extra1.name = "hello"
>>> extra2 = NifFormat.NiExtraData()
>>> extra2.name = "world"
>>> node.get_extra_datas()
[]
>>> node.set_extra_datas([extra1, extra2])
>>> [extra.name for extra in node.get_extra_datas()]
[b'hello', b'world']
>>> [extra.name for extra in node.extra_data_list]
[b'hello', b'world']
>>> node.extra_data is extra1
True
>>> extra1.next_extra_data is extra2
True
>>> extra2.next_extra_data is None
True
>>> node.set_extra_datas([])
>>> node.get_extra_datas()
[]
>>> # now set them the other way around
>>> node.set_extra_datas([extra2, extra1])
>>> [extra.name for extra in node.get_extra_datas()]
[b'world', b'hello']
>>> [extra.name for extra in node.extra_data_list]
[b'world', b'hello']
>>> node.extra_data is extra2
True
>>> extra2.next_extra_data is extra1
True
>>> extra1.next_extra_data is None
True
Parameters: | extralist (list of L{NifFormat.NiExtraData}) – List of extra data blocks to add. |
---|
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiPSSphereEmitter
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiPSysEmitterCtlr
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Bases: pyffi.formats.nif.NiPSEmitterDeclinationCtlr
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Bases: pyffi.formats.nif.NiPSEmitterPlanarAngleCtlr
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Bases: pyffi.formats.nif.NiPSEmitterRotAngleCtlr
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Bases: pyffi.formats.nif.NiPSEmitterRotSpeedCtlr
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiObject
Gravity node?
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiPSParticleSystem
Unknown - may or may not be emitted mesh?
Bases: pyffi.formats.nif.NiAVObject
Emitter?
Generator?
Simulator?
0?
0?
Counter?
Simulator?
Updater?
1?
0?
Spawner?
Unknown
Unknown
0?
-1?
-1?
0?
256?
0?
0?
0?
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiMeshModifier
The mesh modifier that performs all particle system simulation.
The number of simulation steps in this modifier.
Links to the simulation steps.
Bases: pyffi.formats.nif.NiPSSimulatorStep
Encapsulates a floodgate kernel that simulates particle colliders.
The colliders affecting the particle system.
The number of colliders affecting the particle system.
Bases: pyffi.formats.nif.NiPSSimulatorStep
Encapsulates a floodgate kernel that updates particle positions and ages. As indicated by its name, this step should be attached last in the NiPSSimulator mesh modifier.
Bases: pyffi.formats.nif.NiPSSimulatorStep
Encapsulates a floodgate kernel that simulates particle forces.
The forces affecting the particle system.
The number of forces affecting the particle system.
Bases: pyffi.formats.nif.NiPSSimulatorStep
Encapsulates a floodgate kernel that updates particle size, colors, and rotations.
The particle color keys.
The loop behavior for the color keys.
Specifies the particle generation to which the grow effect should be applied. This is usually generation 0, so that newly created particles will grow.
The the amount of time over which a particle’s size is ramped from 0.0 to 1.0 in seconds
The number of color animation keys.
The number of rotatoin animation keys.
The number of size animation keys.
The particle rotation keys.
The loop behavior for the rotation keys.
Specifies the particle generation to which the shrink effect should be applied. This is usually the highest supported generation for the particle system, so that particles will shrink immediately before getting killed.
The the amount of time over which a particle’s size is ramped from 1.0 to 0.0 in seconds
The particle size keys.
The loop behavior for the size keys.
Bases: pyffi.formats.nif.NiPSSimulatorStep
Encapsulates a floodgate kernel that updates mesh particle alignment and transforms.
The number of rotation keys.
The particle rotation keys.
The loop behavior for the rotation keys.
Bases: pyffi.formats.nif.NiObject
Abstract base class for a single step in the particle system simulation process. It has no seralized data.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiObject
Target node?
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiPSysModifier
Unknown particle modifier.
Link to NiPSysSpawnModifier object?
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for air field air friction.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for air field inherit velocity.
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particle velocity in a field like wind.
Direction of the particle velocity
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for air field spread.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that uses a NiNode to use as a “Bomb Object” to alter the path of particles.
Orientation of bomb object.
Link to a NiNode for bomb to function.
Falloff rate of the bomb object.
Decay type
DeltaV / Strength?
Shape/symmetry of the bomb object.
Bases: pyffi.formats.nif.NiPSysModifier
Unknown particle system modifier.
Unknown.
Bases: pyffi.formats.nif.NiPSysVolumeEmitter
Particle emitter that uses points within a defined Box shape to emit from..
Defines the Depth of the box area.
Defines the Height of the box area.
Defines the Width of the box area.
Bases: pyffi.formats.nif.NiObject
Particle system collider.
Defines amount of bounce the collider object has.
Links to a NiNode that will define where in object space the collider is located/oriented.
Kill particles on impact if set to yes.
The next collider.
Link to parent.
Link to NiPSysSpawnModifier object?
Unknown.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that adds a defined shape to act as a collision object for particles to interact with.
Link to a NiPSysPlanarCollider or NiPSysSphericalCollider.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that adds keyframe data to modify color/alpha values of particles over time.
Refers to NiColorData object.
Bases: pyffi.formats.nif.NiPSysVolumeEmitter
Particle emitter that uses points within a defined Cylinder shape to emit from.
Height of the cylinders shape.
Radius of the cylinder shape.
Bases: pyffi.formats.nif.NiRotatingParticlesData
Particle system data.
Sets aspect ratio for Subtexture Offset UV quads
Boolean for Num Subtexture Offset UVs
Unknown.
How many quads to use in BSPSysSubTexModifier for texture atlasing
Unknown.
Defines UV offsets
Unknown
Unknown.
Unknown
Unknown
Unknown
Unknown.
Unknown.
Unknown
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particle velocity in drag space warp.
Direction of the particle velocity
Whether to use the direction field?
Bases: pyffi.formats.nif.NiPSysModifier
Unknown.
The drag axis.
Parent reference.
Drag percentage.
The range.
The range falloff.
Bases: pyffi.formats.nif.NiPSysModifier
A particle emitter?
Declination / First axis.
Declination randomness / First axis.
Defines color of a birthed particle.
Size of a birthed particle.
Duration until a particle dies.
Adds randomness to Life Span.
Planar Angle / Second axis.
Planar Angle randomness / Second axis .
Particle Radius randomness.
Speed / Inertia of particle movement.
Adds an amount of randomness to Speed.
Bases: pyffi.formats.nif.NiPSysModifierCtlr
Particle system emitter controller.
This controller’s data
Links to a bool interpolator. Controls emitter’s visibility status?
Bases: pyffi.formats.nif.NiObject
Particle system emitter controller data.
Unknown.
Number of keys.
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter planar angle.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter planar angle variation.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for force field attenuation.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for force field magnitude.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for force field maximum distance.
Bases: pyffi.formats.nif.NiPSysModifier
Base for all force field particle modifiers.
Controls how quick the field diminishes
Force Field Object
Magnitude of the force
Maximum distance
Use maximum distance
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particle velocity in gravity field.
Direction of the particle velocity
Bases: pyffi.formats.nif.NiPSysModifier
Adds gravity to a particle system, when linked to a NiNode to use as a Gravity Object.
Falloff range.
Planar or Spherical type
Orientation of gravity.
Refers to a NiNode for gravity location.
The strength of gravity.
Adds a degree of randomness.
Range for turbulence.
Unknown
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Unknown.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that controls the time it takes to grow a particle from Size=0 to the specified Size in the emitter, and then back to 0. This modifer has no control over alpha settings.
Unknown
Unknown.
Time in seconds to fade out.
Unknown.
Time in seconds to fade in.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter initial rotation angle.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter initial rotation angle variation.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter initial rotation speed.
Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr
Particle system controller for emitter initial rotation speed variation.
Bases: pyffi.formats.nif.NiPSysEmitter
Particle emitter that uses points on a specified mesh to emit from.
The emission axis.
The parts of the mesh that the particles emit from.
Links to meshes used for emitting.
The way the particles get their initial direction and speed.
The number of references to emitter meshes that follow.
Bases: pyffi.formats.nif.NiPSysModifier
Unknown.
Group of target NiNodes or NiTriShapes?
The number of object references that follow.
Bases: pyffi.formats.nif.NiObject
Generic particle system modifier object.
Whether the modifier is currently in effect? Usually true.
The object name.
Modifier ID in the particle modifier chain (always a multiple of 1000)?
NiParticleSystem parent of this modifier.
Bases: pyffi.formats.nif.NiPSysModifierBoolCtlr
Unknown.
This controller’s data.
Bases: pyffi.formats.nif.NiPSysModifierCtlr
A particle system modifier controller that deals with boolean data?
Bases: pyffi.formats.nif.NiSingleInterpController
A particle system modifier controller.
Refers to modifier object by its name?
Bases: pyffi.formats.nif.NiPSysModifierCtlr
A particle system modifier controller that deals with floating point data?
This controller’s data.
Bases: pyffi.formats.nif.NiPSysCollider
Particle Collider object which particles will interact with.
Defines the height of the plane.
Defines the width of the plane.
Defines Orientation.
Defines Orientation.
Bases: pyffi.formats.nif.NiPSysModifier
Unknown particle system modifier.
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particlevelocity in force field.
Unknown Enums?
Bases: pyffi.formats.nif.NiTimeController
Unknown.
Bases: pyffi.formats.nif.NiPSysModifier
Particle modifier that adds rotations to particles.
Unknown.
Sets the intial angle for particles to be birthed in.
Adds a random range to Initial angle.
The initial speed of rotation.
Adds a ranged randomness to rotation speed.
Unknown.
Unknown
Bases: pyffi.formats.nif.NiPSysModifier
Unknown particle modifier.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown
Bases: pyffi.formats.nif.NiPSysVolumeEmitter
Particle emitter that uses points within a sphere shape to emit from.
The radius of the sphere shape
Bases: pyffi.formats.nif.NiPSysCollider
Particle Collider object which particles will interact with.
Defines the radius of the sphere object.
Bases: pyffi.formats.nif.NiPSysEmitter
Guild 2-Specific node
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particle velocity in drag space warp.
Frequency of the update.
Bases: pyffi.formats.nif.NiTimeController
Particle system controller, used for ???.
Bases: pyffi.formats.nif.NiPSysEmitter
An emitter that emits meshes?
Node parent of this modifier?
Bases: pyffi.formats.nif.NiPSysFieldModifier
Particle system modifier, used for controlling the particle velocity in force field.
Direction of the particle velocity
Bases: pyffi.formats.nif.NiObject
A color palette.
The number of palette entries. Always = 256.
The color palette.
Unknown, Usually = 0.
Bases: pyffi.formats.nif.NiParticleModifier
A particle modifier.
Unknown.
Unknown.
Unknown.
The direction of the applied acceleration?
Unknown.
The position of the mass point relative to the particle system?
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiParticleModifier
Unknown.
Color data index.
Bases: pyffi.formats.nif.NiParticleModifier
This particle system modifier controls the particle size. If it is present the particles start with size 0.0 . Then they grow to their original size and stay there until they fade to zero size again at the end of their lifetime cycle.
The time from the end of the particle lifetime during which the particle fades.
The time from the beginning of the particle lifetime during which the particle grows.
Bases: pyffi.formats.nif.NiParticleModifier
Unknown.
The number of particle mesh references that follow.
Links to nodes of particle meshes?
Bases: pyffi.formats.nif.NiParticles
Mesh particle node?
Bases: pyffi.formats.nif.NiRotatingParticlesData
Particle meshes data.
Refers to the mesh that makes up a particle?
Bases: pyffi.formats.nif.NiObject
A particle system modifier.
Points to the particle system controller parent.
Next particle modifier.
Bases: pyffi.formats.nif.NiParticleModifier
Unknown.
Unknown.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiParticles
A particle system.
The list of particle modifiers.
The number of modifier references.
Unknown
Unknown
Unknown
If true, Particles are birthed into world space. If false, Particles are birthed into object space.
Bases: pyffi.formats.nif.NiTimeController
A generic particle system time controller object.
Bit 0: Emit Rate toggle bit (0 = auto adjust, 1 = use Emit Rate value)
Particle emission rate (particles per second)
Particle emit start time
Particle emit stop time
This index targets the particle emitter object (TODO: find out what type of object this refers to).
emitter’s horizontal opening angle
horizontal emit direction
Particle lifetime
Particle lifetime random modifier
Size of the following array. (Maximum number of simultaneous active particles)
Number of valid entries in the following array. (Number of active particles at the time the system was saved)
Particle emission rate in old files
Particle speed in old files
Link to some optional particle modifiers (NiGravity, NiParticleGrowFade, NiParticleBomb, ...)
The particle’s age.
Timestamp of the last update.
Unknown short
Unknown
Particle velocity
Particle/vertex index matches array index
Individual particle modifiers?
Particle size
Particle speed
Particle random speed modifier
Particle random start translation vector
Trailing null byte
Unknown byte, (=0)
Unknown.
? float=1.0 ?
? int=1 ?
? int=0 ?
unknown int (=0xffffffff)
Unknown int (=0xffffffff)
Unknown.
? short=0 ?
? short=0 ?
emitter’s vertical opening angle [radians]
vertical emit direction [radians]0.0 : up1.6 : horizontal3.1416 : down
Bases: pyffi.formats.nif.NiGeometry
Generic particle system node.
Bases: pyffi.formats.nif.NiGeometryData
Generic rotating particles data object.
Is the particle size array present?
Are the angles of rotation present?
Are axes of rotation present?
Is the particle rotation array present?
Is the particle size array present?
if value is no, a single image rendered
The number of active particles at the time the system was saved. This is also the number of valid entries in the following arrays.
The maximum number of particles (matches the number of vertices).
2,4,8,16,32,64 are potential values. If “Has” was no then this should be 256, which represents a 16x16 framed image, which is invalid
The particles’size.
The individual particel sizes.
Angles of rotation
Unknown
The individual particle rotations.
The individual particel sizes.
Unknown, probably a boolean.
Unknown
Unknown
Bases: pyffi.formats.nif.NiTimeController
Time controller for a path.
Path controller data index (float data). ?
Path controller data index (position data). ?
Unknown, often 0?
Unknown, often 0?
Unknown, always 1?
Unknown, always 0?
Unknown.
Bases: pyffi.formats.nif.NiKeyBasedInterpolator
Unknown interpolator.
Links to NiFloatData.
Links to NiPosData.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown. Zero.
Bases: pyffi.formats.nif.ATextureRenderData
Unknown
Unknown
Raw pixel data holding the mipmaps. Mipmap zero is the full-size texture and they get smaller by half as the number increases.
Unknown, same as the number of pixels? / number of blocks?
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
PhysX Shape Description
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown node.
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Number of mesh vertices
Unknown
Unknown
NXS
MESH
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Vertices
Bases: pyffi.formats.nif.NiObjectNET
Unknown PhysX node.
Number of NiPhysXTransformDest references
PhysX Property Description.
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Unknown
PhysX Joint Descriptions
PhysX Material Descriptions
Number of NiPhysXActorDesc references
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
PhysX Mesh Description
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Unknown PhysX node.
Affected node?
Unknown. =1?
Unknown. =0
Bases: pyffi.formats.nif.ATextureRenderData
A texture.
Unknown
Total number of pixels
Raw pixel data holding the mipmaps. Mipmap zero is the full-size texture and they get smaller by half as the number increases.
Bases: pyffi.formats.nif.NiParticleModifier
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Usually 0?
Unknown.
Bases: pyffi.formats.nif.NiSingleInterpController
A controller that interpolates point 3 data?
Material color controller data object index. Points to NiPosData.
Selects which color to control.
Bases: pyffi.formats.nif.NiKeyBasedInterpolator
Unknown.
Reference to NiPosData.
Value when posed? Value at time 0?
Bases: pyffi.formats.nif.NiLight
A point light.
Constant Attenuation
Linear Attenuation
Quadratic Attenuation (see glLight)
Bases: pyffi.formats.nif.NiAVObject
A Portal
Number of vertices in this polygon
Target portal or room
Unknown flags.
Unknown
Vertices
Bases: pyffi.formats.nif.NiObject
Position data.
The position keys.
Bases: pyffi.formats.nif.NiObjectNET
A generic property object.
Bases: pyffi.formats.nif.NiLODData
Describes levels of detail based on distance of object from camera.
?
The ranges of distance that each level of detail applies in.
Number of levels of detail.
Bases: pyffi.formats.nif.NiObject
Raw image data.
Image height
The format of the raw image data.
Image pixel data.
Image pixel data.
Image width
Bases: pyffi.formats.nif.NiAVObject
An object that can be rendered.
The index of the currently active material.
Per-material data.
The initial value for the flag that determines if the internal cached shader is valid.
The number of materials affecting this renderable object.
Bases: pyffi.formats.nif.NiSingleInterpController
Unknown.
The data for the controller.
Bases: pyffi.formats.nif.NiNode
Grouping node for nodes in a Portal
Number of portals into room
All geometry associated with room.
Number of doors into room
Number of unknowns
Number of doors out of room
Number of walls in a room?
Number of portals out of room
Face normal and unknown value.
Bases: pyffi.formats.nif.NiNode
Grouping node for nodes in a Portal
Number of rooms in this group
Rooms associated with this group.
Outer Shell Geometry Node?
Bases: pyffi.formats.nif.NiParticles
Unknown.
Bases: pyffi.formats.nif.NiParticlesData
Rotating particles data object.
Is the particle rotation array present?
The individual particle rotations.
Bases: pyffi.formats.nif.NiTriShape
Two dimensional screen elements.
Bases: pyffi.formats.nif.NiTriShapeData
Two dimensional screen elements.
Maximum number of polygons?
Number of Polygons actually in use
Polygon Indices
Polygons
Unknown
Unknown
Maximum number of faces
Number of in-use triangles
Number of in-use vertices
Bases: pyffi.formats.nif.NiLODData
Describes levels of detail based on size of object on screen?
The center of the bounding sphere?
The radius of the bounding sphere?
The number of screen size based LOD levels.
The LOD levels based on proportion of screen size?
The center of the bounding sphere in world space?
The radius of the bounding sphere in world space?
Bases: pyffi.formats.nif.NiObject
Root node used in some Empire Earth II .kf files (version 4.2.2.0).
Refers to controlled objects.
Name of this object. This is also the name of the action associated with this file. For instance, if the original NIF file is called”demon.nif”and this animation file contains an attack sequence, then the file would be called”demon_attack1.kf”and this field would contain the string”attack1”.
Number of controlled objects.
Link to NiTextKeyExtraData.
Name of following referenced NiTextKeyExtraData class.
Unknown.
Unknown
Unknown
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiObjectNET
Keyframe animation root node, in .kf files.
Bases: pyffi.formats.nif.NiProperty
Determines whether flat shading or smooth shading is used on a shape.
1’s Bit: Enable smooth phong shading on this shape.If 1’s bit is not set, hard-edged flat shading will be used on this shape.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif.NiInterpController
A controller referring to a single interpolator.
Link to interpolator.
Bases: pyffi.formats.nif._NiSkinData, builtins.object
Apply scale factor on data.
>>> from pyffi.formats.nif import NifFormat
>>> id44 = NifFormat.Matrix44()
>>> id44.set_identity()
>>> skelroot = NifFormat.NiNode()
>>> skelroot.name = 'Scene Root'
>>> skelroot.set_transform(id44)
>>> bone1 = NifFormat.NiNode()
>>> bone1.name = 'bone1'
>>> bone1.set_transform(id44)
>>> bone1.translation.x = 10
>>> skelroot.add_child(bone1)
>>> geom = NifFormat.NiTriShape()
>>> geom.set_transform(id44)
>>> skelroot.add_child(geom)
>>> skininst = NifFormat.NiSkinInstance()
>>> geom.skin_instance = skininst
>>> skininst.skeleton_root = skelroot
>>> skindata = NifFormat.NiSkinData()
>>> skininst.data = skindata
>>> skindata.set_transform(id44)
>>> geom.add_bone(bone1, {})
>>> geom.update_bind_position()
>>> bone1.translation.x
10.0
>>> skindata.bone_list[0].skin_transform.translation.x
-10.0
>>> import pyffi.spells.nif.fix
>>> import pyffi.spells.nif
>>> data = NifFormat.Data()
>>> data.roots = [skelroot]
>>> toaster = pyffi.spells.nif.NifToaster()
>>> toaster.scale = 0.1
>>> pyffi.spells.nif.fix.SpellScale(data=data, toaster=toaster).recurse()
pyffi.toaster:INFO:--- fix_scale ---
pyffi.toaster:INFO: scaling by factor 0.100000
pyffi.toaster:INFO: ~~~ NiNode [Scene Root] ~~~
pyffi.toaster:INFO: ~~~ NiNode [bone1] ~~~
pyffi.toaster:INFO: ~~~ NiTriShape [] ~~~
pyffi.toaster:INFO: ~~~ NiSkinInstance [] ~~~
pyffi.toaster:INFO: ~~~ NiSkinData [] ~~~
>>> bone1.translation.x
1.0
>>> skindata.bone_list[0].skin_transform.translation.x
-1.0
Return scale, rotation, and translation into a single 4x4 matrix.
Set rotation, transform, and velocity.
Bases: pyffi.formats.nif.NiObject
Skinning instance.
List of all armature bones.
Skinning data reference.
The number of node bones referenced as influences.
Armature root node.
Refers to a NiSkinPartition objects, which partitions the mesh such that every vertex is only influenced by a limited number of bones.
Bases: pyffi.formats.nif.NiObject
Skinning data, optimized for hardware skinning. The mesh is partitioned in submeshes such that each vertex of a submesh is influenced only by a limited and fixed number of bones.
Unknown.
Skin partition objects.
Bases: pyffi.formats.nif.NiTimeController
Bases: pyffi.formats.nif.NiMeshModifier
The bounds of the bones. Only stored if the RECOMPUTE_BOUNDS bit is set.
The transforms that go from bind-pose space to bone space.
Pointers to the bone nodes that affect this skin.
USE_SOFTWARE_SKINNING = 0x0001RECOMPUTE_BOUNDS = 0x0002
The number of bones referenced by this mesh modifier.
The root bone of the skeleton.
The transform that takes the root bone parent coordinate system into the skin coordinate system.
Bases: pyffi.formats.nif.NiNode
Unknown node. Found in Loki.
Sorting
Unknown.
Bases: pyffi.formats.nif.NiSourceTexture
Unknown node. Found in Emerge Demo.
Bases: pyffi.formats.nif.NiTexture
Describes texture source and properties.
Note: the NiTriShape linked to this object must have a NiAlphaProperty in its list of properties to enable material and/or texture transparency.
Load direct to renderer
The original source filename of the image embedded by the referred NiPixelData object.
Is Static?
Render data is persistant
Pixel data object index. NiPixelData or NiPersistentSrcTextureRendererData
Specifies the way the image will be stored.
Unknown. Seems to be set if Pixel Data is present?
Unknown.
Is the texture external?
Specifies whether mip maps are used.
Bases: pyffi.formats.nif.NiProperty
Gives specularity to a shape. Flags 0x0001.
1’s Bit = Enable specular lighting on this shape.
Bases: pyffi.formats.nif.NiParticleModifier
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Bases: pyffi.formats.nif.NiPointLight
A spot.
The opening angle of the spot.
Describes the distribution of light. (see: glLight)
Unknown
Bases: pyffi.formats.nif.NiProperty
Allows control of stencil testing.
Used to enabled double sided faces. Default is 3 (DRAW_BOTH).
Property flags:Bit 0: Stencil EnableBits 1-3: Fail ActionBits 4-6: Z Fail ActionBits 7-9: Pass ActionBits 10-11: Draw ModeBits 12-14: Stencil Function
Enables or disables the stencil test.
Selects the compare mode function (see: glStencilFunc).
A bit mask. The default is 0xffffffff.
Unknown. Default is 0.
Bases: pyffi.formats.nif.NiExtraData
Apparently commands for an optimizer instructing it to keep things it would normally discard.Also refers to NiNode objects (through their name) in animation .kf files.
The number of bytes left in the record. Equals the length of the following string + 4.
The string.
Bases: pyffi.formats.nif.NiObject
List of 0x00-seperated strings, which are names of controlled objects and controller types. Used in .kf files in conjunction with NiControllerSequence.
A bunch of 0x00 seperated strings.
Bases: pyffi.formats.nif.NiExtraData
List of strings; for example, a list of all bone names.
The strings.
Number of strings.
Bases: pyffi.formats.nif.NiNode
A node used to switch between branches, such as for LOD levels?
Flags
Index?
Bases: pyffi.formats.nif.NiExtraData
Extra data, used to name different animation sequences.
The number of text keys that follow.
List of textual notes and at which time they take effect. Used for designating the start and stop of animations and the triggering of sounds.
Unknown. Always equals zero in all official files.
Bases: pyffi.formats.nif.NiObjectNET
A texture.
Bases: pyffi.formats.nif.NiDynamicEffect
Enables environment mapping. Should be in both the children list and effects list of the NiTriShape object. For Morrowind: the bump map can be used to bump the environment map (note that the bump map is ignored if no NiTextureEffect object is present).
Determines whether a clipping plane is used. 0 means that a plane is not used.
The method that will be used to generate UV coordinates for the texture effect.
Image index.
Model projection matrix. Always identity?
Model projection transform. Always (0,0,0)?
-75?
0?
Source texture index.
Texture Clamp mode.
Texture Filtering mode.
The type of effect that the texture is used for.
Unknown. 0?
Unknown: 0.
Unknown: (1,0,0)?
Bases: pyffi.formats.nif.NiProperty
Unknown
-75?
0?
Unknown. Either 210 or 194.
Bases: pyffi.formats.nif.NiProperty
Property flags.
Link to the texture image.
Property flags.
Unknown. 0?
Bases: pyffi.formats.nif.NiFloatInterpController
Texture transformation controller. The target texture slot should have “Has Texture Transform” enabled.
Link to NiFloatData.
Determines how this controller animates the UV Coordinates.
The target texture slot.
Unknown.
Bases: pyffi.formats.nif.NiProperty
Describes an object’s textures.
Determines how the texture will be applied. Seems to have special functions in Oblivion.
The base texture.
Unknown.
Unknown.
Unknown.
The bump map texture.
The dark texture.
The decal texture.
Another decal texture.
Another decal texture.
Another decal texture. Who knows the limit.
The detail texture.
Property flags.
The gloss texture.
The glowing texture.
Do we have a base texture?
Do we have a bump map texture?
Do we have a dark texture?
Do we have a decal 0 texture?
Do we have a decal 1 texture?
Do we have a decal 2 texture?
Do we have a decal 3 texture?
Do we have a detail texture?
Do we have a gloss texture?
Do we have a glow texture?
Do we have a normal texture? (Noraml guess based on file suffix in sample files)
Do we have a unknown texture 2?
Normal texture.
Number of Shader textures that follow.
Shader textures.
Number of textures. Always 7 in versions<20.0.0.4. Can also be 8 in>= 20.0.0.4.
Unknown.
Unknown texture 2.
Bases: pyffi.formats.nif.NiObject
A generic time controller object.
Controller flags (usually 0x000C). Probably controls loops.Bit 0 : Anim type, 0=APP_TIME 1=APP_INITBit 1-2 : Cycle type 00=Loop 01=Reverse 10=LoopBit 3 : ActiveBit 4 : Play backwards
Frequency (is usually 1.0).
Index of the next controller.
Phase (usually 0.0).
Controller start time.
Controller stop time.
Controller target (object index of the first controllable ancestor of this object).
Unknown integer.
Bases: pyffi.formats.nif.NiKeyframeController
NiTransformController replaces the NiKeyframeController.
Bases: pyffi.formats.nif.NiKeyframeData
Mesh animation keyframe data.
Bases: pyffi.formats.nif.NiObject
Bases: pyffi.formats.nif._NiTransformInterpolator, builtins.object
Apply scale factor <scale> on data.
Bases: pyffi.formats.nif.NiProperty
Unknown
Unknown.
Bases: pyffi.formats.nif._NiTriBasedGeom, builtins.object
Returns a NiTriShape block that is geometrically interchangeable. If you do not want to set the triangles from the original shape, use the triangles argument.
Returns a NiTriStrips block that is geometrically interchangeable. If you do not want to set the strips from the original shape, use the strips argument.
Return iterator over normal, tangent, bitangent vectors. If the block has no tangent space, then returns None.
Update centers and radii of all skin data fields.
Recalculate skin partition data.
Deprecated : | Do not use the verbose argument. |
---|---|
Parameters: |
|
Recalculate tangent space data.
Parameters: | as_extra – Whether to store the tangent space data as extra data (as in Oblivion) or not (as in Fallout 3). If not set, switches to Oblivion if an extra data block is found, otherwise does default. Set it to override this detection (for example when using this function to create tangent space data) and force behaviour. |
---|
Bases: pyffi.formats.nif._NiTriBasedGeomData, builtins.object
Yield list of triangle indices (relative to self.get_triangles()) of given triangles. Degenerate triangles in the list are assigned index None.
>>> from pyffi.formats.nif import NifFormat
>>> geomdata = NifFormat.NiTriShapeData()
>>> geomdata.set_triangles([(0,1,2),(1,2,3),(2,3,4)])
>>> list(geomdata.get_triangle_indices([(1,2,3)]))
[1]
>>> list(geomdata.get_triangle_indices([(3,1,2)]))
[1]
>>> list(geomdata.get_triangle_indices([(2,3,1)]))
[1]
>>> list(geomdata.get_triangle_indices([(1,2,0),(4,2,3)]))
[0, 2]
>>> list(geomdata.get_triangle_indices([(0,0,0),(4,2,3)]))
[None, 2]
>>> list(geomdata.get_triangle_indices([(0,3,4),(4,2,3)]))
Traceback (most recent call last):
...
ValueError: ...
Parameters: | triangles (iterator or list of tuples of three ints) – An iterable of triangles to check. |
---|
Heuristically checks if two NiTriBasedGeomData blocks describe the same geometry, that is, if they can be used interchangeably in a nif file without affecting the rendering. The check is not fool proof but has shown to work in most practical cases.
Parameters: | other (L{NifFormat.NiTriBasedGeomData} (if it has another type then the function will always return False)) – Another geometry data block. |
---|---|
Returns: | True if the geometries are equivalent, False otherwise. |
Bases: pyffi.formats.nif.NiTriBasedGeom
A shape node that refers to singular triangle data.
Bases: pyffi.formats.nif._NiTriShapeData, builtins.object
Example usage:
>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiTriShapeData()
>>> block.set_triangles([(0,1,2),(2,1,3),(2,3,4)])
>>> block.get_strips()
[[0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 1, 2), (2, 1, 3), (2, 3, 4)]
>>> block.set_strips([[1,0,1,2,3,4]])
>>> block.get_strips() # stripifier keeps geometry but nothing else
[[0, 2, 1, 3], [2, 4, 3]]
>>> block.get_triangles()
[(0, 2, 1), (1, 2, 3), (2, 4, 3)]
Bases: pyffi.formats.nif.NiTimeController
Old version of skinning instance.
Contains skin weight data for each node that this skin is influenced by.
List of all armature bones.
The number of node bones referenced as influences.
The number of vertex weights stored for each bone.
Bases: pyffi.formats.nif.NiTriBasedGeom
A shape node that refers to data organized into strips of triangles
Bases: pyffi.formats.nif._NiTriStripsData, builtins.object
Example usage:
>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiTriStripsData()
>>> block.set_triangles([(0,1,2),(2,1,3),(2,3,4)])
>>> block.get_strips()
[[0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 1, 2), (1, 3, 2), (2, 3, 4)]
>>> block.set_strips([[1,0,1,2,3,4]])
>>> block.get_strips()
[[1, 0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 2, 1), (1, 2, 3), (2, 4, 3)]
Bases: pyffi.formats.nif.NiTimeController
Time controller for texture coordinates.
Texture coordinate controller data index.
Always 0?
Bases: pyffi.formats.nif.NiObject
Texture coordinate data.
Four UV data groups. Appear to be U translation, V translation, U scaling/tiling, V scaling/tiling.
Bases: pyffi.formats.nif.NiExtraData
Extra vector data.
Not sure whether this comes before or after the vector data.
The vector data.
Bases: pyffi.formats.nif.NiExtraData
Not used in skinning.Unsure of use - perhaps for morphing animation or gravity.
Number of bytes in this data object.
Number of vertices.
The vertex weights.
Bases: pyffi.formats.nif.NiProperty
Property of vertex colors. This object is referred to by the root object of the NIF file whenever some NiTriShapeData object has vertex colors with non-default settings; if not present, vertex colors have vertex_mode=2 and lighting_mode=1.
Property flags. Appears to be unused until 20.1.0.3.Bits 0-2: UnknownBit 3: Lighting Mode?Bits 4-5: Vertex Mode?
The light mode. In Flags from 20.1.0.3 on.
Determines how vertex and material colors are mixed.related gl function: glColorMaterialIn Flags from version 20.1.0.3 onwards.
Bases: pyffi.formats.nif.NiBoolInterpController
Time controller for visibility.
Visibility controller data object index.
Bases: pyffi.formats.nif.NiObject
Visibility data for a controller.
The visibility keys.
The number of visibility keys that follow.
Bases: pyffi.formats.nif.NiProperty
Unknown.
Property flags.0 - Wireframe Mode Disabled1 - Wireframe Mode Enabled
Bases: pyffi.formats.nif.NiProperty
This Property controls the Z buffer (OpenGL: depth buffer).
Bit 0 enables the z testBit 1 controls wether the Z buffer is read only (0) or read/write (1)
Z-Test function (see: glDepthFunc). In Flags from 20.1.0.3 on.
Bases: builtins.Exception
Standard nif exception class.
Bases: pyffi.object_models.xml.struct_.StructBase
A group of NiNodes references.
The list of NiNode references.
Number of node references that follow.
Bases: pyffi.object_models.xml.struct_.StructBase
Oblivion’s ColFilter property for Havok.
The first bit sets the LINK property and controls whether this body is physically linked to others. The next bit turns collision off. Then, the next bit sets the SCALED property in Oblivion. The next five bits make up the number of this part in a linked body list.
Sets mesh color in Oblivion Construction Set.
Unknown.
Bases: pyffi.object_models.xml.enum.EnumBase
Sets mesh color in Oblivion Construction Set. Anything higher than 57 is also null.
Bases: pyffi.object_models.xml.struct_.StructBase
Havok Information for packed TriStrip shapes.
The first bit sets the LINK property and controls whether this body is physically linked to others. The next bit turns collision off. Then, the next bit sets the SCALED property in Oblivion. The next five bits make up the number of this part in a linked body list.
Sets mesh color in Oblivion Construction Set.
The material of the subshape.
The number of vertices that form this sub shape.
Unknown. Perhaps the vertex wielding type?
Bases: pyffi.object_models.xml.struct_.StructBase
Used to store skin weights in NiTriShapeSkinController.
Unknown. Perhaps some sort of offset?
The index of the vertex that this weight applies to.
The amount that this bone affects the vertex.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
particle array entry
Maximum age of the particle.
The particle’s age.
Timestamp of the last update.
Unknown short
Unknown
Particle velocity
Particle/vertex index matches array index
Bases: pyffi.object_models.xml.struct_.StructBase
Particle Description.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Unknown.
Bases: pyffi.object_models.xml.enum.EnumBase
Specifies the pixel format used by the NiPixelData object to store a texture.
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, describing the color depth of a texture.
Bases: pyffi.object_models.xml.struct_.StructBase
Two dimensional screen elements.
Number of faces in this polygon
Number of vertices in this polygon
Triangle offset in shape
Vertex Offset
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.formats.nif.Ref
A weak reference to another block, used to point up the hierarchy tree. The reference is not returned by the L{get_refs} function to avoid infinite recursion.
Bases: pyffi.object_models.xml.struct_.StructBase
Rotation.
Scale.
Translation.
Bases: pyffi.object_models.xml.struct_.StructBase
A special version of the key type used for quaternions. Never has tangents.
The TBC of the key.
Time the key applies.
Value of the key.
Bases: pyffi.object_models.xml.struct_.StructBase
A quaternion.
The w-coordinate.
The x-coordinate.
The y-coordinate.
The z-coordinate.
Bases: pyffi.object_models.xml.struct_.StructBase
A quaternion as it appears in the havok objects.
The w-coordinate.
The x-coordinate.
The y-coordinate.
The z-coordinate.
Bases: pyffi.formats.nif._RagdollDescriptor, builtins.object
Update B pivot and axes from A using the given transform.
Bases: pyffi.object_models.xml.basic.BasicBase
Reference to another block.
Fix block links.
>>> from pyffi.formats.nif import NifFormat
>>> x = NifFormat.NiNode()
>>> y = NifFormat.NiNode()
>>> z = NifFormat.NiNode()
>>> x.add_child(y)
>>> x.children[0] is y
True
>>> x.children[0] is z
False
>>> x.replace_global_node(y, z)
>>> x.children[0] is y
False
>>> x.children[0] is z
True
>>> x.replace_global_node(z, None)
>>> x.children[0] is None
True
Write block reference.
Bases: pyffi.object_models.xml.struct_.StructBase
A range of indices, which make up a region (such as a submesh).
Bases: pyffi.formats.nif.NiNode
Morrowind-specific node for collision mesh.
Bases: pyffi.object_models.xml.struct_.StructBase
An extra index of the data. For example, if there are 3 uv maps,then the corresponding TEXCOORD data components would have indices0, 1, and 2, respectively.
Type of data (POSITION, POSITION_BP, INDEX, NORMAL, NORMAL_BP,TEXCOORD, BLENDINDICES, BLENDWEIGHT, BONE_PALETTE, COLOR, DISPLAYLIST,MORPH_POSITION, BINORMAL_BP, TANGENT_BP).
Bases: pyffi.object_models.xml.struct_.StructBase
An extended texture description for shader textures.
Is it used?
Map Index
The texture data.
Bases: pyffi.object_models.xml.basic.BasicBase
Another type for strings.
Bases: pyffi.object_models.xml.basic.BasicBase, pyffi.object_models.editable.EditableLineEdit
Basic type for strings. The type starts with an unsigned int which describes the length of the string.
>>> from tempfile import TemporaryFile
>>> f = TemporaryFile()
>>> from pyffi.object_models import FileFormat
>>> data = FileFormat.Data()
>>> s = SizedString()
>>> if f.write('\x07\x00\x00\x00abcdefg'.encode("ascii")): pass # ignore result for py3k
>>> if f.seek(0): pass # ignore result for py3k
>>> s.read(f, data)
>>> str(s)
'abcdefg'
>>> if f.seek(0): pass # ignore result for py3k
>>> s.set_value('Hi There')
>>> s.write(f, data)
>>> if f.seek(0): pass # ignore result for py3k
>>> m = SizedString()
>>> m.read(f, data)
>>> str(m)
'Hi There'
Return a hash value for this string.
Returns: | An immutable object that can be used as a hash. |
---|
Return number of bytes this type occupies in a file.
Returns: | Number of bytes. |
---|
Return the string.
Returns: | The stored string. |
---|
Read string from stream.
Parameters: | stream (file) – The stream to read from. |
---|
Set string to C{value}.
Parameters: | value (str) – The value to assign. |
---|
Write string to stream.
Parameters: | stream (file) – The stream to write to. |
---|
Bases: pyffi.formats.nif._SkinData, builtins.object
Return scale, rotation, and translation into a single 4x4 matrix.
Set rotation, transform, and velocity.
Bases: pyffi.formats.nif._SkinPartition, builtins.object
Get list of triangles of this partition (mapping into the geometry data vertex list).
Get list of triangles of this partition.
Bases: pyffi.object_models.xml.struct_.StructBase
Bases: pyffi.object_models.xml.struct_.StructBase
Reference to shape and skin instance.
The shape.
Skinning instance for the shape?
Bases: pyffi.object_models.xml.struct_.StructBase
Unknown.
First link is a NiTriShape object.Second link is a NiSkinInstance object.
Counts unknown.
Bases: pyffi.formats.nif._SkinTransform, builtins.object
Return scale, rotation, and translation into a single 4x4 matrix.
Set rotation, transform, and velocity.
Bases: pyffi.object_models.xml.struct_.StructBase
A weighted vertex.
The vertex index, in the mesh.
The vertex weight - between 0.0 and 1.0
Bases: pyffi.object_models.xml.enum.EnumBase
Skyrim, sets what sky function this object fulfills in BSSkyShaderProperty.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node? Found in Fallout3
The texture.
Unknown
Unknown
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.object_models.xml.bit_struct.BitStructBase
Bases: pyffi.object_models.xml.enum.EnumBase
A list of possible solver deactivation settings. This value defines how thesolver deactivates objects. The solver works on a per object basis.Note: Solver deactivation does not save CPU, but reduces creeping ofmovable objects in a pile quite dramatically.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
A sphere.
The sphere’s center.
The sphere’s radius.
Bases: pyffi.object_models.xml.enum.EnumBase
This enum defines the various actions used in conjunction with the stencil buffer.For a detailed description of the individual options please refer to the OpenGL docs.
Bases: pyffi.object_models.xml.enum.EnumBase
This enum contains the options for doing stencil buffer tests.
alias of UInt
Bases: pyffi.object_models.common.Int
This is just an integer with -1 as default value.
Bases: pyffi.formats.nif._StringPalette, builtins.object
Adds string to palette (will recycle existing strings if possible) and return offset to the string in the palette.
>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> pal.add_string("")
-1
>>> print(pal.get_string(4).decode("ascii"))
def
Clear all strings in the palette.
>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
'abc\x00def\x00'
>>> pal.clear()
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
''
Return a list of all strings.
>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> for x in pal.get_all_strings():
... print(x.decode("ascii"))
abc
def
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
'abc\x00def\x00'
Return string at given offset.
>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> print(pal.get_string(0).decode("ascii"))
abc
>>> print(pal.get_string(4).decode("ascii"))
def
>>> pal.get_string(5)
pyffi.nif.stringpalette:WARNING:StringPalette: no string starts at offset 5 (string is b'ef', preceeding character is b'd')
b'ef'
>>> pal.get_string(100)
Traceback (most recent call last):
...
ValueError: ...
Bases: pyffi.object_models.xml.enum.EnumBase
Determines symetry type used by NiPSysBombModifier.
Bases: pyffi.object_models.xml.enum.EnumBase
Specifies the time when an application must syncronize for some reason.
Bases: pyffi.object_models.xml.struct_.StructBase
Tension, bias, continuity.
Bias.
Continuity.
Tension.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node.
Texture file name
Bases: pyffi.object_models.xml.enum.EnumBase
Used by NiPoint3InterpControllers to select which type of color in the controlled object that will be animated.
Bases: pyffi.object_models.xml.enum.EnumBase
Specifies the availiable texture clamp modes. That is, the behavior of pixels outside the range of the texture.
Bases: pyffi.formats.nif._TexCoord, builtins.object
Bases: pyffi.object_models.xml.struct_.StructBase
Texture description.
The offset from the origin?
0=clamp S clamp T, 1=clamp S wrap T, 2=wrap S clamp T, 3=wrap S wrap T
0=nearest, 1=bilinear, 2=trilinear, 3=..., 4=..., 5=...
Texture mode flags; clamp and filter mode stored in upper byte with 0xYZ00 = clamp mode Y, filter mode Z.
Determines whether or not the texture’s coordinates are transformed.
PS2 only; from the Freedom Force docs,”The K value is used as an offset into the mipmap levels and can range from -2047 to 2047. Positive values push the mipmap towards being blurry and negative values make the mipmap sharper.”-75 for most v4.0.0.2 meshes.
PS2 only; from the Freedom Force docs,”L values can range from 0 to 3 and are used to specify how fast a texture gets blurry”.
NiSourceTexture object index.
The number of times the texture is tiled in each direction?
The texture transform type? Doesn’t seem to do anything.
The amount to translate the texture coordinates in each direction?
Unknown, 0 or 0x0101?
Unknown, seems to always be 1
The texture coordinate set in NiGeometryData that this texture slot will use.
2D Rotation of texture image around third W axis after U and V.
Bases: pyffi.object_models.xml.enum.EnumBase
Specifies the availiable texture filter modes. That is, the way pixels within a texture are blended together when textures are displayed on the screen at a size other than their original dimentions.
Bases: pyffi.object_models.xml.struct_.StructBase
A texture source.
The original source filename of the image embedded by the referred NiPixelData object.
Pixel data object index.
Unknown.
Unknown.
Is the texture external?
Bases: pyffi.object_models.xml.enum.EnumBase
Determines how a NiTextureTransformController animates the UV coordinates.
Bases: pyffi.object_models.xml.enum.EnumBase
The type of texture.
Bases: pyffi.formats.nif.BSShaderLightingProperty
Bethesda-specific node.
Texture file name
Bases: pyffi.object_models.xml.struct_.StructBase
List of three vertex indices.
First vertex index.
Second vertex index.
Third vertex index.
Bases: pyffi.object_models.xml.struct_.StructBase
Bounding Volume.
Number of Bounding Volumes.
Bases: pyffi.formats.nif._Vector3, builtins.object
Bases: pyffi.formats.nif._Vector4, builtins.object
>>> from pyffi.formats.nif import NifFormat
>>> vec = NifFormat.Vector4()
>>> vec.x = 1.0
>>> vec.y = 2.0
>>> vec.z = 3.0
>>> vec.w = 4.0
>>> print(vec)
[ 1.000 2.000 3.000 4.000 ]
>>> vec.as_list()
[1.0, 2.0, 3.0, 4.0]
>>> vec.as_tuple()
(1.0, 2.0, 3.0, 4.0)
>>> print(vec.get_vector_3())
[ 1.000 2.000 3.000 ]
>>> vec2 = NifFormat.Vector4()
>>> vec == vec2
False
>>> vec2.x = 1.0
>>> vec2.y = 2.0
>>> vec2.z = 3.0
>>> vec2.w = 4.0
>>> vec == vec2
True
Bases: pyffi.object_models.xml.enum.EnumBase
Controls the way the a particle mesh emitter determines the starting speed and direction of the particles that are emitted.
Bases: pyffi.object_models.xml.enum.EnumBase
An unsigned 32-bit integer, which describes how to apply vertex colors.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node.
Bases: pyffi.formats.nif.BSShaderProperty
Bethesda-specific node? Found in Fallout3
Bases: pyffi.object_models.xml.enum.EnumBase
This enum contains the options for doing z buffer tests.
Bases: pyffi.formats.nif.bhkShapePhantom
Bethesda-specific node.
Bases: pyffi.formats.nif.bhkConstraint
A Ball and Socket Constraint.
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.bhkSerializable
A Ball and Socket Constraint chain.
Unknown
Unknown
Unknown
Unknown
Number of links in the chain
Number of links in the chain
Unknown
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.bhkCollisionObject
Unknown.
Blending parameter?
Another blending parameter?
Bases: pyffi.formats.nif.NiTimeController
Unknown. Is apparently only used in skeleton.nif files.
Seems to be always zero.
Bases: pyffi.formats.nif._bhkBoxShape, builtins.object
Apply scale factor C{scale} on data.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkConstraint
Bethesda-Specific node.
The entities affected by this constraint.
Number of bodies affected by this constraint.
Unknown
Usually 1. Higher values indicate higher priority of this constraint?
Unknown
Unknown
Unknown
Unknown
A count or flag?
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.bhkShape
A tree-like Havok data structure stored in an assembly-like binary code?
Bases: pyffi.object_models.xml.struct_.StructBase
Triangle indices used in pair with “Big Verts” in a bhkCompressedMeshShapeData.
Always 0?
Bases: pyffi.object_models.xml.struct_.StructBase
Defines subshape chunks in bhkCompressedMeshShapeData
Compressed
Index of material in bhkCompressedMeshShapeData::Chunk Materials
Number of
Number of compressed strips
Number of compressed vertices
Compressed strips
Index of transformation in bhkCompressedMeshShapeData::Chunk Transforms
Local translation
Always 65535?
Compressed vertices
Bases: pyffi.object_models.xml.struct_.StructBase
per-chunk material, used in bhkCompressedMeshShapeData
Material.
Always 1?
Bases: pyffi.object_models.xml.struct_.StructBase
A set of transformation data: translation and rotation
Rotation. Reference point for rotation is bhkRigidBody translation.
A vector that moves the chunk by the specified amount. W is not used.
Bases: pyffi.formats.nif._bhkCapsuleShape, builtins.object
Apply scale factor <scale> on data.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkNiCollisionObject
Havok related collision object?
Bases: pyffi.formats.nif.bhkShape
Compressed collision mesh.
The collision mesh data.
A shell with that radius is added around the shape.
Scale
The shape’s material.
Points to root node?
Unknown.
Unknown.
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.bhkRefObject
A compressed mesh shape for collision in Skyrim.
Unknown
Compressed Vertices?
Number of bits in the shape-key reserved for a triangle index
Number of bits in the shape-key reserved for a triangle index and its winding
The maximum boundary of the AABB (the coordinates of the corner with the highest numerical values)
The minimum boundary of the AABB (the coordinates of the corner with the lowest numerical values)
Table (array) with sets of materials. Chunks refers to this table by index.
Table (array) with sets of transformations. Chunks refers to this table by index.
The radius of the storage mesh shape? Quantization error?
Mask used to get the triangle index from a shape-key (common: 131071 = 0x1ffff)
Mask used to get the triangle index and winding from a shape-key (common: 262143 = 0x3ffff)
Unknown
Unknown
Unknown
Number of chunk materials
Number of chunk transformations
Unknown
Unknown
Unknown, end of block.
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif._bhkConstraint, builtins.object
Returns the transform of the first entity relative to the second entity. Root is simply a nif block that is a common parent to both blocks.
Bases: pyffi.formats.nif.bhkShape
A havok shape.A list of convex shapes.Do not put a bhkPackedNiTriStripsShape in the Sub Shapes. Use aseparate collision nodes without a list shape for those.Also, shapes collected in a bhkListShape may not have the correctwalking noise, so only use it for non-walkable objects.
The shape’s material.
The number of sub shapes referenced.
The shape’s material.
List of shapes.
Unknown Flag
Unknown Flag
Unknown. Set to (0.0,0.0,-0.0,0.0,0.0,-0.0), where -0.0 is 0x80000000 in hex.
Bases: pyffi.formats.nif.bhkSphereRepShape
A havok shape.
Bases: pyffi.formats.nif.bhkTransformShape
A convex transformed shape?
Bases: pyffi.formats.nif._bhkConvexVerticesShape, builtins.object
Apply scale factor on data.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkWorldObject
A havok node, describes physical properties.
Bases: pyffi.formats.nif.bhkConstraint
A hinge constraint.
Hinge constraing.
Bases: pyffi.formats.nif._bhkLimitedHingeConstraint, builtins.object
Scale data.
Update the B data from the A data. The parent argument is simply a common parent to the entities.
Bases: pyffi.formats.nif.bhkSerializable
Bethesda-specific node.
Unknown Flag
Unknown Flag
Unknown Flag
Unknown Flag
Unknown Flag
Unknown Flag
Unknown Flag
Bases: pyffi.formats.nif._bhkListShape, builtins.object
Add shape to list.
Return center of gravity and area.
Remove a shape from the shape list.
Bases: pyffi.formats.nif._bhkMalleableConstraint, builtins.object
Scale data.
Update the B data from the A data.
Bases: pyffi.formats.nif.bhkShape
The number of strips data objects referenced.
Refers to a bunch of NiTriStripsData objects that make up this shape.
Bases: pyffi.formats.nif._bhkMoppBvTreeShape, builtins.object
Return mass, center of gravity, and inertia tensor.
The mopp data is printed to the debug channel while parsed. Returns list of indices into mopp data of the bytes processed and a list of triangle indices encountered.
The verbose argument is ignored (and is deprecated).
Direction 0=X, 1=Y, 2=Z
Update the MOPP data, scale, and origin, and welding info.
@deprecated: use update_mopp_welding instead
Update the MOPP data, scale, and origin, and welding info.
Update scale and origin.
Bases: pyffi.formats.nif._bhkMultiSphereShape, builtins.object
Return center of gravity and area.
Bases: pyffi.formats.nif.NiCollisionObject
Havok related collision object?
Links to the collision object data
Set to 1 for most objects, and to 41 for animated objects (OL_ANIM_STATIC). Bits: 0=Active 2=Notify 3=Set Local 6=Reset.
Bases: pyffi.formats.nif._bhkNiTriStripsShape, builtins.object
Returns a bhkPackedNiTriStripsShape block that is geometrically interchangeable.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkSerializable
Bethesda-Specific node.
Bases: pyffi.formats.nif.bhkNiCollisionObject
Unknown.
Bases: pyffi.formats.nif._bhkPackedNiTriStripsShape, builtins.object
Pack the given geometry.
Return mass, center, and inertia tensor.
Return sub shapes (works for both Oblivion and Fallout 3).
Generator which produces a tuple of integers, or None in degenerate case, for each triangle to ease detection of duplicate triangles.
>>> shape = NifFormat.bhkPackedNiTriStripsShape()
>>> data = NifFormat.hkPackedNiTriStripsData()
>>> shape.data = data
>>> data.num_triangles = 6
>>> data.triangles.update_size()
>>> data.triangles[0].triangle.v_1 = 0
>>> data.triangles[0].triangle.v_2 = 1
>>> data.triangles[0].triangle.v_3 = 2
>>> data.triangles[1].triangle.v_1 = 2
>>> data.triangles[1].triangle.v_2 = 1
>>> data.triangles[1].triangle.v_3 = 3
>>> data.triangles[2].triangle.v_1 = 3
>>> data.triangles[2].triangle.v_2 = 2
>>> data.triangles[2].triangle.v_3 = 1
>>> data.triangles[3].triangle.v_1 = 3
>>> data.triangles[3].triangle.v_2 = 1
>>> data.triangles[3].triangle.v_3 = 2
>>> data.triangles[4].triangle.v_1 = 0
>>> data.triangles[4].triangle.v_2 = 0
>>> data.triangles[4].triangle.v_3 = 3
>>> data.triangles[5].triangle.v_1 = 1
>>> data.triangles[5].triangle.v_2 = 3
>>> data.triangles[5].triangle.v_3 = 4
>>> list(shape.get_triangle_hash_generator())
[(0, 1, 2), (1, 3, 2), (1, 3, 2), (1, 2, 3), None, (1, 3, 4)]
Returns: | A generator yielding a hash value for each triangle. |
---|
Generator which produces a tuple of integers for each vertex to ease detection of duplicate/close enough to remove vertices. The precision parameter denote number of significant digits behind the comma.
For vertexprecision, 3 seems usually enough (maybe we’ll have to increase this at some point).
>>> shape = NifFormat.bhkPackedNiTriStripsShape()
>>> data = NifFormat.hkPackedNiTriStripsData()
>>> shape.data = data
>>> shape.num_sub_shapes = 2
>>> shape.sub_shapes.update_size()
>>> data.num_vertices = 3
>>> shape.sub_shapes[0].num_vertices = 2
>>> shape.sub_shapes[1].num_vertices = 1
>>> data.vertices.update_size()
>>> data.vertices[0].x = 0.0
>>> data.vertices[0].y = 0.1
>>> data.vertices[0].z = 0.2
>>> data.vertices[1].x = 1.0
>>> data.vertices[1].y = 1.1
>>> data.vertices[1].z = 1.2
>>> data.vertices[2].x = 2.0
>>> data.vertices[2].y = 2.1
>>> data.vertices[2].z = 2.2
>>> list(shape.get_vertex_hash_generator())
[(0, (0, 100, 200)), (0, (1000, 1100, 1200)), (1, (2000, 2100, 2200))]
>>> list(shape.get_vertex_hash_generator(subshape_index=0))
[(0, 100, 200), (1000, 1100, 1200)]
>>> list(shape.get_vertex_hash_generator(subshape_index=1))
[(2000, 2100, 2200)]
Parameters: | vertexprecision (float) – Precision to be used for vertices. |
---|---|
Returns: | A generator yielding a hash value for each vertex. |
Bases: pyffi.formats.nif.bhkWorldObject
Havok object that do not react with other objects when they collide (causing deflection, etc.) but still trigger collision notifications to the game. Possible uses are traps, portals, AI fields, etc.
Bases: pyffi.formats.nif.bhkConstraint
A prismatic constraint.
Friction.
Describe the max distance the object is able to travel.
Describe the min distance the object is able to travel.
Pivot.
Pivot in B coordinates.
Plane normal. Describes the plane the object is able to move on.
Plane normal. Describes the plane the object is able to move on in B coordinates.
Rotation axis.
Rotation axis.
4x4 rotation matrix, rotates the child entity.
Describes the axis the object is able to travel along. Unit vector.
Describes the axis the object is able to travel along in B coordinates. Unit vector.
Unknown. Do not set this to anything over 0 as it will crash the game.
Bases: pyffi.formats.nif._bhkRagdollConstraint, builtins.object
Scale data.
Update the B data from the A data.
Bases: pyffi.formats.nif._bhkRefObject, builtins.object
Return mass, center of gravity, and inertia tensor of this object’s shape, if self.shape is not None.
If self.shape is None, then returns zeros for everything.
Bases: pyffi.formats.nif._bhkRigidBody, builtins.object
Apply scale factor <scale> on data.
Look at all the objects under this rigid body and update the mass, center of gravity, and inertia tensor accordingly. If the C{mass} parameter is given then the C{density} argument is ignored.
Bases: pyffi.formats.nif.bhkRigidBody
Unknown.
Bases: pyffi.formats.nif.bhkPCollisionObject
Unknown.
Bases: pyffi.formats.nif.bhkRefObject
Havok objects that can be saved and loaded from disk?
Bases: pyffi.formats.nif.bhkSerializable
A Havok Shape?
Bases: pyffi.formats.nif.bhkShape
Havok collision object that uses multiple shapes?
Bases: pyffi.formats.nif.bhkPhantom
A Havok phantom that uses a Havok shape object for its collision volume instead of just a bounding box.
Bases: pyffi.formats.nif.bhkShapePhantom
Unknown shape.
Unknown.
Unknown. (1,0,0,0,0) x 3.
Unknown.
Bases: pyffi.formats.nif.bhkShape
A havok shape, perhaps with a bounding sphere for quick rejection in addition to more detailed shape data?
The shape’s material.
The radius of the sphere that encloses the shape.
The shape’s material.
Bases: pyffi.formats.nif._bhkSphereShape, builtins.object
Apply scale factor <scale> on data.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkConstraint
A spring constraint.
Length.
Pivot A.
Pivot B.
Bases: pyffi.formats.nif._bhkTransformShape, builtins.object
Apply scale factor <scale> on data.
Return mass, center, and inertia tensor.
Bases: pyffi.formats.nif.bhkSerializable
Havok objects that have a position in the world?
The first bit sets the LINK property and controls whether this body is physically linked to others. The next bit turns collision off. Then, the next bit sets the SCALED property in Oblivion. The next five bits make up the number of this part in a linked body list.
Sets mesh color in Oblivion Construction Set.
Link to the body for this collision object.
Unknown.
Bases: pyffi.object_models.xml.basic.BasicBase, pyffi.object_models.editable.EditableBoolComboBox
Basic implementation of a 32-bit (8-bit for versions > 4.0.0.2) boolean type.
>>> i = NifFormat.bool()
>>> i.set_value('false')
>>> i.get_value()
False
>>> i.set_value('true')
>>> i.get_value()
True
alias of UByte
alias of Char
alias of Float
Bases: pyffi.formats.nif._hkPackedNiTriStripsData, builtins.object
Apply scale factor on data.
Bases: pyffi.object_models.xml.enum.EnumBase
Bases: pyffi.object_models.xml.struct_.StructBase
A triangle with extra data used for physics.
This is the triangle’s normal.
The triangle.
Additional havok information on how triangles are welded.
alias of Int
Bases: pyffi.object_models.xml.struct_.StructBase
PhysX Material Description
Unknown
Unknown
alias of Short
Bases: pyffi.object_models.common.SizedString
alias of UInt
alias of ULittle32
alias of UShort
Converts version string into an integer.
Parameters: | version_str (str) – The version string. |
---|---|
Returns: | A version integer. |
>>> hex(NifFormat.version_number('3.14.15.29'))
'0x30e0f1d'
>>> hex(NifFormat.version_number('1.2'))
'0x1020000'
>>> hex(NifFormat.version_number('3.03'))
'0x3000300'
>>> hex(NifFormat.version_number('NS'))
'0xa010000'
These tests are used to check for functionality and bugs in the library. They also provide code examples which you may find useful.
>>> stream = open('tests/nif/test.nif', 'rb')
>>> data = NifFormat.Data()
>>> # inspect is optional; it will not read the actual blocks
>>> data.inspect(stream)
>>> hex(data.version)
'0x14010003'
>>> data.user_version
0
>>> for blocktype in data.header.block_types:
... print(blocktype.decode("ascii"))
NiNode
NiTriShape
NiTriShapeData
>>> data.roots # blocks have not been read yet, so this is an empty list
[]
>>> data.read(stream)
>>> for root in data.roots:
... for block in root.tree():
... if isinstance(block, NifFormat.NiNode):
... print(block.name.decode("ascii"))
test
>>> stream.close()
>>> for stream, data in NifFormat.walkData('tests/nif'):
... try:
... # the replace call makes the doctest also pass on windows
... print("reading %s" % stream.name.replace("\\", "/"))
... data.read(stream)
... except Exception:
... print(
... "Warning: read failed due corrupt file,"
... " corrupt format description, or bug.")
reading tests/nif/invalid.nif
Warning: read failed due corrupt file, corrupt format description, or bug.
reading tests/nif/nds.nif
reading tests/nif/neosteam.nif
reading tests/nif/test.nif
reading tests/nif/test_centerradius.nif
reading tests/nif/test_check_tangentspace1.nif
reading tests/nif/test_check_tangentspace2.nif
reading tests/nif/test_check_tangentspace3.nif
reading tests/nif/test_check_tangentspace4.nif
reading tests/nif/test_convexverticesshape.nif
reading tests/nif/test_dump_tex.nif
reading tests/nif/test_fix_clampmaterialalpha.nif
reading tests/nif/test_fix_cleanstringpalette.nif
reading tests/nif/test_fix_detachhavoktristripsdata.nif
reading tests/nif/test_fix_disableparallax.nif
reading tests/nif/test_fix_ffvt3rskinpartition.nif
reading tests/nif/test_fix_mergeskeletonroots.nif
reading tests/nif/test_fix_tangentspace.nif
reading tests/nif/test_fix_texturepath.nif
reading tests/nif/test_grid_128x128.nif
reading tests/nif/test_grid_64x64.nif
reading tests/nif/test_mopp.nif
reading tests/nif/test_opt_collision_complex_mopp.nif
reading tests/nif/test_opt_collision_mopp.nif
reading tests/nif/test_opt_collision_packed.nif
reading tests/nif/test_opt_collision_to_boxshape.nif
reading tests/nif/test_opt_collision_to_boxshape_notabox.nif
reading tests/nif/test_opt_collision_unpacked.nif
reading tests/nif/test_opt_delunusedbones.nif
reading tests/nif/test_opt_dupgeomdata.nif
reading tests/nif/test_opt_dupverts.nif
reading tests/nif/test_opt_emptyproperties.nif
reading tests/nif/test_opt_grid_layout.nif
reading tests/nif/test_opt_mergeduplicates.nif
reading tests/nif/test_opt_vertex_cache.nif
reading tests/nif/test_opt_zeroscale.nif
reading tests/nif/test_skincenterradius.nif
reading tests/nif/test_vertexcolor.nif
>>> root = NifFormat.NiNode()
>>> root.name = 'Scene Root'
>>> blk = NifFormat.NiNode()
>>> root.add_child(blk)
>>> blk.name = 'new block'
>>> blk.scale = 2.4
>>> blk.translation.x = 3.9
>>> blk.rotation.m_11 = 1.0
>>> blk.rotation.m_22 = 1.0
>>> blk.rotation.m_33 = 1.0
>>> ctrl = NifFormat.NiVisController()
>>> ctrl.flags = 0x000c
>>> ctrl.target = blk
>>> blk.add_controller(ctrl)
>>> blk.add_controller(NifFormat.NiAlphaController())
>>> strips = NifFormat.NiTriStrips()
>>> root.add_child(strips, front = True)
>>> strips.name = "hello world"
>>> strips.rotation.m_11 = 1.0
>>> strips.rotation.m_22 = 1.0
>>> strips.rotation.m_33 = 1.0
>>> data = NifFormat.NiTriStripsData()
>>> strips.data = data
>>> data.num_vertices = 5
>>> data.has_vertices = True
>>> data.vertices.update_size()
>>> for i, v in enumerate(data.vertices):
... v.x = 1.0+i/10.0
... v.y = 0.2+1.0/(i+1)
... v.z = 0.03
>>> data.update_center_radius()
>>> data.num_strips = 2
>>> data.strip_lengths.update_size()
>>> data.strip_lengths[0] = 3
>>> data.strip_lengths[1] = 4
>>> data.has_points = True
>>> data.points.update_size()
>>> data.points[0][0] = 0
>>> data.points[0][1] = 1
>>> data.points[0][2] = 2
>>> data.points[1][0] = 1
>>> data.points[1][1] = 2
>>> data.points[1][2] = 3
>>> data.points[1][3] = 4
>>> data.num_uv_sets = 1
>>> data.has_uv = True
>>> data.uv_sets.update_size()
>>> for i, v in enumerate(data.uv_sets[0]):
... v.u = 1.0-i/10.0
... v.v = 1.0/(i+1)
>>> data.has_normals = True
>>> data.normals.update_size()
>>> for i, v in enumerate(data.normals):
... v.x = 0.0
... v.y = 0.0
... v.z = 1.0
>>> strips.update_tangent_space()
>>> from tempfile import TemporaryFile
>>> stream = TemporaryFile()
>>> nifdata = NifFormat.Data(version=0x14010003, user_version=10)
>>> nifdata.roots = [root]
>>> nifdata.write(stream)
>>> stream.close()
>>> for vnum in sorted(NifFormat.versions.values()):
... print('0x%08X' % vnum)
0x02030000
0x03000000
0x03000300
0x03010000
0x0303000D
0x04000000
0x04000002
0x0401000C
0x04020002
0x04020100
0x04020200
0x0A000100
0x0A000102
0x0A000103
0x0A010000
0x0A010065
0x0A01006A
0x0A020000
0x0A020001
0x0A040001
0x14000004
0x14000005
0x14010003
0x14020007
0x14020008
0x14030001
0x14030002
0x14030003
0x14030006
0x14030009
0x14050000
0x14060000
0x14060500
0x1E000002
>>> for game, versions in sorted(NifFormat.games.items(), key=lambda x: x[0]):
... print("%s " % game + " ".join('0x%08X' % vnum for vnum in versions))
? 0x0A000103
Atlantica 0x14020008
Axis and Allies 0x0A010000
Bully SE 0x14030009
Civilization IV 0x04020002 0x04020100 0x04020200 0x0A000100 0x0A010000 0x0A020000 0x14000004
Culpa Innata 0x04020200
Dark Age of Camelot 0x02030000 0x03000300 0x03010000 0x0401000C 0x04020100 0x04020200 0x0A010000
Divinity 2 0x14030009
Emerge 0x14020007 0x14020008 0x14030001 0x14030002 0x14030003 0x14030006 0x1E000002
Empire Earth II 0x04020200 0x0A010000
Empire Earth III 0x14020007 0x14020008
Entropia Universe 0x0A010000
Epic Mickey 0x14060500
Fallout 3 0x14020007
Freedom Force 0x04000000 0x04000002
Freedom Force vs. the 3rd Reich 0x0A010000
Howling Sword 0x14030009
Kohan 2 0x0A010000
KrazyRain 0x14050000 0x14060000
Lazeska 0x14030009
Loki 0x0A020000
Megami Tensei: Imagine 0x14010003
Morrowind 0x04000002
NeoSteam 0x0A010000
Oblivion 0x0303000D 0x0A000100 0x0A000102 0x0A010065 0x0A01006A 0x0A020000 0x14000004 0x14000005
Prison Tycoon 0x0A020000
Pro Cycling Manager 0x0A020000
Red Ocean 0x0A020000
Sid Meier's Railroads 0x14000004
Skyrim 0x14020007
Star Trek: Bridge Commander 0x03000000 0x03010000
The Guild 2 0x0A010000
Warhammer 0x14030009
Wildlife Park 2 0x0A010000 0x0A020000
Worldshift 0x0A020001 0x0A040001
Zoo Tycoon 2 0x0A000100
>>> stream = open('tests/nif/invalid.nif', 'rb')
>>> data = NifFormat.Data()
>>> data.inspect(stream) # the file seems ok on inspection
>>> data.read(stream)
Traceback (most recent call last):
...
ValueError: ...
>>> stream.close()
>>> block = NifFormat.NiTextKeyExtraData()
>>> block.num_text_keys = 1
>>> block.text_keys.update_size()
>>> block.text_keys[0].time = 1.0
>>> block.text_keys[0].value = 'hi'
>>> NifFormat.NiNode._has_links
True
>>> NifFormat.NiBone._has_links
True
>>> skelroot = NifFormat.NiNode()
>>> geom = NifFormat.NiTriShape()
>>> geom.skin_instance = NifFormat.NiSkinInstance()
>>> geom.skin_instance.skeleton_root = skelroot
>>> [block.__class__.__name__ for block in geom.get_refs()]
['NiSkinInstance']
>>> [block.__class__.__name__ for block in geom.get_links()]
['NiSkinInstance']
>>> [block.__class__.__name__ for block in geom.skin_instance.get_refs()]
[]
>>> [block.__class__.__name__ for block in geom.skin_instance.get_links()]
['NiNode']
>>> extra = NifFormat.NiTextKeyExtraData()
>>> extra.num_text_keys = 2
>>> extra.text_keys.update_size()
>>> extra.text_keys[0].time = 0.0
>>> extra.text_keys[0].value = "start"
>>> extra.text_keys[1].time = 2.0
>>> extra.text_keys[1].value = "end"
>>> for extrastr in extra.get_strings(None):
... print(extrastr.decode("ascii"))
start
end