pyffi.formats.nif — NetImmerse/Gamebryo (.nif and .kf)

Implementation

class pyffi.formats.nif.NifFormat

Bases: pyffi.object_models.xml.FileFormat

This class contains the generated classes from the xml.

ARCHIVE_CLASSES = [<class 'pyffi.formats.bsa.BsaFormat'>]
class ATextureRenderData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._ATextureRenderData, object

save_as_dds(stream)

Save image as DDS file.

class AVObject(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Used in NiDefaultAVObjectPalette.

av_object

Object reference.

name

Object name.

class AbstractAdditionalGeometryData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class AdditionalDataBlock(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

block_offsets

Unknown

block_size

Size of Block

data

Unknown

data_sizes

Unknown

has_data

Has data

num_blocks

Unknown

num_data

Unknown

class AdditionalDataInfo(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

block_index

Unsure. The block in which this channel is stored? Usually there is only one block, and so this is zero.

channel_offset

Offset (in bytes) of this channel. Sum of all num channel bytes per element of all preceeding block infos.

data_type

Type of data in this channel

num_channel_bytes

Total number of bytes of this channel (num vertices times num bytes per element)

num_channel_bytes_per_element

Number of bytes per element of this channel

num_total_bytes_per_element

Number of bytes per element in all channels together. Sum of num channel bytes per element over all block infos.

unknown_byte_1

Unknown, usually equal to 2.

class AlphaFormat(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing how transparency is handled in a texture.

ALPHABINARY = 1
ALPHADEFAULT = 3
ALPHANONE = 0
ALPHASMOOTH = 2
class AnimationType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Animation type used on this position. This specifies the function of this position.

Lean = 4
Sit = 1
Sleep = 2
class ApplyMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing the apply mode of a texture.

APPLYDECAL = 1
APPLYHILIGHT = 3
APPLYHILIGHT2 = 4
APPLYMODULATE = 2
APPLYREPLACE = 0
class ArkTexture(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A texture reference used by NiArkTextureExtraData.

texture_name
texturing_property
unknown_bytes
unknown_int_3
unknown_int_4
class AvoidNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Morrowind specific?

class BSAnimNotes(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Bethesda-specific node.

unknown_short_1

Unknown

class BSBehaviorGraphExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Links a nif with a Havok Behavior .hkx animation file

behaviour_graph_file

Name of the hkx file.

controls_base_skeleton

Unknown, has to do with blending appended bones onto an actor.

class BSBlastNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node.

unknown_byte_1

Unknown

unknown_short_2

Unknown

class BSBoneLODExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown

bone_l_o_d_count

Number of bone entries

bone_l_o_d_info

Bone Entry

class BSBound(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._BSBound, object

apply_scale(scale)

Scale data.

class BSDamageStage(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node.

unknown_byte_1

Unknown

unknown_short_2

Unknown

class BSDebrisNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node.

unknown_byte_1

Unknown

unknown_short_2

Unknown

class BSDecalPlacementVectorExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Bethesda-specific node. (for dynamic decal projection?)

num_vector_blocks

Number of groups

unknown_float_1

Unknown

vector_blocks

Number of Blocks

class BSDismemberBodyPartType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Biped bodypart data used for visibility control of triangles. Options are Fallout 3, except where marked for Skyrim (uses SBP prefix)Skyrim BP names are listed only for vanilla names, different creatures have different defnitions for naming.

BPBRAIN = 13
BPHEAD = 1
BPHEAD2 = 2
BPLEFTARM = 3
BPLEFTARM2 = 4
BPLEFTLEG = 7
BPLEFTLEG2 = 8
BPLEFTLEG3 = 9
BPRIGHTARM = 5
BPRIGHTARM2 = 6
BPRIGHTLEG = 10
BPRIGHTLEG2 = 11
BPRIGHTLEG3 = 12
BPSECTIONCAPBRAIN = 113
BPSECTIONCAPHEAD = 101
BPSECTIONCAPHEAD2 = 102
BPSECTIONCAPLEFTARM = 103
BPSECTIONCAPLEFTARM2 = 104
BPSECTIONCAPLEFTLEG = 107
BPSECTIONCAPLEFTLEG2 = 108
BPSECTIONCAPLEFTLEG3 = 109
BPSECTIONCAPRIGHTARM = 105
BPSECTIONCAPRIGHTARM2 = 106
BPSECTIONCAPRIGHTLEG = 110
BPSECTIONCAPRIGHTLEG2 = 111
BPSECTIONCAPRIGHTLEG3 = 112
BPTORSO = 0
BPTORSOCAPBRAIN = 213
BPTORSOCAPHEAD = 201
BPTORSOCAPHEAD2 = 202
BPTORSOCAPLEFTARM = 203
BPTORSOCAPLEFTARM2 = 204
BPTORSOCAPLEFTLEG = 207
BPTORSOCAPLEFTLEG2 = 208
BPTORSOCAPLEFTLEG3 = 209
BPTORSOCAPRIGHTARM = 205
BPTORSOCAPRIGHTARM2 = 206
BPTORSOCAPRIGHTLEG = 210
BPTORSOCAPRIGHTLEG2 = 211
BPTORSOCAPRIGHTLEG3 = 212
BPTORSOSECTIONBRAIN = 13000
BPTORSOSECTIONHEAD = 1000
BPTORSOSECTIONHEAD2 = 2000
BPTORSOSECTIONLEFTARM = 3000
BPTORSOSECTIONLEFTARM2 = 4000
BPTORSOSECTIONLEFTLEG = 7000
BPTORSOSECTIONLEFTLEG2 = 8000
BPTORSOSECTIONLEFTLEG3 = 9000
BPTORSOSECTIONRIGHTARM = 5000
BPTORSOSECTIONRIGHTARM2 = 6000
BPTORSOSECTIONRIGHTLEG = 10000
BPTORSOSECTIONRIGHTLEG2 = 11000
BPTORSOSECTIONRIGHTLEG3 = 12000
SBP130HEAD = 130
SBP131HAIR = 131
SBP141LONGHAIR = 141
SBP142CIRCLET = 142
SBP143EARS = 143
SBP150DECAPITATEDHEAD = 150
SBP230HEAD = 230
SBP30HEAD = 30
SBP31HAIR = 31
SBP32BODY = 32
SBP33HANDS = 33
SBP34FOREARMS = 34
SBP35AMULET = 35
SBP36RING = 36
SBP37FEET = 37
SBP38CALVES = 38
SBP39SHIELD = 39
SBP40TAIL = 40
SBP41LONGHAIR = 41
SBP42CIRCLET = 42
SBP43EARS = 43
SBP44DRAGONBLOODHEADORMODMOUTH = 44
SBP45DRAGONBLOODWINGLORMODNECK = 45
SBP46DRAGONBLOODWINGRORMODCHESTPRIMARY = 46
SBP47DRAGONBLOODTAILORMODBACK = 47
SBP48MODMISC1 = 48
SBP49MODPELVISPRIMARY = 49
SBP50DECAPITATEDHEAD = 50
SBP51DECAPITATE = 51
SBP52MODPELVISSECONDARY = 52
SBP53MODLEGRIGHT = 53
SBP54MODLEGLEFT = 54
SBP55MODFACEJEWELRY = 55
SBP56MODCHESTSECONDARY = 56
SBP57MODSHOULDER = 57
SBP58MODARMLEFT = 58
SBP59MODARMRIGHT = 59
SBP60MODMISC2 = 60
SBP61FX01 = 61
class BSDismemberSkinInstance(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._BSDismemberSkinInstance, object

get_dismember_partitions()

Return triangles and body part indices.

class BSDistantTreeShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node.

class BSEffectShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Skyrim non-PP shader model, used primarily for transparency effects, often as decal.

emissive_color

Emissive color

emissive_multiple

Multiplier for Emissive Color (RGB part)

falloff_start_angle

At this cosine of angle falloff will be equal to Falloff Start Opacity

falloff_start_opacity

Alpha falloff multiplier at start angle

falloff_stop_angle

At this cosine of angle falloff will be equal to Falloff Stop Opacity

falloff_stop_opacity

Alpha falloff multiplier at end angle

greyscale_texture

Points to an external texture, used as palette for SLSF1_Greyscale_To_PaletteColor/SLSF1_Greyscale_To_PaletteAlpha.

shader_flags_1
shader_flags_2
soft_falloff_depth
source_texture

points to an external texture.

texture_clamp_mode

How to handle texture borders.

uv_offset

Offset UVs

uv_scale

Offset UV Scale to repeat tiling textures

class BSEffectShaderPropertyColorController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

This controller is used to animate colors in BSEffectShaderProperty.

type_of_controlled_color

Which color in BSEffectShaderProperty to animate

class BSEffectShaderPropertyFloatController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

This controller is used to animate float variables in BSEffectShaderProperty.

type_of_controlled_variable

Which float variable in BSEffectShaderProperty to animate

class BSFadeNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-specific fade node.

class BSFrustumFOVController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Bethesda-specific node.

interpolator

Frustrum field of view animation interpolater and data.

class BSFurnitureMarker(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown. Marks furniture sitting positions?

num_positions

Number of positions.

positions

Unknown. Probably has something to do with the furniture positions?

class BSFurnitureMarkerNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSFurnitureMarker

Furniture Marker for actors

class BSInvMarker(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Orientation marker for Skyrim’s inventory view.How to show the nif in the player’s inventory.Typically attached to the root node of the nif tree.If not present, then Skyrim will still show the nif in inventory,using the default values.Name should be ‘INV’ (without the quotes).For rotations, a short of “4712” appears as “4.712” but “959” appears as “0.959” meshesweaponsdaedricdaedricbowskinned.nif

rotation_x
rotation_y
rotation_z
zoom

Zoom factor.

class BSKeyframeController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyframeController

An extended keyframe controller.

data_2

A link to more keyframe data.

class BSLODTriShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriBasedGeom

A variation on NiTriShape, for visibility control over vertex groups.

level_0_size

Unknown

level_1_size

Unknown

level_2_size

Unknown

class BSLagBoneController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

A controller that trails a bone behind an actor.

linear_rotation

How the bone lags rotation

linear_velocity

How long it takes to rotate about an actor back to rest position.

maximum_distance

How far bone will tail an actor.

class BSLeafAnimNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Unknown, related to trees.

class BSLightingShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Skyrim PP shader for assigning material/shader/texture.

alpha

The material’s opacity (1=non-transparent).

emissive_color

Glow color and alpha

emissive_multiple

Multiplied emissive colors

environment_map_scale

Scales the intensity of the environment/cube map. (0-1)

eye_cubemap_scale

Eye cubemap scale

glossiness

The material’s specular power, or glossiness (0-999).

hair_tint_color

Tints the base texture. Overridden by game settings.

left_eye_reflection_center

Offset to set center for left eye cubemap

lighting_effect_1

Controls strength for envmap/backlight/rim/softlight lighting effect?

lighting_effect_2

Controls strength for envmap/backlight/rim/softlight lighting effect?

max_passes

Max Passes

parallax_envmap_strength

How strong the environment/cube map is. (0-??)

parallax_inner_layer_texture_scale

Scales the inner parallax layer texture.

parallax_inner_layer_thickness

How far from the surface the inner layer appears to be.

parallax_refraction_scale

Depth of inner parallax layer effect.

refraction_strength

The amount of distortion. Not based on physically accurate refractive index (0=none) (0-1)

right_eye_reflection_center

Offset to set center for right eye cubemap

scale

Scale

shader_flags_1

Skyrim Shader Flags for setting render/shader options.

shader_flags_2

Skyrim Shader Flags for setting render/shader options.

skin_tint_color

Tints the base texture. Overridden by game settings.

sparkle_parameters

Unknown/unused? CK lists “snow material” when used.

specular_color

Adds a colored highlight.

specular_strength

Brightness of specular highlight. (0=not visible) (0-999)

texture_clamp_mode

How to handle texture borders.

texture_set

Texture Set, can have override in an esm/esp

uv_offset

Offset UVs

uv_scale

Offset UV Scale to repeat tiling textures, see above.

class BSLightingShaderPropertyColorController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

This controller is used to animate colors in BSLightingShaderProperty.

type_of_controlled_color

Which color in BSLightingShaderProperty to animate

class BSLightingShaderPropertyFloatController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

This controller is used to animate float variables in BSLightingShaderProperty.

type_of_controlled_variable

Which float variable in BSLightingShaderProperty to animate

class BSLightingShaderPropertyShaderType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Values for configuring the shader type in a BSLightingShaderProperty

Default = 0
EnvironmentMap = 1
EyeEnvmap = 16
FaceTint = 4
GlowShader = 2
HairTint = 6
Heightmap = 3
MultiLayerParallax = 11
ParallaxOccMaterial = 7
SkinTint = 5
SparkleSnow = 14
Unknown10 = 10
Unknown12 = 12
Unknown17 = 17
WorldLODMultitexture = 19
WorldMap1 = 9
WorldMap2 = 13
WorldMap3 = 15
WorldMap4 = 18
WorldMultitexture = 8
class BSMasterParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node.

max_emitter_objects

Unknown

num_particle_systems

Unknown

particle_systems

Unknown

class BSMaterialEmittanceMultController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Bethesda-Specific node.

class BSMultiBound(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Bethesda-specific node.

data

Unknown.

class BSMultiBoundAABB(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSMultiBoundData

Bethesda-specific node.

extent

Extent of the AABB in all directions

position

Position of the AABB’s center

class BSMultiBoundData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Abstract base type for bounding data.

class BSMultiBoundNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-specific node.

multi_bound

Unknown.

unknown_int

Unknown

class BSMultiBoundOBB(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSMultiBoundData

Oriented bounding box.

center

Center of the box.

rotation

Rotation of the bounding box.

size

Size of the box along each axis.

class BSMultiBoundSphere(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSMultiBoundData

Bethesda-specific node.

radius

Radius

unknown_int_1

Unknown Flag

unknown_int_2

Unknown Flag

unknown_int_3

Unknown Flag

class BSNiAlphaPropertyTestRefController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAlphaController

Unkown

class BSOrderedNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node.

alpha_sort_bound

Unknown

is_static_bound

Unknown

class BSPSysArrayEmitter(template=None, argument=None, parent=None)

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.

class BSPSysHavokUpdateModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

modifier

Unknown

nodes

Group of target NiNodes?

num_nodes

Unknown

class BSPSysInheritVelocityModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_int_1

Unknown

class BSPSysLODModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

uknown_float_1

Unknown

uknown_float_2

Unknown

uknown_float_3

Unknown

uknown_float_4

Unknown

class BSPSysMultiTargetEmitterCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

Particle system (multi?) emitter controller.

data

This controller’s data

unknown_int_1

Unknown

unknown_short_1

Unknown

visibility_interpolator

Links to a bool interpolator. Controls emitter’s visibility status?

class BSPSysRecycleBoundModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_float_4

Unknown

unknown_float_5

Unknown

unknown_float_6

Unknown

unknown_int_1

Unknown

class BSPSysScaleModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

floats

Unknown

num_floats
class BSPSysSimpleColorModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Bethesda-Specific Particle node.

color_1_end_percent

Unknown

color_1_start_percent

Unknown

color_2_end_percent

Unknown

color_2_start_percent

Unknown

colors

Colors

fade_in_percent

Unknown

fade_out_percent

Unknown

class BSPSysStripUpdateModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Bethesda-Specific (mesh?) Particle System Modifier.

update_delta_time

Unknown

class BSPSysSubTexModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Similar to a Flip Controller, this handles particle texture animation on a single texture atlas

end_frame

Ending frame/position on atlas

frame_count

Unknown

frame_count_fudge

Unknown

loop_start_frame

Frame to start looping

loop_start_frame_fudge
start_frame

Starting frame/position on atlas

start_frame_fudge

Random chance to start on a different frame?

class BSPackedAdditionalDataBlock(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

atom_sizes

The sum of all of these equal num total bytes per element, so this probably describes how each data element breaks down into smaller chunks (i.e. atoms).

block_offsets

Block offsets in the data? Usually equal to zero.

data

Unknown

has_data

Has data

num_atoms

Number of atoms?

num_blocks

Number of blocks? Usually equal to one.

num_total_bytes

Total number of bytes (over all channels and all elements, equals num total bytes per element times num vertices).

num_total_bytes_per_element

Unsure, but this seems to correspond again to the number of total bytes per element.

unknown_int_1
class BSPackedAdditionalGeometryData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.AbstractAdditionalGeometryData

block_infos

Number of additional data blocks

blocks

Number of additional data blocks

num_block_infos

Information about additional data blocks

num_blocks

Number of additional data blocks. Usually there is exactly one block.

num_vertices
class BSParentVelocityModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle modifier that adds a blend of object space translation and rotation to particles born in world space.

damping

Amount of blending?

class BSPartFlag(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

pf_editor_visible
pf_start_net_boneset
reserved_bits_1
class BSProceduralLightningController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Skyrim, Paired with dummy TriShapes, this controller generates lightning shapes for special effects.First interpolator controls Generation.

byte_1

Unknown

byte_2

Unknown

byte_3

Unknown

distance_weight

How far lightning will stretch to.

float_2

Unknown

float_5

Unknown

fork

Influences forking behavior

interpolator_10

Unknown, unsure if this is actually another interpolator link.

interpolator_2_mutation

References interpolator for Mutation of strips

interpolator_3

Unknown

interpolator_4

Unknown

interpolator_5

Unknown

interpolator_6

Unknown

interpolator_7

Unknown

interpolator_8

Unknown

interpolator_9_arc_offset

References interpolator for Amplitutde control. 0=straight, 50=wide

strip_width

How wide the bolt will be

unknown_short_1

Unknown

unknown_short_2

Unknown

unknown_short_3

Unknown

class BSRefractionFirePeriodController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Bethesda-specific node.

interpolator

Link to Interpolator.

class BSRefractionStrengthController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Bethesda-Specific node.

class BSRotAccumTransfInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTransformInterpolator

class BSSegment(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Bethesda-specific node.

flags

Geometry present in the segment

internal_index

Index multiplied by 1536 (0x0600)

unknown_byte_1

Unknown

class BSSegmentFlags(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

bsseg_water
reserved_bits_0
class BSSegmentedTriShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriShape

Bethesda-specific node.

num_segments

Number of segments in the square grid

segment

Configuration of each segment

class BSShaderFlags(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

sf_alpha_texture
sf_decal_single_pass
sf_dynamic_alpha
sf_dynamic_decal_single_pass
sf_empty
sf_environment_mapping
sf_external_emittance
sf_eye_environment_mapping
sf_face_gen
sf_fire_refraction
sf_hair
sf_localmap_hide_secret
sf_low_detail
sf_multiple_textures
sf_non_projective_shadows
sf_parallax_occulsion
sf_parallax_shader_index_15
sf_refraction
sf_remappable_textures
sf_shadow_frustum
sf_shadow_map
sf_single_pass
sf_skinned
sf_specular
sf_tree_billboard
sf_unknown_1
sf_unknown_2
sf_unknown_3
sf_unknown_4
sf_vertex_alpha
sf_window_environment_mapping
sf_z_buffer_test
class BSShaderFlags2(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

sf_2_1_st_light_is_point_light
sf_2_2_nd_light
sf_2_3_rd_light
sf_2_alpha_decal
sf_2_billboard_and_envmap_light_fade
sf_2_envmap_light_fade
sf_2_fit_slope
sf_2_lod_building
sf_2_lod_landscape
sf_2_no_fade
sf_2_no_lod_land_blend
sf_2_no_transparecny_multisampling
sf_2_premult_alpha
sf_2_refraction_tint
sf_2_show_in_local_map
sf_2_skip_normal_maps
sf_2_uniform_scale
sf_2_unknown_1
sf_2_unknown_10
sf_2_unknown_2
sf_2_unknown_3
sf_2_unknown_4
sf_2_unknown_5
sf_2_unknown_6
sf_2_unknown_7
sf_2_unknown_8
sf_2_unknown_9
sf_2_vats_selection
sf_2_vertex_colors
sf_2_vertex_lighting
sf_2_wireframe
sf_2_z_buffer_write
class BSShaderLightingProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific property.

texture_clamp_mode

How to handle texture borders.

class BSShaderNoLightingProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderLightingProperty

Bethesda-specific property.

falloff_start_angle

At this cosine of angle falloff will be equal to Falloff Start Opacity

falloff_start_opacity

Alpha falloff multiplier at start angle

falloff_stop_angle

At this cosine of angle falloff will be equal to Falloff Stop Opacity

falloff_stop_opacity

Alpha falloff multiplier at end angle

file_name

The texture glow map.

class BSShaderPPLightingProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderLightingProperty

Bethesda-specific Shade node.

emissive_color

Glow color and alpha

refraction_fire_period

Rate of texture movement for refraction shader.

refraction_strength

The amount of distortion. Not based on physically accurate refractive index (0=none) (0-1)

texture_set

Texture Set

unknown_float_4

Unknown

unknown_float_5

Unknown

class BSShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Bethesda-specific Property node

environment_map_scale

Scales the intensity of the environment/cube map.

shader_flags

Shader Property Flags

shader_flags_2

Shader Property Flags 2

shader_type

Unknown (Set to 0x21 for NoLighting, 0x11 for Water)

smooth

**Unknown.0* – smooth no1* – smooth yes

class BSShaderTextureSet(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Bethesda-specific Texture Set.

num_textures

Number of Textures

textures

**Textures.0* – Diffuse1* – Normal/Gloss2: Glow(SLSF2_Glow_Map)/Skin/Hair/Rim light(SLSF2_Rim_Lighting)3: Height/Parallax4: Environment5: Environment Mask6: Subsurface for Multilayer Parallax7: Back Lighting Map (SLSF2_Back_Lighting)

class BSShaderType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of animation interpolation (blending) that will be used on the associated key frames.

SHADERDEFAULT = 1
SHADERLIGHTING30 = 29
SHADERNOLIGHTING = 33
SHADERSKIN = 14
SHADERSKY = 10
SHADERTALLGRASS = 0
SHADERTILE = 32
SHADERWATER = 17
class BSSkyShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Skyrim Sky shader block.

shader_flags_1
shader_flags_2
sky_object_type

Sky Object Type

source_texture

points to an external texture.

uv_offset

Offset UVs. Seems to be unused, but it fits with the other Skyrim shader properties.

uv_scale

Offset UV Scale to repeat tiling textures, see above.

class BSStripPSysData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysData

Bethesda-Specific (mesh?) Particle System Data.

unknown_byte_6

Unknown

unknown_float_8

Unknown

unknown_int_7

Unknown

unknown_short_5

Unknown

class BSStripParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleSystem

Bethesda-Specific (mesh?) Particle System.

class BSTreadTransfInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpolator

Bethesda-specific node.

data

Unknown float data.

num_tread_transforms

Unknown.

tread_transforms

Unknown.

class BSTreadTransform(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Bethesda-specific node.

name

Name of affected node?

transform_1

Transform data.

transform_2

Transform data.

class BSTreadTransformData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Bethesda-specific node.

rotation

Rotation.

scale

Scale (usually float_min).

translation

Translation.

class BSTreeNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Node for handling Trees, Switches branch configurations for variation?

bones

Unknown

bones_1

Unknown

num_bones_1

Unknown

num_bones_2

Unknown

class BSValueNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-Specific node. Found on fxFire effects

unknown_byte

Unknown

value

Value

class BSWArray(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Bethesda-specific node.

items

Unknown

num_items

Unknown

class BSWaterShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Skyrim water shader property, different from “WaterShaderProperty” seen in Fallout.

shader_flags_1
shader_flags_2
unknown_short_3

Unknown, flag?

uv_offset

Offset UVs. Seems to be unused, but it fits with the other Skyrim shader properties.

uv_scale

Offset UV Scale to repeat tiling textures, see above.

water_direction

A bitflag, only the first/second bit controls water flow positive or negative along UVs.

water_shader_flags

Defines attributes for the water shader (will use SkyrimWaterShaderFlags)

class BSWindModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle Modifier that uses the wind value from the gamedata to alter the path of particles.

strength

The amount of force wind will have on particles.

class BSXFlags(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiIntegerExtraData

Controls animation and collision. Integer holds flags:Bit 0 : enable havok, bAnimated(Skyrim)Bit 1 : enable collision, bHavok(Skyrim)Bit 2 : is skeleton nif?, bRagdoll(Skyrim)Bit 3 : enable animation, bComplex(Skyrim)Bit 4 : FlameNodes present, bAddon(Skyrim)Bit 5 : EditorMarkers presentBit 6 : bDynamic(Skyrim)Bit 7 : bArticulated(Skyrim)Bit 8 : bIKTarget(Skyrim)Bit 9 : Unknown(Skyrim)

class BallAndSocketDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

unknown_4_bytes

Unknown

unknown_floats_1

Unknown

unknown_floats_2

Unknown

unknown_int_1

Unknown

class BillboardMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines the way the billboard will react to the camera.Billboard mode is stored in lowest 3 bits although Oblivion vanilla nifs uses values higher than 7.

ALWAYSFACECAMERA = 0
ALWAYSFACECENTER = 3
BSROTATEABOUTUP = 5
RIGIDFACECAMERA = 2
RIGIDFACECENTER = 4
ROTATEABOUTUP = 1
ROTATEABOUTUP2 = 9
BlockTypeIndex

alias of UShort

class BodyPartList(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Body part list for DismemberSkinInstance

body_part

Body Part Index

part_flag

Flags related to the Body Partition

class BoneLOD(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Stores Bone Level of Detail info in a BSBoneLODExtraData

bone_name

The bones name

distance

Distance to cull?

class BoundVolumeType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

BASEBV = 4294967295
BOXBV = 1
CAPSULEBV = 2
HALFSPACEBV = 5
SPHEREBV = 0
UNIONBV = 4
class BoundingBox(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Bounding box.

radius

Radius, per direction.

rotation

Rotation matrix.

translation

Translation vector.

unknown_int

Usually 1.

class BoundingVolume(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

box

Box

capsule

Capsule

collision_type

Type of collision data.

half_space

Half Space

sphere

Sphere

union

Union

class BoxBV(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Box Bounding Volume

axis

Axis

center

Center

extent

Extent

class ByteArray(**kwargs)

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__.

get_hash(data=None)
get_size(data=None)
get_value()
read(stream, data)
set_value(value)
write(stream, data)
class ByteColor3(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A color without alpha (red, green, blue).

b

Blue color component.

g

Green color component.

r

Red color component.

class ByteColor4(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A color with alpha (red, green, blue, alpha).

a

Alpha color component.

b

Blue color component.

g

Green color component.

r

Red color component.

class ByteMatrix(**kwargs)

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__.

get_hash(data=None)
get_size(data=None)
get_value()
read(stream, data)
set_value(value)
write(stream, data)
class CStreamableAssetData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

root
unknown_bytes
class CapsuleBV(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Capsule Bounding Volume

center

Center

origin

Origin

unknown_float_1

Unknown.

unknown_float_2

Unknown.

class ChannelConvention(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

CCCOMPRESSED = 4
CCEMPTY = 5
CCFIXED = 0
CCINDEX = 3
class ChannelData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Channel data

bits_per_channel

Bits per channel

convention

Data Storage Convention

type

Channel Type

unknown_byte_1

Unknown

class ChannelType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

CHNLALPHA = 3
CHNLBLUE = 2
CHNLCOMPRESSED = 4
CHNLEMPTY = 19
CHNLGREEN = 1
CHNLINDEX = 16
CHNLRED = 0
class CloningBehavior(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Sets how objects are to be cloned.

CLONINGBLANKCOPY = 2
CLONINGCOPY = 1
CLONINGSHARE = 0
class CollisionMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

CMNOTEST = 3
CMUSEABV = 2
CMUSENIBOUND = 4
CMUSEOBB = 0
CMUSETRI = 1
class Color3(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A color without alpha (red, green, blue).

b

Blue color component.

g

Green color component.

r

Red color component.

class Color4(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A color with alpha (red, green, blue, alpha).

a

Alpha.

b

Blue component.

g

Green component.

r

Red component.

class ComponentFormat(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The data format of components.

FFLOAT161 = 66097
FFLOAT162 = 131634
FFLOAT163 = 197171
FFLOAT164 = 262708
FFLOAT321 = 66613
FFLOAT322 = 132150
FFLOAT323 = 197687
FFLOAT324 = 263224
FINT161 = 66065
FINT162 = 131602
FINT163 = 197139
FINT164 = 262676
FINT321 = 66593
FINT322 = 132130
FINT323 = 197667
FINT324 = 263204
FINT81 = 65793
FINT82 = 131330
FINT83 = 196867
FINT84 = 262404
FNORMINT1010102 = 66621
FNORMINT101010L1 = 66618
FNORMINT111110 = 66619
FNORMINT161 = 66073
FNORMINT162 = 131610
FNORMINT163 = 197147
FNORMINT164 = 262684
FNORMINT321 = 66601
FNORMINT322 = 132138
FNORMINT323 = 197675
FNORMINT324 = 263212
FNORMINT81 = 65801
FNORMINT82 = 131338
FNORMINT83 = 196875
FNORMINT84 = 262412
FNORMUINT161 = 66077
FNORMUINT162 = 131614
FNORMUINT163 = 197151
FNORMUINT164 = 262688
FNORMUINT321 = 66605
FNORMUINT322 = 132142
FNORMUINT323 = 197679
FNORMUINT324 = 263216
FNORMUINT81 = 65805
FNORMUINT82 = 131342
FNORMUINT83 = 196879
FNORMUINT84 = 262416
FNORMUINT84BGRA = 262460
FUINT1010102 = 66622
FUINT101010L1 = 66617
FUINT161 = 66069
FUINT162 = 131606
FUINT163 = 197143
FUINT164 = 262680
FUINT321 = 66597
FUINT322 = 132134
FUINT323 = 197671
FUINT324 = 263208
FUINT81 = 65797
FUINT82 = 131334
FUINT83 = 196871
FUINT84 = 262408
FUNKNOWN = 0
class ConsistencyType(**kwargs)

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.

CTMUTABLE = 0
CTSTATIC = 16384
CTVOLATILE = 32768

Bases: pyffi.formats.nif._ControllerLink, object

>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.node_name_offset
-1
>>> link.set_node_name("Bip01")
>>> link.node_name_offset
0
>>> link.get_node_name()
b'Bip01'
>>> link.node_name
b'Bip01'
>>> link.set_node_name("Bip01 Tail")
>>> link.node_name_offset
6
>>> link.get_node_name()
b'Bip01 Tail'
>>> link.node_name
b'Bip01 Tail'
get_controller_type()
get_node_name()

Return the node name.

>>> # a doctest
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.string_palette = NifFormat.NiStringPalette()
>>> palette = link.string_palette.palette
>>> link.node_name_offset = palette.add_string("Bip01")
>>> link.get_node_name()
b'Bip01'
>>> # another doctest
>>> from pyffi.formats.nif import NifFormat
>>> link = NifFormat.ControllerLink()
>>> link.node_name = "Bip01"
>>> link.get_node_name()
b'Bip01'
get_property_type()
get_variable_1()
get_variable_2()
set_controller_type(text)
set_node_name(text)
set_property_type(text)
set_variable_1(text)
set_variable_2(text)
class CoordGenType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines the way that UV texture coordinates are generated.

CGDIFFUSECUBEMAP = 4
CGSPECULARCUBEMAP = 3
CGSPHEREMAP = 2
CGWORLDPARALLEL = 0
CGWORLDPERSPECTIVE = 1
class CycleType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The animation cyle behavior.

CYCLECLAMP = 2
CYCLELOOP = 0
CYCLEREVERSE = 1
class Data(version=67108866, user_version=0, user_version_2=0)

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:
  • version – The nif version.
  • user_version – The nif user version.
  • user_version_2 – The nif user version 2.
  • roots – List of root blocks.
  • header – The nif header.
  • blocks – List of blocks.
  • modification – Neo Steam (“neosteam”) or Ndoors (“ndoors”) or Joymaster Interactive Howling Sword (“jmihs1”) or Laxe Lore (“laxelore”) style nif?
class VersionUInt(**kwargs)

Bases: pyffi.object_models.common.UInt

get_detail_display()
set_value(value)
get_detail_child_names(edge_filter=(True, True))
get_detail_child_nodes(edge_filter=(True, True))
get_global_child_nodes(edge_filter=(True, True))
inspect(stream)

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.
inspect_version_only(stream)

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(stream)

Read a NIF file. Does not reset stream position.

Parameters:stream (file) – The stream from which to read.
replace_global_node(oldbranch, newbranch, edge_filter=(True, True))
user_version
user_version_2
version
write(stream)

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.
class DataStreamAccess(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

cpu_read
cpu_write_mutable
cpu_write_static
cpu_write_static_inititialized
cpu_write_volatile
gpu_read
gpu_write
class DataStreamUsage(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines how a data stream is used?

USAGESHADERCONSTANT = 2
USAGEUSER = 3
USAGEVERTEX = 1
USAGEVERTEXINDEX = 0
class DeactivatorType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

DEACTIVATORINVALID = 0
DEACTIVATORNEVER = 1
DEACTIVATORSPATIAL = 2
class DecalVectorArray(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Array of Vectors for Decal placement in BSDecalPlacementVectorExtraData.

normals

Vector Normals

num_vectors

Number of sets

points

Vector XYZ coords

class DecayType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines decay function. Used by NiPSysBombModifier.

DECAYEXPONENTIAL = 2
DECAYLINEAR = 1
DECAYNONE = 0
class DistantLODShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node.

EPSILON = 0.0001
class EffectShaderControlledColor(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing which color in BSEffectShaderProperty to animate.

EmissiveColor = 0
class EffectShaderControlledVariable(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing which float variable in BSEffectShaderProperty to animate.

AlphaTransparencyEmissivealpha = 5
EmissiveMultiple = 0
FalloffStartAngledegrees = 1
FalloffStartOpacity = 3
FalloffStopAngledegrees = 2
FalloffStopOpacity = 4
UOffset = 6
UScale = 7
VOffset = 8
VScale = 9
class EffectType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of information that’s store in a texture used by a NiTextureEffect.

EFFECTENVIRONMENTMAP = 2
EFFECTFOGMAP = 3
EFFECTPROJECTEDLIGHT = 0
EFFECTPROJECTEDSHADOW = 1
class ElementReference(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

normalize_flag

Whether or not to normalize the data.

semantic

The element semantic.

class EmitFrom(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Controls which parts of the mesh that the particles are emitted from.

EMITFROMEDGECENTER = 2
EMITFROMEDGESURFACE = 4
EMITFROMFACECENTER = 1
EMITFROMFACESURFACE = 3
EMITFROMVERTICES = 0
class EndianType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

ENDIANBIG = 0
ENDIANLITTLE = 1
class ExportInfo(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Information about how the file was exported

creator

Could be the name of the creator of the NIF file?

export_info_1

Unknown. Can be something like’TriStrip Process Script’.

export_info_2

Unknown. Possibly the selected option of the export script. Can be something like’Default Export Script’.

unknown

Probably the number of strings that follow.

class ExtraMeshDataEpicMickey(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

unknown_int_1
unknown_int_2
unknown_int_3
unknown_int_4
unknown_int_5
unknown_int_6
class ExtraMeshDataEpicMickey2(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

end
start
unknown_shorts
class ExtraVectorsFlags(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

None = 0
TangentsBitangents = 16
class FaceDrawMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

This enum lists the different face culling options.

DRAWBOTH = 3
DRAWCCW = 1
DRAWCCWORBOTH = 0
DRAWCW = 2
class Fallout3HavokMaterial(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

A material, used by havok shape objects in Fallout 3.Bit 5: flag for PLATFORM (for values 32-63 substract 32 to know material number)Bit 6: flag for STAIRS (for values 64-95 substract 64 to know material number)Bit 5+6: flag for STAIRS+PLATFORM (for values 96-127 substract 96 to know material number)

MATBABYRATTLE = 30
MATBARREL = 23
MATBOTTLE = 24
MATBOTTLECAP = 14
MATBROKENCONCRETE = 19
MATCHAIN = 13
MATCLOTH = 1
MATDIRT = 2
MATELEVATOR = 15
MATGLASS = 3
MATGRASS = 4
MATHEAVYMETAL = 11
MATHEAVYSTONE = 10
MATHEAVYWOOD = 12
MATHOLLOWMETAL = 16
MATLUNCHBOX = 29
MATMETAL = 5
MATORGANIC = 6
MATPISTOL = 26
MATRIFLE = 27
MATRUBBERBALL = 31
MATSAND = 18
MATSHEETMETAL = 17
MATSHOPPINGCART = 28
MATSKIN = 7
MATSODACAN = 25
MATSTONE = 0
MATVEHICLEBODY = 20
MATVEHICLEPARTHOLLOW = 22
MATVEHICLEPARTSOLID = 21
MATWATER = 8
MATWOOD = 9
class Fallout3Layer(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Sets mesh color in Fallout 3 GECK. Anything higher than 72 is also null.

ACOUSTICSPACE = 21
ACTORZONE = 22
ADDONARM = 71
ADDONCHEST = 70
ADDONHEAD = 69
ADDONLEG = 72
ANIMSTATIC = 2
AVOIDBOX = 31
BIPED = 29
BODY = 46
CAMERAPICK = 35
CAMERASPHERE = 33
CHAIN = 68
CHARCONTROLLER = 30
CLOUDTRAP = 16
CLUTTER = 4
COLLISIONBOX = 32
CUSTOMPICK1 = 39
CUSTOMPICK2 = 40
DEBRISLARGE = 20
DEBRISSMALL = 19
DOORDETECTION = 34
DROPPINGPICK = 42
GASTRAP = 24
GROUND = 17
HEAD = 45
INVISIBLEWALL = 27
ITEMPICK = 36
LCALF = 53
LFOOT = 54
LFOREARM = 50
LHAND = 51
LINEOFSIGHT = 37
LTHIGH = 52
LUPPERARM = 49
NONCOLLIDABLE = 15
NULL = 43
OTHER = 44
PACK = 67
PATHPICK = 38
PONYTAIL = 65
PORTAL = 18
PROJECTILE = 6
PROJECTILEZONE = 23
PROPS = 10
QUIVER = 63
RCALF = 59
RFOOT = 60
RFOREARM = 56
RHAND = 57
RTHIGH = 58
RUPPERARM = 55
SHELLCASING = 25
SHIELD = 62
SPELL = 7
SPELLEXPLOSION = 41
SPINE1 = 47
SPINE2 = 48
STATIC = 1
TAIL = 61
TERRAIN = 13
TRANSPARENT = 3
TRANSPARENTSMALL = 26
TRANSPARENTSMALLANIM = 28
TRAP = 14
TREES = 9
TRIGGER = 12
UNIDENTIFIED = 0
WATER = 11
WEAPON = 64
WING = 66
class FieldType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The force field’s type.

FIELDPOINT = 1
FIELDWIND = 0
class FilePath(**kwargs)

Bases: pyffi.formats.nif.string

A file path.

get_hash(data=None)

Returns a case insensitive hash value.

class FileVersion(**kwargs)

Bases: pyffi.object_models.common.UInt

get_detail_display()
read(stream, data)
set_value()
write(stream, data)
class Flags(**kwargs)

Bases: pyffi.object_models.common.UShort

class Footer(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Footer, object

read(stream, data)
write(stream, data)
class ForceType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of force? May be more valid values.

FORCEPLANAR = 0
FORCESPHERICAL = 1
FORCEUNKNOWN = 2
class FurnitureEntryPoints(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

behind
front
left
right
up
class FurniturePosition(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Describes a furniture position?

animation_type

Unknown

entry_properties

Unknown/unused in nif?

heading

Similar to Orientation, in float form.

offset

Offset of furniture marker.

orientation

Furniture marker orientation.

position_ref_1

Refers to a furnituremarkerxx.nif file. Always seems to be the same as Position Ref 2.

position_ref_2

Refers to a furnituremarkerxx.nif file. Always seems to be the same as Position Ref 1.

class FxButton(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.FxWidget

Unknown.

class FxRadioButton(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.FxWidget

Unknown.

buttons

Unknown pointers to other buttons. Maybe other buttons in a group so they can be switch off if this one is switched on?

num_buttons

Number of unknown links.

unknown_int_1

Unknown.

unknown_int_2

Unknown.

unknown_int_3

Unknown.

class FxWidget(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Firaxis-specific UI widgets?

unknown_292_bytes

Looks like 9 links and some string data.

unknown_3

Unknown.

class HairShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node.

class HalfSpaceBV(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

center

Center

normal

Normal

unknown_float_1

Unknown.

class HavokColFilter(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

ColFilter property for Havok. It contains Layer, Flags and Part Number

flags_and_part_number

**FLAGS are stored in highest 3 bits* – Bit 7* – sets the LINK property and controls whether this body is physically linked to others.Bit 6: turns collision off (not used for Layer BIPED).Bit 5: sets the SCALED property.PART NUMBER is stored in bits 0-4. Used only when Layer is set to BIPED.Part Numbers for Oblivion, Fallout 3, Skyrim:0 - OTHER1 - HEAD2 - BODY3 - SPINE14 - SPINE25 - LUPPERARM6 - LFOREARM7 - LHAND8 - LTHIGH9 - LCALF10 - LFOOT11 - RUPPERARM12 - RFOREARM13 - RHAND14 - RTHIGH15 - RCALF16 - RFOOT17 - TAIL18 - SHIELD19 - QUIVER20 - WEAPON21 - PONYTAIL22 - WING23 - PACK24 - CHAIN25 - ADDONHEAD26 - ADDONCHEST27 - ADDONARM28 - ADDONLEG29-31 - NULL

layer

Physical purpose of collision object? The setting affects object’s havok behavior in game.

unknown_short

Unknown.

class HavokMaterial(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

material

The material of the shape.

class Header(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Header, object

has_block_type(block_type)

Check if header has a particular block type.

Raises:ValueError – If number of block types is zero (only nif versions 10.0.1.0 and up store block types in header).
Parameters:block_type (L{NifFormat.NiObject}) – The block type.
Returns:True if the header’s list of block types has the given block type, or a subclass of it. False otherwise.
Return type:bool
class HeaderString(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.basic.BasicBase

get_detail_display()
get_hash(data=None)
get_size(data=None)
read(stream, data)
static version_string(version, modification=None)

Transforms version number into a version string.

>>> NifFormat.HeaderString.version_string(0x03000300)
'NetImmerse File Format, Version 3.03'
>>> NifFormat.HeaderString.version_string(0x03010000)
'NetImmerse File Format, Version 3.1'
>>> NifFormat.HeaderString.version_string(0x0A000100)
'NetImmerse File Format, Version 10.0.1.0'
>>> NifFormat.HeaderString.version_string(0x0A010000)
'Gamebryo File Format, Version 10.1.0.0'
>>> NifFormat.HeaderString.version_string(0x0A010000,
...                                       modification="neosteam")
'NS'
>>> NifFormat.HeaderString.version_string(0x14020008,
...                                       modification="ndoors")
'NDSNIF....@....@...., Version 20.2.0.8'
>>> NifFormat.HeaderString.version_string(0x14030009,
...                                       modification="jmihs1")
'Joymaster HS1 Object Format - (JMI), Version 20.3.0.9'
write(stream, data)
class HingeDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

This constraint allows rotation about a specified axis.

axle_a

Axis of rotation.

axle_b

Axle A in second entity coordinate system.

perp_2_axle_in_a_1

Vector in the rotation plane which defines the zero angle.

perp_2_axle_in_a_2

Vector in the rotation plane, orthogonal on the previous one, which defines the positive direction of rotation. This is always the vector product of Axle A and Perp2 Axle In A1.

perp_2_axle_in_b_1

Perp2 Axle In A1 in second entity coordinate system.

perp_2_axle_in_b_2

Perp2 Axle In A2 in second entity coordinate system.

pivot_a

Pivot point around which the object will rotate.

pivot_b

Pivot A in second entity coordinate system.

class ImageType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines how the raw image data is stored in NiRawImageData.

RGB = 1
RGBA = 2
class InertiaMatrix(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._InertiaMatrix, object

as_list()

Return matrix as 3x3 list.

as_tuple()

Return matrix as 3x3 tuple.

get_copy()

Return a copy of the matrix.

is_identity()

Return True if the matrix is close to identity.

set_identity()

Set to identity matrix.

class Key(template=None, argument=None, parent=None)

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.

backward

The key backward tangent.

forward

Key forward tangent.

tbc

The key’s TBC.

time

Time of the key.

value

The key value.

class KeyGroup(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Array of vector keys (anything that can be interpolated, except rotations).

interpolation

The key type.

keys

The keys.

num_keys

Number of keys in the array.

class KeyType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of animation interpolation (blending) that will be used on the associated key frames.

CONSTKEY = 5
LINEARKEY = 1
QUADRATICKEY = 2
TBCKEY = 3
XYZROTATIONKEY = 4
class LODRange(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

The distance range where a specific level of detail applies.

far_extent

End of Range.

near_extent

Begining of range.

unknown_ints

Unknown (0,0,0).

class LightMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing how vertex colors influence lighting.

LIGHTMODEEMIAMBDIF = 1
LIGHTMODEEMISSIVE = 0
class Lighting30ShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderPPLightingProperty

Bethesda-specific node.

class LightingShaderControlledColor(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing which color in BSLightingShaderProperty to animate.

EmissiveColor = 1
SpecularColor = 0
class LightingShaderControlledVariable(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing which float variable in BSLightingShaderProperty to animate.

Alpha = 12
EmissiveMultiple = 11
EnvironmentMapScale = 8
Glossiness = 9
RefractionStrength = 0
SpecularStrength = 10
UOffset = 20
UScale = 21
VOffset = 22
VScale = 23
class LimitedHingeDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._LimitedHingeDescriptor, object

update_a_b(transform)

Update B pivot and axes from A using the given transform.

class LineString(**kwargs)

Bases: pyffi.object_models.xml.basic.BasicBase

Basic type for strings ending in a newline character (0x0a).

>>> from tempfile import TemporaryFile
>>> f = TemporaryFile()
>>> l = NifFormat.LineString()
>>> f.write('abcdefg\x0a'.encode())
8
>>> f.seek(0)
0
>>> l.read(f)
>>> str(l)
'abcdefg'
>>> f.seek(0)
0
>>> l.set_value('Hi There')
>>> l.write(f)
>>> f.seek(0)
0
>>> m = NifFormat.LineString()
>>> m.read(f)
>>> str(m)
'Hi There'
get_hash(data=None)
get_size(data=None)
get_value()
read(stream, data=None)
set_value(value)
write(stream, data=None)
class MTransform(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

rotation

Rotation.

scale

Scale.

translation

Translation.

class MatchGroup(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Group of vertex indices of vertices that match.

num_vertices

Number of vertices in this group.

vertex_indices

The vertex indices.

class MaterialData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Data stored per-material by NiRenderObject

material_extra_data

Extra data associated with the material?

material_name

The name of the material.

class Matrix22(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A 2x2 matrix of float values. Stored in OpenGL column-major format.

m_11

Member 1,1 (top left)

m_12

Member 1,2 (top right)

m_21

Member 2,1 (bottom left)

m_22

Member 2,2 (bottom right)

class Matrix33(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Matrix33, object

as_list()

Return matrix as 3x3 list.

as_tuple()

Return matrix as 3x3 tuple.

get_copy()

Return a copy of the matrix.

get_determinant()

Return determinant.

get_inverse()

Get inverse (assuming is_scale_rotation is true!).

get_scale()

Gets the scale (assuming is_scale_rotation is true!).

get_scale_quat()

Decompose matrix into scale and quaternion.

get_scale_rotation()

Decompose the matrix into scale and rotation, where scale is a float and rotation is a C{Matrix33}. Returns a pair (scale, rotation).

get_transpose()

Get transposed of the matrix.

is_identity()

Return True if the matrix is close to identity.

is_rotation()

Returns True if the matrix is a rotation matrix (a member of SO(3)).

is_scale_rotation()

Returns true if the matrix decomposes nicely into scale * rotation.

set_identity()

Set to identity matrix.

set_scale_rotation(scale, rotation)

Compose the matrix as the product of scale * rotation.

sup_norm()

Calculate supremum norm of matrix (maximum absolute value of all entries).

class Matrix44(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Matrix44, object

as_list()

Return matrix as 4x4 list.

as_tuple()

Return matrix as 4x4 tuple.

get_copy()

Create a copy of the matrix.

get_inverse(fast=True)

Calculates inverse (fast assumes is_scale_rotation_translation is True).

get_matrix_33()

Returns upper left 3x3 part.

get_scale_quat_translation()
get_scale_rotation_translation()
get_translation()

Returns lower left 1x3 part.

is_identity()

Return True if the matrix is close to identity.

is_scale_rotation_translation()
set_identity()

Set to identity matrix.

set_matrix_33(m)

Sets upper left 3x3 part.

set_rows(row0, row1, row2, row3)

Set matrix from rows.

set_scale_rotation_translation(scale, rotation, translation)
set_translation(translation)

Returns lower left 1x3 part.

sup_norm()

Calculate supremum norm of matrix (maximum absolute value of all entries).

class MeshData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

component_semantics

Describes the semantic of each component.

is_per_instance

Sets whether this stream data is per-instance data for use inhardware instancing.

num_components
num_submeshes

The number of submesh-to-region mappings that this data streamhas.

stream

Reference to a data stream object which holds the data used bythis reference.

submesh_to_region_map

A lookup table that maps submeshes to regions.

class MeshPrimitiveType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Describes the type of primitives stored in a mesh object.

MESHPRIMITIVELINESTRIPS = 2
MESHPRIMITIVEPOINTS = 4
MESHPRIMITIVEQUADS = 3
MESHPRIMITIVETRIANGLES = 0
MESHPRIMITIVETRISTRIPS = 1
class MipMap(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Description of a MipMap within a NiPixelData object.

height

Height of the mipmap image.

offset

Offset into the pixel data array where this mipmap starts.

width

Width of the mipmap image.

class MipMapFormat(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing how mipmaps are handled in a texture.

MIPFMTDEFAULT = 2
MIPFMTNO = 0
MIPFMTYES = 1
class MoppDataBuildType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

A byte describing if MOPP Data is organized into chunks (PS3) or not (PC)

BUILDNOTSET = 2
BUILTWITHCHUNKSUBDIVISION = 0
BUILTWITHOUTCHUNKSUBDIVISION = 1
class Morph(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Geometry morphing data component.

frame_name

Name of the frame.

interpolation

Unlike most objects, the presense of this value is not conditional on there being keys.

keys

The morph key frames.

num_keys

The number of morph keys that follow.

unknown_int

Unknown.

vectors

Morph vectors.

class MorphWeight(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

interpolator

Interpolator

weight

Weight

class MotionQuality(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The motion type. Determines quality of motion?

MOQUALBULLET = 6
MOQUALCHARACTER = 8
MOQUALCRITICAL = 5
MOQUALDEBRIS = 3
MOQUALFIXED = 1
MOQUALINVALID = 0
MOQUALKEYFRAMED = 2
MOQUALKEYFRAMEDREPORT = 9
MOQUALMOVING = 4
MOQUALUSER = 7
class MotionSystem(**kwargs)

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.

MOSYSBOX = 4
MOSYSBOXSTABILIZED = 5
MOSYSCHARACTER = 9
MOSYSDYNAMIC = 1
MOSYSFIXED = 7
MOSYSINVALID = 0
MOSYSKEYFRAMED = 6
MOSYSSPHERE = 2
MOSYSSPHEREINERTIA = 3
MOSYSTHINBOX = 8
class MotorDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

unknown_byte_1

Unknown

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_float_4

Unknown

unknown_float_5

Unknown

unknown_float_6

Unknown

class MultiTextureElement(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

clamp

May be texture clamp mode.

filter

May be texture filter mode.

has_image

Looks like a memory address, so probably a bool.

image

Link to the texture image.

ps_2_k

-75?

ps_2_l

0?

unknown_short_3

Unknown. Usually 0 but sometimes 257

uv_set

This may be the UV set counting from 1 instead of zero.

class Ni3dsAlphaAnimator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown.

num_1

Unknown.

num_2

Unknown.

parent

The parent?

unknown_1

Unknown.

unknown_2

Unknown.

class Ni3dsAnimationNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown. Only found in 2.3 nifs.

child

Child?

count

A count.

has_data

Unknown.

name

Name of this object.

unknown_array

Unknown.

unknown_floats_1

Unknown. Matrix?

unknown_floats_2

Unknown.

unknown_short

Unknown.

class Ni3dsColorAnimator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown!

unknown_1

Unknown.

class Ni3dsMorphShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown!

unknown_1

Unknown.

class Ni3dsParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown!

unknown_1

Unknown.

class Ni3dsPathController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown!

unknown_1

Unknown.

class NiAVObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiAVObject, object

>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> prop1 = NifFormat.NiProperty()
>>> prop1.name = "hello"
>>> prop2 = NifFormat.NiProperty()
>>> prop2.name = "world"
>>> node.get_properties()
[]
>>> node.set_properties([prop1, prop2])
>>> [prop.name for prop in node.get_properties()]
[b'hello', b'world']
>>> [prop.name for prop in node.properties]
[b'hello', b'world']
>>> node.set_properties([])
>>> node.get_properties()
[]
>>> # now set them the other way around
>>> node.set_properties([prop2, prop1])
>>> [prop.name for prop in node.get_properties()]
[b'world', b'hello']
>>> [prop.name for prop in node.properties]
[b'world', b'hello']
>>> node.remove_property(prop2)
>>> [prop.name for prop in node.properties]
[b'hello']
>>> node.add_property(prop2)
>>> [prop.name for prop in node.properties]
[b'hello', b'world']
add_property(prop)

Add the given property to the property list.

Parameters:prop (L{NifFormat.NiProperty}) – The property block to add.
apply_scale(scale)

Apply scale factor on data.

Parameters:scale – The scale factor.
get_properties()

Return a list of the properties of the block.

Returns:The list of properties.
Return type:list of L{NifFormat.NiProperty}
get_transform(relative_to=None)

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_property(prop)

Remove the given property to the property list.

Parameters:prop (L{NifFormat.NiProperty}) – The property block to remove.
set_properties(proplist)

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_transform(m)

Set rotation, translation, and scale, from a 4x4 matrix.

Parameters:m – The matrix to which the transform should be set.
class NiAVObjectPalette(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown.

class NiAdditionalGeometryData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.AbstractAdditionalGeometryData

block_infos

Number of additional data blocks

blocks

Number of additional data blocks

num_block_infos

Information about additional data blocks

num_blocks

Number of additional data blocks

num_vertices

Number of vertices

class NiAlphaController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Time controller for transparency.

data

Alpha controller data index.

class NiAlphaProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Transparency. Flags 0x00ED.

flags

**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

Threshold for alpha testing (see – glAlphaFunc)

unknown_int_2

Unknown

unknown_short_1

Unknown

class NiAmbientLight(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiLight

Ambient light source.

class NiArkAnimationExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown node.

unknown_bytes
unknown_ints
class NiArkImporterExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown node.

importer_name

Contains a string like”Gamebryo_1_1”or”4.1.0.12”

unknown_bytes
unknown_floats
unknown_int_1
unknown_int_2
class NiArkShaderExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown node.

unknown_int
unknown_string
class NiArkTextureExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown node.

num_textures
textures
unknown_byte
unknown_int_2
unknown_ints_1
class NiArkViewportInfoExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown node.

unknown_bytes
class NiAutoNormalParticles(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticles

Unknown.

class NiAutoNormalParticlesData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticlesData

Particle system data object (with automatic normals?).

class NiBSAnimationNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Bethesda-specific extension of Node with animation properties stored in the flags, often 42?

class NiBSBoneLODController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBoneLODController

A simple LOD controller for bones.

class NiBSPArrayController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleSystemController

A particle system controller, used by BS in conjunction with NiBSParticleNode.

class NiBSParticleNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Unknown.

class NiBSplineBasisData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Stores the number of control points of a B-spline.

num_control_points

The number of control points of the B-spline (number of frames of animation plus degree of B-spline minus one).

class NiBSplineCompFloatInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBSplineFloatInterpolator

Unknown.

base

Base value when curve not defined.

bias

Bias

multiplier

Multiplier

offset

Starting offset for the data. (USHRT_MAX for no data.)

class NiBSplineCompPoint3Interpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBSplinePoint3Interpolator

Unknown.

class NiBSplineCompTransformEvaluator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class NiBSplineCompTransformInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiBSplineCompTransformInterpolator, object

apply_scale(scale)

Apply scale factor on data.

get_rotations()

Return an iterator over all rotation keys.

get_scales()

Return an iterator over all scale keys.

get_translations()

Return an iterator over all translation keys.

class NiBSplineData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiBSplineData, object

>>> # a doctest
>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiBSplineData()
>>> block.num_short_control_points = 50
>>> block.short_control_points.update_size()
>>> for i in range(block.num_short_control_points):
...     block.short_control_points[i] = 20 - i
>>> list(block.get_short_data(12, 4, 3))
[(8, 7, 6), (5, 4, 3), (2, 1, 0), (-1, -2, -3)]
>>> offset = block.append_short_data([(1,2),(4,3),(13,14),(8,2),(33,33)])
>>> offset
50
>>> list(block.get_short_data(offset, 5, 2))
[(1, 2), (4, 3), (13, 14), (8, 2), (33, 33)]
>>> list(block.get_comp_data(offset, 5, 2, 10.0, 32767.0))
[(11.0, 12.0), (14.0, 13.0), (23.0, 24.0), (18.0, 12.0), (43.0, 43.0)]
>>> block.append_float_data([(1.0,2.0),(3.0,4.0),(0.5,0.25)])
0
>>> list(block.get_float_data(0, 3, 2))
[(1.0, 2.0), (3.0, 4.0), (0.5, 0.25)]
>>> block.append_comp_data([(1,2),(4,3)])
(60, 2.5, 1.5)
>>> list(block.get_short_data(60, 2, 2))
[(-32767, -10922), (32767, 10922)]
>>> list(block.get_comp_data(60, 2, 2, 2.5, 1.5)) 
[(1.0, 2.00...), (4.0, 2.99...)]
append_comp_data(data)

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_float_data(data)

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_short_data(data)

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_comp_data(offset, num_elements, element_size, bias, multiplier)

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:
  • offset – The offset in the data where to start.
  • num_elements – Number of elements to get.
  • element_size – Size of a single element.
  • bias – Value bias.
  • multiplier – Value multiplier.
Returns:

A list of C{num_elements} tuples of size C{element_size}.

get_float_data(offset, num_elements, element_size)

Get an iterator to the data.

Parameters:
  • offset – The offset in the data where to start.
  • num_elements – Number of elements to get.
  • element_size – Size of a single element.
Returns:

A list of C{num_elements} tuples of size C{element_size}.

get_short_data(offset, num_elements, element_size)

Get an iterator to the data.

Parameters:
  • offset – The offset in the data where to start.
  • num_elements – Number of elements to get.
  • element_size – Size of a single element.
Returns:

A list of C{num_elements} tuples of size C{element_size}.

class NiBSplineFloatInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBSplineInterpolator

Unknown.

class NiBSplineInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiBSplineInterpolator, object

get_times()

Return an iterator over all key times.

@todo: When code for calculating the bsplines is ready, this function will return exactly self.basis_data.num_control_points - 1 time points, and not self.basis_data.num_control_points as it is now.

class NiBSplinePoint3Interpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBSplineInterpolator

Unknown.

unknown_floats

Unknown.

class NiBSplineTransformInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiBSplineTransformInterpolator, object

apply_scale(scale)

Apply scale factor on data.

get_rotations()

Return an iterator over all rotation keys.

get_scales()

Return an iterator over all scale keys.

get_translations()

Return an iterator over all translation keys.

class NiBezierMesh(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

Unknown

bezier_triangle

unknown

count_1

Data count.

count_2

data count 2.

data_2

data count.

num_bezier_triangles

references.

points_1

data.

points_2

data.

unknown_3

Unknown.

unknown_4

Unknown.

unknown_5

Unknown (illegal link?).

unknown_6

unknown

class NiBezierTriangle4(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Sub data of NiBezierMesh

matrix

unknown

unknown_1

unknown

unknown_2

unknown

unknown_3

unknown

unknown_4

unknown

unknown_5

unknown

unknown_6

unknown

vector_1

unknown

vector_2

unknown

class NiBillboardNode(template=None, argument=None, parent=None)

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

billboard_mode

The way the billboard will react to the camera.

class NiBinaryExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Binary extra data object. Used to store tangents and bitangents in Oblivion.

binary_data

The binary data.

class NiBinaryVoxelData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Voxel data object.

num_unknown_bytes_2

Unknown.

num_unknown_vectors

Unknown.

unknown_5_ints

Unknown.

unknown_7_floats

Unknown.

unknown_bytes_1

Unknown. Always a multiple of 7.

unknown_bytes_2

Unknown.

unknown_short_1

Unknown.

unknown_short_2

Unknown.

unknown_short_3

Unknown. Is this^3 the Unknown Bytes 1 size?

unknown_vectors

Vectors on the unit sphere.

class NiBinaryVoxelExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Voxel extra data object.

data

Link to binary voxel data.

unknown_int

Unknown. 0?

class NiBlendBoolInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBlendInterpolator

An interpolator for a bool.

bool_value

The interpolated bool?

class NiBlendFloatInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBlendInterpolator

An interpolator for a float.

float_value

The interpolated float?

class NiBlendInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpolator

An extended type of interpolater.

unknown_int

Unknown.

unknown_short

Unknown.

class NiBlendPoint3Interpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBlendInterpolator

Interpolates a point?

point_value

The interpolated point?

class NiBlendTransformInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBlendInterpolator

Unknown.

class NiBone(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

A NiNode used as a skeleton bone?

class NiBoneLODController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Level of detail controller for bones. Priority is arranged from low to high.

node_groups

A list of node groups (each group a sequence of bones).

num_node_groups

Number of node groups.

num_node_groups_2

Number of node groups.

num_shape_groups

Number of shape groups.

num_shape_groups_2

The size of the second list of shape groups.

shape_groups_1

List of shape groups.

shape_groups_2

Group of NiTriShape indices.

unknown_int_1

Unknown.

unknown_int_2

Unknown.

unknown_int_3

Unknown.

class NiBoolData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Timed boolean data.

data

The boolean keys.

class NiBoolInterpController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

A controller that interpolates floating point numbers?

class NiBoolInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyBasedInterpolator

Unknown.

bool_value

Value when posed? At time 0?

data

Refers to a NiBoolData object.

class NiBoolTimelineInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBoolInterpolator

Unknown.

class NiBooleanExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Boolean extra data.

boolean_data

The boolean extra data value.

class NiCamera(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

Camera object.

frustum_bottom

Frustrum bottom.

frustum_far

Frustrum far.

frustum_left

Frustrum left.

frustum_near

Frustrum near.

frustum_right

Frustrum right.

frustum_top

Frustrum top.

lod_adjust

Level of detail adjust.

unknown_int

Unknown. Changing value crashes viewer.

unknown_int_2

Unknown. Changing value crashes viewer.

unknown_int_3

Unknown.

Unknown.

unknown_short

Unknown.

use_orthographic_projection

Determines whether perspective is used. Orthographic means no perspective.

viewport_bottom

Viewport bottom.

viewport_left

Viewport left.

viewport_right

Viewport right.

viewport_top

Viewport top.

class NiClod(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriBasedGeom

A shape node that holds continuous level of detail information.Seems to be specific to Freedom Force.

class NiClodData(template=None, argument=None, parent=None)

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.

unknown_clod_shorts_1
unknown_clod_shorts_2
unknown_clod_shorts_3
unknown_count_1
unknown_count_2
unknown_count_3
unknown_float
unknown_short
unknown_shorts
class NiClodSkinInstance(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSkinInstance

A copy of NISkinInstance for use with NiClod meshes.

class NiCollisionData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiCollisionObject

Collision box.

bounding_volume

Collision data.

collision_mode

Collision Mode

propagation_mode

Propagation Mode

use_abv

Use Alternate Bounding Volume.

class NiCollisionObject(template=None, argument=None, parent=None)

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.

target

Index of the AV object referring to this collision object.

class NiColorData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Color data for material color controller.

data

The color keys.

class NiColorExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown.

data

RGBA Color?

class NiControllerManager(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Unknown. Root of all controllers?

controller_sequences

Refers to a list of NiControllerSequence object.

cumulative

Designates whether animation sequences are cumulative?

num_controller_sequences

The number of controller sequence objects.

object_palette

Refers to a NiDefaultAVObjectPalette.

class NiControllerSequence(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiControllerSequence, object

add_controlled_block()

Create new controlled block, and return it.

>>> seq = NifFormat.NiControllerSequence()
>>> seq.num_controlled_blocks
0
>>> ctrlblock = seq.add_controlled_block()
>>> seq.num_controlled_blocks
1
>>> isinstance(ctrlblock, NifFormat.ControllerLink)
True
class NiDataStream(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

access
cloning_behavior
component_formats

The format of each component in this data stream.

data
num_bytes

The size in bytes of this data stream.

num_components

Number of components of the data (matches corresponding field in MeshData).

num_regions

Number of regions (such as submeshes).

regions

The regions in the mesh. Regions can be used to mark off submeshes which are independent draw calls.

streamable
usage
class NiDefaultAVObjectPalette(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObjectPalette

Unknown. Refers to a list of objects. Used by NiControllerManager.

num_objs

Number of objects.

objs

The objects.

unknown_int

Unknown.

class NiDirectionalLight(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiLight

Directional light source.

class NiDitherProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Unknown.

flags

1’s Bit – Enable dithering

class NiDynamicEffect(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

A dynamic effect such as a light or environment map.

affected_node_list_pointers

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.

affected_nodes

The list of affected nodes?

num_affected_node_list_pointers

The number of affected nodes referenced.

num_affected_nodes

The number of affected nodes referenced.

switch_state

Turns effect on and off? Switches list to list of unaffected nodes?

class NiEnvMappedTriShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObjectNET

Unknown

child_2

unknown

child_3

unknown

children

List of child node object indices.

num_children

The number of child objects.

unknown_1

unknown (=4 - 5)

unknown_matrix

unknown

class NiEnvMappedTriShapeData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriShapeData

Holds mesh data using a list of singular triangles.

class NiExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

A generic extra data object.

name

Name of this object.

next_extra_data

Block number of the next extra data object.

class NiExtraDataController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

An controller for extra data.

class NiFlipController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Texture flipping controller.

delta

Time between two flips.delta = (start_time - stop_time) / sources.num_indices

images

The image sources

num_sources

The number of source objects.

sources

The texture sources.

texture_slot

Target texture slot (0=base, 4=glow).

unknown_int_2

0?

class NiFloatData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Possibly the 1D position along a 3D path.

data

The keys.

class NiFloatExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Float extra data.

float_data

The float data.

class NiFloatExtraDataController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraDataController

Unknown.

controller_data

Refers to a NiFloatExtraData name.

num_extra_bytes

Number of extra bytes.

unknown_bytes

Unknown.

unknown_extra_bytes

Unknown.

class NiFloatInterpController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

A controller that interpolates floating point numbers?

class NiFloatInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyBasedInterpolator

Unknown.

data

Float data?

float_value

Value when posed? At time 0?

class NiFloatsExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Unknown.

data

Float data.

num_floats

Number of floats in the next field.

class NiFogProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Describes… fog?

flags

**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.

fog_color

The color of the fog.

fog_depth

The thickness of the fog? Default is 1.0

class NiFurSpringController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

bones

List of all armature bones.

bones_2

List of all armature bones.

num_bones

The number of node bones referenced as influences.

num_bones_2

The number of node bones referenced as influences.

unknown_float
unknown_float_2
class NiGeomMorpherController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

Time controller for geometry morphing.

always_update

Always Update

data

Geometry morphing data index.

extra_flags

Unknown.

interpolator_weights

Weighted Interpolators?

interpolators

List of interpolators.

num_interpolators

The number of interpolator objects.

num_unknown_ints

A count.

unknown_2

Unknown.

unknown_ints

Unknown.

class NiGeometry(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiGeometry, object

>>> from pyffi.formats.nif import NifFormat
>>> id44 = NifFormat.Matrix44()
>>> id44.set_identity()
>>> skelroot = NifFormat.NiNode()
>>> skelroot.name = 'skelroot'
>>> skelroot.set_transform(id44)
>>> bone1 = NifFormat.NiNode()
>>> bone1.name = 'bone1'
>>> bone1.set_transform(id44)
>>> bone2 = NifFormat.NiNode()
>>> bone2.name = 'bone2'
>>> bone2.set_transform(id44)
>>> bone21 = NifFormat.NiNode()
>>> bone21.name = 'bone21'
>>> bone21.set_transform(id44)
>>> bone22 = NifFormat.NiNode()
>>> bone22.name = 'bone22'
>>> bone22.set_transform(id44)
>>> bone211 = NifFormat.NiNode()
>>> bone211.name = 'bone211'
>>> bone211.set_transform(id44)
>>> skelroot.add_child(bone1)
>>> bone1.add_child(bone2)
>>> bone2.add_child(bone21)
>>> bone2.add_child(bone22)
>>> bone21.add_child(bone211)
>>> geom = NifFormat.NiTriShape()
>>> geom.name = 'geom'
>>> geom.set_transform(id44)
>>> geomdata = NifFormat.NiTriShapeData()
>>> skininst = NifFormat.NiSkinInstance()
>>> skindata = NifFormat.NiSkinData()
>>> skelroot.add_child(geom)
>>> geom.data = geomdata
>>> geom.skin_instance = skininst
>>> skininst.skeleton_root = skelroot
>>> skininst.data = skindata
>>> skininst.num_bones = 4
>>> skininst.bones.update_size()
>>> skininst.bones[0] = bone1
>>> skininst.bones[1] = bone2
>>> skininst.bones[2] = bone22
>>> skininst.bones[3] = bone211
>>> skindata.num_bones = 4
>>> skindata.bone_list.update_size()
>>> [child.name for child in skelroot.children]
[b'bone1', b'geom']
>>> skindata.set_transform(id44)
>>> for bonedata in skindata.bone_list:
...     bonedata.set_transform(id44)
>>> affectedbones = geom.flatten_skin()
>>> [bone.name for bone in affectedbones]
[b'bone1', b'bone2', b'bone22', b'bone211']
>>> [child.name for child in skelroot.children]
[b'geom', b'bone1', b'bone21', b'bone2', b'bone22', b'bone211']
add_bone(bone, vert_weights)

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:
  • bone – The bone NiNode block.
  • vert_weights – A dictionary mapping each influenced vertex index to a vertex weight.
flatten_skin()

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.

get_skin_deformation()

Returns a list of vertices and normals in their final position after skinning, in geometry space.

get_skin_partition()

Return the skin partition block.

get_vertex_weights()

Get vertex weights in a convenient format: list bone and weight per vertex.

is_skin()

Returns True if geometry is skinned.

send_bones_to_bind_position()

Send all bones to their bind position.

@deprecated: Use L{NifFormat.NiNode.send_bones_to_bind_position} instead of
this function.
set_skin_partition(skinpart)

Set skin partition block.

update_bind_position()

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.

class NiGeometryData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiGeometryData, object

>>> from pyffi.formats.nif import NifFormat
>>> geomdata = NifFormat.NiGeometryData()
>>> geomdata.num_vertices = 3
>>> geomdata.has_vertices = True
>>> geomdata.has_normals = True
>>> geomdata.has_vertex_colors = True
>>> geomdata.num_uv_sets = 2
>>> geomdata.vertices.update_size()
>>> geomdata.normals.update_size()
>>> geomdata.vertex_colors.update_size()
>>> geomdata.uv_sets.update_size()
>>> geomdata.vertices[0].x = 1
>>> geomdata.vertices[0].y = 2
>>> geomdata.vertices[0].z = 3
>>> geomdata.vertices[1].x = 4
>>> geomdata.vertices[1].y = 5
>>> geomdata.vertices[1].z = 6
>>> geomdata.vertices[2].x = 1.200001
>>> geomdata.vertices[2].y = 3.400001
>>> geomdata.vertices[2].z = 5.600001
>>> geomdata.normals[0].x = 0
>>> geomdata.normals[0].y = 0
>>> geomdata.normals[0].z = 1
>>> geomdata.normals[1].x = 0
>>> geomdata.normals[1].y = 1
>>> geomdata.normals[1].z = 0
>>> geomdata.normals[2].x = 1
>>> geomdata.normals[2].y = 0
>>> geomdata.normals[2].z = 0
>>> geomdata.vertex_colors[1].r = 0.310001
>>> geomdata.vertex_colors[1].g = 0.320001
>>> geomdata.vertex_colors[1].b = 0.330001
>>> geomdata.vertex_colors[1].a = 0.340001
>>> geomdata.uv_sets[0][0].u = 0.990001
>>> geomdata.uv_sets[0][0].v = 0.980001
>>> geomdata.uv_sets[0][2].u = 0.970001
>>> geomdata.uv_sets[0][2].v = 0.960001
>>> geomdata.uv_sets[1][0].v = 0.910001
>>> geomdata.uv_sets[1][0].v = 0.920001
>>> geomdata.uv_sets[1][2].v = 0.930001
>>> geomdata.uv_sets[1][2].v = 0.940001
>>> for h in geomdata.get_vertex_hash_generator():
...     print(h)
(1000, 2000, 3000, 0, 0, 1000, 99000, 98000, 0, 92000, 0, 0, 0, 0)
(4000, 5000, 6000, 0, 1000, 0, 0, 0, 0, 0, 310, 320, 330, 340)
(1200, 3400, 5600, 1000, 0, 0, 97000, 96000, 0, 94000, 0, 0, 0, 0)
apply_scale(scale)

Apply scale factor on data.

get_vertex_hash_generator(vertexprecision=3, normalprecision=3, uvprecision=5, vcolprecision=3)

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:
  • vertexprecision (float) – Precision to be used for vertices.
  • normalprecision (float) – Precision to be used for normals.
  • uvprecision (float) – Precision to be used for uvs.
  • vcolprecision (float) – Precision to be used for vertex colors.
Returns:

A generator yielding a hash value for each vertex.

update_center_radius()

Recalculate center and radius of the data.

class NiGravity(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

A particle modifier; applies a gravitational field on the particles.

direction

The direction of the applied acceleration.

force

The strength/force of this gravity.

position

The position of the mass point relative to the particle system. (TODO – check for versions<= 3.1)

type

The force field’s type.

unknown_float_1

Unknown.

class NiImage(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

file_name

The filepath to the texture.

image_data

Link to the internally stored image data.

unknown_float

Unknown. Perhaps fImageScale?

unknown_int

Unknown. Often seems to be 7. Perhaps m_uiMipLevels?

use_external

0 if the texture is internal to the NIF file.

class NiInstancingMeshModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiMeshModifier

class NiIntegerExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Extra integer data.

integer_data

The value of the extra data.

class NiIntegersExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Integers data.

data

Integers.

num_integers

Number of integers.

class NiInterpController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

A controller capable of interpolation?

class NiInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Interpolator objects - function unknown.

class NiKeyBasedInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpolator

Interpolator objects that use keys?

class NiKeyframeController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

A time controller object for animation key frames.

data

Keyframe controller data index.

class NiKeyframeData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiKeyframeData, object

apply_scale(scale)

Apply scale factor on data.

class NiLODData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Abstract class used for different types of LOD selections.

class NiLODNode(template=None, argument=None, parent=None)

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.

lod_center

Point to calculate distance from for switching?

lod_level_data

Refers to LOD level information, either distance or screen size based.

lod_levels

The ranges of distance that each level of detail applies in.

num_lod_levels

Number of levels of detail.

class NiLight(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiDynamicEffect

Light source.

ambient_color

Ambient color.

diffuse_color

Diffuse color.

dimmer

Dimmer.

specular_color

Specular color.

class NiLightColorController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPoint3InterpController

Light color animation controller.

class NiLightDimmerController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Unknown controller.

class NiLightIntensityController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Unknown controller

class NiLines(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriBasedGeom

Wireframe geometry.

class NiLinesData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiGeometryData

Wireframe geometry data.

lines

Is vertex connected to other (next?) vertex?

class NiLookAtController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Unknown. Start time is 3.4e+38 and stop time is -3.4e+38.

look_at_node

Link to the node to look at?

unknown_1

Unknown.

class NiLookAtInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpolator

Unknown.

look_at

Refers to a Node to focus on.

rotation

Rotation.

scale

Scale.

target

Target node name.

translation

Translate.

Refers to NiPoint3Interpolator.

Refers to a NiFloatInterpolator.

Refers to a NiFloatInterpolator.

unknown_short

Unknown.

class NiMaterialColorController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiMaterialColorController, object

get_target_color()

Get target color (works for all nif versions).

set_target_color(target_color)

Set target color (works for all nif versions).

class NiMaterialProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiMaterialProperty, object

is_interchangeable(other)

Are the two material blocks interchangeable?

class NiMesh(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiRenderObject

bound

The combined bounding volume of all submeshes.

datas
instancing_enabled

Sets whether hardware instancing is being used.

modifiers
num_datas
num_modifiers
num_submeshes

The number of submeshes contained in this mesh.

primitive_type

The primitive type of the mesh, such as triangles or lines.

unknown_100

Unknown.

unknown_101

Unknown.

unknown_102

Size of additional data.

unknown_103
unknown_200
unknown_201
unknown_250
unknown_251
unknown_300
unknown_301
unknown_302
unknown_303
unknown_350
unknown_351
unknown_400
unknown_51
unknown_52
unknown_53
unknown_54
unknown_55
unknown_56
class NiMeshHWInstance(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class NiMeshModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Base class for mesh modifiers.

complete_points

The complete points used by this mesh modifier

num_complete_points

The number of complete points used by this mesh modifier.

num_submit_points

The number of submit points used by this mesh modifier.

submit_points

The submit points used by this mesh modifier

class NiMeshPSysData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysData

Particle meshes data.

num_unknown_ints_1

Unknown.

unknown_byte_3

Unknown. 0?

unknown_int_2

Unknown. Possible vertex count but probably not.

unknown_ints_1

Unknown integers

unknown_node

Unknown NiNode.

class NiMeshParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleSystem

Particle system.

class NiMorphController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

Unknown! Used by Daoc->’healing.nif’.

class NiMorphData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiMorphData, object

apply_scale(scale)

Apply scale factor on data.

class NiMorphMeshModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiMeshModifier

Performs linear-weighted blending between a set of target data streams.

elements

Semantics and normalization of the morphing data stream elements.

flags

FLAG_RELATIVETARGETS = 0x01FLAG_UPDATENORMALS = 0x02FLAG_NEEDSUPDATE = 0x04FLAG_ALWAYSUPDATE = 0x08FLAG_NEEDSCOMPLETION = 0x10FLAG_SKINNED = 0x20FLAG_SWSKINNED = 0x40

num_elements

The number of morphing data stream elements.

num_targets

The number of morph targets.

class NiMorphWeightsController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

interpolators
num_interpolators
num_targets

The number of morph targets.

target_names

Name of each morph target.

unknown_2
class NiMorpherController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

Unknown! Used by Daoc.

data

This controller’s data.

class NiMultiTargetTransformController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

Unknown.

extra_targets

NiNode Targets to be controlled.

num_extra_targets

The number of target pointers that follow.

class NiMultiTextureProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

(note: not quite complete yet… but already reads most of the DAoC ones)

flags

Property flags.

texture_elements

Describes the various textures used by this mutli-texture property. Each slot probably has special meaning like thoes in NiTexturingProperty.

unknown_int

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.

class NiNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiNode, object

>>> from pyffi.formats.nif import NifFormat
>>> x = NifFormat.NiNode()
>>> y = NifFormat.NiNode()
>>> z = NifFormat.NiNode()
>>> x.num_children =1
>>> x.children.update_size()
>>> y in x.children
False
>>> x.children[0] = y
>>> y in x.children
True
>>> x.add_child(z, front = True)
>>> x.add_child(y)
>>> x.num_children
2
>>> x.children[0] is z
True
>>> x.remove_child(y)
>>> y in x.children
False
>>> x.num_children
1
>>> e = NifFormat.NiSpotLight()
>>> x.add_effect(e)
>>> x.num_effects
1
>>> e in x.effects
True
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> child1 = NifFormat.NiNode()
>>> child1.name = "hello"
>>> child_2 = NifFormat.NiNode()
>>> child_2.name = "world"
>>> node.get_children()
[]
>>> node.set_children([child1, child_2])
>>> [child.name for child in node.get_children()]
[b'hello', b'world']
>>> [child.name for child in node.children]
[b'hello', b'world']
>>> node.set_children([])
>>> node.get_children()
[]
>>> # now set them the other way around
>>> node.set_children([child_2, child1])
>>> [child.name for child in node.get_children()]
[b'world', b'hello']
>>> [child.name for child in node.children]
[b'world', b'hello']
>>> node.remove_child(child_2)
>>> [child.name for child in node.children]
[b'hello']
>>> node.add_child(child_2)
>>> [child.name for child in node.children]
[b'hello', b'world']
>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> effect1 = NifFormat.NiSpotLight()
>>> effect1.name = "hello"
>>> effect2 = NifFormat.NiSpotLight()
>>> effect2.name = "world"
>>> node.get_effects()
[]
>>> node.set_effects([effect1, effect2])
>>> [effect.name for effect in node.get_effects()]
[b'hello', b'world']
>>> [effect.name for effect in node.effects]
[b'hello', b'world']
>>> node.set_effects([])
>>> node.get_effects()
[]
>>> # now set them the other way around
>>> node.set_effects([effect2, effect1])
>>> [effect.name for effect in node.get_effects()]
[b'world', b'hello']
>>> [effect.name for effect in node.effects]
[b'world', b'hello']
>>> node.remove_effect(effect2)
>>> [effect.name for effect in node.effects]
[b'hello']
>>> node.add_effect(effect2)
>>> [effect.name for effect in node.effects]
[b'hello', b'world']
add_child(child, front=False)

Add block to child list.

Parameters:child (L{NifFormat.NiAVObject}) – The child to add.
Keyword Arguments:
 front – Whether to add to the front or to the end of the list (default is at end).
add_effect(effect)

Add an effect to the list of effects.

Parameters:effect (L{NifFormat.NiDynamicEffect}) – The effect to add.
get_children()

Return a list of the children of the block.

Returns:The list of children.
Return type:list of L{NifFormat.NiAVObject}
get_effects()

Return a list of the effects of the block.

Returns:The list of effects.
Return type:list of L{NifFormat.NiDynamicEffect}
get_skinned_geometries()

This function yields all skinned geometries which have self as skeleton root.

merge_external_skeleton_root(skelroot)

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.

merge_skeleton_roots()

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_child(child)

Remove a block from the child list.

Parameters:child (L{NifFormat.NiAVObject}) – The child to remove.
remove_effect(effect)

Remove a block from the effect list.

Parameters:effect (L{NifFormat.NiDynamicEffect}) – The effect to remove.
send_bones_to_bind_position()

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
send_detached_geometries_to_node_position()

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.

send_geometries_to_bind_position()

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_children(childlist)

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_effects(effectlist)

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.
class NiObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiObject, object

apply_scale(scale)

Scale data in this block. This implementation does nothing. Override this method if it contains geometry data that can be scaled.

find(block_name=None, block_type=None)
find_chain(block, block_type=None)

Finds a chain of blocks going from C{self} to C{block}. If found, self is the first element and block is the last element. If no branch found, returns an empty list. Does not check whether there is more than one branch; if so, the first one found is returned.

Parameters:
  • block – The block to find a chain to.
  • block_type – The type that blocks should have in this chain.
is_interchangeable(other)

Are the two blocks interchangeable?

@todo: Rely on AnyType, SimpleType, ComplexType, etc. implementation.

tree(block_type=None, follow_all=True, unique=False)

A generator for parsing all blocks in the tree (starting from and including C{self}).

Parameters:
  • block_type – If not None, yield only blocks of the type C{block_type}.
  • follow_all – If C{block_type} is not None, then if this is True the function will parse the whole tree. Otherwise, the function will not follow branches that start by a non-C{block_type} block.
  • unique – Whether the generator can return the same block twice or not.
class NiObjectNET(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiObjectNET, object

add_controller(ctrlblock)

Add block to controller chain and set target of controller to self.

add_extra_data(extrablock)

Add block to extra data list and extra data chain. It is good practice to ensure that the extra data has empty next_extra_data field when adding it to avoid loops in the hierarchy.

add_integer_extra_data(name, value)

Add a particular extra integer data block.

get_controllers()

Get a list of all controllers.

get_extra_datas()

Get a list of all extra data blocks.

remove_extra_data(extrablock)

Remove block from extra data list and extra data chain.

>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiNode()
>>> block.num_extra_data_list = 3
>>> block.extra_data_list.update_size()
>>> extrablock = NifFormat.NiStringExtraData()
>>> block.extra_data_list[1] = extrablock
>>> block.remove_extra_data(extrablock)
>>> [extra for extra in block.extra_data_list]
[None, None]
set_extra_datas(extralist)

Set all extra data blocks from given list (erases existing data).

>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> extra1 = NifFormat.NiExtraData()
>>> extra1.name = "hello"
>>> extra2 = NifFormat.NiExtraData()
>>> extra2.name = "world"
>>> node.get_extra_datas()
[]
>>> node.set_extra_datas([extra1, extra2])
>>> [extra.name for extra in node.get_extra_datas()]
[b'hello', b'world']
>>> [extra.name for extra in node.extra_data_list]
[b'hello', b'world']
>>> node.extra_data is extra1
True
>>> extra1.next_extra_data is extra2
True
>>> extra2.next_extra_data is None
True
>>> node.set_extra_datas([])
>>> node.get_extra_datas()
[]
>>> # now set them the other way around
>>> node.set_extra_datas([extra2, extra1])
>>> [extra.name for extra in node.get_extra_datas()]
[b'world', b'hello']
>>> [extra.name for extra in node.extra_data_list]
[b'world', b'hello']
>>> node.extra_data is extra2
True
>>> extra2.next_extra_data is extra1
True
>>> extra1.next_extra_data is None
True
Parameters:extralist (list of L{NifFormat.NiExtraData}) – List of extra data blocks to add.
class NiPSBombForce(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
unknown_1
unknown_10
unknown_2
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSBoundUpdater(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

unknown_1
unknown_2
class NiPSBoxEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
unknown_1
unknown_10
unknown_11
unknown_12
unknown_13
unknown_14
unknown_15
unknown_16
unknown_17
unknown_18
unknown_19
unknown_2
unknown_20
unknown_21
unknown_22
unknown_23
unknown_24
unknown_25
unknown_26
unknown_27
unknown_28
unknown_29
unknown_3
unknown_30
unknown_31
unknown_32
unknown_33
unknown_34
unknown_35
unknown_36
unknown_37
unknown_38
unknown_39
unknown_4
unknown_40
unknown_41
unknown_42
unknown_43
unknown_44
unknown_45
unknown_46
unknown_47
unknown_48
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSCylinderEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSSphereEmitter

unknown_23
class NiPSDragForce(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

unknown_1
unknown_10
unknown_2
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSEmitParticlesCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysEmitterCtlr

class NiPSEmitterDeclinationCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

class NiPSEmitterDeclinationVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSEmitterDeclinationCtlr

class NiPSEmitterLifeSpanCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

class NiPSEmitterPlanarAngleCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

class NiPSEmitterPlanarAngleVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSEmitterPlanarAngleCtlr

class NiPSEmitterRadiusCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

interpolator
unknown_2
class NiPSEmitterRotAngleCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

class NiPSEmitterRotAngleVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSEmitterRotAngleCtlr

class NiPSEmitterRotSpeedCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

class NiPSEmitterRotSpeedVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSEmitterRotSpeedCtlr

class NiPSEmitterSpeedCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

interpolator
unknown_3
class NiPSFacingQuadGenerator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

unknown_1
unknown_10
unknown_11
unknown_12
unknown_2
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSForceActiveCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

interpolator
unknown_2
class NiPSGravityForce(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

unknown_1
unknown_10
unknown_11
unknown_12
unknown_13
unknown_14
unknown_15
unknown_16
unknown_17
unknown_18
unknown_19
unknown_2
unknown_20
unknown_21
unknown_22
unknown_23
unknown_24
unknown_25
unknown_26
unknown_27
unknown_28
unknown_29
unknown_3
unknown_30
unknown_31
unknown_32
unknown_33
unknown_34
unknown_35
unknown_36

Gravity node?

unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSGravityStrengthCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

unknown_2
unknown_3
class NiPSMeshEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
unknown_1
unknown_10
unknown_11
unknown_12
unknown_13
unknown_14
unknown_15
unknown_16
unknown_17
unknown_18
unknown_19
unknown_2
unknown_20
unknown_21
unknown_22
unknown_23
unknown_24
unknown_25
unknown_26
unknown_27
unknown_28
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSMeshParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSParticleSystem

unknown_23
unknown_24

Unknown - may or may not be emitted mesh?

unknown_25
unknown_26
class NiPSParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

emitter

Emitter?

generator

Generator?

simulator

Simulator?

unknown_10

0?

unknown_11

0?

unknown_12

Counter?

unknown_15

Simulator?

unknown_16

Updater?

unknown_17

1?

unknown_19

0?

unknown_20

Spawner?

unknown_21

Unknown

unknown_22

Unknown

unknown_27
unknown_28
unknown_29
unknown_3

0?

unknown_30
unknown_31
unknown_32
unknown_33
unknown_34
unknown_35
unknown_36

-1?

unknown_37
unknown_38
unknown_39
unknown_4

-1?

unknown_5

0?

unknown_6

256?

unknown_7

0?

unknown_8

0?

unknown_9

0?

class NiPSPlanarCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
unknown_byte_4
unknown_floats_5
unknown_int_1
unknown_int_2
unknown_short_3
class NiPSResetOnLoopCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

class NiPSSimulator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiMeshModifier

The mesh modifier that performs all particle system simulation.

num_simulation_steps

The number of simulation steps in this modifier.

simulation_steps

Links to the simulation steps.

class NiPSSimulatorCollidersStep(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSSimulatorStep

Encapsulates a floodgate kernel that simulates particle colliders.

colliders

The colliders affecting the particle system.

num_colliders

The number of colliders affecting the particle system.

class NiPSSimulatorFinalStep(template=None, argument=None, parent=None)

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.

class NiPSSimulatorForcesStep(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSSimulatorStep

Encapsulates a floodgate kernel that simulates particle forces.

forces

The forces affecting the particle system.

num_forces

The number of forces affecting the particle system.

class NiPSSimulatorGeneralStep(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSSimulatorStep

Encapsulates a floodgate kernel that updates particle size, colors, and rotations.

color_keys

The particle color keys.

color_loop_behavior

The loop behavior for the color keys.

grow_generation

Specifies the particle generation to which the grow effect should be applied. This is usually generation 0, so that newly created particles will grow.

grow_time

The the amount of time over which a particle’s size is ramped from 0.0 to 1.0 in seconds

num_color_keys

The number of color animation keys.

num_rotation_keys

The number of rotatoin animation keys.

num_size_keys

The number of size animation keys.

rotation_keys

The particle rotation keys.

rotation_loop_behavior

The loop behavior for the rotation keys.

shrink_generation

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.

shrink_time

The the amount of time over which a particle’s size is ramped from 1.0 to 0.0 in seconds

size_keys

The particle size keys.

size_loop_behavior

The loop behavior for the size keys.

unknown_1
unknown_2
unknown_3
class NiPSSimulatorMeshAlignStep(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSSimulatorStep

Encapsulates a floodgate kernel that updates mesh particle alignment and transforms.

num_rotation_keys

The number of rotation keys.

rotation_keys

The particle rotation keys.

rotation_loop_behavior

The loop behavior for the rotation keys.

class NiPSSimulatorStep(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Abstract base class for a single step in the particle system simulation process. It has no seralized data.

class NiPSSpawner(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class NiPSSphereEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
unknown_10
unknown_11
unknown_12
unknown_13
unknown_14
unknown_15
unknown_16
unknown_17
unknown_18
unknown_19
unknown_2
unknown_20
unknown_21

Target node?

unknown_22
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
unknown_8
unknown_9
class NiPSSphericalCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

unknown_1
unknown_2
unknown_3
unknown_4
unknown_5
unknown_6
unknown_7
class NiPSysAgeDeathModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown particle modifier.

spawn_modifier

Link to NiPSysSpawnModifier object?

spawn_on_death

Unknown.

class NiPSysAirFieldAirFrictionCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for air field air friction.

class NiPSysAirFieldInheritVelocityCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for air field inherit velocity.

class NiPSysAirFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particle velocity in a field like wind.

direction

Direction of the particle velocity

unknown_boolean_1

Unknown

unknown_boolean_2

Unknown

unknown_boolean_3

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_float_4

Unknown

class NiPSysAirFieldSpreadCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for air field spread.

class NiPSysBombModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle modifier that uses a NiNode to use as a “Bomb Object” to alter the path of particles.

bomb_axis

Orientation of bomb object.

bomb_object

Link to a NiNode for bomb to function.

decay

Falloff rate of the bomb object.

decay_type

Decay type

delta_v

DeltaV / Strength?

symmetry_type

Shape/symmetry of the bomb object.

class NiPSysBoundUpdateModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown particle system modifier.

update_skip

Unknown.

class NiPSysBoxEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysVolumeEmitter

Particle emitter that uses points within a defined Box shape to emit from..

depth

Defines the Depth of the box area.

height

Defines the Height of the box area.

width

Defines the Width of the box area.

class NiPSysCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Particle system collider.

bounce

Defines amount of bounce the collider object has.

collider_object

Links to a NiNode that will define where in object space the collider is located/oriented.

die_on_collide

Kill particles on impact if set to yes.

next_collider

The next collider.

parent

Link to parent.

spawn_modifier

Link to NiPSysSpawnModifier object?

spawn_on_collide

Unknown.

class NiPSysColliderManager(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle modifier that adds a defined shape to act as a collision object for particles to interact with.

collider

Link to a NiPSysPlanarCollider or NiPSysSphericalCollider.

class NiPSysColorModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle modifier that adds keyframe data to modify color/alpha values of particles over time.

data

Refers to NiColorData object.

class NiPSysCylinderEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysVolumeEmitter

Particle emitter that uses points within a defined Cylinder shape to emit from.

height

Height of the cylinders shape.

radius

Radius of the cylinder shape.

class NiPSysData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiRotatingParticlesData

Particle system data.

aspect_ratio

Sets aspect ratio for Subtexture Offset UV quads

has_subtexture_offset_u_vs

Boolean for Num Subtexture Offset UVs

has_unknown_floats_3

Unknown.

num_subtexture_offset_u_vs

How many quads to use in BSPSysSubTexModifier for texture atlasing

particle_descriptions

Unknown.

subtexture_offset_u_vs

Defines UV offsets

unknown_byte_4

Unknown

unknown_floats_3

Unknown.

unknown_int_4

Unknown

unknown_int_5

Unknown

unknown_int_6

Unknown

unknown_short_1

Unknown.

unknown_short_2

Unknown.

unknown_short_3

Unknown

class NiPSysDragFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particle velocity in drag space warp.

direction

Direction of the particle velocity

use_direction

Whether to use the direction field?

class NiPSysDragModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown.

drag_axis

The drag axis.

parent

Parent reference.

percentage

Drag percentage.

range

The range.

range_falloff

The range falloff.

class NiPSysEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

A particle emitter?

declination

Declination / First axis.

declination_variation

Declination randomness / First axis.

initial_color

Defines color of a birthed particle.

initial_radius

Size of a birthed particle.

life_span

Duration until a particle dies.

life_span_variation

Adds randomness to Life Span.

planar_angle

Planar Angle / Second axis.

planar_angle_variation

Planar Angle randomness / Second axis .

radius_variation

Particle Radius randomness.

speed

Speed / Inertia of particle movement.

speed_variation

Adds an amount of randomness to Speed.

class NiPSysEmitterCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

Particle system emitter controller.

data

This controller’s data

visibility_interpolator

Links to a bool interpolator. Controls emitter’s visibility status?

class NiPSysEmitterCtlrData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Particle system emitter controller data.

float_keys

Unknown.

num_visibility_keys

Number of keys.

visibility_keys

Unknown.

class NiPSysEmitterDeclinationCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysEmitterDeclinationVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysEmitterInitialRadiusCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysEmitterLifeSpanCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysEmitterPlanarAngleCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter planar angle.

class NiPSysEmitterPlanarAngleVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter planar angle variation.

class NiPSysEmitterSpeedCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysFieldAttenuationCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for force field attenuation.

class NiPSysFieldMagnitudeCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for force field magnitude.

class NiPSysFieldMaxDistanceCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for force field maximum distance.

class NiPSysFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Base for all force field particle modifiers.

attenuation

Controls how quick the field diminishes

field_object

Force Field Object

magnitude

Magnitude of the force

max_distance

Maximum distance

use_max_distance

Use maximum distance

class NiPSysGravityFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particle velocity in gravity field.

direction

Direction of the particle velocity

class NiPSysGravityModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Adds gravity to a particle system, when linked to a NiNode to use as a Gravity Object.

decay

Falloff range.

force_type

Planar or Spherical type

gravity_axis

Orientation of gravity.

gravity_object

Refers to a NiNode for gravity location.

strength

The strength of gravity.

turbulence

Adds a degree of randomness.

turbulence_scale

Range for turbulence.

unknown_byte

Unknown

class NiPSysGravityStrengthCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Unknown.

class NiPSysGrowFadeModifier(template=None, argument=None, parent=None)

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.

base_scale

Unknown

fade_generation

Unknown.

fade_time

Time in seconds to fade out.

grow_generation

Unknown.

grow_time

Time in seconds to fade in.

class NiPSysInitialRotAngleCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter initial rotation angle.

class NiPSysInitialRotAngleVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter initial rotation angle variation.

class NiPSysInitialRotSpeedCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter initial rotation speed.

class NiPSysInitialRotSpeedVarCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierFloatCtlr

Particle system controller for emitter initial rotation speed variation.

class NiPSysMeshEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysEmitter

Particle emitter that uses points on a specified mesh to emit from.

emission_axis

The emission axis.

emission_type

The parts of the mesh that the particles emit from.

emitter_meshes

Links to meshes used for emitting.

initial_velocity_type

The way the particles get their initial direction and speed.

num_emitter_meshes

The number of references to emitter meshes that follow.

class NiPSysMeshUpdateModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown.

meshes

Group of target NiNodes or NiTriShapes?

num_meshes

The number of object references that follow.

class NiPSysModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Generic particle system modifier object.

active

Whether the modifier is currently in effect? Usually true.

name

The object name.

order

Modifier ID in the particle modifier chain (always a multiple of 1000)?

target

NiParticleSystem parent of this modifier.

class NiPSysModifierActiveCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierBoolCtlr

Unknown.

data

This controller’s data.

class NiPSysModifierBoolCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

A particle system modifier controller that deals with boolean data?

class NiPSysModifierCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

A particle system modifier controller.

modifier_name

Refers to modifier object by its name?

class NiPSysModifierFloatCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifierCtlr

A particle system modifier controller that deals with floating point data?

data

This controller’s data.

class NiPSysPlanarCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysCollider

Particle Collider object which particles will interact with.

height

Defines the height of the plane.

width

Defines the width of the plane.

x_axis

Defines Orientation.

y_axis

Defines Orientation.

class NiPSysPositionModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown particle system modifier.

class NiPSysRadialFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particlevelocity in force field.

radial_type

Unknown Enums?

class NiPSysResetOnLoopCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Unknown.

class NiPSysRotationModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Particle modifier that adds rotations to particles.

initial_axis

Unknown.

initial_rotation_angle

Sets the intial angle for particles to be birthed in.

initial_rotation_angle_variation

Adds a random range to Initial angle.

initial_rotation_speed

The initial speed of rotation.

initial_rotation_speed_variation

Adds a ranged randomness to rotation speed.

random_initial_axis

Unknown.

random_rot_speed_sign

Unknown

class NiPSysSpawnModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysModifier

Unknown particle modifier.

life_span

Unknown.

life_span_variation

Unknown.

max_num_to_spawn

Unknown.

min_num_to_spawn

Unknown.

num_spawn_generations

Unknown.

percentage_spawned

Unknown.

spawn_dir_chaos

Unknown.

spawn_speed_chaos

Unknown.

unknown_int

Unknown

class NiPSysSphereEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysVolumeEmitter

Particle emitter that uses points within a sphere shape to emit from.

radius

The radius of the sphere shape

class NiPSysSphericalCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysCollider

Particle Collider object which particles will interact with.

radius

Defines the radius of the sphere object.

class NiPSysTrailEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysEmitter

Guild 2-Specific node

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_float_4

Unknown

unknown_float_5

Unknown

unknown_float_6

Unknown

unknown_float_7

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_3

Unknown

unknown_int_4

Unknown

class NiPSysTurbulenceFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particle velocity in drag space warp.

frequency

Frequency of the update.

class NiPSysUpdateCtlr(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Particle system controller, used for ???.

class NiPSysVolumeEmitter(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysEmitter

An emitter that emits meshes?

emitter_object

Node parent of this modifier?

class NiPSysVortexFieldModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPSysFieldModifier

Particle system modifier, used for controlling the particle velocity in force field.

direction

Direction of the particle velocity

class NiPalette(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

A color palette.

num_entries

The number of palette entries. Always = 256.

palette

The color palette.

unknown_byte

Unknown, Usually = 0.

class NiParticleBomb(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

A particle modifier.

decay

Unknown.

decay_type

Unknown.

delta_v

Unknown.

direction

The direction of the applied acceleration?

duration

Unknown.

position

The position of the mass point relative to the particle system?

start

Unknown.

symmetry_type

Unknown.

class NiParticleColorModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

Unknown.

color_data

Color data index.

class NiParticleGrowFade(template=None, argument=None, parent=None)

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.

fade

The time from the end of the particle lifetime during which the particle fades.

grow

The time from the beginning of the particle lifetime during which the particle grows.

class NiParticleMeshModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

Unknown.

num_particle_meshes

The number of particle mesh references that follow.

particle_meshes

Links to nodes of particle meshes?

class NiParticleMeshes(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticles

Mesh particle node?

class NiParticleMeshesData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiRotatingParticlesData

Particle meshes data.

Refers to the mesh that makes up a particle?

class NiParticleModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

A particle system modifier.

controller

Points to the particle system controller parent.

next_modifier

Next particle modifier.

class NiParticleRotation(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

Unknown.

initial_axis

Unknown.

random_initial_axis

Unknown.

rotation_speed

Unknown.

class NiParticleSystem(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticles

A particle system.

modifiers

The list of particle modifiers.

num_modifiers

The number of modifier references.

unknown_int_1

Unknown

unknown_short_2

Unknown

unknown_short_3

Unknown

world_space

If true, Particles are birthed into world space. If false, Particles are birthed into object space.

class NiParticleSystemController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

A generic particle system time controller object.

color_data
emit_flags

Bit 0 – Emit Rate toggle bit (0 = auto adjust, 1 = use Emit Rate value)

emit_rate

Particle emission rate (particles per second)

emit_start_time

Particle emit start time

emit_stop_time

Particle emit stop time

emitter

This index targets the particle emitter object (TODO – find out what type of object this refers to).

horizontal_angle

emitter’s horizontal opening angle

horizontal_direction

horizontal emit direction

lifetime

Particle lifetime

lifetime_random

Particle lifetime random modifier

num_particles

Size of the following array. (Maximum number of simultaneous active particles)

num_valid

Number of valid entries in the following array. (Number of active particles at the time the system was saved)

old_emit_rate

Particle emission rate in old files

old_speed

Particle speed in old files

particle_extra

Link to some optional particle modifiers (NiGravity, NiParticleGrowFade, NiParticleBomb, …)

particle_lifetime

The particle’s age.

particle_timestamp

Timestamp of the last update.

particle_unknown_short

Unknown short

particle_unknown_vector

Unknown

particle_velocity

Particle velocity

particle_vertex_id

Particle/vertex index matches array index

particles

Individual particle modifiers?

size

Particle size

speed

Particle speed

speed_random

Particle random speed modifier

start_random

Particle random start translation vector

trailer

Trailing null byte

unknown_byte

Unknown byte, (=0)

unknown_color

Unknown.

unknown_float_1
unknown_float_13

? float=1.0 ?

unknown_floats_2
unknown_int_1

? int=1 ?

unknown_int_2

? int=0 ?

unknown int (=0xffffffff)

Unknown int (=0xffffffff)

unknown_normal

Unknown.

unknown_short_2

? short=0 ?

unknown_short_3

? short=0 ?

vertical_angle

emitter’s vertical opening angle [radians]

vertical_direction

**vertical emit direction [radians]0.0* – up1.6* – horizontal3.1416 : down

class NiParticles(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiGeometry

Generic particle system node.

class NiParticlesData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiGeometryData

Generic rotating particles data object.

has_radii

Is the particle size array present?

has_rotation_angles

Are the angles of rotation present?

has_rotation_axes

Are axes of rotation present?

has_rotations

Is the particle rotation array present?

has_sizes

Is the particle size array present?

has_uv_quadrants

if value is no, a single image rendered

num_active

The number of active particles at the time the system was saved. This is also the number of valid entries in the following arrays.

num_particles

The maximum number of particles (matches the number of vertices).

num_uv_quadrants

2,4,8,16,32,64 are potential values. If “Has” was no then this should be 256, which represents a 16x16 framed image, which is invalid

particle_radius

The particles’size.

radii

The individual particel sizes.

rotation_angles

Angles of rotation

rotation_axes

Unknown

rotations

The individual particle rotations.

sizes

The individual particel sizes.

unknown_byte_1

Unknown, probably a boolean.

unknown_byte_2

Unknown

Unknown

uv_quadrants
class NiPathController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Time controller for a path.

float_data

Path controller data index (float data). ?

pos_data

Path controller data index (position data). ?

unknown_float_2

Unknown, often 0?

unknown_float_3

Unknown, often 0?

unknown_int_1

Unknown, always 1?

unknown_short

Unknown, always 0?

unknown_short_2

Unknown.

class NiPathInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyBasedInterpolator

Unknown interpolator.

float_data

Links to NiFloatData.

pos_data

Links to NiPosData.

unknown_float_1

Unknown.

unknown_float_2

Unknown.

unknown_int

Unknown.

unknown_short

Unknown.

unknown_short_2

Unknown. Zero.

class NiPersistentSrcTextureRendererData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.ATextureRenderData

num_faces

Unknown

num_pixels

Unknown

pixel_data

Raw pixel data holding the mipmaps. Mipmap zero is the full-size texture and they get smaller by half as the number increases.

unknown_int_6

Unknown, same as the number of pixels? / number of blocks?

unknown_int_7

Unknown

class NiPhysXActorDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

shape_description

PhysX Shape Description

unknown_byte_1

Unknown

unknown_byte_2

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_4

Unknown

unknown_int_5

Unknown

unknown_int_6

Unknown

unknown_quat_1

Unknown

unknown_quat_2

Unknown

unknown_quat_3

Unknown

unknown_ref_0

Unknown

unknown_ref_1

Unknown

unknown_ref_2

Unknown

unknown_refs_3

Unknown

class NiPhysXBodyDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

unknown_bytes

Unknown

class NiPhysXD6JointDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

unknown_bytes

Unknown

class NiPhysXKinematicSrc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

unknown_bytes

Unknown

class NiPhysXMaterialDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown node.

unknown_byte_1

Unknown

unknown_byte_2

Unknown

unknown_int

Unknown

class NiPhysXMeshDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

num_vertices

Number of mesh vertices

unknown_byte_1

Unknown

unknown_byte_2

Unknown

unknown_bytes_0

NXS

unknown_bytes_1

MESH

unknown_bytes_2

Unknown

unknown_bytes_3

Unknown

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_4

Unknown

unknown_ints_1

Unknown

unknown_short_1

Unknown

unknown_short_2

Unknown

unknown_shorts_1

Unknown

vertices

Vertices

class NiPhysXProp(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObjectNET

Unknown PhysX node.

num_dests

Number of NiPhysXTransformDest references

prop_description

PhysX Property Description.

transform_dests

Unknown

unknown_byte

Unknown

unknown_float_1

Unknown

unknown_int

Unknown

unknown_int_1

Unknown

unknown_refs_1

Unknown

class NiPhysXPropDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

actor_descs

Unknown

joint_descs

PhysX Joint Descriptions

material_descs

PhysX Material Descriptions

num_dests

Number of NiPhysXActorDesc references

num_joints

Unknown

num_materials

Unknown

unknown_byte_6

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_3

Unknown

unknown_int_5

Unknown

unknown_string_4

Unknown

class NiPhysXShapeDesc(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

mesh_description

PhysX Mesh Description

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_float_3

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_3

Unknown

unknown_int_4

Unknown

unknown_int_5

Unknown

unknown_int_7

Unknown

unknown_int_8

Unknown

unknown_quat_1

Unknown

unknown_quat_2

Unknown

unknown_quat_3

Unknown

unknown_short_1

Unknown

unknown_short_2

Unknown

class NiPhysXTransformDest(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Unknown PhysX node.

node

Affected node?

unknown_byte_1

Unknown. =1?

unknown_byte_2

Unknown. =0

class NiPixelData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.ATextureRenderData

A texture.

num_faces

Unknown

num_pixels

Total number of pixels

pixel_data

Raw pixel data holding the mipmaps. Mipmap zero is the full-size texture and they get smaller by half as the number increases.

class NiPlanarCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

Unknown.

unknown_float_1

Unknown.

unknown_float_10

Unknown.

unknown_float_11

Unknown.

unknown_float_12

Unknown.

unknown_float_13

Unknown.

unknown_float_14

Unknown.

unknown_float_15

Unknown.

unknown_float_16

Unknown.

unknown_float_2

Unknown.

unknown_float_3

Unknown.

unknown_float_4

Unknown.

unknown_float_5

Unknown.

unknown_float_6

Unknown.

unknown_float_7

Unknown.

unknown_float_8

Unknown.

unknown_float_9

Unknown.

unknown_short

Usually 0?

unknown_short_2

Unknown.

class NiPoint3InterpController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

A controller that interpolates point 3 data?

data

Material color controller data object index. Points to NiPosData.

target_color

Selects which color to control.

class NiPoint3Interpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyBasedInterpolator

Unknown.

data

Reference to NiPosData.

point_3_value

Value when posed? Value at time 0?

class NiPointLight(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiLight

A point light.

constant_attenuation

Constant Attenuation

linear_attenuation

Linear Attenuation

quadratic_attenuation

Quadratic Attenuation (see glLight)

class NiPortal(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

A Portal

num_vertices

Number of vertices in this polygon

target

Target portal or room

unknown_flags

Unknown flags.

unknown_short_2

Unknown

vertices

Vertices

class NiPosData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Position data.

data

The position keys.

class NiProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObjectNET

A generic property object.

class NiRangeLODData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiLODData

Describes levels of detail based on distance of object from camera.

lod_center

?

lod_levels

The ranges of distance that each level of detail applies in.

num_lod_levels

Number of levels of detail.

class NiRawImageData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Raw image data.

height

Image height

image_type

The format of the raw image data.

rgb_image_data

Image pixel data.

rgba_image_data

Image pixel data.

width

Image width

class NiRenderObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiAVObject

An object that can be rendered.

active_material

The index of the currently active material.

material_data

Per-material data.

material_needs_update_default

The initial value for the flag that determines if the internal cached shader is valid.

num_materials

The number of materials affecting this renderable object.

class NiRollController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSingleInterpController

Unknown.

data

The data for the controller.

class NiRoom(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Grouping node for nodes in a Portal

in_portals

Number of portals into room

items

All geometry associated with room.

num_in_portals

Number of doors into room

num_items

Number of unknowns

num_portals_2

Number of doors out of room

num_walls

Number of walls in a room?

portals_2

Number of portals out of room

wall_plane

Face normal and unknown value.

class NiRoomGroup(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Grouping node for nodes in a Portal

num_rooms

Number of rooms in this group

rooms

Rooms associated with this group.

Outer Shell Geometry Node?

class NiRotatingParticles(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticles

Unknown.

class NiRotatingParticlesData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticlesData

Rotating particles data object.

has_rotations_2

Is the particle rotation array present?

rotations_2

The individual particle rotations.

class NiScreenElements(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriShape

Two dimensional screen elements.

class NiScreenElementsData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriShapeData

Two dimensional screen elements.

max_polygons

Maximum number of polygons?

num_polygons

Number of Polygons actually in use

polygon_indices

Polygon Indices

polygons

Polygons

unknown_u_short_1

Unknown

unknown_u_short_2

Unknown

unknown_u_short_3

Maximum number of faces

used_triangle_points

Number of in-use triangles

used_vertices

Number of in-use vertices

class NiScreenLODData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiLODData

Describes levels of detail based on size of object on screen?

bound_center

The center of the bounding sphere?

bound_radius

The radius of the bounding sphere?

proportion_count

The number of screen size based LOD levels.

proportion_levels

The LOD levels based on proportion of screen size?

world_center

The center of the bounding sphere in world space?

world_radius

The radius of the bounding sphere in world space?

class NiSequence(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Root node used in some Empire Earth II .kf files (version 4.2.2.0).

controlled_blocks

Refers to controlled objects.

name

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”.

num_controlled_blocks

Number of controlled objects.

text_keys

Link to NiTextKeyExtraData.

text_keys_name

Name of following referenced NiTextKeyExtraData class.

unknown_int_1

Unknown.

unknown_int_4

Unknown

unknown_int_5

Unknown

class NiSequenceData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class NiSequenceStreamHelper(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObjectNET

Keyframe animation root node, in .kf files.

class NiShadeProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Determines whether flat shading or smooth shading is used on a shape.

flags

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.

class NiShadowGenerator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

name
target
unknown_flags
unkown_byte_5
unkown_byte_9
unkown_float_4
unkown_int_2
unkown_int_6
unkown_int_7
unkown_int_8
class NiSingleInterpController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiInterpController

A controller referring to a single interpolator.

interpolator

Link to interpolator.

class NiSkinData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiSkinData, object

apply_scale(scale)

Apply scale factor on data.

>>> from pyffi.formats.nif import NifFormat
>>> id44 = NifFormat.Matrix44()
>>> id44.set_identity()
>>> skelroot = NifFormat.NiNode()
>>> skelroot.name = 'Scene Root'
>>> skelroot.set_transform(id44)
>>> bone1 = NifFormat.NiNode()
>>> bone1.name = 'bone1'
>>> bone1.set_transform(id44)
>>> bone1.translation.x = 10
>>> skelroot.add_child(bone1)
>>> geom = NifFormat.NiTriShape()
>>> geom.set_transform(id44)
>>> skelroot.add_child(geom)
>>> skininst = NifFormat.NiSkinInstance()
>>> geom.skin_instance = skininst
>>> skininst.skeleton_root = skelroot
>>> skindata = NifFormat.NiSkinData()
>>> skininst.data = skindata
>>> skindata.set_transform(id44)
>>> geom.add_bone(bone1, {})
>>> geom.update_bind_position()
>>> bone1.translation.x
10.0
>>> skindata.bone_list[0].skin_transform.translation.x
-10.0
>>> import pyffi.spells.nif.fix
>>> import pyffi.spells.nif
>>> data = NifFormat.Data()
>>> data.roots = [skelroot]
>>> toaster = pyffi.spells.nif.NifToaster()
>>> toaster.scale = 0.1
>>> pyffi.spells.nif.fix.SpellScale(data=data, toaster=toaster).recurse()
pyffi.toaster:INFO:--- fix_scale ---
pyffi.toaster:INFO:  scaling by factor 0.100000
pyffi.toaster:INFO:  ~~~ NiNode [Scene Root] ~~~
pyffi.toaster:INFO:    ~~~ NiNode [bone1] ~~~
pyffi.toaster:INFO:    ~~~ NiTriShape [] ~~~
pyffi.toaster:INFO:      ~~~ NiSkinInstance [] ~~~
pyffi.toaster:INFO:        ~~~ NiSkinData [] ~~~
>>> bone1.translation.x
1.0
>>> skindata.bone_list[0].skin_transform.translation.x
-1.0
get_transform()

Return scale, rotation, and translation into a single 4x4 matrix.

set_transform(mat)

Set rotation, transform, and velocity.

class NiSkinInstance(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Skinning instance.

bones

List of all armature bones.

data

Skinning data reference.

num_bones

The number of node bones referenced as influences.

skeleton_root

Armature root node.

skin_partition

Refers to a NiSkinPartition objects, which partitions the mesh such that every vertex is only influenced by a limited number of bones.

class NiSkinPartition(template=None, argument=None, parent=None)

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.

num_skin_partition_blocks

Unknown.

skin_partition_blocks

Skin partition objects.

class NiSkinningLODController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

class NiSkinningMeshModifier(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiMeshModifier

bone_bounds

The bounds of the bones. Only stored if the RECOMPUTE_BOUNDS bit is set.

bone_transforms

The transforms that go from bind-pose space to bone space.

bones

Pointers to the bone nodes that affect this skin.

flags

USE_SOFTWARE_SKINNING = 0x0001RECOMPUTE_BOUNDS = 0x0002

num_bones

The number of bones referenced by this mesh modifier.

skeleton_root

The root bone of the skeleton.

skeleton_transform

The transform that takes the root bone parent coordinate system into the skin coordinate system.

class NiSortAdjustNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Unknown node. Found in Loki.

sorting_mode

Sorting

unknown_int_2

Unknown.

class NiSourceCubeMap(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiSourceTexture

Unknown node. Found in Emerge Demo.

class NiSourceTexture(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTexture

Describes texture source and properties.

alpha_format

Note – the NiTriShape linked to this object must have a NiAlphaProperty in its list of properties to enable material and/or texture transparency.

direct_render

Load direct to renderer

file_name

The original source filename of the image embedded by the referred NiPixelData object.

is_static

Is Static?

persist_render_data

Render data is persistant

pixel_data

Pixel data object index. NiPixelData or NiPersistentSrcTextureRendererData

pixel_layout

Specifies the way the image will be stored.

unknown_byte

Unknown. Seems to be set if Pixel Data is present?

Unknown.

use_external

Is the texture external?

use_mipmaps

Specifies whether mip maps are used.

class NiSpecularProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Gives specularity to a shape. Flags 0x0001.

flags

1’s Bit = Enable specular lighting on this shape.

class NiSphericalCollider(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiParticleModifier

Unknown.

unknown_float_1

Unknown.

unknown_float_2

Unknown.

unknown_float_3

Unknown.

unknown_float_4

Unknown.

unknown_float_5

Unknown.

unknown_short_1

Unknown.

unknown_short_2

Unknown.

class NiSpotLight(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiPointLight

A spot.

cutoff_angle

The opening angle of the spot.

exponent

Describes the distribution of light. (see – glLight)

unknown_float

Unknown

class NiStencilProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Allows control of stencil testing.

draw_mode

Used to enabled double sided faces. Default is 3 (DRAW_BOTH).

fail_action
flags

**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

pass_action
stencil_enabled

Enables or disables the stencil test.

stencil_function

Selects the compare mode function (see – glStencilFunc).

stencil_mask

A bit mask. The default is 0xffffffff.

stencil_ref

Unknown. Default is 0.

z_fail_action
class NiStringExtraData(template=None, argument=None, parent=None)

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.

bytes_remaining

The number of bytes left in the record. Equals the length of the following string + 4.

string_data

The string.

class NiStringPalette(template=None, argument=None, parent=None)

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.

palette

A bunch of 0x00 seperated strings.

class NiStringsExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

List of strings; for example, a list of all bone names.

data

The strings.

num_strings

Number of strings.

class NiSwitchNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

A node used to switch between branches, such as for LOD levels?

unknown_flags_1

Flags

unknown_int_1

Index?

class NiTextKeyExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Extra data, used to name different animation sequences.

num_text_keys

The number of text keys that follow.

text_keys

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_int_1

Unknown. Always equals zero in all official files.

class NiTexture(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObjectNET

A texture.

class NiTextureEffect(template=None, argument=None, parent=None)

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).

clipping_plane

Determines whether a clipping plane is used. 0 means that a plane is not used.

coordinate_generation_type

The method that will be used to generate UV coordinates for the texture effect.

image

Image index.

model_projection_matrix

Model projection matrix. Always identity?

model_projection_transform

Model projection transform. Always (0,0,0)?

ps_2_k

-75?

ps_2_l

0?

source_texture

Source texture index.

texture_clamping

Texture Clamp mode.

texture_filtering

Texture Filtering mode.

texture_type

The type of effect that the texture is used for.

unknown
unknown_float

Unknown. 0?

unknown_short

Unknown

unknown_vector

Unknown – (1,0,0)?

class NiTextureModeProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Unknown

ps_2_k

-75?

ps_2_l

0?

unknown_ints
unknown_short

Unknown. Either 210 or 194.

class NiTextureProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

flags

Property flags.

image

Link to the texture image.

unknown_ints_1

Property flags.

unknown_ints_2

Unknown. 0?

class NiTextureTransformController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiFloatInterpController

Texture transformation controller. The target texture slot should have “Has Texture Transform” enabled.

data

Link to NiFloatData.

operation

Determines how this controller animates the UV Coordinates.

texture_slot

The target texture slot.

unknown_2

Unknown.

class NiTexturingProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Describes an object’s textures.

apply_mode

Determines how the texture will be applied. Seems to have special functions in Oblivion.

base_texture

The base texture.

bump_map_luma_offset

Unknown.

bump_map_luma_scale

Unknown.

bump_map_matrix

Unknown.

bump_map_texture

The bump map texture.

dark_texture

The dark texture.

decal_0_texture

The decal texture.

decal_1_texture

Another decal texture.

decal_2_texture

Another decal texture.

decal_3_texture

Another decal texture. Who knows the limit.

detail_texture

The detail texture.

flags

Property flags.

gloss_texture

The gloss texture.

glow_texture

The glowing texture.

has_base_texture

Do we have a base texture?

has_bump_map_texture

Do we have a bump map texture?

has_dark_texture

Do we have a dark texture?

has_decal_0_texture

Do we have a decal 0 texture?

has_decal_1_texture

Do we have a decal 1 texture?

has_decal_2_texture

Do we have a decal 2 texture?

has_decal_3_texture

Do we have a decal 3 texture?

has_detail_texture

Do we have a detail texture?

has_gloss_texture

Do we have a gloss texture?

has_glow_texture

Do we have a glow texture?

has_normal_texture

Do we have a normal texture? (Noraml guess based on file suffix in sample files)

has_unknown_2_texture

Do we have a unknown texture 2?

normal_texture

Normal texture.

num_shader_textures

Number of Shader textures that follow.

shader_textures

Shader textures.

texture_count

Number of textures. Always 7 in versions<20.0.0.4. Can also be 8 in>= 20.0.0.4.

unknown_2_float

Unknown.

unknown_2_texture

Unknown texture 2.

class NiTimeController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

A generic time controller object.

flags

**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

Frequency (is usually 1.0).

next_controller

Index of the next controller.

phase

Phase (usually 0.0).

start_time

Controller start time.

stop_time

Controller stop time.

target

Controller target (object index of the first controllable ancestor of this object).

unknown_integer

Unknown integer.

class NiTransformController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyframeController

NiTransformController replaces the NiKeyframeController.

class NiTransformData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiKeyframeData

Mesh animation keyframe data.

class NiTransformEvaluator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

class NiTransformInterpolator(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiTransformInterpolator, object

apply_scale(scale)

Apply scale factor <scale> on data.

class NiTransparentProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Unknown

unknown

Unknown.

class NiTriBasedGeom(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiTriBasedGeom, object

get_interchangeable_tri_shape(triangles=None)

Returns a NiTriShape block that is geometrically interchangeable. If you do not want to set the triangles from the original shape, use the triangles argument.

get_interchangeable_tri_strips(strips=None)

Returns a NiTriStrips block that is geometrically interchangeable. If you do not want to set the strips from the original shape, use the strips argument.

get_tangent_space()

Return iterator over normal, tangent, bitangent vectors. If the block has no tangent space, then returns None.

update_skin_center_radius()

Update centers and radii of all skin data fields.

update_skin_partition(maxbonesperpartition=4, maxbonespervertex=4, verbose=0, stripify=True, stitchstrips=False, padbones=False, triangles=None, trianglepartmap=None, maximize_bone_sharing=False)

Recalculate skin partition data.

Deprecated:

Do not use the verbose argument.

Parameters:
  • maxbonesperpartition – Maximum number of bones in each partition. The num_bones field will not exceed this number.
  • maxbonespervertex – Maximum number of bones per vertex. The num_weights_per_vertex field will be exactly equal to this number.
  • verbose – Ignored, and deprecated. Set pyffi’s log level instead.
  • stripify – If true, stripify the partitions, otherwise use triangles.
  • stitchstrips – If stripify is true, then set this to true to stitch the strips.
  • padbones – Enforces the numbones field to be equal to maxbonesperpartition. Also ensures that the bone indices are unique and sorted, per vertex. Raises an exception if maxbonespervertex is not equal to maxbonesperpartition (in that case bone indices cannot be unique and sorted). This options is required for Freedom Force vs. the 3rd Reich skin partitions.
  • triangles – The triangles of the partition (if not specified, then this defaults to C{self.data.get_triangles()}.
  • trianglepartmap – Maps each triangle to a partition index. Faces with different indices will never appear in the same partition. If the skin instance is a BSDismemberSkinInstance, then these indices are used as body part types, and the partitions in the BSDismemberSkinInstance are updated accordingly. Note that the faces are counted relative to L{triangles}.
  • maximize_bone_sharing – Maximize bone sharing between partitions. This option is useful for Fallout 3.
update_tangent_space(as_extra=None, vertexprecision=3, normalprecision=3)

Recalculate tangent space data.

Parameters:as_extra – Whether to store the tangent space data as extra data (as in Oblivion) or not (as in Fallout 3). If not set, switches to Oblivion if an extra data block is found, otherwise does default. Set it to override this detection (for example when using this function to create tangent space data) and force behaviour.
class NiTriBasedGeomData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiTriBasedGeomData, object

get_triangle_indices(triangles)

Yield list of triangle indices (relative to self.get_triangles()) of given triangles. Degenerate triangles in the list are assigned index None.

>>> from pyffi.formats.nif import NifFormat
>>> geomdata = NifFormat.NiTriShapeData()
>>> geomdata.set_triangles([(0,1,2),(1,2,3),(2,3,4)])
>>> list(geomdata.get_triangle_indices([(1,2,3)]))
[1]
>>> list(geomdata.get_triangle_indices([(3,1,2)]))
[1]
>>> list(geomdata.get_triangle_indices([(2,3,1)]))
[1]
>>> list(geomdata.get_triangle_indices([(1,2,0),(4,2,3)]))
[0, 2]
>>> list(geomdata.get_triangle_indices([(0,0,0),(4,2,3)]))
[None, 2]
>>> list(geomdata.get_triangle_indices([(0,3,4),(4,2,3)])) 
Traceback (most recent call last):
    ...
ValueError: ...
Parameters:triangles (iterator or list of tuples of three ints) – An iterable of triangles to check.
is_interchangeable(other)

Heuristically checks if two NiTriBasedGeomData blocks describe the same geometry, that is, if they can be used interchangeably in a NIF file without affecting the rendering. The check is not fool proof but has shown to work in most practical cases.

Parameters:other (L{NifFormat.NiTriBasedGeomData} (if it has another type then the function will always return False)) – Another geometry data block.
Returns:True if the geometries are equivalent, False otherwise.
class NiTriShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriBasedGeom

A shape node that refers to singular triangle data.

class NiTriShapeData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiTriShapeData, object

Example usage:

>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiTriShapeData()
>>> block.set_triangles([(0,1,2),(2,1,3),(2,3,4)])
>>> block.get_strips()
[[0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 1, 2), (2, 1, 3), (2, 3, 4)]
>>> block.set_strips([[1,0,1,2,3,4]])
>>> block.get_strips() # stripifier keeps geometry but nothing else
[[0, 2, 1, 3], [2, 4, 3]]
>>> block.get_triangles()
[(0, 2, 1), (1, 2, 3), (2, 4, 3)]
get_strips()
get_triangles()
set_strips(strips)
set_triangles(triangles, stitchstrips=False)
class NiTriShapeSkinController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Old version of skinning instance.

bone_data

Contains skin weight data for each node that this skin is influenced by.

bones

List of all armature bones.

num_bones

The number of node bones referenced as influences.

vertex_counts

The number of vertex weights stored for each bone.

class NiTriStrips(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTriBasedGeom

A shape node that refers to data organized into strips of triangles

class NiTriStripsData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._NiTriStripsData, object

Example usage:

>>> from pyffi.formats.nif import NifFormat
>>> block = NifFormat.NiTriStripsData()
>>> block.set_triangles([(0,1,2),(2,1,3),(2,3,4)])
>>> block.get_strips()
[[0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 1, 2), (1, 3, 2), (2, 3, 4)]
>>> block.set_strips([[1,0,1,2,3,4]])
>>> block.get_strips()
[[1, 0, 1, 2, 3, 4]]
>>> block.get_triangles()
[(0, 2, 1), (1, 2, 3), (2, 4, 3)]
get_strips()
get_triangles()
set_strips(strips)
set_triangles(triangles, stitchstrips=False)
class NiUVController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Time controller for texture coordinates.

data

Texture coordinate controller data index.

unknown_short

Always 0?

class NiUVData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Texture coordinate data.

uv_groups

Four UV data groups. Appear to be U translation, V translation, U scaling/tiling, V scaling/tiling.

class NiVectorExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Extra vector data.

unknown_float

Not sure whether this comes before or after the vector data.

vector_data

The vector data.

class NiVertWeightsExtraData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiExtraData

Not used in skinning.Unsure of use - perhaps for morphing animation or gravity.

num_bytes

Number of bytes in this data object.

num_vertices

Number of vertices.

weight

The vertex weights.

class NiVertexColorProperty(template=None, argument=None, parent=None)

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.

flags

**Property flags. Appears to be unused until 20.1.0.3.Bits 0-2* – UnknownBit 3* – Lighting Mode?Bits 4-5: Vertex Mode?

lighting_mode

The light mode. In Flags from 20.1.0.3 on.

vertex_mode

Determines how vertex and material colors are mixed.related gl function – glColorMaterialIn Flags from version 20.1.0.3 onwards.

class NiVisController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiBoolInterpController

Time controller for visibility.

data

Visibility controller data object index.

class NiVisData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Visibility data for a controller.

keys

The visibility keys.

num_keys

The number of visibility keys that follow.

class NiWireframeProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

Unknown.

flags

Property flags.0 - Wireframe Mode Disabled1 - Wireframe Mode Enabled

class NiZBufferProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiProperty

This Property controls the Z buffer (OpenGL: depth buffer).

flags

Bit 0 enables the z testBit 1 controls wether the Z buffer is read only (0) or read/write (1)

function

Z-Test function (see – glDepthFunc). In Flags from 20.1.0.3 on.

exception NifError

Bases: Exception

Standard nif exception class.

class NodeGroup(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A group of NiNodes references.

nodes

The list of NiNode references.

num_nodes

Number of node references that follow.

class OblivionHavokMaterial(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

A material, used by havok shape objects in Oblivion.

HAVMATCHAIN = 13
HAVMATCHAINSTAIRS = 28
HAVMATCLOTH = 1
HAVMATCLOTHSTAIRS = 16
HAVMATDIRT = 2
HAVMATDIRTSTAIRS = 17
HAVMATELEVATOR = 30
HAVMATGLASS = 3
HAVMATGLASSSTAIRS = 18
HAVMATGRASS = 4
HAVMATGRASSSTAIRS = 19
HAVMATHEAVYMETAL = 11
HAVMATHEAVYMETALSTAIRS = 26
HAVMATHEAVYSTONE = 10
HAVMATHEAVYSTONESTAIRS = 25
HAVMATHEAVYWOOD = 12
HAVMATHEAVYWOODSTAIRS = 27
HAVMATMETAL = 5
HAVMATMETALSTAIRS = 20
HAVMATORGANIC = 6
HAVMATORGANICSTAIRS = 21
HAVMATRUBBER = 31
HAVMATSKIN = 7
HAVMATSKINSTAIRS = 22
HAVMATSNOW = 14
HAVMATSNOWSTAIRS = 29
HAVMATSTONE = 0
HAVMATSTONESTAIRS = 15
HAVMATWATER = 8
HAVMATWATERSTAIRS = 23
HAVMATWOOD = 9
HAVMATWOODSTAIRS = 24
class OblivionLayer(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Sets mesh color in Oblivion Construction Set. Anything higher than 57 is also null.

ANIMSTATIC = 2
AVOIDBOX = 21
BACKWEAPON = 53
BACKWEAPON2 = 54
BIPED = 8
BODY = 34
CAMERAPICK = 24
CHARCONTROLLER = 20
CLOUDTRAP = 16
CLUTTER = 4
CUSTOMPICK1 = 28
CUSTOMPICK2 = 29
DROPPINGPICK = 31
GROUND = 17
HEAD = 33
ITEMPICK = 25
LCALF = 41
LFOOT = 42
LFOREARM = 38
LHAND = 39
LINEOFSIGHT = 26
LTHIGH = 40
LUPPERARM = 37
NONCOLLIDABLE = 15
NULL = 57
OTHER = 32
PATHPICK = 27
PONYTAIL = 55
PORTAL = 18
PROJECTILE = 6
PROPS = 10
QUIVER = 52
RCALF = 47
RFOOT = 48
RFOREARM = 44
RHAND = 45
RTHIGH = 46
RUPPERARM = 43
SHIELD = 51
SIDEWEAPON = 50
SPELL = 7
SPELLEXPLOSION = 30
SPINE1 = 35
SPINE2 = 36
STAIRS = 19
STATIC = 1
TAIL = 49
TERRAIN = 13
TRANSPARENT = 3
TRAP = 14
TREES = 9
TRIGGER = 12
UNIDENTIFIED = 0
UNKNOWN1 = 22
UNKNOWN2 = 23
WATER = 11
WEAPON = 5
WING = 56
class OblivionSubShape(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Havok Information for packed TriStrip shapes.

havok_col_filter
material

The material of the subshape.

num_vertices

The number of vertices that form this sub shape.

class OldSkinData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Used to store skin weights in NiTriShapeSkinController.

unknown_vector

Unknown. Perhaps some sort of offset?

vertex_index

The index of the vertex that this weight applies to.

vertex_weight

The amount that this bone affects the vertex.

class PSLoopBehavior(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

PSLOOPAGESCALE = 2
PSLOOPCLAMPBIRTH = 0
PSLOOPCLAMPDEATH = 1
PSLOOPLOOP = 3
PSLOOPREFLECT = 4
class Particle(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

particle array entry

lifespan

Maximum age of the particle.

lifetime

The particle’s age.

timestamp

Timestamp of the last update.

unknown_short

Unknown short

unknown_vector

Unknown

velocity

Particle velocity

vertex_id

Particle/vertex index matches array index

class ParticleDesc(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Particle Description.

translation

Unknown.

unknown_float_1

Unknown.

unknown_float_2

Unknown.

unknown_float_3

Unknown.

unknown_floats_1

Unknown.

unknown_int_1

Unknown.

class PixelFormat(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Specifies the pixel format used by the NiPixelData object to store a texture.

PXFMTDXT1 = 4
PXFMTDXT5 = 5
PXFMTDXT5ALT = 6
PXFMTPAL8 = 2
PXFMTRGB8 = 0
PXFMTRGBA8 = 1
class PixelLayout(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, describing the color depth of a texture.

PIXLAYBUMPMAP = 4
PIXLAYCOMPRESSED = 3
PIXLAYDEFAULT = 6
PIXLAYHIGHCOLOR16 = 1
PIXLAYPALETTISED = 0
PIXLAYPALETTISED4 = 5
PIXLAYTRUECOLOR32 = 2
class Polygon(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Two dimensional screen elements.

num_triangles

Number of faces in this polygon

num_vertices

Number of vertices in this polygon

triangle_offset

Triangle offset in shape

vertex_offset

Vertex Offset

class PrismaticDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

friction

Friction.

max_distance

Describe the max distance the object is able to travel.

min_distance

Describe the min distance the object is able to travel.

pivot_a

Pivot.

pivot_b

Pivot in B coordinates.

plane_a

Plane normal. Describes the plane the object is able to move on.

plane_b

Plane normal. Describes the plane the object is able to move on in B coordinates.

rotation_a

Rotation axis.

rotation_b

Rotation axis.

rotation_matrix_a

4x4 rotation matrix, rotates the child entity.

sliding_a

Describes the axis the object is able to travel along. Unit vector.

sliding_b

Describes the axis the object is able to travel along in B coordinates. Unit vector.

unknown_byte_1

Unknown. Do not set this to anything over 0 as it will crash the game.

class PropagationMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

PROPAGATEALWAYS = 2
PROPAGATENEVER = 3
PROPAGATEONFAILURE = 1
PROPAGATEONSUCCESS = 0
class Ptr(**kwargs)

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.

get_hash(data=None)
get_refs(data=None)
get_value()
replace_global_node(oldbranch, newbranch, edge_filter=(True, True))
set_value(value)
class QTransform(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

rotation

Rotation.

scale

Scale.

translation

Translation.

class QuatKey(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A special version of the key type used for quaternions. Never has tangents.

tbc

The TBC of the key.

time

Time the key applies.

value

Value of the key.

class Quaternion(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A quaternion.

w

The w-coordinate.

x

The x-coordinate.

y

The y-coordinate.

z

The z-coordinate.

class QuaternionXYZW(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A quaternion as it appears in the havok objects.

w

The w-coordinate.

x

The x-coordinate.

y

The y-coordinate.

z

The z-coordinate.

RE_FILENAME = re.compile('^.*\\.(nif|kf|kfa|nifcache|jmi|texcache|pcpatch|nft|item|nif_wii)$', re.IGNORECASE)
class RagdollDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._RagdollDescriptor, object

update_a_b(transform)

Update B pivot and axes from A using the given transform.

class Ref(**kwargs)

Bases: pyffi.object_models.xml.basic.BasicBase

Reference to another block.

Fix block links.

get_detail_display()
get_hash(data=None)
get_refs(data=None)
get_size(data=None)
get_value()
read(stream, data)
replace_global_node(oldbranch, newbranch, edge_filter=(True, True))
>>> 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
set_value(value)
write(stream, data)

Write block reference.

class Region(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A range of indices, which make up a region (such as a submesh).

num_indices
start_index
class RootCollisionNode(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiNode

Morrowind-specific node for collision mesh.

class SemanticData(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

index

An extra index of the data. For example, if there are 3 uv maps,then the corresponding TEXCOORD data components would have indices0, 1, and 2, respectively.

name

Type of data (POSITION, POSITION_BP, INDEX, NORMAL, NORMAL_BP,TEXCOORD, BLENDINDICES, BLENDWEIGHT, BONE_PALETTE, COLOR, DISPLAYLIST,MORPH_POSITION, BINORMAL_BP, TANGENT_BP).

class ShaderTexDesc(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

An extended texture description for shader textures.

is_used

Is it used?

map_index

Map Index

texture_data

The texture data.

class ShortString(**kwargs)

Bases: pyffi.object_models.xml.basic.BasicBase

Another type for strings.

get_hash(data=None)
get_size(data=None)
get_value()
read(stream, data)
set_value(value)
write(stream, data)
class SizedString(**kwargs)

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'
get_hash(data=None)

Return a hash value for this string.

Returns:An immutable object that can be used as a hash.
get_size(data=None)

Return number of bytes this type occupies in a file.

Returns:Number of bytes.
get_value()

Return the string.

Returns:The stored string.
read(stream, data)

Read string from stream.

Parameters:stream (file) – The stream to read from.
set_value(value)

Set string to C{value}.

Parameters:value (str) – The value to assign.
write(stream, data)

Write string to stream.

Parameters:stream (file) – The stream to write to.
class SkinData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._SkinData, object

get_transform()

Return scale, rotation, and translation into a single 4x4 matrix.

set_transform(mat)

Set rotation, transform, and velocity.

class SkinPartition(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._SkinPartition, object

get_mapped_triangles()

Get list of triangles of this partition (mapping into the geometry data vertex list).

get_triangles()

Get list of triangles of this partition.

class SkinShape(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Reference to shape and skin instance.

shape

The shape.

skin_instance

Skinning instance for the shape?

class SkinShapeGroup(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Unknown.

First link is a NiTriShape object.Second link is a NiSkinInstance object.

Counts unknown.

class SkinTransform(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._SkinTransform, object

get_transform()

Return scale, rotation, and translation into a single 4x4 matrix.

set_transform(mat)

Set rotation, transform, and velocity.

class SkinWeight(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A weighted vertex.

index

The vertex index, in the mesh.

weight

The vertex weight - between 0.0 and 1.0

class SkyObjectType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Sets what sky function this object fulfills in BSSkyShaderProperty or SkyShaderProperty.

BSSMSKY = 2
BSSMSKYCLOUDS = 3
BSSMSKYMOONSTARSMASK = 7
BSSMSKYSTARS = 5
BSSMSKYSUNGLARE = 1
BSSMSKYTEXTURE = 0
class SkyShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderLightingProperty

Bethesda-specific node? Found in Fallout3

file_name

The texture.

sky_object_type

Sky Object Type

class SkyrimHavokMaterial(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

A material, used by havok shape objects in Skyrim.

MATBARREL = 732141076
MATBOTTLE = 493553910
MATBROKENSTONE = 131151687
MATCLOTH = 3839073443
MATDIRT = 3106094762
MATDRAGON = 2518321175
MATGLASS = 3739830338
MATGRASS = 1848600814
MATGRAVEL = 428587608
MATHEAVYMETAL = 2229413539
MATHEAVYSTONE = 1570821952
MATHEAVYWOOD = 3070783559
MATICE = 873356572
MATLIGHTWOOD = 365420259
MATMATERIALARMORHEAVY = 3708432437
MATMATERIALARMORLIGHT = 3424720541
MATMATERIALARROW = 3725505938
MATMATERIALAXE1HAND = 1305674443
MATMATERIALBASKET = 790784366
MATMATERIALBLADE1HAND = 1060167844
MATMATERIALBLADE1HANDSMALL = 2617944780
MATMATERIALBLADE2HAND = 2022742644
MATMATERIALBLUNT2HAND = 3969592277
MATMATERIALBONE = 3049421844
MATMATERIALBOOK = 1264672850
MATMATERIALBOTTLESMALL = 2025794648
MATMATERIALBOULDERLARGE = 1885326971
MATMATERIALBOULDERMEDIUM = 4283869410
MATMATERIALBOULDERSMALL = 1550912982
MATMATERIALBOWSSTAVES = 1607128641
MATMATERIALCARPET = 1286705471
MATMATERIALCERAMICMEDIUM = 781661019
MATMATERIALCHAIN = 3074114406
MATMATERIALCHAINMETAL = 438912228
MATMATERIALCOIN = 3589100606
MATMATERIALSHIELDHEAVY = 3702389584
MATMATERIALSHIELDLIGHT = 3448167928
MATMATERIALSKINLARGE = 2965929619
MATMATERIALSKINSMALL = 2632367422
MATMATERIALSTONEASSTAIRS = 1886078335
MATMATERIALWOODASSTAIRS = 1803571212
MATMUD = 1486385281
MATORGANIC = 2974920155
MATSAND = 2168343821
MATSKIN = 591247106
MATSNOW = 398949039
MATSOLIDMETAL = 1288358971
MATSTAIRSBROKENSTONE = 2892392795
MATSTAIRSSNOW = 1560365355
MATSTAIRSSTONE = 899511101
MATSTAIRSWOOD = 1461712277
MATSTONE = 3741512247
MATUNKNOWN1028101969 = 1028101969
MATUNKNOWN1440721808 = 1440721808
MATUNKNOWN1574477864 = 1574477864
MATUNKNOWN1591009235 = 1591009235
MATWATER = 1024582599
MATWOOD = 500811281
class SkyrimLayer(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Physical purpose of collision object? The setting affects object’s havok behavior in game. Anything higher than 47 is also null.

ACOUSTICSPACE = 21
ACTORZONE = 22
ANIMSTATIC = 2
AVOIDBOX = 34
BIPED = 8
BIPEDNOCC = 33
CAMERAPICK = 39
CAMERASHPERE = 36
CHARCONTROLLER = 30
CLOUDTRAP = 16
CLUTTER = 4
COLLISIONBOX = 35
CONEPROJECTILE = 38
CUSTOMPICK1 = 43
CUSTOMPICK2 = 44
DEADBIP = 32
DEBRISLARGE = 20
DEBRISSMALL = 19
DOORDETECTION = 37
DROPPINGPICK = 46
GASTRAP = 24
GROUND = 17
INVISIBLEWALL = 27
ITEMPICK = 40
LINEOFSIGHT = 41
NONCOLLIDABLE = 15
NULL = 47
PATHPICK = 42
PORTAL = 18
PROJECTILE = 6
PROJECTILEZONE = 23
PROPS = 10
SHELLCASING = 25
SPELL = 7
SPELLEXPLOSION = 45
STAIRHELPER = 31
STATIC = 1
TERRAIN = 13
TRANSPARENT = 3
TRANSPARENTSMALL = 26
TRANSPARENTSMALLANIM = 28
TRAP = 14
TREES = 9
TRIGGER = 12
UNIDENTIFIED = 0
WARD = 29
WATER = 11
WEAPON = 5
class SkyrimShaderPropertyFlags1(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

slsf_1_cast_shadows
slsf_1_decal
slsf_1_dynamic_decal
slsf_1_environment_mapping
slsf_1_external_emittance
slsf_1_eye_environment_mapping
slsf_1_face_gen_rgb_tint
slsf_1_facegen_detail_map
slsf_1_fire_refraction
slsf_1_greyscale_to_palette_alpha
slsf_1_greyscale_to_palette_color
slsf_1_hair_soft_lighting
slsf_1_landscape
slsf_1_localmap_hide_secret
slsf_1_model_space_normals
slsf_1_multiple_textures
slsf_1_non_projective_shadows
slsf_1_own_emit
slsf_1_parallax
slsf_1_parallax_occlusion
slsf_1_projected_uv
slsf_1_recieve_shadows
slsf_1_refraction
slsf_1_remappable_textures
slsf_1_screendoor_alpha_fade
slsf_1_skinned
slsf_1_soft_effect
slsf_1_specular
slsf_1_temp_refraction
slsf_1_use_falloff
slsf_1_vertex_alpha
slsf_1_z_buffer_test
class SkyrimShaderPropertyFlags2(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

slsf_2_anisotropic_lighting
slsf_2_assume_shadowmask
slsf_2_back_lighting
slsf_2_billboard
slsf_2_cloud_lod
slsf_2_double_sided
slsf_2_effect_lighting
slsf_2_env_map_light_fade
slsf_2_fit_slope
slsf_2_glow_map
slsf_2_hd_lod_objects
slsf_2_hide_on_local_map
slsf_2_lod_landscape
slsf_2_lod_objects
slsf_2_multi_index_snow
slsf_2_multi_layer_parallax
slsf_2_no_fade
slsf_2_no_lod_land_blend
slsf_2_no_transparency_multisampling
slsf_2_packed_tangent
slsf_2_premult_alpha
slsf_2_rim_lighting
slsf_2_soft_lighting
slsf_2_tree_anim
slsf_2_uniform_scale
slsf_2_unused_01
slsf_2_unused_02
slsf_2_vertex_colors
slsf_2_vertex_lighting
slsf_2_weapon_blood
slsf_2_wireframe
slsf_2_z_buffer_write
class SkyrimWaterShaderFlags(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.bit_struct.BitStructBase

swsf_1_bypass_refraction_map
swsf_1_enabled
swsf_1_highlight_layer_toggle
swsf_1_unknown_0
swsf_1_unknown_3
swsf_1_unknown_4
swsf_1_unknown_5
swsf_1_water_toggle
class SolverDeactivation(**kwargs)

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.

SOLVERDEACTIVATIONHIGH = 4
SOLVERDEACTIVATIONINVALID = 0
SOLVERDEACTIVATIONLOW = 2
SOLVERDEACTIVATIONMAX = 5
SOLVERDEACTIVATIONMEDIUM = 3
SOLVERDEACTIVATIONOFF = 1
class SortingMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

SORTINGINHERIT = 0
SORTINGOFF = 1
class SphereBV(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A sphere.

center

The sphere’s center.

radius

The sphere’s radius.

class StencilAction(**kwargs)

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.

ACTIONDECREMENT = 4
ACTIONINCREMENT = 3
ACTIONINVERT = 5
ACTIONKEEP = 0
ACTIONREPLACE = 2
ACTIONZERO = 1
class StencilCompareMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

This enum contains the options for doing stencil buffer tests.

TESTALWAYS = 7
TESTEQUAL = 2
TESTGREATER = 4
TESTGREATEREQUAL = 6
TESTLESS = 1
TESTLESSEQUAL = 3
TESTNEVER = 0
TESTNOTEQUAL = 5
class StiffSpringDescriptor(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

length

Length.

pivot_a

Pivot A.

pivot_b

Pivot B.

StringIndex

alias of UInt

class StringOffset(**kwargs)

Bases: pyffi.object_models.common.Int

This is just an integer with -1 as default value.

class StringPalette(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._StringPalette, object

add_string(text)

Adds string to palette (will recycle existing strings if possible) and return offset to the string in the palette.

>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> pal.add_string("")
-1
>>> print(pal.get_string(4).decode("ascii"))
def
clear()

Clear all strings in the palette.

>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
'abc\x00def\x00'
>>> pal.clear()
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
''
get_all_strings()

Return a list of all strings.

>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> for x in pal.get_all_strings():
...     print(x.decode("ascii"))
abc
def
>>> # pal.palette.decode("ascii") needs lstrip magic for py3k
>>> print(repr(pal.palette.decode("ascii")).lstrip("u"))
'abc\x00def\x00'
get_string(offset)

Return string at given offset.

>>> from pyffi.formats.nif import NifFormat
>>> pal = NifFormat.StringPalette()
>>> pal.add_string("abc")
0
>>> pal.add_string("def")
4
>>> print(pal.get_string(0).decode("ascii"))
abc
>>> print(pal.get_string(4).decode("ascii"))
def
>>> pal.get_string(5) 
pyffi.nif.stringpalette:WARNING:StringPalette: no string starts at offset 5 (string is b'ef', preceeding character is b'd')
b'ef'
>>> pal.get_string(100) 
Traceback (most recent call last):
    ...
ValueError: ...
class SubConstraint(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

ball_and_socket
entities

Usually NONE. The entities affected by this constraint.

hinge
limited_hinge
num_entities

Usually 2. Number of bodies affected by this constraint.

priority

Usually 1. Higher values indicate higher priority of this constraint?

prismatic
ragdoll
stiff_spring
type

Type of constraint.

class SymmetryType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines symetry type used by NiPSysBombModifier.

CYLINDRICALSYMMETRY = 1
PLANARSYMMETRY = 2
SPHERICALSYMMETRY = 0
class SyncPoint(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Specifies the time when an application must syncronize for some reason.

SYNCANY = 32768
SYNCPHYSICSCOMPLETED = 32864
SYNCPHYSICSSIMULATE = 32848
SYNCPOSTUPDATE = 32800
SYNCREFLECTIONS = 32880
SYNCRENDER = 32832
SYNCUPDATE = 32784
SYNCVISIBLE = 32816
class TBC(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Tension, bias, continuity.

b

Bias.

c

Continuity.

t

Tension.

class TallGrassShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node.

file_name

Texture file name

class TargetColor(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Used by NiPoint3InterpControllers to select which type of color in the controlled object that will be animated.

TCAMBIENT = 0
TCDIFFUSE = 1
TCSELFILLUM = 3
TCSPECULAR = 2
class TexClampMode(**kwargs)

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.

CLAMPSCLAMPT = 0
CLAMPSWRAPT = 1
WRAPSCLAMPT = 2
WRAPSWRAPT = 3
class TexCoord(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._TexCoord, object

as_list()
normalize()
class TexDesc(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Texture description.

center_offset

The offset from the origin?

clamp_mode

0=clamp S clamp T, 1=clamp S wrap T, 2=wrap S clamp T, 3=wrap S wrap T

filter_mode

0=nearest, 1=bilinear, 2=trilinear, 3=…, 4=…, 5=…

flags

Texture mode flags; clamp and filter mode stored in upper byte with 0xYZ00 = clamp mode Y, filter mode Z.

has_texture_transform

Determines whether or not the texture’s coordinates are transformed.

ps_2_k

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.

ps_2_l

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”.

source

NiSourceTexture object index.

tiling

The number of times the texture is tiled in each direction?

transform_type

The texture transform type? Doesn’t seem to do anything.

translation

The amount to translate the texture coordinates in each direction?

unknown_1

Unknown, 0 or 0x0101?

unknown_short

Unknown, seems to always be 1

uv_set

The texture coordinate set in NiGeometryData that this texture slot will use.

w_rotation

2D Rotation of texture image around third W axis after U and V.

class TexFilterMode(**kwargs)

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.

FILTERBILERP = 1
FILTERBILERPMIPNEAREST = 5
FILTERNEAREST = 0
FILTERNEARESTMIPLERP = 4
FILTERNEARESTMIPNEAREST = 3
FILTERTRILERP = 2
class TexSource(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A texture source.

file_name

The original source filename of the image embedded by the referred NiPixelData object.

pixel_data

Pixel data object index.

unknown_byte

Unknown.

Unknown.

use_external

Is the texture external?

class TexTransform(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

Determines how a NiTextureTransformController animates the UV coordinates.

TTROTATE = 2
TTSCALEU = 3
TTSCALEV = 4
TTTRANSLATEU = 0
TTTRANSLATEV = 1
class TexType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of texture.

BASEMAP = 0
BUMPMAP = 5
DARKMAP = 1
DECAL0MAP = 8
DECAL1MAP = 9
DECAL2MAP = 10
DECAL3MAP = 11
DETAILMAP = 2
GLOSSMAP = 3
GLOWMAP = 4
NORMALMAP = 6
UNKNOWN2MAP = 7
class TileShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderLightingProperty

Bethesda-specific node.

file_name

Texture file name

class Triangle(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

List of three vertex indices.

v_1

First vertex index.

v_2

Second vertex index.

v_3

Third vertex index.

class UnionBV(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

bounding_volumes

Bounding Volume.

num_bv

Number of Bounding Volumes.

class Vector3(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Vector3, object

as_list()
as_tuple()
crossproduct(x)
get_copy()
norm(sqrt=<built-in function sqrt>)
normalize(ignore_error=False, sqrt=<built-in function sqrt>)
normalized(ignore_error=False)
class Vector4(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._Vector4, object

>>> from pyffi.formats.nif import NifFormat
>>> vec = NifFormat.Vector4()
>>> vec.x = 1.0
>>> vec.y = 2.0
>>> vec.z = 3.0
>>> vec.w = 4.0
>>> print(vec)
[  1.000  2.000  3.000  4.000 ]
>>> vec.as_list()
[1.0, 2.0, 3.0, 4.0]
>>> vec.as_tuple()
(1.0, 2.0, 3.0, 4.0)
>>> print(vec.get_vector_3())
[  1.000  2.000  3.000 ]
>>> vec2 = NifFormat.Vector4()
>>> vec == vec2
False
>>> vec2.x = 1.0
>>> vec2.y = 2.0
>>> vec2.z = 3.0
>>> vec2.w = 4.0
>>> vec == vec2
True
as_list()
as_tuple()
get_copy()
get_vector_3()
class VelocityType(**kwargs)

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.

VELOCITYUSEDIRECTION = 2
VELOCITYUSENORMALS = 0
VELOCITYUSERANDOM = 1
class VertMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

An unsigned 32-bit integer, which describes how to apply vertex colors.

VERTMODESRCAMBDIF = 2
VERTMODESRCEMISSIVE = 1
VERTMODESRCIGNORE = 0
class VolumetricFogShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node.

class WaterShaderProperty(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.BSShaderProperty

Bethesda-specific node? Found in Fallout3

class ZCompareMode(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

This enum contains the options for doing z buffer tests.

ZCOMPALWAYS = 0
ZCOMPEQUAL = 2
ZCOMPGREATER = 4
ZCOMPGREATEREQUAL = 6
ZCOMPLESS = 1
ZCOMPLESSEQUAL = 3
ZCOMPNEVER = 7
ZCOMPNOTEQUAL = 5
class bhkAabbPhantom(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShapePhantom

Bethesda-specific node.

unknown_ints_1
class bhkBallAndSocketConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkConstraint

A Ball and Socket Constraint.

ball_and_socket

Describes a ball and socket constraint

class bhkBallSocketConstraintChain(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSerializable

A Ball and Socket Constraint chain.

floats_1

Unknown

Unknown

Unknown

num_floats

Unknown

Number of links in the chain

Number of links in the chain

unknown_float_1

Unknown

unknown_float_2

Unknown

unknown_int_1

Unknown

unknown_int_2

Unknown

unknown_int_3

Unknown

class bhkBlendCollisionObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkCollisionObject

Unknown.

unknown_float_1

Blending parameter?

unknown_float_2

Another blending parameter?

class bhkBlendController(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiTimeController

Unknown. Is apparently only used in skeleton.nif files.

unknown_int

Seems to be always zero.

class bhkBoxShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkBoxShape, object

apply_scale(scale)

Apply scale factor C{scale} on data.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkBreakableConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkConstraint

A breakable constraint.

remove_if_broken

Unknown

sub_constraint

Constraint within constraint.

threshold

Amount of force to break the rigid bodies apart?

class bhkBvTreeShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

A tree-like Havok data structure stored in an assembly-like binary code?

class bhkCMSDBigTris(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Triangle indices used in pair with “Big Verts” in a bhkCompressedMeshShapeData.

triangle_1
triangle_2
triangle_3
unknown_int_1

Always 0?

unknown_short_1
class bhkCMSDChunk(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Defines subshape chunks in bhkCompressedMeshShapeData

indices
indices_2

Compressed

material_index

Index of material in bhkCompressedMeshShapeData::Chunk Materials

num_indices
num_indices_2

Number of

num_strips

Number of compressed strips

num_vertices

Number of compressed vertices

strips

Compressed strips

transform_index

Index of transformation in bhkCompressedMeshShapeData::Chunk Transforms

translation

Local translation

unknown_short_1

Always 65535?

vertices

Compressed vertices

class bhkCMSDMaterial(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

Per-chunk material, used in bhkCompressedMeshShapeData

byte_set_to_0

Always set to 0. It is only remainder of “Layer” 32-bit integer above.

layer

Copy of Layer from bhkRigidBody. The value is stored as 32-bit integer.

material

Material.

short_set_to_0

Always set to 0. It is only remainder of “Layer” 32-bit integer above.

class bhkCMSDTransform(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A set of transformation data: translation and rotation

rotation

Rotation. Reference point for rotation is bhkRigidBody translation.

translation

A vector that moves the chunk by the specified amount. W is not used.

class bhkCapsuleShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkCapsuleShape, object

apply_scale(scale)

Apply scale factor <scale> on data.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkCollisionObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkNiCollisionObject

Havok related collision object?

class bhkCompressedMeshShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

Compressed collision mesh.

data

The collision mesh data.

radius

A shell with that radius is added around the shape.

scale

Scale

target

Points to root node?

unknown_4_bytes

Unknown.

unknown_float_1

Unknown.

unknown_float_3

Unknown

unknown_float_4

Unknown

unknown_float_5

Unknown

unknown_floats_1

Unknown

unknown_int_1

Unknown.

class bhkCompressedMeshShapeData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkRefObject

A compressed mesh shape for collision in Skyrim.

big_tris

Unknown

big_verts

Compressed Vertices?

bits_per_index

Number of bits in the shape-key reserved for a triangle index

bits_per_w_index

Number of bits in the shape-key reserved for a triangle index and its winding

bounds_max

The maximum boundary of the AABB (the coordinates of the corner with the highest numerical values)

bounds_min

The minimum boundary of the AABB (the coordinates of the corner with the lowest numerical values)

chunk_materials

Table (array) with sets of materials. Chunks refers to this table by index.

chunk_transforms

Table (array) with sets of transformations. Chunks refers to this table by index.

chunks
error

The radius of the storage mesh shape? Quantization error?

mask_index

Mask used to get the triangle index from a shape-key (common – 131071 = 0x1ffff)

mask_w_index

Mask used to get the triangle index and winding from a shape-key (common – 262143 = 0x3ffff)

num_big_tris

Unknown

num_big_verts

Unknown

num_chunks

Unknown

num_materials

Number of chunk materials

num_transforms

Number of chunk transformations

unknown_byte_1

Unknown

unknown_byte_2

Unknown

unknown_int_12

Unknown, end of block.

unknown_int_3

Unknown

unknown_int_4

Unknown

unknown_int_5

Unknown

unknown_int_6

Unknown

class bhkConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkConstraint, object

get_transform_a_b(parent)

Returns the transform of the first entity relative to the second entity. Root is simply a nif block that is a common parent to both blocks.

class bhkConvexListShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

A havok shape.A list of convex shapes.Do not put a bhkPackedNiTriStripsShape in the Sub Shapes. Use aseparate collision nodes without a list shape for those.Also, shapes collected in a bhkListShape may not have the correctwalking noise, so only use it for non-walkable objects.

material

The material of the shape.

num_sub_shapes

The number of sub shapes referenced.

sub_shapes

List of shapes.

unknown_byte_1

Unknown Flag

unknown_float_1

Unknown Flag

unknown_floats

Unknown. Set to (0.0,0.0,-0.0,0.0,0.0,-0.0), where -0.0 is 0x80000000 in hex.

class bhkConvexShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSphereRepShape

A havok shape.

class bhkConvexTransformShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkTransformShape

A convex transformed shape?

class bhkConvexVerticesShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkConvexVerticesShape, object

apply_scale(scale)

Apply scale factor on data.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkEntity(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkWorldObject

A havok node, describes physical properties.

class bhkHingeConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkConstraint

A hinge constraint.

hinge

Hinge constraing.

class bhkLimitedHingeConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkLimitedHingeConstraint, object

apply_scale(scale)

Scale data.

update_a_b(parent)

Update the B data from the A data. The parent argument is simply a common parent to the entities.

class bhkLiquidAction(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSerializable

Bethesda-specific node.

unknown_float_1

Unknown Flag

unknown_float_2

Unknown Flag

unknown_float_3

Unknown Flag

unknown_float_4

Unknown Flag

unknown_int_1

Unknown Flag

unknown_int_2

Unknown Flag

unknown_int_3

Unknown Flag

class bhkListShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkListShape, object

add_shape(shape, front=False)

Add shape to list.

get_mass_center_inertia(density=1, solid=True)

Return center of gravity and area.

remove_shape(shape)

Remove a shape from the shape list.

class bhkMalleableConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkMalleableConstraint, object

apply_scale(scale)

Scale data.

update_a_b(parent)

Update the B data from the A data.

class bhkMeshShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

num_strips_data

The number of strips data objects referenced.

num_unknown_floats
strips_data

Refers to a bunch of NiTriStripsData objects that make up this shape.

unknown_1
unknown_2
unknown_floats
class bhkMoppBvTreeShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkMoppBvTreeShape, object

get_mass_center_inertia(density=1, solid=True)

Return mass, center of gravity, and inertia tensor.

mopp_from_tree(tree)
parse_mopp(start=0, depth=0, toffset=0, verbose=False)

The mopp data is printed to the debug channel while parsed. Returns list of indices into mopp data of the bytes processed and a list of triangle indices encountered.

The verbose argument is ignored (and is deprecated).

split_triangles(ts, bbox, dir=0)

Direction 0=X, 1=Y, 2=Z

update_mopp()

Update the MOPP data, scale, and origin, and welding info.

@deprecated: use update_mopp_welding instead

update_mopp_welding()

Update the MOPP data, scale, and origin, and welding info.

update_origin_scale()

Update scale and origin.

class bhkMultiSphereShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkMultiSphereShape, object

get_mass_center_inertia(density=1, solid=True)

Return center of gravity and area.

class bhkNiCollisionObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiCollisionObject

Havok related collision object?

body

Links to the collision object data

flags

Set to 1 for most objects, and to 41 for animated objects (ANIM_STATIC). Bits – 0=Active 2=Notify 3=Set Local 6=Reset.

class bhkNiTriStripsShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkNiTriStripsShape, object

get_interchangeable_packed_shape()

Returns a bhkPackedNiTriStripsShape block that is geometrically interchangeable.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkOrientHingedBodyAction(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSerializable

Bethesda-Specific node.

unknown_ints_1
class bhkPCollisionObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkNiCollisionObject

Unknown.

class bhkPackedNiTriStripsShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkPackedNiTriStripsShape, object

add_shape(triangles, normals, vertices, layer=0, material=0)

Pack the given geometry.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

get_sub_shapes()

Return sub shapes (works for both Oblivion and Fallout 3).

get_triangle_hash_generator()

Generator which produces a tuple of integers, or None in degenerate case, for each triangle to ease detection of duplicate triangles.

>>> shape = NifFormat.bhkPackedNiTriStripsShape()
>>> data = NifFormat.hkPackedNiTriStripsData()
>>> shape.data = data
>>> data.num_triangles = 6
>>> data.triangles.update_size()
>>> data.triangles[0].triangle.v_1 = 0
>>> data.triangles[0].triangle.v_2 = 1
>>> data.triangles[0].triangle.v_3 = 2
>>> data.triangles[1].triangle.v_1 = 2
>>> data.triangles[1].triangle.v_2 = 1
>>> data.triangles[1].triangle.v_3 = 3
>>> data.triangles[2].triangle.v_1 = 3
>>> data.triangles[2].triangle.v_2 = 2
>>> data.triangles[2].triangle.v_3 = 1
>>> data.triangles[3].triangle.v_1 = 3
>>> data.triangles[3].triangle.v_2 = 1
>>> data.triangles[3].triangle.v_3 = 2
>>> data.triangles[4].triangle.v_1 = 0
>>> data.triangles[4].triangle.v_2 = 0
>>> data.triangles[4].triangle.v_3 = 3
>>> data.triangles[5].triangle.v_1 = 1
>>> data.triangles[5].triangle.v_2 = 3
>>> data.triangles[5].triangle.v_3 = 4
>>> list(shape.get_triangle_hash_generator())
[(0, 1, 2), (1, 3, 2), (1, 3, 2), (1, 2, 3), None, (1, 3, 4)]
Returns:A generator yielding a hash value for each triangle.
get_vertex_hash_generator(vertexprecision=3, subshape_index=None)

Generator which produces a tuple of integers for each vertex to ease detection of duplicate/close enough to remove vertices. The precision parameter denote number of significant digits behind the comma.

For vertexprecision, 3 seems usually enough (maybe we’ll have to increase this at some point).

>>> shape = NifFormat.bhkPackedNiTriStripsShape()
>>> data = NifFormat.hkPackedNiTriStripsData()
>>> shape.data = data
>>> shape.num_sub_shapes = 2
>>> shape.sub_shapes.update_size()
>>> data.num_vertices = 3
>>> shape.sub_shapes[0].num_vertices = 2
>>> shape.sub_shapes[1].num_vertices = 1
>>> data.vertices.update_size()
>>> data.vertices[0].x = 0.0
>>> data.vertices[0].y = 0.1
>>> data.vertices[0].z = 0.2
>>> data.vertices[1].x = 1.0
>>> data.vertices[1].y = 1.1
>>> data.vertices[1].z = 1.2
>>> data.vertices[2].x = 2.0
>>> data.vertices[2].y = 2.1
>>> data.vertices[2].z = 2.2
>>> list(shape.get_vertex_hash_generator())
[(0, (0, 100, 200)), (0, (1000, 1100, 1200)), (1, (2000, 2100, 2200))]
>>> list(shape.get_vertex_hash_generator(subshape_index=0))
[(0, 100, 200), (1000, 1100, 1200)]
>>> list(shape.get_vertex_hash_generator(subshape_index=1))
[(2000, 2100, 2200)]
Parameters:vertexprecision (float) – Precision to be used for vertices.
Returns:A generator yielding a hash value for each vertex.
class bhkPhantom(template=None, argument=None, parent=None)

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.

class bhkPrismaticConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkConstraint

A prismatic constraint.

prismatic

Describes a prismatic constraint

class bhkRDTConstraint(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

entity_a

Entity A in this constraint.

entity_b

Entity B in this constraint.

malleable_constraint
priority

Usually 1. Higher values indicate higher priority of this constraint?

ragdoll
type

Type of constraint.7 = RagDoll Constraint?13 = Malleable Constraint?

unknown_int

Unknown. Usually 2.

class bhkRDTMalleableConstraint(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A malleable constraint.

damping
entity_a

Usually -1?

entity_b

Usually -1?

hinge
limited_hinge
priority

Usually 1. Higher values indicate higher priority of this constraint?

ragdoll
type

Type of constraint.

unknown_int

Unknown. Usually 2.

class bhkRagdollConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkRagdollConstraint, object

apply_scale(scale)

Scale data.

update_a_b(parent)

Update the B data from the A data.

class bhkRagdollTemplate(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Found in Fallout 3, more ragdoll info? (meshesragdollconstraint*.rdt)

bones

Bones in index

name
num_bones

Number of target bones

class bhkRagdollTemplateData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.NiObject

Data for bhkRagdollTemplate

constraint

Unknown

flag_or_num_constraints

**Either a flag or a number of constraints.0* – no Constraint is present.1* – a Constraint is present.

friction

Probably a Friction for bhkRigidBody linked to this bone node.

mass

Probably a Mass for bhkRigidBody linked to this bone node.

name
radius

Probably a Radius for collision object shape of bhkRigidBody linked to this bone node.

restitution

Probably a Restitution for bhkRigidBody linked to this bone node.

unknown_int

Unknown. Dependent on value of User Version 2?Value 7 found in Fallout3 meshesragdollconstraintdefault.rdt. This file has User Version 2 = 34.Value 0 found in Fallout3 meshesragdollconstraintstiff.rdt. This file has User Version 2 = 16.

class bhkRefObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkRefObject, object

get_shape_mass_center_inertia(density=1, solid=True)

Return mass, center of gravity, and inertia tensor of this object’s shape, if self.shape is not None.

If self.shape is None, then returns zeros for everything.

class bhkRigidBody(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkRigidBody, object

apply_scale(scale)

Apply scale factor <scale> on data.

update_mass_center_inertia(density=1, solid=True, mass=None)

Look at all the objects under this rigid body and update the mass, center of gravity, and inertia tensor accordingly. If the C{mass} parameter is given then the C{density} argument is ignored.

class bhkRigidBodyT(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkRigidBody

Unknown.

class bhkSPCollisionObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkPCollisionObject

Unknown.

class bhkSerializable(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkRefObject

Havok objects that can be saved and loaded from disk?

class bhkShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSerializable

A Havok Shape?

class bhkShapeCollection(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

Havok collision object that uses multiple shapes?

class bhkShapePhantom(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkPhantom

A Havok phantom that uses a Havok shape object for its collision volume instead of just a bounding box.

class bhkSimpleShapePhantom(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShapePhantom

Unknown shape.

unknown_float

Unknown.

unknown_floats_2

Unknown. (1,0,0,0,0) x 3.

unkown_floats

Unknown.

class bhkSphereRepShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkShape

A havok shape, perhaps with a bounding sphere for quick rejection in addition to more detailed shape data?

material

The material of the shape.

radius

The radius of the sphere that encloses the shape.

class bhkSphereShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkSphereShape, object

apply_scale(scale)

Apply scale factor <scale> on data.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkStiffSpringConstraint(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkConstraint

A spring constraint.

stiff_spring

Stiff Spring constraint.

class bhkTransformShape(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._bhkTransformShape, object

apply_scale(scale)

Apply scale factor <scale> on data.

get_mass_center_inertia(density=1, solid=True)

Return mass, center, and inertia tensor.

class bhkWorldObject(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif.bhkSerializable

Havok objects that have a position in the world?

havok_col_filter
shape

Link to the body for this collision object.

class bool(**kwargs)

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
get_hash(data=None)
get_size(data=None)
get_value()
read(stream, data)
set_value(value)
write(stream, data)
byte

alias of UByte

char

alias of Char

float

alias of Float

games = {'Dark Age of Camelot': [33751040, 50332416, 50397184, 67174412, 67240192, 67240448, 167837696], 'Star Trek: Bridge Commander': [50331648, 50397184], 'Oblivion': [50528269, 167772416, 167772418, 167837797, 167837802, 167903232, 335544324, 335544325], 'Freedom Force': [67108864, 67108866], 'Morrowind': [67108866], 'Civilization IV': [67239938, 67240192, 67240448, 167772416, 167837696, 167903232, 335544324], 'Empire Earth II': [67240448, 167837696], 'Culpa Innata': [67240448], 'Zoo Tycoon 2': [167772416], '?': [167772419], 'Freedom Force vs. the 3rd Reich': [167837696], 'Axis and Allies': [167837696], 'Kohan 2': [167837696], 'Entropia Universe': [167837696], 'Wildlife Park 2': [167837696, 167903232], 'The Guild 2': [167837696], 'NeoSteam': [167837696], 'Loki': [167903232], 'Pro Cycling Manager': [167903232], 'Prison Tycoon': [167903232], 'Red Ocean': [167903232], 'Worldshift': [167903233, 168034305], "Sid Meier's Railroads": [335544324], 'Megami Tensei: Imagine': [335609859], 'Emerge': [335675399, 335675400, 335740929, 335740930, 335740931, 335740934, 503316482], 'Empire Earth III': [335675399, 335675400], 'Fallout 3': [335675399], 'Skyrim': [335675399], 'Atlantica': [335675400], 'Warhammer': [335740937], 'Lazeska': [335740937], 'Divinity 2': [335740937], 'Howling Sword': [335740937], 'Bully SE': [335740937], 'KrazyRain': [335872000, 335937536], 'Epic Mickey': [335938816], 'Rocksmith': [503382019], 'Rocksmith 2014': [503382019]}
class hkConstraintType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

The type of constraint.

BallAndSocket = 0
Hinge = 1
LimitedHinge = 2
Prismatic = 6
Ragdoll = 7
StiffSpring = 8
class hkPackedNiTriStripsData(template=None, argument=None, parent=None)

Bases: pyffi.formats.nif._hkPackedNiTriStripsData, object

apply_scale(scale)

Apply scale factor on data.

class hkResponseType(**kwargs)

Bases: pyffi.object_models.xml.enum.EnumBase

RESPONSEINVALID = 0
RESPONSENONE = 3
RESPONSEREPORTING = 2
RESPONSESIMPLECONTACT = 1
class hkTriangle(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

A triangle with extra data used for physics.

normal

This is the triangle’s normal.

triangle

The triangle.

welding_info

Additional havok information on how triangles are welded.

int

alias of Int

class physXMaterialRef(template=None, argument=None, parent=None)

Bases: pyffi.object_models.xml.struct_.StructBase

material_desc

PhysX Material Description

number

Unknown

unknown_byte_1

Unknown

short

alias of Short

class string(**kwargs)

Bases: pyffi.object_models.common.SizedString

get_hash(data=None)
get_size(data=None)
get_strings(data)
read(stream, data)
write(stream, data)
uint

alias of UInt

ulittle32

alias of ULittle32

ushort

alias of UShort

static version_number(version_str)

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'
versions = {'2.3': 33751040, '3.0': 50331648, '3.03': 50332416, '3.1': 50397184, '3.3.0.13': 50528269, '4.0.0.0': 67108864, '4.0.0.2': 67108866, '4.1.0.12': 67174412, '4.2.0.2': 67239938, '4.2.1.0': 67240192, '4.2.2.0': 67240448, '10.0.1.0': 167772416, '10.0.1.2': 167772418, '10.0.1.3': 167772419, '10.1.0.0': 167837696, '10.1.0.101': 167837797, '10.1.0.106': 167837802, '10.2.0.0': 167903232, '10.2.0.1': 167903233, '10.4.0.1': 168034305, '20.0.0.4': 335544324, '20.0.0.5': 335544325, '20.1.0.3': 335609859, '20.2.0.7': 335675399, '20.2.0.8': 335675400, '20.3.0.1': 335740929, '20.3.0.2': 335740930, '20.3.0.3': 335740931, '20.3.0.6': 335740934, '20.3.0.9': 335740937, '20.5.0.0': 335872000, '20.6.0.0': 335937536, '20.6.5.0': 335938816, '30.0.0.2': 503316482, '30.1.0.3': 503382019}
xml_alias = []
xml_bit_struct = [<bit_struct 'BSSegmentFlags'>, <bit_struct 'FurnitureEntryPoints'>, <bit_struct 'BSPartFlag'>, <bit_struct 'BSShaderFlags'>, <bit_struct 'BSShaderFlags2'>, <bit_struct 'SkyrimShaderPropertyFlags1'>, <bit_struct 'SkyrimShaderPropertyFlags2'>, <bit_struct 'SkyrimWaterShaderFlags'>, <bit_struct 'DataStreamAccess'>]
xml_enum = [<enum 'AlphaFormat'>, <enum 'ApplyMode'>, <enum 'TexType'>, <enum 'KeyType'>, <enum 'LightMode'>, <enum 'OblivionHavokMaterial'>, <enum 'Fallout3HavokMaterial'>, <enum 'SkyrimHavokMaterial'>, <enum 'OblivionLayer'>, <enum 'Fallout3Layer'>, <enum 'SkyrimLayer'>, <enum 'MoppDataBuildType'>, <enum 'MipMapFormat'>, <enum 'PixelFormat'>, <enum 'PixelLayout'>, <enum 'TexClampMode'>, <enum 'TexFilterMode'>, <enum 'VertMode'>, <enum 'CycleType'>, <enum 'FieldType'>, <enum 'BillboardMode'>, <enum 'StencilCompareMode'>, <enum 'ZCompareMode'>, <enum 'StencilAction'>, <enum 'FaceDrawMode'>, <enum 'MotionSystem'>, <enum 'DeactivatorType'>, <enum 'SolverDeactivation'>, <enum 'MotionQuality'>, <enum 'ForceType'>, <enum 'TexTransform'>, <enum 'DecayType'>, <enum 'SymmetryType'>, <enum 'VelocityType'>, <enum 'EmitFrom'>, <enum 'EffectType'>, <enum 'CoordGenType'>, <enum 'EndianType'>, <enum 'TargetColor'>, <enum 'ConsistencyType'>, <enum 'SortingMode'>, <enum 'PropagationMode'>, <enum 'CollisionMode'>, <enum 'BoundVolumeType'>, <enum 'hkResponseType'>, <enum 'BSDismemberBodyPartType'>, <enum 'BSLightingShaderPropertyShaderType'>, <enum 'EffectShaderControlledVariable'>, <enum 'EffectShaderControlledColor'>, <enum 'LightingShaderControlledVariable'>, <enum 'LightingShaderControlledColor'>, <enum 'ExtraVectorsFlags'>, <enum 'hkConstraintType'>, <enum 'AnimationType'>, <enum 'ImageType'>, <enum 'ChannelType'>, <enum 'ChannelConvention'>, <enum 'BSShaderType'>, <enum 'SkyObjectType'>, <enum 'CloningBehavior'>, <enum 'ComponentFormat'>, <enum 'DataStreamUsage'>, <enum 'MeshPrimitiveType'>, <enum 'SyncPoint'>, <enum 'PSLoopBehavior'>]
xml_file_name = 'nif.xml'
xml_file_path = [None, '/home/travis/build/niftools/pyffi/pyffi/formats/nif/nifxml']
xml_struct = [<struct 'Color3'>, <struct 'ByteColor3'>, <struct 'Color4'>, <struct 'ByteColor4'>, <struct '_Footer'>, <struct 'LODRange'>, <struct 'MatchGroup'>, <struct '_Vector3'>, <struct '_Vector4'>, <struct 'Quaternion'>, <struct 'QuaternionXYZW'>, <struct 'Matrix22'>, <struct '_Matrix33'>, <struct '_Matrix44'>, <struct 'MipMap'>, <struct 'NodeGroup'>, <struct 'ns keylin'>, <struct 'ns keyarray'>, <struct 'ns keytan'>, <struct 'SkinShape'>, <struct 'SkinShapeGroup'>, <struct 'SkinWeight'>, <struct 'AVObject'>, <struct '_ControllerLink'>, <struct 'ExportInfo'>, <struct '_Header'>, <struct '_StringPalette'>, <struct 'TBC'>, <struct 'Key'>, <struct 'KeyGroup'>, <struct 'ns keytbc'>, <struct 'ns keyvecarray'>, <struct 'ns keyrotsub'>, <struct 'ns keyrotarray'>, <struct 'ns keyvecarraytyp'>, <struct 'QuatKey'>, <struct '_TexCoord'>, <struct 'TexDesc'>, <struct 'ShaderTexDesc'>, <struct 'TexSource'>, <struct 'Triangle'>, <struct '_SkinPartition'>, <struct 'QTransform'>, <struct 'MTransform'>, <struct '_SkinTransform'>, <struct 'BoundingBox'>, <struct 'FurniturePosition'>, <struct 'hkTriangle'>, <struct 'Morph'>, <struct 'Particle'>, <struct '_SkinData'>, <struct 'SphereBV'>, <struct 'HavokColFilter'>, <struct 'HavokMaterial'>, <struct 'OblivionSubShape'>, <struct 'MotorDescriptor'>, <struct '_RagdollDescriptor'>, <struct '_LimitedHingeDescriptor'>, <struct 'HingeDescriptor'>, <struct 'BallAndSocketDescriptor'>, <struct 'PrismaticDescriptor'>, <struct 'StiffSpringDescriptor'>, <struct 'OldSkinData'>, <struct 'MultiTextureElement'>, <struct 'BoxBV'>, <struct 'CapsuleBV'>, <struct 'HalfSpaceBV'>, <struct 'BoundingVolume'>, <struct 'UnionBV'>, <struct 'MorphWeight'>, <struct 'ArkTexture'>, <struct '_InertiaMatrix'>, <struct 'DecalVectorArray'>, <struct 'BodyPartList'>, <struct 'BSSegment'>, <struct 'BoneLOD'>, <struct 'bhkCMSDMaterial'>, <struct 'bhkCMSDBigTris'>, <struct 'bhkCMSDTransform'>, <struct 'bhkCMSDChunk'>, <struct 'SubConstraint'>, <struct 'bhkRDTConstraint'>, <struct 'bhkRDTMalleableConstraint'>, <struct '_NiObject'>, <struct 'Ni3dsAlphaAnimator'>, <struct 'Ni3dsAnimationNode'>, <struct 'Ni3dsColorAnimator'>, <struct 'Ni3dsMorphShape'>, <struct 'Ni3dsParticleSystem'>, <struct 'Ni3dsPathController'>, <struct 'NiParticleModifier'>, <struct 'NiPSysCollider'>, <struct '_bhkRefObject'>, <struct 'bhkSerializable'>, <struct 'bhkWorldObject'>, <struct 'bhkPhantom'>, <struct 'bhkShapePhantom'>, <struct 'bhkSimpleShapePhantom'>, <struct 'bhkEntity'>, <struct '_bhkRigidBody'>, <struct 'bhkRigidBodyT'>, <struct '_bhkConstraint'>, <struct '_bhkLimitedHingeConstraint'>, <struct '_bhkMalleableConstraint'>, <struct 'bhkStiffSpringConstraint'>, <struct '_bhkRagdollConstraint'>, <struct 'bhkPrismaticConstraint'>, <struct 'bhkHingeConstraint'>, <struct 'bhkBallAndSocketConstraint'>, <struct 'bhkBallSocketConstraintChain'>, <struct 'bhkShape'>, <struct '_bhkTransformShape'>, <struct 'bhkSphereRepShape'>, <struct 'bhkConvexShape'>, <struct '_bhkSphereShape'>, <struct '_bhkCapsuleShape'>, <struct '_bhkBoxShape'>, <struct '_bhkConvexVerticesShape'>, <struct 'bhkConvexTransformShape'>, <struct '_bhkMultiSphereShape'>, <struct 'bhkBvTreeShape'>, <struct '_bhkMoppBvTreeShape'>, <struct 'bhkShapeCollection'>, <struct '_bhkListShape'>, <struct 'bhkMeshShape'>, <struct '_bhkPackedNiTriStripsShape'>, <struct '_bhkNiTriStripsShape'>, <struct 'NiExtraData'>, <struct 'NiInterpolator'>, <struct 'NiKeyBasedInterpolator'>, <struct 'NiFloatInterpolator'>, <struct '_NiTransformInterpolator'>, <struct 'NiPoint3Interpolator'>, <struct 'NiPathInterpolator'>, <struct 'NiBoolInterpolator'>, <struct 'NiBoolTimelineInterpolator'>, <struct 'NiBlendInterpolator'>, <struct '_NiBSplineInterpolator'>, <struct '_NiObjectNET'>, <struct 'NiCollisionObject'>, <struct 'NiCollisionData'>, <struct 'bhkNiCollisionObject'>, <struct 'bhkCollisionObject'>, <struct 'bhkBlendCollisionObject'>, <struct 'bhkPCollisionObject'>, <struct 'bhkSPCollisionObject'>, <struct '_NiAVObject'>, <struct 'NiDynamicEffect'>, <struct 'NiLight'>, <struct 'NiProperty'>, <struct 'NiTransparentProperty'>, <struct 'NiPSysModifier'>, <struct 'NiPSysEmitter'>, <struct 'NiPSysVolumeEmitter'>, <struct 'NiTimeController'>, <struct 'NiInterpController'>, <struct 'NiMultiTargetTransformController'>, <struct 'NiGeomMorpherController'>, <struct 'NiMorphController'>, <struct 'NiMorpherController'>, <struct 'NiSingleInterpController'>, <struct 'NiKeyframeController'>, <struct 'NiTransformController'>, <struct 'NiPSysModifierCtlr'>, <struct 'NiPSysEmitterCtlr'>, <struct 'NiPSysModifierBoolCtlr'>, <struct 'NiPSysModifierActiveCtlr'>, <struct 'NiPSysModifierFloatCtlr'>, <struct 'NiPSysEmitterDeclinationCtlr'>, <struct 'NiPSysEmitterDeclinationVarCtlr'>, <struct 'NiPSysEmitterInitialRadiusCtlr'>, <struct 'NiPSysEmitterLifeSpanCtlr'>, <struct 'NiPSysEmitterSpeedCtlr'>, <struct 'NiPSysGravityStrengthCtlr'>, <struct 'NiFloatInterpController'>, <struct 'NiFlipController'>, <struct 'NiAlphaController'>, <struct 'NiTextureTransformController'>, <struct 'NiLightDimmerController'>, <struct 'NiBoolInterpController'>, <struct 'NiVisController'>, <struct 'NiPoint3InterpController'>, <struct '_NiMaterialColorController'>, <struct 'NiLightColorController'>, <struct 'NiExtraDataController'>, <struct 'NiFloatExtraDataController'>, <struct 'NiBoneLODController'>, <struct 'NiBSBoneLODController'>, <struct '_NiGeometry'>, <struct '_NiTriBasedGeom'>, <struct '_NiGeometryData'>, <struct 'AbstractAdditionalGeometryData'>, <struct '_NiTriBasedGeomData'>, <struct 'bhkBlendController'>, <struct '_BSBound'>, <struct 'BSFurnitureMarker'>, <struct 'BSParentVelocityModifier'>, <struct 'BSPSysArrayEmitter'>, <struct 'BSWindModifier'>, <struct '_hkPackedNiTriStripsData'>, <struct 'NiAlphaProperty'>, <struct 'NiAmbientLight'>, <struct 'NiParticlesData'>, <struct 'NiRotatingParticlesData'>, <struct 'NiAutoNormalParticlesData'>, <struct 'ParticleDesc'>, <struct 'NiPSysData'>, <struct 'NiMeshPSysData'>, <struct 'NiBinaryExtraData'>, <struct 'NiBinaryVoxelExtraData'>, <struct 'NiBinaryVoxelData'>, <struct 'NiBlendBoolInterpolator'>, <struct 'NiBlendFloatInterpolator'>, <struct 'NiBlendPoint3Interpolator'>, <struct 'NiBlendTransformInterpolator'>, <struct 'NiBoolData'>, <struct 'NiBooleanExtraData'>, <struct 'NiBSplineBasisData'>, <struct 'NiBSplineFloatInterpolator'>, <struct 'NiBSplineCompFloatInterpolator'>, <struct 'NiBSplinePoint3Interpolator'>, <struct 'NiBSplineCompPoint3Interpolator'>, <struct '_NiBSplineTransformInterpolator'>, <struct '_NiBSplineCompTransformInterpolator'>, <struct 'BSRotAccumTransfInterpolator'>, <struct '_NiBSplineData'>, <struct 'NiCamera'>, <struct 'NiColorData'>, <struct 'NiColorExtraData'>, <struct 'NiControllerManager'>, <struct 'NiSequence'>, <struct '_NiControllerSequence'>, <struct 'NiAVObjectPalette'>, <struct 'NiDefaultAVObjectPalette'>, <struct 'NiDirectionalLight'>, <struct 'NiDitherProperty'>, <struct 'NiRollController'>, <struct 'NiFloatData'>, <struct 'NiFloatExtraData'>, <struct 'NiFloatsExtraData'>, <struct 'NiFogProperty'>, <struct 'NiGravity'>, <struct 'NiIntegerExtraData'>, <struct 'BSXFlags'>, <struct 'NiIntegersExtraData'>, <struct 'BSKeyframeController'>, <struct '_NiKeyframeData'>, <struct 'NiLookAtController'>, <struct 'NiLookAtInterpolator'>, <struct '_NiMaterialProperty'>, <struct '_NiMorphData'>, <struct '_NiNode'>, <struct 'NiBone'>, <struct 'AvoidNode'>, <struct 'FxWidget'>, <struct 'FxButton'>, <struct 'FxRadioButton'>, <struct 'NiBillboardNode'>, <struct 'NiBSAnimationNode'>, <struct 'NiBSParticleNode'>, <struct 'NiSwitchNode'>, <struct 'NiLODNode'>, <struct 'NiPalette'>, <struct 'NiParticleBomb'>, <struct 'NiParticleColorModifier'>, <struct 'NiParticleGrowFade'>, <struct 'NiParticleMeshModifier'>, <struct 'NiParticleRotation'>, <struct 'NiParticles'>, <struct 'NiAutoNormalParticles'>, <struct 'NiParticleMeshes'>, <struct 'NiParticleMeshesData'>, <struct 'NiParticleSystem'>, <struct 'NiMeshParticleSystem'>, <struct 'NiParticleSystemController'>, <struct 'NiBSPArrayController'>, <struct 'NiPathController'>, <struct 'ChannelData'>, <struct '_ATextureRenderData'>, <struct 'NiPersistentSrcTextureRendererData'>, <struct 'NiPixelData'>, <struct 'NiPlanarCollider'>, <struct 'NiPointLight'>, <struct 'NiPosData'>, <struct 'NiPSysAgeDeathModifier'>, <struct 'NiPSysBombModifier'>, <struct 'NiPSysBoundUpdateModifier'>, <struct 'NiPSysBoxEmitter'>, <struct 'NiPSysColliderManager'>, <struct 'NiPSysColorModifier'>, <struct 'NiPSysCylinderEmitter'>, <struct 'NiPSysDragModifier'>, <struct 'NiPSysEmitterCtlrData'>, <struct 'NiPSysGravityModifier'>, <struct 'NiPSysGrowFadeModifier'>, <struct 'NiPSysMeshEmitter'>, <struct 'NiPSysMeshUpdateModifier'>, <struct 'BSPSysInheritVelocityModifier'>, <struct 'BSPSysHavokUpdateModifier'>, <struct 'BSPSysRecycleBoundModifier'>, <struct 'BSPSysSubTexModifier'>, <struct 'NiPSysPlanarCollider'>, <struct 'NiPSysSphericalCollider'>, <struct 'NiPSysPositionModifier'>, <struct 'NiPSysResetOnLoopCtlr'>, <struct 'NiPSysRotationModifier'>, <struct 'NiPSysSpawnModifier'>, <struct 'NiPSysSphereEmitter'>, <struct 'NiPSysUpdateCtlr'>, <struct 'NiPSysFieldModifier'>, <struct 'NiPSysVortexFieldModifier'>, <struct 'NiPSysGravityFieldModifier'>, <struct 'NiPSysDragFieldModifier'>, <struct 'NiPSysTurbulenceFieldModifier'>, <struct 'BSPSysLODModifier'>, <struct 'BSPSysScaleModifier'>, <struct 'NiPSysFieldMagnitudeCtlr'>, <struct 'NiPSysFieldAttenuationCtlr'>, <struct 'NiPSysFieldMaxDistanceCtlr'>, <struct 'NiPSysAirFieldAirFrictionCtlr'>, <struct 'NiPSysAirFieldInheritVelocityCtlr'>, <struct 'NiPSysAirFieldSpreadCtlr'>, <struct 'NiPSysInitialRotSpeedCtlr'>, <struct 'NiPSysInitialRotSpeedVarCtlr'>, <struct 'NiPSysInitialRotAngleCtlr'>, <struct 'NiPSysInitialRotAngleVarCtlr'>, <struct 'NiPSysEmitterPlanarAngleCtlr'>, <struct 'NiPSysEmitterPlanarAngleVarCtlr'>, <struct 'NiPSysAirFieldModifier'>, <struct 'NiPSysTrailEmitter'>, <struct 'NiLightIntensityController'>, <struct 'NiPSysRadialFieldModifier'>, <struct 'NiLODData'>, <struct 'NiRangeLODData'>, <struct 'NiScreenLODData'>, <struct 'NiRotatingParticles'>, <struct 'NiSequenceStreamHelper'>, <struct 'NiShadeProperty'>, <struct '_NiSkinData'>, <struct 'NiSkinInstance'>, <struct 'NiTriShapeSkinController'>, <struct 'NiClodSkinInstance'>, <struct 'NiSkinPartition'>, <struct 'NiTexture'>, <struct 'NiSourceTexture'>, <struct 'NiSpecularProperty'>, <struct 'NiSphericalCollider'>, <struct 'NiSpotLight'>, <struct 'NiStencilProperty'>, <struct 'NiStringExtraData'>, <struct 'NiStringPalette'>, <struct 'NiStringsExtraData'>, <struct 'NiTextKeyExtraData'>, <struct 'NiTextureEffect'>, <struct 'NiTextureModeProperty'>, <struct 'NiImage'>, <struct 'NiTextureProperty'>, <struct 'NiMultiTextureProperty'>, <struct 'NiTexturingProperty'>, <struct 'NiTransformData'>, <struct 'NiTriShape'>, <struct '_NiTriShapeData'>, <struct 'NiTriStrips'>, <struct '_NiTriStripsData'>, <struct 'NiEnvMappedTriShape'>, <struct 'NiEnvMappedTriShapeData'>, <struct 'NiBezierTriangle4'>, <struct 'NiBezierMesh'>, <struct 'NiClod'>, <struct 'NiClodData'>, <struct 'NiUVController'>, <struct 'NiUVData'>, <struct 'NiVectorExtraData'>, <struct 'NiVertexColorProperty'>, <struct 'NiVertWeightsExtraData'>, <struct 'NiVisData'>, <struct 'NiWireframeProperty'>, <struct 'NiZBufferProperty'>, <struct 'RootCollisionNode'>, <struct 'NiRawImageData'>, <struct 'NiSortAdjustNode'>, <struct 'NiSourceCubeMap'>, <struct 'NiPhysXProp'>, <struct 'physXMaterialRef'>, <struct 'NiPhysXPropDesc'>, <struct 'NiPhysXActorDesc'>, <struct 'NiPhysXBodyDesc'>, <struct 'NiPhysXD6JointDesc'>, <struct 'NiPhysXShapeDesc'>, <struct 'NiPhysXMeshDesc'>, <struct 'NiPhysXMaterialDesc'>, <struct 'NiPhysXKinematicSrc'>, <struct 'NiPhysXTransformDest'>, <struct 'NiArkAnimationExtraData'>, <struct 'NiArkImporterExtraData'>, <struct 'NiArkTextureExtraData'>, <struct 'NiArkViewportInfoExtraData'>, <struct 'NiArkShaderExtraData'>, <struct 'NiLines'>, <struct 'NiLinesData'>, <struct 'Polygon'>, <struct 'NiScreenElementsData'>, <struct 'NiScreenElements'>, <struct 'NiRoomGroup'>, <struct 'NiRoom'>, <struct 'NiPortal'>, <struct 'BSFadeNode'>, <struct 'BSShaderProperty'>, <struct 'BSShaderLightingProperty'>, <struct 'BSShaderNoLightingProperty'>, <struct 'BSShaderPPLightingProperty'>, <struct 'BSEffectShaderPropertyFloatController'>, <struct 'BSEffectShaderPropertyColorController'>, <struct 'BSLightingShaderPropertyFloatController'>, <struct 'BSLightingShaderPropertyColorController'>, <struct 'BSNiAlphaPropertyTestRefController'>, <struct 'BSProceduralLightningController'>, <struct 'BSShaderTextureSet'>, <struct 'WaterShaderProperty'>, <struct 'SkyShaderProperty'>, <struct 'TileShaderProperty'>, <struct 'DistantLODShaderProperty'>, <struct 'BSDistantTreeShaderProperty'>, <struct 'TallGrassShaderProperty'>, <struct 'VolumetricFogShaderProperty'>, <struct 'HairShaderProperty'>, <struct 'Lighting30ShaderProperty'>, <struct 'BSLightingShaderProperty'>, <struct 'BSEffectShaderProperty'>, <struct 'BSWaterShaderProperty'>, <struct 'BSSkyShaderProperty'>, <struct '_BSDismemberSkinInstance'>, <struct 'BSDecalPlacementVectorExtraData'>, <struct 'BSPSysSimpleColorModifier'>, <struct 'BSValueNode'>, <struct 'BSStripParticleSystem'>, <struct 'BSStripPSysData'>, <struct 'BSPSysStripUpdateModifier'>, <struct 'BSMaterialEmittanceMultController'>, <struct 'BSMasterParticleSystem'>, <struct 'BSPSysMultiTargetEmitterCtlr'>, <struct 'BSRefractionStrengthController'>, <struct 'BSOrderedNode'>, <struct 'BSBlastNode'>, <struct 'BSDamageStage'>, <struct 'BSRefractionFirePeriodController'>, <struct 'bhkConvexListShape'>, <struct 'BSTreadTransformData'>, <struct 'BSTreadTransform'>, <struct 'BSTreadTransfInterpolator'>, <struct 'BSAnimNotes'>, <struct 'bhkLiquidAction'>, <struct 'BSMultiBoundNode'>, <struct 'BSMultiBound'>, <struct 'BSMultiBoundData'>, <struct 'BSMultiBoundOBB'>, <struct 'BSMultiBoundSphere'>, <struct 'BSSegmentedTriShape'>, <struct 'BSMultiBoundAABB'>, <struct 'AdditionalDataInfo'>, <struct 'AdditionalDataBlock'>, <struct 'BSPackedAdditionalDataBlock'>, <struct 'NiAdditionalGeometryData'>, <struct 'BSPackedAdditionalGeometryData'>, <struct 'BSWArray'>, <struct 'bhkAabbPhantom'>, <struct 'BSFrustumFOVController'>, <struct 'BSDebrisNode'>, <struct 'bhkBreakableConstraint'>, <struct 'bhkOrientHingedBodyAction'>, <struct 'bhkRagdollTemplate'>, <struct 'bhkRagdollTemplateData'>, <struct 'Region'>, <struct 'NiDataStream'>, <struct 'SemanticData'>, <struct 'MeshData'>, <struct 'MaterialData'>, <struct 'NiRenderObject'>, <struct 'NiMeshModifier'>, <struct 'ExtraMeshDataEpicMickey'>, <struct 'ExtraMeshDataEpicMickey2'>, <struct 'NiMesh'>, <struct 'NiMorphWeightsController'>, <struct 'ElementReference'>, <struct 'NiMorphMeshModifier'>, <struct 'NiSkinningMeshModifier'>, <struct 'NiInstancingMeshModifier'>, <struct 'NiSkinningLODController'>, <struct 'NiPSParticleSystem'>, <struct 'NiPSMeshParticleSystem'>, <struct 'NiPSEmitParticlesCtlr'>, <struct 'NiPSForceActiveCtlr'>, <struct 'NiPSSimulator'>, <struct 'NiPSSimulatorStep'>, <struct 'NiPSSimulatorGeneralStep'>, <struct 'NiPSSimulatorForcesStep'>, <struct 'NiPSSimulatorCollidersStep'>, <struct 'NiPSSimulatorMeshAlignStep'>, <struct 'NiPSSimulatorFinalStep'>, <struct 'NiPSFacingQuadGenerator'>, <struct 'NiShadowGenerator'>, <struct 'NiPSBoundUpdater'>, <struct 'NiPSDragForce'>, <struct 'NiPSGravityForce'>, <struct 'NiPSBoxEmitter'>, <struct 'NiPSMeshEmitter'>, <struct 'NiPSGravityStrengthCtlr'>, <struct 'NiPSPlanarCollider'>, <struct 'NiPSEmitterSpeedCtlr'>, <struct 'NiPSEmitterRadiusCtlr'>, <struct 'NiPSResetOnLoopCtlr'>, <struct 'NiPSSphereEmitter'>, <struct 'NiPSCylinderEmitter'>, <struct 'NiPSEmitterDeclinationCtlr'>, <struct 'NiPSEmitterDeclinationVarCtlr'>, <struct 'NiPSEmitterPlanarAngleCtlr'>, <struct 'NiPSEmitterPlanarAngleVarCtlr'>, <struct 'NiPSEmitterRotAngleCtlr'>, <struct 'NiPSEmitterRotAngleVarCtlr'>, <struct 'NiPSEmitterRotSpeedCtlr'>, <struct 'NiPSEmitterRotSpeedVarCtlr'>, <struct 'NiPSEmitterLifeSpanCtlr'>, <struct 'NiPSBombForce'>, <struct 'NiPSSphericalCollider'>, <struct 'NiPSSpawner'>, <struct 'NiSequenceData'>, <struct 'NiTransformEvaluator'>, <struct 'NiBSplineCompTransformEvaluator'>, <struct 'NiMeshHWInstance'>, <struct 'NiFurSpringController'>, <struct 'CStreamableAssetData'>, <struct 'bhkCompressedMeshShape'>, <struct 'bhkCompressedMeshShapeData'>, <struct 'BSInvMarker'>, <struct 'BSBoneLODExtraData'>, <struct 'BSBehaviorGraphExtraData'>, <struct 'BSLagBoneController'>, <struct 'BSLODTriShape'>, <struct 'BSFurnitureMarkerNode'>, <struct 'BSLeafAnimNode'>, <struct 'BSTreeNode'>]

Regression tests

These tests are used to check for functionality and bugs in the library. They also provide code examples which you may find useful.

Read a NIF file

>>> from os.path import dirname
>>> dirpath = __file__
>>> for i in range(4): #recurse up to root repo dir
...     dirpath = dirname(dirpath)
>>> repo_root = dirpath
>>> format_root = os.path.join(repo_root, 'tests', 'spells', 'nif', 'files')
>>> stream = open(os.path.join(format_root, '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()

Parse all NIF files in a directory tree

>>> for stream, data in NifFormat.walkData(format_root):
...     try:
...         # the replace call makes the doctest also pass on windows
...         os_path = stream.name
...         split = (os_path.split(os.sep))[-5:]
...         rejoin = os.path.join(*split).replace(os.sep, "/")
...         print("reading %s" % rejoin)
...         data.read(stream)
...     except Exception:
...         print(
...             "Warning: read failed due corrupt file,"
...             " corrupt format description, or bug.") 
reading tests/spells/nif/files/invalid.nif
Warning: read failed due corrupt file, corrupt format description, or bug.
reading tests/spells/nif/files/nds.nif
reading tests/spells/nif/files/neosteam.nif
reading tests/spells/nif/files/test.nif
reading tests/spells/nif/files/test_centerradius.nif
reading tests/spells/nif/files/test_check_tangentspace1.nif
reading tests/spells/nif/files/test_check_tangentspace2.nif
reading tests/spells/nif/files/test_check_tangentspace3.nif
reading tests/spells/nif/files/test_check_tangentspace4.nif
reading tests/spells/nif/files/test_convexverticesshape.nif
reading tests/spells/nif/files/test_dump_tex.nif
reading tests/spells/nif/files/test_fix_clampmaterialalpha.nif
reading tests/spells/nif/files/test_fix_cleanstringpalette.nif
reading tests/spells/nif/files/test_fix_detachhavoktristripsdata.nif
reading tests/spells/nif/files/test_fix_disableparallax.nif
reading tests/spells/nif/files/test_fix_ffvt3rskinpartition.nif
reading tests/spells/nif/files/test_fix_mergeskeletonroots.nif
reading tests/spells/nif/files/test_fix_tangentspace.nif
reading tests/spells/nif/files/test_fix_texturepath.nif
reading tests/spells/nif/files/test_grid_128x128.nif
reading tests/spells/nif/files/test_grid_64x64.nif
reading tests/spells/nif/files/test_mopp.nif
reading tests/spells/nif/files/test_opt_collision_complex_mopp.nif
reading tests/spells/nif/files/test_opt_collision_mopp.nif
reading tests/spells/nif/files/test_opt_collision_packed.nif
reading tests/spells/nif/files/test_opt_collision_to_boxshape.nif
reading tests/spells/nif/files/test_opt_collision_to_boxshape_notabox.nif
reading tests/spells/nif/files/test_opt_collision_unpacked.nif
reading tests/spells/nif/files/test_opt_delunusedbones.nif

reading tests/spells/nif/files/test_opt_dupverts.nif reading tests/spells/nif/files/test_opt_emptyproperties.nif reading tests/spells/nif/files/test_opt_grid_layout.nif reading tests/spells/nif/files/test_opt_mergeduplicates.nif reading tests/spells/nif/files/test_opt_vertex_cache.nif reading tests/spells/nif/files/test_opt_zeroscale.nif reading tests/spells/nif/files/test_skincenterradius.nif reading tests/spells/nif/files/test_vertexcolor.nif

Create a NIF model from scratch and write to file

>>> 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()

Get list of versions and games

>>> 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
0x1E010003
>>> 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
Rocksmith 0x1E010003
Rocksmith 2014 0x1E010003
Sid Meier's Railroads 0x14000004
Skyrim 0x14020007
Star Trek: Bridge Commander 0x03000000 0x03010000
The Guild 2 0x0A010000
Warhammer 0x14030009
Wildlife Park 2 0x0A010000 0x0A020000
Worldshift 0x0A020001 0x0A040001
Zoo Tycoon 2 0x0A000100

Reading an unsupported NIF file

>>> file = os.path.join(format_root, 'invalid.nif')
>>> stream = open(file, 'rb')
>>> data = NifFormat.Data()
>>> data.inspect(stream) # the file seems ok on inspection
>>> data.read(stream) 
Traceback (most recent call last):
    ...
ValueError: ...
>>> stream.close()

Template types

>>> 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'

Strings

>>> 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