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-06-03 09:14:28 +0400
committerDalai Felinto <dfelinto@gmail.com>2014-06-03 09:14:28 +0400
commit6f1a64830ac03d5964580bd912ada80d095f62eb (patch)
tree0d6d8a5966b1336da1a99604c2b6a647c0749834 /source/blender
parent5f3c8cf72d647ef97c275fc03dfc5dd6f3116513 (diff)
Bake-API small cleanup
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/object/object_bake_api.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index b2df61ac209..3f8393e6117 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -356,7 +356,7 @@ static bool bake_object_check(Object *ob, ReportList *reports)
}
/* before even getting in the bake function we check for some basic errors */
-static bool bake_objects_check(Main *bmain, Object *ob, ListBase *objects,
+static bool bake_objects_check(Main *bmain, Object *ob, ListBase *selected_objects,
ReportList *reports, const bool is_selected_to_active)
{
CollectionPointerLink *link;
@@ -370,7 +370,7 @@ static bool bake_objects_check(Main *bmain, Object *ob, ListBase *objects,
if (!bake_object_check(ob, reports))
return false;
- for (link = objects->first; link; link = link->next) {
+ for (link = selected_objects->first; link; link = link->next) {
Object *ob_iter = (Object *)link->ptr.data;
if (ob_iter == ob)
@@ -389,12 +389,12 @@ static bool bake_objects_check(Main *bmain, Object *ob, ListBase *objects,
}
}
else {
- if (BLI_listbase_is_empty(objects)) {
+ if (BLI_listbase_is_empty(selected_objects)) {
BKE_report(reports, RPT_ERROR, "No valid selected objects");
return false;
}
- for (link = objects->first; link; link = link->next) {
+ for (link = selected_objects->first; link; link = link->next) {
if (!bake_object_check(link->ptr.data, reports))
return false;
}
@@ -413,7 +413,7 @@ static void bake_images_clear(Main *bmain, const bool is_tangent)
}
}
-static bool build_image_lookup(Main *bmain, Object *ob, BakeImages *bake_images)
+static void build_image_lookup(Main *bmain, Object *ob, BakeImages *bake_images)
{
const int tot_mat = ob->totcol;
int i, j;
@@ -443,7 +443,6 @@ static bool build_image_lookup(Main *bmain, Object *ob, BakeImages *bake_images)
}
bake_images->size = tot_images;
- return true;
}
/*
@@ -578,8 +577,7 @@ static int bake(
bake_images.data = MEM_callocN(sizeof(BakeImage) * tot_materials, "bake images dimensions (width, height, offset)");
bake_images.lookup = MEM_callocN(sizeof(int) * tot_materials, "bake images lookup (from material to BakeImage)");
- if (!build_image_lookup(bmain, ob_low, &bake_images))
- goto cleanup;
+ build_image_lookup(bmain, ob_low, &bake_images);
if (is_save_internal) {
num_pixels = initialize_internal_images(&bake_images, reports);