diff --git a/__init__.py b/__init__.py index 50f7d79..50c7f0b 100644 --- a/__init__.py +++ b/__init__.py @@ -331,6 +331,11 @@ class NDPreferences(AddonPreferences): default="GENERAL", ) + enable_auto_smooth: BoolProperty( + name="Enable Auto Smoothing", + default=True, + ) + default_smoothing_angle: EnumProperty( name="Default Smooting Angle", items=[ @@ -469,7 +474,8 @@ def draw_general(self, box): "use_fast_booleans", "recon_poly_solidify", "recon_poly_inscribed", - "enable_right_click_select"] + "enable_right_click_select", + "enable_auto_smooth"] for pref in general_prefs: column = box.column(align=True) diff --git a/bevels/bevel.py b/bevels/bevel.py index 4849473..aa0bc2a 100644 --- a/bevels/bevel.py +++ b/bevels/bevel.py @@ -256,6 +256,9 @@ def summon_old_operator(self, context): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): add_smooth_by_angle(self.target_object) return diff --git a/bevels/edge_bevel.py b/bevels/edge_bevel.py index 2023643..dfefea8 100644 --- a/bevels/edge_bevel.py +++ b/bevels/edge_bevel.py @@ -258,6 +258,9 @@ def summon_old_operator(self, context, mods): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): bpy.ops.object.mode_set(mode='OBJECT') add_smooth_by_angle(self.target_object) diff --git a/bevels/vertex_bevel.py b/bevels/vertex_bevel.py index 6d79857..8876eb3 100644 --- a/bevels/vertex_bevel.py +++ b/bevels/vertex_bevel.py @@ -243,6 +243,9 @@ def prepare_new_operator(self, context): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): bpy.ops.object.mode_set(mode='OBJECT') add_smooth_by_angle(self.target_object) diff --git a/extrusion/profile_extrude.py b/extrusion/profile_extrude.py index a925a19..358468b 100644 --- a/extrusion/profile_extrude.py +++ b/extrusion/profile_extrude.py @@ -213,6 +213,9 @@ def calculate_existing_weighting(self): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): self.smoothing = add_smooth_by_angle(self.target_object) return diff --git a/extrusion/screw.py b/extrusion/screw.py index a4a241c..aa475d9 100644 --- a/extrusion/screw.py +++ b/extrusion/screw.py @@ -227,6 +227,9 @@ def summon_old_operator(self, context, mods): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): add_smooth_by_angle(self.target_object) return diff --git a/extrusion/solidify.py b/extrusion/solidify.py index 34f2efc..628283f 100644 --- a/extrusion/solidify.py +++ b/extrusion/solidify.py @@ -181,6 +181,9 @@ def summon_old_operator(self, context, mods): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): add_smooth_by_angle(self.target_object) return diff --git a/packaging/seams.py b/packaging/seams.py index 9316826..44f5779 100644 --- a/packaging/seams.py +++ b/packaging/seams.py @@ -121,7 +121,7 @@ def invoke(self, context, event): self.base_angle_factor = 15 self.angle = int(get_preferences().default_smoothing_angle) - self.commit_auto_smooth = True + self.commit_auto_smooth = get_preferences().enable_auto_smooth self.angle_input_stream = new_stream() diff --git a/sketch/circularize.py b/sketch/circularize.py index 2941b58..02ab4df 100644 --- a/sketch/circularize.py +++ b/sketch/circularize.py @@ -174,6 +174,9 @@ def prepare_new_operator(self, context): def add_smooth_shading(self, context): + if not get_preferences().enable_auto_smooth: + return + if bpy.app.version >= (4, 1, 0): add_smooth_by_angle(self.target_object) return