blender_niftools_addon
blender_niftools_addon copied to clipboard
Material Export: Alpha
In the documentation it says that enabling Transparency and setting the alpha value in the material will affect the alpha of the exported mesh, however, I found that when I import a nif file and export it again, there is always a NiAlphaProperty in every NiTriShape and the alpha value is always 0, so the mesh is invisible. Transparency is not enabled in the materials in Blender.
Apparently the alpha value from the blender material is reversed. As it is 1.000 by default and in most imported meshes, it is exported as 0.000. If I set it so 0.000 in Blender, it is exported as 1.000, and there is no NiAlphaProperty, unless there is a second vertex color layer (=alpha value of the vertex color) that is not completely white. In objects with no second vertex color layer, no NiAlphaProperty is present after export, however, the alpha values are reversed just the same.
Oh, this one should have been closed.
I know we now only add the NiAlphaProperty as needed, but still need a documentation update as to how to set.
Well, this still happens... I import a mesh (e.g. from Oblivion) without NiAlphaProperty, and on export all materials have their alpha set to 0 and all NiTriShapes have a NiAlphaProperty, resulting in an invisible mesh.
While working through #365 I had to disable alpha support for BSShader based nodes. Doing some research into the high level node system, I think I know what will need to be done here to support the alpha use case and some other node/material property types.