[Bf-blender-cvs] [6f1a648] master: Bake-API small cleanup

Dalai Felinto noreply at git.blender.org
Tue Jun 3 07:15:13 CEST 2014


Commit: 6f1a64830ac03d5964580bd912ada80d095f62eb
Author: Dalai Felinto
Date:   Tue Jun 3 02:14:28 2014 -0300
https://developer.blender.org/rB6f1a64830ac03d5964580bd912ada80d095f62eb

Bake-API small cleanup

===================================================================

M	source/blender/editors/object/object_bake_api.c

===================================================================

diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index b2df61a..3f8393e 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);




More information about the Bf-blender-cvs mailing list