[Bf-blender-cvs] [5ec8a9ac27c] master: Fix T53116: default texture coordinates for volume materials are blank.

José Luis Oliveira Cunha noreply at git.blender.org
Wed Nov 29 19:28:01 CET 2017


Commit: 5ec8a9ac27c2dcb654ba3a9057625687136cd87f
Author: José Luis Oliveira Cunha
Date:   Wed Nov 29 19:18:04 2017 +0100
Branches: master
https://developer.blender.org/rB5ec8a9ac27c2dcb654ba3a9057625687136cd87f

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

Differential Revision: https://developer.blender.org/D2935

===================================================================

M	source/blender/blenkernel/intern/texture.c

===================================================================

diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 50bb3a5f10d..122b605f160 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -1165,6 +1165,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;



More information about the Bf-blender-cvs mailing list