diff --git a/Mcblend Source/Materials/Materials.py b/Mcblend Source/Materials/Materials.py index f62ea242..0dad6a6c 100644 --- a/Mcblend Source/Materials/Materials.py +++ b/Mcblend Source/Materials/Materials.py @@ -134,7 +134,7 @@ def fix_world(): scene = bpy.context.scene WProperties = scene.world_properties - if MaterialIn(Alpha_Blend_Materials, material): + if MaterialIn(Alpha_Blend_Materials, material) and WProperties.use_alpha_blend: material.blend_method = 'BLEND' else: material.blend_method = 'HASHED' @@ -159,7 +159,7 @@ def fix_world(): if "Lazy Biome Color Fix" == node.node_tree.name: lbcf_node = node - if (image_texture_node and PBSDF) != None: + if image_texture_node and PBSDF: if GetConnectedSocketTo("Alpha", "BSDF_PRINCIPLED", material) == None: material.node_tree.links.new(image_texture_node.outputs["Alpha"], PBSDF.inputs["Alpha"]) diff --git a/Mcblend Source/Properties.py b/Mcblend Source/Properties.py index 058b67e5..977a12a1 100644 --- a/Mcblend Source/Properties.py +++ b/Mcblend Source/Properties.py @@ -21,6 +21,17 @@ class WorldProperties(PropertyGroup): default=True, ) + def alpha_blend_fix(): # Fix for Eevee Next + if blender_version(">= 4.2.0"): + return False + else: + return True + + use_alpha_blend: BoolProperty( + name="Use Alpha Blend", + default=alpha_blend_fix(), + ) + diff --git a/Mcblend Source/__init__.py b/Mcblend Source/__init__.py index ee6b048f..86fc801a 100644 --- a/Mcblend Source/__init__.py +++ b/Mcblend Source/__init__.py @@ -179,6 +179,9 @@ def draw(self, context): row = box.row() row.prop(WProperties, "lazy_biome_fix") + row = box.row() + row.prop(WProperties, "use_alpha_blend") + row = box.row() row.scale_y = Big_Button_Scale row.operator("world.fix_world", text="Fix World") diff --git a/Mcblend.blend b/Mcblend.blend index 7df3d993..ced5fe45 100644 Binary files a/Mcblend.blend and b/Mcblend.blend differ