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
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-02-23 00:00:45 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-02-23 00:01:30 +0300
commit655faca105863eafd1080d32a753e48dbe3b9164 (patch)
treebcefc1421c88dd81867c1d7f271205a278c0ef4c /source
parente9f738754d19a1c578a2d5139a79904873b58204 (diff)
Fix: Workbench assert on non-image texture node
This was not report, but it would happen if you open the sample file from T61858 and changed to solid view with texture.
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index 921585122dd..5fd4c4a6109 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -225,10 +225,24 @@ void workbench_material_get_image_and_mat(Object *ob, int mat_nr, Image **r_imag
bNode *node;
*r_mat = give_current_material(ob, mat_nr);
ED_object_get_active_image(ob, mat_nr, r_image, NULL, &node, NULL);
- if (node) {
- BLI_assert(node->type == SH_NODE_TEX_IMAGE);
- NodeTexImage *storage = node->storage;
- *r_interp = storage->interpolation;
+ if (node && *r_image) {
+ switch (node->type) {
+ case SH_NODE_TEX_IMAGE:
+ {
+ NodeTexImage *storage = node->storage;
+ *r_interp = storage->interpolation;
+ break;
+ }
+ case SH_NODE_TEX_ENVIRONMENT:
+ {
+ NodeTexEnvironment *storage = node->storage;
+ *r_interp = storage->interpolation;
+ break;
+ }
+ default:
+ BLI_assert(!"Node type not supported by workbench");
+ *r_interp = 0;
+ }
}
else {
*r_interp = 0;