Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_materials.c
| Show First 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* Return correct material or empty default material if slot is empty. */ | /* Return correct material or empty default material if slot is empty. */ | ||||
| BLI_INLINE Material *eevee_object_material_get(Object *ob, int slot, bool holdout) | BLI_INLINE Material *eevee_object_material_get(Object *ob, int slot, bool holdout) | ||||
| { | { | ||||
| if (holdout) { | if (holdout) { | ||||
| return BKE_material_default_holdout(); | return BKE_material_default_holdout(); | ||||
| } | } | ||||
| Material *ma = BKE_object_material_get(ob, slot + 1); | Material *ma = BKE_object_material_get_eval(ob, slot + 1); | ||||
| if (ma == NULL) { | if (ma == NULL) { | ||||
| if (ob->type == OB_VOLUME) { | if (ob->type == OB_VOLUME) { | ||||
| ma = BKE_material_default_volume(); | ma = BKE_material_default_volume(); | ||||
| } | } | ||||
| else { | else { | ||||
| ma = BKE_material_default_surface(); | ma = BKE_material_default_surface(); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 410 Lines • Show Last 20 Lines | |||||