Fix T53116: default texture coordinates for volume materials are blank.

Differential Revision: https://developer.blender.org/D2935
This commit is contained in:
José Luis Oliveira Cunha 2017-11-29 19:18:04 +01:00 committed by Bastien Montagne
parent 0f841e24b0
commit 576899b90a
1 changed files with 4 additions and 0 deletions

View File

@ -1131,6 +1131,10 @@ void set_current_material_texture(Material *ma, Tex *newtex)
ma->mtex[act] = BKE_texture_mtex_add();
/* Reset this slot's ON/OFF toggle, for materials, when slot was empty. */
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;