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:
authorJacques Lucke <jacques@blender.org>2021-03-04 17:27:33 +0300
committerJacques Lucke <jacques@blender.org>2021-03-04 17:27:33 +0300
commit3de5fbba3a984fab1a3f69fea3a62e620f55d4b7 (patch)
treed558660c711733de5da484b5313b51561eab73e6
parenta988099ee478dd7ab0eca79a24fb6102c5b68f82 (diff)
Fix T86050: use material count from correct data block
See comment in code for more details. Differential Revision: https://developer.blender.org/D10615
-rw-r--r--source/blender/draw/intern/draw_cache.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index fcd626eb92b..f902a95a19a 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -935,8 +935,15 @@ GPUVertBuf *DRW_cache_object_pos_vertbuf_get(Object *ob)
int DRW_cache_object_material_count_get(struct Object *ob)
{
+ short type = ob->type;
+
Mesh *me = BKE_object_get_evaluated_mesh(ob);
- short type = (me != NULL) ? OB_MESH : ob->type;
+ if (me != NULL && type != OB_POINTCLOUD) {
+ /* Some object types (e.g. curves) can have a Curve in ob->data, but will be rendered as mesh.
+ * For point clouds this never happens. Ideally this check would happen at another level and we
+ * would just have to care about ob->data here. */
+ type = OB_MESH;
+ }
switch (type) {
case OB_MESH: