BadDogSkyrim / PyNifly

Export/Import tools between Blender and the Nif format, using Bodyslide/Outfit Studio's Nifly layer. Supports Skyrim LE, Skyrim SE, Fallout 4, Fallout New Vegas, Fallout 76, and Fallout 3.
GNU General Public License v3.0
167 stars 15 forks source link

Suppport FO4/FO76 tree alpha #164

Closed BadDogSkyrim closed 1 year ago

BadDogSkyrim commented 1 year ago

Well, any FO76 vanilla file which is having vertex(-alpha) painting is an issue while importing in Blender 3.6...

...However that is also the case with FO4 files ( trees, bushes or grass .nif ) as I just checked.

So, I propose you to look at these 2 files which are a common resource ( while saved in 2 different formats ) in both vanilla packs of each game : MESHES\Landscape\Trees\Chargen\TreeMaplePreWar01Orange.nif Inside this archive, you'll find for each game the vanilla file before it is imported in Blender, and the output file while then are immediately exported : https://mega.nz/file/umhSlZDD#rrpdkLNPBtf3bMGMS-G0Lf1ic4b7ZUy35IydTFLGP4s ( Note: The Add-on won't import files not having a "NiNode" as their root node, while all grasses and trees being vertices-painted in Fallout games are "BSLeafAnimNode", thus the so-called by me "vanilla" files here have although been re-saved with Nifskope 2.0 Dev 10 so their root node "BSLeafAnimNode" has been converted to "NiNode". It's not changing in any way the other parts of the .nif files. )

...As you can see in browsing their TriShape "Vertex Data" ( with Nifskope ), the "vanilla" trunks at the bottom have vertices with Vertex Data being alpha-painted to a "00" value while their leaves are painted with a "ff" value. ( The game uses these usually visual values to weight paint the wind factor in-game for plants and trees )

So, importing these files in Blender and trying to see the vertices colors and alpha paint will result in the mesh becoming invisible... And, indeed, exporting it without any modification after importing it will create a .nif with a TriShape aware of having a "Color" flag, but with all vertices painted in "FF FF FF FF". Basically, at import, Blender .nif Add-on 2.10 is finding the Color flag but is painting all vertices in full white with alpha set to FF instead of retrieving proper painted values.

That happens also when you paint yourself any values on a mesh and export if from Blender : The export is perfect, including for alpha values... However if you try to import your own work again, you'll be loosing the vertices painted values.

Again, thanks very much BadPup if you can find some time to have a look at it <3

I am part of a team of modder working on a total conversion for FO76 meaning a whole new set of plants and grasses thus, of course, getting the ability to have proper import feature for vertex painting would greatly improve our workflow !

BadDogSkyrim commented 1 year ago

Fixed in next release.