Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.c
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | |||||
| /** \name Shared Operator Poll Functions | /** \name Shared Operator Poll Functions | ||||
| * \{ */ | * \{ */ | ||||
| static bool object_materials_supported_poll_ex(bContext *C, const Object *ob) | static bool object_materials_supported_poll_ex(bContext *C, const Object *ob) | ||||
| { | { | ||||
| if (!ED_operator_object_active_local_editable_ex(C, ob)) { | if (!ED_operator_object_active_local_editable_ex(C, ob)) { | ||||
| return false; | 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; | const ID *data = ob->data; | ||||
| return (OB_TYPE_SUPPORT_MATERIAL(ob->type) && | return (data && !ID_IS_LINKED(data) && !ID_IS_OVERRIDE_LIBRARY(data)); | ||||
| /* Object data checks. */ | |||||
| data && !ID_IS_LINKED(data) && !ID_IS_OVERRIDE_LIBRARY(data)); | |||||
| } | } | ||||
| static bool object_materials_supported_poll(bContext *C) | static bool object_materials_supported_poll(bContext *C) | ||||
| { | { | ||||
| Object *ob = ED_object_context(C); | Object *ob = ED_object_context(C); | ||||
| return object_materials_supported_poll_ex(C, ob); | return object_materials_supported_poll_ex(C, ob); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 2,487 Lines • Show Last 20 Lines | |||||