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:
authorTon Roosendaal <ton@blender.org>2011-04-04 17:47:34 +0400
committerTon Roosendaal <ton@blender.org>2011-04-04 17:47:34 +0400
commitf2fd9d11bc9cb7e208a45268203721d45c2223f2 (patch)
tree511125c791cee4633a65bd64fd3ac66893f3d7a7 /source/blender/editors/render
parent36858f63427b02dea2df77708aea591c455fa2ed (diff)
Bugfix #26761
Texture preview render now doesn't increment/decrement material->texture user counts anymore. Blenders library.c code could use some overhaul once to support data relinkage and copying around better. :)
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r--source/blender/editors/render/render_preview.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 73d7fc2abee..239b078a910 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -1117,11 +1117,20 @@ static void shader_preview_free(void *customdata)
if(sp->matcopy) {
struct IDProperty *properties;
+ int a;
+
/* node previews */
shader_preview_updatejob(sp);
/* get rid of copied material */
BLI_remlink(&pr_main->mat, sp->matcopy);
+
+ /* free_material decrements texture, prevent this. hack alert! */
+ for(a=0; a<MAX_MTEX; a++) {
+ MTex *mtex= sp->matcopy->mtex[a];
+ if(mtex && mtex->tex) mtex->tex= NULL;
+ }
+
free_material(sp->matcopy);
properties= IDP_GetProperties((ID *)sp->matcopy, FALSE);