Update API for Blender 4.1+ and 5.0 compatibility (v1.4.0)#23
Open
artryazanov wants to merge 2 commits intojohnzero7:masterfrom
Open
Update API for Blender 4.1+ and 5.0 compatibility (v1.4.0)#23artryazanov wants to merge 2 commits intojohnzero7:masterfrom
artryazanov wants to merge 2 commits intojohnzero7:masterfrom
Conversation
…normal handling and node API changes, and bump version to 1.4.0.
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.
Description
This PR updates the addon to ensure full compatibility with modern Blender versions, specifically targeting Blender 5.0.1 (while addressing breaking API changes introduced in Blender 4.0 and 4.1).
The legacy APIs for mesh smoothing, custom split normals, and shader nodes have been heavily refactored or removed in recent Blender updates, causing the previous versions of this addon to fail. This update resolves these issues and bumps the addon version to
1.4.0.Key Changes
1. Mesh & Custom Normals API Update (Blender 4.1+):
use_auto_smooth: Blender 4.1 removed theuse_auto_smoothandauto_smooth_angleproperties from meshes. These have been disabled/removed during the import process (HaydeeImporter.py).mesh.create_normals_split()andmesh.normals_split_custom_set_from_vertices()with the modernmesh.normals_split_custom_set()using loop indices for proper normal assignment on import.calc_smooth_groupsfunction during export (HaydeeExporter.py), preventing export crashes. Replacedto_mesh_clear()withbpy.data.meshes.remove(mesh)for proper cleanup.2. Shader Nodes & Principled BSDF Update (Blender 4.0+):
'Specular'to'Specular IOR Level'to comply with the massive Principled BSDF overhaul in Blender 4.0 (HaydeeNodeMat.py).ShaderNodeSeparateRGBandShaderNodeCombineRGBwith their modern equivalentsShaderNodeSeparateColorandShaderNodeCombineColor. Updated socket references fromR, G, BtoRed, Green, Blue.3. Node Group Interface (Blender 4.0+):
Haydee Normal). The legacynode_tree.inputs.new()method was replaced with the modernnode_tree.interface.new_socket()API, including a fallback check to maintain stability.4. Metadata & Cleanup:
1.4.0and minimum Blender version to5.0.1in__init__.py.README.mdto reflect current version support..idea/to.gitignore.Testing