From 28780342eddb0e1e767bf64d69cb99bd138d621f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Jul 2011 00:41:00 +0000 Subject: fix/workaround [#28040] float images reduced to 256 levels per channel upon save Generated images would not be re-generated with a float buffer on load, even when selected on creation. Now save the float buffer setting as a generated image flag. This means you can enable before baking to enable baking to a float buffer. --- source/blender/blenkernel/intern/image.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/image.c') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index c48497c45a1..ab67d7e3f25 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -432,6 +432,7 @@ Image *BKE_add_image_size(unsigned int width, unsigned int height, const char *n ima->gen_x= width; ima->gen_y= height; ima->gen_type= uvtestgrid; + ima->gen_flag |= (floatbuf ? IMA_GEN_FLOAT : 0); ibuf= add_ibuf_size(width, height, name, depth, floatbuf, uvtestgrid, color); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); @@ -2172,7 +2173,7 @@ ImBuf *BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **lock_r) /* UV testgrid or black or solid etc */ if(ima->gen_x==0) ima->gen_x= 1024; if(ima->gen_y==0) ima->gen_y= 1024; - ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 24, 0, ima->gen_type, color); + ibuf= add_ibuf_size(ima->gen_x, ima->gen_y, ima->name, 24, (ima->gen_flag & IMA_GEN_FLOAT) != 0, ima->gen_type, color); image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0); ima->ok= IMA_OK_LOADED; } -- cgit v1.2.3