Bases: pyffi.object_models.xml.FileFormat
This class contains the generated classes from the xml.
Bases: pyffi.object_models.xml.struct_.StructBase
Used in NiDefaultAVObjectPalette.
Object reference.
Object name.
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
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.NiNode
Bethesda-Specific node.
Unknown
Unknown
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.formats.nif.BSShaderProperty
Bethesda-specific node.
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.NiKeyframeController
An extended keyframe controller.
A link to more keyframe data.
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.
Unknown
Bases: pyffi.formats.nif.NiObject
Abstract base type for bounding data.
Bases: pyffi.formats.nif.NiNode
Bethesda-specific node.
Unknown.
Bases: pyffi.formats.nif.BSMultiBoundData
Bethesda-specific node.
Radius
Unknown Flag
Unknown Flag
Unknown Flag
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.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
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
Particle modifier that adds a blend of object space translation and rotation to particles born in world space.
Amount of blending?
Bases: pyffi.formats.nif.NiTimeController
Bethesda-specific node.
Link to Interpolator.
Bases: pyffi.formats.nif.NiFloatInterpController
Bethesda-Specific node.
Bases: pyffi.formats.nif.NiTriShape
Bethesda-specific node.
Unknown
Unknown
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Unknown
Unknown
Unknown
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.
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.NiPSysData
Bethesda-Specific (mesh?) Particle System Data.
Unknown
Unknown
Unknown
Unknown
Bases: pyffi.formats.nif.NiParticleSystem
Bethesda-Specific (mesh?) Particle System.
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Data
Unknown Flag
Bases: pyffi.formats.nif.NiInterpolator
Bethesda-specific node.
Unknown
Unknown
Unknown
Bases: pyffi.object_models.xml.struct_.StructBase
Bethesda-specific node.
Unknown
Unknown
Unknown
Unknown
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.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 havokBit 1 : enable collisionBit 2 : is skeleton nif?Bit 3 : enable animationBit 4 : FlameNodes presentBit 5 : EditorMarkers present
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
Bounding box.
Radius, per direction.
Rotation matrix.
Translation vector.
Usually 1.
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.object_models.xml.struct_.StructBase
Capsule Bounding Volume
Center
Origin
Unknown.
Unknown.
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
Sets how objects are to be cloned.
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
>>> 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()
'Bip01'
>>> link.node_name
'Bip01'
>>> link.set_node_name("Bip01 Tail")
>>> link.node_name_offset
6
>>> link.get_node_name()
'Bip01 Tail'
>>> link.node_name
'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()
'Bip01'
>>> # another doctest
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.node_name = "Bip01"
>>> link.get_node_name()
'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: |
|
---|
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.enum.EnumBase
Determines how a data stream is used?
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.enum.EnumBase
Controls which parts of the mesh that the particles are emitted from.
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.xml.enum.EnumBase
The type of force? May be more valid values.
Bases: pyffi.object_models.xml.struct_.StructBase
Describes a furniture position?
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.enum.EnumBase
A material, used by havok shape objects.
Bases: pyffi.object_models.xml.enum.EnumBase
Determines how the raw image data is stored in NiRawImageData.
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.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())
>>> f.seek(0)
>>> l.read(f)
>>> str(l)
'abcdefg'
>>> f.seek(0)
>>> l.set_value('Hi There')
>>> l.write(f)
>>> f.seek(0)
>>> m = NifFormat.LineString()
>>> m.read(f)
>>> str(m)
'Hi There'
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.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.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.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
>>> 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()]
['hello', 'world']
>>> [prop.name for prop in node.properties]
['hello', '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()]
['world', 'hello']
>>> [prop.name for prop in node.properties]
['world', 'hello']
>>> node.remove_property(prop2)
>>> [prop.name for prop in node.properties]
['hello']
>>> node.add_property(prop2)
>>> [prop.name for prop in node.properties]
['hello', '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.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._NiBSplineData
>>> # 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
Unknown.
Unknown.
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 normals and binormals 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.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.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
>>> 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]
['bone1', '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]
['bone1', 'bone2', 'bone22', 'bone211']
>>> [child.name for child in skelroot.children]
['geom', 'bone1', 'bone21', 'bone2', 'bone22', '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
>>> 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.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.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.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.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
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
>>> 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()]
['hello', 'world']
>>> [child.name for child in node.children]
['hello', '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()]
['world', 'hello']
>>> [child.name for child in node.children]
['world', 'hello']
>>> node.remove_child(child_2)
>>> [child.name for child in node.children]
['hello']
>>> node.add_child(child_2)
>>> [child.name for child in node.children]
['hello', '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()]
['hello', 'world']
>>> [effect.name for effect in node.effects]
['hello', '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()]
['world', 'hello']
>>> [effect.name for effect in node.effects]
['world', 'hello']
>>> node.remove_effect(effect2)
>>> [effect.name for effect in node.effects]
['hello']
>>> node.add_effect(effect2)
>>> [effect.name for effect in node.effects]
['hello', '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.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.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.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.
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?
Unknown ushort
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).
Unknown
The particles’size.
The individual particel sizes.
Angles of rotation
Unknown
The individual particle rotations.
The individual particel sizes.
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.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.
Raw pixel data holding the mipmaps. Mipmap zero is the full-size texture and they get smaller by half as the number increases.
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.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.NiInterpController
A controller referring to a single interpolator.
Link to interpolator.
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.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.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.NiProperty
Unknown
Unknown.
Bases: pyffi.formats.nif.NiTriBasedGeom
A shape node that refers to singular triangle data.
Bases: pyffi.formats.nif._NiTriShapeData
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
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: exceptions.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.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.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
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.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 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.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.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.formats.nif.BSShaderProperty
Bethesda-specific node? Found in Fallout3
The texture.
Unknown
Unknown
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.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.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.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.formats.nif._Vector4
>>> 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.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.bhkConstraint
Bethesda-Specific node.
Unknown
Bases: pyffi.formats.nif.bhkShape
A tree-like Havok data structure stored in an assembly-like binary code?
Bases: pyffi.formats.nif.bhkNiCollisionObject
Havok related collision object?
Bases: pyffi.formats.nif.bhkShape
A havok shape.A list of 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.
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.bhkWorldObject
A havok node, describes physical properties.
Bases: pyffi.formats.nif.bhkConstraint
A hinge constraint.
Hinge constraing.
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.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.bhkSerializable
Bethesda-Specific node.
Bases: pyffi.formats.nif.bhkNiCollisionObject
Unknown.
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.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.
Bases: pyffi.formats.nif.bhkConstraint
A spring constraint.
Length.
Pivot A.
Pivot B.
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.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
alias of Short
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
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