diff options
-rw-r--r-- | source/blender/editors/render/render_shading.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index cf8418bb7b9..10cd1df6d96 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -148,10 +148,18 @@ static bool object_materials_supported_poll_ex(bContext *C, const Object *ob) if (!ED_operator_object_active_local_editable_ex(C, ob)) { return false; } + if (!OB_TYPE_SUPPORT_MATERIAL(ob->type)) { + return false; + } + + /* Material linked to object. */ + if (ob->matbits && ob->actcol && ob->matbits[ob->actcol - 1]) { + return true; + } + + /* Material linked to obdata. */ const ID *data = ob->data; - return (OB_TYPE_SUPPORT_MATERIAL(ob->type) && - /* Object data checks. */ - data && !ID_IS_LINKED(data) && !ID_IS_OVERRIDE_LIBRARY(data)); + return (data && !ID_IS_LINKED(data) && !ID_IS_OVERRIDE_LIBRARY(data)); } static bool object_materials_supported_poll(bContext *C) |