diff options
author | Pablo Vazquez <pablovazquez> | 2022-05-11 12:54:14 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2022-05-11 14:21:59 +0300 |
commit | eef98e66cf9e726ae262a7bb7f734d01b9577812 (patch) | |
tree | aa88e5d1a3015eb44ffc9171ead06691a4905333 /release | |
parent | 6bd270f3af7dff3cd3223966b65a9f73a492df1d (diff) |
Mesh: Add Auto Smooth option to Shade Smooth operator
Add a property to the **Shade Smooth** operator to quickly enable the Mesh `use_auto_smooth` option.
The `Angle` property is exposed in the **Adjust Last Operation** panel to make it easy to tweak on multiple objects without having to go to the Properties editor.
The operator is exposed in the `Object` menu and `Object Context Menu`.
=== Demo ===
{F13066173, size=full}
Regarding the implementation, there are multiple ways to go about this (like making a whole new operator altogether), but I think a property is the cleanest/simplest.
I imagine there are simpler ways to achieve this without duplicating the `use_auto_smooth` property in the operator itself (getting it from the Mesh props?), but I couldn't find other operators doing something similar.
Reviewed By: #modeling, mont29
Differential Revision: https://developer.blender.org/D14894
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 7bac7343bca..9ea120616f4 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2346,6 +2346,7 @@ class VIEW3D_MT_object(Menu): layout.separator() layout.operator("object.shade_smooth") + layout.operator("object.shade_smooth", text="Shade Auto Smooth").use_auto_smooth = True layout.operator("object.shade_flat") layout.separator() @@ -2588,7 +2589,8 @@ class VIEW3D_MT_object_context_menu(Menu): # Shared among some object types. if obj is not None: if obj.type in {'MESH', 'CURVE', 'SURFACE'}: - layout.operator("object.shade_smooth", text="Shade Smooth") + layout.operator("object.shade_smooth") + layout.operator("object.shade_smooth", text="Shade Auto Smooth").use_auto_smooth = True layout.operator("object.shade_flat", text="Shade Flat") layout.separator() |