niftools / blender_niftools_addon

The Blender Niftools Addon is a Blender add-on to enable import and export of NetImmese File Formats including .nif, .kf, .egm.
http://www.niftools.org
Other
386 stars 104 forks source link

BS Lighting Shader Object Type information gets lost at export #622

Open Xyotic opened 9 months ago

Xyotic commented 9 months ago

@niftools/blender-niftools-addon-reviewer -

Issue Overview

Exporting an object for Skyrim SE as nif with material settings Shader Type: BS Lighting Shader Property BS Lighting Shader Object Type: ENVIRONMENT_MAP does not work. Settings

When checking the exported .nif inside Nifskope the shader type is set to "Default" Nifskope

This will cause the CreationKit to crash with a fatal error when using the related shader flag "Environment_Mapping"

Version Information

Blender Niftools Addon Version Info

0.1.1

Blender Version Info

3.6.1

Platform information

Windows 10 i9-9900k RTX-2080

Steps to Reproduce

Blend File

TestCube.zip

Nif File

untitled.zip

arcusmaximus commented 8 months ago

For me it crashes Skyrim itself (LE). The problematic line is here: https://github.com/niftools/blender_niftools_addon/blob/master/io_scene_niftools/modules/nif_export/property/shader/__init__.py#L97

bsshader.skyrim_shader_type should be changed to just bsshader.shader_type.