Skip to content
Snippets Groups Projects
  1. Jul 19, 2018
  2. Jul 16, 2018
    • jonwd7's avatar
      BSVertexDesc correct bitfield · 2954bb4a
      jonwd7 authored
      Made a correct bitfield using `uint64` as the underlying type, split into nibbles for the sizes and offsets of the vertex attributes.
      
      Changed VertexFlags to VertexAttributes and it no longer has the empty nibble in front.
      
      ARG passing of the BSVertexDesc is treated as the underlying numeric value of the bitfield, so that the attributes can be passed into BSVertexData using `#RSH# 44` instead of the member accessor syntax.
      
      This makes the first use of the basic `uint64` type, so (de)serialization now requires support of 64-bit values.
      2954bb4a
    • jonwd7's avatar
      Bethesda Havok major refactor · 111598d2
      jonwd7 authored
      Cleaned up class naming e.g. Descriptor->CInfo to match the engine and other classes already named that way.  Added hk/bhk to front of type names where appropriate.
      
      Changed Info/Property names to be consistent e.g.  "Rigid Body Info", "Entity Info" instead of CInfo.
      
      Changed all "Unused" fields to a consistent naming scheme, using byte array types and binary="true".
      
      Class hierarchy fixes.  Class documentation complete overhaul.
      
      Some existing naming collides with new naming of different fields, e.g. bhkMoppBvTreeShape "Scale" used to be "Shape Scale" and now "Scale" is  "MOPP Code" -> "Scale".
      111598d2
  3. Jul 02, 2018
  4. Jul 01, 2018
    • jonwd7's avatar
      BSWaterShaderProperty flags correction · 847607fa
      jonwd7 authored
      The previous decoding was all guesswork, though did align somewhat.  Enough to know that the decoding from FO4 applies to Skyrim as well.
      847607fa
  5. Jun 29, 2018
    • jonwd7's avatar
      Default Values Pass 1 · 7887f4ea
      jonwd7 authored
      Added `default` to a large number of members, as well as `calc` to a few members to enforce array sizes based on other data.
      
      Also fixed a few `type` issues.
      
      This is a first pass in a much larger effort,  using data analysis to gather the most commonly used values.
      7887f4ea
    • jonwd7's avatar
      FO4 skin instance and shader decoding · 20dab6b5
      jonwd7 authored
      FO4 changed the Color3 to a Color4 for Skin Tint.  Leaving as separate Alpha for now however.
      
      Also found out the point of the BSSkin::Instance array which is non-uniform scaling.
      20dab6b5
    • jonwd7's avatar
      NiBound naming consistency · 8d8a4aed
      jonwd7 authored
      For Name-based APIs, naming all NiBound fields consistently helps with generic treatment of NiBound getting and setting for any NiObject.
      8d8a4aed
    • jonwd7's avatar
      bhk Emulate Havok CInfo for World Obj, Entity, Rigid Body · 12e72861
      jonwd7 authored
      Split up the Rigid Body CInfo into multiple compounds for each Havok version (though left 550/660 combined).  Followed suit with bhkWorldObject and bhkEntity.
      
      Having each in their own CInfo simplifies both naming and versioning at the cost of repetition.
      
      The bhkRigidBodyCInfo variants will need some kind of shared parent, but compound inheritance is currently not part of the XML spec.  It would have to be done with custom types in niflib.  The shared parent will be needed for getting/setting the same info on different CInfo versions.
      12e72861
  6. Jun 28, 2018
  7. Jun 26, 2018
    • jonwd7's avatar
      NiGeometryData flags bitfield · 086024bc
      jonwd7 authored
      Use a correct bitfield for NiGeometryData flags now that we know what the unknown values are for Bethesda bhk data. (NiGeometryData that gets used in a bhk shape)
      086024bc
  8. Jun 25, 2018
    • jonwd7's avatar
      Explicit ver1/ver2 for BS 20.2 · 8d73ad09
      jonwd7 authored
      Specifying ver1/ver2 even for `vercond="#BS...` for FO3 and later allows early rejection of that member for any non-BS 20.2 NIFs.
      8d73ad09
    • jonwd7's avatar
      NiSkinPartition (Bethesda) decoding and cleanup · 61d2b796
      jonwd7 authored
      Unknown Short for FO3+ was two values, a byte and a bool.
      
      Renamed "Num Skin Partition Blocks" and "Skin Partition Blocks" and combined the Partitions array into one row, as having a row separate for SSE was unnecessary.
      61d2b796
    • jonwd7's avatar
      Replace `calculated` with `calc` · 121ba5f7
      jonwd7 authored
      For #76.  `calc` does not need to be supported and is only used for pre-serialization preparation of the data.  This can also be done by hand.
      
      Some revisions also need to be made for #70 and #73 to account for another attribute with its own expression grammar and tokens.
      
      However, the tokens introduced for `calc` will not be added to the tokens in the XML and will need to be explicitly supported if supporting `calc`.  They are:
      
      1D array size (uses regex): `#LEN[(.*?)]#`
      2D array size (uses regex): `#LEN2[(.*?)]#`
      
      Ternary `?`: `#THEN#`
      Ternary `:`: `#ELSE#`
      
      Also removes any unnecessary `calculated` without replacement.
      
      Additionally, `calc` is used to limit array size for the time being, though it's possible this should be done with its own attribute, such as `maxlen`.
      121ba5f7
  9. Jun 19, 2018
    • jonwd7's avatar
      BSLightingShader decoding · 639bea61
      jonwd7 authored
      FO4 DLC uses BSLightingShaderPropertyUShortController in 2 NIFs, but according to the CK it is not actually a functional block and spits out constant warnings. It is still needed in nif.xml for serialization though.
      
      FO4 also adds two booleans for Env Map shader type for SSR.  These were previously marked as an Unknown Short.  These booleans are *not* synced with their values in the BGSM files except for generated meshes such as SCOL and precombined.
      639bea61
    • jonwd7's avatar
      bhk block cleanup, decoding, inheritance fixes · 285b1cb4
      jonwd7 authored
      Havok serialization is separate from inheritance and so certain shapes that are actually convex were not considered such by nif.xml, which in turn excludes them from uses of `template="bhkConvexShape"`.
      
      Created a fake base class to fix these issues.  Also, bhkConvexTransformShape no longer inheriting bhkTransformShape was more correct anyway, as the Ref type could be made more specific (bhkConvexShape).
      
      Did some comment/description cleanup and some minor decoding.
      285b1cb4
  10. Jun 17, 2018
    • jonwd7's avatar
      Rename `binary`/`abstract` booleans from 1 to true · 7fb12339
      jonwd7 authored
      For #76
      
      For reduced ambiguity.  Adapting for this in Python is as easy as
      
      ```py
      # XML Booleans
      XML_TRUE = ["true", "1"]
      XML_FALSE = ["false", "0"]
      
      # Example
      self.is_abstract = get('abstract') in XML_TRUE
      ```
      
      Note "True" and "False" are not valid booleans in XML.  Only lowercase.
      7fb12339
    • jonwd7's avatar
      Add NiPhysXClothDesc · 34ae18eb
      jonwd7 authored
      34ae18eb
    • jonwd7's avatar
      Move BSGeometry mimicry for NiParticles · 8f3b2d05
      jonwd7 authored
      8f3b2d05
    • jonwd7's avatar
      Improved NiAdditionalGeometryData · 83df1e5b
      jonwd7 authored
      Named the compounds correctly after the actual structs,  separated the "Has Data" bool from the compound as it's not actually part of the struct, but before it in a for loop during (de)serialize.
      
      Combined NiAdditionalGeometryData and the BS version into one compound when possible.  But the block can actually no longer be found in any official files, so the BS version is not very important.
      83df1e5b
    • jonwd7's avatar
      Clean up and remove unnecessary XML comments · a58bd613
      jonwd7 authored
      Try to use element text whenever possible, and remove any unnecessary XML comments.  Soon the XML will be regenerated and so the XML comments need to be well formed and in predictable locations.
      a58bd613
    • jonwd7's avatar
      bhk cleanup, new primitives · 24b6ce04
      jonwd7 authored
      Finally added bhkPlaneShape, used once in SSE.  Added bhkCylinderShape which is possible to export from the official FO4 exporter.
      
      Cleaned up much of the class descriptions and also added `binary="true"` to the padding bytes.
      24b6ce04
  11. Jun 14, 2018
    • jonwd7's avatar
      Add `bitfield` type, remove 'Flags' · cd1af9c9
      jonwd7 authored
      For #3, #76
      
      Replaces all Flags types with real enums (where there were only two options) or a new bitfield type.
      
      Bitfield mimics the bitfield syntax of C structs (Compounds), but also acts like Enum/Bitflags with the `storage` attribute in that the entire structure can simply be aliased to a basic type like `ushort`.
      
      The `type` on each Bitfield member does **NOT denote size**.  Each member only takes up the bits that are defined by `width` and `pos`.  The `type` information is for casting for getters and setters.  That means for C structs, code generation would not use the type on each member, but the storage type instead.
      cd1af9c9
    • jonwd7's avatar
      RSH and LSH operators · 331d2c78
      jonwd7 authored
      For #70
      
      Their use was discussed as being useful for shifting and masking values before sending as an ARG.
      331d2c78
  12. Jun 08, 2018
    • jonwd7's avatar
      [Linting] Types that cannot be used as array sizes · 70edce19
      jonwd7 authored
      For #74
      
      Implemented thanks to changes done in #76 for differentiating integral and "countable" i.e. can be used for sizes.
      
      Marking types as boolean was also in #76, yet there were no errors for this lint; all the `cond` references that were not complex expressions were already boolean types.
      70edce19
    • jonwd7's avatar
      Add `convertible`, split `countable` · 1aa013d8
      jonwd7 authored
      For #76
      
      The signed integeral types were marked as countable even though they should not be used for array sizes.  A negative value cannot be passed into an array size.   They are still integral though, so countable was split into `countable` and `integral`.
      
      In addition,  added `boolean` to designate types that can toggle the presence of another member.
      
      Also reordered items for `convertible` so that the referenced types come before the type referencing it, i.e. larger types first.
      1aa013d8
  13. Jun 07, 2018
    • jonwd7's avatar
      Add `int64` and `uint64` · f64419a8
      jonwd7 authored
      For #76
      
      Also reorganized the basic types to be in a logical order.
      f64419a8
    • jonwd7's avatar
      Replace ARG and TEMPLATE · f23d16fa
      jonwd7 authored
      For #70 and #76
      
      Adopting the token syntax of the other tokens, TEMPLATE and ARG can now be treated the same as other tokens and differentiated from regular identifiers in a generic manner.
      f23d16fa
  14. Jun 06, 2018
    • jonwd7's avatar
      Move and Rename User Version 2, change ExportInfo to BSStreamHeader · bcd94134
      jonwd7 authored
      Now that any usage of `User Version 2` was actually just a `#BSVER#` token, reorganized the header information for Bethesda NIFs into the correct layout, and renamed the member to a more appropriate BS Version.
      
      The global for #BSVER# uses the member of operator `\`, but as it is a token now it is free to be used however one wishes.
      
      I split #BSSTREAMHEADER# into its own token in case the expression is ever reused (it used to be on multiple members before this reorganization).
      
      Also put `Max Filepath` into BSStreamHeader where it belonged.
      bcd94134
    • jonwd7's avatar
      Replaced global tokens and XML entity operators · 4970fcba
      jonwd7 authored
      For #70
      
      Have not decided on the non-escaped entities such as `==`, `|`, `||`, etc. yet, as at least `==` is much more readable than `#EQ#`.
      
      Replaced all Version, User Version, etc. with their global tokens.
      
      Also cleaned up NiTexturingProperty in the process.
      4970fcba
    • jonwd7's avatar
      Remove `arr3` from legacy object · 29d02452
      jonwd7 authored
      Was completely unsupported and undocumented and unused by any software.  Replaced with arithmetic even though the decoding is likely wrong anyway.
      
      For #76
      29d02452
  15. Jun 05, 2018
    • jonwd7's avatar
      Add versions to a few Bethesda-only compounds · f023ad36
      jonwd7 authored
      Follow-up to fd66c975 for #70
      f023ad36
    • jonwd7's avatar
      Add `size` to compounds · 04fe24d2
      jonwd7 authored
      For #76
      04fe24d2
    • jonwd7's avatar
      Rename count to countable, add `size` to basic · 120f4763
      jonwd7 authored
      For #76
      
      `bool` type is something that has to be dealt with as it changes size.  Also it's marked as countable which should probably be analyzed... It shouldn't be used in array counts.
      120f4763
    • jonwd7's avatar
      Remove `cond` for type checking, add `onlyT` and `excludeT` for #76 · fe3b87c9
      jonwd7 authored
      The `cond` attribute was being overloaded with multiple functions.  Conditions should be actual expressions, using local or inherited data.  Type checking inside of `cond` would also mean that you could do both in one expression, such as `cond="NiParticleSystem && Num Vertices > 0"` which doesn't make any sense.
      
      So, `onlyT` and `excludeT` were made to serve that function.  Two attributes also means not having to use the unary not (!) in order negate the meaning.
      
      Existing logic can simply alias the attributes to cond if need be.
      fe3b87c9
    • jonwd7's avatar
      Use tokens for verconds · d8866313
      jonwd7 authored
      For #70
      d8866313
    • jonwd7's avatar
      Use tokens for defaults · 30010df6
      jonwd7 authored
      For #70
      30010df6
    • jonwd7's avatar
      Bethesda block versioning · fd66c975
      jonwd7 authored
      Using tokens from #70 it is now feasible to version the Bethesda blocks.
      fd66c975
    • jonwd7's avatar
      Initial commit for #70 · 9c7061f8
      jonwd7 authored
      Tokens are grouped by name and associated with a list of attributes.  Only listed attributes should be processed for tokens of that name.
      
      Order of token groups matters.  Token strings can themselves include tokens, so any token group used in other tokens needs to come after.
      9c7061f8
Loading