Skip to content

Commit 9914a2b

Browse files
committed
Added support for Fantasy Frontier/Aura Kingdom nifs, based on niftools#47 as well as Hexabit's xml from niftools/nifskope#187. Should close niftools#98.
1 parent 2067401 commit 9914a2b

File tree

1 file changed

+63
-15
lines changed

1 file changed

+63
-15
lines changed

nif.xml

+63-15
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@
295295
A float in the range -1.0:1.0, stored as a byte.
296296
</basic>
297297

298+
<basic name="normsbyte" boolean="false" size="1">
299+
A float in the range -1.0:1.0, stored as a signed byte.
300+
</basic>
301+
298302
<basic name="bool" boolean="true" integral="true" countable="false">
299303
A boolean; 32-bit up to and including 4.0.0.2, 8-bit from 4.1.0.1 on.
300304
</basic>
@@ -1717,6 +1721,14 @@
17171721
<field name="a" type="float">Alpha.</field>
17181722
</struct>
17191723

1724+
<struct name="HalfColor4" size="8" convertible="Color4" module="NiMain">
1725+
A color with alpha (red, green, blue, alpha).
1726+
<field name="r" type="hfloat">Red color component.</field>
1727+
<field name="g" type="hfloat">Green color component.</field>
1728+
<field name="b" type="hfloat">Blue color component.</field>
1729+
<field name="a" type="hfloat">Alpha color component.</field>
1730+
</struct>
1731+
17201732
<struct name="ByteColor4" size="4" convertible="Color4" module="NiMain">
17211733
A color with alpha (red, green, blue, alpha).
17221734
<field name="r" type="byte">Red color component.</field>
@@ -1778,6 +1790,13 @@
17781790
<field name="z" type="normbyte">Third coordinate.</field>
17791791
</struct>
17801792

1793+
<struct name="SbyteVector3" size="3" convertible="Vector3 UshortVector3" module="NiMain">
1794+
A vector in 3D space (x,y,z).
1795+
<field name="x" type="normsbyte">First coordinate.</field>
1796+
<field name="y" type="normsbyte">Second coordinate.</field>
1797+
<field name="z" type="normsbyte">Third coordinate.</field>
1798+
</struct>
1799+
17811800
<struct name="Vector4" size="16" module="NiMain">
17821801
A 4-dimensional vector.
17831802
<field name="x" type="float">First coordinate.</field>
@@ -1912,6 +1931,12 @@
19121931
<field name="Weight" type="float" range="#F0_1#">The vertex weight - between 0.0 and 1.0</field>
19131932
</struct>
19141933

1934+
<compound name="BoneVertDataHalf" versions="V20_3_1_1 V20_3_1_2">
1935+
NiSkinData::BoneVertData. A vertex and its weight.
1936+
<field name="Index" type="ushort">The vertex index, in the mesh.</field>
1937+
<field name="Weight" type="hfloat">The vertex weight - between 0.0 and 1.0</field>
1938+
</compound>
1939+
19151940
<struct name="AVObject" module="NiMain">
19161941
Used in NiDefaultAVObjectPalette.
19171942
<field name="Name" type="SizedString">Object name.</field>
@@ -2153,9 +2178,12 @@
21532178
<field name="Has Vertex Map" type="bool" since="10.1.0.0">Do we have a vertex map?</field>
21542179
<field name="Vertex Map" type="ushort" length="Num Vertices" until="10.0.1.2">Maps the weight/influence lists in this submesh to the vertices in the shape being skinned.</field>
21552180
<field name="Vertex Map" type="ushort" length="Num Vertices" cond="Has Vertex Map" since="10.1.0.0">Maps the weight/influence lists in this submesh to the vertices in the shape being skinned.</field>
2156-
<field name="Has Vertex Weights" type="bool" since="10.1.0.0">Do we have vertex weights?</field>
2181+
<field name="Has Vertex Weights" type="bool" since="10.1.0.0">Do we have vertex weights?
2182+
1 (default): vertex weights are stored in floats.
2183+
15 (compression): vertex weights are stored in half floats (found in 20.3.1.1 Fantasy Frontier Online).</field>
21572184
<field name="Vertex Weights" type="float" length="Num Vertices" width="Num Weights Per Vertex" until="10.0.1.2">The vertex weights.</field>
2158-
<field name="Vertex Weights" type="float" length="Num Vertices" width="Num Weights Per Vertex" cond="Has Vertex Weights" since="10.1.0.0">The vertex weights.</field>
2185+
<field name="Vertex Weights" type="float" length="Num Vertices" width="Num Weights Per Vertex" cond="(Has Vertex Weights #GT# 0) #AND# (Has Vertex Weights #NEQ# 15)" since="10.1.0.0">The vertex weights.</field>
2186+
<field name="Vertex Weights" type="hfloat" length="Num Vertices" width="Num Weights Per Vertex" cond="Has Vertex Weights #EQ# 15" ver1="20.3.1.1">The vertex weights.</field>
21592187
<field name="Strip Lengths" type="ushort" length="Num Strips">The strip lengths.</field>
21602188
<field name="Has Faces" type="bool" calc="(#LEN[Strips]# #ADD# #LEN[Triangles]#) #GT# 0 #THEN# true #ELSE# false" since="10.1.0.0">Do we have triangle or strip data?</field>
21612189
<field name="Strips" type="ushort" length="Num Strips" width="Strip Lengths" cond="Num Strips != 0" until="10.0.1.2">The strips.</field>
@@ -2280,7 +2308,8 @@
22802308
<field name="Bounding Sphere" type="NiBound">Note that its a Sphere Containing Axis Aligned Box not a minimum volume Sphere</field>
22812309
<field name="Num Vertices" type="ushort">Number of weighted vertices.</field>
22822310
<field name="Vertex Weights" type="BoneVertData" length="Num Vertices" until="4.2.1.0">The vertex weights.</field>
2283-
<field name="Vertex Weights" type="BoneVertData" length="Num Vertices" since="4.2.2.0" cond="#ARG# != 0">The vertex weights.</field>
2311+
<field name="Vertex Weights" type="BoneVertData" length="Num Vertices" since="4.2.2.0" cond="(#ARG# != 0) #AND# (#ARG# #NEQ# 15)">The vertex weights.</field>
2312+
<field name="Vertex Weights" type="BoneVertDataHalf" arr1="Num Vertices" ver1="20.3.1.1" cond="#ARG# #EQ# 15">The vertex weights.</field>
22842313
</struct>
22852314

22862315
<struct name="HavokFilter" size="4" module="BSHavok" versions="#BETHESDA#">
@@ -3889,13 +3918,21 @@
38893918
<field name="BS Max Vertices" type="ushort" onlyT="NiPSysData" since="20.2.0.7" until="20.2.0.7" vercond="#BS_GTE_FO3#">Bethesda uses this for max number of particles in NiPSysData.</field>
38903919
<field name="Keep Flags" type="byte" since="10.1.0.0">Used with NiCollision objects when OBB or TRI is set.</field>
38913920
<field name="Compress Flags" type="byte" since="10.1.0.0" />
3892-
<field name="Has Vertices" type="bool" default="true">Is the vertex array present? (Always non-zero.)</field>
3893-
<field name="Vertices" type="Vector3" length="Num Vertices" cond="Has Vertices">The mesh vertices.</field>
3921+
<field name="Has Vertices" type="bool" default="true">Is the vertex array present? (Always non-zero.)
3922+
1 (default): vertices and texture coordinates are stored in floats.
3923+
15 (compression): vertices and texture coordinates are stored in half floats (found in 20.3.1.1 Fantasy Frontier Online).</field>
3924+
<field name="Vertices" type="Vector3" length="Num Vertices" cond="(Has Vertices #GT# 0) #AND# (Has Vertices #NEQ# 15)">The mesh vertices.</field>
3925+
<field name="Vertices" type="HalfVector3" length="Num Vertices" ver1="20.3.1.1" cond="Has Vertices #EQ# 15">The mesh vertices.</field>
38943926
<field name="Data Flags" type="NiGeometryDataFlags" since="10.0.1.0" vercond="!#BS202#" />
38953927
<field name="BS Data Flags" type="BSGeometryDataFlags" vercond="#BS202#" />
38963928
<field name="Material CRC" type="uint" since="20.2.0.7" until="20.2.0.7" vercond="#BS_GT_FO3#" />
3897-
<field name="Has Normals" type="bool">Do we have lighting normals? These are essential for proper lighting: if not present, the model will only be influenced by ambient light.</field>
3898-
<field name="Normals" type="Vector3" length="Num Vertices" cond="Has Normals">The lighting normals.</field>
3929+
<field name="Has Normals" type="bool">Do we have lighting normals? These are essential for proper lighting: if not present, the model will only be influenced by ambient light.
3930+
1 (default): normals are stored in floats.
3931+
6 (compression): normals are stored in ByteVector3 (found in 20.3.1.1 Fantasy Frontier Online).
3932+
15 (compression): normals are stored in HalfVector3 (found in 20.3.1.2 Aura Kingdom).</field>
3933+
<field name="Normals" type="Vector3" length="Num Vertices" cond="(Has Normals #GT# 0) #AND# (Has Normals #NEQ# 6) #AND# (Has Normals #NEQ# 15)">The lighting normals.</field>
3934+
<field name="Normals" type="HalfVector3" length="Num Vertices" ver1="20.3.1.2" cond="Has Normals #EQ# 15">The lighting normals.</field>
3935+
<field name="Normals" type="SbyteVector3" length="Num Vertices" ver1="20.3.1.1" cond="Has Normals #EQ# 6">The lighting normals.</field>
38993936
<field name="Tangents" type="Vector3" length="Num Vertices" cond="(Has Normals) #AND# (((Data Flags #BITOR# BS Data Flags) #BITAND# 4096) != 0)" since="10.1.0.0">Tangent vectors.</field>
39003937
<field name="Bitangents" type="Vector3" length="Num Vertices" cond="(Has Normals) #AND# (((Data Flags #BITOR# BS Data Flags) #BITAND# 4096) != 0)" since="10.1.0.0">Bitangent vectors.</field>
39013938
<field name="Has DIV2 Floats" type="bool" since="20.3.0.9" until="20.3.0.9" vercond="#DIVINITY2#" />
@@ -3907,15 +3944,23 @@
39073944
Note: how vertex colors influence the model can be controlled by having a NiVertexColorProperty object as a property child of the root node. If this property object is not present, the vertex colors fine-tune lighting.
39083945

39093946
Note 2: set to either 0 or 0xFFFFFFFF for NifTexture compatibility.
3947+
3948+
Note 3:
3949+
1 (default): vertex colors are stored in 4 floats.
3950+
7 (compression): vertex colors are stored in 4 bytes (found in 20.3.1.1 Fantasy Frontier Online).
3951+
15 (compression): vertex colors are stored in 4 half floats (found in 20.3.1.2 Aura Kingdom).
39103952
</field>
3911-
<field name="Vertex Colors" type="Color4" default="#VEC4_ONE#" length="Num Vertices" cond="Has Vertex Colors">The vertex colors.</field>
3953+
<field name="Vertex Colors" type="Color4" default="#VEC4_ONE#" length="Num Vertices" cond="(Has Vertex Colors #GT# 0) #AND# (Has Vertex Colors #NEQ# 7) #AND# (Has Vertex Colors #NEQ# 15)">The vertex colors.</field>
3954+
<field name="Vertex Colors" type="HalfColor4" length="Num Vertices" ver1="20.3.1.2" cond="Has Vertex Colors #EQ# 15">The vertex colors.</field>
3955+
<field name="Vertex Colors" type="ByteColor4" length="Num Vertices" ver1="20.3.1.1" cond="Has Vertex Colors #EQ# 7">The vertex colors.</field>
39123956
<field name="Data Flags" type="NiGeometryDataFlags" until="4.2.2.0">The lower 6 bits of this field represent the number of UV texture sets. The rest is unused.</field>
39133957
<field name="Has UV" type="bool" until="4.0.0.2">
39143958
Do we have UV coordinates?
39153959

39163960
Note: for compatibility with NifTexture, set this value to either 0x00000000 or 0xFFFFFFFF.
39173961
</field>
3918-
<field name="UV Sets" type="TexCoord" length="((Data Flags #BITAND# 63) #BITOR# (BS Data Flags #BITAND# 1))" width="Num Vertices">The UV texture coordinates. They follow the OpenGL standard: some programs may require you to flip the second coordinate.</field>
3962+
<field name="UV Sets" type="TexCoord" cond="(Has Vertices #GT# 0) #AND# (Has Vertices #NEQ# 15)" length="((Data Flags #BITAND# 63) #BITOR# (BS Data Flags #BITAND# 1))" width="Num Vertices">The UV texture coordinates. They follow the OpenGL standard: some programs may require you to flip the second coordinate.</field>
3963+
<field name="UV Sets" type="HalfTexCoord" cond="Has Vertices #EQ# 15" length="((Data Flags #BITAND# 63) #BITOR# (BS Data Flags #BITAND# 1))" width="Num Vertices" ver1="20.3.1.1">The UV texture coordinates. They follow the OpenGL standard: some programs may require you to flip the second coordinate.</field>
39193964
<field name="Consistency Flags" type="ConsistencyType" since="10.0.1.0" default="CT_MUTABLE">Consistency Flags</field>
39203965
<field name="Additional Data" type="Ref" template="AbstractAdditionalGeometryData" since="20.0.0.4" />
39213966
</niobject>
@@ -3978,6 +4023,7 @@
39784023
<field name="Flags" type="AlphaFlags" default="4844" />
39794024
<field name="Threshold" type="byte" default="128">Threshold for alpha testing</field>
39804025
<field name="Unknown Short 1" type="ushort" until="2.3" />
4026+
<field name="Unknown Short 1" type="ushort" ver1="20.3.1.1" ver2="20.3.1.2">Unknown</field>
39814027
<field name="Unknown Int 2" type="uint" until="2.3" />
39824028
</niobject>
39834029

@@ -5074,7 +5120,9 @@
50745120
<field name="Skin Transform" type="NiTransform">Offset of the skin from this bone in bind position.</field>
50755121
<field name="Num Bones" type="uint">Number of bones.</field>
50765122
<field name="Skin Partition" type="Ref" template="NiSkinPartition" since="4.0.0.2" until="10.1.0.0">This optionally links a NiSkinPartition for hardware-acceleration information.</field>
5077-
<field name="Has Vertex Weights" type="bool" since="4.2.1.0" default="true">Enables Vertex Weights for this NiSkinData.</field>
5123+
<field name="Has Vertex Weights" type="bool" since="4.2.1.0" default="true">Enables Vertex Weights for this NiSkinData.
5124+
1 (default): vertex weights are stored in floats.
5125+
15 (compression): vertex weights are stored in half floats (found in 20.3.1.1 Fantasy Frontier Online).</field>
50785126
<field name="Bone List" type="BoneData" length="Num Bones" arg="Has Vertex Weights">Contains offset data for each node that this skin is influenced by.</field>
50795127
</niobject>
50805128

@@ -5237,15 +5285,15 @@
52375285
<field name="Flags" type="TexturingFlags" since="20.1.0.2">Property flags.</field>
52385286
<field name="Apply Mode" type="ApplyMode" default="APPLY_MODULATE" since="3.3.0.13" until="20.1.0.1">Determines how the texture will be applied. Seems to have special functions in Oblivion.</field>
52395287
<field name="Texture Count" type="uint" default="7">Number of textures.</field>
5240-
<field name="Has Base Texture" type="bool" />
5288+
<field name="Has Base Texture" type="bool" cond="Texture Count #GT# 0" />
52415289
<field name="Base Texture" type="TexDesc" cond="Has Base Texture" />
5242-
<field name="Has Dark Texture" type="bool" />
5290+
<field name="Has Dark Texture" type="bool" cond="Texture Count #GT# 1" />
52435291
<field name="Dark Texture" type="TexDesc" cond="Has Dark Texture" />
5244-
<field name="Has Detail Texture" type="bool" />
5292+
<field name="Has Detail Texture" type="bool" cond="Texture Count #GT# 2" />
52455293
<field name="Detail Texture" type="TexDesc" cond="Has Detail Texture" />
5246-
<field name="Has Gloss Texture" type="bool" />
5294+
<field name="Has Gloss Texture" type="bool" cond="Texture Count #GT# 3" />
52475295
<field name="Gloss Texture" type="TexDesc" cond="Has Gloss Texture" />
5248-
<field name="Has Glow Texture" type="bool" />
5296+
<field name="Has Glow Texture" type="bool" cond="Texture Count #GT# 4" />
52495297
<field name="Glow Texture" type="TexDesc" cond="Has Glow Texture" />
52505298
<field name="Has Bump Map Texture" type="bool" since="3.3.0.13" cond="Texture Count #GT# 5" />
52515299
<field name="Bump Map Texture" type="TexDesc" since="3.3.0.13" cond="Has Bump Map Texture" />

0 commit comments

Comments
 (0)