Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/texture.c
| Show First 20 Lines • Show All 1,159 Lines • ▼ Show 20 Lines | else { | ||||
| tex = (ma->mtex[act]) ? ma->mtex[act]->tex : NULL; | tex = (ma->mtex[act]) ? ma->mtex[act]->tex : NULL; | ||||
| id_us_min(&tex->id); | id_us_min(&tex->id); | ||||
| if (newtex) { | if (newtex) { | ||||
| if (!ma->mtex[act]) { | if (!ma->mtex[act]) { | ||||
| ma->mtex[act] = BKE_texture_mtex_add(); | ma->mtex[act] = BKE_texture_mtex_add(); | ||||
| /* Reset this slot's ON/OFF toggle, for materials, when slot was empty. */ | /* Reset this slot's ON/OFF toggle, for materials, when slot was empty. */ | ||||
| ma->septex &= ~(1 << act); | ma->septex &= ~(1 << act); | ||||
| /* For volumes the default UV texture coordinates are not available. */ | |||||
| if (ma->material_type == MA_TYPE_VOLUME) { | |||||
| ma->mtex[act]->texco = TEXCO_ORCO; | |||||
| } | |||||
| } | } | ||||
| ma->mtex[act]->tex = newtex; | ma->mtex[act]->tex = newtex; | ||||
| id_us_plus(&newtex->id); | id_us_plus(&newtex->id); | ||||
| } | } | ||||
| else if (ma->mtex[act]) { | else if (ma->mtex[act]) { | ||||
| MEM_freeN(ma->mtex[act]); | MEM_freeN(ma->mtex[act]); | ||||
| ma->mtex[act] = NULL; | ma->mtex[act] = NULL; | ||||
| ▲ Show 20 Lines • Show All 416 Lines • Show Last 20 Lines | |||||