Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy EEVEE blend_method update #2264

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading