Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2021-01-11 19:32:10 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-01-12 12:03:48 +0300
commitff51afb194493270c93535adc1580ee8eb0cacda (patch)
tree1c13a0db069fc34318df089ce4b5b27ebbd07810 /source/blender/editors/render/render_shading.c
parent55059af01d8bdea7d9c3d3ab313956dd85c106f8 (diff)
Fix T84593: Operators on material (linked to local object but with
linked obdata) fail Caused by rB1a650fdcb286. Above commit made polling more restricitive in that it did not allow for actions on material slots (linked to object, not object data) on objects with liked object data. This should be allowed though. Maniphest Tasks: T84593 https://developer.blender.org/D10078
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c14
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)