blender_niftools_addon icon indicating copy to clipboard operation
blender_niftools_addon copied to clipboard

Material Export: Alpha

Open FeuerTiger86 opened this issue 6 years ago • 4 comments

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.

FeuerTiger86 avatar Jan 09 '19 23:01 FeuerTiger86

Oh, this one should have been closed.

HENDRIX-ZT2 avatar May 20 '20 08:05 HENDRIX-ZT2

I know we now only add the NiAlphaProperty as needed, but still need a documentation update as to how to set.

neomonkeus avatar May 21 '20 10:05 neomonkeus

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.

FeuerTiger86 avatar May 29 '20 18:05 FeuerTiger86

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.

neomonkeus avatar Jun 02 '20 10:06 neomonkeus