fix: fix blender 4.2 mesh issue.

- fix issue that blender 4.2 lost use_auto_smooth and calc_split_normals. (it almost works but not perfect. still need more debugging)
- remove depracted material blend_mode. use modern one instead. (the modern setting make me consufes but it works)
This commit is contained in:
2024-07-17 19:45:35 +08:00
parent aa602a7bb8
commit 6940428b88
3 changed files with 12 additions and 13 deletions

View File

@ -403,7 +403,14 @@ def apply_to_blender_material(mtl: bpy.types.Material):
# set some alpha data
mtl.use_backface_culling = not rawdata.mEnableTwoSided
mtl.blend_method = 'BLEND' if rawdata.mEnableAlphaBlend else 'OPAQUE'
if rawdata.mEnableAlphaBlend:
# In old format: mtl.blend_method = 'BLEND'
mtl.surface_render_method = 'BLENDED'
mtl.use_raytrace_refraction = True
else:
# In old format: mtl.blend_method = 'OPAQUE'
mtl.surface_render_method = 'DITHERED'
mtl.use_raytrace_refraction = False
# set texture
if rawdata.mTexture is not None: