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:
authorDalai Felinto <dfelinto@gmail.com>2014-05-30 05:54:57 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-05-30 05:56:57 +0400
commit2a9efa4e5185275d6d16c8348decd6d6b52afab6 (patch)
treed01cbd6210d2bd6d84816d469764316866f8ddb7 /source/blender/render
parentd914d101ecc7f2e70398182978b491c9710ef64b (diff)
Bake-API: Support for batch baking
When "Selected to Active" is not on, we bake all the selected objects. This is the same behaviour we have for Blender Internal. Dev note: I moved most of the validation tests to outside the bake() routine so the function can be called in loop. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D560
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/extern/include/RE_bake.h2
-rw-r--r--source/blender/render/intern/source/bake_api.c22
2 files changed, 9 insertions, 15 deletions
diff --git a/source/blender/render/extern/include/RE_bake.h b/source/blender/render/extern/include/RE_bake.h
index b7cfe47c01b..0f82082911a 100644
--- a/source/blender/render/extern/include/RE_bake.h
+++ b/source/blender/render/extern/include/RE_bake.h
@@ -103,6 +103,6 @@ void RE_bake_normal_world_to_world(
const BakePixel pixel_array[], const int num_pixels, const int depth, float result[],
const BakeNormalSwizzle normal_swizzle[3]);
-void RE_bake_ibuf_clear(struct BakeImages *bake_images, const bool is_tangent);
+void RE_bake_ibuf_clear(struct Image *image, const bool is_tangent);
#endif /* __RE_BAKE_H__ */
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index 43cf6878a81..92b639c9e77 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -774,31 +774,25 @@ void RE_bake_normal_world_to_world(
}
}
-void RE_bake_ibuf_clear(BakeImages *bake_images, const bool is_tangent)
+void RE_bake_ibuf_clear(Image *image, const bool is_tangent)
{
ImBuf *ibuf;
void *lock;
- Image *image;
- int i;
const float vec_alpha[4] = {0.0f, 0.0f, 0.0f, 0.0f};
const float vec_solid[4] = {0.0f, 0.0f, 0.0f, 1.0f};
const float nor_alpha[4] = {0.5f, 0.5f, 1.0f, 0.0f};
const float nor_solid[4] = {0.5f, 0.5f, 1.0f, 1.0f};
- for (i = 0; i < bake_images->size; i ++) {
- image = bake_images->data[i].image;
-
- ibuf = BKE_image_acquire_ibuf(image, NULL, &lock);
- BLI_assert(ibuf);
+ ibuf = BKE_image_acquire_ibuf(image, NULL, &lock);
+ BLI_assert(ibuf);
- if (is_tangent)
- IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
- else
- IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
+ if (is_tangent)
+ IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? nor_alpha : nor_solid);
+ else
+ IMB_rectfill(ibuf, (ibuf->planes == R_IMF_PLANES_RGBA) ? vec_alpha : vec_solid);
- BKE_image_release_ibuf(image, ibuf, lock);
- }
+ BKE_image_release_ibuf(image, ibuf, lock);
}
/* ************************************************************* */