diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-16 05:06:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-16 05:06:50 +0300 |
commit | e322f7a3a244e36f8607674a24e7e356c33c34de (patch) | |
tree | f38ade1a421bf98a9c266d25e973f02c5ca1eaed /source/blender/editors | |
parent | 002752f021a67ff8c4e3f5c488678525b766872a (diff) |
UI: disable shade flat/smooth in sculpt mode
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 6833143dec0..d944d4c4dd3 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1364,7 +1364,15 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) static bool shade_poll(bContext *C) { - return (CTX_data_edit_object(C) == NULL); + ViewLayer *view_layer = CTX_data_view_layer(C); + Object *obact = OBACT(view_layer); + if (obact != NULL) { + /* Doesn't handle edit-data, sculpt dynamic-topology, or their undo systems. */ + if (obact->mode & (OB_MODE_EDIT | OB_MODE_SCULPT)) { + return false; + } + } + return true; } void OBJECT_OT_shade_flat(wmOperatorType *ot) |