diff options
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 9 |
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 66ba558c4f4..739723b3af0 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -970,8 +970,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: |