Skip to content

Commit

Permalink
Merge pull request #2264 from KhronosGroup/remove_legacy_eevee
Browse files Browse the repository at this point in the history
Remove legacy EEVEE blend_method update
  • Loading branch information
julienduroure authored Jun 6, 2024
2 parents 3a03e0f + 2ae7a46 commit dc05091
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions addons/io_scene_gltf2/blender/imp/gltf2_blender_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create(gltf, material_idx, vertex_color):

set_extras(mat, pymaterial.extras)
BlenderMaterial.set_double_sided(pymaterial, mat)
BlenderMaterial.set_eevee_blend_method(pymaterial, mat)
BlenderMaterial.set_eevee_surface_render_method(pymaterial, mat)
BlenderMaterial.set_viewport_color(pymaterial, mat, vertex_color)

mat.use_nodes = True
Expand Down Expand Up @@ -79,19 +79,12 @@ def set_double_sided(pymaterial, mat):
mat.use_backface_culling = (pymaterial.double_sided != True)

@staticmethod
def set_eevee_blend_method(pymaterial, mat):
def set_eevee_surface_render_method(pymaterial, mat):
alpha_mode = pymaterial.alpha_mode or 'OPAQUE'
if alpha_mode == 'OPAQUE':
mat.blend_method = 'OPAQUE'
elif alpha_mode == 'BLEND':
mat.blend_method = 'BLEND'
elif alpha_mode == 'MASK':
# Alpha clipping is done with nodes, NOT with the
# blend_method, since the blend_method only affects Eevee
# legacy. Using the CLIP method here just hints to Eevee
# that the alpha is always 0 or 1.
mat.blend_method = 'CLIP'
mat.alpha_threshold = 0.5
if alpha_mode in ['OPAQUE', 'MASK']:
mat.surface_render_method = 'DITHERED'
else:
mat.surface_render_method = 'BLENDED'

@staticmethod
def set_viewport_color(pymaterial, mat, vertex_color):
Expand Down

0 comments on commit dc05091

Please sign in to comment.