diff options
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 7 |
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); |