Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache.c
| Show First 20 Lines • Show All 929 Lines • ▼ Show 20 Lines | case OB_VOLUME: | ||||
| return NULL; | return NULL; | ||||
| default: | default: | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| } | } | ||||
| int DRW_cache_object_material_count_get(struct Object *ob) | int DRW_cache_object_material_count_get(struct Object *ob) | ||||
| { | { | ||||
| short type = ob->type; | |||||
| Mesh *me = BKE_object_get_evaluated_mesh(ob); | 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) { | switch (type) { | ||||
| case OB_MESH: | case OB_MESH: | ||||
| return DRW_mesh_material_count_get((me != NULL) ? me : ob->data); | return DRW_mesh_material_count_get((me != NULL) ? me : ob->data); | ||||
| case OB_CURVE: | case OB_CURVE: | ||||
| case OB_SURF: | case OB_SURF: | ||||
| case OB_FONT: | case OB_FONT: | ||||
| return DRW_curve_material_count_get(ob->data); | return DRW_curve_material_count_get(ob->data); | ||||
| ▲ Show 20 Lines • Show All 2,680 Lines • Show Last 20 Lines | |||||