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

Fix #40 clean mesh tool error when blend v >= 4.1 #41

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion i3d_exporter_additionals/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"author": "T-Bone",
"description": "Additionals For I3D Exporter",
"blender": (3, 5, 0),
"version": (3, 1, 0),
"version": (3, 2, 1),
"location": "View3D > UI > I3D Exporter Additionals",
"warning": "",
"category": "Game Engine"
Expand Down
7 changes: 5 additions & 2 deletions i3d_exporter_additionals/tools/mesh_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ def execute(self, context):
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.tris_convert_to_quads(uvs=True)
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.shade_smooth(use_auto_smooth=True)
bpy.context.object.data.auto_smooth_angle = smooth_radians
if bpy.app.version >= (4, 1, 0):
bpy.ops.object.shade_smooth()
else:
bpy.ops.object.shade_smooth(use_auto_smooth=True)
bpy.context.object.data.auto_smooth_angle = smooth_radians
self.report({'INFO'}, "Object(s) cleaned")
for obj in sel_obj:
obj.select_set(True)
Expand Down