Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-05-28 10:19:41 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-05-28 10:19:41 +0400
commit4b15a54eded7724af3341f4d3fd5a61b3009a209 (patch)
treec9aac251d0c1e0b734d76a1b4afeb7c3a4bc3e17 /source/blender/editors/render/render_shading.c
parenta6005319a7f5fdd317132ea9ce4256f63d60e1f8 (diff)
Fix T40388: 2.70a - Blender Render - Texture Stack - persistent checkbox state.
Reset 'use_texture' flag of a material tex slot when creating/assigning a texture to an empty slot.
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 4166a52691f..79ab300fa7f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -449,6 +449,13 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
* pointer se also increases user, so this compensates it */
tex->id.us--;
+ if (ptr.id.data && GS(((ID *)ptr.id.data)->name) == ID_MA &&
+ RNA_property_pointer_get(&ptr, prop).id.data == NULL) {
+ /* In case we are assigning new texture to a material, and active slot was empty, reset 'use' flag. */
+ Material *ma = (Material *)ptr.id.data;
+ ma->septex &= ~(1 << ma->texact);
+ }
+
RNA_id_pointer_create(&tex->id, &idptr);
RNA_property_pointer_set(&ptr, prop, idptr);
RNA_property_update(C, &ptr, prop);