Fixed compatibility with Blender version 4.3#8
Open
hentila wants to merge 1 commit intoEatTheFuture:masterfrom
Open
Fixed compatibility with Blender version 4.3#8hentila wants to merge 1 commit intoEatTheFuture:masterfrom
hentila wants to merge 1 commit intoEatTheFuture:masterfrom
Conversation
mat.shadow_method is removed from Blender 4.3
Author
|
Fixes #7 |
marklio
reviewed
Jul 21, 2025
| mat = bpy.data.materials.new(name) | ||
| mat.use_nodes = True | ||
| mat.blend_method = 'HASHED' | ||
| mat.shadow_method = 'HASHED' |
There was a problem hiding this comment.
Instead of removing this, you could create a function that will work in both environments:
def _set_hashed_shadow(mat):
"""
Make a material cast alpha‑hashed (dithered) shadows on
every Blender version that still supports the add‑on.
"""
if hasattr(mat, "shadow_method"): # Blender 2.8 – 3.6
mat.shadow_method = 'HASHED'
elif hasattr(mat, "surface_render_method"): # Blender 4.0 +
# ‘DITHERED’ == hashed transparency in Eevee‑Next
mat.surface_render_method = 'DITHERED'Than call that in place of the removed line. This seems to work as far as 5.0.
|
@hentila I have a comment with a backwards-compatible replacement that seems to work (although I'm unfamiliar with common approaches for this kind of breaking change in blender add-ons. There may be a better pattern I'm unaware of. @cessen For the record, this change gets things working (seemingly) as far as the current 5.0 alphas. I'd love to see this concrete issue fixed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mat.shadow_method is removed from Blender 4.3